ETH Price: $3,840.93 (+5.79%)

Contract

0x96e8Cf990545c5853ac8DeF324C72fB0E5759019
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Bridge178753662023-08-09 5:49:35490 days ago1691560175IN
0x96e8Cf99...0E5759019
0 ETH0.0007082115

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CallProxy

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : CallProxy.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.17;

import "./libraries/Utils.sol";
import "./access/Ownable2Step.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract CallProxy is Ownable2Step {
    using SafeERC20 for IERC20;

    address public bridge;

    event SetBridge(address bridge);

    modifier onlyBridge() {
        require(msg.sender == bridge, "CallProxy: no privilege");
        _;
    }

    function proxyCall(
        address token,
        uint256 amount,
        address receiver,
        bytes memory callData
    ) external onlyBridge returns (bool) {
        try this.decodeCallDataForExternalCall(callData) returns (address callee, bytes memory data) {
            IERC20(token).safeApprove(callee, 0);
            IERC20(token).safeApprove(callee, amount);

            callee.call(data);
        } catch {}

        uint256 balance = IERC20(token).balanceOf(address(this));
        if (balance > 0) {
            IERC20(token).safeTransfer(receiver, balance);
        }

        return true;
    }

    function setBridge(address newBridge) external onlyOwner {
        require(newBridge != address(0), "bridge address cannot be zero");
        bridge = newBridge;
        emit SetBridge(newBridge);
    }

    function rescueFund(address tokenAddress) external onlyOwner {
        IERC20 token = IERC20(tokenAddress);
        token.safeTransfer(_msgSender(), token.balanceOf(address(this)));
    }

    function decodeCallDataForExternalCall(bytes memory callData) external pure returns (
        address callee,
        bytes memory data
    ) {
        uint256 offset = 0;

        bytes memory calleeAddressBytes;
        (calleeAddressBytes, offset) = Utils.NextVarBytes(callData, offset);
        callee = Utils.bytesToAddress(calleeAddressBytes);

        (data, offset) = Utils.NextVarBytes(callData, offset);
    }

    function encodeCallDataForExternalCall(
        address callee,
        bytes calldata callData
    ) external pure returns (bytes memory) {
        bytes memory buff;

        buff = abi.encodePacked(
            Utils.WriteVarBytes(abi.encodePacked(callee)),
            Utils.WriteVarBytes(callData)
        );

        return buff;
    }
}

File 2 of 9 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
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].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

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

File 3 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

File 4 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../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;

    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'
        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) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
        }
    }
}

File 6 of 9 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

File 7 of 9 : Ownable.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.17;

