More Info
Private Name Tags
ContractCreator
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 Tricrypto Burner @notice Converts tricrypto LP tokens to USDC and transfers to `ChildBurner` """ from vyper.interfaces import ERC20 interface StableSwap: def remove_liquidity_one_coin( _token_amount: uint256, i: int128, _min_amount: uint256, _use_underlying: bool ) -> uint256: nonpayable interface CryptoSwap: def remove_liquidity_one_coin(token_amount: uint256, i: uint256, min_amount: uint256): nonpayable receiver: public(address) is_killed: public(bool) owner: public(address) future_owner: public(address) is_approved: HashMap[address, HashMap[address, bool]] ATRICRYPTO3: constant(address) = 0x92215849c439E1f8612b6646060B4E3E5ef822cC SS_AAVE: constant(address) = 0x445FE580eF8d70FF569aB36e80c647af338db351 AM3CRV: constant(address) = 0xE7a24EF0C5e95Ffb0f6684b813A78F2a3AD7D171 USDC: constant(address) = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 @external def __init__(_receiver: address, _owner: address): """ @notice Contract constructor @param _receiver Address that converted tokens are transferred to. Should be set to the `ChildBurner` deployment. @param _owner Owner address. Can kill the contract and recover tokens. """ self.receiver = _receiver self.owner = _owner @external def burn(_coin: address) -> bool: """ @notice Unwrap `_coin` and transfer to the receiver @param _coin Address of the coin being unwrapped @return bool success """ assert not self.is_killed # dev: is killed # transfer coins from caller amount: uint256 = ERC20(_coin).balanceOf(msg.sender) ERC20(_coin).transferFrom(msg.sender, self, amount) # get actual balance in case of transfer fee or pre-existing balance amount = ERC20(_coin).balanceOf(self) # withdraw from tricrypto as AM3CRV CryptoSwap(ATRICRYPTO3).remove_liquidity_one_coin(amount, 0, 0) # withdraw from aave as USDC amount = ERC20(AM3CRV).balanceOf(self) StableSwap(SS_AAVE).remove_liquidity_one_coin(amount, 1, 0, True) # transfer USDC to receiver amount = ERC20(USDC).balanceOf(self) ERC20(USDC).transfer(self.receiver, amount) return True @external def recover_balance(_coin: address) -> bool: """ @notice Recover ERC20 tokens from this contract @param _coin Token address @return bool success """ assert msg.sender == self.owner # dev: only owner amount: uint256 = ERC20(_coin).balanceOf(self) response: Bytes[32] = raw_call( _coin, _abi_encode(msg.sender, amount, method_id=method_id("transfer(address,uint256)")), max_outsize=32, ) if len(response) != 0: assert convert(response, bool) return True @external def set_receiver(_receiver: address): assert msg.sender == self.owner self.receiver = _receiver @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 == self.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
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_receiver","type":"address"},{"name":"_owner","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"burn","inputs":[{"name":"_coin","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":26870},{"stateMutability":"nonpayable","type":"function","name":"recover_balance","inputs":[{"name":"_coin","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":12531},{"stateMutability":"nonpayable","type":"function","name":"set_receiver","inputs":[{"name":"_receiver","type":"address"}],"outputs":[],"gas":37702},{"stateMutability":"nonpayable","type":"function","name":"set_killed","inputs":[{"name":"_is_killed","type":"bool"}],"outputs":[{"name":"","type":"bool"}],"gas":37875},{"stateMutability":"nonpayable","type":"function","name":"commit_transfer_ownership","inputs":[{"name":"_future_owner","type":"address"}],"outputs":[{"name":"","type":"bool"}],"gas":37905},{"stateMutability":"nonpayable","type":"function","name":"accept_transfer_ownership","inputs":[],"outputs":[{"name":"","type":"bool"}],"gas":37774},{"stateMutability":"view","type":"function","name":"receiver","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2706},{"stateMutability":"view","type":"function","name":"is_killed","inputs":[],"outputs":[{"name":"","type":"bool"}],"gas":2736},{"stateMutability":"view","type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2766},{"stateMutability":"view","type":"function","name":"future_owner","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2796}]
Contract Creation Code
602061055f60c03960c0518060a01c61055a57809050610140526020602061055f0160c03960c0518060a01c61055a5780905061016052610140516000556101605160025561054256600436101561000d576104ee565b60046000601c37600051346104f4576389afcb44811415610283576004358060a01c6104f457809050610140526001546104f4576370a0823161018052336101a0526020610180602461019c610140515afa156104f457601f3d11156104f45761018051610160526323b872dd61018052336101a052306101c052610160516101e0526020610180606461019c6000610140515af1156104f457601f3d11156104f457610180506370a0823161018052306101a0526020610180602461019c610140515afa156104f457601f3d11156104f457610180516101605263f1dc3cc961018052610160516101a05260006101c05260006101e0527392215849c439e1f8612b6646060b4e3e5ef822cc3b156104f45760006000606461019c60007392215849c439e1f8612b6646060b4e3e5ef822cc5af1156104f4576370a0823161018052306101a0526020610180602461019c73e7a24ef0c5e95ffb0f6684b813a78f2a3ad7d1715afa156104f457601f3d11156104f457610180516101605263517a55a361018052610160516101a05260016101c05260006101e0526001610200526020610180608461019c600073445fe580ef8d70ff569ab36e80c647af338db3515af1156104f457601f3d11156104f457610180506370a0823161018052306101a0526020610180602461019c732791bca1f2de4661ed88a30c99a7a9449aa841745afa156104f457601f3d11156104f457610180516101605263a9059cbb610180526000546101a052610160516101c0526020610180604461019c6000732791bca1f2de4661ed88a30c99a7a9449aa841745af1156104f457601f3d11156104f457610180506001610180526020610180f35b63db2f5f798114156103b4576004358060a01c6104f457809050610140526002543314156104f4576370a0823161018052306101a0526020610180602461019c610140515afa156104f457601f3d11156104f457610180516101605263a9059cbb6101c4526004336101e45261016051610204526040016101c0526101c08051602001806102408284600060045af1156104f457505060206102e0610240516102606000610140515af1156104f45760203d808211156103435780610345565b815b905090506102c0526102c08051602001806101808284600060045af1156104f457505060006101805118156103a75761018080602001516000825180602090136104f457809190126104f457806020036101000a8204905090509050156104f4575b60016101c05260206101c0f35b63d1dd6f568114156103e5576004358060a01c6104f457809050610140526002543314156104f45761014051600055005b6390b22997811415610421576004358060011c6104f457809050610140526002543314156104f457610140516001556001610160526020610160f35b636b441a4081141561045d576004358060a01c6104f457809050610140526002543314156104f457610140516003556001610160526020610160f35b63e5ea47b8811415610484576003543314156104f457336002556001610140526020610140f35b63f7260d3e81141561049e57600054610140526020610140f35b639c868ac08114156104b857600154610140526020610140f35b638da5cb5b8114156104d257600254610140526020610140f35b631ec0cdc18114156104ec57600354610140526020610140f35b505b60006000fd5b600080fd5b61004961054203610049600039610049610542036000f35b600080fd0000000000000000000000004473243a61b5193670d1324872368d015081822f0000000000000000000000007eeac6cddbd1d0b8af061742d41877d7f707289a
Deployed Bytecode
0x600436101561000d576104ee565b60046000601c37600051346104f4576389afcb44811415610283576004358060a01c6104f457809050610140526001546104f4576370a0823161018052336101a0526020610180602461019c610140515afa156104f457601f3d11156104f45761018051610160526323b872dd61018052336101a052306101c052610160516101e0526020610180606461019c6000610140515af1156104f457601f3d11156104f457610180506370a0823161018052306101a0526020610180602461019c610140515afa156104f457601f3d11156104f457610180516101605263f1dc3cc961018052610160516101a05260006101c05260006101e0527392215849c439e1f8612b6646060b4e3e5ef822cc3b156104f45760006000606461019c60007392215849c439e1f8612b6646060b4e3e5ef822cc5af1156104f4576370a0823161018052306101a0526020610180602461019c73e7a24ef0c5e95ffb0f6684b813a78f2a3ad7d1715afa156104f457601f3d11156104f457610180516101605263517a55a361018052610160516101a05260016101c05260006101e0526001610200526020610180608461019c600073445fe580ef8d70ff569ab36e80c647af338db3515af1156104f457601f3d11156104f457610180506370a0823161018052306101a0526020610180602461019c732791bca1f2de4661ed88a30c99a7a9449aa841745afa156104f457601f3d11156104f457610180516101605263a9059cbb610180526000546101a052610160516101c0526020610180604461019c6000732791bca1f2de4661ed88a30c99a7a9449aa841745af1156104f457601f3d11156104f457610180506001610180526020610180f35b63db2f5f798114156103b4576004358060a01c6104f457809050610140526002543314156104f4576370a0823161018052306101a0526020610180602461019c610140515afa156104f457601f3d11156104f457610180516101605263a9059cbb6101c4526004336101e45261016051610204526040016101c0526101c08051602001806102408284600060045af1156104f457505060206102e0610240516102606000610140515af1156104f45760203d808211156103435780610345565b815b905090506102c0526102c08051602001806101808284600060045af1156104f457505060006101805118156103a75761018080602001516000825180602090136104f457809190126104f457806020036101000a8204905090509050156104f4575b60016101c05260206101c0f35b63d1dd6f568114156103e5576004358060a01c6104f457809050610140526002543314156104f45761014051600055005b6390b22997811415610421576004358060011c6104f457809050610140526002543314156104f457610140516001556001610160526020610160f35b636b441a4081141561045d576004358060a01c6104f457809050610140526002543314156104f457610140516003556001610160526020610160f35b63e5ea47b8811415610484576003543314156104f457336002556001610140526020610140f35b63f7260d3e81141561049e57600054610140526020610140f35b639c868ac08114156104b857600154610140526020610140f35b638da5cb5b8114156104d257600254610140526020610140f35b631ec0cdc18114156104ec57600354610140526020610140f35b505b60006000fd5b600080fd
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004473243a61b5193670d1324872368d015081822f0000000000000000000000007eeac6cddbd1d0b8af061742d41877d7f707289a
-----Decoded View---------------
Arg [0] : _receiver (address): 0x4473243A61b5193670D1324872368d015081822f
Arg [1] : _owner (address): 0x7EeAC6CDdbd1D0B8aF061742D41877D7F707289a
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004473243a61b5193670d1324872368d015081822f
Arg [1] : 0000000000000000000000007eeac6cddbd1d0b8af061742d41877d7f707289a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.