ETH Price: $2,526.51 (+3.12%)

Contract

0xb51803E6fb0f0C68Cc72236CC8Da985483A6E0d3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

Transaction Hash
Method
Block
From
To
Deposit ETH206618132024-09-02 8:52:3518 hrs ago1725267155IN
0xb51803E6...483A6E0d3
0.6211 ETH0.000591723.61917473
Deposit ETH206617812024-09-02 8:46:1118 hrs ago1725266771IN
0xb51803E6...483A6E0d3
0.6 ETH0.000759114.64298867
Deposit ETH206556852024-09-01 12:21:3538 hrs ago1725193295IN
0xb51803E6...483A6E0d3
0.515 ETH0.000202871.24086534
Deposit ETH206542652024-09-01 7:35:3543 hrs ago1725176135IN
0xb51803E6...483A6E0d3
0.5 ETH0.000116270.71120427
Deposit ETH206519962024-09-01 0:00:352 days ago1725148835IN
0xb51803E6...483A6E0d3
0.001 ETH0.000114960.70318859
Deposit Token206342602024-08-29 12:32:234 days ago1724934743IN
0xb51803E6...483A6E0d3
0 ETH0.000448972.07732764
Deposit ETH206149382024-08-26 19:44:477 days ago1724701487IN
0xb51803E6...483A6E0d3
0.002 ETH0.000261971.60231109
Deposit ETH206082042024-08-25 21:11:118 days ago1724620271IN
0xb51803E6...483A6E0d3
0.001 ETH0.000130650.79914837
Deposit Token206081722024-08-25 21:04:478 days ago1724619887IN
0xb51803E6...483A6E0d3
0 ETH0.000177670.84873879
Deposit ETH205639662024-08-19 16:48:4714 days ago1724086127IN
0xb51803E6...483A6E0d3
1 ETH0.000336012.05521329
Deposit ETH205548172024-08-18 10:08:4715 days ago1723975727IN
0xb51803E6...483A6E0d3
0.01 ETH0.000197441.20763181
Deposit ETH205398432024-08-16 7:57:2317 days ago1723795043IN
0xb51803E6...483A6E0d3
0.06 ETH0.000222141.35872556
Deposit ETH205223492024-08-13 21:20:1120 days ago1723584011IN
0xb51803E6...483A6E0d3
0.0011 ETH0.000203221.24302411
Deposit ETH205082272024-08-11 22:02:3522 days ago1723413755IN
0xb51803E6...483A6E0d3
2 ETH0.000230011.40682874
Deposit Token204873172024-08-09 0:00:1125 days ago1723161611IN
0xb51803E6...483A6E0d3
0 ETH0.000573142.65171838
Deposit ETH204750622024-08-07 7:00:1126 days ago1723014011IN
0xb51803E6...483A6E0d3
0.1 ETH0.000191541.17157008
Deposit ETH204750442024-08-07 6:56:3526 days ago1723013795IN
0xb51803E6...483A6E0d3
0.1 ETH0.000205061.25427397
Deposit Token204729932024-08-07 0:04:3527 days ago1722989075IN
0xb51803E6...483A6E0d3
0 ETH0.000272431.26050693
Deposit ETH204726762024-08-06 23:01:1127 days ago1722985271IN
0xb51803E6...483A6E0d3
0.1 ETH0.000403632.46874604
Deposit ETH204687442024-08-06 9:50:3527 days ago1722937835IN
0xb51803E6...483A6E0d3
0.001 ETH0.000490052.99732639
Deposit ETH204685372024-08-06 9:08:4727 days ago1722935327IN
0xb51803E6...483A6E0d3
0.056 ETH0.00090335.52491341
Deposit Token204563102024-08-04 16:12:5929 days ago1722787979IN
0xb51803E6...483A6E0d3
0 ETH0.0027290312.62670196
Deposit Token204545682024-08-04 10:23:2329 days ago1722767003IN
0xb51803E6...483A6E0d3
0 ETH0.000236691.11712168
Deposit ETH204536122024-08-04 7:11:4729 days ago1722755507IN
0xb51803E6...483A6E0d3
0.32 ETH0.000163491
Deposit Token204392002024-08-02 6:53:4731 days ago1722581627IN
0xb51803E6...483A6E0d3
0 ETH0.000655193.03145484
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
206618132024-09-02 8:52:3518 hrs ago1725267155
0xb51803E6...483A6E0d3
0.6211 ETH
206617812024-09-02 8:46:1118 hrs ago1725266771
0xb51803E6...483A6E0d3
0.6 ETH
206556852024-09-01 12:21:3538 hrs ago1725193295
0xb51803E6...483A6E0d3
0.515 ETH
206542652024-09-01 7:35:3543 hrs ago1725176135
0xb51803E6...483A6E0d3
0.5 ETH
206519962024-09-01 0:00:352 days ago1725148835
0xb51803E6...483A6E0d3
0.001 ETH
206342602024-08-29 12:32:234 days ago1724934743
0xb51803E6...483A6E0d3
0 ETH
206342602024-08-29 12:32:234 days ago1724934743
0xb51803E6...483A6E0d3
0 ETH
206342602024-08-29 12:32:234 days ago1724934743
0xb51803E6...483A6E0d3
0 ETH
206149382024-08-26 19:44:477 days ago1724701487
0xb51803E6...483A6E0d3
0.002 ETH
206082042024-08-25 21:11:118 days ago1724620271
0xb51803E6...483A6E0d3
0.001 ETH
206081722024-08-25 21:04:478 days ago1724619887
0xb51803E6...483A6E0d3
0 ETH
206081722024-08-25 21:04:478 days ago1724619887
0xb51803E6...483A6E0d3
0 ETH
206081722024-08-25 21:04:478 days ago1724619887
0xb51803E6...483A6E0d3
0 ETH
205639662024-08-19 16:48:4714 days ago1724086127
0xb51803E6...483A6E0d3
1 ETH
205548172024-08-18 10:08:4715 days ago1723975727
0xb51803E6...483A6E0d3
0.01 ETH
205398432024-08-16 7:57:2317 days ago1723795043
0xb51803E6...483A6E0d3
0.06 ETH
205223492024-08-13 21:20:1120 days ago1723584011
0xb51803E6...483A6E0d3
0.0011 ETH
205082272024-08-11 22:02:3522 days ago1723413755
0xb51803E6...483A6E0d3
2 ETH
204873172024-08-09 0:00:1125 days ago1723161611
0xb51803E6...483A6E0d3
0 ETH
204873172024-08-09 0:00:1125 days ago1723161611
0xb51803E6...483A6E0d3
0 ETH
204873172024-08-09 0:00:1125 days ago1723161611
0xb51803E6...483A6E0d3
0 ETH
204750622024-08-07 7:00:1126 days ago1723014011
0xb51803E6...483A6E0d3
0.1 ETH
204750442024-08-07 6:56:3526 days ago1723013795
0xb51803E6...483A6E0d3
0.1 ETH
204729932024-08-07 0:04:3527 days ago1722989075
0xb51803E6...483A6E0d3
0 ETH
204729932024-08-07 0:04:3527 days ago1722989075
0xb51803E6...483A6E0d3
0 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RizeWormholeV1

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
No with 200 runs

Other Settings:
paris EvmVersion
File 1 of 15 : RizeWormholeV1.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.20;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import { IWormhole } from "./interfaces/IWormhole.sol";
import { ITokenBridgeRelayer } from "./interfaces/ITokenBridgeRelayer.sol";
import { Storage } from "./Storage.sol";
import { Events } from "./Events.sol";
import { Errors } from "./Errors.sol";

