ETH Price: $2,026.08 (-1.40%)
Gas: 44 Gwei
 

Multi Chain

Transaction Hash
Method
Block
From
To
Value
0x0918b4d1d73adbc768253cd4786021fbc15265ccd6602b9cc7aa736e3d9b7fcaWrap And Relay T...(pending)2023-11-27 9:56:512 days 11 hrs ago1701079011IN
PulseChain: WETH Omnibridge Router
0.031 ETH(Pending)(Pending)
0x89bdd0e7d1d274ce5a358d34fca8c9498eae35883fbb61eecdefcd9b2faebf39Wrap And Relay T...(pending)2023-11-26 2:32:133 days 19 hrs ago1700965933IN
PulseChain: WETH Omnibridge Router
0.1875 ETH(Pending)(Pending)
Wrap And Relay T...186800312023-11-29 21:44:356 mins ago1701294275IN
PulseChain: WETH Omnibridge Router
0.15 ETH0.0074606137.54200937
Wrap And Relay T...186799072023-11-29 21:19:4731 mins ago1701292787IN
PulseChain: WETH Omnibridge Router
0.1104 ETH0.0117604459.17532926
Wrap And Relay T...186797922023-11-29 20:56:3554 mins ago1701291395IN
PulseChain: WETH Omnibridge Router
0.065 ETH0.0089580945.07465448
Wrap And Relay T...186795732023-11-29 20:12:351 hr 38 mins ago1701288755IN
PulseChain: WETH Omnibridge Router
0.093 ETH0.0080832140.67250639
Wrap And Relay T...186794902023-11-29 19:55:591 hr 55 mins ago1701287759IN
PulseChain: WETH Omnibridge Router
0.21 ETH0.0101694751.16999687
Wrap And Relay T...186794112023-11-29 19:39:472 hrs 11 mins ago1701286787IN
PulseChain: WETH Omnibridge Router
0.101 ETH0.0108670954.68024011
Wrap And Relay T...186794042023-11-29 19:38:232 hrs 12 mins ago1701286703IN
PulseChain: WETH Omnibridge Router
1.057 ETH0.0103710952.18447545
Wrap And Relay T...186793582023-11-29 19:28:592 hrs 22 mins ago1701286139IN
PulseChain: WETH Omnibridge Router
0.055 ETH0.0098657149.64157562
Wrap And Relay T...186793452023-11-29 19:26:232 hrs 24 mins ago1701285983IN
PulseChain: WETH Omnibridge Router
0.91 ETH0.0090671645.62347218
Wrap And Relay T...186793032023-11-29 19:17:592 hrs 33 mins ago1701285479IN
PulseChain: WETH Omnibridge Router
1.5 ETH0.0104598452.63108516
Wrap And Relay T...186792442023-11-29 19:06:112 hrs 44 mins ago1701284771IN
PulseChain: WETH Omnibridge Router
0.165 ETH0.0101992651.3198781
Wrap And Relay T...186791922023-11-29 18:55:472 hrs 55 mins ago1701284147IN
PulseChain: WETH Omnibridge Router
0.03979243 ETH0.0090161845.36694914
Wrap And Relay T...186791782023-11-29 18:52:592 hrs 58 mins ago1701283979IN
PulseChain: WETH Omnibridge Router
0.09300367 ETH0.007263936.54994858
Wrap And Relay T...186791402023-11-29 18:45:233 hrs 5 mins ago1701283523IN
PulseChain: WETH Omnibridge Router
0.084 ETH0.0073061936.76274168
Wrap And Relay T...186790332023-11-29 18:23:593 hrs 27 mins ago1701282239IN
PulseChain: WETH Omnibridge Router
0.0502013 ETH0.0066490233.45809424
Wrap And Relay T...186789762023-11-29 18:12:233 hrs 38 mins ago1701281543IN
PulseChain: WETH Omnibridge Router
0.51 ETH0.0079605240.05517629
Wrap And Relay T...186789642023-11-29 18:09:593 hrs 41 mins ago1701281399IN
PulseChain: WETH Omnibridge Router
0.03665832 ETH0.0070749335.59913169
Wrap And Relay T...186788982023-11-29 17:56:473 hrs 54 mins ago1701280607IN
PulseChain: WETH Omnibridge Router
0.16 ETH0.0069767835.10525893
Wrap And Relay T...186788652023-11-29 17:49:594 hrs 1 min ago1701280199IN
PulseChain: WETH Omnibridge Router
0.74 ETH0.0073644937.0561208
Wrap And Relay T...186788592023-11-29 17:48:354 hrs 2 mins ago1701280115IN
PulseChain: WETH Omnibridge Router
0.5 ETH0.0079910140.20857986
Wrap And Relay T...186787062023-11-29 17:17:594 hrs 33 mins ago1701278279IN
PulseChain: WETH Omnibridge Router
0.05 ETH0.0087207843.88324824
Wrap And Relay T...186787042023-11-29 17:17:354 hrs 33 mins ago1701278255IN
PulseChain: WETH Omnibridge Router
1 ETH0.0088627444.59758819
Wrap And Relay T...186786662023-11-29 17:09:594 hrs 41 mins ago1701277799IN
PulseChain: WETH Omnibridge Router
0.14 ETH0.0089116544.84097868
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
186800462023-11-29 21:47:473 mins ago1701294467
PulseChain: WETH Omnibridge Router
0.50752195 ETH
186800462023-11-29 21:47:473 mins ago1701294467
PulseChain: WETH Omnibridge Router
0.50752195 ETH
186800312023-11-29 21:44:356 mins ago1701294275
PulseChain: WETH Omnibridge Router
0.15 ETH
186800252023-11-29 21:43:237 mins ago1701294203
PulseChain: WETH Omnibridge Router
5.7282635 ETH
186800252023-11-29 21:43:237 mins ago1701294203
PulseChain: WETH Omnibridge Router
5.7282635 ETH
186800122023-11-29 21:40:4710 mins ago1701294047
PulseChain: WETH Omnibridge Router
1.74427241 ETH
186800122023-11-29 21:40:4710 mins ago1701294047
PulseChain: WETH Omnibridge Router
1.74427241 ETH
186799992023-11-29 21:38:1112 mins ago1701293891
PulseChain: WETH Omnibridge Router
0.37385979 ETH
186799992023-11-29 21:38:1112 mins ago1701293891
PulseChain: WETH Omnibridge Router
0.37385979 ETH
186799072023-11-29 21:19:4731 mins ago1701292787
PulseChain: WETH Omnibridge Router
0.1104 ETH
186798962023-11-29 21:17:3533 mins ago1701292655
PulseChain: WETH Omnibridge Router
1.0411724 ETH
186798962023-11-29 21:17:3533 mins ago1701292655
PulseChain: WETH Omnibridge Router
1.0411724 ETH
186797922023-11-29 20:56:3554 mins ago1701291395
PulseChain: WETH Omnibridge Router
0.065 ETH
186797552023-11-29 20:48:591 hr 2 mins ago1701290939
PulseChain: WETH Omnibridge Router
20.7026433 ETH
186797552023-11-29 20:48:591 hr 2 mins ago1701290939
PulseChain: WETH Omnibridge Router
20.7026433 ETH
186797042023-11-29 20:38:471 hr 12 mins ago1701290327
PulseChain: WETH Omnibridge Router
0.10566315 ETH
186797042023-11-29 20:38:471 hr 12 mins ago1701290327
PulseChain: WETH Omnibridge Router
0.10566315 ETH
186797032023-11-29 20:38:351 hr 12 mins ago1701290315
PulseChain: WETH Omnibridge Router
1.11063943 ETH
186797032023-11-29 20:38:351 hr 12 mins ago1701290315
PulseChain: WETH Omnibridge Router
1.11063943 ETH
186796932023-11-29 20:36:351 hr 14 mins ago1701290195
PulseChain: WETH Omnibridge Router
0.1387919 ETH
186796932023-11-29 20:36:351 hr 14 mins ago1701290195
PulseChain: WETH Omnibridge Router
0.1387919 ETH
186796352023-11-29 20:24:591 hr 26 mins ago1701289499
PulseChain: WETH Omnibridge Router
1.59410968 ETH
186796352023-11-29 20:24:591 hr 26 mins ago1701289499
PulseChain: WETH Omnibridge Router
1.59410968 ETH
186796342023-11-29 20:24:471 hr 26 mins ago1701289487
PulseChain: WETH Omnibridge Router
1.22043767 ETH
186796342023-11-29 20:24:471 hr 26 mins ago1701289487
PulseChain: WETH Omnibridge Router
1.22043767 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WETHOmnibridgeRouter

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2023-05-15
*/

