Contract 0x3e6586e144cD0DcE44C8FDc7d28CC8cf656f3b36

Contract Overview

Balance:
0 Ether
Txn Hash
Method
Block
From
To
Value
0x4fdec11c0559743b8b07ab8d5a61cda8eb4ec8a3558b69260038f9533d21e3650x60206104122092312022-04-21 11:28:30160 days 19 hrs ago0x02139137fdd974181a49268d7b0ae888634e5469 IN  Create: Vyper_contract0 Ether0.0894261300
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x4280ceb132d9cc4be441df546c157465558e36a369c6114c7b3c567c3b285575125520502022-07-08 16:04:4882 days 15 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xf174f9a837536c449321df1ca093bb96948d53860 Ether
0x4280ceb132d9cc4be441df546c157465558e36a369c6114c7b3c567c3b285575125520502022-07-08 16:04:4882 days 15 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0x4280ceb132d9cc4be441df546c157465558e36a369c6114c7b3c567c3b285575125520502022-07-08 16:04:4882 days 15 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xa60100d5e12e9f83c1b04997314cf11685a618ff0 Ether
0x4280ceb132d9cc4be441df546c157465558e36a369c6114c7b3c567c3b285575125520502022-07-08 16:04:4882 days 15 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0x4280ceb132d9cc4be441df546c157465558e36a369c6114c7b3c567c3b285575125520502022-07-08 16:04:4882 days 15 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0x4280ceb132d9cc4be441df546c157465558e36a369c6114c7b3c567c3b285575125520502022-07-08 16:04:4882 days 15 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0x97d208c7717d2715913606402e49afb3f2ae6d1932747fe8e5af5a4b831d7efe125231512022-07-04 11:01:1286 days 20 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xf174f9a837536c449321df1ca093bb96948d53860 Ether
0x97d208c7717d2715913606402e49afb3f2ae6d1932747fe8e5af5a4b831d7efe125231512022-07-04 11:01:1286 days 20 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0x97d208c7717d2715913606402e49afb3f2ae6d1932747fe8e5af5a4b831d7efe125231512022-07-04 11:01:1286 days 20 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xa60100d5e12e9f83c1b04997314cf11685a618ff0 Ether
0x97d208c7717d2715913606402e49afb3f2ae6d1932747fe8e5af5a4b831d7efe125231512022-07-04 11:01:1286 days 20 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0x97d208c7717d2715913606402e49afb3f2ae6d1932747fe8e5af5a4b831d7efe125231512022-07-04 11:01:1286 days 20 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0x97d208c7717d2715913606402e49afb3f2ae6d1932747fe8e5af5a4b831d7efe125231512022-07-04 11:01:1286 days 20 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0xb8b28c69f7b5e7eb7bc3d5c5531ecdfa5ddf9a9f016619be3e6bb7eb335f1a19122950022022-05-24 18:24:21127 days 12 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xf174f9a837536c449321df1ca093bb96948d53860 Ether
0xb8b28c69f7b5e7eb7bc3d5c5531ecdfa5ddf9a9f016619be3e6bb7eb335f1a19122950022022-05-24 18:24:21127 days 12 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0xb8b28c69f7b5e7eb7bc3d5c5531ecdfa5ddf9a9f016619be3e6bb7eb335f1a19122950022022-05-24 18:24:21127 days 12 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xa60100d5e12e9f83c1b04997314cf11685a618ff0 Ether
0xb8b28c69f7b5e7eb7bc3d5c5531ecdfa5ddf9a9f016619be3e6bb7eb335f1a19122950022022-05-24 18:24:21127 days 12 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0xb8b28c69f7b5e7eb7bc3d5c5531ecdfa5ddf9a9f016619be3e6bb7eb335f1a19122950022022-05-24 18:24:21127 days 12 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0xb8b28c69f7b5e7eb7bc3d5c5531ecdfa5ddf9a9f016619be3e6bb7eb335f1a19122950022022-05-24 18:24:21127 days 12 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0x54d42706b7a9291f7aa091f2661e4a5ba78d38913ae65f1915148f0b18264ff7122108732022-04-22 9:34:59159 days 21 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xf174f9a837536c449321df1ca093bb96948d53860 Ether
0x54d42706b7a9291f7aa091f2661e4a5ba78d38913ae65f1915148f0b18264ff7122108732022-04-22 9:34:59159 days 21 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0x54d42706b7a9291f7aa091f2661e4a5ba78d38913ae65f1915148f0b18264ff7122108732022-04-22 9:34:59159 days 21 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xa60100d5e12e9f83c1b04997314cf11685a618ff0 Ether
0x54d42706b7a9291f7aa091f2661e4a5ba78d38913ae65f1915148f0b18264ff7122108732022-04-22 9:34:59159 days 21 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360x00000000000000000000000000000000000000040 Ether
0x54d42706b7a9291f7aa091f2661e4a5ba78d38913ae65f1915148f0b18264ff7122108732022-04-22 9:34:59159 days 21 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0x54d42706b7a9291f7aa091f2661e4a5ba78d38913ae65f1915148f0b18264ff7122108732022-04-22 9:34:59159 days 21 hrs ago 0xd7fe7881cd50fc155bc310224352a812214e1e50 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b360 Ether
0x4887c071bd52c1500563c29912c499ca81d46d5e91da4cd9e241f07eb18eae77122093982022-04-21 13:50:29160 days 17 hrs ago 0x3e6586e144cd0dce44c8fdc7d28cc8cf656f3b36 0xf174f9a837536c449321df1ca093bb96948d53860 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vyper_contract