import "@openzeppelin/contracts/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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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 8 of 9 : Ownable2Step.sol
/*
 * Copyright (c) 2022, Circle Internet Financial Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.8.17;

import "./Ownable.sol";

/**
 * @dev forked from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/7c5f6bc2c8743d83443fa46395d75f2f3f99054a/contracts/access/Ownable2Step.sol
 * Modifications:
 * 1. Update Solidity version from 0.8.0 to 0.7.6. Version 0.8.0 was used
 * as base because this contract was added to OZ repo after version 0.8.0.
 *
 * Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner)
        public
        virtual
        override
        onlyOwner
    {
        require(newOwner != address(0), "new owner address cannot be zero");
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() external {
        address sender = _msgSender();
        require(
            pendingOwner() == sender,
            "Ownable2Step: caller is not the new owner"
        );
        _transferOwnership(sender);
    }
}

File 9 of 9 : Utils.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity ^0.8.0;

library Utils {

    function WriteByte(bytes1 b) internal pure returns (bytes memory) {
        return WriteUint8(uint8(b));
    }

    function WriteUint8(uint8 v) internal pure returns (bytes memory) {
        bytes memory buff;
        assembly{
            buff := mload(0x40)
            mstore(buff, 1)
            mstore(add(buff, 0x20), shl(248, v))
            // mstore(add(buff, 0x20), byte(0x1f, v))
            mstore(0x40, add(buff, 0x21))
        }
        return buff;
    }

    function WriteUint16(uint16 v) internal pure returns (bytes memory) {
        bytes memory buff;

        assembly{
            buff := mload(0x40)
            let byteLen := 0x02
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x22))
        }
        return buff;
    }

    function WriteUint32(uint32 v) internal pure returns(bytes memory) {
        bytes memory buff;
        assembly{
            buff := mload(0x40)
            let byteLen := 0x04
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x24))
        }
        return buff;
    }

    function WriteUint64(uint64 v) internal pure returns(bytes memory) {
        bytes memory buff;

        assembly{
            buff := mload(0x40)
            let byteLen := 0x08
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x28))
        }
        return buff;
    }

    function WriteUint255(uint256 v) internal pure returns (bytes memory) {
        require(v <= 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "Value exceeds uint255 range");
        bytes memory buff;

        assembly{
            buff := mload(0x40)
            let byteLen := 0x20
            mstore(buff, byteLen)
            for {
                let mindex := 0x00
                let vindex := 0x1f
            } lt(mindex, byteLen) {
                mindex := add(mindex, 0x01)
                vindex := sub(vindex, 0x01)
            }{
                mstore8(add(add(buff, 0x20), mindex), byte(vindex, v))
            }
            mstore(0x40, add(buff, 0x40))
        }
        return buff;
    }

    function WriteVarBytes(bytes memory data) internal pure returns (bytes memory) {
        uint64 l = uint64(data.length);
        return abi.encodePacked(WriteVarUint(l), data);
    }

    function WriteVarUint(uint64 v) internal pure returns (bytes memory) {
        if (v < 0xFD){
    		return WriteUint8(uint8(v));
    	} else if (v <= 0xFFFF) {
    		return abi.encodePacked(WriteByte(0xFD), WriteUint16(uint16(v)));
    	} else if (v <= 0xFFFFFFFF) {
            return abi.encodePacked(WriteByte(0xFE), WriteUint32(uint32(v)));
    	} else {
    		return abi.encodePacked(WriteByte(0xFF), WriteUint64(uint64(v)));
    	}
    }

    function NextByte(bytes memory buff, uint256 offset) internal pure returns (bytes1, uint256) {
        require(offset + 1 <= buff.length && offset < offset + 1, "NextByte, Offset exceeds maximum");
        bytes1 v;
        assembly{
            v := mload(add(add(buff, 0x20), offset))
        }
        return (v, offset + 1);
    }

    function NextUint8(bytes memory buff, uint256 offset) internal pure returns (uint8, uint256) {
        require(offset + 1 <= buff.length && offset < offset + 1, "NextUint8, Offset exceeds maximum");
        uint8 v;
        assembly{
            let tmpbytes := mload(0x40)
            let bvalue := mload(add(add(buff, 0x20), offset))
            mstore8(tmpbytes, byte(0, bvalue))
            mstore(0x40, add(tmpbytes, 0x01))
            v := mload(sub(tmpbytes, 0x1f))
        }
        return (v, offset + 1);
    }

    function NextUint16(bytes memory buff, uint256 offset) internal pure returns (uint16, uint256) {
        require(offset + 2 <= buff.length && offset < offset + 2, "NextUint16, offset exceeds maximum");

        uint16 v;
        assembly {
            let tmpbytes := mload(0x40)
            let bvalue := mload(add(add(buff, 0x20), offset))
            mstore8(tmpbytes, byte(0x01, bvalue))
            mstore8(add(tmpbytes, 0x01), byte(0, bvalue))
            mstore(0x40, add(tmpbytes, 0x02))
            v := mload(sub(tmpbytes, 0x1e))
        }
        return (v, offset + 2);
    }

    function NextUint32(bytes memory buff, uint256 offset) internal pure returns (uint32, uint256) {
        require(offset + 4 <= buff.length && offset < offset + 4, "NextUint32, offset exceeds maximum");
        uint32 v;
        assembly {
            let tmpbytes := mload(0x40)
            let byteLen := 0x04
            for {
                let tindex := 0x00
                let bindex := sub(byteLen, 0x01)
                let bvalue := mload(add(add(buff, 0x20), offset))
            } lt(tindex, byteLen) {
                tindex := add(tindex, 0x01)
                bindex := sub(bindex, 0x01)
            }{
                mstore8(add(tmpbytes, tindex), byte(bindex, bvalue))
            }
            mstore(0x40, add(tmpbytes, byteLen))
            v := mload(sub(tmpbytes, sub(0x20, byteLen)))
        }
        return (v, offset + 4);
    }

    function NextUint64(bytes memory buff, uint256 offset) internal pure returns (uint64, uint256) {
        require(offset + 8 <= buff.length && offset < offset + 8, "NextUint64, offset exceeds maximum");
        uint64 v;
        assembly {
            let tmpbytes := mload(0x40)
            let byteLen := 0x08
            for {
                let tindex := 0x00
                let bindex := sub(byteLen, 0x01)
                let bvalue := mload(add(add(buff, 0x20), offset))
            } lt(tindex, byteLen) {
                tindex := add(tindex, 0x01)
                bindex := sub(bindex, 0x01)
            }{
                mstore8(add(tmpbytes, tindex), byte(bindex, bvalue))
            }
            mstore(0x40, add(tmpbytes, byteLen))
            v := mload(sub(tmpbytes, sub(0x20, byteLen)))
        }
        return (v, offset + 8);
    }

    function NextUint255(bytes memory buff, uint256 offset) internal pure returns (uint256, uint256) {
        require(offset + 32 <= buff.length && offset < offset + 32, "NextUint255, offset exceeds maximum");
        uint256 v;
        assembly {
            let tmpbytes := mload(0x40)
            let byteLen := 0x20
            for {
                let tindex := 0x00
                let bindex := sub(byteLen, 0x01)
                let bvalue := mload(add(add(buff, 0x20), offset))
            } lt(tindex, byteLen) {
                tindex := add(tindex, 0x01)
                bindex := sub(bindex, 0x01)
            }{
                mstore8(add(tmpbytes, tindex), byte(bindex, bvalue))
            }
            mstore(0x40, add(tmpbytes, byteLen))
            v := mload(tmpbytes)
        }
        require(v <= 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, "Value exceeds the range");
        return (v, offset + 32);
    }

    function NextVarBytes(bytes memory buff, uint256 offset) internal pure returns(bytes memory, uint256) {
        uint len;
        (len, offset) = NextVarUint(buff, offset);
        require(offset + len <= buff.length && offset <= offset + len, "NextVarBytes, offset exceeds maximum");
        bytes memory tempBytes;
        assembly{
            switch iszero(len)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(len, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, len)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(buff, lengthmod), mul(0x20, iszero(lengthmod))), offset)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, len)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return (tempBytes, offset + len);
    }

    function NextVarUint(bytes memory buff, uint256 offset) internal pure returns(uint, uint256) {
        bytes1 v;
        (v, offset) = NextByte(buff, offset);

        uint value;
        if (v == 0xFD) {
            // return NextUint16(buff, offset);
            (value, offset) = NextUint16(buff, offset);
            require(value >= 0xFD && value <= 0xFFFF, "NextUint16, value outside range");
            return (value, offset);
        } else if (v == 0xFE) {
            // return NextUint32(buff, offset);
            (value, offset) = NextUint32(buff, offset);
            require(value > 0xFFFF && value <= 0xFFFFFFFF, "NextVarUint, value outside range");
            return (value, offset);
        } else if (v == 0xFF) {
            // return NextUint64(buff, offset);
            (value, offset) = NextUint64(buff, offset);
            require(value > 0xFFFFFFFF, "NextVarUint, value outside range");
            return (value, offset);
        } else{
            // return (uint8(v), offset);
            value = uint8(v);
            require(value < 0xFD, "NextVarUint, value outside range");
            return (value, offset);
        }
    }

    function bytesToAddress(bytes memory _bs) internal pure returns (address addr) {
        require(_bs.length == 20, "bytes length does not match address");
        assembly {
            // for _bs, first word store _bs.length, second word store _bs.value
            // load 32 bytes from mem[_bs+20], convert it into Uint160, meaning we take last 20 bytes as addr (address).
            addr := mload(add(_bs, 0x14))
        }
    }

    function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // fslot can contain both the length and contents of the array
                // if slength < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                // slength != 0
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":"address","name":"bridge","type":"address"}],"name":"SetBridge","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bridge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"decodeCallDataForExternalCall","outputs":[{"internalType":"address","name":"callee","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"callee","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"encodeCallDataForExternalCall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes","name":"callData","type":"bytes"}],"name":"proxyCall","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"rescueFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBridge","type":"address"}],"name":"setBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361001f565b610096565b600180546001600160a01b031916905561004381610046602090811b61074717901c565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6117d0806100a56000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b8c6fd8411610066578063b8c6fd8414610131578063dea39a5314610144578063e30c397814610165578063e78cea9214610176578063f2fde38b1461018957600080fd5b80633cbd1fbb146100a357806372e7de26146100cc57806379ba5097146100ef5780638da5cb5b146100f95780638dd148021461011e575b600080fd5b6100b66100b1366004611366565b61019c565b6040516100c3919061143b565b60405180910390f35b6100df6100da36600461151a565b610248565b60405190151581526020016100c3565b6100f761042e565b005b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100c3565b6100f761012c366004611586565b6104a8565b6100f761013f366004611586565b61057c565b6101576101523660046115a3565b610628565b6040516100c39291906115d8565b6001546001600160a01b0316610106565b600254610106906001600160a01b031681565b6100f7610197366004611586565b61065e565b6060806101df856040516020016101cb919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052610797565b61021e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061079792505050565b60405160200161022f9291906115fc565b60408051808303601f1901815291905295945050505050565b6002546000906001600160a01b031633146102aa5760405162461bcd60e51b815260206004820152601760248201527f43616c6c50726f78793a206e6f2070726976696c65676500000000000000000060448201526064015b60405180910390fd5b60405163dea39a5360e01b8152309063dea39a53906102cd90859060040161143b565b600060405180830381865afa92505050801561030b57506040513d6000823e601f3d908101601f19168201604052610308919081019061162b565b60015b15610399576103256001600160a01b0388168360006107ce565b6103396001600160a01b03881683886107ce565b816001600160a01b03168160405161035191906116b8565b6000604051808303816000865af19150503d806000811461038e576040519150601f19603f3d011682016040523d82523d6000602084013e610393565b606091505b50505050505b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa1580156103e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040491906116d4565b90508015610420576104206001600160a01b038716858361091b565b60019150505b949350505050565b60015433906001600160a01b0316811461049c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016102a1565b6104a58161094b565b50565b6000546001600160a01b031633146104d25760405162461bcd60e51b81526004016102a1906116ed565b6001600160a01b0381166105285760405162461bcd60e51b815260206004820152601d60248201527f62726964676520616464726573732063616e6e6f74206265207a65726f00000060448201526064016102a1565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fe605ac02ea219003ec58fc9cf4d4b3c5f2d62ec39807b1c63886ddd47a6fcd6e9060200160405180910390a150565b6000546001600160a01b031633146105a65760405162461bcd60e51b81526004016102a1906116ed565b80610624336040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156105ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061391906116d4565b6001600160a01b038416919061091b565b5050565b600060606000606061063a8583610964565b9250905061064781610a73565b93506106538583610964565b509395939450505050565b6000546001600160a01b031633146106885760405162461bcd60e51b81526004016102a1906116ed565b6001600160a01b0381166106de5760405162461bcd60e51b815260206004820181905260248201527f6e6577206f776e657220616464726573732063616e6e6f74206265207a65726f60448201526064016102a1565b600180546001600160a01b0383166001600160a01b0319909116811790915561070f6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516060906107a581610ada565b836040516020016107b79291906115fc565b604051602081830303815290604052915050919050565b8015806108485750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610822573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084691906116d4565b155b6108b35760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016102a1565b6040516001600160a01b03831660248201526044810182905261091690849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ba4565b505050565b6040516001600160a01b03831660248201526044810182905261091690849063a9059cbb60e01b906064016108df565b600180546001600160a01b03191690556104a581610747565b60606000806109738585610c76565b86519095509091506109858286611722565b1115801561099c57506109988185611722565b8411155b6109f45760405162461bcd60e51b8152602060048201526024808201527f4e65787456617242797465732c206f66667365742065786365656473206d6178604482015263696d756d60e01b60648201526084016102a1565b606081158015610a0f57604051915060208201604052610a59565b6040519150601f8316801560200281840101848101888315602002848c0101015b81831015610a48578051835260209283019201610a30565b5050848452601f01601f1916604052505b5080610a658387611722565b9350935050505b9250929050565b60008151601414610ad25760405162461bcd60e51b815260206004820152602360248201527f6279746573206c656e67746820646f6573206e6f74206d61746368206164647260448201526265737360e81b60648201526084016102a1565b506014015190565b606060fd8267ffffffffffffffff161015610b0f57604080516001815260f884901b6020820152602181019091525b92915050565b61ffff8267ffffffffffffffff1611610b5f57610b2f60fd60f81b610dea565b610b3883610e11565b604051602001610b499291906115fc565b6040516020818303038152906040529050919050565b63ffffffff8267ffffffffffffffff1611610b8a57610b81607f60f91b610dea565b610b3883610e54565b610b9b6001600160f81b0319610dea565b610b3883610e97565b6000610bf9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610eda9092919063ffffffff16565b8051909150156109165780806020019051810190610c179190611743565b6109165760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102a1565b6000806000610c858585610ee9565b9450905060006001600160f81b0319821660fd60f81b03610d1d57610caa8686610f7d565b955061ffff16905060fd8110801590610cc5575061ffff8111155b610d115760405162461bcd60e51b815260206004820152601f60248201527f4e65787455696e7431362c2076616c7565206f7574736964652072616e67650060448201526064016102a1565b9250839150610a6c9050565b6001600160f81b03198216607f60f91b03610d7757610d3c8686611036565b955063ffffffff16905061ffff81118015610d5b575063ffffffff8111155b610d115760405162461bcd60e51b81526004016102a190611765565b6001600160f81b03198083169003610dc457610d938686611107565b955067ffffffffffffffff16905063ffffffff8111610d115760405162461bcd60e51b81526004016102a190611765565b5060f881901c60fd8110610d115760405162461bcd60e51b81526004016102a190611765565b60408051600181526001600160f81b03198316602082015260218101909152606090610b09565b6040516002808252606091906000601f5b82821015610e445785811a826020860101536001919091019060001901610e22565b5050506022810160405292915050565b6040516004808252606091906000601f5b82821015610e875785811a826020860101536001919091019060001901610e65565b5050506024810160405292915050565b6040516008808252606091906000601f5b82821015610eca5785811a826020860101536001919091019060001901610ea8565b5050506028810160405292915050565b606061042684846000856111d8565b6000808351836001610efb9190611722565b11158015610f125750610f0f836001611722565b83105b610f5e5760405162461bcd60e51b815260206004820181905260248201527f4e657874427974652c204f66667365742065786365656473206d6178696d756d60448201526064016102a1565b8383016020015180610f71856001611722565b92509250509250929050565b6000808351836002610f8f9190611722565b11158015610fa65750610fa3836002611722565b83105b610ffd5760405162461bcd60e51b815260206004820152602260248201527f4e65787455696e7431362c206f66667365742065786365656473206d6178696d604482015261756d60f01b60648201526084016102a1565b6000604051846020870101518060011a82538060001a60018301535060028101604052601e81035191505080846002610f719190611722565b60008083518360046110489190611722565b1115801561105f575061105c836004611722565b83105b6110b65760405162461bcd60e51b815260206004820152602260248201527f4e65787455696e7433322c206f66667365742065786365656473206d6178696d604482015261756d60f01b60648201526084016102a1565b600060405160046000600182038760208a0101515b838310156110eb5780821a838601536001830192506001820391506110cb565b505050016040819052601f190151905080610f71856004611722565b60008083518360086111199190611722565b11158015611130575061112d836008611722565b83105b6111875760405162461bcd60e51b815260206004820152602260248201527f4e65787455696e7436342c206f66667365742065786365656473206d6178696d604482015261756d60f01b60648201526084016102a1565b600060405160086000600182038760208a0101515b838310156111bc5780821a8386015360018301925060018203915061119c565b505050016040819052601f190151905080610f71856008611722565b6060824710156112395760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102a1565b600080866001600160a01b0316858760405161125591906116b8565b60006040518083038185875af1925050503d8060008114611292576040519150601f19603f3d011682016040523d82523d6000602084013e611297565b606091505b50915091506112a8878383876112b3565b979650505050505050565b6060831561132257825160000361131b576001600160a01b0385163b61131b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102a1565b5081610426565b61042683838151156113375781518083602001fd5b8060405162461bcd60e51b81526004016102a1919061143b565b6001600160a01b03811681146104a557600080fd5b60008060006040848603121561137b57600080fd5b833561138681611351565b9250602084013567ffffffffffffffff808211156113a357600080fd5b818601915086601f8301126113b757600080fd5b8135818111156113c657600080fd5b8760208285010111156113d857600080fd5b6020830194508093505050509250925092565b60005b838110156114065781810151838201526020016113ee565b50506000910152565b600081518084526114278160208601602086016113eb565b601f01601f19169290920160200192915050565b60208152600061144e602083018461140f565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561149457611494611455565b604052919050565b600067ffffffffffffffff8211156114b6576114b6611455565b50601f01601f191660200190565b600082601f8301126114d557600080fd5b81356114e86114e38261149c565b61146b565b8181528460208386010111156114fd57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561153057600080fd5b843561153b81611351565b935060208501359250604085013561155281611351565b9150606085013567ffffffffffffffff81111561156e57600080fd5b61157a878288016114c4565b91505092959194509250565b60006020828403121561159857600080fd5b813561144e81611351565b6000602082840312156115b557600080fd5b813567ffffffffffffffff8111156115cc57600080fd5b610426848285016114c4565b6001600160a01b03831681526040602082018190526000906104269083018461140f565b6000835161160e8184602088016113eb565b8351908301906116228183602088016113eb565b01949350505050565b6000806040838503121561163e57600080fd5b825161164981611351565b602084015190925067ffffffffffffffff81111561166657600080fd5b8301601f8101851361167757600080fd5b80516116856114e38261149c565b81815286602083850101111561169a57600080fd5b6116ab8260208301602086016113eb565b8093505050509250929050565b600082516116ca8184602087016113eb565b9190910192915050565b6000602082840312156116e657600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b80820180821115610b0957634e487b7160e01b600052601160045260246000fd5b60006020828403121561175557600080fd5b8151801515811461144e57600080fd5b6020808252818101527f4e65787456617255696e742c2076616c7565206f7574736964652072616e676560408201526060019056fea264697066735822122090542bc233ec765a1004bee5dcf15827c6eac634b54ffa06108937c277f1fe2764736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063b8c6fd8411610066578063b8c6fd8414610131578063dea39a5314610144578063e30c397814610165578063e78cea9214610176578063f2fde38b1461018957600080fd5b80633cbd1fbb146100a357806372e7de26146100cc57806379ba5097146100ef5780638da5cb5b146100f95780638dd148021461011e575b600080fd5b6100b66100b1366004611366565b61019c565b6040516100c3919061143b565b60405180910390f35b6100df6100da36600461151a565b610248565b60405190151581526020016100c3565b6100f761042e565b005b6000546001600160a01b03165b6040516001600160a01b0390911681526020016100c3565b6100f761012c366004611586565b6104a8565b6100f761013f366004611586565b61057c565b6101576101523660046115a3565b610628565b6040516100c39291906115d8565b6001546001600160a01b0316610106565b600254610106906001600160a01b031681565b6100f7610197366004611586565b61065e565b6060806101df856040516020016101cb919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052610797565b61021e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061079792505050565b60405160200161022f9291906115fc565b60408051808303601f1901815291905295945050505050565b6002546000906001600160a01b031633146102aa5760405162461bcd60e51b815260206004820152601760248201527f43616c6c50726f78793a206e6f2070726976696c65676500000000000000000060448201526064015b60405180910390fd5b60405163dea39a5360e01b8152309063dea39a53906102cd90859060040161143b565b600060405180830381865afa92505050801561030b57506040513d6000823e601f3d908101601f19168201604052610308919081019061162b565b60015b15610399576103256001600160a01b0388168360006107ce565b6103396001600160a01b03881683886107ce565b816001600160a01b03168160405161035191906116b8565b6000604051808303816000865af19150503d806000811461038e576040519150601f19603f3d011682016040523d82523d6000602084013e610393565b606091505b50505050505b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa1580156103e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040491906116d4565b90508015610420576104206001600160a01b038716858361091b565b60019150505b949350505050565b60015433906001600160a01b0316811461049c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016102a1565b6104a58161094b565b50565b6000546001600160a01b031633146104d25760405162461bcd60e51b81526004016102a1906116ed565b6001600160a01b0381166105285760405162461bcd60e51b815260206004820152601d60248201527f62726964676520616464726573732063616e6e6f74206265207a65726f00000060448201526064016102a1565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fe605ac02ea219003ec58fc9cf4d4b3c5f2d62ec39807b1c63886ddd47a6fcd6e9060200160405180910390a150565b6000546001600160a01b031633146105a65760405162461bcd60e51b81526004016102a1906116ed565b80610624336040516370a0823160e01b81523060048201526001600160a01b038416906370a0823190602401602060405180830381865afa1580156105ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061391906116d4565b6001600160a01b038416919061091b565b5050565b600060606000606061063a8583610964565b9250905061064781610a73565b93506106538583610964565b509395939450505050565b6000546001600160a01b031633146106885760405162461bcd60e51b81526004016102a1906116ed565b6001600160a01b0381166106de5760405162461bcd60e51b815260206004820181905260248201527f6e6577206f776e657220616464726573732063616e6e6f74206265207a65726f60448201526064016102a1565b600180546001600160a01b0383166001600160a01b0319909116811790915561070f6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516060906107a581610ada565b836040516020016107b79291906115fc565b604051602081830303815290604052915050919050565b8015806108485750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa158015610822573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084691906116d4565b155b6108b35760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016102a1565b6040516001600160a01b03831660248201526044810182905261091690849063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ba4565b505050565b6040516001600160a01b03831660248201526044810182905261091690849063a9059cbb60e01b906064016108df565b600180546001600160a01b03191690556104a581610747565b60606000806109738585610c76565b86519095509091506109858286611722565b1115801561099c57506109988185611722565b8411155b6109f45760405162461bcd60e51b8152602060048201526024808201527f4e65787456617242797465732c206f66667365742065786365656473206d6178604482015263696d756d60e01b60648201526084016102a1565b606081158015610a0f57604051915060208201604052610a59565b6040519150601f8316801560200281840101848101888315602002848c0101015b81831015610a48578051835260209283019201610a30565b5050848452601f01601f1916604052505b5080610a658387611722565b9350935050505b9250929050565b60008151601414610ad25760405162461bcd60e51b815260206004820152602360248201527f6279746573206c656e67746820646f6573206e6f74206d61746368206164647260448201526265737360e81b60648201526084016102a1565b506014015190565b606060fd8267ffffffffffffffff161015610b0f57604080516001815260f884901b6020820152602181019091525b92915050565b61ffff8267ffffffffffffffff1611610b5f57610b2f60fd60f81b610dea565b610b3883610e11565b604051602001610b499291906115fc565b6040516020818303038152906040529050919050565b63ffffffff8267ffffffffffffffff1611610b8a57610b81607f60f91b610dea565b610b3883610e54565b610b9b6001600160f81b0319610dea565b610b3883610e97565b6000610bf9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610eda9092919063ffffffff16565b8051909150156109165780806020019051810190610c179190611743565b6109165760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102a1565b6000806000610c858585610ee9565b9450905060006001600160f81b0319821660fd60f81b03610d1d57610caa8686610f7d565b955061ffff16905060fd8110801590610cc5575061ffff8111155b610d115760405162461bcd60e51b815260206004820152601f60248201527f4e65787455696e7431362c2076616c7565206f7574736964652072616e67650060448201526064016102a1565b9250839150610a6c9050565b6001600160f81b03198216607f60f91b03610d7757610d3c8686611036565b955063ffffffff16905061ffff81118015610d5b575063ffffffff8111155b610d115760405162461bcd60e51b81526004016102a190611765565b6001600160f81b03198083169003610dc457610d938686611107565b955067ffffffffffffffff16905063ffffffff8111610d115760405162461bcd60e51b81526004016102a190611765565b5060f881901c60fd8110610d115760405162461bcd60e51b81526004016102a190611765565b60408051600181526001600160f81b03198316602082015260218101909152606090610b09565b6040516002808252606091906000601f5b82821015610e445785811a826020860101536001919091019060001901610e22565b5050506022810160405292915050565b6040516004808252606091906000601f5b82821015610e875785811a826020860101536001919091019060001901610e65565b5050506024810160405292915050565b6040516008808252606091906000601f5b82821015610eca5785811a826020860101536001919091019060001901610ea8565b5050506028810160405292915050565b606061042684846000856111d8565b6000808351836001610efb9190611722565b11158015610f125750610f0f836001611722565b83105b610f5e5760405162461bcd60e51b815260206004820181905260248201527f4e657874427974652c204f66667365742065786365656473206d6178696d756d60448201526064016102a1565b8383016020015180610f71856001611722565b92509250509250929050565b6000808351836002610f8f9190611722565b11158015610fa65750610fa3836002611722565b83105b610ffd5760405162461bcd60e51b815260206004820152602260248201527f4e65787455696e7431362c206f66667365742065786365656473206d6178696d604482015261756d60f01b60648201526084016102a1565b6000604051846020870101518060011a82538060001a60018301535060028101604052601e81035191505080846002610f719190611722565b60008083518360046110489190611722565b1115801561105f575061105c836004611722565b83105b6110b65760405162461bcd60e51b815260206004820152602260248201527f4e65787455696e7433322c206f66667365742065786365656473206d6178696d604482015261756d60f01b60648201526084016102a1565b600060405160046000600182038760208a0101515b838310156110eb5780821a838601536001830192506001820391506110cb565b505050016040819052601f190151905080610f71856004611722565b60008083518360086111199190611722565b11158015611130575061112d836008611722565b83105b6111875760405162461bcd60e51b815260206004820152602260248201527f4e65787455696e7436342c206f66667365742065786365656473206d6178696d604482015261756d60f01b60648201526084016102a1565b600060405160086000600182038760208a0101515b838310156111bc5780821a8386015360018301925060018203915061119c565b505050016040819052601f190151905080610f71856008611722565b6060824710156112395760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102a1565b600080866001600160a01b0316858760405161125591906116b8565b60006040518083038185875af1925050503d8060008114611292576040519150601f19603f3d011682016040523d82523d6000602084013e611297565b606091505b50915091506112a8878383876112b3565b979650505050505050565b6060831561132257825160000361131b576001600160a01b0385163b61131b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102a1565b5081610426565b61042683838151156113375781518083602001fd5b8060405162461bcd60e51b81526004016102a1919061143b565b6001600160a01b03811681146104a557600080fd5b60008060006040848603121561137b57600080fd5b833561138681611351565b9250602084013567ffffffffffffffff808211156113a357600080fd5b818601915086601f8301126113b757600080fd5b8135818111156113c657600080fd5b8760208285010111156113d857600080fd5b6020830194508093505050509250925092565b60005b838110156114065781810151838201526020016113ee565b50506000910152565b600081518084526114278160208601602086016113eb565b601f01601f19169290920160200192915050565b60208152600061144e602083018461140f565b9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561149457611494611455565b604052919050565b600067ffffffffffffffff8211156114b6576114b6611455565b50601f01601f191660200190565b600082601f8301126114d557600080fd5b81356114e86114e38261149c565b61146b565b8181528460208386010111156114fd57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561153057600080fd5b843561153b81611351565b935060208501359250604085013561155281611351565b9150606085013567ffffffffffffffff81111561156e57600080fd5b61157a878288016114c4565b91505092959194509250565b60006020828403121561159857600080fd5b813561144e81611351565b6000602082840312156115b557600080fd5b813567ffffffffffffffff8111156115cc57600080fd5b610426848285016114c4565b6001600160a01b03831681526040602082018190526000906104269083018461140f565b6000835161160e8184602088016113eb565b8351908301906116228183602088016113eb565b01949350505050565b6000806040838503121561163e57600080fd5b825161164981611351565b602084015190925067ffffffffffffffff81111561166657600080fd5b8301601f8101851361167757600080fd5b80516116856114e38261149c565b81815286602083850101111561169a57600080fd5b6116ab8260208301602086016113eb565b8093505050509250929050565b600082516116ca8184602087016113eb565b9190910192915050565b6000602082840312156116e657600080fd5b5051919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b80820180821115610b0957634e487b7160e01b600052601160045260246000fd5b60006020828403121561175557600080fd5b8151801515811461144e57600080fd5b6020808252818101527f4e65787456617255696e742c2076616c7565206f7574736964652072616e676560408201526060019056fea264697066735822122090542bc233ec765a1004bee5dcf15827c6eac634b54ffa06108937c277f1fe2764736f6c63430008110033

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.