// File: contracts/interfaces/IOmnibridge.sol

pragma solidity 0.7.5;

interface IOmnibridge {
    function relayTokens(
        address _token,
        address _receiver,
        uint256 _value
    ) external;
}

// File: contracts/interfaces/IWETH.sol

pragma solidity 0.7.5;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256 _value) external;

    function approve(address _to, uint256 _value) external;
}

// File: contracts/upgradeable_contracts/Sacrifice.sol

pragma solidity 0.7.5;

contract Sacrifice {
    constructor(address payable _recipient) payable {
        selfdestruct(_recipient);
    }
}

// File: contracts/libraries/AddressHelper.sol

pragma solidity 0.7.5;


/**
 * @title AddressHelper
 * @dev Helper methods for Address type.
 */
library AddressHelper {
    /**
     * @dev Try to send native tokens to the address. If it fails, it will force the transfer by creating a selfdestruct contract
     * @param _receiver address that will receive the native tokens
     * @param _value the amount of native tokens to send
     */
    function safeSendValue(address payable _receiver, uint256 _value) internal {
        if (!(_receiver).send(_value)) {
            new Sacrifice{ value: _value }(_receiver);
        }
    }
}

// File: contracts/libraries/Bytes.sol

pragma solidity 0.7.5;

/**
 * @title Bytes
 * @dev Helper methods to transform bytes to other solidity types.
 */