Compiler Version
vyper:0.3.1

Optimization Enabled:
N/A

Other Settings:
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) = 0xA60100d5e12E9F83c1B04997314cf11685A618fF
UST_WRAPPER_TOKEN: constant(address) = 0x6cA13a4ab78dd7D657226b155873A04DB929A3A4

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 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}]

60206104ba6080396080518060a01c6104b55760e052600060e0511415610094576016610100527f627269646765206973207a65726f2061646472657373000000000000000000006101205261010050610100518061012001818260206001820306601f82010390500336823750506308c379a060c052602060e0526101005160206001820306601f820103905060440160dcfd5b60e05160005561049d56600436101561000d576101b2565b60046000601c3760005163f217dfa7811861008e576044356004016104008135116103f95780803560200180826107203750505060005460e05273a60100d5e12e9f83c1b04997314cf11685a618ff610100526024356101205260043561014052610720805160200180610160828460045afa9050505061008c6101b8565b005b6370a1ee1f8118610105576044356004016104008135116103f95780803560200180826107203750505060005460e052736ca13a4ab78dd7d657226b155873a04db929a3a4610100526024356101205260043561014052610720805160200180610160828460045afa905050506101036101b8565b005b346103f95763d775b5f28118610199576008602435111561018c57604e60243560088082106103f9578082039050905010156103f95760243560088082106103f95780820390509050600a0a60e05260043560e0518080156103f95782049050905060e0518082028215828483041417156103f95790509050610100526020610100610197565b60043560e052602060e05bf35b630cd40b9781186101b05760005460e052602060e0f35b505b60006000fd5b60403661058037602061016051106102975761016060206000602083510381136103f9570460200260200181015190506105805263ffffffff6105805111156102975760266105c0527f6e6f6e636520657863656564732073697a65206f662075696e743332202834206105e0527f6279746573290000000000000000000000000000000000000000000000000000610600526105c0506105c051806105e001818260206001820306601f82010390500336823750506308c379a06105805260206105a0526105c05160206001820306601f820103905060440161059cfd5b604061016051106102c55761016060206020602083510381136103f9570460200260200181015190506105a0525b63095ea7b36105c05260e0516105e052610120516106005260206105c060446105dc6000610100515af16102fe573d600060003e3d6000fd5b601f3d11156103f9576105c051156103f957600060046105c0527f0f5287b0000000000000000000000000000000000000000000000000000000006105e0526105c06004806020846106000101826020850160045afa50508051820191505061010051602082610600010152602081019050610120516020826106000101526020810190506003602082610600010152602081019050610140516020826106000101526020810190506105a051602082610600010152602081019050610580516020826106000101526020810190508061060052610600505060006000610600516106203460e0515af16103f7573d600060003e3d6000fd5b565b600080fd5b61009f61049d0361009f60003961009f61049d036000f35b600080fd000000000000000000000000f174f9a837536c449321df1ca093bb96948d5386

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

000000000000000000000000f174f9a837536c449321df1ca093bb96948d5386

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

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000f174f9a837536c449321df1ca093bb96948d5386


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
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.