ETH Price: $2,669.69 (-1.47%)

Contract

0x208b80E85dAC3354DD80f72cC272297909EE81b7
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Bridge Ether To ...218608932025-02-16 18:58:1110 hrs ago1739732291IN
0x208b80E8...909EE81b7
0.00101 ETH0.000116081.22473708
Bridge To Chia217929452025-02-07 6:48:479 days ago1738910927IN
0x208b80E8...909EE81b7
0.00001 ETH0.000112441
Bridge To Chia217911442025-02-07 0:47:4710 days ago1738889267IN
0x208b80E8...909EE81b7
0.00001 ETH0.000111681.04570479
Bridge Ether To ...217777082025-02-05 3:47:5912 days ago1738727279IN
0x208b80E8...909EE81b7
0.09001 ETH0.000164731.73798799
Bridge Ether To ...217754332025-02-04 20:10:2312 days ago1738699823IN
0x208b80E8...909EE81b7
0.05151 ETH0.000612186.45855581
Bridge To Chia217739622025-02-04 15:14:2312 days ago1738682063IN
0x208b80E8...909EE81b7
0.00001 ETH0.000510064.56999651
Bridge To Chia217561032025-02-02 3:18:5915 days ago1738466339IN
0x208b80E8...909EE81b7
0.00001 ETH0.000602025.63633848
Bridge Ether To ...217172862025-01-27 17:15:1120 days ago1737998111IN
0x208b80E8...909EE81b7
0.00201 ETH0.0013021213.73737955
Bridge To Chia216823202025-01-22 20:08:4725 days ago1737576527IN
0x208b80E8...909EE81b7
0.00001 ETH0.000816938.0100713
Bridge To Chia216732112025-01-21 13:38:2326 days ago1737466703IN
0x208b80E8...909EE81b7
0.00001 ETH0.0019425618.18672203
Bridge To Chia216439192025-01-17 11:29:2330 days ago1737113363IN
0x208b80E8...909EE81b7
0.00001 ETH0.000678146.34893735
Bridge Ether To ...216320422025-01-15 19:41:5932 days ago1736970119IN
0x208b80E8...909EE81b7
0.15001 ETH0.0015130215.96239122
Bridge To Chia215810862025-01-08 16:55:2339 days ago1736355323IN
0x208b80E8...909EE81b7
0.00001 ETH0.001890817.70419603
Bridge To Chia215619362025-01-06 0:45:5942 days ago1736124359IN
0x208b80E8...909EE81b7
0.00001 ETH0.000846557.92563862
Bridge To Chia215545332025-01-04 23:55:1143 days ago1736034911IN
0x208b80E8...909EE81b7
0.00001 ETH0.000718526.38942961
Bridge To Chia215122602024-12-30 2:18:2349 days ago1735525103IN
0x208b80E8...909EE81b7
0.00001 ETH0.000313992.81325887
Bridge To Chia214685162024-12-23 23:39:4755 days ago1734997187IN
0x208b80E8...909EE81b7
0.00001 ETH0.000959658.98449438
Bridge To Chia213976212024-12-14 1:58:3565 days ago1734141515IN
0x208b80E8...909EE81b7
0.00001 ETH0.001042669.76275683
Bridge To Chia213829962024-12-12 0:58:5967 days ago1733965139IN
0x208b80E8...909EE81b7
0.00001 ETH0.0015981414.96223394
Bridge To Chia213757372024-12-11 0:38:2368 days ago1733877503IN
0x208b80E8...909EE81b7
0.00001 ETH0.0014719313.78059545
Bridge To Chia213746212024-12-10 20:54:2368 days ago1733864063IN
0x208b80E8...909EE81b7
0.00001 ETH0.0019431518.19232535
Bridge Ether To ...213743942024-12-10 20:08:3568 days ago1733861315IN
0x208b80E8...909EE81b7
0.60001 ETH0.0024472525.8185028
Bridge To Chia213203742024-12-03 7:05:5975 days ago1733209559IN
0x208b80E8...909EE81b7
0.00001 ETH0.002284521.38811564
Bridge To Chia213177342024-12-02 22:13:4776 days ago1733177627IN
0x208b80E8...909EE81b7
0.00001 ETH0.0037630336.88815939
Bridge To Chia213124932024-12-02 4:39:1177 days ago1733114351IN
0x208b80E8...909EE81b7
0.00001 ETH0.0016379815.33518525
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
218608932025-02-16 18:58:1110 hrs ago1739732291
0x208b80E8...909EE81b7
0.00001 ETH
218608932025-02-16 18:58:1110 hrs ago1739732291
0x208b80E8...909EE81b7
0.001 ETH
217929452025-02-07 6:48:479 days ago1738910927
0x208b80E8...909EE81b7
0.00001 ETH
217911442025-02-07 0:47:4710 days ago1738889267
0x208b80E8...909EE81b7
0.00001 ETH
217837002025-02-05 23:52:1111 days ago1738799531
0x208b80E8...909EE81b7
0.000134 ETH
217837002025-02-05 23:52:1111 days ago1738799531
0x208b80E8...909EE81b7
0.044686 ETH
217837002025-02-05 23:52:1111 days ago1738799531
0x208b80E8...909EE81b7
0.04482 ETH
217782722025-02-05 5:41:2311 days ago1738734083
0x208b80E8...909EE81b7
0.00019 ETH
217782722025-02-05 5:41:2311 days ago1738734083
0x208b80E8...909EE81b7
0.063449 ETH
217782722025-02-05 5:41:2311 days ago1738734083
0x208b80E8...909EE81b7
0.063639 ETH
217777082025-02-05 3:47:5912 days ago1738727279
0x208b80E8...909EE81b7
0.00001 ETH
217777082025-02-05 3:47:5912 days ago1738727279
0x208b80E8...909EE81b7
0.09 ETH
217754332025-02-04 20:10:2312 days ago1738699823
0x208b80E8...909EE81b7
0.00001 ETH
217754332025-02-04 20:10:2312 days ago1738699823
0x208b80E8...909EE81b7
0.0515 ETH
217739622025-02-04 15:14:2312 days ago1738682063
0x208b80E8...909EE81b7
0.00001 ETH
217653562025-02-03 10:23:1113 days ago1738578191
0x208b80E8...909EE81b7
0.000107 ETH
217653562025-02-03 10:23:1113 days ago1738578191
0x208b80E8...909EE81b7
0.035804 ETH
217653562025-02-03 10:23:1113 days ago1738578191
0x208b80E8...909EE81b7
0.035911 ETH
217561032025-02-02 3:18:5915 days ago1738466339
0x208b80E8...909EE81b7
0.00001 ETH
217172862025-01-27 17:15:1120 days ago1737998111
0x208b80E8...909EE81b7
0.00001 ETH
217172862025-01-27 17:15:1120 days ago1737998111
0x208b80E8...909EE81b7
0.002 ETH
216823202025-01-22 20:08:4725 days ago1737576527
0x208b80E8...909EE81b7
0.00001 ETH
216732112025-01-21 13:38:2326 days ago1737466703
0x208b80E8...909EE81b7
0.00001 ETH
216439192025-01-17 11:29:2330 days ago1737113363
0x208b80E8...909EE81b7
0.00001 ETH
216320422025-01-15 19:41:5932 days ago1736970119
0x208b80E8...909EE81b7
0.00001 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC20Bridge

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 8 : ERC20Bridge.sol
// SPDX-License-Identifier: MIT License
/* yak tracks all over the place */

