FTM Price: $0.99 (-2.58%)
Gas: 106 GWei

Contract

0x423F26eB44D4be89072EEcfc81b95065cE43BF4B
 

Overview

FTM Balance

Fantom LogoFantom LogoFantom Logo0 FTM

FTM Value

$0.00

Token Holdings

Sponsored

Transaction Hash
Method
Block
From
To
Value
Set_receiver252308142021-12-17 13:40:49832 days ago1639748449IN
0x423F26eB...5cE43BF4B
0 FTM0.00296311106.7713
Burn220526032021-11-14 19:08:44865 days ago1636916924IN
0x423F26eB...5cE43BF4B
0 FTM0.27565424163.756
Burn220524742021-11-14 19:06:59865 days ago1636916819IN
0x423F26eB...5cE43BF4B
0 FTM0.33275772193.1617
0x60206106220524222021-11-14 19:06:18865 days ago1636916778IN
 Create: Vyper_contract
0 FTM0.08233145193.5685

Latest 1 internal transaction

Parent Txn Hash Block From To Value
220524222021-11-14 19:06:18865 days ago1636916778  Contract Creation0 FTM
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.0

Optimization Enabled:
N/A

Other Settings:
MIT license

Contract Source Code (Vyper language format)

# @version 0.3.0
"""
@title Underlying Burner
@notice Performs a direct swap to USDT
"""

from vyper.interfaces import ERC20


interface RegistrySwap:
    def exchange_with_best_rate(
        _from: address,
        _to: address,
        _amount: uint256,
        _expected: uint256
    ) -> uint256: payable

interface AddressProvider:
    def get_address(_id: uint256) -> address: view


receiver: public(address)
is_killed: public(bool)

owner: public(address)
future_owner: public(address)

is_approved: HashMap[address, HashMap[address, bool]]

ADDRESS_PROVIDER: constant(address) = 0x0000000022D53366457F9d5E68Ec105046FC4383
USDT: constant(address) = 0x049d68029688eAbF473097a2fC38ef61633A3C7A

@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)
    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)

    # swap for USDT
    registry_swap: address = AddressProvider(ADDRESS_PROVIDER).get_address(2)
    if not self.is_approved[registry_swap][_coin]:
        response: Bytes[32] = raw_call(
            _coin,
            _abi_encode(registry_swap, MAX_UINT256, method_id=method_id("approve(address,uint256)")),
            max_outsize=32,
        )
        if len(response) != 0:
            assert convert(response, bool)
        self.is_approved[registry_swap][_coin] = True

    RegistrySwap(registry_swap).exchange_with_best_rate(_coin, USDT, amount, 0)

    # transfer USDT to receiver
    amount = ERC20(USDT).balanceOf(self)
    ERC20(USDT).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

Contract ABI