/// @title RIZE V1 smart contract for wormhole bridge integration.
/// @author [email protected]
/// @notice This contract integrates with the Wormhole TokenBridgeRelayer.
/// It guides specific operations such as defining the target blockchain
/// network, allowed token whitelist, and the recipient (forwarder) address.
contract RizeWormholeV1 is Ownable, ReentrancyGuard, Storage {
    constructor(address wh, address tbr) Ownable(msg.sender) {
        if (wh == address(0)) {
            revert Errors.InvalidWormhole(wh);
        }
        if (tbr == address(0)) {
            revert Errors.InvalidTokenBridgeRelayer(tbr);
        }

        _wormhole = wh;
        _tokenBridgeRelayer = tbr;
    }

    /// @dev Deposit Ether into this smart contract, which then gets bridged
    /// via the Wormhole to the specified target blockchain network.
    function depositETH(
        uint16 targetChain
    ) external payable nonReentrant returns (uint64 messageSequence) {
        bytes32 forwarder = forwarderByChainId(targetChain);

        messageSequence = tokenBridgeRelayer().wrapAndTransferEthWithRelay{
            value: msg.value
        }(0, targetChain, forwarder, 0);

        emit Events.WormholeETHDepositEvent(
            msg.sender,
            msg.value,
            targetChain,
            forwarder,
            messageSequence
        );
    }

    /// @dev Deposit ERC20 tokens into this smart contract, which then gets
    /// bridged via the Wormhole to a specified target blockchain network.
    function depositToken(
        address token,
        uint256 amount,
        uint16 targetChain
    ) external nonReentrant returns (uint64 messageSequence) {
        if (!isTokenWhitelisted(token, targetChain)) {
            revert Errors.NotWhitelisted(token, targetChain);
        }
        bytes32 forwarder = forwarderByChainId(targetChain);

        SafeERC20.safeTransferFrom(
            IERC20(token),
            msg.sender,
            address(this),
            amount
        );

        uint256 allowance = IERC20(token).allowance(
            address(this),
            address(tokenBridgeRelayer())
        );
        if (allowance < amount) {
            SafeERC20.safeIncreaseAllowance(
                IERC20(token),
                address(tokenBridgeRelayer()),
                type(uint256).max
            );
        }

        messageSequence = tokenBridgeRelayer().transferTokensWithRelay(
            token,
            amount,
            0,
            targetChain,
            forwarder,
            0
        );

        emit Events.WormholeERC20DepositEvent(
            msg.sender,
            token,
            amount,
            targetChain,
            forwarder,
            messageSequence
        );
    }

    // Public view methods

    function wormhole() public view returns (IWormhole) {
        return IWormhole(_wormhole);
    }

    function tokenBridgeRelayer() public view returns (ITokenBridgeRelayer) {
        return ITokenBridgeRelayer(_tokenBridgeRelayer);
    }

    function isTokenWhitelisted(
        address token,
        uint16 whChainId
    ) public view returns (bool) {
        return _tokens[token] && _targetChains[whChainId];
    }

    function isChainEnabled(uint16 whChainId) public view returns (bool) {
        return _targetChains[whChainId];
    }

    function forwarderByChainId(
        uint16 whChainId
    ) public view returns (bytes32) {
        if (!isChainEnabled(whChainId)) {
            revert Errors.ChainDisabled(whChainId);
        }

        bytes32 forwarder = _forwarders[whChainId];
        if (forwarder == bytes32(0)) {
            revert Errors.ChainDisabled(whChainId);
        }

        return forwarder;
    }

    // Admin set methods

    function setWormhole(address wh) external onlyOwner nonReentrant {
        if (wh == address(0)) {
            revert Errors.InvalidWormhole(wh);
        }
        _wormhole = wh;

        emit Events.SetWormholeEvent(wh);
    }

    function setTokenBridgeRelayer(
        address tbr
    ) external onlyOwner nonReentrant {
        if (tbr == address(0)) {
            revert Errors.InvalidTokenBridgeRelayer(tbr);
        }
        _tokenBridgeRelayer = tbr;

        emit Events.SetTokenBridgeRelayerEvent(tbr);
    }

    function addToken(address token) external onlyOwner nonReentrant {
        _tokens[token] = true;

        emit Events.AddTokenEvent(token);
    }

    function removeToken(address token) external onlyOwner nonReentrant {
        _tokens[token] = false;

        emit Events.RemoveTokenEvent(token);
    }

    function addChain(
        uint16 whChainId,
        bytes32 forwarder
    ) external onlyOwner nonReentrant {
        _targetChains[whChainId] = true;
        _forwarders[whChainId] = forwarder;

        emit Events.AddChainEvent(whChainId, forwarder);
    }

    function removeChain(uint16 whChainId) external onlyOwner nonReentrant {
        _targetChains[whChainId] = false;

        emit Events.RemoveChainEvent(whChainId);
    }

    // @dev Backdoor for withdraw ERC20 sent to this contract. The ERC20 token
    //   does not include user deposit assets. The withdraw only applies to token
    //   that is accidentally sent to the smart contract, or airdropped tokens.
    function withdrawToken(
        IERC20 token,
        uint256 amount
    ) external onlyOwner nonReentrant {
        SafeERC20.safeTransfer(token, owner(), amount);

        emit Events.WithdrawTokenEvent(address(token), amount);
    }

    fallback() external payable {
        revert Errors.Unsupported();
    }

    receive() external payable {
        revert Errors.Unsupported();
    }
}

File 2 of 15 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 15 : 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 4 of 15 : 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 5 of 15 : 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 6 of 15 : 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 7 of 15 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

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

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 9 of 15 : Errors.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.20;

contract Errors {
    error NotWhitelisted(address token, uint16 targetChain);
    error ChainDisabled(uint16 chainId);
    error InvalidWormhole(address wh);
    error InvalidTokenBridgeRelayer(address tbr);
    error Unsupported();
}

File 10 of 15 : Events.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.20;

contract Events {
    // ERC20 deposit event
    event WormholeERC20DepositEvent(
        address user,
        address token,
        uint256 amount,
        uint16 targetChain,
        bytes32 forwarder,
        uint64 messageSequence
    );

    // ETH deposit event
    event WormholeETHDepositEvent(
        address user,
        uint256 amount,
        uint16 targetChain,
        bytes32 forwarder,
        uint64 messageSequence
    );

    event SetTokenBridgeRelayerEvent(address tokenBridgeRelayer);

    event SetWormholeEvent(address wormhole);

    event AddTokenEvent(address token);

    event RemoveTokenEvent(address token);

    event AddChainEvent(uint16 whChainId, bytes32 forwarder);

    event RemoveChainEvent(uint16 whChainId);

    event WithdrawTokenEvent(address token, uint256 amount);
}

File 11 of 15 : ITokenBridge.sol
// SPDX-License-Identifier: Apache 2

pragma solidity ^0.8.20;

import { IWETH } from "./IWETH.sol";
import { IWormhole } from "./IWormhole.sol";

interface ITokenBridge {
    struct Transfer {
        uint8 payloadID;
        uint256 amount;
        bytes32 tokenAddress;
        uint16 tokenChain;
        bytes32 to;
        uint16 toChain;
        uint256 fee;
    }

    struct TransferWithPayload {
        uint8 payloadID;
        uint256 amount;
        bytes32 tokenAddress;
        uint16 tokenChain;
        bytes32 to;
        uint16 toChain;
        bytes32 fromAddress;
        bytes payload;
    }

    struct AssetMeta {
        uint8 payloadID;
        bytes32 tokenAddress;
        uint16 tokenChain;
        uint8 decimals;
        bytes32 symbol;
        bytes32 name;
    }

    struct RegisterChain {
        bytes32 module;
        uint8 action;
        uint16 chainId;
        uint16 emitterChainID;
        bytes32 emitterAddress;
    }

    struct UpgradeContract {
        bytes32 module;
        uint8 action;
        uint16 chainId;
        bytes32 newContract;
    }

