More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
UniV3Adapter
Compiler Version
v0.6.9+commit.3e3065ac
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ // File: contracts/SmartRoute/intf/IDODOAdapter.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; interface IDODOAdapter { function sellBase(address to, address pool, bytes memory data) external; function sellQuote(address to, address pool, bytes memory data) external; } // File: contracts/SmartRoute/intf/IUniswapV3SwapCallback.sol /// @title Callback for IUniswapV3PoolActions#swap /// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface interface IUniswapV3SwapCallback { /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap. /// @dev In the implementation you must pay the pool tokens owed for the swap. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped. /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata data ) external; } // File: contracts/SmartRoute/intf/IUniV3.sol interface IUniV3 { function swap( address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes calldata data ) external returns (int256 amount0, int256 amount1); } // File: contracts/intf/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } // File: contracts/lib/SafeMath.sol /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/lib/SafeERC20.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 ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @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. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: contracts/SmartRoute/lib/UniversalERC20.sol library UniversalERC20 { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 private constant ETH_ADDRESS = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); function universalTransfer( IERC20 token, address payable to, uint256 amount ) internal { if (amount > 0) { if (isETH(token)) { to.transfer(amount); } else { token.safeTransfer(to, amount); } } } function universalApproveMax( IERC20 token, address to, uint256 amount ) internal { uint256 allowance = token.allowance(address(this), to); if (allowance < amount) { if (allowance > 0) { token.safeApprove(to, 0); } token.safeApprove(to, uint256(-1)); } } function universalBalanceOf(IERC20 token, address who) internal view returns (uint256) { if (isETH(token)) { return who.balance; } else { return token.balanceOf(who); } } function tokenBalanceOf(IERC20 token, address who) internal view returns (uint256) { return token.balanceOf(who); } function isETH(IERC20 token) internal pure returns (bool) { return token == ETH_ADDRESS; } } // File: contracts/lib/TickMath.sol /// @title Math library for computing sqrt prices from ticks and vice versa /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports /// prices between 2**-128 and 2**128 library TickMath { /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 int24 internal constant MIN_TICK = -887272; /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 int24 internal constant MAX_TICK = -MIN_TICK; /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) uint160 internal constant MIN_SQRT_RATIO = 4295128739; /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; /// @notice Calculates sqrt(1.0001^tick) * 2^96 /// @dev Throws if |tick| > max tick /// @param tick The input tick for the above formula /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) /// at the given tick function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) { uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick)); require(absTick <= uint256(MAX_TICK), 'T'); uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000; if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; if (tick > 0) ratio = type(uint256).max / ratio; // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. // we then downcast because we know the result always fits within 160 bits due to our tick input constraint // we round up in the division so getTickAtSqrtRatio of the output price is always consistent sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)); } /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may /// ever return. /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) { // second inequality must be < because the price can never reach the price at the max tick require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R'); uint256 ratio = uint256(sqrtPriceX96) << 32; uint256 r = ratio; uint256 msb = 0; assembly { let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(5, gt(r, 0xFFFFFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(4, gt(r, 0xFFFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(3, gt(r, 0xFF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(2, gt(r, 0xF)) msb := or(msb, f) r := shr(f, r) } assembly { let f := shl(1, gt(r, 0x3)) msb := or(msb, f) r := shr(f, r) } assembly { let f := gt(r, 0x1) msb := or(msb, f) } if (msb >= 128) r = ratio >> (msb - 127); else r = ratio << (127 - msb); int256 log_2 = (int256(msb) - 128) << 64; assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(63, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(62, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(61, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(60, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(59, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(58, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(57, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(56, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(55, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(54, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(53, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(52, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(51, f)) r := shr(f, r) } assembly { r := shr(127, mul(r, r)) let f := shr(128, r) log_2 := or(log_2, shl(50, f)) } int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128); int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128); tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow; } } // File: contracts/intf/IWETH.sol interface IWETH { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address src, address dst, uint256 wad ) external returns (bool); function deposit() external payable; function withdraw(uint256 wad) external; } // File: contracts/SmartRoute/adapter/UniV3Adapter.sol //import {TickMath} from '@uniswap/v3-core/contracts/libraries/TickMath.sol'; // to adapter like dodo V1 contract UniV3Adapter is IDODOAdapter, IUniswapV3SwapCallback { using SafeMath for uint; // ============ Storage ============ address constant _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public immutable _WETH_; constructor ( address payable weth ) public { _WETH_ = weth; } function _uniV3Swap(address to, address pool, uint160 sqrtX96, bytes memory data) internal { (address fromToken, address toToken, uint24 fee) = abi.decode(data, (address, address, uint24)); uint256 sellAmount = IERC20(fromToken).balanceOf(address(this)); bool zeroForOne = fromToken < toToken; // transfer //IERC20(fromToken).transfer(pool, sellAmount); // swap IUniV3(pool).swap( to, zeroForOne, int256(sellAmount), sqrtX96 == 0 ? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1) : sqrtX96, data ); } function sellBase(address to, address pool, bytes memory moreInfo) external override { (uint160 sqrtX96, bytes memory data) = abi.decode(moreInfo, (uint160, bytes)); _uniV3Swap(to, pool, sqrtX96, data); } function sellQuote(address to, address pool, bytes memory moreInfo) external override { (uint160 sqrtX96, bytes memory data) = abi.decode(moreInfo, (uint160, bytes)); _uniV3Swap(to, pool, sqrtX96, data); } // for uniV3 callback function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata _data ) external override { require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported (address tokenIn, address tokenOut, uint24 fee) = abi.decode(_data, (address, address, uint24)); (bool isExactInput, uint256 amountToPay) = amount0Delta > 0 ? (tokenIn < tokenOut, uint256(amount0Delta)) : (tokenOut < tokenIn, uint256(amount1Delta)); if (isExactInput) { pay(tokenIn, address(this), msg.sender, amountToPay); } else { tokenIn = tokenOut; // swap in/out because exact output swaps are reversed pay(tokenIn, address(this), msg.sender, amountToPay); } } /// @param token The token to pay /// @param payer The entity that must pay /// @param recipient The entity that will receive payment /// @param value The amount to pay function pay( address token, address payer, address recipient, uint256 value ) internal { if (token == _WETH_ && address(this).balance >= value) { // pay with WETH9 IWETH(_WETH_).deposit{value: value}(); // wrap only what is needed to pay IWETH(_WETH_).transfer(recipient, value); } else if (payer == address(this)) { // pay with tokens already in the contract (for the exact input multihop case) SafeERC20.safeTransfer(IERC20(token), recipient, value); } else { // pull payment SafeERC20.safeTransferFrom(IERC20(token), payer, recipient, value); } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address payable","name":"weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"_WETH_","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes","name":"moreInfo","type":"bytes"}],"name":"sellBase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"pool","type":"address"},{"internalType":"bytes","name":"moreInfo","type":"bytes"}],"name":"sellQuote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405234801561001057600080fd5b50604051610b34380380610b3483398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c610a9761009d6000398060995280610312528061035852806103de5250610a976000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630d4eec8f1461005157806330e6ae311461006f5780636f7929f21461006f578063fa461e3314610084575b600080fd5b610059610097565b6040516100669190610894565b60405180910390f35b61008261007d36600461066a565b6100bb565b005b610082610092366004610757565b6100ea565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006060828060200190518101906100d391906107d4565b915091506100e38585848461018a565b5050505050565b60008413806100f95750600083135b61010257600080fd5b60008080610112848601866105df565b9250925092506000806000891361013e57846001600160a01b0316846001600160a01b03161088610155565b836001600160a01b0316856001600160a01b031610895b9150915081156101705761016b85303384610310565b61017f565b83945061017f85303384610310565b505050505050505050565b6000806000838060200190518101906101a39190610629565b9250925092506000836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016101d79190610894565b60206040518083038186803b1580156101ef57600080fd5b505afa158015610203573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102279190610860565b90506000836001600160a01b0316856001600160a01b0316109050876001600160a01b031663128acb088a83858b6001600160a01b031660001461026b578b610291565b8561028a5773fffd8963efd1fc6a506488495d951d5263988d25610291565b6401000276a45b8b6040518663ffffffff1660e01b81526004016102b29594939291906108cc565b6040805180830381600087803b1580156102cb57600080fd5b505af11580156102df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103039190610734565b5050505050505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b03161480156103515750804710155b15610470577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156103b157600080fd5b505af11580156103c5573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb9250610418915085908590600401610929565b602060405180830381600087803b15801561043257600080fd5b505af1158015610446573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046a919061070d565b5061049d565b6001600160a01b0383163014156104915761048c8483836104a3565b61049d565b61049d848484846104fe565b50505050565b6104f98363a9059cbb60e01b84846040516024016104c2929190610929565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261051f565b505050565b61049d846323b872dd60e01b8585856040516024016104c2939291906108a8565b60006060836001600160a01b03168360405161053b9190610878565b6000604051808303816000865af19150503d8060008114610578576040519150601f19603f3d011682016040523d82523d6000602084013e61057d565b606091505b5091509150816105a85760405162461bcd60e51b815260040161059f90610942565b60405180910390fd5b80511561049d57808060200190518101906105c3919061070d565b61049d5760405162461bcd60e51b815260040161059f90610977565b6000806000606084860312156105f3578283fd5b83356105fe81610a38565b9250602084013561060e81610a38565b9150604084013561061e81610a50565b809150509250925092565b60008060006060848603121561063d578283fd5b835161064881610a38565b602085015190935061065981610a38565b604085015190925061061e81610a50565b60008060006060848603121561067e578283fd5b833561068981610a38565b9250602084013561069981610a38565b9150604084013567ffffffffffffffff8111156106b4578182fd5b80850186601f8201126106c5578283fd5b803591506106da6106d5836109e8565b6109c1565b8281528760208484010111156106ee578384fd5b8260208301602083013783602084830101528093505050509250925092565b60006020828403121561071e578081fd5b8151801515811461072d578182fd5b9392505050565b60008060408385031215610746578182fd5b505080516020909101519092909150565b6000806000806060858703121561076c578081fd5b8435935060208501359250604085013567ffffffffffffffff80821115610791578283fd5b81870188601f8201126107a2578384fd5b80359250818311156107b2578384fd5b8860208483010111156107c3578384fd5b959894975050602090940194505050565b600080604083850312156107e6578182fd5b82516107f181610a38565b602084015190925067ffffffffffffffff81111561080d578182fd5b80840185601f82011261081e578283fd5b8051915061082e6106d5836109e8565b828152866020848401011115610842578384fd5b610853836020830160208501610a0c565b8093505050509250929050565b600060208284031215610871578081fd5b5051919050565b6000825161088a818460208701610a0c565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060018060a01b038088168352861515602084015285604084015280851660608401525060a0608083015282518060a08401526109118160c0850160208701610a0c565b601f01601f19169190910160c0019695505050505050565b6001600160a01b03929092168252602082015260400190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60405181810167ffffffffffffffff811182821017156109e057600080fd5b604052919050565b600067ffffffffffffffff8211156109fe578081fd5b50601f01601f191660200190565b60005b83811015610a27578181015183820152602001610a0f565b8381111561049d5750506000910152565b6001600160a01b0381168114610a4d57600080fd5b50565b62ffffff81168114610a4d57600080fdfea2646970667358221220885361f7be72cfeb482c21c81a3aca8d2214a726f527501aa3a1699d16e1b70164736f6c63430006090033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630d4eec8f1461005157806330e6ae311461006f5780636f7929f21461006f578063fa461e3314610084575b600080fd5b610059610097565b6040516100669190610894565b60405180910390f35b61008261007d36600461066a565b6100bb565b005b610082610092366004610757565b6100ea565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b60006060828060200190518101906100d391906107d4565b915091506100e38585848461018a565b5050505050565b60008413806100f95750600083135b61010257600080fd5b60008080610112848601866105df565b9250925092506000806000891361013e57846001600160a01b0316846001600160a01b03161088610155565b836001600160a01b0316856001600160a01b031610895b9150915081156101705761016b85303384610310565b61017f565b83945061017f85303384610310565b505050505050505050565b6000806000838060200190518101906101a39190610629565b9250925092506000836001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016101d79190610894565b60206040518083038186803b1580156101ef57600080fd5b505afa158015610203573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102279190610860565b90506000836001600160a01b0316856001600160a01b0316109050876001600160a01b031663128acb088a83858b6001600160a01b031660001461026b578b610291565b8561028a5773fffd8963efd1fc6a506488495d951d5263988d25610291565b6401000276a45b8b6040518663ffffffff1660e01b81526004016102b29594939291906108cc565b6040805180830381600087803b1580156102cb57600080fd5b505af11580156102df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103039190610734565b5050505050505050505050565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b03161480156103515750804710155b15610470577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156103b157600080fd5b505af11580156103c5573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216935063a9059cbb9250610418915085908590600401610929565b602060405180830381600087803b15801561043257600080fd5b505af1158015610446573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061046a919061070d565b5061049d565b6001600160a01b0383163014156104915761048c8483836104a3565b61049d565b61049d848484846104fe565b50505050565b6104f98363a9059cbb60e01b84846040516024016104c2929190610929565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261051f565b505050565b61049d846323b872dd60e01b8585856040516024016104c2939291906108a8565b60006060836001600160a01b03168360405161053b9190610878565b6000604051808303816000865af19150503d8060008114610578576040519150601f19603f3d011682016040523d82523d6000602084013e61057d565b606091505b5091509150816105a85760405162461bcd60e51b815260040161059f90610942565b60405180910390fd5b80511561049d57808060200190518101906105c3919061070d565b61049d5760405162461bcd60e51b815260040161059f90610977565b6000806000606084860312156105f3578283fd5b83356105fe81610a38565b9250602084013561060e81610a38565b9150604084013561061e81610a50565b809150509250925092565b60008060006060848603121561063d578283fd5b835161064881610a38565b602085015190935061065981610a38565b604085015190925061061e81610a50565b60008060006060848603121561067e578283fd5b833561068981610a38565b9250602084013561069981610a38565b9150604084013567ffffffffffffffff8111156106b4578182fd5b80850186601f8201126106c5578283fd5b803591506106da6106d5836109e8565b6109c1565b8281528760208484010111156106ee578384fd5b8260208301602083013783602084830101528093505050509250925092565b60006020828403121561071e578081fd5b8151801515811461072d578182fd5b9392505050565b60008060408385031215610746578182fd5b505080516020909101519092909150565b6000806000806060858703121561076c578081fd5b8435935060208501359250604085013567ffffffffffffffff80821115610791578283fd5b81870188601f8201126107a2578384fd5b80359250818311156107b2578384fd5b8860208483010111156107c3578384fd5b959894975050602090940194505050565b600080604083850312156107e6578182fd5b82516107f181610a38565b602084015190925067ffffffffffffffff81111561080d578182fd5b80840185601f82011261081e578283fd5b8051915061082e6106d5836109e8565b828152866020848401011115610842578384fd5b610853836020830160208501610a0c565b8093505050509250929050565b600060208284031215610871578081fd5b5051919050565b6000825161088a818460208701610a0c565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060018060a01b038088168352861515602084015285604084015280851660608401525060a0608083015282518060a08401526109118160c0850160208701610a0c565b601f01601f19169190910160c0019695505050505050565b6001600160a01b03929092168252602082015260400190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60405181810167ffffffffffffffff811182821017156109e057600080fd5b604052919050565b600067ffffffffffffffff8211156109fe578081fd5b50601f01601f191660200190565b60005b83811015610a27578181015183820152602001610a0f565b8381111561049d5750506000910152565b6001600160a01b0381168114610a4d57600080fd5b50565b62ffffff81168114610a4d57600080fdfea2646970667358221220885361f7be72cfeb482c21c81a3aca8d2214a726f527501aa3a1699d16e1b70164736f6c63430006090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode Sourcemap
20240:3398:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20467:31;;;:::i;:::-;;;;;;;;;;;;;;;;21329:227;;;;;;;;;:::i;:::-;;21831:882;;;;;;;;;:::i;20467:31::-;;;:::o;21329:227::-;21426:15;21443:17;21475:8;21464:38;;;;;;;;;;;;;;21425:77;;;;21513:35;21524:2;21528:4;21534:7;21543:4;21513:10;:35::i;:::-;21329:227;;;;;:::o;21831:882::-;22012:1;21997:12;:16;:36;;;;22032:1;22017:12;:16;21997:36;21989:45;;;;;;22109:15;;;22158:45;;;;22169:5;22158:45;;;22108:95;;;;;;22217:17;22236:19;22287:1;22272:12;:16;:142;;22383:7;-1:-1:-1;;;;;22372:18:0;:8;-1:-1:-1;;;;;22372:18:0;;22400:12;22272:142;;;22319:8;-1:-1:-1;;;;;22309:18:0;:7;-1:-1:-1;;;;;22309:18:0;;22337:12;22272:142;22216:198;;;;22429:12;22425:281;;;22458:52;22462:7;22479:4;22486:10;22498:11;22458:3;:52::i;:::-;22425:281;;;22564:8;22554:18;;22642:52;22646:7;22663:4;22670:10;22682:11;22642:3;:52::i;:::-;21831:882;;;;;;;;;:::o;20605:716::-;20708:17;20727:15;20744:10;20769:4;20758:44;;;;;;;;;;;;;;20707:95;;;;;;20823:18;20851:9;-1:-1:-1;;;;;20844:27:0;;20880:4;20844:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20823:63;;20897:15;20927:7;-1:-1:-1;;;;;20915:19:0;:9;-1:-1:-1;;;;;20915:19:0;;20897:37;;21049:4;-1:-1:-1;;;;;21042:17:0;;21074:2;21092:10;21125;21152:7;-1:-1:-1;;;;;21152:12:0;21163:1;21152:12;:131;;21276:7;21152:131;;;21185:10;:70;;21228:27;21185:70;;;21198:27;21185:70;21298:4;21042:271;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20605:716;;;;;;;;;:::o;22910:723::-;23063:6;-1:-1:-1;;;;;23054:15:0;:5;-1:-1:-1;;;;;23054:15:0;;:49;;;;;23098:5;23073:21;:30;;23054:49;23050:576;;;23157:6;-1:-1:-1;;;;;23151:21:0;;23180:5;23151:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;23238:40:0;;-1:-1:-1;;;23238:40:0;;-1:-1:-1;;;;;23244:6:0;23238:22;;-1:-1:-1;23238:22:0;;-1:-1:-1;23238:40:0;;-1:-1:-1;23261:9:0;;23272:5;;23238:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23050:576;;;-1:-1:-1;;;;;23300:22:0;;23317:4;23300:22;23296:330;;;23431:55;23461:5;23469:9;23480:5;23431:22;:55::i;:::-;23296:330;;;23548:66;23582:5;23590;23597:9;23608:5;23548:26;:66::i;:::-;22910:723;;;;:::o;6476:211::-;6593:86;6613:5;6643:23;;;6668:2;6672:5;6620:58;;;;;;;;;;;;;;-1:-1:-1;;6620:58:0;;;;;;;;;;;;;;-1:-1:-1;;;;;6620:58:0;-1:-1:-1;;;;;;6620:58:0;;;;;;;;;;6593:19;:86::i;:::-;6476:211;;;:::o;6695:285::-;6839:133;6873:5;6916:27;;;6945:4;6951:2;6955:5;6893:68;;;;;;;;;;;8049:1046;8709:12;8723:23;8758:5;-1:-1:-1;;;;;8750:19:0;8770:4;8750:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8708:67;;;;8794:7;8786:52;;;;-1:-1:-1;;;8786:52:0;;;;;;;;;;;;;;;;;8855:17;;:21;8851:237;;9010:10;8999:30;;;;;;;;;;;;;;8991:85;;;;-1:-1:-1;;;8991:85:0;;;;;;;;2675:521:-1;;;;2828:2;2816:9;2807:7;2803:23;2799:32;2796:2;;;-1:-1;;2834:12;2796:2;230:6;217:20;242:41;277:5;242:41;;;2886:71;-1:-1;2994:2;3041:22;;217:20;242:41;217:20;242:41;;;3002:71;-1:-1;3110:2;3148:22;;2326:20;2351:32;2326:20;2351:32;;;3118:62;;;;2790:406;;;;;;3203:565;;;;3367:2;3355:9;3346:7;3342:23;3338:32;3335:2;;;-1:-1;;3373:12;3335:2;387:6;381:13;399:41;434:5;399:41;;;3544:2;3602:22;;381:13;3425:82;;-1:-1;399:41;381:13;399:41;;;3671:2;3720:22;;2472:13;3552:82;;-1:-1;2490:32;2472:13;2490:32;;3775:595;;;;3922:2;3910:9;3901:7;3897:23;3893:32;3890:2;;;-1:-1;;3928:12;3890:2;85:6;72:20;97:33;124:5;97:33;;;3980:63;-1:-1;4080:2;4119:22;;72:20;97:33;72:20;97:33;;;4088:63;-1:-1;4216:2;4201:18;;4188:32;4240:18;4229:30;;4226:2;;;-1:-1;;4262:12;4226:2;4337:6;4326:9;4322:22;1047:3;1040:4;1032:6;1028:17;1024:27;1014:2;;-1:-1;;1055:12;1014:2;1102:6;1089:20;1075:34;;1124:64;1139:48;1180:6;1139:48;;;1124:64;;;1208:6;1201:5;1194:21;1312:3;4080:2;1303:6;1236;1294:16;;1291:25;1288:2;;;-1:-1;;1319:12;1288:2;13322:6;4080:2;1236:6;1232:17;4080:2;1270:5;1266:16;13299:30;-1:-1;4080:2;13369:6;1270:5;13360:16;;13353:27;4282:72;;;;;;3884:486;;;;;;4377:257;;4489:2;4477:9;4468:7;4464:23;4460:32;4457:2;;;-1:-1;;4495:12;4457:2;533:6;527:13;14121:5;12836:13;12829:21;14099:5;14096:32;14086:2;;-1:-1;;14132:12;14086:2;4547:71;4451:183;-1:-1;;;4451:183;4641:395;;;4771:2;4759:9;4750:7;4746:23;4742:32;4739:2;;;-1:-1;;4777:12;4739:2;-1:-1;;2057:13;;4939:2;4988:22;;;2057:13;;;;;-1:-1;4733:303;5043:611;;;;;5198:2;5186:9;5177:7;5173:23;5169:32;5166:2;;;-1:-1;;5204:12;5166:2;1924:6;1911:20;5256:62;;5355:2;5397:9;5393:22;1911:20;5363:62;;5490:2;5479:9;5475:18;5462:32;5514:18;;5506:6;5503:30;5500:2;;;-1:-1;;5536:12;5500:2;5621:6;5610:9;5606:22;715:3;708:4;700:6;696:17;692:27;682:2;;-1:-1;;723:12;682:2;766:6;753:20;743:30;;5514:18;785:6;782:30;779:2;;;-1:-1;;815:12;779:2;910:3;5355:2;890:17;851:6;876:32;;873:41;870:2;;;-1:-1;;917:12;870:2;5160:494;;;;-1:-1;;5355:2;847:17;;;;-1:-1;;;5160:494;5661:496;;;5802:2;5790:9;5781:7;5777:23;5773:32;5770:2;;;-1:-1;;5808:12;5770:2;2203:6;2197:13;2215:33;2242:5;2215:33;;;5992:2;5977:18;;5971:25;5860:74;;-1:-1;6016:18;6005:30;;6002:2;;;-1:-1;;6038:12;6002:2;6124:6;6113:9;6109:22;1507:3;1500:4;1492:6;1488:17;1484:27;1474:2;;-1:-1;;1515:12;1474:2;1555:6;1549:13;1535:27;;1577:64;1592:48;1633:6;1592:48;;1577:64;1661:6;1654:5;1647:21;1765:3;5992:2;1756:6;1689;1747:16;;1744:25;1741:2;;;-1:-1;;1772:12;1741:2;1792:39;1824:6;5992:2;1723:5;1719:16;5992:2;1689:6;1685:17;1792:39;;;6058:83;;;;;;5764:393;;;;;;6164:263;;6279:2;6267:9;6258:7;6254:23;6250:32;6247:2;;;-1:-1;;6285:12;6247:2;-1:-1;2612:13;;6241:186;-1:-1;6241:186;8464:271;;7175:5;12029:12;7286:52;7331:6;7326:3;7319:4;7312:5;7308:16;7286:52;;;7350:16;;;;;8598:137;-1:-1;;8598:137;8742:222;-1:-1;;;;;13002:54;;;;6505:37;;8869:2;8854:18;;8840:124;8971:444;-1:-1;;;;;13002:54;;;6505:37;;13002:54;;;;9318:2;9303:18;;6505:37;9401:2;9386:18;;7447:36;;;;9154:2;9139:18;;9125:290;9422:736;;4240:18;;13013:42;;;;13006:5;13002:54;6512:3;6505:37;6646:5;12836:13;12829:21;9830:2;9819:9;9815:18;6619:34;7476:5;9911:2;9900:9;9896:18;7447:36;13013:42;8325:5;13002:54;9994:2;9983:9;9979:18;8295:37;;9671:3;10031;10020:9;10016:19;10009:49;6807:5;12029:12;12185:6;9671:3;9660:9;9656:19;12173;6900:52;6945:6;12213:14;9660:9;12213:14;9830:2;6926:5;6922:16;6900:52;;;13755:7;13739:14;-1:-1;;13735:28;6964:39;;;;12213:14;6964:39;;9642:516;-1:-1;;;;;;9642:516;10165:333;-1:-1;;;;;13002:54;;;;6505:37;;10484:2;10469:18;;7447:36;10320:2;10305:18;;10291:207;10505:416;10705:2;10719:47;;;10690:18;;;12173:19;7756:34;12213:14;;;7736:55;7810:12;;;10676:245;10928:416;11128:2;11142:47;;;8061:2;11113:18;;;12173:19;8097:34;12213:14;;;8077:55;-1:-1;;;8152:12;;;8145:34;8198:12;;;11099:245;11351:256;11413:2;11407:9;11439:17;;;11514:18;11499:34;;11535:22;;;11496:62;11493:2;;;11571:1;;11561:12;11493:2;11413;11580:22;11391:216;;-1:-1;11391:216;11614:321;;11757:18;11749:6;11746:30;11743:2;;;-1:-1;;11779:12;11743:2;-1:-1;13755:7;11833:17;-1:-1;;11829:33;11920:4;11910:15;;11680:255;13395:268;13460:1;13467:101;13481:6;13478:1;13475:13;13467:101;;;13548:11;;;13542:18;13529:11;;;13522:39;13503:2;13496:10;13467:101;;;13583:6;13580:1;13577:13;13574:2;;;-1:-1;;13460:1;13630:16;;13623:27;13444:219;13776:117;-1:-1;;;;;13002:54;;13835:35;;13825:2;;13884:1;;13874:12;13825:2;13819:74;;14404:115;13140:8;14489:5;13129:20;14465:5;14462:34;14452:2;;14510:1;;14500:12
Swarm Source
ipfs://885361f7be72cfeb482c21c81a3aca8d2214a726f527501aa3a1699d16e1b701
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 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.