ETH Price: $2,654.90 (+1.43%)

Contract

0x2618e94a7F6118acED2E51e0a05da43D2e2eD40C
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Token Transfers found.

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.1

Optimization Enabled:
N/A

Other Settings:
default evmVersion, MIT license

Contract Source Code (Vyper language format)

# @version 0.3.1
# @author skozin, hostgame, blitz-1306 <[email protected]>
# @licence MIT
from vyper.interfaces import ERC20

BETH_TOKEN: constant(address) = 0x707F9118e33A9B8998beA41dd0d46f38bb963FC8
UST_WRAPPER_TOKEN: constant(address) = 0xa693B19d2931d498c5B318dF961919BB4aee87a5

TERRA_CHAIN_ID: constant(uint256) = 3

# Max value of uint32 integer (4 bytes). Equivalent of 0xFFFFFFFF.
MAX_UINT32: constant(uint256) = 4294967295

# Address of currently used Wormhole token bridge implementation.
wormhole_token_bridge: public(address)

@external
def __init__(wormhole_token_bridge: address):
    assert wormhole_token_bridge != ZERO_ADDRESS, "bridge is zero address"

    self.wormhole_token_bridge = wormhole_token_bridge


# Prepares data and calls `Bridge.transferTokens()`.
#
# First 64 bytes of `_extra_data` argument are reserved for passing 
# `nonce` (first 32 bytes) and `arbiter_fee` (second 32 bytes) values.
#
# Vyper does not support few types (uint16 and uint32), that are available in Solidity.
# We encode a call payload manually for compatibility reasons.
#
# See target method signature: https://etherscan.io/address/0x6c4c12987303b2c94b2c76c612fc5f4d2f0360f7#code#F2#L93
@internal
@payable
def _transfer_asset(_bridge: address, _asset: address, _amount: uint256, _recipient: bytes32, _extra_data: Bytes[1024]):
    nonce: uint256 = 0
    arbiter_fee: uint256 = 0

    if len(_extra_data) >= 32:
        nonce = extract32(_extra_data, 0, output_type=uint256)

        assert nonce <= MAX_UINT32, "nonce exceeds size of uint32 (4 bytes)"

    if len(_extra_data) >= 64:
        arbiter_fee = extract32(_extra_data, 32, output_type=uint256)

    assert ERC20(_asset).approve(_bridge, _amount)

    raw_call(
        _bridge,
        concat(
            method_id('transferTokens(address,uint256,uint16,bytes32,uint256,uint32)'),
            convert(_asset, bytes32),
            convert(_amount, bytes32),
            convert(TERRA_CHAIN_ID, bytes32),
            _recipient,
            convert(arbiter_fee, bytes32),
            convert(nonce, bytes32)
        ),
        value=msg.value
    )


# Submits amount of bETH tokens to Terra address via token bridge.
@external
@payable
def forward_beth(_terra_address: bytes32, _amount: uint256, _extra_data: Bytes[1024]):
    self._transfer_asset(self.wormhole_token_bridge, BETH_TOKEN, _amount, _terra_address, _extra_data)

# Submits amount of UST tokens to Terra address via token bridge.
@external
@payable
def forward_ust(_terra_address: bytes32, _amount: uint256, _extra_data: Bytes[1024]):
    self._transfer_asset(self.wormhole_token_bridge, UST_WRAPPER_TOKEN, _amount, _terra_address, _extra_data)


# Adjusts amount, considering allowed decimals.
# Bridges have some limitations as target chain or token
# might not support an equivalent precision.
#
# Wormhole only supports the precision of 8 decimals.
# See https://etherscan.io/address/0x6c4c12987303b2c94b2c76c612fc5f4d2f0360f7#code#F2#L113
@external
@view
def adjust_amount(_amount: uint256, _decimals: uint256) -> uint256:
    if _decimals > 8:
        mult: uint256 = 10 ** (_decimals - 8)

        return (_amount / mult) * mult

    return _amount

Contract Security Audit

Contract ABI

