More Info
Private Name Tags
ContractCreator
Latest 8 from a total of 8 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Redeem | 20502213 | 136 days ago | IN | 0 ETH | 0.00046721 | ||||
Set Token | 20502213 | 136 days ago | IN | 0 ETH | 0.00023308 | ||||
Update Weights | 20502213 | 136 days ago | IN | 0 ETH | 0.00079729 | ||||
Redeem | 19212297 | 316 days ago | IN | 0 ETH | 0.00618176 | ||||
Set Token | 19212294 | 316 days ago | IN | 0 ETH | 0.00140335 | ||||
Buy Tokens | 19208679 | 317 days ago | IN | 0 ETH | 0.01072753 | ||||
Buy Tokens | 19208514 | 317 days ago | IN | 0 ETH | 0.01467955 | ||||
Set Token | 19208142 | 317 days ago | IN | 0 ETH | 0.00181446 |
Loading...
Loading
Contract Name:
Index
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// ██╗ ██╗ ██████╗ ██╗ ██╗██╗ ██╗ // ██║ ██║██╔═████╗██║ ██║╚██╗██╔╝ // ███████║██║██╔██║███████║ ╚███╔╝ // ╚════██║████╔╝██║╚════██║ ██╔██╗ // ██║╚██████╔╝ ██║██╔╝ ██╗ // ╚═╝ ╚═════╝ ╚═╝╚═╝ ╚═╝ // Twitter: https://twitter.com/ERC404X // Website: https://404index.xyz/ // Telegram: https://t.me/ERC404Index pragma solidity ^0.8.13; import {Owned} from "solmate/auth/Owned.sol"; import {ERC20} from "solmate/tokens/ERC20.sol"; import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; import {WETH as IWETH} from "solmate/tokens/WETH.sol"; import {IERC404Index} from "./interfaces/IERC404Index.sol"; import {IUniswapV2Router} from "./interfaces/IUniswapV2Router.sol"; import {ISwapRouter} from "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; import {IQuoter} from "@uniswap/v3-periphery/contracts/interfaces/IQuoter.sol"; contract Index is Owned { using SafeTransferLib for ERC20; enum UniswapVersion { V2, V3 } struct IndexComponent { address token; uint8 weight; uint24 fee; UniswapVersion version; } struct TokenAmount { address token; uint256 amount; } event SetERC404Token(address indexed t); event IndexComponentUpdated(address indexed token, uint8 weight); event TokenPurchased(address indexed token, uint256 amount); event TokenRedeemed(address indexed token, uint256 amount); IUniswapV2Router public immutable uniswapV2Router; ISwapRouter public immutable uniswapV3Router; /// @dev enable perfect granularity uint256 public constant MAX_BPS = 1_000_000_000 * 1e18; uint24 public immutable LOW_FEE = 3_000; uint24 public immutable HIGH_FEE = 10_000; address public constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address public constant PANDORA = 0x9E9FbDE7C7a83c43913BddC8779158F1368F0413; address public constant MNRCH = 0x6C061D18D2b5bbfBe8a8D1EEB9ee27eFD544cC5D; address public constant DEFROGS = 0xd555498a524612c67f286dF0e0a9a64a73a7Cdc7; bool public canUpdateWeights = true; address public ERC404Token; uint256 public lastPurchase; // Current implementation mapping(address => IndexComponent) public components; mapping(address => bool) public hasToken; address[] public tokens; address[] public allTokens; constructor( address routerAddressV2, address routerAddressV3 ) Owned(msg.sender) { uniswapV2Router = IUniswapV2Router(routerAddressV2); uniswapV3Router = ISwapRouter(routerAddressV3); components[PANDORA] = IndexComponent({ token: PANDORA, weight: 70, fee: HIGH_FEE, version: UniswapVersion.V3 }); components[MNRCH] = IndexComponent({ token: MNRCH, weight: 20, fee: HIGH_FEE, version: UniswapVersion.V3 }); components[DEFROGS] = IndexComponent({ token: DEFROGS, weight: 10, fee: HIGH_FEE, version: UniswapVersion.V3 }); tokens = [PANDORA, MNRCH, DEFROGS]; allTokens = [PANDORA, MNRCH, DEFROGS]; hasToken[PANDORA] = true; hasToken[MNRCH] = true; hasToken[DEFROGS] = true; ERC20(WETH).approve(routerAddressV2, type(uint256).max); ERC20(WETH).approve(routerAddressV3, type(uint256).max); lastPurchase = block.timestamp; } receive() external payable {} function _requireIsOwner() internal view { require(msg.sender == owner, "!owner"); } function setToken(address newToken) external { _requireIsOwner(); ERC404Token = newToken; ERC20(IERC404Index(ERC404Token).uniswapV2Pair()).approve( address(uniswapV2Router), type(uint256).max ); emit SetERC404Token(newToken); } function buyTokens() external { _requireIsOwner(); uint256 wethBalance = ERC20(WETH).balanceOf(address(this)); uint256 etherBalance = address(this).balance; uint256 totalBalance = wethBalance + etherBalance; if (totalBalance == 0) { return; } uint256 managementFee = (totalBalance * 2) / 100; uint256 purchaseAmount = (totalBalance * 98) / 100; uint256 etherToWithdraw = managementFee - etherBalance; if (etherToWithdraw > 0) { IWETH(payable(WETH)).withdraw(etherToWithdraw); } (bool success, ) = address(owner).call{value: managementFee}(""); require(success); address token; uint256 ethAmount; IndexComponent memory component; for (uint8 i = 0; i < tokens.length; ) { token = tokens[i]; component = components[token]; ethAmount = (component.weight * purchaseAmount) / 100; if (component.version == UniswapVersion.V2) { _purchaseFromV2(token, ethAmount); } else { _purchaseFromV3(token, ethAmount, component.fee); } unchecked { i++; } } lastPurchase = block.timestamp; } function updateWeights(IndexComponent[] calldata newComponents) external { _requireIsOwner(); uint8 totalWeight; for (uint8 i = 0; i < newComponents.length; ) { require(ERC20(newComponents[i].token).totalSupply() > 0, "Not ERC404 token"); totalWeight += newComponents[i].weight; unchecked { i++; } } require(totalWeight == 100, "!valid"); for (uint i = 0; i < allTokens.length; ) { address token = allTokens[i]; delete components[token]; emit IndexComponentUpdated(token, 0); unchecked { i++; } } delete tokens; IndexComponent memory currentComponent; for (uint i = 0; i < newComponents.length; ) { currentComponent = newComponents[i]; components[currentComponent.token] = currentComponent; tokens.push(currentComponent.token); if (!hasToken[currentComponent.token]) { hasToken[currentComponent.token] = true; allTokens.push(currentComponent.token); } emit IndexComponentUpdated( currentComponent.token, currentComponent.weight ); unchecked { i++; } } } function redeem(uint256 amount) external { require(ERC404Token != address(0), "erc is not zero"); require(amount > 0, "!tokens"); uint256 share = (amount * MAX_BPS) / ERC20(ERC404Token).totalSupply(); IERC404Index(ERC404Token).burn(msg.sender, amount); address token; uint256 allocation; uint256 contractBalance; for (uint8 i = 0; i < allTokens.length; ) { token = allTokens[i]; contractBalance = ERC20(token).balanceOf(address(this)); if (contractBalance > 0) { allocation = (contractBalance * share) / MAX_BPS; ERC20(token).transfer(msg.sender, allocation); emit TokenRedeemed(token, allocation); } unchecked { i++; } } } function redemptionAmounts() external view returns (TokenAmount[] memory) { TokenAmount[] memory tokenAmounts = new TokenAmount[](allTokens.length); for (uint8 i = 0; i < allTokens.length; ) { address token = allTokens[i]; tokenAmounts[i].token = token; tokenAmounts[i].amount = ERC20(token).balanceOf(address(this)); unchecked { i++; } } return tokenAmounts; } function currentTokenCount() external view returns (uint256) { return tokens.length; } function totalTokenCount() external view returns (uint256) { return allTokens.length; } function _purchaseFromV2(address token, uint256 amount) internal { address[] memory path = new address[](2); path[0] = WETH; path[1] = token; uint256 balanceBefore = ERC20(token).balanceOf(address(this)); uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens( amount, 0, path, address(this), block.timestamp ); uint256 balanceAfter = ERC20(token).balanceOf(address(this)); emit TokenPurchased(token, balanceAfter - balanceBefore); } function _purchaseFromV3( address token, uint256 amount, uint24 fee ) internal { uint256 balanceBefore = ERC20(token).balanceOf(address(this)); uniswapV3Router.exactInput( ISwapRouter.ExactInputParams({ path: abi.encodePacked(WETH, fee, token), recipient: address(this), deadline: block.timestamp, amountIn: amount, amountOutMinimum: 0 }) ); uint256 balanceAfter = ERC20(token).balanceOf(address(this)); emit TokenPurchased(token, balanceAfter - balanceBefore); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Simple single owner authorization mixin. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol) abstract contract Owned { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event OwnershipTransferred(address indexed user, address indexed newOwner); /*////////////////////////////////////////////////////////////// OWNERSHIP STORAGE //////////////////////////////////////////////////////////////*/ address public owner; modifier onlyOwner() virtual { require(msg.sender == owner, "UNAUTHORIZED"); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _owner) { owner = _owner; emit OwnershipTransferred(address(0), _owner); } /*////////////////////////////////////////////////////////////// OWNERSHIP LOGIC //////////////////////////////////////////////////////////////*/ function transferOwnership(address newOwner) public virtual onlyOwner { owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( ERC20 token, address from, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument. mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "TRANSFER_FAILED"); } function safeApprove( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "APPROVE_FAILED"); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "./ERC20.sol"; import {SafeTransferLib} from "../utils/SafeTransferLib.sol"; /// @notice Minimalist and modern Wrapped Ether implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/WETH.sol) /// @author Inspired by WETH9 (https://github.com/dapphub/ds-weth/blob/master/src/weth9.sol) contract WETH is ERC20("Wrapped Ether", "WETH", 18) { using SafeTransferLib for address; event Deposit(address indexed from, uint256 amount); event Withdrawal(address indexed to, uint256 amount); function deposit() public payable virtual { _mint(msg.sender, msg.value); emit Deposit(msg.sender, msg.value); } function withdraw(uint256 amount) public virtual { _burn(msg.sender, amount); emit Withdrawal(msg.sender, amount); msg.sender.safeTransferETH(amount); } receive() external payable virtual { deposit(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IERC404Index { function burn(address from, uint256 amount) external; function uniswapV2Pair() external returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IUniswapV2Router { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; pragma abicoder v2; import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; /// @title Router token swapping functionality /// @notice Functions for swapping tokens via Uniswap V3 interface ISwapRouter is IUniswapV3SwapCallback { struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } /// @notice Swaps `amountIn` of one token for as much as possible of another token /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata /// @return amountOut The amount of the received token function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); struct ExactInputParams { bytes path; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; } /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata /// @return amountOut The amount of the received token function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); struct ExactOutputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; uint160 sqrtPriceLimitX96; } /// @notice Swaps as little as possible of one token for `amountOut` of another token /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata /// @return amountIn The amount of the input token function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn); struct ExactOutputParams { bytes path; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; } /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed) /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata /// @return amountIn The amount of the input token function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; pragma abicoder v2; /// @title Quoter Interface /// @notice Supports quoting the calculated amounts from exact input or exact output swaps /// @dev These functions are not marked view because they rely on calling non-view functions and reverting /// to compute the result. They are also not gas efficient and should not be called on-chain. interface IQuoter { /// @notice Returns the amount out received for a given exact input swap without executing the swap /// @param path The path of the swap, i.e. each token pair and the pool fee /// @param amountIn The amount of the first token to swap /// @return amountOut The amount of the last token that would be received function quoteExactInput(bytes memory path, uint256 amountIn) external returns (uint256 amountOut); /// @notice Returns the amount out received for a given exact input but for a swap of a single pool /// @param tokenIn The token being swapped in /// @param tokenOut The token being swapped out /// @param fee The fee of the token pool to consider for the pair /// @param amountIn The desired input amount /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap /// @return amountOut The amount of `tokenOut` that would be received function quoteExactInputSingle( address tokenIn, address tokenOut, uint24 fee, uint256 amountIn, uint160 sqrtPriceLimitX96 ) external returns (uint256 amountOut); /// @notice Returns the amount in required for a given exact output swap without executing the swap /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order /// @param amountOut The amount of the last token to receive /// @return amountIn The amount of first token required to be paid function quoteExactOutput(bytes memory path, uint256 amountOut) external returns (uint256 amountIn); /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool /// @param tokenIn The token being swapped in /// @param tokenOut The token being swapped out /// @param fee The fee of the token pool to consider for the pair /// @param amountOut The desired output amount /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap /// @return amountIn The amount required as the input for the swap in order to receive `amountOut` function quoteExactOutputSingle( address tokenIn, address tokenOut, uint24 fee, uint256 amountOut, uint160 sqrtPriceLimitX96 ) external returns (uint256 amountIn); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @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; }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"routerAddressV2","type":"address"},{"internalType":"address","name":"routerAddressV3","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint8","name":"weight","type":"uint8"}],"name":"IndexComponentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"t","type":"address"}],"name":"SetERC404Token","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRedeemed","type":"event"},{"inputs":[],"name":"DEFROGS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC404Token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HIGH_FEE","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOW_FEE","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MNRCH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PANDORA","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"allTokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"canUpdateWeights","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"components","outputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint8","name":"weight","type":"uint8"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"enum Index.UniswapVersion","name":"version","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastPurchase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redemptionAmounts","outputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Index.TokenAmount[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newToken","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokenCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV3Router","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint8","name":"weight","type":"uint8"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"enum Index.UniswapVersion","name":"version","type":"uint8"}],"internalType":"struct Index.IndexComponent[]","name":"newComponents","type":"tuple[]"}],"name":"updateWeights","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
610100604052610bb860c05261271060e0525f805460ff60a01b1916600160a01b1790553480156200002f575f80fd5b5060405162002372380380620023728339810160408190526200005291620006e4565b5f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600160a01b03808316608090815290821660a052604080519182018152739e9fbde7c7a83c43913bddc8779158f1368f041382526046602083015260e05162ffffff16908201526060810160019052739e9fbde7c7a83c43913bddc8779158f1368f04135f526003602090815281517f24ee435fe7fffa52d6784b0b889e61335e0748c5ba356a8b082892cca647d375805492840151604085015162ffffff16600160a81b0262ffffff60a81b1960ff909216600160a01b026001600160a81b03199095166001600160a01b0394909416939093179390931792831682178155606084015190929091839160ff60c01b1990911663ffffffff60a81b1990911617600160c01b836001811115620001af57620001af6200071a565b02179055505060408051608081018252736c061d18d2b5bbfbe8a8d1eeb9ee27efd544cc5d81526014602082015260e05162ffffff169181019190915290506060810160019052736c061d18d2b5bbfbe8a8d1eeb9ee27efd544cc5d5f526003602090815281517f9efea8666b5e06da7002632c0308b784c3745ef68b034588f47a8bf61119b4a2805492840151604085015162ffffff16600160a81b0262ffffff60a81b1960ff909216600160a01b026001600160a81b03199095166001600160a01b0394909416939093179390931792831682178155606084015190929091839160ff60c01b1990911663ffffffff60a81b1990911617600160c01b836001811115620002c257620002c26200071a565b021790555050604080516080810182525f80516020620023528339815191528152600a602082015260e05162ffffff1691810191909152905060608101600190525f80516020620023528339815191525f526003602090815281517fc60e85b190f0fef8867ca4db4d96814ca6673296306959e935af979f91d3135e805492840151604085015162ffffff16600160a81b0262ffffff60a81b1960ff909216600160a01b026001600160a81b03199095166001600160a01b0394909416939093179390931792831682178155606084015190929091839160ff60c01b1990911663ffffffff60a81b1990911617600160c01b836001811115620003c957620003c96200071a565b02179055505060408051606081018252739e9fbde7c7a83c43913bddc8779158f1368f04138152736c061d18d2b5bbfbe8a8d1eeb9ee27efd544cc5d60208201525f80516020620023528339815191529181019190915262000431915060059060036200064a565b5060408051606081018252739e9fbde7c7a83c43913bddc8779158f1368f04138152736c061d18d2b5bbfbe8a8d1eeb9ee27efd544cc5d60208201525f805160206200235283398151915291810191909152620004939060069060036200064a565b50600460208190527f8e4056f7f85b77736003e6c31cd1ebc9ce1faa4fea39e4e52f5bec1f404be2b98054600160ff1991821681179092557ffae6c838369fc58922da880e2fd5e636c6ce2dac419770f13679d003d6ed676e80548216831790555f80516020620023528339815191525f527f29bc2a6fdf4f6600cbc676c6ab32f058e8e1f4192ca9069456f32c5f34d77a2a8054909116909117905560405163095ea7b360e01b81526001600160a01b038416918101919091525f19602482015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29063095ea7b3906044016020604051808303815f875af115801562000591573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620005b791906200072e565b5060405163095ea7b360e01b81526001600160a01b03821660048201525f19602482015273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29063095ea7b3906044016020604051808303815f875af115801562000617573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200063d91906200072e565b5050426002555062000756565b828054828255905f5260205f20908101928215620006a0579160200282015b82811115620006a057825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000669565b50620006ae929150620006b2565b5090565b5b80821115620006ae575f8155600101620006b3565b80516001600160a01b0381168114620006df575f80fd5b919050565b5f8060408385031215620006f6575f80fd5b6200070183620006c8565b91506200071160208401620006c8565b90509250929050565b634e487b7160e01b5f52602160045260245ffd5b5f602082840312156200073f575f80fd5b815180151581146200074f575f80fd5b9392505050565b60805160a05160c05160e051611bb36200079f5f395f61020f01525f61046701525f8181610275015261165e01525f81816101c4015281816105fc015261143f0152611bb35ff3fe608060405260043610610164575f3560e01c8063764912ef116100cd578063ad5c464811610087578063db006a7511610062578063db006a75146104e3578063f2fde38b14610502578063fd6c6a1414610521578063fd967f4714610542575f80fd5b8063ad5c464814610489578063bb90f75e146104b0578063d0febe4c146104cf575f80fd5b8063764912ef146103a85780637965b5f0146103bc5780638757fc0f146103e35780638da5cb5b1461040a5780639bb0f59914610428578063a7d4006d14610456575f80fd5b80632ec06c5a1161011e5780632ec06c5a146102975780633140acc9146102be5780634528f3ec146103265780634f64b2be1461033b5780635f4614ae1461035a578063634282af14610389575f80fd5b806311b639d91461016f578063144fa6d7146101925780631694505e146101b35780631dbd04d8146101fe57806322e11b8e146102455780632c76d7a614610264575f80fd5b3661016b57005b5f80fd5b34801561017a575f80fd5b506005545b6040519081526020015b60405180910390f35b34801561019d575f80fd5b506101b16101ac36600461174a565b610561565b005b3480156101be575f80fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610189565b348015610209575f80fd5b506102317f000000000000000000000000000000000000000000000000000000000000000081565b60405162ffffff9091168152602001610189565b348015610250575f80fd5b506101b161025f36600461176c565b6106ae565b34801561026f575f80fd5b506101e67f000000000000000000000000000000000000000000000000000000000000000081565b3480156102a2575f80fd5b506101e673d555498a524612c67f286df0e0a9a64a73a7cdc781565b3480156102c9575f80fd5b506103166102d836600461174a565b60036020525f90815260409020546001600160a01b0381169060ff600160a01b820481169162ffffff600160a81b82041691600160c01b9091041684565b60405161018994939291906117ef565b348015610331575f80fd5b5061017f60025481565b348015610346575f80fd5b506101e661035536600461183e565b610ad2565b348015610365575f80fd5b505f5461037990600160a01b900460ff1681565b6040519015158152602001610189565b348015610394575f80fd5b506101e66103a336600461183e565b610afa565b3480156103b3575f80fd5b5060065461017f565b3480156103c7575f80fd5b506101e6739e9fbde7c7a83c43913bddc8779158f1368f041381565b3480156103ee575f80fd5b506101e6736c061d18d2b5bbfbe8a8d1eeb9ee27efd544cc5d81565b348015610415575f80fd5b505f546101e6906001600160a01b031681565b348015610433575f80fd5b5061037961044236600461174a565b60046020525f908152604090205460ff1681565b348015610461575f80fd5b506102317f000000000000000000000000000000000000000000000000000000000000000081565b348015610494575f80fd5b506101e673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156104bb575f80fd5b506001546101e6906001600160a01b031681565b3480156104da575f80fd5b506101b1610b09565b3480156104ee575f80fd5b506101b16104fd36600461183e565b610df8565b34801561050d575f80fd5b506101b161051c36600461174a565b6110f5565b34801561052c575f80fd5b50610535611187565b6040516101899190611855565b34801561054d575f80fd5b5061017f6b033b2e3c9fd0803ce800000081565b6105696112f0565b600180546001600160a01b0319166001600160a01b038316908117909155604080516324dead2f60e11b815290516349bd5a5e9160048082019260209290919082900301815f875af11580156105c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105e591906118ac565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f196024830152919091169063095ea7b3906044016020604051808303815f875af1158015610653573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061067791906118c7565b506040516001600160a01b038216907f6fa514daba342957e6cdaa126dbd2a46aa20bd65a5fd4c83b3b3a1303d88f19d905f90a250565b6106b66112f0565b5f805b60ff81168311156107d5575f84848360ff168181106106da576106da6118e6565b6106f0926020608090920201908101915061174a565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561072b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061074f91906118fa565b116107945760405162461bcd60e51b815260206004820152601060248201526f2737ba1022a9219a181a103a37b5b2b760811b60448201526064015b60405180910390fd5b83838260ff168181106107a9576107a96118e6565b90506080020160200160208101906107c19190611926565b6107cb9083611953565b91506001016106b9565b508060ff166064146108125760405162461bcd60e51b8152602060048201526006602482015265085d985b1a5960d21b604482015260640161078b565b5f5b60065481101561089e575f60068281548110610832576108326118e6565b5f918252602080832091909101546001600160a01b031680835260038252604080842080546001600160c81b031916905551928352925082917e6f3c11a03585d1b777f727ab55879672a0c73a67c94eddf39ee818afd0b110910160405180910390a250600101610814565b506108aa60055f611700565b6108d1604080516080810182525f8082526020820181905291810182905290606082015290565b5f5b83811015610acb578484828181106108ed576108ed6118e6565b9050608002018036038101906109039190611994565b80516001600160a01b039081165f9081526003602090815260409182902084518154928601519386015162ffffff16600160a81b0262ffffff60a81b1960ff909516600160a01b026001600160a81b0319909416919095161791909117918216831781556060840151939550859390929091839160ff60c01b191663ffffffff60a81b1990911617600160c01b8360018111156109a2576109a26117db565b0217905550508251600580546001810182555f9182527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b03938416179055845190911681526004602052604090205460ff169050610a7b5781516001600160a01b039081165f9081526004602052604081208054600160ff19909116811790915584516006805492830181559092527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b031916919092161790555b815160208084015160405160ff90911681526001600160a01b03909216917e6f3c11a03585d1b777f727ab55879672a0c73a67c94eddf39ee818afd0b110910160405180910390a26001016108d3565b5050505050565b60058181548110610ae1575f80fd5b5f918252602090912001546001600160a01b0316905081565b60068181548110610ae1575f80fd5b610b116112f0565b6040516370a0823160e01b81523060048201525f9073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906370a0823190602401602060405180830381865afa158015610b60573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8491906118fa565b9050475f610b928284611a26565b9050805f03610ba057505050565b5f6064610bae836002611a39565b610bb89190611a50565b90505f6064610bc8846062611a39565b610bd29190611a50565b90505f610bdf8584611a6f565b90508015610c4857604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d906024015f604051808303815f87803b158015610c31575f80fd5b505af1158015610c43573d5f803e3d5ffd5b505050505b5f80546040516001600160a01b039091169085908381818185875af1925050503d805f8114610c92576040519150601f19603f3d011682016040523d82523d5f602084013e610c97565b606091505b5050905080610ca4575f80fd5b5f80610ccd604080516080810182525f8082526020820181905291810182905290606082015290565b5f5b60055460ff82161015610de75760058160ff1681548110610cf257610cf26118e6565b5f9182526020808320909101546001600160a01b039081168084526003835260409384902084516080810186528154938416815260ff600160a01b850481169582019590955262ffffff600160a81b85041695810195909552909750916060840191600160c01b9004166001811115610d6d57610d6d6117db565b6001811115610d7e57610d7e6117db565b815250509150606487836020015160ff16610d999190611a39565b610da39190611a50565b92505f82606001516001811115610dbc57610dbc6117db565b03610dd057610dcb8484611334565b610ddf565b610ddf84848460400151611561565b600101610ccf565b505042600255505050505050505050565b6001546001600160a01b0316610e425760405162461bcd60e51b815260206004820152600f60248201526e657263206973206e6f74207a65726f60881b604482015260640161078b565b5f8111610e7b5760405162461bcd60e51b815260206004820152600760248201526621746f6b656e7360c81b604482015260640161078b565b600154604080516318160ddd60e01b815290515f926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610ec2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ee691906118fa565b610efc6b033b2e3c9fd0803ce800000084611a39565b610f069190611a50565b600154604051632770a7eb60e21b8152336004820152602481018590529192506001600160a01b031690639dc29fac906044015f604051808303815f87803b158015610f50575f80fd5b505af1158015610f62573d5f803e3d5ffd5b505050505f805f805f90505b60065460ff821610156110ed5760068160ff1681548110610f9157610f916118e6565b5f918252602090912001546040516370a0823160e01b81523060048201526001600160a01b03909116945084906370a0823190602401602060405180830381865afa158015610fe2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061100691906118fa565b915081156110e5576b033b2e3c9fd0803ce80000006110258684611a39565b61102f9190611a50565b60405163a9059cbb60e01b8152336004820152602481018290529093506001600160a01b0385169063a9059cbb906044016020604051808303815f875af115801561107c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110a091906118c7565b50836001600160a01b03167fce4385affa8ad2cbec45b1660c6f6afcb691bf0a7a73ebda096ee1dfb670fe6f846040516110dc91815260200190565b60405180910390a25b600101610f6e565b505050505050565b5f546001600160a01b0316331461113d5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015260640161078b565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6006546060905f9067ffffffffffffffff8111156111a7576111a7611972565b6040519080825280602002602001820160405280156111eb57816020015b604080518082019091525f80825260208201528152602001906001900390816111c55790505b5090505f5b60065460ff821610156112ea575f60068260ff1681548110611214576112146118e6565b905f5260205f20015f9054906101000a90046001600160a01b0316905080838360ff1681518110611247576112476118e6565b60209081029190910101516001600160a01b0391821690526040516370a0823160e01b8152306004820152908216906370a0823190602401602060405180830381865afa15801561129a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112be91906118fa565b838360ff16815181106112d3576112d36118e6565b6020908102919091018101510152506001016111f0565b50919050565b5f546001600160a01b031633146113325760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161078b565b565b6040805160028082526060820183525f9260208301908036833701905050905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2815f8151811061137b5761137b6118e6565b60200260200101906001600160a01b031690816001600160a01b03168152505082816001815181106113af576113af6118e6565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b81523060048201525f918516906370a0823190602401602060405180830381865afa158015611401573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061142591906118fa565b604051635c11d79560e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635c11d7959061147c9086905f90879030904290600401611a82565b5f604051808303815f87803b158015611493575f80fd5b505af11580156114a5573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201525f92506001600160a01b03871691506370a08231906024015b602060405180830381865afa1580156114ee573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061151291906118fa565b90506001600160a01b0385167f55c18555197c6574627cf460c66073d10aa05d412468800b7b71feeaf82ea92d6115498484611a6f565b60405190815260200160405180910390a25050505050565b6040516370a0823160e01b81523060048201525f906001600160a01b038516906370a0823190602401602060405180830381865afa1580156115a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c991906118fa565b6040805160a081018252736015551cd911ff4685072e2793f56c841e3ab66160611b60c08201526001600160e81b031960e886901b1660d4820152606087811b6bffffffffffffffffffffffff191660d7830152825180830360cb01815260eb830184528252306020830152428284015281018690525f6080820152905163c04b8d5960e01b81529192506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163c04b8d599161169191600401611af3565b6020604051808303815f875af11580156116ad573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116d191906118fa565b506040516370a0823160e01b81523060048201525f906001600160a01b038616906370a08231906024016114d3565b5080545f8255905f5260205f209081019061171b919061171e565b50565b5b80821115611732575f815560010161171f565b5090565b6001600160a01b038116811461171b575f80fd5b5f6020828403121561175a575f80fd5b813561176581611736565b9392505050565b5f806020838503121561177d575f80fd5b823567ffffffffffffffff80821115611794575f80fd5b818501915085601f8301126117a7575f80fd5b8135818111156117b5575f80fd5b8660208260071b85010111156117c9575f80fd5b60209290920196919550909350505050565b634e487b7160e01b5f52602160045260245ffd5b6001600160a01b038516815260ff8416602082015262ffffff83166040820152608081016002831061182f57634e487b7160e01b5f52602160045260245ffd5b82606083015295945050505050565b5f6020828403121561184e575f80fd5b5035919050565b602080825282518282018190525f919060409081850190868401855b8281101561189f57815180516001600160a01b03168552860151868501529284019290850190600101611871565b5091979650505050505050565b5f602082840312156118bc575f80fd5b815161176581611736565b5f602082840312156118d7575f80fd5b81518015158114611765575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561190a575f80fd5b5051919050565b803560ff81168114611921575f80fd5b919050565b5f60208284031215611936575f80fd5b61176582611911565b634e487b7160e01b5f52601160045260245ffd5b60ff818116838216019081111561196c5761196c61193f565b92915050565b634e487b7160e01b5f52604160045260245ffd5b803560028110611921575f80fd5b5f608082840312156119a4575f80fd5b6040516080810181811067ffffffffffffffff821117156119d357634e487b7160e01b5f52604160045260245ffd5b60405282356119e181611736565b81526119ef60208401611911565b6020820152604083013562ffffff81168114611a09575f80fd5b6040820152611a1a60608401611986565b60608201529392505050565b8082018082111561196c5761196c61193f565b808202811582820484141761196c5761196c61193f565b5f82611a6a57634e487b7160e01b5f52601260045260245ffd5b500490565b8181038181111561196c5761196c61193f565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b81811015611ad25784516001600160a01b031683529383019391830191600101611aad565b50506001600160a01b03969096166060850152505050608001529392505050565b5f6020808352835160a0602085015280518060c08601525f5b81811015611b285782810184015186820160e001528301611b0c565b505f85820160e0015260208601516001600160a01b038116604087015292506040860151606086015260608601516080860152608086015160a086015260e0601f19601f83011686010193505050509291505056fea26469706673582212200ef8b920494651781d41bb29da7f55e037bc524eecece54050638009925eb90564736f6c63430008160033000000000000000000000000d555498a524612c67f286df0e0a9a64a73a7cdc70000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Deployed Bytecode
0x608060405260043610610164575f3560e01c8063764912ef116100cd578063ad5c464811610087578063db006a7511610062578063db006a75146104e3578063f2fde38b14610502578063fd6c6a1414610521578063fd967f4714610542575f80fd5b8063ad5c464814610489578063bb90f75e146104b0578063d0febe4c146104cf575f80fd5b8063764912ef146103a85780637965b5f0146103bc5780638757fc0f146103e35780638da5cb5b1461040a5780639bb0f59914610428578063a7d4006d14610456575f80fd5b80632ec06c5a1161011e5780632ec06c5a146102975780633140acc9146102be5780634528f3ec146103265780634f64b2be1461033b5780635f4614ae1461035a578063634282af14610389575f80fd5b806311b639d91461016f578063144fa6d7146101925780631694505e146101b35780631dbd04d8146101fe57806322e11b8e146102455780632c76d7a614610264575f80fd5b3661016b57005b5f80fd5b34801561017a575f80fd5b506005545b6040519081526020015b60405180910390f35b34801561019d575f80fd5b506101b16101ac36600461174a565b610561565b005b3480156101be575f80fd5b506101e67f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b039091168152602001610189565b348015610209575f80fd5b506102317f000000000000000000000000000000000000000000000000000000000000271081565b60405162ffffff9091168152602001610189565b348015610250575f80fd5b506101b161025f36600461176c565b6106ae565b34801561026f575f80fd5b506101e67f000000000000000000000000e592427a0aece92de3edee1f18e0157c0586156481565b3480156102a2575f80fd5b506101e673d555498a524612c67f286df0e0a9a64a73a7cdc781565b3480156102c9575f80fd5b506103166102d836600461174a565b60036020525f90815260409020546001600160a01b0381169060ff600160a01b820481169162ffffff600160a81b82041691600160c01b9091041684565b60405161018994939291906117ef565b348015610331575f80fd5b5061017f60025481565b348015610346575f80fd5b506101e661035536600461183e565b610ad2565b348015610365575f80fd5b505f5461037990600160a01b900460ff1681565b6040519015158152602001610189565b348015610394575f80fd5b506101e66103a336600461183e565b610afa565b3480156103b3575f80fd5b5060065461017f565b3480156103c7575f80fd5b506101e6739e9fbde7c7a83c43913bddc8779158f1368f041381565b3480156103ee575f80fd5b506101e6736c061d18d2b5bbfbe8a8d1eeb9ee27efd544cc5d81565b348015610415575f80fd5b505f546101e6906001600160a01b031681565b348015610433575f80fd5b5061037961044236600461174a565b60046020525f908152604090205460ff1681565b348015610461575f80fd5b506102317f0000000000000000000000000000000000000000000000000000000000000bb881565b348015610494575f80fd5b506101e673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b3480156104bb575f80fd5b506001546101e6906001600160a01b031681565b3480156104da575f80fd5b506101b1610b09565b3480156104ee575f80fd5b506101b16104fd36600461183e565b610df8565b34801561050d575f80fd5b506101b161051c36600461174a565b6110f5565b34801561052c575f80fd5b50610535611187565b6040516101899190611855565b34801561054d575f80fd5b5061017f6b033b2e3c9fd0803ce800000081565b6105696112f0565b600180546001600160a01b0319166001600160a01b038316908117909155604080516324dead2f60e11b815290516349bd5a5e9160048082019260209290919082900301815f875af11580156105c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105e591906118ac565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d811660048301525f196024830152919091169063095ea7b3906044016020604051808303815f875af1158015610653573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061067791906118c7565b506040516001600160a01b038216907f6fa514daba342957e6cdaa126dbd2a46aa20bd65a5fd4c83b3b3a1303d88f19d905f90a250565b6106b66112f0565b5f805b60ff81168311156107d5575f84848360ff168181106106da576106da6118e6565b6106f0926020608090920201908101915061174a565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561072b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061074f91906118fa565b116107945760405162461bcd60e51b815260206004820152601060248201526f2737ba1022a9219a181a103a37b5b2b760811b60448201526064015b60405180910390fd5b83838260ff168181106107a9576107a96118e6565b90506080020160200160208101906107c19190611926565b6107cb9083611953565b91506001016106b9565b508060ff166064146108125760405162461bcd60e51b8152602060048201526006602482015265085d985b1a5960d21b604482015260640161078b565b5f5b60065481101561089e575f60068281548110610832576108326118e6565b5f918252602080832091909101546001600160a01b031680835260038252604080842080546001600160c81b031916905551928352925082917e6f3c11a03585d1b777f727ab55879672a0c73a67c94eddf39ee818afd0b110910160405180910390a250600101610814565b506108aa60055f611700565b6108d1604080516080810182525f8082526020820181905291810182905290606082015290565b5f5b83811015610acb578484828181106108ed576108ed6118e6565b9050608002018036038101906109039190611994565b80516001600160a01b039081165f9081526003602090815260409182902084518154928601519386015162ffffff16600160a81b0262ffffff60a81b1960ff909516600160a01b026001600160a81b0319909416919095161791909117918216831781556060840151939550859390929091839160ff60c01b191663ffffffff60a81b1990911617600160c01b8360018111156109a2576109a26117db565b0217905550508251600580546001810182555f9182527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b03938416179055845190911681526004602052604090205460ff169050610a7b5781516001600160a01b039081165f9081526004602052604081208054600160ff19909116811790915584516006805492830181559092527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b031916919092161790555b815160208084015160405160ff90911681526001600160a01b03909216917e6f3c11a03585d1b777f727ab55879672a0c73a67c94eddf39ee818afd0b110910160405180910390a26001016108d3565b5050505050565b60058181548110610ae1575f80fd5b5f918252602090912001546001600160a01b0316905081565b60068181548110610ae1575f80fd5b610b116112f0565b6040516370a0823160e01b81523060048201525f9073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906370a0823190602401602060405180830381865afa158015610b60573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b8491906118fa565b9050475f610b928284611a26565b9050805f03610ba057505050565b5f6064610bae836002611a39565b610bb89190611a50565b90505f6064610bc8846062611a39565b610bd29190611a50565b90505f610bdf8584611a6f565b90508015610c4857604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d906024015f604051808303815f87803b158015610c31575f80fd5b505af1158015610c43573d5f803e3d5ffd5b505050505b5f80546040516001600160a01b039091169085908381818185875af1925050503d805f8114610c92576040519150601f19603f3d011682016040523d82523d5f602084013e610c97565b606091505b5050905080610ca4575f80fd5b5f80610ccd604080516080810182525f8082526020820181905291810182905290606082015290565b5f5b60055460ff82161015610de75760058160ff1681548110610cf257610cf26118e6565b5f9182526020808320909101546001600160a01b039081168084526003835260409384902084516080810186528154938416815260ff600160a01b850481169582019590955262ffffff600160a81b85041695810195909552909750916060840191600160c01b9004166001811115610d6d57610d6d6117db565b6001811115610d7e57610d7e6117db565b815250509150606487836020015160ff16610d999190611a39565b610da39190611a50565b92505f82606001516001811115610dbc57610dbc6117db565b03610dd057610dcb8484611334565b610ddf565b610ddf84848460400151611561565b600101610ccf565b505042600255505050505050505050565b6001546001600160a01b0316610e425760405162461bcd60e51b815260206004820152600f60248201526e657263206973206e6f74207a65726f60881b604482015260640161078b565b5f8111610e7b5760405162461bcd60e51b815260206004820152600760248201526621746f6b656e7360c81b604482015260640161078b565b600154604080516318160ddd60e01b815290515f926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015610ec2573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ee691906118fa565b610efc6b033b2e3c9fd0803ce800000084611a39565b610f069190611a50565b600154604051632770a7eb60e21b8152336004820152602481018590529192506001600160a01b031690639dc29fac906044015f604051808303815f87803b158015610f50575f80fd5b505af1158015610f62573d5f803e3d5ffd5b505050505f805f805f90505b60065460ff821610156110ed5760068160ff1681548110610f9157610f916118e6565b5f918252602090912001546040516370a0823160e01b81523060048201526001600160a01b03909116945084906370a0823190602401602060405180830381865afa158015610fe2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061100691906118fa565b915081156110e5576b033b2e3c9fd0803ce80000006110258684611a39565b61102f9190611a50565b60405163a9059cbb60e01b8152336004820152602481018290529093506001600160a01b0385169063a9059cbb906044016020604051808303815f875af115801561107c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110a091906118c7565b50836001600160a01b03167fce4385affa8ad2cbec45b1660c6f6afcb691bf0a7a73ebda096ee1dfb670fe6f846040516110dc91815260200190565b60405180910390a25b600101610f6e565b505050505050565b5f546001600160a01b0316331461113d5760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015260640161078b565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6006546060905f9067ffffffffffffffff8111156111a7576111a7611972565b6040519080825280602002602001820160405280156111eb57816020015b604080518082019091525f80825260208201528152602001906001900390816111c55790505b5090505f5b60065460ff821610156112ea575f60068260ff1681548110611214576112146118e6565b905f5260205f20015f9054906101000a90046001600160a01b0316905080838360ff1681518110611247576112476118e6565b60209081029190910101516001600160a01b0391821690526040516370a0823160e01b8152306004820152908216906370a0823190602401602060405180830381865afa15801561129a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112be91906118fa565b838360ff16815181106112d3576112d36118e6565b6020908102919091018101510152506001016111f0565b50919050565b5f546001600160a01b031633146113325760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161078b565b565b6040805160028082526060820183525f9260208301908036833701905050905073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2815f8151811061137b5761137b6118e6565b60200260200101906001600160a01b031690816001600160a01b03168152505082816001815181106113af576113af6118e6565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b81523060048201525f918516906370a0823190602401602060405180830381865afa158015611401573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061142591906118fa565b604051635c11d79560e01b81529091506001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1690635c11d7959061147c9086905f90879030904290600401611a82565b5f604051808303815f87803b158015611493575f80fd5b505af11580156114a5573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201525f92506001600160a01b03871691506370a08231906024015b602060405180830381865afa1580156114ee573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061151291906118fa565b90506001600160a01b0385167f55c18555197c6574627cf460c66073d10aa05d412468800b7b71feeaf82ea92d6115498484611a6f565b60405190815260200160405180910390a25050505050565b6040516370a0823160e01b81523060048201525f906001600160a01b038516906370a0823190602401602060405180830381865afa1580156115a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c991906118fa565b6040805160a081018252736015551cd911ff4685072e2793f56c841e3ab66160611b60c08201526001600160e81b031960e886901b1660d4820152606087811b6bffffffffffffffffffffffff191660d7830152825180830360cb01815260eb830184528252306020830152428284015281018690525f6080820152905163c04b8d5960e01b81529192506001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564169163c04b8d599161169191600401611af3565b6020604051808303815f875af11580156116ad573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906116d191906118fa565b506040516370a0823160e01b81523060048201525f906001600160a01b038616906370a08231906024016114d3565b5080545f8255905f5260205f209081019061171b919061171e565b50565b5b80821115611732575f815560010161171f565b5090565b6001600160a01b038116811461171b575f80fd5b5f6020828403121561175a575f80fd5b813561176581611736565b9392505050565b5f806020838503121561177d575f80fd5b823567ffffffffffffffff80821115611794575f80fd5b818501915085601f8301126117a7575f80fd5b8135818111156117b5575f80fd5b8660208260071b85010111156117c9575f80fd5b60209290920196919550909350505050565b634e487b7160e01b5f52602160045260245ffd5b6001600160a01b038516815260ff8416602082015262ffffff83166040820152608081016002831061182f57634e487b7160e01b5f52602160045260245ffd5b82606083015295945050505050565b5f6020828403121561184e575f80fd5b5035919050565b602080825282518282018190525f919060409081850190868401855b8281101561189f57815180516001600160a01b03168552860151868501529284019290850190600101611871565b5091979650505050505050565b5f602082840312156118bc575f80fd5b815161176581611736565b5f602082840312156118d7575f80fd5b81518015158114611765575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f6020828403121561190a575f80fd5b5051919050565b803560ff81168114611921575f80fd5b919050565b5f60208284031215611936575f80fd5b61176582611911565b634e487b7160e01b5f52601160045260245ffd5b60ff818116838216019081111561196c5761196c61193f565b92915050565b634e487b7160e01b5f52604160045260245ffd5b803560028110611921575f80fd5b5f608082840312156119a4575f80fd5b6040516080810181811067ffffffffffffffff821117156119d357634e487b7160e01b5f52604160045260245ffd5b60405282356119e181611736565b81526119ef60208401611911565b6020820152604083013562ffffff81168114611a09575f80fd5b6040820152611a1a60608401611986565b60608201529392505050565b8082018082111561196c5761196c61193f565b808202811582820484141761196c5761196c61193f565b5f82611a6a57634e487b7160e01b5f52601260045260245ffd5b500490565b8181038181111561196c5761196c61193f565b5f60a08201878352602087602085015260a0604085015281875180845260c0860191506020890193505f5b81811015611ad25784516001600160a01b031683529383019391830191600101611aad565b50506001600160a01b03969096166060850152505050608001529392505050565b5f6020808352835160a0602085015280518060c08601525f5b81811015611b285782810184015186820160e001528301611b0c565b505f85820160e0015260208601516001600160a01b038116604087015292506040860151606086015260608601516080860152608086015160a086015260e0601f19601f83011686010193505050509291505056fea26469706673582212200ef8b920494651781d41bb29da7f55e037bc524eecece54050638009925eb90564736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
-----Decoded View---------------
Arg [0] : routerAddressV2 (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [1] : routerAddressV3 (address): 0xE592427A0AEce92De3Edee1F18E0157C05861564
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [1] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.