Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 30 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Add Route | 21830215 | 3 days ago | IN | 0 ETH | 0.00013781 | ||||
Add Route | 21830214 | 3 days ago | IN | 0 ETH | 0.00013898 | ||||
Add Route | 21830213 | 3 days ago | IN | 0 ETH | 0.00013607 | ||||
Add Route | 21830212 | 3 days ago | IN | 0 ETH | 0.0001435 | ||||
Override Route | 21830135 | 3 days ago | IN | 0 ETH | 0.00005498 | ||||
Add Route | 21830128 | 3 days ago | IN | 0 ETH | 0.00013649 | ||||
Override Route | 21826188 | 3 days ago | IN | 0 ETH | 0.00004769 | ||||
Override Route | 21826187 | 3 days ago | IN | 0 ETH | 0.00004672 | ||||
Add Route | 21825861 | 3 days ago | IN | 0 ETH | 0.00018703 | ||||
Add Route | 21825820 | 3 days ago | IN | 0 ETH | 0.0002045 | ||||
Add Route | 21825625 | 3 days ago | IN | 0 ETH | 0.00018622 | ||||
Add Route | 21781437 | 9 days ago | IN | 0 ETH | 0.0003678 | ||||
Add Route | 21781436 | 9 days ago | IN | 0 ETH | 0.00032924 | ||||
Add Route | 21781435 | 9 days ago | IN | 0 ETH | 0.00031637 | ||||
Add Route | 21781434 | 9 days ago | IN | 0 ETH | 0.00028526 | ||||
Add Route | 21781433 | 9 days ago | IN | 0 ETH | 0.00026849 | ||||
Add Route | 21781432 | 9 days ago | IN | 0 ETH | 0.00029573 | ||||
Add Route | 21781429 | 9 days ago | IN | 0 ETH | 0.00028221 | ||||
Add Route | 21781428 | 9 days ago | IN | 0 ETH | 0.00028805 | ||||
Add Route | 21781427 | 9 days ago | IN | 0 ETH | 0.00027521 | ||||
Add Route | 21781426 | 9 days ago | IN | 0 ETH | 0.00029011 | ||||
Add Route | 21781425 | 9 days ago | IN | 0 ETH | 0.00029096 | ||||
Add Route | 21781424 | 9 days ago | IN | 0 ETH | 0.00028627 | ||||
Add Route | 21781423 | 9 days ago | IN | 0 ETH | 0.00026128 | ||||
Add Route | 21781422 | 9 days ago | IN | 0 ETH | 0.00027746 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
SwapperCurve
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {ICurvePool} from "./interfaces/ICurvePool.sol"; import {SwapperBase} from "./SwapperBase.sol"; struct CurveRoute { IERC20 tokenFrom; IERC20 tokenTo; ICurvePool pool; int128 idFrom; int128 idTo; } interface IWETH9 { function deposit() external payable; function withdraw(uint wad) external; function totalSupply() external view returns (uint); function approve(address guy, uint wad) external returns (bool); function transfer(address dst, uint wad) external returns (bool); function transferFrom( address src, address dst, uint wad ) external returns (bool); } error UnsupportedChain(); contract SwapperCurve is SwapperBase { using SafeERC20 for IERC20; IWETH9 public immutable WETH; address constant ethAddress = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; event RouteAdded( uint32 routeId, IERC20 tokenFrom, IERC20 tokenTo, ICurvePool pool, int128 idFrom, int128 idTo ); event Swap( uint32 routeId, IERC20 tokenFrom, IERC20 tokenTo, ICurvePool pool, int128 idFrom, int128 idTo, uint256 amountIn, uint256 amountOut ); mapping(uint32 => CurveRoute) public routes; uint32 public routesCount = 0; constructor() SwapperBase() { if (block.chainid == 1) { WETH = IWETH9(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); } else if (block.chainid == 8453) { WETH = IWETH9(0x4200000000000000000000000000000000000006); } else { revert UnsupportedChain(); } } function sell(uint32 routeId) public returns (uint256) { CurveRoute memory route = routes[routeId]; uint256 amountIn = route.tokenFrom.balanceOf(msg.sender); route.tokenFrom.safeTransferFrom(msg.sender, address(this), amountIn); if (address(route.tokenFrom) == address(WETH)) { WETH.withdraw(amountIn); route.pool.exchange{value: amountIn}( route.idFrom, route.idTo, amountIn, 0 ); } else { route.tokenFrom.forceApprove(address(route.pool), amountIn); route.pool.exchange(route.idFrom, route.idTo, amountIn, 0); } uint256 amountOut = route.tokenTo.balanceOf(address(this)); route.tokenTo.safeTransfer(msg.sender, amountOut); emit Swap( routeId, route.tokenFrom, route.tokenTo, route.pool, route.idFrom, route.idTo, amountIn, amountOut ); return amountOut; } function previewSell( uint32 routeId, uint256 amountIn ) external view returns (uint256 amountOut) { CurveRoute memory route = routes[routeId]; return route.pool.get_dy(route.idFrom, route.idTo, amountIn); } function approvalNeeded( uint32 routeId ) external view returns (IERC20 token, address who, uint256 amount) { CurveRoute memory route = routes[routeId]; return ( route.tokenFrom, address(this), route.tokenFrom.balanceOf(msg.sender) ); } function addRoute( IERC20 tokenFrom, IERC20 tokenTo, ICurvePool pool, int128 idFrom, int128 idTo ) public onlyRole(DEFAULT_ADMIN_ROLE) returns (uint32 routeId) { emit RouteAdded(routesCount, tokenFrom, tokenTo, pool, idFrom, idTo); routes[routesCount] = CurveRoute( tokenFrom, tokenTo, pool, idFrom, idTo ); routesCount += 1; return routesCount - 1; } function overrideRoute( uint32 routeId, IERC20 tokenFrom, IERC20 tokenTo, ICurvePool pool, int128 idFrom, int128 idTo ) public onlyRole(DEFAULT_ADMIN_ROLE) returns (uint32) { if (routeId >= routesCount) { revert RouteNotFound(); } emit RouteAdded(routeId, tokenFrom, tokenTo, pool, idFrom, idTo); routes[routeId] = CurveRoute(tokenFrom, tokenTo, pool, idFrom, idTo); return routeId; } fallback() external payable { if (msg.sender != address(WETH)) WETH.deposit{value: msg.value}(); } receive() external payable { if (msg.sender != address(WETH)) WETH.deposit{value: msg.value}(); } }
// 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.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 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 { using Address for address; /** * @dev An operation with an ERC20 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. */ 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. */ 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. */ 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 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). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { 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 silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; interface ICurvePool { function exchange( int128 i, int128 j, uint256 _dx, uint256 _min_dy ) external payable; function get_dy( int128 i, int128 j, uint256 dx ) external view returns (uint256 dy); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {ISwapRoute} from "./interfaces/ISwapRoute.sol"; abstract contract SwapperBase is ISwapRoute, AccessControl { using SafeERC20 for IERC20; error UnsupportedChain(); error RouteNotFound(); error UnsufficientBalance(); address private immutable STEAKHOUSE_SIGNER_1 = 0x0D61C8b6CA9669A36F351De3AE335e9689dd9C5b; address private immutable STEAKHOUSE_SMOL_OPS = 0x0000aeB716a0DF7A9A1AAd119b772644Bc089dA8; constructor() { _grantRole(DEFAULT_ADMIN_ROLE, STEAKHOUSE_SIGNER_1); _grantRole(DEFAULT_ADMIN_ROLE, STEAKHOUSE_SMOL_OPS); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } /****************************************** * RECOVER AND UNSTUCK FUNCTIONS ******************************************/ function recover( IERC20 token, address where, uint256 amount ) external onlyRole(DEFAULT_ADMIN_ROLE) { if (amount > token.balanceOf(address(this))) { revert UnsufficientBalance(); } token.safeTransfer(where, amount); } function recover( IERC20 token, address where ) external onlyRole(DEFAULT_ADMIN_ROLE) { token.safeTransfer(where, token.balanceOf(address(this))); } function recoverETH( address payable where, uint256 amount ) external onlyRole(DEFAULT_ADMIN_ROLE) { if (amount > address(this).balance) { revert UnsufficientBalance(); } where.transfer(amount); } function approve( IERC20 token, address where, uint256 amount ) external onlyRole(DEFAULT_ADMIN_ROLE) { token.forceApprove(where, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @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 AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @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 * {FailedInnerCall} 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 AddressInsufficientBalance(address(this)); } (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 {FailedInnerCall}) 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 {FailedInnerCall} 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 {FailedInnerCall}. */ 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol"; interface ISwapRoute { function sell(uint32 routeId) external returns (uint256 amountOut); /* function sell(uint32 routeId, uint256 amountIn) external; function buy( uint32 routeId, uint256 amountOut ) external view returns (uint256 amountIn); */ function previewSell( uint32 routeId, uint256 amountIn ) external returns (uint256 amountOut); function approvalNeeded( uint32 routeId ) external view returns (IERC20 token, address who, uint256 amount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol) pragma solidity ^0.8.20; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev The `account` is missing a role. */ error AccessControlUnauthorizedAccount(address account, bytes32 neededRole); /** * @dev The caller of a function is not the expected one. * * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}. */ error AccessControlBadConfirmation(); /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. */ function renounceRole(bytes32 role, address callerConfirmation) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * 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[EIP 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); }
{ "remappings": [ "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "ds-auth/=lib/dss-psm/lib/dss/lib/ds-token/lib/ds-auth/src/", "ds-math/=lib/dss-psm/lib/dss/lib/ds-token/lib/ds-math/src/", "ds-note/=lib/dss-psm/lib/dss/lib/ds-value/lib/ds-thing/lib/ds-note/src/", "ds-test/=lib/forge-std/lib/ds-test/src/", "ds-thing/=lib/dss-psm/lib/dss/lib/ds-value/lib/ds-thing/src/", "ds-token/=lib/dss-psm/lib/dss/lib/ds-token/src/", "ds-value/=lib/dss-psm/lib/dss/lib/ds-value/src/", "dss-interfaces/=lib/dss-psm/lib/dss-interfaces/src/", "dss-psm/=lib/dss-psm/src/", "dss/=lib/dss-psm/lib/dss/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "morpho-blue-oracles/=lib/morpho-blue-oracles/src/", "@morpho-blue-oracles/=lib/morpho-blue-oracles/", "morpho-blue/=lib/morpho-blue/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/", "@uniswap/v3-periphery/=lib/v3-periphery/", "@uniswap/v3-core/=lib/v3-core/", "@slipstream/=lib/slipstream/", "@ensdomains/=lib/slipstream/node_modules/@ensdomains/", "@nomad-xyz/=lib/slipstream/lib/ExcessivelySafeCall/", "@solidity-parser/=lib/slipstream/node_modules/solhint/node_modules/@solidity-parser/", "ExcessivelySafeCall/=lib/slipstream/lib/ExcessivelySafeCall/src/", "base64-sol/=lib/slipstream/lib/base64/", "base64/=lib/slipstream/lib/base64/", "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/", "hardhat/=lib/slipstream/node_modules/hardhat/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "slipstream/=lib/slipstream/", "solidity-lib/=lib/slipstream/lib/solidity-lib/contracts/", "v3-core/=lib/v3-core/", "v3-periphery/=lib/v3-periphery/contracts/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"RouteNotFound","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"UnsufficientBalance","type":"error"},{"inputs":[],"name":"UnsupportedChain","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"routeId","type":"uint32"},{"indexed":false,"internalType":"contract IERC20","name":"tokenFrom","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"tokenTo","type":"address"},{"indexed":false,"internalType":"contract ICurvePool","name":"pool","type":"address"},{"indexed":false,"internalType":"int128","name":"idFrom","type":"int128"},{"indexed":false,"internalType":"int128","name":"idTo","type":"int128"}],"name":"RouteAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"routeId","type":"uint32"},{"indexed":false,"internalType":"contract IERC20","name":"tokenFrom","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"tokenTo","type":"address"},{"indexed":false,"internalType":"contract ICurvePool","name":"pool","type":"address"},{"indexed":false,"internalType":"int128","name":"idFrom","type":"int128"},{"indexed":false,"internalType":"int128","name":"idTo","type":"int128"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"}],"name":"Swap","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"tokenFrom","type":"address"},{"internalType":"contract IERC20","name":"tokenTo","type":"address"},{"internalType":"contract ICurvePool","name":"pool","type":"address"},{"internalType":"int128","name":"idFrom","type":"int128"},{"internalType":"int128","name":"idTo","type":"int128"}],"name":"addRoute","outputs":[{"internalType":"uint32","name":"routeId","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"routeId","type":"uint32"}],"name":"approvalNeeded","outputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"who","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"where","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"routeId","type":"uint32"},{"internalType":"contract IERC20","name":"tokenFrom","type":"address"},{"internalType":"contract IERC20","name":"tokenTo","type":"address"},{"internalType":"contract ICurvePool","name":"pool","type":"address"},{"internalType":"int128","name":"idFrom","type":"int128"},{"internalType":"int128","name":"idTo","type":"int128"}],"name":"overrideRoute","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"routeId","type":"uint32"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"previewSell","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"where","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"where","type":"address"}],"name":"recover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"where","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"routes","outputs":[{"internalType":"contract IERC20","name":"tokenFrom","type":"address"},{"internalType":"contract IERC20","name":"tokenTo","type":"address"},{"internalType":"contract ICurvePool","name":"pool","type":"address"},{"internalType":"int128","name":"idFrom","type":"int128"},{"internalType":"int128","name":"idTo","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"routesCount","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"routeId","type":"uint32"}],"name":"sell","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60e0604052346200010357730d61c8b6ca9669a36f351de3ae335e9689dd9c5b60805271aeb716a0df7a9a1aad119b772644bc089da860a0526200004262000107565b5060a0516200005a906001600160a01b03166200019c565b5062000066336200019c565b506002805463ffffffff1916905546600103620000c95773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260c0525b6040516113ec908162000205823960805181505060a05181505060c05181818161029f015281816104c801526113420152f35b4661210503620000f15773420000000000000000000000000000000000000660c05262000096565b60405163d21eab3760e01b8152600490fd5b5f80fd5b730d61c8b6ca9669a36f351de3ae335e9689dd9c5b5f8181525f80516020620016118339815191526020527fedf07e26db10def4031c312abfb7ce3fb89c4a385b7a95747666c138ddc2ea795490919060ff166200019857818052816020526040822081835260205260408220600160ff1982541617905533915f80516020620015f18339815191528180a4600190565b5090565b6001600160a01b03165f8181525f8051602062001611833981519152602052604081205490919060ff166200019857818052816020526040822081835260205260408220600160ff1982541617905533915f80516020620015f18339815191528180a460019056fe608060408181526004918236101561002d575b505050361561002557610023611340565b005b610023611340565b5f92833560e01c91826301ffc9a714610dbf575081630cfe725814610cd85781630fc975c614610b745781631ec82cb814610ac6578163248a9ca314610a9c578163263af8e814610a2c5781632f2ff15d14610a0257816336568abe146109bc5781633e0c06291461094557816346f07683146107b25781634ffd23a7146103d5578163648bf7741461032c57816391d14854146102e9578163a217fddf146102ce578163ad5c46481461028a578163d547741f14610247578163e1f21c6714610224578163ec6b635614610134575063fd3269211461010d5780610012565b3461013057816003193601126101305760209063ffffffff600254169051908152f35b5080fd5b82843461022157602091826003193601126101305763ffffffff610156610e12565b1682526001835280822092815161016c81611013565b6080600360018060a01b03968781541697888552806001830154168686015260028201541686850152015480600f0b6060840152811d600f0b9101528151946370a0823160e01b865233908601528085602481875afa92831561021657926101e2575b6060945081519384523090840152820152f35b80925084813d831161020f575b6101f98183611057565b8101031261020b5760609351916101cf565b5f80fd5b503d6101ef565b8251903d90823e3d90fd5b80fd5b83346102215761024461023636610e77565b9161023f610eac565b6111e2565b80f35b91905034610286578060031936011261028657610282913561027d600161026c610e25565b938387528660205286200154610f03565b610fa0565b5080f35b8280fd5b505034610130578160031936011261013057517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50503461013057816003193601126101305751908152602090f35b90503461028657816003193601126102865781602093610307610e25565b92358152808552209060018060a01b03165f52825260ff815f20541690519015158152f35b91905034610286578060031936011261028657610347610e51565b61034f610e25565b90610358610eac565b82516370a0823160e01b815230948101949094526020846024816001600160a01b0385165afa9283156103cc57508492610397575b6102449350611079565b91506020833d82116103c4575b816103b160209383611057565b8101031261020b5761024492519161038d565b3d91506103a4565b513d86823e3d90fd5b83833461013057602092836003193601126102865763ffffffff6103f7610e12565b1690818452600185528284209083519061041082611013565b60018060a01b03908184541693848452826001820154169389810194855260038460028401541692898301938452015493600f91606081019486840b8652608082019660801d840b87528a51988d8a6024816370a0823160e01b9485825233878301525afa998a156107a8578d9a610768575b506104c08e8d868651169051916323b872dd60e01b908301523360248301523060448301528c6064830152606482526104bb82611013565b6110cf565b838351168a857f000000000000000000000000000000000000000000000000000000000000000016918281145f146106cf575050803b156106cb578d809160248f8e90519485938492632e1a7d4d60e01b8452898401525af180156106a757908e916106b7575b5050838651168751860b8951870b90823b156106b3578e51630f7c084960e21b8152600f91820b8682019081529290910b6020830152604082018d90525f6060830152918f9183919082908f90829060800103925af180156106a757918f928f90928f9593610685575b50506024905b868c511694519485938492835230908301525afa9b8c1561067a579b610635575b50918180610100999795937f67a1749b2c7cf898d97abbfef82c510bb2eb4c3f1a9155cac893aa0bbb2cc8ef9b9997956105f68f33848c5116611079565b51169651169251169251810b9351900b9389519687528b870152888601526060850152608084015260a083015260c08201528460e0820152a151908152f35b979593919a50979593918b88813d8311610673575b6106548183611057565b8101031261020b579651999597949693959294919390929091816105b8565b503d61064a565b8b51903d90823e3d90fd5b90929450610694919350611043565b6106a3578b918e918e5f610591565b8c80fd5b8e8e51903d90823e3d90fd5b8f80fd5b6106c090611043565b6106a3578c8f610527565b8d80fd5b6106de925086895116906111e2565b838651168751860b8951870b90823b156106b3578e51630f7c084960e21b8152600f91820b8682019081529290910b6020830152604082018d90525f6060830152918f9183919082908490829060800103925af180156106a757908f93929161074e575b509060248d9392610597565b8d9392919e61075e602492611043565b9e91929350610742565b9d809d9c9b9a508e813d83116107a1575b6107838183611057565b8101031261079d576104c08d9e9d9a9b9c9d519a50610483565b8b80fd5b503d610779565b8c513d8f823e3d90fd5b8383346101305760a0366003190112610130576107cd610e51565b906107d6610e25565b6107de610e3b565b926064359081600f0b9081830361094157908584837f7ed3883046c17bb0b9637b35fb1c1670f2ae1cdbd532a59389a381478ea1b7b86003969589610846610824610e67565b809961082e610eac565b63ffffffff9e8f600254169d8e9551968796876112fe565b0390a187519661085588611013565b60018060a01b0380921688528160208901931683528189890194168452606088019485526080880195600f0b86528a52600160205280888b20975116916bffffffffffffffffffffffff60a01b92838954161788558160018901915116838254161790556002870192511690825416179055516001600160801b0316906001600160801b0319905160801b161791015560025460018382160183811161092e578316809163ffffffff1916176002555f19019282841161091b5750602093505191168152f35b634e487b7160e01b815260118552602490fd5b634e487b7160e01b855260118652602485fd5b8680fd5b90503461028657816003193601126102865780356001600160a01b038116908190036109b85760243591610977610eac565b4783116109aa57508380809381938282156109a1575bf115610997575080f35b51903d90823e3d90fd5b506108fc61098d565b8351639a5ce56160e01b8152fd5b8380fd5b8383346101305780600319360112610130576109d6610e25565b90336001600160a01b038316036109f35750610282919235610fa0565b5163334bd91960e11b81528390fd5b919050346102865780600319360112610286576102829135610a27600161026c610e25565b610f24565b505034610130576020366003190112610130578060a09263ffffffff610a50610e12565b168152600160205220600180841b0390818154169260038360018401541693600284015416920154928151948552602085015283015280600f0b606083015260801d600f0b6080820152f35b90503461028657602036600319011261028657816020936001923581528085522001549051908152f35b83833461013057610ad636610e77565b92610ae2929192610eac565b80516370a0823160e01b815230878201526020816024816001600160a01b0387165afa908115610b6a578691610b35575b508411610b265750610244939450611079565b51639a5ce56160e01b81528590fd5b90506020813d8211610b62575b81610b4f60209383611057565b81010312610b5e575187610b13565b8580fd5b3d9150610b42565b82513d88823e3d90fd5b919050346102865760c036600319011261028657610b90610e12565b92610b99610e25565b90610ba2610e3b565b94606435916001600160a01b038084169182850361022157610bc2610e67565b9360a43580600f0b968782036109b857610bda610eac565b60025463ffffffff8481169c91168c1015610cca57508b937f7ed3883046c17bb0b9637b35fb1c1670f2ae1cdbd532a59389a381478ea1b7b88a879560209f8b9a99968f969c60039e9d610c33938951968796876112fe565b0390a18282519a610c438c611013565b168a52828d8b0195168552818a0195865260608a0196600f0b875260808a019788528b815260018d5220975116916bffffffffffffffffffffffff60a01b92838954161788558160018901915116838254161790556002870192511690825416179055516001600160801b0316906001600160801b0319905160801b161791015551908152f35b8a516302d703d160e61b8152fd5b83833461013057806003193601126101305763ffffffff610cf7610e12565b16825260806020809460018252606484862091855192610d1684611013565b600360018060a01b03808354168652806001840154168787015260028301541691828987015201549384600f0b94856060830152871d600f0b968791015286519586948593635e0d443f60e01b8552840152602483015260243560448301525afa928315610216578093610d8d575b505051908152f35b909192508382813d8311610db8575b610da68183611057565b81010312610221575051908380610d85565b503d610d9c565b849134610286576020366003190112610286573563ffffffff60e01b81168091036102865760209250637965db0b60e01b8114908115610e01575b5015158152f35b6301ffc9a760e01b14905083610dfa565b6004359063ffffffff8216820361020b57565b602435906001600160a01b038216820361020b57565b604435906001600160a01b038216820361020b57565b600435906001600160a01b038216820361020b57565b6084359081600f0b820361020b57565b606090600319011261020b576001600160a01b0390600435828116810361020b5791602435908116810361020b579060443590565b335f9081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604081205460ff1615610ee55750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b805f525f60205260405f20335f5260205260ff60405f20541615610ee55750565b905f9180835282602052604083209160018060a01b03169182845260205260ff604084205416155f14610f9b57808352826020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b905f9180835282602052604083209160018060a01b03169182845260205260ff6040842054165f14610f9b5780835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b60a0810190811067ffffffffffffffff82111761102f57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161102f57604052565b90601f8019910116810190811067ffffffffffffffff82111761102f57604052565b60405163a9059cbb60e01b60208201526001600160a01b039290921660248301526044808301939093529181526110b5916104bb606483611057565b565b9081602091031261020b5751801515810361020b5790565b5f806110f79260018060a01b03169360208151910182865af16110f0611140565b908361117f565b8051908115159182611125575b505061110d5750565b60249060405190635274afe760e01b82526004820152fd5b61113892506020809183010191016110b7565b155f80611104565b3d1561117a573d9067ffffffffffffffff821161102f576040519161116f601f8201601f191660200184611057565b82523d5f602084013e565b606090565b906111a6575080511561119457805190602001fd5b604051630a12f52160e11b8152600490fd5b815115806111d9575b6111b7575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b156111af565b60405163095ea7b360e01b602082018181526001600160a01b03851660248401526044808401969096529482529493909261121e606485611057565b83515f926001600160a01b039291858416918591829182855af190611241611140565b826112cc575b50816112c1575b501561125e575b50505050509050565b60405196602088015216602486015280604486015260448552608085019085821067ffffffffffffffff8311176112ad57506112a293946104bb91604052826110cf565b805f80808080611255565b634e487b7160e01b81526041600452602490fd5b90503b15155f61124e565b805191925081159182156112e4575b5050905f611247565b6112f792506020809183010191016110b7565b5f806112db565b63ffffffff90911681526001600160a01b03918216602082015291811660408301529091166060820152600f91820b608082015291900b60a082015260c00190565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316338190036113755750565b803b1561020b575f60049160405192838092630d0e30db60e41b825234905af180156113ab576113a25750565b6110b590611043565b6040513d5f823e3d90fdfea2646970667358221220ab6caa47ec10b34c788869786a9f0059fd0f386324d2981ccca97542a79c053f64736f6c634300081500332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0dad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5
Deployed Bytecode
0x608060408181526004918236101561002d575b505050361561002557610023611340565b005b610023611340565b5f92833560e01c91826301ffc9a714610dbf575081630cfe725814610cd85781630fc975c614610b745781631ec82cb814610ac6578163248a9ca314610a9c578163263af8e814610a2c5781632f2ff15d14610a0257816336568abe146109bc5781633e0c06291461094557816346f07683146107b25781634ffd23a7146103d5578163648bf7741461032c57816391d14854146102e9578163a217fddf146102ce578163ad5c46481461028a578163d547741f14610247578163e1f21c6714610224578163ec6b635614610134575063fd3269211461010d5780610012565b3461013057816003193601126101305760209063ffffffff600254169051908152f35b5080fd5b82843461022157602091826003193601126101305763ffffffff610156610e12565b1682526001835280822092815161016c81611013565b6080600360018060a01b03968781541697888552806001830154168686015260028201541686850152015480600f0b6060840152811d600f0b9101528151946370a0823160e01b865233908601528085602481875afa92831561021657926101e2575b6060945081519384523090840152820152f35b80925084813d831161020f575b6101f98183611057565b8101031261020b5760609351916101cf565b5f80fd5b503d6101ef565b8251903d90823e3d90fd5b80fd5b83346102215761024461023636610e77565b9161023f610eac565b6111e2565b80f35b91905034610286578060031936011261028657610282913561027d600161026c610e25565b938387528660205286200154610f03565b610fa0565b5080f35b8280fd5b505034610130578160031936011261013057517f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168152602090f35b50503461013057816003193601126101305751908152602090f35b90503461028657816003193601126102865781602093610307610e25565b92358152808552209060018060a01b03165f52825260ff815f20541690519015158152f35b91905034610286578060031936011261028657610347610e51565b61034f610e25565b90610358610eac565b82516370a0823160e01b815230948101949094526020846024816001600160a01b0385165afa9283156103cc57508492610397575b6102449350611079565b91506020833d82116103c4575b816103b160209383611057565b8101031261020b5761024492519161038d565b3d91506103a4565b513d86823e3d90fd5b83833461013057602092836003193601126102865763ffffffff6103f7610e12565b1690818452600185528284209083519061041082611013565b60018060a01b03908184541693848452826001820154169389810194855260038460028401541692898301938452015493600f91606081019486840b8652608082019660801d840b87528a51988d8a6024816370a0823160e01b9485825233878301525afa998a156107a8578d9a610768575b506104c08e8d868651169051916323b872dd60e01b908301523360248301523060448301528c6064830152606482526104bb82611013565b6110cf565b838351168a857f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216918281145f146106cf575050803b156106cb578d809160248f8e90519485938492632e1a7d4d60e01b8452898401525af180156106a757908e916106b7575b5050838651168751860b8951870b90823b156106b3578e51630f7c084960e21b8152600f91820b8682019081529290910b6020830152604082018d90525f6060830152918f9183919082908f90829060800103925af180156106a757918f928f90928f9593610685575b50506024905b868c511694519485938492835230908301525afa9b8c1561067a579b610635575b50918180610100999795937f67a1749b2c7cf898d97abbfef82c510bb2eb4c3f1a9155cac893aa0bbb2cc8ef9b9997956105f68f33848c5116611079565b51169651169251169251810b9351900b9389519687528b870152888601526060850152608084015260a083015260c08201528460e0820152a151908152f35b979593919a50979593918b88813d8311610673575b6106548183611057565b8101031261020b579651999597949693959294919390929091816105b8565b503d61064a565b8b51903d90823e3d90fd5b90929450610694919350611043565b6106a3578b918e918e5f610591565b8c80fd5b8e8e51903d90823e3d90fd5b8f80fd5b6106c090611043565b6106a3578c8f610527565b8d80fd5b6106de925086895116906111e2565b838651168751860b8951870b90823b156106b3578e51630f7c084960e21b8152600f91820b8682019081529290910b6020830152604082018d90525f6060830152918f9183919082908490829060800103925af180156106a757908f93929161074e575b509060248d9392610597565b8d9392919e61075e602492611043565b9e91929350610742565b9d809d9c9b9a508e813d83116107a1575b6107838183611057565b8101031261079d576104c08d9e9d9a9b9c9d519a50610483565b8b80fd5b503d610779565b8c513d8f823e3d90fd5b8383346101305760a0366003190112610130576107cd610e51565b906107d6610e25565b6107de610e3b565b926064359081600f0b9081830361094157908584837f7ed3883046c17bb0b9637b35fb1c1670f2ae1cdbd532a59389a381478ea1b7b86003969589610846610824610e67565b809961082e610eac565b63ffffffff9e8f600254169d8e9551968796876112fe565b0390a187519661085588611013565b60018060a01b0380921688528160208901931683528189890194168452606088019485526080880195600f0b86528a52600160205280888b20975116916bffffffffffffffffffffffff60a01b92838954161788558160018901915116838254161790556002870192511690825416179055516001600160801b0316906001600160801b0319905160801b161791015560025460018382160183811161092e578316809163ffffffff1916176002555f19019282841161091b5750602093505191168152f35b634e487b7160e01b815260118552602490fd5b634e487b7160e01b855260118652602485fd5b8680fd5b90503461028657816003193601126102865780356001600160a01b038116908190036109b85760243591610977610eac565b4783116109aa57508380809381938282156109a1575bf115610997575080f35b51903d90823e3d90fd5b506108fc61098d565b8351639a5ce56160e01b8152fd5b8380fd5b8383346101305780600319360112610130576109d6610e25565b90336001600160a01b038316036109f35750610282919235610fa0565b5163334bd91960e11b81528390fd5b919050346102865780600319360112610286576102829135610a27600161026c610e25565b610f24565b505034610130576020366003190112610130578060a09263ffffffff610a50610e12565b168152600160205220600180841b0390818154169260038360018401541693600284015416920154928151948552602085015283015280600f0b606083015260801d600f0b6080820152f35b90503461028657602036600319011261028657816020936001923581528085522001549051908152f35b83833461013057610ad636610e77565b92610ae2929192610eac565b80516370a0823160e01b815230878201526020816024816001600160a01b0387165afa908115610b6a578691610b35575b508411610b265750610244939450611079565b51639a5ce56160e01b81528590fd5b90506020813d8211610b62575b81610b4f60209383611057565b81010312610b5e575187610b13565b8580fd5b3d9150610b42565b82513d88823e3d90fd5b919050346102865760c036600319011261028657610b90610e12565b92610b99610e25565b90610ba2610e3b565b94606435916001600160a01b038084169182850361022157610bc2610e67565b9360a43580600f0b968782036109b857610bda610eac565b60025463ffffffff8481169c91168c1015610cca57508b937f7ed3883046c17bb0b9637b35fb1c1670f2ae1cdbd532a59389a381478ea1b7b88a879560209f8b9a99968f969c60039e9d610c33938951968796876112fe565b0390a18282519a610c438c611013565b168a52828d8b0195168552818a0195865260608a0196600f0b875260808a019788528b815260018d5220975116916bffffffffffffffffffffffff60a01b92838954161788558160018901915116838254161790556002870192511690825416179055516001600160801b0316906001600160801b0319905160801b161791015551908152f35b8a516302d703d160e61b8152fd5b83833461013057806003193601126101305763ffffffff610cf7610e12565b16825260806020809460018252606484862091855192610d1684611013565b600360018060a01b03808354168652806001840154168787015260028301541691828987015201549384600f0b94856060830152871d600f0b968791015286519586948593635e0d443f60e01b8552840152602483015260243560448301525afa928315610216578093610d8d575b505051908152f35b909192508382813d8311610db8575b610da68183611057565b81010312610221575051908380610d85565b503d610d9c565b849134610286576020366003190112610286573563ffffffff60e01b81168091036102865760209250637965db0b60e01b8114908115610e01575b5015158152f35b6301ffc9a760e01b14905083610dfa565b6004359063ffffffff8216820361020b57565b602435906001600160a01b038216820361020b57565b604435906001600160a01b038216820361020b57565b600435906001600160a01b038216820361020b57565b6084359081600f0b820361020b57565b606090600319011261020b576001600160a01b0390600435828116810361020b5791602435908116810361020b579060443590565b335f9081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604081205460ff1615610ee55750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b805f525f60205260405f20335f5260205260ff60405f20541615610ee55750565b905f9180835282602052604083209160018060a01b03169182845260205260ff604084205416155f14610f9b57808352826020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b905f9180835282602052604083209160018060a01b03169182845260205260ff6040842054165f14610f9b5780835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b60a0810190811067ffffffffffffffff82111761102f57604052565b634e487b7160e01b5f52604160045260245ffd5b67ffffffffffffffff811161102f57604052565b90601f8019910116810190811067ffffffffffffffff82111761102f57604052565b60405163a9059cbb60e01b60208201526001600160a01b039290921660248301526044808301939093529181526110b5916104bb606483611057565b565b9081602091031261020b5751801515810361020b5790565b5f806110f79260018060a01b03169360208151910182865af16110f0611140565b908361117f565b8051908115159182611125575b505061110d5750565b60249060405190635274afe760e01b82526004820152fd5b61113892506020809183010191016110b7565b155f80611104565b3d1561117a573d9067ffffffffffffffff821161102f576040519161116f601f8201601f191660200184611057565b82523d5f602084013e565b606090565b906111a6575080511561119457805190602001fd5b604051630a12f52160e11b8152600490fd5b815115806111d9575b6111b7575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b156111af565b60405163095ea7b360e01b602082018181526001600160a01b03851660248401526044808401969096529482529493909261121e606485611057565b83515f926001600160a01b039291858416918591829182855af190611241611140565b826112cc575b50816112c1575b501561125e575b50505050509050565b60405196602088015216602486015280604486015260448552608085019085821067ffffffffffffffff8311176112ad57506112a293946104bb91604052826110cf565b805f80808080611255565b634e487b7160e01b81526041600452602490fd5b90503b15155f61124e565b805191925081159182156112e4575b5050905f611247565b6112f792506020809183010191016110b7565b5f806112db565b63ffffffff90911681526001600160a01b03918216602082015291811660408301529091166060820152600f91820b608082015291900b60a082015260c00190565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316338190036113755750565b803b1561020b575f60049160405192838092630d0e30db60e41b825234905af180156113ab576113a25750565b6110b590611043565b6040513d5f823e3d90fdfea2646970667358221220ab6caa47ec10b34c788869786a9f0059fd0f386324d2981ccca97542a79c053f64736f6c63430008150033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.