[{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"wormhole_token_bridge","type":"address"}],"outputs":[]},{"stateMutability":"payable","type":"function","name":"forward_beth","inputs":[{"name":"_terra_address","type":"bytes32"},{"name":"_amount","type":"uint256"},{"name":"_extra_data","type":"bytes"}],"outputs":[],"gas":54007},{"stateMutability":"payable","type":"function","name":"forward_ust","inputs":[{"name":"_terra_address","type":"bytes32"},{"name":"_amount","type":"uint256"},{"name":"_extra_data","type":"bytes"}],"outputs":[],"gas":54037},{"stateMutability":"view","type":"function","name":"adjust_amount","inputs":[{"name":"_amount","type":"uint256"},{"name":"_decimals","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}],"gas":1293},{"stateMutability":"view","type":"function","name":"wormhole_token_bridge","inputs":[],"outputs":[{"name":"","type":"address"}],"gas":2550}]

60206104ba6080396080518060a01c6104b55760e052600060e0511415610094576016610100527f627269646765206973207a65726f2061646472657373000000000000000000006101205261010050610100518061012001818260206001820306601f82010390500336823750506308c379a060c052602060e0526101005160206001820306601f820103905060440160dcfd5b60e05160005561049d56600436101561000d576101b2565b60046000601c3760005163f217dfa7811861008e576044356004016104008135116103f95780803560200180826107203750505060005460e05273707f9118e33a9b8998bea41dd0d46f38bb963fc8610100526024356101205260043561014052610720805160200180610160828460045afa9050505061008c6101b8565b005b6370a1ee1f8118610105576044356004016104008135116103f95780803560200180826107203750505060005460e05273a693b19d2931d498c5b318df961919bb4aee87a5610100526024356101205260043561014052610720805160200180610160828460045afa905050506101036101b8565b005b346103f95763d775b5f28118610199576008602435111561018c57604e60243560088082106103f9578082039050905010156103f95760243560088082106103f95780820390509050600a0a60e05260043560e0518080156103f95782049050905060e0518082028215828483041417156103f95790509050610100526020610100610197565b60043560e052602060e05bf35b630cd40b9781186101b05760005460e052602060e0f35b505b60006000fd5b60403661058037602061016051106102975761016060206000602083510381136103f9570460200260200181015190506105805263ffffffff6105805111156102975760266105c0527f6e6f6e636520657863656564732073697a65206f662075696e743332202834206105e0527f6279746573290000000000000000000000000000000000000000000000000000610600526105c0506105c051806105e001818260206001820306601f82010390500336823750506308c379a06105805260206105a0526105c05160206001820306601f820103905060440161059cfd5b604061016051106102c55761016060206020602083510381136103f9570460200260200181015190506105a0525b63095ea7b36105c05260e0516105e052610120516106005260206105c060446105dc6000610100515af16102fe573d600060003e3d6000fd5b601f3d11156103f9576105c051156103f957600060046105c0527f0f5287b0000000000000000000000000000000000000000000000000000000006105e0526105c06004806020846106000101826020850160045afa50508051820191505061010051602082610600010152602081019050610120516020826106000101526020810190506003602082610600010152602081019050610140516020826106000101526020810190506105a051602082610600010152602081019050610580516020826106000101526020810190508061060052610600505060006000610600516106203460e0515af16103f7573d600060003e3d6000fd5b565b600080fd5b61009f61049d0361009f60003961009f61049d036000f35b600080fd0000000000000000000000003ee18b2214aff97000d974cf647e7c347e8fa585

Deployed Bytecode

0x600436101561000d576101b2565b60046000601c3760005163f217dfa7811861008e576044356004016104008135116103f95780803560200180826107203750505060005460e05273707f9118e33a9b8998bea41dd0d46f38bb963fc8610100526024356101205260043561014052610720805160200180610160828460045afa9050505061008c6101b8565b005b6370a1ee1f8118610105576044356004016104008135116103f95780803560200180826107203750505060005460e05273a693b19d2931d498c5b318df961919bb4aee87a5610100526024356101205260043561014052610720805160200180610160828460045afa905050506101036101b8565b005b346103f95763d775b5f28118610199576008602435111561018c57604e60243560088082106103f9578082039050905010156103f95760243560088082106103f95780820390509050600a0a60e05260043560e0518080156103f95782049050905060e0518082028215828483041417156103f95790509050610100526020610100610197565b60043560e052602060e05bf35b630cd40b9781186101b05760005460e052602060e0f35b505b60006000fd5b60403661058037602061016051106102975761016060206000602083510381136103f9570460200260200181015190506105805263ffffffff6105805111156102975760266105c0527f6e6f6e636520657863656564732073697a65206f662075696e743332202834206105e0527f6279746573290000000000000000000000000000000000000000000000000000610600526105c0506105c051806105e001818260206001820306601f82010390500336823750506308c379a06105805260206105a0526105c05160206001820306601f820103905060440161059cfd5b604061016051106102c55761016060206020602083510381136103f9570460200260200181015190506105a0525b63095ea7b36105c05260e0516105e052610120516106005260206105c060446105dc6000610100515af16102fe573d600060003e3d6000fd5b601f3d11156103f9576105c051156103f957600060046105c0527f0f5287b0000000000000000000000000000000000000000000000000000000006105e0526105c06004806020846106000101826020850160045afa50508051820191505061010051602082610600010152602081019050610120516020826106000101526020810190506003602082610600010152602081019050610140516020826106000101526020810190506105a051602082610600010152602081019050610580516020826106000101526020810190508061060052610600505060006000610600516106203460e0515af16103f7573d600060003e3d6000fd5b565b600080fd

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

0000000000000000000000003ee18b2214aff97000d974cf647e7c347e8fa585

-----Decoded View---------------
Arg [0] : wormhole_token_bridge (address): 0x3ee18B2214AFF97000D974cf647E7C347E8fa585

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003ee18b2214aff97000d974cf647e7c347e8fa585


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

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.