pragma solidity 0.8.23;

import "./interfaces/IPortalMessageReceiver.sol";
import "./interfaces/IPortal.sol";
import "./interfaces/IWETH.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol";
import "@openzeppelin/contracts/utils/Address.sol";

interface ERC20Decimals {
    function decimals() external returns (uint8);
}

/**
 * @title   ERC-20 Bridge for the warp.green protocol
 * @notice  Allows wrapping ERC-20 tokens on Chia and unwrapping them back to the original network using warp.green.
 * @dev     Not compatible with fee-on-transfer or rebasing tokens. The contract assumes 1 token now is 1 token in the future, and that transferring `a` tokens will result to exactly `a` tokens being granted to the recipient (not more, not less).
 */
contract ERC20Bridge is IPortalMessageReceiver {
    /**
     * @notice  When wrapping or unwrapping ERC-20s, a tip is sent to the warp.green protocol. The tip is expressed in basis points.
     * @dev     Tip is calculated as amount * tip / 10000; the remaining amount is sent to the recipient.
     */
    uint16 public immutable tip;

    /**
     * @notice  The address of the warp.green portal contract.
     * @dev     Used as an oracle. The portal usually sits behind a TransparentUpgradeableProxy.
     */
    address public immutable portal;

    /**
     * @notice  The address of the contract used to convert between ether and an equivalent ERC-20. Usually milliETH or WETH.
     * @dev     WETH uses a conversion rate of 1:1, while milliETH uses one of 1000 milliETH = 1 ETH.
     */
    address public immutable iweth;

    /**
     * @notice  How much wei the smallest unit of the wrapped ether ERC-20 translates to.
     * @dev     For example, 1000 milliETH = 1 ETH, so 10^(3+3) wei milliETH (milliETH has 3 decimals) translates to 10^18 wei. The ratio would be 10^12, as 0.001 milliETH (smallest denomination) translates to 10^12 wei = 0.000001 ETH.
     */
    uint64 public immutable wethToEthRatio;

    /**
     * @notice  The chain id of the other chain. Usually "xch", which indicates Chia.
     * @dev     Used to verify the source chain of messages.
     */
    bytes3 public immutable otherChain;

    /**
     * @notice  The hash of the puzzle used to burn CATs associated with an ERC-20 that was locked in this contract. Sender of messages from Chia.
     * @dev     Used to verify the source of messages when they're received.
     */
    bytes32 public burnPuzzleHash;

    /**
     * @notice  The hash of the puzzle used to mint CATs on Chia after they've been transferred to this contract. Message receiver on Chia.
     * @dev     Used as a destination for sent messages.
     */
    bytes32 public mintPuzzleHash;

    /**
     * @notice  ERC20Bridge constructor
     * @param   _tip The percentage (in basis points) used as a tip for the warp.green protocol (0.01 - 10%)
     * @param   _portal Address of the warp.green portal contract
     * @param   _iweth Address of the WETH contract or its equivalent
     * @param   _wethToEthRatio The conversion ratio from 1 'wei' of WETH to ETH, considering the difference in decimals
     * @param   _otherChain The chain ID of the destination chain, typically 'xch' for Chia
     * @dev     Initializes contract state with immutable values for gas efficiency
     */
    constructor(
        uint16 _tip,
        address _portal,
        address _iweth,
        uint64 _wethToEthRatio,
        bytes3 _otherChain
    ) {
        require(_tip > 0 && _tip <= 1000, "!tip");
        require(_iweth != address(0) && _portal != address(0), "!addrs");

        tip = _tip;
        portal = _portal;
        iweth = _iweth;
        wethToEthRatio = _wethToEthRatio;
        otherChain = _otherChain;
    }

    /**
     * @notice  Initialize the contract. Should be called in the same transaction as the deployment.
     * @dev     Allows the address of the contract to be determined using CREATE2, as the arguments below depend on the address of this contract. Can only be called once per contract lifetime.
     * @param   _burnPuzzleHash  Chia-side burn puzzle hash. Will be used to set the value of `burnPuzzleHash`.
     * @param   _mintPuzzleHash  Chia-side mint puzzle hash. Will be used to set the value of `mintPuzzleHash`.
     */
    function initializePuzzleHashes(
        bytes32 _burnPuzzleHash,
        bytes32 _mintPuzzleHash
    ) external {
        require(
            burnPuzzleHash == bytes32(0) && mintPuzzleHash == bytes32(0),
            "nope"
        );
        burnPuzzleHash = _burnPuzzleHash;
        mintPuzzleHash = _mintPuzzleHash;
    }

    /**
     * @notice  Receives and processes messages from the warp.green portal
     * @dev     Uses the warp.green Portal contract as an oracle; verifies message and handles the unwrapping process.
     * @param   _source_chain  Message source chain id (e.g., "xch").
     * @param   _source  Message source (puzzle hash).
     * @param   _contents  Message contents - asset contract, receiver, and mojo amount.
     */
    function receiveMessage(
        bytes32 /* _nonce */,
        bytes3 _source_chain,
        bytes32 _source,
        bytes32[] calldata _contents
    ) external {
        require(
            msg.sender == portal &&
                _source == burnPuzzleHash &&
                _source_chain == otherChain,
            "!msg"
        );

        address assetContract = address(uint160(uint256(_contents[0])));
        address receiver = address(uint160(uint256(_contents[1])));
        uint256 amount = uint256(_contents[2]);

        amount = (amount * 10 ** (ERC20Decimals(assetContract).decimals() - 3)); // transform from mojos to ETH wei

        uint256 transferTip = (amount * tip) / 10000;
        if (transferTip == 0) {
            transferTip = 1;
        }
        require(amount > transferTip, "!amnt");

        if (assetContract != iweth) {
            SafeERC20.safeTransfer(
                IERC20(assetContract),
                receiver,
                amount - transferTip
            );
            SafeERC20.safeTransfer(IERC20(assetContract), portal, transferTip);
        } else {
            IWETH(iweth).withdraw(amount);

            Address.sendValue(
                payable(receiver),
                (amount - transferTip) * wethToEthRatio
            );
            Address.sendValue(payable(portal), transferTip * wethToEthRatio);
        }
    }

    /**
     * @notice  Bridges ERC-20 tokens to Chia via the warp.green protocol
     * @dev     Transfers tokens to this contract, redirects portal tip, and send message for tokens to be minted on Chia.
     * @param   _assetContract  Address of the ERC-20 token to bridge.
     * @param   _receiver  Receiver of the wrapped tokens on Chia, given as a puzzle hash. Usually the decoded bech32m address taken from the wallet.
     * @param   _mojoAmount  Amount to bridge to Chia, in mojos (1 CAT = 10^3 mojos). For example, 1 would mean 0.001 CAT tokens, equivalent to 0.001 ERC-20 tokens.
     */
    function bridgeToChia(
        address _assetContract,
        bytes32 _receiver,
        uint256 _mojoAmount // on Chia
    ) external payable {
        require(msg.value == IPortal(portal).messageToll(), "!toll");

        _handleBridging(
            _assetContract,
            true,
            _receiver,
            _mojoAmount,
            msg.value,
            10 ** (ERC20Decimals(_assetContract).decimals() - 3)
        );
    }

    /**
     * @notice  Bridges native Ether to Chia by first wrapping it into milliETH (or WETH).
     * @dev     Wraps ether into an ERC-20, sends portal tip, and sends a message to mint tokens on Chia.
     * @param   _receiver  Receiver puzzle hash for the wrapped tokens.
     */
    function bridgeEtherToChia(
        bytes32 _receiver,
        uint256 _maxMessageToll
    ) external payable {
        uint256 messageToll = IPortal(portal).messageToll();
        require(messageToll <= _maxMessageToll, "!toll");

        uint256 amountAfterToll = msg.value - messageToll;
        require(
            amountAfterToll >= wethToEthRatio &&
                amountAfterToll % wethToEthRatio == 0,
            "!amnt"
        );

        IWETH(iweth).deposit{value: amountAfterToll}();

        uint256 wethToMojosFactor = 10 ** (ERC20Decimals(iweth).decimals() - 3);

        _handleBridging(
            iweth,
            false,
            _receiver,
            amountAfterToll / wethToEthRatio / wethToMojosFactor,
            messageToll,
            wethToMojosFactor
        );
    }

    /**
     * @notice  Bridges ERC-20 tokens to Chia with a permit allowing token spend
     * @dev     Uses ERC-20 permit for gas-efficient token approval and transfer in a single transaction.
     * @param   _assetContract  Address of the ERC-20 token to bridge.
     * @param   _receiver  Receiver puzzle hash for the wrapped tokens.
     * @param   _amount  Amount to bridge to Chia, in mojos. For example, 1 would mean 0.001 CAT tokens, equivalent to 0.001 ERC-20 tokens.
     * @param   _deadline  Permit deadline.
     * @param   _v  Permit signature v value.
     * @param   _r  Permit signature r value.
     * @param   _s  Permit signature s value.
     */
    function bridgeToChiaWithPermit(
        address _assetContract,
        bytes32 _receiver,
        uint256 _amount, // on Chia
        uint256 _deadline,
        uint8 _v,
        bytes32 _r,
        bytes32 _s
    ) external payable {
        require(msg.value == IPortal(portal).messageToll(), "!toll");
        uint256 factor = 10 ** (ERC20Decimals(_assetContract).decimals() - 3);

        IERC20Permit(_assetContract).permit(
            msg.sender,
            address(this),
            _amount * factor,
            _deadline,
            _v,
            _r,
            _s
        );

        _handleBridging(
            _assetContract,
            true,
            _receiver,
            _amount,
            msg.value,
            factor
        );
    }

    /**
     * @notice  Internal function used to craft and send message acknowledging tokens were locked on this chain.
     * @dev     Tip is also calculated and transferred to the portal in this function.
     * @param   _assetContract  Address of the ERC-20 token to bridge.
     * @param   _transferAsset  Whether to transfer the asset to this contract or not. If false, the tokens must already be owned by this contract.
     * @param   _receiver  Receiver puzzle hash for the wrapped tokens.
     * @param   _amount  Amount of CAT tokens to be minted on Chia (in mojos).
     * @param   _messageToll Message toll in wei required by the portal to relay the message.
     * @param   _mojoToTokenFactor  A power of 10 to convert from CAT amount (mojos) to the ERC-20 token's smallest unit.
     */
    function _handleBridging(
        address _assetContract,
        bool _transferAsset,
        bytes32 _receiver,
        uint256 _amount, // WARNING: in CAT mojos
        uint256 _messageToll,
        uint256 _mojoToTokenFactor
    ) internal {
        uint256 transferTip = (_amount * tip) / 10000;
        if (transferTip == 0) {
            transferTip = 1;
        }
        require(_amount > transferTip, "!amnt");

        bytes32[] memory message = new bytes32[](3);
        message[0] = bytes32(uint256(uint160(_assetContract)));
        message[1] = _receiver;
        message[2] = bytes32(_amount - transferTip);

        if (_transferAsset) {
            SafeERC20.safeTransferFrom(
                IERC20(_assetContract),
                msg.sender,
                address(this),
                _amount * _mojoToTokenFactor
            );
        }
        SafeERC20.safeTransfer(
            IERC20(_assetContract),
            portal,
            transferTip * _mojoToTokenFactor
        );

        IPortal(portal).sendMessage{value: _messageToll}(
            otherChain,
            mintPuzzleHash,
            message
        );
    }

    /**
     * @notice  Function that handles incoming ether transfers. Do not simply send ether to this contract.
     * @dev     The 'require' should prevent user errors.
     */
    receive() external payable {
        require(msg.sender == iweth, "!sender");
    }
}