[{"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":66976},{"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}]

602061064a60c03960c0518060a01c61064557809050610140526020602061064a0160c03960c0518060a01c6106455780905061016052610140516000556101605160025561062d56600436101561000d576105d9565b60046000601c37600051346105df576389afcb4481141561036e576004358060a01c6105df57809050610140526001546105df576370a0823161018052336101a0526020610180602461019c610140515afa156105df57601f3d11156105df57610180516101605260006101605111156100c1576323b872dd61018052336101a052306101c052610160516101e0526020610180606461019c6000610140515af1156105df57601f3d11156105df57610180505b6370a0823161018052306101a0526020610180602461019c610140515afa156105df57601f3d11156105df57610180516101605263493f4f746101a05260026101c05260206101a060246101bc6f22d53366457f9d5e68ec105046fc43835afa156105df57601f3d11156105df576101a0518060a01c6105df578090506101805260046101805160e05260c052604060c0206101405160e05260c052604060c020546102735763095ea7b36101e452600461018051610204527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610224526040016101e0526101e08051602001806102608284600060045af1156105df5750506020610300610260516102806000610140515af1156105df5760203d808211156101eb57806101ed565b815b905090506102e0526102e08051602001806101a08284600060045af1156105df57505060006101a051181561024f576101a080602001516000825180602090136105df57809190126105df57806020036101000a8204905090509050156105df575b600160046101805160e05260c052604060c0206101405160e05260c052604060c020555b6310e5e3036101a052610140516101c05273049d68029688eabf473097a2fc38ef61633a3c7a6101e052610160516102005260006102205260206101a060846101bc6000610180515af1156105df57601f3d11156105df576101a0506370a082316101a052306101c05260206101a060246101bc73049d68029688eabf473097a2fc38ef61633a3c7a5afa156105df57601f3d11156105df576101a0516101605263a9059cbb6101a0526000546101c052610160516101e05260206101a060446101bc600073049d68029688eabf473097a2fc38ef61633a3c7a5af1156105df57601f3d11156105df576101a05060016101a05260206101a0f35b63db2f5f7981141561049f576004358060a01c6105df57809050610140526002543314156105df576370a0823161018052306101a0526020610180602461019c610140515afa156105df57601f3d11156105df57610180516101605263a9059cbb6101c4526004336101e45261016051610204526040016101c0526101c08051602001806102408284600060045af1156105df57505060206102e0610240516102606000610140515af1156105df5760203d8082111561042e5780610430565b815b905090506102c0526102c08051602001806101808284600060045af1156105df57505060006101805118156104925761018080602001516000825180602090136105df57809190126105df57806020036101000a8204905090509050156105df575b60016101c05260206101c0f35b63d1dd6f568114156104d0576004358060a01c6105df57809050610140526002543314156105df5761014051600055005b6390b2299781141561050c576004358060011c6105df57809050610140526002543314156105df57610140516001556001610160526020610160f35b636b441a40811415610548576004358060a01c6105df57809050610140526002543314156105df57610140516003556001610160526020610160f35b63e5ea47b881141561056f576003543314156105df57336002556001610140526020610140f35b63f7260d3e81141561058957600054610140526020610140f35b639c868ac08114156105a357600154610140526020610140f35b638da5cb5b8114156105bd57600254610140526020610140f35b631ec0cdc18114156105d757600354610140526020610140f35b505b60006000fd5b600080fd5b61004961062d0361004960003961004961062d036000f35b600080fd000000000000000000000000ffbacce0cc7c19d46132f1258fc16cf6871d153c0000000000000000000000007eeac6cddbd1d0b8af061742d41877d7f707289a

Deployed Bytecode

0x600436101561000d576105d9565b60046000601c37600051346105df576389afcb4481141561036e576004358060a01c6105df57809050610140526001546105df576370a0823161018052336101a0526020610180602461019c610140515afa156105df57601f3d11156105df57610180516101605260006101605111156100c1576323b872dd61018052336101a052306101c052610160516101e0526020610180606461019c6000610140515af1156105df57601f3d11156105df57610180505b6370a0823161018052306101a0526020610180602461019c610140515afa156105df57601f3d11156105df57610180516101605263493f4f746101a05260026101c05260206101a060246101bc6f22d53366457f9d5e68ec105046fc43835afa156105df57601f3d11156105df576101a0518060a01c6105df578090506101805260046101805160e05260c052604060c0206101405160e05260c052604060c020546102735763095ea7b36101e452600461018051610204527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610224526040016101e0526101e08051602001806102608284600060045af1156105df5750506020610300610260516102806000610140515af1156105df5760203d808211156101eb57806101ed565b815b905090506102e0526102e08051602001806101a08284600060045af1156105df57505060006101a051181561024f576101a080602001516000825180602090136105df57809190126105df57806020036101000a8204905090509050156105df575b600160046101805160e05260c052604060c0206101405160e05260c052604060c020555b6310e5e3036101a052610140516101c05273049d68029688eabf473097a2fc38ef61633a3c7a6101e052610160516102005260006102205260206101a060846101bc6000610180515af1156105df57601f3d11156105df576101a0506370a082316101a052306101c05260206101a060246101bc73049d68029688eabf473097a2fc38ef61633a3c7a5afa156105df57601f3d11156105df576101a0516101605263a9059cbb6101a0526000546101c052610160516101e05260206101a060446101bc600073049d68029688eabf473097a2fc38ef61633a3c7a5af1156105df57601f3d11156105df576101a05060016101a05260206101a0f35b63db2f5f7981141561049f576004358060a01c6105df57809050610140526002543314156105df576370a0823161018052306101a0526020610180602461019c610140515afa156105df57601f3d11156105df57610180516101605263a9059cbb6101c4526004336101e45261016051610204526040016101c0526101c08051602001806102408284600060045af1156105df57505060206102e0610240516102606000610140515af1156105df5760203d8082111561042e5780610430565b815b905090506102c0526102c08051602001806101808284600060045af1156105df57505060006101805118156104925761018080602001516000825180602090136105df57809190126105df57806020036101000a8204905090509050156105df575b60016101c05260206101c0f35b63d1dd6f568114156104d0576004358060a01c6105df57809050610140526002543314156105df5761014051600055005b6390b2299781141561050c576004358060011c6105df57809050610140526002543314156105df57610140516001556001610160526020610160f35b636b441a40811415610548576004358060a01c6105df57809050610140526002543314156105df57610140516003556001610160526020610160f35b63e5ea47b881141561056f576003543314156105df57336002556001610140526020610140f35b63f7260d3e81141561058957600054610140526020610140f35b639c868ac08114156105a357600154610140526020610140f35b638da5cb5b8114156105bd57600254610140526020610140f35b631ec0cdc18114156105d757600354610140526020610140f35b505b60006000fd5b600080fd

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000ffbacce0cc7c19d46132f1258fc16cf6871d153c0000000000000000000000007eeac6cddbd1d0b8af061742d41877d7f707289a

-----Decoded View---------------
Arg [0] : _receiver (address): 0xffbACcE0CC7C19d46132f1258FC16CF6871D153c
Arg [1] : _owner (address): 0x7EeAC6CDdbd1D0B8aF061742D41877D7F707289a

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ffbacce0cc7c19d46132f1258fc16cf6871d153c
Arg [1] : 0000000000000000000000007eeac6cddbd1d0b8af061742d41877d7f707289a


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.