Source Code
Overview
HYPE Balance
HYPE Value
$0.00Latest 25 from a total of 16,859 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deposit From Nat... | 7792917 | 26 mins ago | IN | 500 HYPE | 0.00003313 | ||||
Deposit From Nat... | 7792206 | 38 mins ago | IN | 20.2 HYPE | 0.00001815 | ||||
Deposit From Nat... | 7788587 | 1 hr ago | IN | 0.000311 HYPE | 0.00176899 | ||||
Deposit From Nat... | 7788427 | 1 hr ago | IN | 0.000312 HYPE | 0.0007353 | ||||
Deposit From Nat... | 7787655 | 1 hr ago | IN | 4.1 HYPE | 0.00001815 | ||||
Deposit From Nat... | 7785209 | 2 hrs ago | IN | 10.5 HYPE | 0.00004803 | ||||
Deposit From Nat... | 7783975 | 2 hrs ago | IN | 10 HYPE | 0.00001987 | ||||
Deposit From Nat... | 7783683 | 2 hrs ago | IN | 100 HYPE | 0.00002989 | ||||
Deposit From Nat... | 7781103 | 3 hrs ago | IN | 10 HYPE | 0.00001997 | ||||
Deposit From Nat... | 7778546 | 4 hrs ago | IN | 2,035 HYPE | 0.00002455 | ||||
Deposit From Nat... | 7778399 | 4 hrs ago | IN | 0.5 HYPE | 0.00061621 | ||||
Deposit From Nat... | 7778317 | 4 hrs ago | IN | 2.5 HYPE | 0.00002904 | ||||
Deposit From Nat... | 7778178 | 4 hrs ago | IN | 2.6 HYPE | 0.00005446 | ||||
Deposit From Nat... | 7776302 | 4 hrs ago | IN | 30 HYPE | 0.00001896 | ||||
Deposit From Nat... | 7774350 | 5 hrs ago | IN | 0.1 HYPE | 0.00002178 | ||||
Deposit From Nat... | 7774220 | 5 hrs ago | IN | 0.1 HYPE | 0.00005446 | ||||
Deposit From Nat... | 7774008 | 5 hrs ago | IN | 0.1 HYPE | 0.00003631 | ||||
Deposit From Nat... | 7773866 | 5 hrs ago | IN | 95 HYPE | 0.00002178 | ||||
Deposit From Nat... | 7773797 | 5 hrs ago | IN | 88 HYPE | 0.00002178 | ||||
Deposit From Nat... | 7773728 | 5 hrs ago | IN | 0.1 HYPE | 0.00002178 | ||||
Deposit From Nat... | 7773642 | 5 hrs ago | IN | 37 HYPE | 0.00003086 | ||||
Deposit From Nat... | 7773475 | 5 hrs ago | IN | 1 HYPE | 0.00002153 | ||||
Deposit From Nat... | 7770029 | 6 hrs ago | IN | 200 HYPE | 0.00002178 | ||||
Deposit From Nat... | 7767446 | 7 hrs ago | IN | 3 HYPE | 0.00001822 | ||||
Deposit From Nat... | 7767054 | 7 hrs ago | IN | 500 HYPE | 0.00001656 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
7792917 | 26 mins ago | 500 HYPE | ||||
7792206 | 38 mins ago | 20.2 HYPE | ||||
7788587 | 1 hr ago | 0.000311 HYPE | ||||
7788427 | 1 hr ago | 0.000312 HYPE | ||||
7787655 | 1 hr ago | 4.1 HYPE | ||||
7785209 | 2 hrs ago | 10.5 HYPE | ||||
7783975 | 2 hrs ago | 10 HYPE | ||||
7783683 | 2 hrs ago | 100 HYPE | ||||
7781103 | 3 hrs ago | 10 HYPE | ||||
7778546 | 4 hrs ago | 2,035 HYPE | ||||
7778399 | 4 hrs ago | 0.5 HYPE | ||||
7778317 | 4 hrs ago | 2.5 HYPE | ||||
7778178 | 4 hrs ago | 2.6 HYPE | ||||
7776302 | 4 hrs ago | 30 HYPE | ||||
7774350 | 5 hrs ago | 0.1 HYPE | ||||
7774220 | 5 hrs ago | 0.1 HYPE | ||||
7774008 | 5 hrs ago | 0.1 HYPE | ||||
7773866 | 5 hrs ago | 95 HYPE | ||||
7773797 | 5 hrs ago | 88 HYPE | ||||
7773728 | 5 hrs ago | 0.1 HYPE | ||||
7773642 | 5 hrs ago | 37 HYPE | ||||
7773475 | 5 hrs ago | 1 HYPE | ||||
7770029 | 6 hrs ago | 200 HYPE | ||||
7767446 | 7 hrs ago | 3 HYPE | ||||
7767054 | 7 hrs ago | 500 HYPE |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
DepositWrapper
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 10000 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.25; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IWETH9} from "./interfaces/IWETH9.sol"; import {ISTEXAMM} from "./interfaces/ISTEXAMM.sol"; /** * @notice Native token wrapper to deposit into Stake Exchange AMM. */ contract DepositWrapper { using SafeERC20 for IWETH9; /** * * CUSTOM ERRORS * */ error DepositWrapper__ZeroAddress(); error DepositWrapper__constructor_invalidToken1(); error DepositWrapper__receive_OnlyWETH9(); /** * * IMMUTABLES * */ ISTEXAMM public immutable stex; IWETH9 public immutable weth; /** * * CONSTRUCTOR * */ constructor(address _weth, address _stex) { if (_weth == address(0) || _stex == address(0)) { revert DepositWrapper__ZeroAddress(); } stex = ISTEXAMM(_stex); weth = IWETH9(_weth); if (stex.token1() != _weth) { revert DepositWrapper__constructor_invalidToken1(); } } /** * * EXTERNAL FUNCTIONS * */ receive() external payable { if (msg.sender != address(weth)) { revert DepositWrapper__receive_OnlyWETH9(); } } /** * @notice Helper function which wraps native token before depositing. * @param _minShares Minimum amount of LP token required. * @param _deadline Block timestamp after which this call expires. * @param _recipient Address to mint LP tokens for. * @return shares Amount of LP tokens minted during deposit. */ function depositFromNative(uint256 _minShares, uint256 _deadline, address _recipient) external payable returns (uint256 shares) { if (_recipient == address(0)) revert DepositWrapper__ZeroAddress(); uint256 amount = msg.value; if (amount == 0) return 0; _wrapAndApprove(amount, address(stex)); shares = stex.deposit(amount, _minShares, _deadline, _recipient); } /** * * PRIVATE FUNCTIONS * */ function _wrapAndApprove(uint256 amount, address to) private { weth.deposit{value: amount}(); weth.forceApprove(to, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol) pragma solidity ^0.8.20; import {IERC20} from "./IERC20.sol"; import {IERC165} from "./IERC165.sol"; /** * @title IERC1363 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363]. * * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction. */ interface IERC1363 is IERC20, IERC165 { /* * Note: the ERC-165 identifier for this interface is 0xb0202a11. * 0xb0202a11 === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^ * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^ * bytes4(keccak256('approveAndCall(address,uint256)')) ^ * bytes4(keccak256('approveAndCall(address,uint256,bytes)')) */ /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from the caller's account to `to` * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism * and then calls {IERC1363Receiver-onTransferReceived} on `to`. * @param from The address which you want to send tokens from. * @param to The address which you want to transfer to. * @param value The amount of tokens to be transferred. * @param data Additional data with no specified format, sent in call to `to`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value) external returns (bool); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`. * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. * @param data Additional data with no specified format, sent in call to `spender`. * @return A boolean value indicating whether the operation succeeded unless throwing. */ function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-20 standard as defined in the ERC. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC1363} from "../../../interfaces/IERC1363.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC-20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { /** * @dev An operation with an ERC-20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. * * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client" * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. * * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being * set here. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { safeTransfer(token, to, value); } else if (!token.transferAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * Reverts if the returned value is other than `true`. */ function transferFromAndCallRelaxed( IERC1363 token, address from, address to, uint256 value, bytes memory data ) internal { if (to.code.length == 0) { safeTransferFrom(token, from, to, value); } else if (!token.transferFromAndCall(from, to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when * targeting contracts. * * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}. * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall} * once without retrying, and relies on the returned value to be true. * * Reverts if the returned value is other than `true`. */ function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal { if (to.code.length == 0) { forceApprove(token, to, value); } else if (!token.approveAndCall(to, value, data)) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements. */ function _callOptionalReturn(IERC20 token, bytes memory data) private { uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) // bubble errors if iszero(success) { let ptr := mload(0x40) returndatacopy(ptr, 0, returndatasize()) revert(ptr, returndatasize()) } returnSize := returndatasize() returnValue := mload(0) } if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { bool success; uint256 returnSize; uint256 returnValue; assembly ("memory-safe") { success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20) returnSize := returndatasize() returnValue := mload(0) } return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.2.0) (utils/Address.sol) pragma solidity ^0.8.20; import {Errors} from "./Errors.sol"; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert Errors.InsufficientBalance(address(this).balance, amount); } (bool success, bytes memory returndata) = recipient.call{value: amount}(""); if (!success) { _revert(returndata); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {Errors.FailedCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert Errors.InsufficientBalance(address(this).balance, value); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case * of an unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {Errors.FailedCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly ("memory-safe") { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert Errors.FailedCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol) pragma solidity ^0.8.20; /** * @dev Collection of common custom errors used in multiple contracts * * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library. * It is recommended to avoid relying on the error API for critical functionality. * * _Available since v5.1._ */ library Errors { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error InsufficientBalance(uint256 balance, uint256 needed); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedCall(); /** * @dev The deployment failed. */ error FailedDeployment(); /** * @dev A necessary precompile is missing. */ error MissingPrecompile(address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; import { ALMLiquidityQuoteInput, ALMLiquidityQuote } from '../structs/SovereignALMStructs.sol'; /** @title Sovereign ALM interface @notice All ALMs bound to a Sovereign Pool must implement it. */ interface ISovereignALM { /** @notice Called by the Sovereign pool to request a liquidity quote from the ALM. @param _almLiquidityQuoteInput Contains fundamental data about the swap. @param _externalContext Data received by the pool from the user. @param _verifierData Verification data received by the pool from the verifier module @return almLiquidityQuote Liquidity quote containing tokenIn and tokenOut amounts filled. */ function getLiquidityQuote( ALMLiquidityQuoteInput memory _almLiquidityQuoteInput, bytes calldata _externalContext, bytes calldata _verifierData ) external returns (ALMLiquidityQuote memory); /** @notice Callback function for `depositLiquidity` . @param _amount0 Amount of token0 being deposited. @param _amount1 Amount of token1 being deposited. @param _data Context data passed by the ALM, while calling `depositLiquidity`. */ function onDepositLiquidityCallback(uint256 _amount0, uint256 _amount1, bytes memory _data) external; /** @notice Callback to ALM after swap into liquidity pool. @dev Only callable by pool. @param _isZeroToOne Direction of swap. @param _amountIn Amount of tokenIn in swap. @param _amountOut Amount of tokenOut in swap. */ function onSwapCallback(bool _isZeroToOne, uint256 _amountIn, uint256 _amountOut) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; struct ALMLiquidityQuoteInput { bool isZeroToOne; uint256 amountInMinusFee; uint256 feeInBips; address sender; address recipient; address tokenOutSwap; } struct ALMLiquidityQuote { bool isCallbackOnSwap; uint256 amountOut; uint256 amountInFilled; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; /** @notice Struct returned by the swapFeeModule during the getSwapFeeInBips call. * feeInBips: The swap fee in bips. * internalContext: Arbitrary bytes context data. */ struct SwapFeeModuleData { uint256 feeInBips; bytes internalContext; } interface ISwapFeeModuleMinimal { /** @notice Returns the swap fee in bips for both Universal & Sovereign Pools. @param _tokenIn The address of the token that the user wants to swap. @param _tokenOut The address of the token that the user wants to receive. @param _amountIn The amount of tokenIn being swapped. @param _user The address of the user. @param _swapFeeModuleContext Arbitrary bytes data which can be sent to the swap fee module. @return swapFeeModuleData A struct containing the swap fee in bips, and internal context data. */ function getSwapFeeInBips( address _tokenIn, address _tokenOut, uint256 _amountIn, address _user, bytes memory _swapFeeModuleContext ) external returns (SwapFeeModuleData memory swapFeeModuleData); } interface ISwapFeeModule is ISwapFeeModuleMinimal { /** @notice Callback function called by the pool after the swap has finished. ( Universal Pools ) @param _effectiveFee The effective fee charged for the swap. @param _spotPriceTick The spot price tick after the swap. @param _amountInUsed The amount of tokenIn used for the swap. @param _amountOut The amount of the tokenOut transferred to the user. @param _swapFeeModuleData The context data returned by getSwapFeeInBips. */ function callbackOnSwapEnd( uint256 _effectiveFee, int24 _spotPriceTick, uint256 _amountInUsed, uint256 _amountOut, SwapFeeModuleData memory _swapFeeModuleData ) external; /** @notice Callback function called by the pool after the swap has finished. ( Sovereign Pools ) @param _effectiveFee The effective fee charged for the swap. @param _amountInUsed The amount of tokenIn used for the swap. @param _amountOut The amount of the tokenOut transferred to the user. @param _swapFeeModuleData The context data returned by getSwapFeeInBips. */ function callbackOnSwapEnd( uint256 _effectiveFee, uint256 _amountInUsed, uint256 _amountOut, SwapFeeModuleData memory _swapFeeModuleData ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import {ISovereignALM} from "@valantis-core/ALM/interfaces/ISovereignALM.sol"; import {ISwapFeeModuleMinimal} from "@valantis-core/swap-fee-modules/interfaces/ISwapFeeModule.sol"; interface ISTEXAMM is ISovereignALM { event SwapFeeModuleProposed(address swapFeeModule, uint256 startTimestamp); event SwapFeeModuleProposalCancelled(); event SwapFeeModuleSet(address swapFeeModule); event WithdrawalModuleProposed(address withdrawalModule, uint256 startTimestamp); event WithdrawalModuleProposalCancelled(); event WithdrawalModuleSet(address withdrawalModule); event PoolManagerFeeSet(uint256 poolManagerFeeBips); event PoolManagerFeesClaimed(uint256 fee0, uint256 fee1); event Token0ReservesUnstaked(uint256 reserve0); event Deposit(address indexed sender, address indexed recipient, uint256 amountToken1, uint256 shares); event Withdraw( address indexed sender, address indexed recipient, uint256 amountToken0, uint256 amountToken1, uint256 shares ); function isLocked() external view returns (bool); function pool() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function poolFeeRecipient1() external view returns (address); function poolFeeRecipient2() external view returns (address); function withdrawalModule() external view returns (address); function pause() external; function unpause() external; function proposeSwapFeeModule(address _swapFeeModule, uint256 _timelockDelay) external; function cancelSwapFeeModuleProposal() external; function setProposedSwapFeeModule() external; function proposeWithdrawalModule(address withdrawalModule_) external; function cancelWithdrawalModuleProposal() external; function setProposedWithdrawalModule() external; function setPoolManagerFeeBips(uint256 _poolManagerFeeBips) external; function claimPoolManagerFees() external; function unstakeToken0Reserves(uint256 _unstakeAmountToken0) external; function supplyToken1Reserves(uint256 _amount1) external; function getAmountOut(address _tokenIn, uint256 _amountIn, bool _isInstantWithdraw) external view returns (uint256 amountOut); function deposit(uint256 _amount, uint256 _minShares, uint256 _deadline, address _recipient) external returns (uint256 shares); function withdraw( uint256 _shares, uint256 _amount0Min, uint256 _amount1Min, uint256 _deadline, address _recipient, bool _unwrapToNativeToken, bool _isInstantWithdrawal ) external returns (uint256 amount0, uint256 amount1); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IWETH9 is IERC20 { function deposit() external payable; function withdraw(uint256) external; }
{ "evmVersion": "cancun", "libraries": {}, "metadata": { "appendCBOR": true, "bytecodeHash": "ipfs", "useLiteralContent": false }, "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "remappings": [ "forge-std/=lib/forge-std/src/", "@valantis-core/=lib/valantis-core/src/", "@openzeppelin/=lib/openzeppelin-contracts/", "@solmate/=lib/solmate/src/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/solmate/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/valantis-core/lib/openzeppelin-contracts/contracts/", "solmate/=lib/solmate/src/", "valantis-core/=lib/valantis-core/src/" ], "viaIR": false }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_stex","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DepositWrapper__ZeroAddress","type":"error"},{"inputs":[],"name":"DepositWrapper__constructor_invalidToken1","type":"error"},{"inputs":[],"name":"DepositWrapper__receive_OnlyWETH9","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"uint256","name":"_minShares","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"depositFromNative","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"stex","outputs":[{"internalType":"contract ISTEXAMM","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c060405234801561000f575f80fd5b506040516107ff3803806107ff83398101604081905261002e9161012a565b6001600160a01b038216158061004b57506001600160a01b038116155b1561006957604051633918a4f360e01b815260040160405180910390fd5b6001600160a01b03808216608081905290831660a08190526040805163d21220a760e01b8152905191929163d21220a7916004808201926020929091908290030181865afa1580156100bd573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e1919061015b565b6001600160a01b03161461010857604051638ca3fa4760e01b815260040160405180910390fd5b505061017b565b80516001600160a01b0381168114610125575f80fd5b919050565b5f806040838503121561013b575f80fd5b6101448361010f565b91506101526020840161010f565b90509250929050565b5f6020828403121561016b575f80fd5b6101748261010f565b9392505050565b60805160a0516106426101bd5f395f818160530152818160c1015281816102bc015261035001525f818161011e015281816101c7015261024501526106425ff3fe608060405260043610610036575f3560e01c80633fc8cef3146100b05780635249b96d1461010d5780638b5fa09a14610140575f80fd5b366100ac573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146100aa576040517fc3dc0f0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b5f80fd5b3480156100bb575f80fd5b506100e37f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b348015610118575f80fd5b506100e37f000000000000000000000000000000000000000000000000000000000000000081565b61015361014e3660046105a7565b610161565b604051908152602001610104565b5f73ffffffffffffffffffffffffffffffffffffffff82166101af576040517f3918a4f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b345f8190036101c1575f9150506102b3565b6101eb817f00000000000000000000000000000000000000000000000000000000000000006102ba565b6040517ffad3cc4b00000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044810185905273ffffffffffffffffffffffffffffffffffffffff84811660648301527f0000000000000000000000000000000000000000000000000000000000000000169063fad3cc4b906084016020604051808303815f875af115801561028b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102af91906105f5565b9150505b9392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836040518263ffffffff1660e01b81526004015f604051808303818588803b158015610320575f80fd5b505af1158015610332573d5f803e3d5ffd5b5061037b93505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001691508390508461037f565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905261040b84826104ae565b6104a8576040805173ffffffffffffffffffffffffffffffffffffffff851660248201525f6044808301919091528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905261049e908590610504565b6104a88482610504565b50505050565b5f805f8060205f8651602088015f8a5af192503d91505f5190508280156104fa575081156104df57806001146104fa565b5f8673ffffffffffffffffffffffffffffffffffffffff163b115b9695505050505050565b5f8060205f8451602086015f885af180610523576040513d5f823e3d81fd5b50505f513d9150811561053a578060011415610554565b73ffffffffffffffffffffffffffffffffffffffff84163b155b156104a8576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240160405180910390fd5b5f805f606084860312156105b9575f80fd5b8335925060208401359150604084013573ffffffffffffffffffffffffffffffffffffffff811681146105ea575f80fd5b809150509250925092565b5f60208284031215610605575f80fd5b505191905056fea264697066735822122000026389014af5413b591ba907d57743a2a3f1d8f4d35b817a6a21d0059a9e9064736f6c63430008190033000000000000000000000000555555555555555555555555555555555555555500000000000000000000000039694eff3b02248929120c73f90347013aec834d
Deployed Bytecode
0x608060405260043610610036575f3560e01c80633fc8cef3146100b05780635249b96d1461010d5780638b5fa09a14610140575f80fd5b366100ac573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000555555555555555555555555555555555555555516146100aa576040517fc3dc0f0000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b5f80fd5b3480156100bb575f80fd5b506100e37f000000000000000000000000555555555555555555555555555555555555555581565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b348015610118575f80fd5b506100e37f00000000000000000000000039694eff3b02248929120c73f90347013aec834d81565b61015361014e3660046105a7565b610161565b604051908152602001610104565b5f73ffffffffffffffffffffffffffffffffffffffff82166101af576040517f3918a4f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b345f8190036101c1575f9150506102b3565b6101eb817f00000000000000000000000039694eff3b02248929120c73f90347013aec834d6102ba565b6040517ffad3cc4b00000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044810185905273ffffffffffffffffffffffffffffffffffffffff84811660648301527f00000000000000000000000039694eff3b02248929120c73f90347013aec834d169063fad3cc4b906084016020604051808303815f875af115801561028b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102af91906105f5565b9150505b9392505050565b7f000000000000000000000000555555555555555555555555555555555555555573ffffffffffffffffffffffffffffffffffffffff1663d0e30db0836040518263ffffffff1660e01b81526004015f604051808303818588803b158015610320575f80fd5b505af1158015610332573d5f803e3d5ffd5b5061037b93505073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000055555555555555555555555555555555555555551691508390508461037f565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905261040b84826104ae565b6104a8576040805173ffffffffffffffffffffffffffffffffffffffff851660248201525f6044808301919091528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905261049e908590610504565b6104a88482610504565b50505050565b5f805f8060205f8651602088015f8a5af192503d91505f5190508280156104fa575081156104df57806001146104fa565b5f8673ffffffffffffffffffffffffffffffffffffffff163b115b9695505050505050565b5f8060205f8451602086015f885af180610523576040513d5f823e3d81fd5b50505f513d9150811561053a578060011415610554565b73ffffffffffffffffffffffffffffffffffffffff84163b155b156104a8576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015260240160405180910390fd5b5f805f606084860312156105b9575f80fd5b8335925060208401359150604084013573ffffffffffffffffffffffffffffffffffffffff811681146105ea575f80fd5b809150509250925092565b5f60208284031215610605575f80fd5b505191905056fea264697066735822122000026389014af5413b591ba907d57743a2a3f1d8f4d35b817a6a21d0059a9e9064736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000555555555555555555555555555555555555555500000000000000000000000039694eff3b02248929120c73f90347013aec834d
-----Decoded View---------------
Arg [0] : _weth (address): 0x5555555555555555555555555555555555555555
Arg [1] : _stex (address): 0x39694eFF3b02248929120c73F90347013Aec834d
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000005555555555555555555555555555555555555555
Arg [1] : 00000000000000000000000039694eff3b02248929120c73f90347013aec834d
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.