File 2 of 8 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 3 of 8 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

File 4 of 8 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 5 of 8 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 6 of 8 : IPortal.sol
// SPDX-License-Identifier: MIT License
/* yak tracks all over the place */

pragma solidity 0.8.23;

interface IPortal {
    event MessageSent(
        bytes32 indexed nonce,
        bytes3 destination_chain,
        bytes32 destination,
        bytes32[] contents
    );

    function ethNonce() external returns (uint256);

    function messageToll() external returns (uint256);

    function sendMessage(
        bytes3 _destination_chain,
        bytes32 _destination,
        bytes32[] calldata _contents
    ) external payable;

    function receiveMessage(
        bytes32 _nonce,
        bytes3 _source_chain,
        bytes32 _source,
        address _destination,
        bytes32[] calldata _contents
    ) external;
}

File 7 of 8 : IPortalMessageReceiver.sol
// SPDX-License-Identifier: MIT License
/* yak tracks all over the place */

pragma solidity 0.8.23;

interface IPortalMessageReceiver {
    function receiveMessage(
        bytes32 _nonce,
        bytes3 _source_chain,
        bytes32 _source,
        bytes32[] calldata _contents
    ) external;
}

File 8 of 8 : IWETH.sol
// SPDX-License-Identifier: MIT License
/* yak tracks all over the place */