library Bytes {
    /**
     * @dev Truncate bytes array if its size is more than 20 bytes.
     * NOTE: This function does not perform any checks on the received parameter.
     * Make sure that the _bytes argument has a correct length, not less than 20 bytes.
     * A case when _bytes has length less than 20 will lead to the undefined behaviour,
     * since assembly will read data from memory that is not related to the _bytes argument.
     * @param _bytes to be converted to address type
     * @return addr address included in the firsts 20 bytes of the bytes array in parameter.
     */
    function bytesToAddress(bytes memory _bytes) internal pure returns (address addr) {
        assembly {
            addr := mload(add(_bytes, 20))
        }
    }
}

// File: @openzeppelin/contracts/utils/Address.sol


pragma solidity ^0.7.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: contracts/upgradeable_contracts/modules/OwnableModule.sol

pragma solidity 0.7.5;


/**
 * @title OwnableModule
 * @dev Common functionality for multi-token extension non-upgradeable module.
 */
contract OwnableModule {
    address public owner;

    /**
     * @dev Initializes this contract.
     * @param _owner address of the owner that is allowed to perform additional actions on the particular module.
     */
    constructor(address _owner) {
        owner = _owner;
    }

    /**
     * @dev Throws if sender is not the owner of this contract.
     */
    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    /**
     * @dev Changes the owner of this contract.
     * @param _newOwner address of the new owner.
     */
    function transferOwnership(address _newOwner) external onlyOwner {
        owner = _newOwner;
    }
}

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol


pragma solidity ^0.7.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

    /**
     * @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);
}

// File: @openzeppelin/contracts/math/SafeMath.sol


pragma solidity ^0.7.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: @openzeppelin/contracts/token/ERC20/SafeERC20.sol


pragma solidity ^0.7.0;




/**
 * @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 SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @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, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// File: contracts/upgradeable_contracts/Claimable.sol

pragma solidity 0.7.5;



/**
 * @title Claimable
 * @dev Implementation of the claiming utils that can be useful for withdrawing accidentally sent tokens that are not used in bridge operations.
 */
