More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
328770323 | 41 hrs ago | 0.00006219 ETH | ||||
328770323 | 41 hrs ago | 0.00006219 ETH | ||||
328284974 | 3 days ago | 0.00001248 ETH | ||||
328284974 | 3 days ago | 0.00001248 ETH | ||||
328030968 | 3 days ago | 0.06248649 ETH | ||||
328030968 | 3 days ago | 0.06248649 ETH | ||||
327789003 | 4 days ago | 0.02752649 ETH | ||||
327789003 | 4 days ago | 0.02752649 ETH | ||||
327104014 | 6 days ago | 0.00244642 ETH | ||||
327104014 | 6 days ago | 0.00244642 ETH | ||||
326996139 | 6 days ago | 0.00473193 ETH | ||||
326996139 | 6 days ago | 0.00473193 ETH | ||||
326259280 | 9 days ago | 0.01558484 ETH | ||||
326259280 | 9 days ago | 0.01558484 ETH | ||||
326230874 | 9 days ago | 0.01295681 ETH | ||||
326230874 | 9 days ago | 0.01295681 ETH | ||||
326226561 | 9 days ago | 0.01244658 ETH | ||||
326226561 | 9 days ago | 0.01244658 ETH | ||||
326217861 | 9 days ago | 0.01143587 ETH | ||||
326217861 | 9 days ago | 0.01143587 ETH | ||||
325963277 | 9 days ago | 0.0012154 ETH | ||||
325963277 | 9 days ago | 0.0012154 ETH | ||||
325868092 | 10 days ago | 0.00113523 ETH | ||||
325868092 | 10 days ago | 0.00113523 ETH | ||||
325791758 | 10 days ago | 0.00148597 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Vyper_contract
Compiler Version
vyper:0.2.15
Contract Source Code (Vyper language format)
# @version 0.2.15 """ @title Curve CryptoSwap Deposit Zap @author Curve.Fi @license Copyright (c) Curve.Fi, 2020 - all rights reserved @dev Wraps / unwraps Ether, and redirects deposits / withdrawals """ from vyper.interfaces import ERC20 interface CurveCryptoSwap: def add_liquidity(amounts: uint256[N_COINS], min_mint_amount: uint256): nonpayable def remove_liquidity(_amount: uint256, min_amounts: uint256[N_COINS]): nonpayable def remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256): nonpayable def token() -> address: view def coins(i: uint256) -> address: view interface wETH: def deposit(): payable def withdraw(_amount: uint256): nonpayable N_COINS: constant(uint256) = 3 WETH_IDX: constant(uint256) = N_COINS - 1 WETH: constant(address) = 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 pool: public(address) token: public(address) coins: public(address[N_COINS]) @payable @external def __default__(): assert msg.sender == WETH @external def __init__(_pool: address): """ @notice Contract constructor @param _pool `CurveCryptoSwap` deployment to target """ self.pool = _pool self.token = CurveCryptoSwap(_pool).token() for i in range(N_COINS): coin: address = CurveCryptoSwap(_pool).coins(i) response: Bytes[32] = raw_call( coin, concat( method_id("approve(address,uint256)"), convert(_pool, bytes32), convert(MAX_UINT256, bytes32) ), max_outsize=32 ) if len(response) > 0: assert convert(response, bool) # dev: bad response self.coins[i] = coin assert self.coins[WETH_IDX] == WETH @payable @external def add_liquidity( _amounts: uint256[N_COINS], _min_mint_amount: uint256, _receiver: address = msg.sender ) -> uint256: """ @notice Add liquidity and wrap Ether to wETH @param _amounts Amount of each token to deposit. `msg.value` must be equal to the given amount of Ether. @param _min_mint_amount Minimum amount of LP token to receive @param _receiver Receiver of the LP tokens @return Amount of LP tokens received """ assert msg.value == _amounts[WETH_IDX] wETH(WETH).deposit(value=msg.value) for i in range(N_COINS-1): if _amounts[i] > 0: response: Bytes[32] = raw_call( self.coins[i], concat( method_id("transferFrom(address,address,uint256)"), convert(msg.sender, bytes32), convert(self, bytes32), convert(_amounts[i], bytes32) ), max_outsize=32 ) if len(response) > 0: assert convert(response, bool) # dev: bad response CurveCryptoSwap(self.pool).add_liquidity(_amounts, _min_mint_amount) token: address = self.token amount: uint256 = ERC20(token).balanceOf(self) response: Bytes[32] = raw_call( token, concat( method_id("transfer(address,uint256)"), convert(_receiver, bytes32), convert(amount, bytes32) ), max_outsize=32 ) if len(response) > 0: assert convert(response, bool) # dev: bad response return amount @external def remove_liquidity( _amount: uint256, _min_amounts: uint256[N_COINS], _receiver: address = msg.sender ) -> uint256[N_COINS]: """ @notice Withdraw coins from the pool, unwrapping wETH to Ether @dev Withdrawal amounts are based on current deposit ratios @param _amount Quantity of LP tokens to burn in the withdrawal @param _min_amounts Minimum amounts of coins to receive @param _receiver Receiver of the withdrawn tokens @return Amounts of coins that were withdrawn """ ERC20(self.token).transferFrom(msg.sender, self, _amount) CurveCryptoSwap(self.pool).remove_liquidity(_amount, _min_amounts) amounts: uint256[N_COINS] = empty(uint256[N_COINS]) for i in range(N_COINS-1): coin: address = self.coins[i] amounts[i] = ERC20(coin).balanceOf(self) response: Bytes[32] = raw_call( coin, concat( method_id("transfer(address,uint256)"), convert(_receiver, bytes32), convert(amounts[i], bytes32) ), max_outsize=32 ) if len(response) > 0: assert convert(response, bool) # dev: bad response amounts[WETH_IDX] = ERC20(WETH).balanceOf(self) wETH(WETH).withdraw(amounts[WETH_IDX]) raw_call(_receiver, b"", value=self.balance) return amounts @external def remove_liquidity_one_coin( _token_amount: uint256, i: uint256, _min_amount: uint256, _receiver: address = msg.sender ) -> uint256: """ @notice Withdraw a single coin from the pool, unwrapping wETH to Ether @param _token_amount Amount of LP tokens to burn in the withdrawal @param i Index value of the coin to withdraw @param _min_amount Minimum amount of coin to receive @param _receiver Receiver of the withdrawn token @return Amount of underlying coin received """ ERC20(self.token).transferFrom(msg.sender, self, _token_amount) CurveCryptoSwap(self.pool).remove_liquidity_one_coin(_token_amount, i, _min_amount) coin: address = self.coins[i] amount: uint256 = ERC20(coin).balanceOf(self) if i == WETH_IDX: wETH(WETH).withdraw(amount) raw_call(_receiver, b"", value=self.balance) else: response: Bytes[32] = raw_call( coin, concat( method_id("transfer(address,uint256)"), convert(_receiver, bytes32), convert(amount, bytes32) ), max_outsize=32 ) if len(response) > 0: assert convert(response, bool) # dev: bad response return amount
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"stateMutability":"payable","type":"fallback"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_pool","type":"address"}],"outputs":[]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"_amounts","type":"uint256[3]"},{"name":"_min_mint_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"payable","type":"function","name":"add_liquidity","inputs":[{"name":"_amounts","type":"uint256[3]"},{"name":"_min_mint_amount","type":"uint256"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[3]"}],"outputs":[{"name":"","type":"uint256[3]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity","inputs":[{"name":"_amount","type":"uint256"},{"name":"_min_amounts","type":"uint256[3]"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256[3]"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_token_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"_min_amount","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_liquidity_one_coin","inputs":[{"name":"_token_amount","type":"uint256"},{"name":"i","type":"uint256"},{"name":"_min_amount","type":"uint256"},{"name":"_receiver","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"pool","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2568},{"stateMutability":"view","type":"function","name":"token","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2598},{"stateMutability":"view","type":"function","name":"coins","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}],"gas":2673}]
Contract Creation Code
6020610cf9610140396020610cf960c03960c05160a01c610cf4576101405160005560206101c0600463fc0c546a6101605261017c610140515afa15610cf457601f3d1115610cf4576000506101c05160015561016060006003818352015b6020610220602463c66106576101a052610160516101c0526101bc610140515afa15610cf457601f3d1115610cf457600050610220516101805260006004610200527f095ea7b3000000000000000000000000000000000000000000000000000000006102205261020060048060208461026001018260208501600060045af1505080518201915050610140516020826102600101526020810190507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602082610260010152602081019050806102605261026090508051602001806103008284600060045af115610cf457505060206103c0610300516103206000610180515af115610cf45760203d808211156101765780610178565b815b905090506103a0526103a08051602001806101a08284600060045af115610cf457505060006101a05111156101da576101a08060200151600082518060209013610cf45780919012610cf457806020036101000a820490509050905015610cf4575b610180516001610160516003811015610cf45702600201555b815160010180835281141561005e575b50507382af49447d8a07e3bd95bd0d56f35241523fbab16004541415610cf457610cdc56600436101561000d57610a91565b600035601c52600051634515cef381141561002c573361014052610057565b6375b96abc8114156100525760843560a01c610aaf576020608461014037600050610057565b6103f2565b604435341415610aaf577382af49447d8a07e3bd95bd0d56f35241523fbab13b15610aaf5760006000600463d0e30db06101605261017c347382af49447d8a07e3bd95bd0d56f35241523fbab15af115610aaf5761016060006002818352015b60006004610160516003811015610aaf576020020135111561022657600060046101e0527f23b872dd00000000000000000000000000000000000000000000000000000000610200526101e060048060208461024001018260208501600060045af150508051820191505033602082610240010152602081019050306020826102400101526020810190506004610160516003811015610aaf576020020135602082610240010152602081019050806102405261024090508051602001806103008284600060045af115610aaf57505060206103e06103005161032060006001610160516003811015610aaf5702600201545af115610aaf5760203d808211156101c157806101c3565b815b905090506103c0526103c08051602001806101808284600060045af115610aaf5750506000610180511115610225576101808060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b5b5b81516001018083528114156100b7575b50506000543b15610aaf57600060006084634515cef361016052600480356101805280602001356101a05280604001356101c052506064356101e05261017c60006000545af115610aaf5760015461016052602061022060246370a082316101a052306101c0526101bc610160515afa15610aaf57601f3d1115610aaf57600050610220516101805260006004610200527fa9059cbb000000000000000000000000000000000000000000000000000000006102205261020060048060208461026001018260208501600060045af15050805182019150506101405160208261026001015260208101905061018051602082610260010152602081019050806102605261026090508051602001806103008284600060045af115610aaf57505060206103c0610300516103206000610160515af115610aaf5760203d808211156103815780610383565b815b905090506103a0526103a08051602001806101a08284600060045af115610aaf57505060006101a05111156103e5576101a08060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b6101805160005260206000f35b63ecb586a5811415610408573361014052610433565b632da5dc2181141561042e5760843560a01c610aaf576020608461014037600050610433565b610757565b34610aaf57602061022060646323b872dd610160523361018052306101a0526004356101c05261017c60006001545af115610aaf57601f3d1115610aaf57600050610220506000543b15610aaf5760006000608463ecb586a56101605260043561018052602480356101a05280602001356101c05280604001356101e0525061017c60006000545af115610aaf57606036610160376101c060006002818352015b60016101c0516003811015610aaf5702600201546101e052602061028060246370a0823161020052306102205261021c6101e0515afa15610aaf57601f3d1115610aaf57600050610280516101606101c0516003811015610aaf57602002015260006004610260527fa9059cbb00000000000000000000000000000000000000000000000000000000610280526102606004806020846102c001018260208501600060045af1505080518201915050610140516020826102c00101526020810190506101606101c0516003811015610aaf5760200201516020826102c0010152602081019050806102c0526102c090508051602001806103608284600060045af115610aaf57505060206104206103605161038060006101e0515af115610aaf5760203d808211156106065780610608565b815b90509050610400526104008051602001806102008284600060045af115610aaf575050600061020051111561066a576102008060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b5b81516001018083528114156104d4575b5050602061024060246370a082316101c052306101e0526101dc7382af49447d8a07e3bd95bd0d56f35241523fbab15afa15610aaf57601f3d1115610aaf57600050610240516101a0527382af49447d8a07e3bd95bd0d56f35241523fbab13b15610aaf57600060006024632e1a7d4d6101c0526101a0516101e0526101dc60007382af49447d8a07e3bd95bd0d56f35241523fbab15af115610aaf5760006101c0526101c08051602001806102008284600060045af115610aaf575050600060006102005161022047610140515af115610aaf576060610160f35b63f1dc3cc981141561076d573361014052610798565b630fbcee6e8114156107935760643560a01c610aaf576020606461014037600050610798565b610a28565b34610aaf57602061022060646323b872dd610160523361018052306101a0526004356101c05261017c60006001545af115610aaf57601f3d1115610aaf57600050610220506000543b15610aaf5760006000606463f1dc3cc961016052606060046101803761017c60006000545af115610aaf5760016024356003811015610aaf57026002015461016052602061022060246370a082316101a052306101c0526101bc610160515afa15610aaf57601f3d1115610aaf576000506102205161018052600260243514156108f5577382af49447d8a07e3bd95bd0d56f35241523fbab13b15610aaf57600060006024632e1a7d4d6101a052610180516101c0526101bc60007382af49447d8a07e3bd95bd0d56f35241523fbab15af115610aaf5760006101a0526101a08051602001806101e08284600060045af115610aaf575050600060006101e05161020047610140515af115610aaf57610a1b565b60006004610200527fa9059cbb000000000000000000000000000000000000000000000000000000006102205261020060048060208461026001018260208501600060045af15050805182019150506101405160208261026001015260208101905061018051602082610260010152602081019050806102605261026090508051602001806103008284600060045af115610aaf57505060206103c0610300516103206000610160515af115610aaf5760203d808211156109b657806109b8565b815b905090506103a0526103a08051602001806101a08284600060045af115610aaf57505060006101a0511115610a1a576101a08060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b5b6101805160005260206000f35b6316f0115b811415610a455734610aaf5760005460005260206000f35b63fc0c546a811415610a625734610aaf5760015460005260206000f35b63c6610657811415610a8f5734610aaf5760016004356003811015610aaf57026002015460005260206000f35b505b7382af49447d8a07e3bd95bd0d56f35241523fbab1331415610aaf57005b600080fd5b610228610cdc03610228600039610228610cdc036000f35b600080fd000000000000000000000000960ea3e3c7fb317332d990873d354e18d7645590
Deployed Bytecode
0x600436101561000d57610a91565b600035601c52600051634515cef381141561002c573361014052610057565b6375b96abc8114156100525760843560a01c610aaf576020608461014037600050610057565b6103f2565b604435341415610aaf577382af49447d8a07e3bd95bd0d56f35241523fbab13b15610aaf5760006000600463d0e30db06101605261017c347382af49447d8a07e3bd95bd0d56f35241523fbab15af115610aaf5761016060006002818352015b60006004610160516003811015610aaf576020020135111561022657600060046101e0527f23b872dd00000000000000000000000000000000000000000000000000000000610200526101e060048060208461024001018260208501600060045af150508051820191505033602082610240010152602081019050306020826102400101526020810190506004610160516003811015610aaf576020020135602082610240010152602081019050806102405261024090508051602001806103008284600060045af115610aaf57505060206103e06103005161032060006001610160516003811015610aaf5702600201545af115610aaf5760203d808211156101c157806101c3565b815b905090506103c0526103c08051602001806101808284600060045af115610aaf5750506000610180511115610225576101808060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b5b5b81516001018083528114156100b7575b50506000543b15610aaf57600060006084634515cef361016052600480356101805280602001356101a05280604001356101c052506064356101e05261017c60006000545af115610aaf5760015461016052602061022060246370a082316101a052306101c0526101bc610160515afa15610aaf57601f3d1115610aaf57600050610220516101805260006004610200527fa9059cbb000000000000000000000000000000000000000000000000000000006102205261020060048060208461026001018260208501600060045af15050805182019150506101405160208261026001015260208101905061018051602082610260010152602081019050806102605261026090508051602001806103008284600060045af115610aaf57505060206103c0610300516103206000610160515af115610aaf5760203d808211156103815780610383565b815b905090506103a0526103a08051602001806101a08284600060045af115610aaf57505060006101a05111156103e5576101a08060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b6101805160005260206000f35b63ecb586a5811415610408573361014052610433565b632da5dc2181141561042e5760843560a01c610aaf576020608461014037600050610433565b610757565b34610aaf57602061022060646323b872dd610160523361018052306101a0526004356101c05261017c60006001545af115610aaf57601f3d1115610aaf57600050610220506000543b15610aaf5760006000608463ecb586a56101605260043561018052602480356101a05280602001356101c05280604001356101e0525061017c60006000545af115610aaf57606036610160376101c060006002818352015b60016101c0516003811015610aaf5702600201546101e052602061028060246370a0823161020052306102205261021c6101e0515afa15610aaf57601f3d1115610aaf57600050610280516101606101c0516003811015610aaf57602002015260006004610260527fa9059cbb00000000000000000000000000000000000000000000000000000000610280526102606004806020846102c001018260208501600060045af1505080518201915050610140516020826102c00101526020810190506101606101c0516003811015610aaf5760200201516020826102c0010152602081019050806102c0526102c090508051602001806103608284600060045af115610aaf57505060206104206103605161038060006101e0515af115610aaf5760203d808211156106065780610608565b815b90509050610400526104008051602001806102008284600060045af115610aaf575050600061020051111561066a576102008060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b5b81516001018083528114156104d4575b5050602061024060246370a082316101c052306101e0526101dc7382af49447d8a07e3bd95bd0d56f35241523fbab15afa15610aaf57601f3d1115610aaf57600050610240516101a0527382af49447d8a07e3bd95bd0d56f35241523fbab13b15610aaf57600060006024632e1a7d4d6101c0526101a0516101e0526101dc60007382af49447d8a07e3bd95bd0d56f35241523fbab15af115610aaf5760006101c0526101c08051602001806102008284600060045af115610aaf575050600060006102005161022047610140515af115610aaf576060610160f35b63f1dc3cc981141561076d573361014052610798565b630fbcee6e8114156107935760643560a01c610aaf576020606461014037600050610798565b610a28565b34610aaf57602061022060646323b872dd610160523361018052306101a0526004356101c05261017c60006001545af115610aaf57601f3d1115610aaf57600050610220506000543b15610aaf5760006000606463f1dc3cc961016052606060046101803761017c60006000545af115610aaf5760016024356003811015610aaf57026002015461016052602061022060246370a082316101a052306101c0526101bc610160515afa15610aaf57601f3d1115610aaf576000506102205161018052600260243514156108f5577382af49447d8a07e3bd95bd0d56f35241523fbab13b15610aaf57600060006024632e1a7d4d6101a052610180516101c0526101bc60007382af49447d8a07e3bd95bd0d56f35241523fbab15af115610aaf5760006101a0526101a08051602001806101e08284600060045af115610aaf575050600060006101e05161020047610140515af115610aaf57610a1b565b60006004610200527fa9059cbb000000000000000000000000000000000000000000000000000000006102205261020060048060208461026001018260208501600060045af15050805182019150506101405160208261026001015260208101905061018051602082610260010152602081019050806102605261026090508051602001806103008284600060045af115610aaf57505060206103c0610300516103206000610160515af115610aaf5760203d808211156109b657806109b8565b815b905090506103a0526103a08051602001806101a08284600060045af115610aaf57505060006101a0511115610a1a576101a08060200151600082518060209013610aaf5780919012610aaf57806020036101000a820490509050905015610aaf575b5b6101805160005260206000f35b6316f0115b811415610a455734610aaf5760005460005260206000f35b63fc0c546a811415610a625734610aaf5760015460005260206000f35b63c6610657811415610a8f5734610aaf5760016004356003811015610aaf57026002015460005260206000f35b505b7382af49447d8a07e3bd95bd0d56f35241523fbab1331415610aaf57005b600080fd
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000960ea3e3c7fb317332d990873d354e18d7645590
-----Decoded View---------------
Arg [0] : _pool (address): 0x960ea3e3C7FB317332d990873d354E18d7645590
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000960ea3e3c7fb317332d990873d354e18d7645590
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
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.