More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Burn | 15007459 | 930 days ago | IN | 0 ETH | 0.00191298 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
20160888 | 197 days ago | 0.11613949 ETH | ||||
20160888 | 197 days ago | 0.11613949 ETH | ||||
20125445 | 202 days ago | 0.18537968 ETH | ||||
20125445 | 202 days ago | 0.18537968 ETH | ||||
20124409 | 202 days ago | 5.74782686 ETH | ||||
20124409 | 202 days ago | 5.74782686 ETH | ||||
20075276 | 209 days ago | 0.40570387 ETH | ||||
20075276 | 209 days ago | 0.40570387 ETH | ||||
20025426 | 216 days ago | 0.25742352 ETH | ||||
20025426 | 216 days ago | 0.25742352 ETH | ||||
19974953 | 223 days ago | 0.3361365 ETH | ||||
19974953 | 223 days ago | 0.3361365 ETH | ||||
19925102 | 230 days ago | 0.31120915 ETH | ||||
19925102 | 230 days ago | 0.31120915 ETH | ||||
19874860 | 237 days ago | 0.75570732 ETH | ||||
19874860 | 237 days ago | 0.75570732 ETH | ||||
19825116 | 244 days ago | 0.71405417 ETH | ||||
19825116 | 244 days ago | 0.71405417 ETH | ||||
19774938 | 251 days ago | 0.4708736 ETH | ||||
19774938 | 251 days ago | 0.4708736 ETH | ||||
19724417 | 258 days ago | 0.60528105 ETH | ||||
19724417 | 258 days ago | 0.60528105 ETH | ||||
19671306 | 265 days ago | 1.06952369 ETH | ||||
19671306 | 265 days ago | 1.06952369 ETH | ||||
19619445 | 273 days ago | 0.58021242 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Vyper_contract
Compiler Version
vyper:0.3.0
Contract Source Code (Vyper language format)
# @version 0.3.0 """ @title Crypto LP Burner @notice Converts Crypto Pool LP tokens to a single asset and forwards to another burner """ from vyper.interfaces import ERC20 interface AddressProvider: def get_address(i: uint256) -> address: view interface Registry: def get_pool_from_lp_token(_lp_token: address) -> address: view def get_coins(_pool: address) -> address[8]: view interface CryptoSwap2: def remove_liquidity(_amount: uint256, _min_amounts: uint256[2]): nonpayable interface CryptoSwap3: def remove_liquidity(_amount: uint256, _min_amounts: uint256[3]): nonpayable interface CryptoSwap4: def remove_liquidity(_amount: uint256, _min_amounts: uint256[4]): nonpayable interface Weth: def withdraw(_amount: uint256): nonpayable WETH: constant(address) = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 ADDRESS_PROVIDER: constant(address) = 0x0000000022D53366457F9d5E68Ec105046FC4383 receiver: public(address) recovery: public(address) is_killed: public(bool) owner: public(address) emergency_owner: public(address) future_owner: public(address) future_emergency_owner: public(address) @external def __init__(_receiver: address, _recovery: address, _owner: address, _emergency_owner: address): """ @notice Contract constructor @dev Unlike other burners, this contract may transfer tokens to multiple addresses after the swap. Receiver addresses are set by calling `set_swap_data` instead of setting it within the constructor. @param _recovery Address that tokens are transferred to during an emergency token recovery. @param _owner Owner address. Can kill the contract, recover tokens and modify the recovery address. @param _emergency_owner Emergency owner address. Can kill the contract and recover tokens. """ self.receiver = _receiver self.recovery = _recovery self.owner = _owner self.emergency_owner = _emergency_owner @payable @external def __default__(): # required to receive ether pass @external def burn(_coin: address) -> bool: """ @notice Convert `_coin` by removing liquidity and transfer to another burner @param _coin Address of the coin being converted @return bool success """ assert not self.is_killed # dev: is killed # transfer coins from caller amount: uint256 = ERC20(_coin).balanceOf(msg.sender) if amount != 0: ERC20(_coin).transferFrom(msg.sender, self, amount) # get actual balance in case of transfer fee or pre-existing balance amount = ERC20(_coin).balanceOf(self) if amount != 0: registry: address = AddressProvider(ADDRESS_PROVIDER).get_address(5) swap: address = Registry(registry).get_pool_from_lp_token(_coin) coins: address[8] = Registry(registry).get_coins(swap) # remove liquidity and pass to the next burner if coins[3] == ZERO_ADDRESS: CryptoSwap2(swap).remove_liquidity(amount, [0, 0]) elif coins[4] == ZERO_ADDRESS: CryptoSwap3(swap).remove_liquidity(amount, [0, 0, 0]) else: CryptoSwap4(swap).remove_liquidity(amount, [0, 0, 0, 0]) receiver: address = self.receiver for coin in coins: if coin == ZERO_ADDRESS: break amount = ERC20(coin).balanceOf(self) if coin == WETH: Weth(WETH).withdraw(amount) raw_call(receiver, b"", value=self.balance) else: response: Bytes[32] = raw_call( coin, _abi_encode(receiver, amount, method_id=method_id("transfer(address,uint256)")), max_outsize=32, ) if len(response) != 0: assert convert(response, bool) return True @external def recover_balance(_coin: address) -> bool: """ @notice Recover ERC20 tokens from this contract @dev Tokens are sent to the recovery address @param _coin Token address @return bool success """ assert msg.sender in [self.owner, self.emergency_owner] # dev: only owner amount: uint256 = ERC20(_coin).balanceOf(self) response: Bytes[32] = raw_call( _coin, _abi_encode(self.recovery, amount, method_id=method_id("transfer(address,uint256)")), max_outsize=32, ) if len(response) != 0: assert convert(response, bool) return True @external def set_recovery(_recovery: address) -> bool: """ @notice Set the token recovery address @param _recovery Token recovery address @return bool success """ assert msg.sender == self.owner # dev: only owner self.recovery = _recovery return True @external def set_killed(_is_killed: bool) -> bool: """ @notice Set killed status for this contract @dev When killed, the `burn` function cannot be called @param _is_killed Killed status @return bool success """ assert msg.sender in [self.owner, self.emergency_owner] # dev: only owner self.is_killed = _is_killed return True @external def commit_transfer_ownership(_future_owner: address) -> bool: """ @notice Commit a transfer of ownership @dev Must be accepted by the new owner via `accept_transfer_ownership` @param _future_owner New owner address @return bool success """ assert msg.sender == self.owner # dev: only owner self.future_owner = _future_owner return True @external def accept_transfer_ownership() -> bool: """ @notice Accept a transfer of ownership @return bool success """ assert msg.sender == self.future_owner # dev: only owner self.owner = msg.sender return True @external def commit_transfer_emergency_ownership(_future_owner: address) -> bool: """ @notice Commit a transfer of ownership @dev Must be accepted by the new owner via `accept_transfer_ownership` @param _future_owner New owner address @return bool success """ assert msg.sender == self.emergency_owner # dev: only owner self.future_emergency_owner = _future_owner return True @external def accept_transfer_emergency_ownership() -> bool: """ @notice Accept a transfer of ownership @return bool success """ assert msg.sender == self.future_emergency_owner # dev: only owner self.emergency_owner = msg.sender return True
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_receiver","type":"address"},{"name":"_recovery","type":"address"},{"name":"_owner","type":"address"},{"name":"_emergency_owner","type":"address"}],"outputs":[]},{"stateMutability":"payable","type":"fallback"},{"stateMutability":"nonpayable","type":"function","name":"burn","inputs":[{"name":"_coin","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":396288},{"stateMutability":"nonpayable","type":"function","name":"recover_balance","inputs":[{"name":"_coin","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":17264},{"stateMutability":"nonpayable","type":"function","name":"set_recovery","inputs":[{"name":"_recovery","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":37935},{"stateMutability":"nonpayable","type":"function","name":"set_killed","inputs":[{"name":"_is_killed","type":"bool"}],"outputs":[{"name":"","type":"bool"}],"gas":40513},{"stateMutability":"nonpayable","type":"function","name":"commit_transfer_ownership","inputs":[{"name":"_future_owner","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":37995},{"stateMutability":"nonpayable","type":"function","name":"accept_transfer_ownership","inputs":[],"outputs":[{"name":"","type":"bool"}],"gas":37864},{"stateMutability":"nonpayable","type":"function","name":"commit_transfer_emergency_ownership","inputs":[{"name":"_future_owner","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":38055},{"stateMutability":"nonpayable","type":"function","name":"accept_transfer_emergency_ownership","inputs":[],"outputs":[{"name":"","type":"bool"}],"gas":37924},{"stateMutability":"view","type":"function","name":"receiver","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2856},{"stateMutability":"view","type":"function","name":"recovery","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2886},{"stateMutability":"view","type":"function","name":"is_killed","inputs":[],"outputs":[{"name":"","type":"bool"}],"gas":2916},{"stateMutability":"view","type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2946},{"stateMutability":"view","type":"function","name":"emergency_owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2976},{"stateMutability":"view","type":"function","name":"future_owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":3006},{"stateMutability":"view","type":"function","name":"future_emergency_owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":3036}]
Contract Creation Code
6020610a0b60c03960c0518060a01c610a06578090506101405260206020610a0b0160c03960c0518060a01c610a06578090506101605260206040610a0b0160c03960c0518060a01c610a06578090506101805260206060610a0b0160c03960c0518060a01c610a06578090506101a0526101405160005561016051600155610180516003556101a0516004556109ee56600436101561000d57610956565b60046000601c376000516389afcb44811415610545576004358060a01c61095857809050610140523461095857600254610958576370a0823161018052336101a0526020610180602461019c610140515afa1561095857601f3d111561095857610180516101605260006101605118156100c1576323b872dd61018052336101a052306101c052610160516101e0526020610180606461019c6000610140515af11561095857601f3d111561095857610180505b6370a0823161018052306101a0526020610180602461019c610140515afa1561095857601f3d111561095857610180516101605260006101605118156105385763493f4f746101a05260056101c05260206101a060246101bc6f22d53366457f9d5e68ec105046fc43835afa1561095857601f3d1115610958576101a0518060a01c610958578090506101805263bdf475c36101c052610140516101e05260206101c060246101dc610180515afa1561095857601f3d1115610958576101c0518060a01c610958578090506101a052639ac90d3d6102c0526101a0516102e0526101006102c060246102dc610180515afa156109585760ff3d1115610958576102c080518060a01c610958578090506101c05260208101518060a01c610958578090506101e05260408101518060a01c610958578090506102005260608101518060a01c610958578090506102205260808101518060a01c610958578090506102405260a08101518060a01c610958578090506102605260c08101518060a01c610958578090506102805260e08101518060a01c610958578090506102a05250610220516102ab57635b36389c6102c052610160516102e0526000610300526000610320526101a0513b15610958576000600060646102dc60006101a0515af11561095857610346565b610240516102fb5763ecb586a56102c052610160516102e0526000610300526000610320526000610340526101a0513b15610958576000600060846102dc60006101a0515af11561095857610345565b637d49d8756102c052610160516102e0526000610300526000610320526000610340526000610360526101a0513b15610958576000600060a46102dc60006101a0515af115610958575b5b6000546102c05261030060006008818352015b602061030051026101c001516102e0526102e05161037657610535565b6370a082316103205230610340526020610320602461033c6102e0515afa1561095857601f3d111561095857610320516101605273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26102e051141561045957632e1a7d4d61032052610160516103405273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23b156109585760006000602461033c600073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af115610958576000610320526103208051602001806103408284600060045af1156109585750506000600061034051610360476102c0515af11561095857610525565b63a9059cbb6103645260046102c05161038452610160516103a452604001610360526103608051602001806103e08284600060045af11561095857505060206104806103e05161040060006102e0515af1156109585760203d808211156104c057806104c2565b815b90509050610460526104608051602001806103208284600060045af1156109585750506000610320511815610524576103208060200151600082518060209013610958578091901261095857806020036101000a820490509050905015610958575b5b8151600101808352811415610359575b50505b6001610180526020610180f35b63db2f5f798114156106ce576004358060a01c61095857809050610140523461095857600354610180526004546101a05260006101605261016061012060006002818352015b6101205160200261018001513314156105a757600183526105b7565b815160010180835281141561058b575b5050506101605115610958576370a0823161018052306101a0526020610180602461019c610140515afa1561095857601f3d111561095857610180516101605263a9059cbb6101c45260046001546101e45261016051610204526040016101c0526101c08051602001806102408284600060045af11561095857505060206102e0610240516102606000610140515af1156109585760203d8082111561065d578061065f565b815b905090506102c0526102c08051602001806101808284600060045af11561095857505060006101805118156106c1576101808060200151600082518060209013610958578091901261095857806020036101000a820490509050905015610958575b60016101c05260206101c0f35b635dc659b081141561070f576004358060a01c6109585780905061014052346109585760035433141561095857610140516001556001610160526020610160f35b6390b229978114156107a1576004358060011c61095857809050610140523461095857600354610180526004546101a05260006101605261016061012060006002818352015b6101205160200261018001513314156107715760018352610781565b8151600101808352811415610755575b505050610160511561095857610140516002556001610160526020610160f35b636b441a408114156107e2576004358060a01c6109585780905061014052346109585760035433141561095857610140516005556001610160526020610160f35b63e5ea47b881141561080e57346109585760055433141561095857336003556001610140526020610140f35b6395c8991581141561084f576004358060a01c6109585780905061014052346109585760045433141561095857610140516006556001610160526020610160f35b632d2cb67581141561087b57346109585760065433141561095857336004556001610140526020610140f35b63f7260d3e81141561089a573461095857600054610140526020610140f35b63ddceafa98114156108b9573461095857600154610140526020610140f35b639c868ac08114156108d8573461095857600254610140526020610140f35b638da5cb5b8114156108f7573461095857600354610140526020610140f35b6363a4042a811415610916573461095857600454610140526020610140f35b631ec0cdc1811415610935573461095857600554610140526020610140f35b63e19f994c811415610954573461095857600654610140526020610140f35b505b005b600080fd5b6100916109ee036100916000396100916109ee036000f35b600080fd000000000000000000000000ecb456ea5365865ebab8a2661b0c503410e9b347000000000000000000000000ecb456ea5365865ebab8a2661b0c503410e9b34700000000000000000000000040907540d8a6c65c637785e8f8b742ae6b0b9968000000000000000000000000467947ee34af926cf1dcac093870f613c96b1e0c
Deployed Bytecode
0x600436101561000d57610956565b60046000601c376000516389afcb44811415610545576004358060a01c61095857809050610140523461095857600254610958576370a0823161018052336101a0526020610180602461019c610140515afa1561095857601f3d111561095857610180516101605260006101605118156100c1576323b872dd61018052336101a052306101c052610160516101e0526020610180606461019c6000610140515af11561095857601f3d111561095857610180505b6370a0823161018052306101a0526020610180602461019c610140515afa1561095857601f3d111561095857610180516101605260006101605118156105385763493f4f746101a05260056101c05260206101a060246101bc6f22d53366457f9d5e68ec105046fc43835afa1561095857601f3d1115610958576101a0518060a01c610958578090506101805263bdf475c36101c052610140516101e05260206101c060246101dc610180515afa1561095857601f3d1115610958576101c0518060a01c610958578090506101a052639ac90d3d6102c0526101a0516102e0526101006102c060246102dc610180515afa156109585760ff3d1115610958576102c080518060a01c610958578090506101c05260208101518060a01c610958578090506101e05260408101518060a01c610958578090506102005260608101518060a01c610958578090506102205260808101518060a01c610958578090506102405260a08101518060a01c610958578090506102605260c08101518060a01c610958578090506102805260e08101518060a01c610958578090506102a05250610220516102ab57635b36389c6102c052610160516102e0526000610300526000610320526101a0513b15610958576000600060646102dc60006101a0515af11561095857610346565b610240516102fb5763ecb586a56102c052610160516102e0526000610300526000610320526000610340526101a0513b15610958576000600060846102dc60006101a0515af11561095857610345565b637d49d8756102c052610160516102e0526000610300526000610320526000610340526000610360526101a0513b15610958576000600060a46102dc60006101a0515af115610958575b5b6000546102c05261030060006008818352015b602061030051026101c001516102e0526102e05161037657610535565b6370a082316103205230610340526020610320602461033c6102e0515afa1561095857601f3d111561095857610320516101605273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26102e051141561045957632e1a7d4d61032052610160516103405273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc23b156109585760006000602461033c600073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af115610958576000610320526103208051602001806103408284600060045af1156109585750506000600061034051610360476102c0515af11561095857610525565b63a9059cbb6103645260046102c05161038452610160516103a452604001610360526103608051602001806103e08284600060045af11561095857505060206104806103e05161040060006102e0515af1156109585760203d808211156104c057806104c2565b815b90509050610460526104608051602001806103208284600060045af1156109585750506000610320511815610524576103208060200151600082518060209013610958578091901261095857806020036101000a820490509050905015610958575b5b8151600101808352811415610359575b50505b6001610180526020610180f35b63db2f5f798114156106ce576004358060a01c61095857809050610140523461095857600354610180526004546101a05260006101605261016061012060006002818352015b6101205160200261018001513314156105a757600183526105b7565b815160010180835281141561058b575b5050506101605115610958576370a0823161018052306101a0526020610180602461019c610140515afa1561095857601f3d111561095857610180516101605263a9059cbb6101c45260046001546101e45261016051610204526040016101c0526101c08051602001806102408284600060045af11561095857505060206102e0610240516102606000610140515af1156109585760203d8082111561065d578061065f565b815b905090506102c0526102c08051602001806101808284600060045af11561095857505060006101805118156106c1576101808060200151600082518060209013610958578091901261095857806020036101000a820490509050905015610958575b60016101c05260206101c0f35b635dc659b081141561070f576004358060a01c6109585780905061014052346109585760035433141561095857610140516001556001610160526020610160f35b6390b229978114156107a1576004358060011c61095857809050610140523461095857600354610180526004546101a05260006101605261016061012060006002818352015b6101205160200261018001513314156107715760018352610781565b8151600101808352811415610755575b505050610160511561095857610140516002556001610160526020610160f35b636b441a408114156107e2576004358060a01c6109585780905061014052346109585760035433141561095857610140516005556001610160526020610160f35b63e5ea47b881141561080e57346109585760055433141561095857336003556001610140526020610140f35b6395c8991581141561084f576004358060a01c6109585780905061014052346109585760045433141561095857610140516006556001610160526020610160f35b632d2cb67581141561087b57346109585760065433141561095857336004556001610140526020610140f35b63f7260d3e81141561089a573461095857600054610140526020610140f35b63ddceafa98114156108b9573461095857600154610140526020610140f35b639c868ac08114156108d8573461095857600254610140526020610140f35b638da5cb5b8114156108f7573461095857600354610140526020610140f35b6363a4042a811415610916573461095857600454610140526020610140f35b631ec0cdc1811415610935573461095857600554610140526020610140f35b63e19f994c811415610954573461095857600654610140526020610140f35b505b005b600080fd
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ecb456ea5365865ebab8a2661b0c503410e9b347000000000000000000000000ecb456ea5365865ebab8a2661b0c503410e9b34700000000000000000000000040907540d8a6c65c637785e8f8b742ae6b0b9968000000000000000000000000467947ee34af926cf1dcac093870f613c96b1e0c
-----Decoded View---------------
Arg [0] : _receiver (address): 0xeCb456EA5365865EbAb8a2661B0c503410e9B347
Arg [1] : _recovery (address): 0xeCb456EA5365865EbAb8a2661B0c503410e9B347
Arg [2] : _owner (address): 0x40907540d8a6C65c637785e8f8B742ae6b0b9968
Arg [3] : _emergency_owner (address): 0x467947EE34aF926cF1DCac093870f613C96B1E0c
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000ecb456ea5365865ebab8a2661b0c503410e9b347
Arg [1] : 000000000000000000000000ecb456ea5365865ebab8a2661b0c503410e9b347
Arg [2] : 00000000000000000000000040907540d8a6c65c637785e8f8b742ae6b0b9968
Arg [3] : 000000000000000000000000467947ee34af926cf1dcac093870f613c96b1e0c
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.