contract Claimable {
    using SafeERC20 for IERC20;

    /**
     * Throws if a given address is equal to address(0)
     */
    modifier validAddress(address _to) {
        require(_to != address(0));
        _;
    }

    /**
     * @dev Withdraws the erc20 tokens or native coins from this contract.
     * Caller should additionally check that the claimed token is not a part of bridge operations (i.e. that token != erc20token()).
     * @param _token address of the claimed token or address(0) for native coins.
     * @param _to address of the tokens/coins receiver.
     */
    function claimValues(address _token, address _to) internal validAddress(_to) {
        if (_token == address(0)) {
            claimNativeCoins(_to);
        } else {
            claimErc20Tokens(_token, _to);
        }
    }

    /**
     * @dev Internal function for withdrawing all native coins from the contract.
     * @param _to address of the coins receiver.
     */
    function claimNativeCoins(address _to) internal {
        uint256 value = address(this).balance;
        AddressHelper.safeSendValue(payable(_to), value);
    }

    /**
     * @dev Internal function for withdrawing all tokens of some particular ERC20 contract from this contract.
     * @param _token address of the claimed ERC20 token.
     * @param _to address of the tokens receiver.
     */
    function claimErc20Tokens(address _token, address _to) internal {
        IERC20 token = IERC20(_token);
        uint256 balance = token.balanceOf(address(this));
        token.safeTransfer(_to, balance);
    }
}

// File: contracts/helpers/WETHOmnibridgeRouter.sol

pragma solidity 0.7.5;







/**
 * @title WETHOmnibridgeRouter
 * @dev Omnibridge extension for processing native and wrapped native assets.
 * Intended to work with WETH/WBNB/WXDAI tokens, see:
 *   https://etherscan.io/address/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
 *   https://bscscan.com/address/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c
 *   https://blockscout.com/poa/xdai/address/0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d
 */