    struct RecoverChainId {
        bytes32 module;
        uint8 action;
        uint256 evmChainId;
        uint16 newChainId;
    }

    event ContractUpgraded(
        address indexed oldContract,
        address indexed newContract
    );

    event TransferRedeemed(
        uint16 indexed emitterChainId,
        bytes32 indexed emitterAddress,
        uint64 indexed sequence
    );

    function _parseTransferCommon(
        bytes memory encoded
    ) external pure returns (Transfer memory transfer);

    function attestToken(
        address tokenAddress,
        uint32 nonce
    ) external payable returns (uint64 sequence);

    function wrapAndTransferETH(
        uint16 recipientChain,
        bytes32 recipient,
        uint256 arbiterFee,
        uint32 nonce
    ) external payable returns (uint64 sequence);

    function wrapAndTransferETHWithPayload(
        uint16 recipientChain,
        bytes32 recipient,
        uint32 nonce,
        bytes memory payload
    ) external payable returns (uint64 sequence);

    function transferTokens(
        address token,
        uint256 amount,
        uint16 recipientChain,
        bytes32 recipient,
        uint256 arbiterFee,
        uint32 nonce
    ) external payable returns (uint64 sequence);

    function transferTokensWithPayload(
        address token,
        uint256 amount,
        uint16 recipientChain,
        bytes32 recipient,
        uint32 nonce,
        bytes memory payload
    ) external payable returns (uint64 sequence);

    function updateWrapped(
        bytes memory encodedVm
    ) external returns (address token);

    function createWrapped(
        bytes memory encodedVm
    ) external returns (address token);

    function completeTransferWithPayload(
        bytes memory encodedVm
    ) external returns (bytes memory);

    function completeTransferAndUnwrapETHWithPayload(
        bytes memory encodedVm
    ) external returns (bytes memory);

    function completeTransfer(bytes memory encodedVm) external;

    function completeTransferAndUnwrapETH(bytes memory encodedVm) external;

    function encodeAssetMeta(
        AssetMeta memory meta
    ) external pure returns (bytes memory encoded);

    function encodeTransfer(
        Transfer memory transfer
    ) external pure returns (bytes memory encoded);

    function encodeTransferWithPayload(
        TransferWithPayload memory transfer
    ) external pure returns (bytes memory encoded);

    function parsePayloadID(
        bytes memory encoded
    ) external pure returns (uint8 payloadID);

    function parseAssetMeta(
        bytes memory encoded
    ) external pure returns (AssetMeta memory meta);

    function parseTransfer(
        bytes memory encoded
    ) external pure returns (Transfer memory transfer);

    function parseTransferWithPayload(
        bytes memory encoded
    ) external pure returns (TransferWithPayload memory transfer);

    function governanceActionIsConsumed(
        bytes32 hash
    ) external view returns (bool);

    function isInitialized(address impl) external view returns (bool);

    function isTransferCompleted(bytes32 hash) external view returns (bool);

    function wormhole() external view returns (IWormhole);

    function chainId() external view returns (uint16);

    function evmChainId() external view returns (uint256);

    function isFork() external view returns (bool);

    function governanceChainId() external view returns (uint16);

    function governanceContract() external view returns (bytes32);

    function wrappedAsset(
        uint16 tokenChainId,
        bytes32 tokenAddress
    ) external view returns (address);

    function bridgeContracts(uint16 chainId_) external view returns (bytes32);

    function tokenImplementation() external view returns (address);

    function WETH() external view returns (IWETH);

    function outstandingBridged(address token) external view returns (uint256);

    function isWrappedAsset(address token) external view returns (bool);

    function finality() external view returns (uint8);

    function implementation() external view returns (address);

    function initialize() external;

    function registerChain(bytes memory encodedVM) external;

    function upgrade(bytes memory encodedVM) external;

    function submitRecoverChainId(bytes memory encodedVM) external;

    function parseRegisterChain(
        bytes memory encoded
    ) external pure returns (RegisterChain memory chain);

    function parseUpgrade(
        bytes memory encoded
    ) external pure returns (UpgradeContract memory chain);

    function parseRecoverChainId(
        bytes memory encodedRecoverChainId
    ) external pure returns (RecoverChainId memory rci);
}

File 12 of 15 : ITokenBridgeRelayer.sol
// SPDX-License-Identifier: Apache 2
// https://github.com/wormhole-foundation/example-token-bridge-relayer/tree/main/evm/src/interfaces

pragma solidity ^0.8.20;

import { IWETH } from "./IWETH.sol";
import { IWormhole } from "./IWormhole.sol";
import { ITokenBridge } from "./ITokenBridge.sol";

interface ITokenBridgeRelayer {
    struct TransferWithRelay {
        uint8 payloadId; // == 1
        uint256 targetRelayerFee;
        uint256 toNativeTokenAmount;
        bytes32 targetRecipient;
    }

    struct SwapRateUpdate {
        address token;
        uint256 value;
    }

    event TransferRedeemed(
        uint16 indexed emitterChainId,
        bytes32 indexed emitterAddress,
        uint64 indexed sequence
    );

    event SwapExecuted(
        address indexed recipient,
        address indexed relayer,
        address indexed token,
        uint256 tokenAmount,
        uint256 nativeAmount
    );

    function transferTokensWithRelay(
        address token,
        uint256 amount,
        uint256 toNativeTokenAmount,
        uint16 targetChain,
        bytes32 targetRecipient,
        uint32 batchId
    ) external payable returns (uint64 messageSequence);

    function wrapAndTransferEthWithRelay(
        uint256 toNativeTokenAmount,
        uint16 targetChain,
        bytes32 targetRecipient,
        uint32 batchId
    ) external payable returns (uint64 messageSequence);

    function completeTransferWithRelay(
        bytes calldata encodedTransferMessage
    ) external payable;

    function encodeTransferWithRelay(
        TransferWithRelay memory transfer
    ) external pure returns (bytes memory encoded);

    function decodeTransferWithRelay(
        bytes memory encoded
    ) external pure returns (TransferWithRelay memory transfer);

    function calculateMaxSwapAmountIn(
        address token
    ) external view returns (uint256);

    function calculateNativeSwapAmountOut(
        address token,
        uint256 toNativeAmount
    ) external view returns (uint256);

    function bytes32ToAddress(bytes32 address_) external pure returns (address);

    function updateWormholeFinality(
        uint16 chainId_,
        uint8 newWormholeFinality
    ) external;

    function submitOwnershipTransferRequest(
        uint16 chainId_,
        address newOwner
    ) external;

    function cancelOwnershipTransferRequest(uint16 chainId_) external;

    function confirmOwnershipTransferRequest() external;

    function updateOwnerAssistant(
        uint16 chainId_,
        address newAssistant
    ) external;

    function updateFeeRecipient(
        uint16 chainId_,
        address newFeeRecipient
    ) external;

    function updateUnwrapWethFlag(uint16 chainId_, bool unwrapWeth_) external;

    function registerContract(
        uint16 chainId_,
        bytes32 contractAddress
    ) external;

    function registerToken(uint16 chainId_, address token) external;

    function deregisterToken(uint16 chainId_, address token) external;

    function updateRelayerFee(uint16 chainId_, uint256 amount) external;

    function updateRelayerFeePrecision(
        uint16 chainId_,
        uint256 relayerFeePrecision_
    ) external;

    function updateSwapRate(
        uint16 chainId_,
        SwapRateUpdate[] calldata swapRateUpdate
    ) external;

    function updateSwapRatePrecision(
        uint16 chainId_,
        uint256 swapRatePrecision_
    ) external;

    function updateMaxNativeSwapAmount(
        uint16 chainId_,
        address token,
        uint256 maxAmount
    ) external;

    function setPauseForTransfers(uint16 chainId_, bool paused) external;

    function owner() external view returns (address);

    function pendingOwner() external view returns (address);

    function ownerAssistant() external view returns (address);