pragma solidity 0.8.23;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint) external;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint16","name":"_tip","type":"uint16"},{"internalType":"address","name":"_portal","type":"address"},{"internalType":"address","name":"_iweth","type":"address"},{"internalType":"uint64","name":"_wethToEthRatio","type":"uint64"},{"internalType":"bytes3","name":"_otherChain","type":"bytes3"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[{"internalType":"bytes32","name":"_receiver","type":"bytes32"},{"internalType":"uint256","name":"_maxMessageToll","type":"uint256"}],"name":"bridgeEtherToChia","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_assetContract","type":"address"},{"internalType":"bytes32","name":"_receiver","type":"bytes32"},{"internalType":"uint256","name":"_mojoAmount","type":"uint256"}],"name":"bridgeToChia","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_assetContract","type":"address"},{"internalType":"bytes32","name":"_receiver","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"bridgeToChiaWithPermit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"burnPuzzleHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_burnPuzzleHash","type":"bytes32"},{"internalType":"bytes32","name":"_mintPuzzleHash","type":"bytes32"}],"name":"initializePuzzleHashes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"iweth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPuzzleHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"otherChain","outputs":[{"internalType":"bytes3","name":"","type":"bytes3"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"portal","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes3","name":"_source_chain","type":"bytes3"},{"internalType":"bytes32","name":"_source","type":"bytes32"},{"internalType":"bytes32[]","name":"_contents","type":"bytes32[]"}],"name":"receiveMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tip","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethToEthRatio","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101206040523480156200001257600080fd5b506040516200191038038062001910833981016040819052620000359162000141565b60008561ffff161180156200005057506103e88561ffff1611155b620000905760405162461bcd60e51b815260040162000087906020808252600490820152630217469760e41b604082015260600190565b60405180910390fd5b6001600160a01b03831615801590620000b157506001600160a01b03841615155b620000e85760405162461bcd60e51b815260206004820152600660248201526521616464727360d01b604482015260640162000087565b61ffff9094166080526001600160a01b0392831660a052911660c0526001600160401b031660e0526001600160e81b03191661010052620001d8565b80516001600160a01b03811681146200013c57600080fd5b919050565b600080600080600060a086880312156200015a57600080fd5b855161ffff811681146200016d57600080fd5b94506200017d6020870162000124565b93506200018d6040870162000124565b60608701519093506001600160401b0381168114620001ab57600080fd5b60808701519092506001600160e81b031981168114620001ca57600080fd5b809150509295509295909350565b60805160a05160c05160e05161010051611653620002bd6000396000818161017c015281816103790152610f870152600081816101c901528181610635015281816106ab0152818161096e015281816109af0152610b3c01526000818160bb015281816102e20152818161053a015281816105cb015281816109f501528181610a6d0152610b0b015260008181610270015281816103420152818161058b0152818161067e015281816106de015281816108ba01528181610b7c01528181610f150152610f58015260008181610130015281816104db0152610dfd01526116536000f3fe6080604052600436106100ab5760003560e01c80636425666b116100645780636425666b1461025e57806377c3ebbb146102aa5780639ec911b0146102bd578063c11a463d146102d0578063cdb50da714610304578063f22e7bbd1461031757600080fd5b80632755cd2d1461011e5780633097316a1461016a57806334c26506146101b757806336d1ab30146102045780633f4710d314610228578063574632fc1461023e57600080fd5b3661011957336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101175760405162461bcd60e51b815260206004820152600760248201526610b9b2b73232b960c91b60448201526064015b60405180910390fd5b005b600080fd5b34801561012a57600080fd5b506101527f000000000000000000000000000000000000000000000000000000000000000081565b60405161ffff90911681526020015b60405180910390f35b34801561017657600080fd5b5061019e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160e81b03199091168152602001610161565b3480156101c357600080fd5b506101eb7f000000000000000000000000000000000000000000000000000000000000000081565b60405167ffffffffffffffff9091168152602001610161565b34801561021057600080fd5b5061021a60015481565b604051908152602001610161565b34801561023457600080fd5b5061021a60005481565b34801561024a57600080fd5b506101176102593660046111ce565b610337565b34801561026a57600080fd5b506102927f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610161565b6101176102b836600461129f565b6106dc565b6101176102cb366004611305565b6108b6565b3480156102dc57600080fd5b506102927f000000000000000000000000000000000000000000000000000000000000000081565b610117610312366004611327565b610b7a565b34801561032357600080fd5b50610117610332366004611305565b610caa565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610370575060005483145b80156103af57507f00000000000000000000000000000000000000000000000000000000000000006001600160e81b031916846001600160e81b031916145b6103e45760405162461bcd60e51b815260040161010e90602080825260049082015263216d736760e01b604082015260600190565b6000828260008181106103f9576103f961135a565b9050602002013560001c905060008383600181811061041a5761041a61135a565b9050602002013560001c905060008484600281811061043b5761043b61135a565b9050602002013560001c90506003836001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610489573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ad9190611370565b6104b791906113a3565b6104c290600a6114a0565b6104cc90826114af565b9050600061271061050161ffff7f000000000000000000000000000000000000000000000000000000000000000016846114af565b61050b91906114dc565b905080600003610519575060015b8082116105385760405162461bcd60e51b815260040161010e906114f0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316146105b5576105858484610580848661150f565b610cfa565b6105b0847f000000000000000000000000000000000000000000000000000000000000000083610cfa565b6106d1565b604051632e1a7d4d60e01b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561061757600080fd5b505af115801561062b573d6000803e3d6000fd5b50505050610679837f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff16838561066a919061150f565b61067491906114af565b610d59565b6106d17f000000000000000000000000000000000000000000000000000000000000000061067467ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016846114af565b505050505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166379c06b8b6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190611522565b341461077e5760405162461bcd60e51b815260040161010e9061153b565b60006003886001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af11580156107c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e69190611370565b6107f091906113a3565b6107fb90600a6114a0565b90506001600160a01b03881663d505accf3330610818858b6114af565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064810188905260ff8716608482015260a4810186905260c4810185905260e401600060405180830381600087803b15801561088557600080fd5b505af1158015610899573d6000803e3d6000fd5b505050506108ac88600189893486610df0565b5050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166379c06b8b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190611522565b90508181111561095e5760405162461bcd60e51b815260040161010e9061153b565b600061096a823461150f565b90507f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff1681101580156109d757506109d567ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168261155a565b155b6109f35760405162461bcd60e51b815260040161010e906114f0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b5050505050600060037f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610acb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aef9190611370565b610af991906113a3565b610b0490600a6114a0565b9050610b737f000000000000000000000000000000000000000000000000000000000000000060008784610b6267ffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016886114dc565b610b6c91906114dc565b8786610df0565b5050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166379c06b8b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610bda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfe9190611522565b3414610c1c5760405162461bcd60e51b815260040161010e9061153b565b610ca58360018484346003896001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8b9190611370565b610c9591906113a3565b610ca090600a6114a0565b610df0565b505050565b600054158015610cba5750600154155b610cef5760405162461bcd60e51b815260040161010e906020808252600490820152636e6f706560e01b604082015260600190565b600091909155600155565b6040516001600160a01b03838116602483015260448201839052610ca591859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610fee565b80471015610d7c5760405163cd78605960e01b815230600482015260240161010e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610dc9576040519150601f19603f3d011682016040523d82523d6000602084013e610dce565b606091505b5050905080610ca557604051630a12f52160e11b815260040160405180910390fd5b6000612710610e2361ffff7f000000000000000000000000000000000000000000000000000000000000000016866114af565b610e2d91906114dc565b905080600003610e3b575060015b808411610e5a5760405162461bcd60e51b815260040161010e906114f0565b6040805160038082526080820190925260009160208201606080368337019050509050876001600160a01b031660001b81600081518110610e9d57610e9d61135a565b6020026020010181815250508581600181518110610ebd57610ebd61135a565b6020908102919091010152610ed2828661150f565b60001b81600281518110610ee857610ee861135a565b6020026020010181815250508615610f0f57610f0f883330610f0a878a6114af565b611051565b610f3e887f000000000000000000000000000000000000000000000000000000000000000061058086866114af565b60015460405163b3882f8960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163b3882f89918791610fb2917f00000000000000000000000000000000000000000000000000000000000000009190879060040161156e565b6000604051808303818588803b158015610fcb57600080fd5b505af1158015610fdf573d6000803e3d6000fd5b50505050505050505050505050565b60006110036001600160a01b03841683611090565b9050805160001415801561102857508080602001905181019061102691906115cc565b155b15610ca557604051635274afe760e01b81526001600160a01b038416600482015260240161010e565b6040516001600160a01b03848116602483015283811660448301526064820183905261108a9186918216906323b872dd90608401610d27565b50505050565b606061109e838360006110a7565b90505b92915050565b6060814710156110cc5760405163cd78605960e01b815230600482015260240161010e565b600080856001600160a01b031684866040516110e891906115ee565b60006040518083038185875af1925050503d8060008114611125576040519150601f19603f3d011682016040523d82523d6000602084013e61112a565b606091505b509150915061113a868383611146565b925050505b9392505050565b60608261115b57611156826111a2565b61113f565b815115801561117257506001600160a01b0384163b155b1561119b57604051639996b31560e01b81526001600160a01b038516600482015260240161010e565b508061113f565b8051156111b25780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6000806000806000608086880312156111e657600080fd5b8535945060208601356001600160e81b03198116811461120557600080fd5b935060408601359250606086013567ffffffffffffffff8082111561122957600080fd5b818801915088601f83011261123d57600080fd5b81358181111561124c57600080fd5b8960208260051b850101111561126157600080fd5b9699959850939650602001949392505050565b80356001600160a01b038116811461128b57600080fd5b919050565b60ff811681146111cb57600080fd5b600080600080600080600060e0888a0312156112ba57600080fd5b6112c388611274565b965060208801359550604088013594506060880135935060808801356112e881611290565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561131857600080fd5b50508035926020909101359150565b60008060006060848603121561133c57600080fd5b61134584611274565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561138257600080fd5b815161113f81611290565b634e487b7160e01b600052601160045260246000fd5b60ff82811682821603908111156110a1576110a161138d565b600181815b808511156113f75781600019048211156113dd576113dd61138d565b808516156113ea57918102915b93841c93908002906113c1565b509250929050565b60008261140e575060016110a1565b8161141b575060006110a1565b8160018114611431576002811461143b57611457565b60019150506110a1565b60ff84111561144c5761144c61138d565b50506001821b6110a1565b5060208310610133831016604e8410600b841016171561147a575081810a6110a1565b61148483836113bc565b80600019048211156114985761149861138d565b029392505050565b600061109e60ff8416836113ff565b80820281158282048414176110a1576110a161138d565b634e487b7160e01b600052601260045260246000fd5b6000826114eb576114eb6114c6565b500490565b60208082526005908201526408585b5b9d60da1b604082015260600190565b818103818111156110a1576110a161138d565b60006020828403121561153457600080fd5b5051919050565b602080825260059082015264085d1bdb1b60da1b604082015260600190565b600082611569576115696114c6565b500690565b6001600160e81b03198416815260208082018490526060604083018190528351908301819052600091848101916080850190845b818110156115be578451835293830193918301916001016115a2565b509098975050505050505050565b6000602082840312156115de57600080fd5b8151801515811461113f57600080fd5b6000825160005b8181101561160f57602081860181015185830152016115f5565b50600092019182525091905056fea2646970667358221220022a74f6ae647508a0ad358847abd919f33250935fa68197951278cf94d55d3c64736f6c63430008170033000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b12000000000000000000000000000000000000000000000000000000e8d4a510007863680000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106100ab5760003560e01c80636425666b116100645780636425666b1461025e57806377c3ebbb146102aa5780639ec911b0146102bd578063c11a463d146102d0578063cdb50da714610304578063f22e7bbd1461031757600080fd5b80632755cd2d1461011e5780633097316a1461016a57806334c26506146101b757806336d1ab30146102045780633f4710d314610228578063574632fc1461023e57600080fd5b3661011957336001600160a01b037f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b1216146101175760405162461bcd60e51b815260206004820152600760248201526610b9b2b73232b960c91b60448201526064015b60405180910390fd5b005b600080fd5b34801561012a57600080fd5b506101527f000000000000000000000000000000000000000000000000000000000000001e81565b60405161ffff90911681526020015b60405180910390f35b34801561017657600080fd5b5061019e7f786368000000000000000000000000000000000000000000000000000000000081565b6040516001600160e81b03199091168152602001610161565b3480156101c357600080fd5b506101eb7f000000000000000000000000000000000000000000000000000000e8d4a5100081565b60405167ffffffffffffffff9091168152602001610161565b34801561021057600080fd5b5061021a60015481565b604051908152602001610161565b34801561023457600080fd5b5061021a60005481565b34801561024a57600080fd5b506101176102593660046111ce565b610337565b34801561026a57600080fd5b506102927f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f81565b6040516001600160a01b039091168152602001610161565b6101176102b836600461129f565b6106dc565b6101176102cb366004611305565b6108b6565b3480156102dc57600080fd5b506102927f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b1281565b610117610312366004611327565b610b7a565b34801561032357600080fd5b50610117610332366004611305565b610caa565b336001600160a01b037f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f16148015610370575060005483145b80156103af57507f78636800000000000000000000000000000000000000000000000000000000006001600160e81b031916846001600160e81b031916145b6103e45760405162461bcd60e51b815260040161010e90602080825260049082015263216d736760e01b604082015260600190565b6000828260008181106103f9576103f961135a565b9050602002013560001c905060008383600181811061041a5761041a61135a565b9050602002013560001c905060008484600281811061043b5761043b61135a565b9050602002013560001c90506003836001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610489573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ad9190611370565b6104b791906113a3565b6104c290600a6114a0565b6104cc90826114af565b9050600061271061050161ffff7f000000000000000000000000000000000000000000000000000000000000001e16846114af565b61050b91906114dc565b905080600003610519575060015b8082116105385760405162461bcd60e51b815260040161010e906114f0565b7f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b126001600160a01b0316846001600160a01b0316146105b5576105858484610580848661150f565b610cfa565b6105b0847f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f83610cfa565b6106d1565b604051632e1a7d4d60e01b8152600481018390527f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b126001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561061757600080fd5b505af115801561062b573d6000803e3d6000fd5b50505050610679837f000000000000000000000000000000000000000000000000000000e8d4a5100067ffffffffffffffff16838561066a919061150f565b61067491906114af565b610d59565b6106d17f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f61067467ffffffffffffffff7f000000000000000000000000000000000000000000000000000000e8d4a5100016846114af565b505050505050505050565b7f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f6001600160a01b03166379c06b8b6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190611522565b341461077e5760405162461bcd60e51b815260040161010e9061153b565b60006003886001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af11580156107c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e69190611370565b6107f091906113a3565b6107fb90600a6114a0565b90506001600160a01b03881663d505accf3330610818858b6114af565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064810188905260ff8716608482015260a4810186905260c4810185905260e401600060405180830381600087803b15801561088557600080fd5b505af1158015610899573d6000803e3d6000fd5b505050506108ac88600189893486610df0565b5050505050505050565b60007f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f6001600160a01b03166379c06b8b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093c9190611522565b90508181111561095e5760405162461bcd60e51b815260040161010e9061153b565b600061096a823461150f565b90507f000000000000000000000000000000000000000000000000000000e8d4a5100067ffffffffffffffff1681101580156109d757506109d567ffffffffffffffff7f000000000000000000000000000000000000000000000000000000e8d4a51000168261155a565b155b6109f35760405162461bcd60e51b815260040161010e906114f0565b7f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b126001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b5050505050600060037f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b126001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610acb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aef9190611370565b610af991906113a3565b610b0490600a6114a0565b9050610b737f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b1260008784610b6267ffffffffffffffff7f000000000000000000000000000000000000000000000000000000e8d4a5100016886114dc565b610b6c91906114dc565b8786610df0565b5050505050565b7f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f6001600160a01b03166379c06b8b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610bda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfe9190611522565b3414610c1c5760405162461bcd60e51b815260040161010e9061153b565b610ca58360018484346003896001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8b9190611370565b610c9591906113a3565b610ca090600a6114a0565b610df0565b505050565b600054158015610cba5750600154155b610cef5760405162461bcd60e51b815260040161010e906020808252600490820152636e6f706560e01b604082015260600190565b600091909155600155565b6040516001600160a01b03838116602483015260448201839052610ca591859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050610fee565b80471015610d7c5760405163cd78605960e01b815230600482015260240161010e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610dc9576040519150601f19603f3d011682016040523d82523d6000602084013e610dce565b606091505b5050905080610ca557604051630a12f52160e11b815260040160405180910390fd5b6000612710610e2361ffff7f000000000000000000000000000000000000000000000000000000000000001e16866114af565b610e2d91906114dc565b905080600003610e3b575060015b808411610e5a5760405162461bcd60e51b815260040161010e906114f0565b6040805160038082526080820190925260009160208201606080368337019050509050876001600160a01b031660001b81600081518110610e9d57610e9d61135a565b6020026020010181815250508581600181518110610ebd57610ebd61135a565b6020908102919091010152610ed2828661150f565b60001b81600281518110610ee857610ee861135a565b6020026020010181815250508615610f0f57610f0f883330610f0a878a6114af565b611051565b610f3e887f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f61058086866114af565b60015460405163b3882f8960e01b81526001600160a01b037f0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f169163b3882f89918791610fb2917f78636800000000000000000000000000000000000000000000000000000000009190879060040161156e565b6000604051808303818588803b158015610fcb57600080fd5b505af1158015610fdf573d6000803e3d6000fd5b50505050505050505050505050565b60006110036001600160a01b03841683611090565b9050805160001415801561102857508080602001905181019061102691906115cc565b155b15610ca557604051635274afe760e01b81526001600160a01b038416600482015260240161010e565b6040516001600160a01b03848116602483015283811660448301526064820183905261108a9186918216906323b872dd90608401610d27565b50505050565b606061109e838360006110a7565b90505b92915050565b6060814710156110cc5760405163cd78605960e01b815230600482015260240161010e565b600080856001600160a01b031684866040516110e891906115ee565b60006040518083038185875af1925050503d8060008114611125576040519150601f19603f3d011682016040523d82523d6000602084013e61112a565b606091505b509150915061113a868383611146565b925050505b9392505050565b60608261115b57611156826111a2565b61113f565b815115801561117257506001600160a01b0384163b155b1561119b57604051639996b31560e01b81526001600160a01b038516600482015260240161010e565b508061113f565b8051156111b25780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6000806000806000608086880312156111e657600080fd5b8535945060208601356001600160e81b03198116811461120557600080fd5b935060408601359250606086013567ffffffffffffffff8082111561122957600080fd5b818801915088601f83011261123d57600080fd5b81358181111561124c57600080fd5b8960208260051b850101111561126157600080fd5b9699959850939650602001949392505050565b80356001600160a01b038116811461128b57600080fd5b919050565b60ff811681146111cb57600080fd5b600080600080600080600060e0888a0312156112ba57600080fd5b6112c388611274565b965060208801359550604088013594506060880135935060808801356112e881611290565b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561131857600080fd5b50508035926020909101359150565b60008060006060848603121561133c57600080fd5b61134584611274565b95602085013595506040909401359392505050565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561138257600080fd5b815161113f81611290565b634e487b7160e01b600052601160045260246000fd5b60ff82811682821603908111156110a1576110a161138d565b600181815b808511156113f75781600019048211156113dd576113dd61138d565b808516156113ea57918102915b93841c93908002906113c1565b509250929050565b60008261140e575060016110a1565b8161141b575060006110a1565b8160018114611431576002811461143b57611457565b60019150506110a1565b60ff84111561144c5761144c61138d565b50506001821b6110a1565b5060208310610133831016604e8410600b841016171561147a575081810a6110a1565b61148483836113bc565b80600019048211156114985761149861138d565b029392505050565b600061109e60ff8416836113ff565b80820281158282048414176110a1576110a161138d565b634e487b7160e01b600052601260045260246000fd5b6000826114eb576114eb6114c6565b500490565b60208082526005908201526408585b5b9d60da1b604082015260600190565b818103818111156110a1576110a161138d565b60006020828403121561153457600080fd5b5051919050565b602080825260059082015264085d1bdb1b60da1b604082015260600190565b600082611569576115696114c6565b500690565b6001600160e81b03198416815260208082018490526060604083018190528351908301819052600091848101916080850190845b818110156115be578451835293830193918301916001016115a2565b509098975050505050505050565b6000602082840312156115de57600080fd5b8151801515811461113f57600080fd5b6000825160005b8181101561160f57602081860181015185830152016115f5565b50600092019182525091905056fea2646970667358221220022a74f6ae647508a0ad358847abd919f33250935fa68197951278cf94d55d3c64736f6c63430008170033

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

000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b12000000000000000000000000000000000000000000000000000000e8d4a510007863680000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _tip (uint16): 30
Arg [1] : _portal (address): 0x2593C582B7a24d94Ba0056B493Fd4048bd99fc3F
Arg [2] : _iweth (address): 0xf2D5d8eC69E2faed5eB4De90749c87ee314a4B12
Arg [3] : _wethToEthRatio (uint64): 1000000000000
Arg [4] : _otherChain (bytes3): 0x786368

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [1] : 0000000000000000000000002593c582b7a24d94ba0056b493fd4048bd99fc3f
Arg [2] : 000000000000000000000000f2d5d8ec69e2faed5eb4de90749c87ee314a4b12
Arg [3] : 000000000000000000000000000000000000000000000000000000e8d4a51000
Arg [4] : 7863680000000000000000000000000000000000000000000000000000000000


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
[ 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.