contract WETHOmnibridgeRouter is OwnableModule, Claimable {
    IOmnibridge public immutable bridge;
    IWETH public immutable WETH;

    /**
     * @dev Initializes this contract.
     * @param _bridge address of the HomeOmnibridge/ForeignOmnibridge contract.
     * @param _weth address of the WETH token used for wrapping/unwrapping native coins (e.g. WETH/WBNB/WXDAI).
     * @param _owner address of the contract owner.
     */
    constructor(
        IOmnibridge _bridge,
        IWETH _weth,
        address _owner
    ) OwnableModule(_owner) {
        bridge = _bridge;
        WETH = _weth;
        _weth.approve(address(_bridge), uint256(-1));
    }

    /**
     * @dev Wraps native assets and relays wrapped ERC20 tokens to the other chain.
     * Call msg.sender will receive assets on the other side of the bridge.
     */
    function wrapAndRelayTokens() external payable {
        wrapAndRelayTokens(msg.sender);
    }

    /**
     * @dev Wraps native assets and relays wrapped ERC20 tokens to the other chain.
     * @param _receiver bridged assets receiver on the other side of the bridge.
     */
    function wrapAndRelayTokens(address _receiver) public payable {
        WETH.deposit{ value: msg.value }();
        bridge.relayTokens(address(WETH), _receiver, msg.value);
    }

    /**
     * @dev Bridged callback function used for unwrapping received tokens.
     * Can only be called by the associated Omnibridge contract.
     * @param _token bridged token contract address, should be WETH.
     * @param _value amount of bridged/received tokens.
     * @param _data extra data passed alongside with relayTokensAndCall on the other side of the bridge.
     * Should contain coins receiver address.
     */
    function onTokenBridged(
        address _token,
        uint256 _value,
        bytes memory _data
    ) external {
        require(_token == address(WETH));
        require(msg.sender == address(bridge));
        require(_data.length == 20);

        WETH.withdraw(_value);

        AddressHelper.safeSendValue(payable(Bytes.bytesToAddress(_data)), _value);
    }

    /**
     * @dev Claims stuck coins/tokens.
     * Only contract owner can call this method.
     * @param _token address of claimed token contract, address(0) for native coins.
     * @param _to address of tokens receiver
     */
    function claimTokens(address _token, address _to) external onlyOwner {
        claimValues(_token, _to);
    }

    /**
     * @dev Ether receive function.
     * Should be only called from the WETH contract when withdrawing native coins. Will revert otherwise.
     */
    receive() external payable {
        require(msg.sender == address(WETH));
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IOmnibridge","name":"_bridge","type":"address"},{"internalType":"contract IWETH","name":"_weth","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bridge","outputs":[{"internalType":"contract IOmnibridge","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"onTokenBridged","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wrapAndRelayTokens","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"wrapAndRelayTokens","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c060405234801561001057600080fd5b50604051610b90380380610b908339818101604052606081101561003357600080fd5b5080516020820151604092830151600080546001600160a01b038084166001600160a01b03199092169190911782556001600160601b0319606086811b821660805285901b1660a052855163095ea7b360e01b81528186166004820152600019602482015295519495939492939085169263095ea7b39260448084019391929182900301818387803b1580156100c857600080fd5b505af11580156100dc573d6000803e3d6000fd5b5050505050505060805160601c60a05160601c610a6261012e60003980608f52806102c052806102e45280610365528061045752806104fa52508061032b52806103fa52806104cb5250610a626000f3fe60806040526004361061007f5760003560e01c8063db7af8541161004e578063db7af85414610149578063e78cea9214610211578063f2fde38b14610226578063f52cbf0e14610259576100bb565b806301a754ff146100c057806369ffa08a146100c85780638da5cb5b14610103578063ad5c464814610134576100bb565b366100bb57336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100b957600080fd5b005b600080fd5b6100b961027f565b3480156100d457600080fd5b506100b9600480360360408110156100eb57600080fd5b506001600160a01b038135811691602001351661028a565b34801561010f57600080fd5b506101186102af565b604080516001600160a01b039092168252519081900360200190f35b34801561014057600080fd5b506101186102be565b34801561015557600080fd5b506100b96004803603606081101561016c57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561019c57600080fd5b8201836020820111156101ae57600080fd5b803590602001918460018302840111640100000000831117156101d057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506102e2945050505050565b34801561021d57600080fd5b506101186103f8565b34801561023257600080fd5b506100b96004803603602081101561024957600080fd5b50356001600160a01b031661041c565b6100b96004803603602081101561026f57600080fd5b50356001600160a01b0316610455565b61028833610455565b565b6000546001600160a01b031633146102a157600080fd5b6102ab828261058c565b5050565b6000546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03161461032057600080fd5b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461035557600080fd5b805160141461036357600080fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156103c957600080fd5b505af11580156103dd573d6000803e3d6000fd5b505050506103f36103ed826105c6565b836105cd565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b0316331461043357600080fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b50505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ad58bdd17f000000000000000000000000000000000000000000000000000000000000000083346040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561057157600080fd5b505af1158015610585573d6000803e3d6000fd5b5050505050565b806001600160a01b0381166105a057600080fd5b6001600160a01b0383166105bc576105b782610638565b6103f3565b6103f38383610643565b6014015190565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050506102ab578082604051610604906109c4565b6001600160a01b039091168152604051908190036020019082f0905080158015610632573d6000803e3d6000fd5b50505050565b476102ab82826105cd565b604080516370a0823160e01b8152306004820152905183916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561068e57600080fd5b505afa1580156106a2573d6000803e3d6000fd5b505050506040513d60208110156106b857600080fd5b505190506106326001600160a01b0383168483604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526103f3908490606061076d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166107c99092919063ffffffff16565b8051909150156103f35780806020019051602081101561078c57600080fd5b50516103f35760405162461bcd60e51b815260040180806020018281038252602a815260200180610a03602a913960400191505060405180910390fd5b60606107d884846000856107e0565b949350505050565b60606107eb8561098b565b61083c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061087b5780518252601f19909201916020918201910161085c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146108dd576040519150601f19603f3d011682016040523d82523d6000602084013e6108e2565b606091505b509150915081156108f65791506107d89050565b8051156109065780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610950578181015183820152602001610938565b50505050905090810190601f16801561097d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906107d8575050151592915050565b6032806109d18339019056fe60806040526040516032380380603283398181016040526020811015602357600080fd5b50516001600160a01b038116fffe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220d486ca4779fa6950dbf979c52eee353848c542acd28017b14d63ed5d7e3f455a64736f6c634300070500330000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000610094ab29d1bf683719d2ce3495d8635a47bfc6

Deployed Bytecode

0x60806040526004361061007f5760003560e01c8063db7af8541161004e578063db7af85414610149578063e78cea9214610211578063f2fde38b14610226578063f52cbf0e14610259576100bb565b806301a754ff146100c057806369ffa08a146100c85780638da5cb5b14610103578063ad5c464814610134576100bb565b366100bb57336001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216146100b957600080fd5b005b600080fd5b6100b961027f565b3480156100d457600080fd5b506100b9600480360360408110156100eb57600080fd5b506001600160a01b038135811691602001351661028a565b34801561010f57600080fd5b506101186102af565b604080516001600160a01b039092168252519081900360200190f35b34801561014057600080fd5b506101186102be565b34801561015557600080fd5b506100b96004803603606081101561016c57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561019c57600080fd5b8201836020820111156101ae57600080fd5b803590602001918460018302840111640100000000831117156101d057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506102e2945050505050565b34801561021d57600080fd5b506101186103f8565b34801561023257600080fd5b506100b96004803603602081101561024957600080fd5b50356001600160a01b031661041c565b6100b96004803603602081101561026f57600080fd5b50356001600160a01b0316610455565b61028833610455565b565b6000546001600160a01b031633146102a157600080fd5b6102ab828261058c565b5050565b6000546001600160a01b031681565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316836001600160a01b03161461032057600080fd5b336001600160a01b037f0000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d161461035557600080fd5b805160141461036357600080fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156103c957600080fd5b505af11580156103dd573d6000803e3d6000fd5b505050506103f36103ed826105c6565b836105cd565b505050565b7f0000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d81565b6000546001600160a01b0316331461043357600080fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b1580156104b057600080fd5b505af11580156104c4573d6000803e3d6000fd5b50505050507f0000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d6001600160a01b031663ad58bdd17f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc283346040518463ffffffff1660e01b815260040180846001600160a01b03168152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561057157600080fd5b505af1158015610585573d6000803e3d6000fd5b5050505050565b806001600160a01b0381166105a057600080fd5b6001600160a01b0383166105bc576105b782610638565b6103f3565b6103f38383610643565b6014015190565b6040516001600160a01b0383169082156108fc029083906000818181858888f193505050506102ab578082604051610604906109c4565b6001600160a01b039091168152604051908190036020019082f0905080158015610632573d6000803e3d6000fd5b50505050565b476102ab82826105cd565b604080516370a0823160e01b8152306004820152905183916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561068e57600080fd5b505afa1580156106a2573d6000803e3d6000fd5b505050506040513d60208110156106b857600080fd5b505190506106326001600160a01b0383168483604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526103f3908490606061076d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166107c99092919063ffffffff16565b8051909150156103f35780806020019051602081101561078c57600080fd5b50516103f35760405162461bcd60e51b815260040180806020018281038252602a815260200180610a03602a913960400191505060405180910390fd5b60606107d884846000856107e0565b949350505050565b60606107eb8561098b565b61083c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061087b5780518252601f19909201916020918201910161085c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146108dd576040519150601f19603f3d011682016040523d82523d6000602084013e6108e2565b606091505b509150915081156108f65791506107d89050565b8051156109065780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610950578181015183820152602001610938565b50505050905090810190601f16801561097d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906107d8575050151592915050565b6032806109d18339019056fe60806040526040516032380380603283398181016040526020811015602357600080fd5b50516001600160a01b038116fffe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220d486ca4779fa6950dbf979c52eee353848c542acd28017b14d63ed5d7e3f455a64736f6c63430007050033

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

0000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000610094ab29d1bf683719d2ce3495d8635a47bfc6

-----Decoded View---------------
Arg [0] : _bridge (address): 0x1715a3E4A142d8b698131108995174F37aEBA10D
Arg [1] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _owner (address): 0x610094aB29D1bf683719d2Ce3495d8635A47bfc6

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 000000000000000000000000610094ab29d1bf683719d2ce3495d8635a47bfc6


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.