    function feeRecipient() external view returns (address);

    function tokenBridge() external view returns (ITokenBridge);

    function wormhole() external view returns (IWormhole);

    function WETH() external view returns (IWETH);

    function unwrapWeth() external view returns (bool);

    function chainId() external view returns (uint16);

    function getPaused() external view returns (bool);

    function relayerFeePrecision() external view returns (uint256);

    function relayerFee(uint16 chainId_) external view returns (uint256);

    function calculateRelayerFee(
        uint16 targetChainId,
        address token,
        uint8 decimals
    ) external view returns (uint256 feeInTokenDenomination);

    function swapRatePrecision() external view returns (uint256);

    function swapRate(address token) external view returns (uint256);

    function nativeSwapRate(address token) external view returns (uint256);

    function maxNativeSwapAmount(address token) external view returns (uint256);

    function getRegisteredContract(
        uint16 emitterChainId
    ) external view returns (bytes32);

    function isAcceptedToken(address token) external view returns (bool);

    function getAcceptedTokensList() external view returns (address[] memory);
}

File 13 of 15 : IWETH.sol
// SPDX-License-Identifier: Apache 2

pragma solidity ^0.8.20;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IWETH is IERC20 {
    function deposit() external payable;
    function withdraw(uint256 amount) external;
    function balanceOf() external returns (uint256);
}

File 14 of 15 : IWormhole.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.20;

interface IWormhole {
    struct GuardianSet {
        address[] keys;
        uint32 expirationTime;
    }

    struct Signature {
        bytes32 r;
        bytes32 s;
        uint8 v;
        uint8 guardianIndex;
    }

    struct VM {
        uint8 version;
        uint32 timestamp;
        uint32 nonce;
        uint16 emitterChainId;
        bytes32 emitterAddress;
        uint64 sequence;
        uint8 consistencyLevel;
        bytes payload;
        uint32 guardianSetIndex;
        Signature[] signatures;
        bytes32 hash;
    }

    struct ContractUpgrade {
        bytes32 module;
        uint8 action;
        uint16 chain;
        address newContract;
    }

    struct GuardianSetUpgrade {
        bytes32 module;
        uint8 action;
        uint16 chain;
        GuardianSet newGuardianSet;
        uint32 newGuardianSetIndex;
    }

    struct SetMessageFee {
        bytes32 module;
        uint8 action;
        uint16 chain;
        uint256 messageFee;
    }

    struct TransferFees {
        bytes32 module;
        uint8 action;
        uint16 chain;
        uint256 amount;
        bytes32 recipient;
    }

    struct RecoverChainId {
        bytes32 module;
        uint8 action;
        uint256 evmChainId;
        uint16 newChainId;
    }

    event LogMessagePublished(
        address indexed sender,
        uint64 sequence,
        uint32 nonce,
        bytes payload,
        uint8 consistencyLevel
    );
    event ContractUpgraded(
        address indexed oldContract,
        address indexed newContract
    );
    event GuardianSetAdded(uint32 indexed index);

    function publishMessage(
        uint32 nonce,
        bytes memory payload,
        uint8 consistencyLevel
    ) external payable returns (uint64 sequence);

    function initialize() external;

    function parseAndVerifyVM(
        bytes calldata encodedVM
    ) external view returns (VM memory vm, bool valid, string memory reason);

    function verifyVM(
        VM memory vm
    ) external view returns (bool valid, string memory reason);

    function verifySignatures(
        bytes32 hash,
        Signature[] memory signatures,
        GuardianSet memory guardianSet
    ) external pure returns (bool valid, string memory reason);

    function parseVM(
        bytes memory encodedVM
    ) external pure returns (VM memory vm);

    function quorum(
        uint256 numGuardians
    ) external pure returns (uint256 numSignaturesRequiredForQuorum);

    function getGuardianSet(
        uint32 index
    ) external view returns (GuardianSet memory);

    function getCurrentGuardianSetIndex() external view returns (uint32);

    function getGuardianSetExpiry() external view returns (uint32);

    function governanceActionIsConsumed(
        bytes32 hash
    ) external view returns (bool);

    function isInitialized(address impl) external view returns (bool);

    function chainId() external view returns (uint16);

    function isFork() external view returns (bool);

    function governanceChainId() external view returns (uint16);

    function governanceContract() external view returns (bytes32);

    function messageFee() external view returns (uint256);

    function evmChainId() external view returns (uint256);

    function nextSequence(address emitter) external view returns (uint64);

    function parseContractUpgrade(
        bytes memory encodedUpgrade
    ) external pure returns (ContractUpgrade memory cu);

    function parseGuardianSetUpgrade(
        bytes memory encodedUpgrade
    ) external pure returns (GuardianSetUpgrade memory gsu);

    function parseSetMessageFee(
        bytes memory encodedSetMessageFee
    ) external pure returns (SetMessageFee memory smf);

    function parseTransferFees(
        bytes memory encodedTransferFees
    ) external pure returns (TransferFees memory tf);

    function parseRecoverChainId(
        bytes memory encodedRecoverChainId
    ) external pure returns (RecoverChainId memory rci);

    function submitContractUpgrade(bytes memory _vm) external;

    function submitSetMessageFee(bytes memory _vm) external;

    function submitNewGuardianSet(bytes memory _vm) external;

    function submitTransferFees(bytes memory _vm) external;

    function submitRecoverChainId(bytes memory _vm) external;
}

File 15 of 15 : Storage.sol
// SPDX-License-Identifier: Apache 2
pragma solidity ^0.8.20;

contract Storage {
    // Wormhole contract address
    address public _wormhole;
    // TokenBridgeRelayer contract address.
    address public _tokenBridgeRelayer;
    // Whitelisted ERC20 tokens for wormhole bridge
    mapping(address => bool) public _tokens;
    // Whitelisted wormhole chain IDs as target chain
    mapping(uint16 => bool) public _targetChains;
    // Mapping of target chain ID to the forwarder(recipient) address\
    mapping(uint16 => bytes32) public _forwarders;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"wh","type":"address"},{"internalType":"address","name":"tbr","type":"address"}],"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":[{"internalType":"uint16","name":"chainId","type":"uint16"}],"name":"ChainDisabled","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"tbr","type":"address"}],"name":"InvalidTokenBridgeRelayer","type":"error"},{"inputs":[{"internalType":"address","name":"wh","type":"address"}],"name":"InvalidWormhole","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint16","name":"targetChain","type":"uint16"}],"name":"NotWhitelisted","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"Unsupported","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"whChainId","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"forwarder","type":"bytes32"}],"name":"AddChainEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"AddTokenEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"whChainId","type":"uint16"}],"name":"RemoveChainEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"RemoveTokenEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenBridgeRelayer","type":"address"}],"name":"SetTokenBridgeRelayerEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"wormhole","type":"address"}],"name":"SetWormholeEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawTokenEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"targetChain","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"forwarder","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"messageSequence","type":"uint64"}],"name":"WormholeERC20DepositEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"targetChain","type":"uint16"},{"indexed":false,"internalType":"bytes32","name":"forwarder","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"messageSequence","type":"uint64"}],"name":"WormholeETHDepositEvent","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"_forwarders","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"_targetChains","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_tokenBridgeRelayer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_tokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_wormhole","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"whChainId","type":"uint16"},{"internalType":"bytes32","name":"forwarder","type":"bytes32"}],"name":"addChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"addToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"targetChain","type":"uint16"}],"name":"depositETH","outputs":[{"internalType":"uint64","name":"messageSequence","type":"uint64"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint16","name":"targetChain","type":"uint16"}],"name":"depositToken","outputs":[{"internalType":"uint64","name":"messageSequence","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"whChainId","type":"uint16"}],"name":"forwarderByChainId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"whChainId","type":"uint16"}],"name":"isChainEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint16","name":"whChainId","type":"uint16"}],"name":"isTokenWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"whChainId","type":"uint16"}],"name":"removeChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tbr","type":"address"}],"name":"setTokenBridgeRelayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wh","type":"address"}],"name":"setWormhole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenBridgeRelayer","outputs":[{"internalType":"contract ITokenBridgeRelayer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wormhole","outputs":[{"internalType":"contract IWormhole","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b506040516200258538038062002585833981810160405281019062000037919062000366565b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000ad5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620000a49190620003be565b60405180910390fd5b620000be816200023860201b60201c565b5060018081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036200013a57816040517f62db64b5000000000000000000000000000000000000000000000000000000008152600401620001319190620003be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620001ae57806040517fdbdedc8e000000000000000000000000000000000000000000000000000000008152600401620001a59190620003be565b60405180910390fd5b81600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050620003db565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200032e8262000301565b9050919050565b620003408162000321565b81146200034c57600080fd5b50565b600081519050620003608162000335565b92915050565b6000806040838503121562000380576200037f620002fc565b5b600062000390858286016200034f565b9250506020620003a3858286016200034f565b9150509250929050565b620003b88162000321565b82525050565b6000602082019050620003d56000830184620003ad565b92915050565b61219a80620003eb6000396000f3fe6080604052600436106101395760003560e01c806384acd1bb116100ab578063d48bfca71161006f578063d48bfca714610495578063d49f53b8146104be578063e21ee56a146104e7578063f2fde38b14610510578063f468f68514610539578063f8d3f2f91461057657610170565b806384acd1bb146103bb5780638da5cb5b146103e65780639c3dad1c146104115780639e281a9814610441578063b6017e511461046a57610170565b80634a6aff29116100fd5780634a6aff29146102ab5780635e565460146102d65780635fa7b584146103015780636ce164011461032a578063715018a6146103675780637b90a8521461037e57610170565b806306f41646146101a257806316cd572e146101df5780631c510a15146102085780633b29cc641461024557806346c026aa1461028257610170565b36610170576040517f90a2caf200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f90a2caf200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3480156101ae57600080fd5b506101c960048036038101906101c491906118a3565b6105b3565b6040516101d691906118eb565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190611976565b6105d3565b005b34801561021457600080fd5b5061022f600480360381019061022a91906119ec565b61067c565b60405161023c9190611a62565b60405180910390f35b34801561025157600080fd5b5061026c60048036038101906102679190611a7d565b610891565b60405161027991906118eb565b60405180910390f35b34801561028e57600080fd5b506102a960048036038101906102a49190611a7d565b6108c3565b005b3480156102b757600080fd5b506102c0610949565b6040516102cd9190611ab9565b60405180910390f35b3480156102e257600080fd5b506102eb61096f565b6040516102f89190611ab9565b60405180910390f35b34801561030d57600080fd5b50610328600480360381019061032391906118a3565b610995565b005b34801561033657600080fd5b50610351600480360381019061034c9190611a7d565b610a3f565b60405161035e9190611ae3565b60405180910390f35b34801561037357600080fd5b5061037c610afb565b005b34801561038a57600080fd5b506103a560048036038101906103a09190611a7d565b610b0f565b6040516103b291906118eb565b60405180910390f35b3480156103c757600080fd5b506103d0610b2f565b6040516103dd9190611b5d565b60405180910390f35b3480156103f257600080fd5b506103fb610b59565b6040516104089190611ab9565b60405180910390f35b61042b60048036038101906104269190611a7d565b610b82565b6040516104389190611a62565b60405180910390f35b34801561044d57600080fd5b5061046860048036038101906104639190611bb6565b610c74565b005b34801561047657600080fd5b5061047f610cdb565b60405161048c9190611c17565b60405180910390f35b3480156104a157600080fd5b506104bc60048036038101906104b791906118a3565b610d05565b005b3480156104ca57600080fd5b506104e560048036038101906104e091906118a3565b610daf565b005b3480156104f357600080fd5b5061050e600480360381019061050991906118a3565b610eb3565b005b34801561051c57600080fd5b50610537600480360381019061053291906118a3565b610fb7565b005b34801561054557600080fd5b50610560600480360381019061055b9190611a7d565b61103d565b60405161056d9190611ae3565b60405180910390f35b34801561058257600080fd5b5061059d60048036038101906105989190611c32565b611055565b6040516105aa91906118eb565b60405180910390f35b60046020528060005260406000206000915054906101000a900460ff1681565b6105db6110dd565b6105e3611164565b6001600560008461ffff1661ffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600660008461ffff1661ffff168152602001908152602001600020819055507f6f90ef87f9ab2bc7047c46d4f541b0f9ae591a1aa0c3f313b3bf40fea411be808282604051610668929190611c81565b60405180910390a16106786111aa565b5050565b6000610686611164565b6106908483611055565b6106d35783826040517f7f7c3e8c0000000000000000000000000000000000000000000000000000000081526004016106ca929190611caa565b60405180910390fd5b60006106de83610a3f565b90506106ec853330876111b3565b60008573ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30610713610cdb565b6040518363ffffffff1660e01b8152600401610730929190611cd3565b602060405180830381865afa15801561074d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107719190611d11565b9050848110156107ae576107ad86610787610cdb565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611235565b5b6107b6610cdb565b73ffffffffffffffffffffffffffffffffffffffff16631019d65487876000888760006040518763ffffffff1660e01b81526004016107fa96959493929190611dc9565b6020604051808303816000875af1158015610819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083d9190611e56565b92507f58ba2d42884b532935606e928c4419542ed71109e5b0058455eeb67e5b71a41933878787868860405161087896959493929190611e83565b60405180910390a1505061088a6111aa565b9392505050565b6000600560008361ffff1661ffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6108cb6110dd565b6108d3611164565b6000600560008361ffff1661ffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9b13b2f098364a63a80fd35470a9e35fcd12f38796770ad6f11e7f9c6daa068c816040516109369190611ee4565b60405180910390a16109466111aa565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61099d6110dd565b6109a5611164565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f382de1b4066f7158b67c92c125edeaf7c7c188d217a9592d5b81ad5372bff4e781604051610a2c9190611ab9565b60405180910390a1610a3c6111aa565b50565b6000610a4a82610891565b610a8b57816040517f4dc2c273000000000000000000000000000000000000000000000000000000008152600401610a829190611ee4565b60405180910390fd5b6000600660008461ffff1661ffff1681526020019081526020016000205490506000801b8103610af257826040517f4dc2c273000000000000000000000000000000000000000000000000000000008152600401610ae99190611ee4565b60405180910390fd5b80915050919050565b610b036110dd565b610b0d60006112d1565b565b60056020528060005260406000206000915054906101000a900460ff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610b8c611164565b6000610b9783610a3f565b9050610ba1610cdb565b73ffffffffffffffffffffffffffffffffffffffff166329ac8361346000868560006040518663ffffffff1660e01b8152600401610be29493929190611eff565b60206040518083038185885af1158015610c00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c259190611e56565b91507fe39121df199b9889d0961ab2f4d5ae7fc4022889448acc6e61db8f2b5ddaed923334858486604051610c5e959493929190611f44565b60405180910390a150610c6f6111aa565b919050565b610c7c6110dd565b610c84611164565b610c9682610c90610b59565b83611395565b7f33052e7857076b0fe2659b8d1bbe98f9a6c51cd43780f733dde08f81b2ca94588282604051610cc7929190611f97565b60405180910390a1610cd76111aa565b5050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610d0d6110dd565b610d15611164565b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fca42a4201c11ccc341dd7ab86d8309719300acccdf8de4ce093d0128e69a50a181604051610d9c9190611ab9565b60405180910390a1610dac6111aa565b50565b610db76110dd565b610dbf611164565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e3057806040517f62db64b5000000000000000000000000000000000000000000000000000000008152600401610e279190611ab9565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8fb03834c634ef996436c6eb9c3f014062b97348a295ad06f6c364e163e7684881604051610ea09190611ab9565b60405180910390a1610eb06111aa565b50565b610ebb6110dd565b610ec3611164565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f3457806040517fdbdedc8e000000000000000000000000000000000000000000000000000000008152600401610f2b9190611ab9565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8eb35a69c674a6ca1cede5fd385d666ce9bfedd13d083fbe27e09c6e30d4d4a181604051610fa49190611ab9565b60405180910390a1610fb46111aa565b50565b610fbf6110dd565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110315760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016110289190611ab9565b60405180910390fd5b61103a816112d1565b50565b60066020528060005260406000206000915090505481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156110d55750600560008361ffff1661ffff16815260200190815260200160002060009054906101000a900460ff165b905092915050565b6110e5611414565b73ffffffffffffffffffffffffffffffffffffffff16611103610b59565b73ffffffffffffffffffffffffffffffffffffffff161461116257611126611414565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111599190611ab9565b60405180910390fd5b565b6002600154036111a0576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b60018081905550565b61122f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016111e893929190611fc0565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061141c565b50505050565b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401611272929190611cd3565b602060405180830381865afa15801561128f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b39190611d11565b90506112cb848484846112c69190612026565b6114b3565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61140f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016113c8929190611f97565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061141c565b505050565b600033905090565b6000611447828473ffffffffffffffffffffffffffffffffffffffff166115c290919063ffffffff16565b9050600081511415801561146c57508080602001905181019061146a9190612086565b155b156114ae57826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016114a59190611ab9565b60405180910390fd5b505050565b60008373ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040516024016114e4929190611f97565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905061153284826115d8565b6115bc576115b1848573ffffffffffffffffffffffffffffffffffffffff1663095ea7b386600060405160240161156a9291906120b3565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061141c565b6115bb848261141c565b5b50505050565b60606115d08383600061169f565b905092915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1684604051611602919061214d565b6000604051808303816000865af19150503d806000811461163f576040519150601f19603f3d011682016040523d82523d6000602084013e611644565b606091505b509150915081801561167257506000815114806116715750808060200190518101906116709190612086565b5b5b8015611695575060008573ffffffffffffffffffffffffffffffffffffffff163b115b9250505092915050565b6060814710156116e657306040517fcd7860590000000000000000000000000000000000000000000000000000000081526004016116dd9190611ab9565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161170f919061214d565b60006040518083038185875af1925050503d806000811461174c576040519150601f19603f3d011682016040523d82523d6000602084013e611751565b606091505b509150915061176186838361176c565b925050509392505050565b6060826117815761177c826117fb565b6117f3565b600082511480156117a9575060008473ffffffffffffffffffffffffffffffffffffffff163b145b156117eb57836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016117e29190611ab9565b60405180910390fd5b8190506117f4565b5b9392505050565b60008151111561180e5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061187082611845565b9050919050565b61188081611865565b811461188b57600080fd5b50565b60008135905061189d81611877565b92915050565b6000602082840312156118b9576118b8611840565b5b60006118c78482850161188e565b91505092915050565b60008115159050919050565b6118e5816118d0565b82525050565b600060208201905061190060008301846118dc565b92915050565b600061ffff82169050919050565b61191d81611906565b811461192857600080fd5b50565b60008135905061193a81611914565b92915050565b6000819050919050565b61195381611940565b811461195e57600080fd5b50565b6000813590506119708161194a565b92915050565b6000806040838503121561198d5761198c611840565b5b600061199b8582860161192b565b92505060206119ac85828601611961565b9150509250929050565b6000819050919050565b6119c9816119b6565b81146119d457600080fd5b50565b6000813590506119e6816119c0565b92915050565b600080600060608486031215611a0557611a04611840565b5b6000611a138682870161188e565b9350506020611a24868287016119d7565b9250506040611a358682870161192b565b9150509250925092565b600067ffffffffffffffff82169050919050565b611a5c81611a3f565b82525050565b6000602082019050611a776000830184611a53565b92915050565b600060208284031215611a9357611a92611840565b5b6000611aa18482850161192b565b91505092915050565b611ab381611865565b82525050565b6000602082019050611ace6000830184611aaa565b92915050565b611add81611940565b82525050565b6000602082019050611af86000830184611ad4565b92915050565b6000819050919050565b6000611b23611b1e611b1984611845565b611afe565b611845565b9050919050565b6000611b3582611b08565b9050919050565b6000611b4782611b2a565b9050919050565b611b5781611b3c565b82525050565b6000602082019050611b726000830184611b4e565b92915050565b6000611b8382611865565b9050919050565b611b9381611b78565b8114611b9e57600080fd5b50565b600081359050611bb081611b8a565b92915050565b60008060408385031215611bcd57611bcc611840565b5b6000611bdb85828601611ba1565b9250506020611bec858286016119d7565b9150509250929050565b6000611c0182611b2a565b9050919050565b611c1181611bf6565b82525050565b6000602082019050611c2c6000830184611c08565b92915050565b60008060408385031215611c4957611c48611840565b5b6000611c578582860161188e565b9250506020611c688582860161192b565b9150509250929050565b611c7b81611906565b82525050565b6000604082019050611c966000830185611c72565b611ca36020830184611ad4565b9392505050565b6000604082019050611cbf6000830185611aaa565b611ccc6020830184611c72565b9392505050565b6000604082019050611ce86000830185611aaa565b611cf56020830184611aaa565b9392505050565b600081519050611d0b816119c0565b92915050565b600060208284031215611d2757611d26611840565b5b6000611d3584828501611cfc565b91505092915050565b611d47816119b6565b82525050565b6000819050919050565b6000611d72611d6d611d6884611d4d565b611afe565b6119b6565b9050919050565b611d8281611d57565b82525050565b600063ffffffff82169050919050565b6000611db3611dae611da984611d4d565b611afe565b611d88565b9050919050565b611dc381611d98565b82525050565b600060c082019050611dde6000830189611aaa565b611deb6020830188611d3e565b611df86040830187611d79565b611e056060830186611c72565b611e126080830185611ad4565b611e1f60a0830184611dba565b979650505050505050565b611e3381611a3f565b8114611e3e57600080fd5b50565b600081519050611e5081611e2a565b92915050565b600060208284031215611e6c57611e6b611840565b5b6000611e7a84828501611e41565b91505092915050565b600060c082019050611e986000830189611aaa565b611ea56020830188611aaa565b611eb26040830187611d3e565b611ebf6060830186611c72565b611ecc6080830185611ad4565b611ed960a0830184611a53565b979650505050505050565b6000602082019050611ef96000830184611c72565b92915050565b6000608082019050611f146000830187611d79565b611f216020830186611c72565b611f2e6040830185611ad4565b611f3b6060830184611dba565b95945050505050565b600060a082019050611f596000830188611aaa565b611f666020830187611d3e565b611f736040830186611c72565b611f806060830185611ad4565b611f8d6080830184611a53565b9695505050505050565b6000604082019050611fac6000830185611aaa565b611fb96020830184611d3e565b9392505050565b6000606082019050611fd56000830186611aaa565b611fe26020830185611aaa565b611fef6040830184611d3e565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612031826119b6565b915061203c836119b6565b925082820190508082111561205457612053611ff7565b5b92915050565b612063816118d0565b811461206e57600080fd5b50565b6000815190506120808161205a565b92915050565b60006020828403121561209c5761209b611840565b5b60006120aa84828501612071565b91505092915050565b60006040820190506120c86000830185611aaa565b6120d56020830184611d79565b9392505050565b600081519050919050565b600081905092915050565b60005b838110156121105780820151818401526020810190506120f5565b60008484015250505050565b6000612127826120dc565b61213181856120e7565b93506121418185602086016120f2565b80840191505092915050565b6000612159828461211c565b91508190509291505056fea2646970667358221220644001c031ec69fcc2d9b6e3451e956403252638ca9edb6cb622e29aaa316a2564736f6c6343000818003300000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b000000000000000000000000cafd2f0a35a4459fa40c0517e17e6fa2939441ca

Deployed Bytecode

0x6080604052600436106101395760003560e01c806384acd1bb116100ab578063d48bfca71161006f578063d48bfca714610495578063d49f53b8146104be578063e21ee56a146104e7578063f2fde38b14610510578063f468f68514610539578063f8d3f2f91461057657610170565b806384acd1bb146103bb5780638da5cb5b146103e65780639c3dad1c146104115780639e281a9814610441578063b6017e511461046a57610170565b80634a6aff29116100fd5780634a6aff29146102ab5780635e565460146102d65780635fa7b584146103015780636ce164011461032a578063715018a6146103675780637b90a8521461037e57610170565b806306f41646146101a257806316cd572e146101df5780631c510a15146102085780633b29cc641461024557806346c026aa1461028257610170565b36610170576040517f90a2caf200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f90a2caf200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3480156101ae57600080fd5b506101c960048036038101906101c491906118a3565b6105b3565b6040516101d691906118eb565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190611976565b6105d3565b005b34801561021457600080fd5b5061022f600480360381019061022a91906119ec565b61067c565b60405161023c9190611a62565b60405180910390f35b34801561025157600080fd5b5061026c60048036038101906102679190611a7d565b610891565b60405161027991906118eb565b60405180910390f35b34801561028e57600080fd5b506102a960048036038101906102a49190611a7d565b6108c3565b005b3480156102b757600080fd5b506102c0610949565b6040516102cd9190611ab9565b60405180910390f35b3480156102e257600080fd5b506102eb61096f565b6040516102f89190611ab9565b60405180910390f35b34801561030d57600080fd5b50610328600480360381019061032391906118a3565b610995565b005b34801561033657600080fd5b50610351600480360381019061034c9190611a7d565b610a3f565b60405161035e9190611ae3565b60405180910390f35b34801561037357600080fd5b5061037c610afb565b005b34801561038a57600080fd5b506103a560048036038101906103a09190611a7d565b610b0f565b6040516103b291906118eb565b60405180910390f35b3480156103c757600080fd5b506103d0610b2f565b6040516103dd9190611b5d565b60405180910390f35b3480156103f257600080fd5b506103fb610b59565b6040516104089190611ab9565b60405180910390f35b61042b60048036038101906104269190611a7d565b610b82565b6040516104389190611a62565b60405180910390f35b34801561044d57600080fd5b5061046860048036038101906104639190611bb6565b610c74565b005b34801561047657600080fd5b5061047f610cdb565b60405161048c9190611c17565b60405180910390f35b3480156104a157600080fd5b506104bc60048036038101906104b791906118a3565b610d05565b005b3480156104ca57600080fd5b506104e560048036038101906104e091906118a3565b610daf565b005b3480156104f357600080fd5b5061050e600480360381019061050991906118a3565b610eb3565b005b34801561051c57600080fd5b50610537600480360381019061053291906118a3565b610fb7565b005b34801561054557600080fd5b50610560600480360381019061055b9190611a7d565b61103d565b60405161056d9190611ae3565b60405180910390f35b34801561058257600080fd5b5061059d60048036038101906105989190611c32565b611055565b6040516105aa91906118eb565b60405180910390f35b60046020528060005260406000206000915054906101000a900460ff1681565b6105db6110dd565b6105e3611164565b6001600560008461ffff1661ffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600660008461ffff1661ffff168152602001908152602001600020819055507f6f90ef87f9ab2bc7047c46d4f541b0f9ae591a1aa0c3f313b3bf40fea411be808282604051610668929190611c81565b60405180910390a16106786111aa565b5050565b6000610686611164565b6106908483611055565b6106d35783826040517f7f7c3e8c0000000000000000000000000000000000000000000000000000000081526004016106ca929190611caa565b60405180910390fd5b60006106de83610a3f565b90506106ec853330876111b3565b60008573ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30610713610cdb565b6040518363ffffffff1660e01b8152600401610730929190611cd3565b602060405180830381865afa15801561074d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107719190611d11565b9050848110156107ae576107ad86610787610cdb565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611235565b5b6107b6610cdb565b73ffffffffffffffffffffffffffffffffffffffff16631019d65487876000888760006040518763ffffffff1660e01b81526004016107fa96959493929190611dc9565b6020604051808303816000875af1158015610819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083d9190611e56565b92507f58ba2d42884b532935606e928c4419542ed71109e5b0058455eeb67e5b71a41933878787868860405161087896959493929190611e83565b60405180910390a1505061088a6111aa565b9392505050565b6000600560008361ffff1661ffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6108cb6110dd565b6108d3611164565b6000600560008361ffff1661ffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9b13b2f098364a63a80fd35470a9e35fcd12f38796770ad6f11e7f9c6daa068c816040516109369190611ee4565b60405180910390a16109466111aa565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61099d6110dd565b6109a5611164565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f382de1b4066f7158b67c92c125edeaf7c7c188d217a9592d5b81ad5372bff4e781604051610a2c9190611ab9565b60405180910390a1610a3c6111aa565b50565b6000610a4a82610891565b610a8b57816040517f4dc2c273000000000000000000000000000000000000000000000000000000008152600401610a829190611ee4565b60405180910390fd5b6000600660008461ffff1661ffff1681526020019081526020016000205490506000801b8103610af257826040517f4dc2c273000000000000000000000000000000000000000000000000000000008152600401610ae99190611ee4565b60405180910390fd5b80915050919050565b610b036110dd565b610b0d60006112d1565b565b60056020528060005260406000206000915054906101000a900460ff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610b8c611164565b6000610b9783610a3f565b9050610ba1610cdb565b73ffffffffffffffffffffffffffffffffffffffff166329ac8361346000868560006040518663ffffffff1660e01b8152600401610be29493929190611eff565b60206040518083038185885af1158015610c00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c259190611e56565b91507fe39121df199b9889d0961ab2f4d5ae7fc4022889448acc6e61db8f2b5ddaed923334858486604051610c5e959493929190611f44565b60405180910390a150610c6f6111aa565b919050565b610c7c6110dd565b610c84611164565b610c9682610c90610b59565b83611395565b7f33052e7857076b0fe2659b8d1bbe98f9a6c51cd43780f733dde08f81b2ca94588282604051610cc7929190611f97565b60405180910390a1610cd76111aa565b5050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610d0d6110dd565b610d15611164565b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fca42a4201c11ccc341dd7ab86d8309719300acccdf8de4ce093d0128e69a50a181604051610d9c9190611ab9565b60405180910390a1610dac6111aa565b50565b610db76110dd565b610dbf611164565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e3057806040517f62db64b5000000000000000000000000000000000000000000000000000000008152600401610e279190611ab9565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8fb03834c634ef996436c6eb9c3f014062b97348a295ad06f6c364e163e7684881604051610ea09190611ab9565b60405180910390a1610eb06111aa565b50565b610ebb6110dd565b610ec3611164565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f3457806040517fdbdedc8e000000000000000000000000000000000000000000000000000000008152600401610f2b9190611ab9565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8eb35a69c674a6ca1cede5fd385d666ce9bfedd13d083fbe27e09c6e30d4d4a181604051610fa49190611ab9565b60405180910390a1610fb46111aa565b50565b610fbf6110dd565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036110315760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016110289190611ab9565b60405180910390fd5b61103a816112d1565b50565b60066020528060005260406000206000915090505481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156110d55750600560008361ffff1661ffff16815260200190815260200160002060009054906101000a900460ff165b905092915050565b6110e5611414565b73ffffffffffffffffffffffffffffffffffffffff16611103610b59565b73ffffffffffffffffffffffffffffffffffffffff161461116257611126611414565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016111599190611ab9565b60405180910390fd5b565b6002600154036111a0576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b60018081905550565b61122f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016111e893929190611fc0565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061141c565b50505050565b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401611272929190611cd3565b602060405180830381865afa15801561128f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b39190611d11565b90506112cb848484846112c69190612026565b6114b3565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61140f838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016113c8929190611f97565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061141c565b505050565b600033905090565b6000611447828473ffffffffffffffffffffffffffffffffffffffff166115c290919063ffffffff16565b9050600081511415801561146c57508080602001905181019061146a9190612086565b155b156114ae57826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016114a59190611ab9565b60405180910390fd5b505050565b60008373ffffffffffffffffffffffffffffffffffffffff1663095ea7b384846040516024016114e4929190611f97565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050905061153284826115d8565b6115bc576115b1848573ffffffffffffffffffffffffffffffffffffffff1663095ea7b386600060405160240161156a9291906120b3565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061141c565b6115bb848261141c565b5b50505050565b60606115d08383600061169f565b905092915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1684604051611602919061214d565b6000604051808303816000865af19150503d806000811461163f576040519150601f19603f3d011682016040523d82523d6000602084013e611644565b606091505b509150915081801561167257506000815114806116715750808060200190518101906116709190612086565b5b5b8015611695575060008573ffffffffffffffffffffffffffffffffffffffff163b115b9250505092915050565b6060814710156116e657306040517fcd7860590000000000000000000000000000000000000000000000000000000081526004016116dd9190611ab9565b60405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff16848660405161170f919061214d565b60006040518083038185875af1925050503d806000811461174c576040519150601f19603f3d011682016040523d82523d6000602084013e611751565b606091505b509150915061176186838361176c565b925050509392505050565b6060826117815761177c826117fb565b6117f3565b600082511480156117a9575060008473ffffffffffffffffffffffffffffffffffffffff163b145b156117eb57836040517f9996b3150000000000000000000000000000000000000000000000000000000081526004016117e29190611ab9565b60405180910390fd5b8190506117f4565b5b9392505050565b60008151111561180e5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061187082611845565b9050919050565b61188081611865565b811461188b57600080fd5b50565b60008135905061189d81611877565b92915050565b6000602082840312156118b9576118b8611840565b5b60006118c78482850161188e565b91505092915050565b60008115159050919050565b6118e5816118d0565b82525050565b600060208201905061190060008301846118dc565b92915050565b600061ffff82169050919050565b61191d81611906565b811461192857600080fd5b50565b60008135905061193a81611914565b92915050565b6000819050919050565b61195381611940565b811461195e57600080fd5b50565b6000813590506119708161194a565b92915050565b6000806040838503121561198d5761198c611840565b5b600061199b8582860161192b565b92505060206119ac85828601611961565b9150509250929050565b6000819050919050565b6119c9816119b6565b81146119d457600080fd5b50565b6000813590506119e6816119c0565b92915050565b600080600060608486031215611a0557611a04611840565b5b6000611a138682870161188e565b9350506020611a24868287016119d7565b9250506040611a358682870161192b565b9150509250925092565b600067ffffffffffffffff82169050919050565b611a5c81611a3f565b82525050565b6000602082019050611a776000830184611a53565b92915050565b600060208284031215611a9357611a92611840565b5b6000611aa18482850161192b565b91505092915050565b611ab381611865565b82525050565b6000602082019050611ace6000830184611aaa565b92915050565b611add81611940565b82525050565b6000602082019050611af86000830184611ad4565b92915050565b6000819050919050565b6000611b23611b1e611b1984611845565b611afe565b611845565b9050919050565b6000611b3582611b08565b9050919050565b6000611b4782611b2a565b9050919050565b611b5781611b3c565b82525050565b6000602082019050611b726000830184611b4e565b92915050565b6000611b8382611865565b9050919050565b611b9381611b78565b8114611b9e57600080fd5b50565b600081359050611bb081611b8a565b92915050565b60008060408385031215611bcd57611bcc611840565b5b6000611bdb85828601611ba1565b9250506020611bec858286016119d7565b9150509250929050565b6000611c0182611b2a565b9050919050565b611c1181611bf6565b82525050565b6000602082019050611c2c6000830184611c08565b92915050565b60008060408385031215611c4957611c48611840565b5b6000611c578582860161188e565b9250506020611c688582860161192b565b9150509250929050565b611c7b81611906565b82525050565b6000604082019050611c966000830185611c72565b611ca36020830184611ad4565b9392505050565b6000604082019050611cbf6000830185611aaa565b611ccc6020830184611c72565b9392505050565b6000604082019050611ce86000830185611aaa565b611cf56020830184611aaa565b9392505050565b600081519050611d0b816119c0565b92915050565b600060208284031215611d2757611d26611840565b5b6000611d3584828501611cfc565b91505092915050565b611d47816119b6565b82525050565b6000819050919050565b6000611d72611d6d611d6884611d4d565b611afe565b6119b6565b9050919050565b611d8281611d57565b82525050565b600063ffffffff82169050919050565b6000611db3611dae611da984611d4d565b611afe565b611d88565b9050919050565b611dc381611d98565b82525050565b600060c082019050611dde6000830189611aaa565b611deb6020830188611d3e565b611df86040830187611d79565b611e056060830186611c72565b611e126080830185611ad4565b611e1f60a0830184611dba565b979650505050505050565b611e3381611a3f565b8114611e3e57600080fd5b50565b600081519050611e5081611e2a565b92915050565b600060208284031215611e6c57611e6b611840565b5b6000611e7a84828501611e41565b91505092915050565b600060c082019050611e986000830189611aaa565b611ea56020830188611aaa565b611eb26040830187611d3e565b611ebf6060830186611c72565b611ecc6080830185611ad4565b611ed960a0830184611a53565b979650505050505050565b6000602082019050611ef96000830184611c72565b92915050565b6000608082019050611f146000830187611d79565b611f216020830186611c72565b611f2e6040830185611ad4565b611f3b6060830184611dba565b95945050505050565b600060a082019050611f596000830188611aaa565b611f666020830187611d3e565b611f736040830186611c72565b611f806060830185611ad4565b611f8d6080830184611a53565b9695505050505050565b6000604082019050611fac6000830185611aaa565b611fb96020830184611d3e565b9392505050565b6000606082019050611fd56000830186611aaa565b611fe26020830185611aaa565b611fef6040830184611d3e565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612031826119b6565b915061203c836119b6565b925082820190508082111561205457612053611ff7565b5b92915050565b612063816118d0565b811461206e57600080fd5b50565b6000815190506120808161205a565b92915050565b60006020828403121561209c5761209b611840565b5b60006120aa84828501612071565b91505092915050565b60006040820190506120c86000830185611aaa565b6120d56020830184611d79565b9392505050565b600081519050919050565b600081905092915050565b60005b838110156121105780820151818401526020810190506120f5565b60008484015250505050565b6000612127826120dc565b61213181856120e7565b93506121418185602086016120f2565b80840191505092915050565b6000612159828461211c565b91508190509291505056fea2646970667358221220644001c031ec69fcc2d9b6e3451e956403252638ca9edb6cb622e29aaa316a2564736f6c63430008180033

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

00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b000000000000000000000000cafd2f0a35a4459fa40c0517e17e6fa2939441ca

-----Decoded View---------------
Arg [0] : wh (address): 0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B
Arg [1] : tbr (address): 0xCafd2f0A35A4459fA40C0517e17e6fA2939441CA

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000098f3c9e6e3face36baad05fe09d375ef1464288b
Arg [1] : 000000000000000000000000cafd2f0a35a4459fa40c0517e17e6fa2939441ca


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  ]

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.