ETH Price: $2,423.18 (-0.29%)

Contract

0x6E838e10E3377576bE7290DAB0b1dD1F6528562f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim181669552023-09-19 2:22:11361 days ago1695090131IN
0x6E838e10...F6528562f
0 ETH0.000179237.46818112
Claim181611662023-09-18 6:51:11362 days ago1695019871IN
0x6E838e10...F6528562f
0 ETH0.000185897.74579417
Claim181106872023-09-11 4:19:35369 days ago1694405975IN
0x6E838e10...F6528562f
0 ETH0.000359249.26940113
Claim181106752023-09-11 4:17:11369 days ago1694405831IN
0x6E838e10...F6528562f
0 ETH0.000215088.9617735
Deposit177265042023-07-19 10:00:11423 days ago1689760811IN
0x6E838e10...F6528562f
0 ETH0.0031977414.91821839
Deposit177111732023-07-17 6:23:11425 days ago1689574991IN
0x6E838e10...F6528562f
0 ETH0.0030033714.01140736
Deposit177093082023-07-17 0:07:11426 days ago1689552431IN
0x6E838e10...F6528562f
0 ETH0.0025303312.07566278
Deposit177091772023-07-16 23:40:23426 days ago1689550823IN
0x6E838e10...F6528562f
0 ETH0.0028099912.39917385
Claim177088812023-07-16 22:40:23426 days ago1689547223IN
0x6E838e10...F6528562f
0 ETH0.0011176714.97039387
Deposit177088602023-07-16 22:35:59426 days ago1689546959IN
0x6E838e10...F6528562f
0 ETH0.0028441512.54921045
Setup177076622023-07-16 18:34:47426 days ago1689532487IN
0x6E838e10...F6528562f
0 ETH0.0003695812.71762747
0x60806040177076552023-07-16 18:33:23426 days ago1689532403IN
 Create: Wormhole
0 ETH0.0164510613.24504518

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Wormhole

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
constantinople EvmVersion
File 1 of 8 : Wormhole.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

error AlreadySetuped();
error NotLiveOrSetuped();
error NotEnoughReserve();
error NotEnoughTokens();
error ContractNotApproved();
error ReceiptAlreadyUsed();
error InvalidReceipt();
error ReceiptDelay();
error UnknownBridge();
error InvalidBridgeID();
error InvalidAmount();

contract Wormhole is Ownable, ReentrancyGuard {
    using ECDSA for bytes32;

    address public signerAddr;
    uint32 public bridgeID;
    uint64 public delay;

    bool public paused;
    address public tokenAddr;

    struct Receipt {
        uint256 amount;
        uint256 time;
        bytes32 id;
        uint32 from;
        uint32 to;
        address user;
    }

    mapping(address => bytes32[]) public receiptsPerAddress;

    mapping(address => uint32) public receiptsNbPerAddress;

    mapping(bytes32 => Receipt) public createdReceipts;

    mapping(bytes32 => bool) public usedReceipts;

    // events
    event ReceiptCreated(address indexed depositer, uint256 amount, uint256 datetime, uint32 toBridge);
    event ReceiptUsed(address indexed withdrawer, uint256 amount, uint256 datetime, uint32 fromBridge);

    constructor(address _signerAddr, address _tokenAddr, uint64 _delay) payable {
        signerAddr = _signerAddr;
        tokenAddr = _tokenAddr;
        delay = _delay;
    }

    modifier isLive() {
        if (paused || bridgeID == 0) {
            _revert(NotLiveOrSetuped.selector);
        }
        _;
    }

    modifier validBridge(uint32 _bridgeID) {
        if (_bridgeID == 0 || _bridgeID == bridgeID) {
            _revert(InvalidBridgeID.selector);
        }
        _;
    }

    function setup(uint32 _bridgeID) external payable onlyOwner validBridge(_bridgeID) {
        if (bridgeID != 0) {
            _revert(AlreadySetuped.selector);
        }
        bridgeID = _bridgeID;
    }

    function setSigner(address _v) external payable onlyOwner {
        signerAddr = _v;
    }

    function setDelay(uint64 _v) external payable onlyOwner {
        delay = _v;
    }

    function flipPaused() external payable onlyOwner {
        paused = !paused;
    }

    function claim(uint256 receiptAmount, uint256 receiptTime, uint8 receiptFromBridge, bytes calldata signature) external isLive validBridge(receiptFromBridge) nonReentrant {
        if (IERC20(tokenAddr).balanceOf(address(this)) < receiptAmount) {
            _revert(NotEnoughReserve.selector);
        }

        if (receiptTime + uint256(delay) > block.timestamp) {
            _revert(ReceiptDelay.selector);
        }

        bytes32 receiptID = getReceiptID(receiptAmount, receiptTime, _msgSender(), receiptFromBridge, bridgeID);

        if (usedReceipts[receiptID]) {
            _revert(ReceiptAlreadyUsed.selector);
        }

        if (!verifyReceiptID(receiptID, signature)) {
            _revert(InvalidReceipt.selector);
        }

        // register claim
        usedReceipts[receiptID] = true;
        IERC20(tokenAddr).transfer(_msgSender(), receiptAmount);

        emit ReceiptUsed(_msgSender(), receiptAmount, receiptTime, receiptFromBridge);
    }

    function deposit(uint256 amount, uint32 toBridge) external isLive validBridge(toBridge) nonReentrant {
        if (IERC20(tokenAddr).allowance(_msgSender(), address(this)) < amount) {
            _revert(ContractNotApproved.selector);
        }

        if (amount == 0) {
            _revert(InvalidAmount.selector);
        }

        // create receipt
        bytes32 receiptID = getReceiptID(amount, block.timestamp, _msgSender(), bridgeID, toBridge);

        Receipt memory receipt = Receipt(amount, block.timestamp, receiptID, bridgeID, toBridge, _msgSender());

        createdReceipts[receiptID] = receipt;
        receiptsPerAddress[_msgSender()].push(receiptID);
        receiptsNbPerAddress[_msgSender()] += 1;

        IERC20(tokenAddr).transferFrom(_msgSender(), address(this), amount);

        emit ReceiptCreated(_msgSender(), amount, block.timestamp, toBridge);
    }

    function getReceiptsFromAddress(address addr) external view returns (bytes32[] memory) {
        return receiptsPerAddress[addr];
    }

    function _revert(bytes4 errorSelector) internal pure {
        assembly {
            mstore(0x00, errorSelector)
            revert(0x00, 0x04)
        }
    }

    function verifyReceiptID(bytes32 _receiptID, bytes memory _signature) private view returns (bool) {
        return signerAddr == _receiptID.toEthSignedMessageHash().recover(_signature);
    }

    function getReceiptID(uint256 _amount, uint256 _time, address _user, uint32 _fromBridge, uint32 _toBridge) private pure returns (bytes32) {
        return hashMessage(abi.encode(_amount, _time, _user, _fromBridge, _toBridge));
    }

    function hashMessage(bytes memory _msg) private pure returns (bytes32) {
        return keccak256(_msg);
    }
}

File 2 of 8 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 3 of 8 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 4 of 8 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 5 of 8 : 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 6 of 8 : 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 7 of 8 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

File 8 of 8 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        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);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_signerAddr","type":"address"},{"internalType":"address","name":"_tokenAddr","type":"address"},{"internalType":"uint64","name":"_delay","type":"uint64"}],"stateMutability":"payable","type":"constructor"},{"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":true,"internalType":"address","name":"depositer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"datetime","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"toBridge","type":"uint32"}],"name":"ReceiptCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"datetime","type":"uint256"},{"indexed":false,"internalType":"uint32","name":"fromBridge","type":"uint32"}],"name":"ReceiptUsed","type":"event"},{"inputs":[],"name":"bridgeID","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"receiptAmount","type":"uint256"},{"internalType":"uint256","name":"receiptTime","type":"uint256"},{"internalType":"uint8","name":"receiptFromBridge","type":"uint8"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"createdReceipts","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"},{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"uint32","name":"from","type":"uint32"},{"internalType":"uint32","name":"to","type":"uint32"},{"internalType":"address","name":"user","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"delay","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"toBridge","type":"uint32"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipPaused","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getReceiptsFromAddress","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"receiptsNbPerAddress","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"receiptsPerAddress","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_v","type":"uint64"}],"name":"setDelay","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_v","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_bridgeID","type":"uint32"}],"name":"setup","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"signerAddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAddr","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":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"usedReceipts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040526040516200153d3803806200153d83398101604081905261002491610116565b61002d336100aa565b6001805560028054600380546001600160a01b0395861661010002610100600160a81b03199091161790556001600160401b0390921678010000000000000000000000000000000000000000000000000277ffffffff0000000000000000000000000000000000000000909216929093169190911717905561016a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b038116811461011157600080fd5b919050565b60008060006060848603121561012b57600080fd5b610134846100fa565b9250610142602085016100fa565b60408501519092506001600160401b038116811461015f57600080fd5b809150509250925092565b6113c3806200017a6000396000f3fe6080604052600436106101145760003560e01c8063715018a6116100a0578063cf7ed51811610064578063cf7ed518146103c2578063e84bcacc146103d5578063ed77fbfc146103f9578063f2fde38b14610419578063f6def5891461043957600080fd5b8063715018a61461031e5780638da5cb5b14610333578063a78ab9c814610351578063be58d44d1461037f578063c1073302146103af57600080fd5b80634efe98d5116100e75780634efe98d5146101bd5780635c975abb146102635780635fbe4d1d1461028d5780636a42b8f8146102ca5780636c19e7831461030b57600080fd5b806323244728146101195780632b2dfd2c14610166578063333171bb14610188578063495c0e6f14610190575b600080fd5b34801561012557600080fd5b5061014c610134366004611125565b60056020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b34801561017257600080fd5b5061018661018136600461115b565b610459565b005b6101866107a3565b34801561019c57600080fd5b506101b06101ab366004611125565b6107bf565b60405161015d9190611187565b3480156101c957600080fd5b506102246101d83660046111cb565b60066020526000908152604090208054600182015460028301546003909301549192909163ffffffff80821691640100000000810490911690600160401b90046001600160a01b031686565b6040805196875260208701959095529385019290925263ffffffff90811660608501521660808301526001600160a01b031660a082015260c00161015d565b34801561026f57600080fd5b5060035461027d9060ff1681565b604051901515815260200161015d565b34801561029957600080fd5b506003546102b29061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161015d565b3480156102d657600080fd5b506002546102f290600160c01b900467ffffffffffffffff1681565b60405167ffffffffffffffff909116815260200161015d565b610186610319366004611125565b61082b565b34801561032a57600080fd5b50610186610855565b34801561033f57600080fd5b506000546001600160a01b03166102b2565b34801561035d57600080fd5b5061037161036c3660046111e4565b610869565b60405190815260200161015d565b34801561038b57600080fd5b5061027d61039a3660046111cb565b60076020526000908152604090205460ff1681565b6101866103bd36600461120e565b61089a565b6101866103d0366004611238565b6108cb565b3480156103e157600080fd5b5060025461014c90600160a01b900463ffffffff1681565b34801561040557600080fd5b50610186610414366004611253565b610959565b34801561042557600080fd5b50610186610434366004611125565b610c28565b34801561044557600080fd5b506002546102b2906001600160a01b031681565b60035460ff16806104775750600254600160a01b900463ffffffff16155b1561048c5761048c63ebb3a4f760e01b610ca6565b8063ffffffff811615806104b1575060025463ffffffff828116600160a01b90920416145b156104c6576104c6634e1731af60e11b610ca6565b6104ce610cb0565b600354839061010090046001600160a01b031663dd62ed3e336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa158015610531573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055591906112ef565b101561056b5761056b630711778560e51b610ca6565b826000036105835761058363162908e360e11b610ca6565b60006105a1844233600254600160a01b900463ffffffff1687610d09565b6040805160c08101825286815242602080830191825282840185815260028054600160a01b900463ffffffff908116606087019081528b8216608088019081523360a0890181815260008c8152600689528b81208b51815599516001808c01919091559751968a0196909655925160039098018054925193516001600160a01b0316600160401b0268010000000000000000600160e01b03199486166401000000000267ffffffffffffffff199094169986169990991792909217929092169690961790955584825260048452868220805480850182559083528483200188905593815260059092529381208054959650929490916106a29185911661131e565b825461010092830a63ffffffff81810219909216929091160217909155600354046001600160a01b031690506323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018890526064016020604051808303816000875af1158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190611342565b506040805186815242602082015263ffffffff861681830152905133917f31b20dfc17583a0012e925e525a6e8237749ab5506d3995375a029937b15edb0919081900360600190a2505061079e60018055565b505050565b6107ab610d6b565b6003805460ff19811660ff90911615179055565b6001600160a01b03811660009081526004602090815260409182902080548351818402810184019094528084526060939283018282801561081f57602002820191906000526020600020905b81548152602001906001019080831161080b575b50505050509050919050565b610833610d6b565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61085d610d6b565b6108676000610dc5565b565b6004602052816000526040600020818154811061088557600080fd5b90600052602060002001600091509150505481565b6108a2610d6b565b6002805467ffffffffffffffff909216600160c01b026001600160c01b03909216919091179055565b6108d3610d6b565b8063ffffffff811615806108f8575060025463ffffffff828116600160a01b90920416145b1561090d5761090d634e1731af60e11b610ca6565b600254600160a01b900463ffffffff1615610932576109326316d9ae6160e11b610ca6565b506002805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b60035460ff16806109775750600254600160a01b900463ffffffff16155b1561098c5761098c63ebb3a4f760e01b610ca6565b60ff83168015806109ae575060025463ffffffff828116600160a01b90920416145b156109c3576109c3634e1731af60e11b610ca6565b6109cb610cb0565b6003546040516370a0823160e01b8152306004820152879161010090046001600160a01b0316906370a0823190602401602060405180830381865afa158015610a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3c91906112ef565b1015610a5257610a52638b5555f360e01b610ca6565b6002544290610a7290600160c01b900467ffffffffffffffff1687611364565b1115610a8857610a88630dc8b1f560e21b610ca6565b6000610aaa87873360025460ff8a1690600160a01b900463ffffffff16610d09565b60008181526007602052604090205490915060ff1615610ad457610ad463220bf11360e01b610ca6565b610b148185858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e1592505050565b610b2857610b2863300262ab60e21b610ca6565b6000818152600760205260409020805460ff191660011790556003546001600160a01b036101009091041663a9059cbb610b5f3390565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018a90526044016020604051808303816000875af1158015610bac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd09190611342565b50604080518881526020810188905260ff871681830152905133917fdadd43a69c1dbdbdb43d87bcfd7ec888cf40f1acffd41af07a1205812b0d42e7919081900360600190a250610c2060018055565b505050505050565b610c30610d6b565b6001600160a01b038116610c9a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610ca381610dc5565b50565b8060005260046000fd5b600260015403610d025760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c91565b6002600155565b60408051602081018790529081018590526001600160a01b038416606082015263ffffffff8084166080830152821660a0820152600090610d619060c001604051602081830303815290604052805160209091012090565b9695505050505050565b6000546001600160a01b031633146108675760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c91565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610e7882610e72856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610e92565b6002546001600160a01b0390811691161490505b92915050565b6000806000610ea18585610eb6565b91509150610eae81610efb565b509392505050565b6000808251604103610eec5760208301516040840151606085015160001a610ee087828585611045565b94509450505050610ef4565b506000905060025b9250929050565b6000816004811115610f0f57610f0f611377565b03610f175750565b6001816004811115610f2b57610f2b611377565b03610f785760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c91565b6002816004811115610f8c57610f8c611377565b03610fd95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c91565b6003816004811115610fed57610fed611377565b03610ca35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c91565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561107c5750600090506003611100565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156110d0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110f957600060019250925050611100565b9150600090505b94509492505050565b80356001600160a01b038116811461112057600080fd5b919050565b60006020828403121561113757600080fd5b61114082611109565b9392505050565b803563ffffffff8116811461112057600080fd5b6000806040838503121561116e57600080fd5b8235915061117e60208401611147565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156111bf578351835292840192918401916001016111a3565b50909695505050505050565b6000602082840312156111dd57600080fd5b5035919050565b600080604083850312156111f757600080fd5b61120083611109565b946020939093013593505050565b60006020828403121561122057600080fd5b813567ffffffffffffffff8116811461114057600080fd5b60006020828403121561124a57600080fd5b61114082611147565b60008060008060006080868803121561126b57600080fd5b8535945060208601359350604086013560ff8116811461128a57600080fd5b9250606086013567ffffffffffffffff808211156112a757600080fd5b818801915088601f8301126112bb57600080fd5b8135818111156112ca57600080fd5b8960208285010111156112dc57600080fd5b9699959850939650602001949392505050565b60006020828403121561130157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff81811683821601908082111561133b5761133b611308565b5092915050565b60006020828403121561135457600080fd5b8151801515811461114057600080fd5b80820180821115610e8c57610e8c611308565b634e487b7160e01b600052602160045260246000fdfea264697066735822122090536e3845605210ff03a1610eb191f29b4d73028bc808459725830bae7f5ccd64736f6c63430008140033000000000000000000000000849d88b9002a9845a28eaa390401684956d7331e000000000000000000000000d2d3948d13c1ecceeb9d71a29cc3337e50bc44470000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101145760003560e01c8063715018a6116100a0578063cf7ed51811610064578063cf7ed518146103c2578063e84bcacc146103d5578063ed77fbfc146103f9578063f2fde38b14610419578063f6def5891461043957600080fd5b8063715018a61461031e5780638da5cb5b14610333578063a78ab9c814610351578063be58d44d1461037f578063c1073302146103af57600080fd5b80634efe98d5116100e75780634efe98d5146101bd5780635c975abb146102635780635fbe4d1d1461028d5780636a42b8f8146102ca5780636c19e7831461030b57600080fd5b806323244728146101195780632b2dfd2c14610166578063333171bb14610188578063495c0e6f14610190575b600080fd5b34801561012557600080fd5b5061014c610134366004611125565b60056020526000908152604090205463ffffffff1681565b60405163ffffffff90911681526020015b60405180910390f35b34801561017257600080fd5b5061018661018136600461115b565b610459565b005b6101866107a3565b34801561019c57600080fd5b506101b06101ab366004611125565b6107bf565b60405161015d9190611187565b3480156101c957600080fd5b506102246101d83660046111cb565b60066020526000908152604090208054600182015460028301546003909301549192909163ffffffff80821691640100000000810490911690600160401b90046001600160a01b031686565b6040805196875260208701959095529385019290925263ffffffff90811660608501521660808301526001600160a01b031660a082015260c00161015d565b34801561026f57600080fd5b5060035461027d9060ff1681565b604051901515815260200161015d565b34801561029957600080fd5b506003546102b29061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161015d565b3480156102d657600080fd5b506002546102f290600160c01b900467ffffffffffffffff1681565b60405167ffffffffffffffff909116815260200161015d565b610186610319366004611125565b61082b565b34801561032a57600080fd5b50610186610855565b34801561033f57600080fd5b506000546001600160a01b03166102b2565b34801561035d57600080fd5b5061037161036c3660046111e4565b610869565b60405190815260200161015d565b34801561038b57600080fd5b5061027d61039a3660046111cb565b60076020526000908152604090205460ff1681565b6101866103bd36600461120e565b61089a565b6101866103d0366004611238565b6108cb565b3480156103e157600080fd5b5060025461014c90600160a01b900463ffffffff1681565b34801561040557600080fd5b50610186610414366004611253565b610959565b34801561042557600080fd5b50610186610434366004611125565b610c28565b34801561044557600080fd5b506002546102b2906001600160a01b031681565b60035460ff16806104775750600254600160a01b900463ffffffff16155b1561048c5761048c63ebb3a4f760e01b610ca6565b8063ffffffff811615806104b1575060025463ffffffff828116600160a01b90920416145b156104c6576104c6634e1731af60e11b610ca6565b6104ce610cb0565b600354839061010090046001600160a01b031663dd62ed3e336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa158015610531573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055591906112ef565b101561056b5761056b630711778560e51b610ca6565b826000036105835761058363162908e360e11b610ca6565b60006105a1844233600254600160a01b900463ffffffff1687610d09565b6040805160c08101825286815242602080830191825282840185815260028054600160a01b900463ffffffff908116606087019081528b8216608088019081523360a0890181815260008c8152600689528b81208b51815599516001808c01919091559751968a0196909655925160039098018054925193516001600160a01b0316600160401b0268010000000000000000600160e01b03199486166401000000000267ffffffffffffffff199094169986169990991792909217929092169690961790955584825260048452868220805480850182559083528483200188905593815260059092529381208054959650929490916106a29185911661131e565b825461010092830a63ffffffff81810219909216929091160217909155600354046001600160a01b031690506323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604481018890526064016020604051808303816000875af1158015610727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074b9190611342565b506040805186815242602082015263ffffffff861681830152905133917f31b20dfc17583a0012e925e525a6e8237749ab5506d3995375a029937b15edb0919081900360600190a2505061079e60018055565b505050565b6107ab610d6b565b6003805460ff19811660ff90911615179055565b6001600160a01b03811660009081526004602090815260409182902080548351818402810184019094528084526060939283018282801561081f57602002820191906000526020600020905b81548152602001906001019080831161080b575b50505050509050919050565b610833610d6b565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b61085d610d6b565b6108676000610dc5565b565b6004602052816000526040600020818154811061088557600080fd5b90600052602060002001600091509150505481565b6108a2610d6b565b6002805467ffffffffffffffff909216600160c01b026001600160c01b03909216919091179055565b6108d3610d6b565b8063ffffffff811615806108f8575060025463ffffffff828116600160a01b90920416145b1561090d5761090d634e1731af60e11b610ca6565b600254600160a01b900463ffffffff1615610932576109326316d9ae6160e11b610ca6565b506002805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b60035460ff16806109775750600254600160a01b900463ffffffff16155b1561098c5761098c63ebb3a4f760e01b610ca6565b60ff83168015806109ae575060025463ffffffff828116600160a01b90920416145b156109c3576109c3634e1731af60e11b610ca6565b6109cb610cb0565b6003546040516370a0823160e01b8152306004820152879161010090046001600160a01b0316906370a0823190602401602060405180830381865afa158015610a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3c91906112ef565b1015610a5257610a52638b5555f360e01b610ca6565b6002544290610a7290600160c01b900467ffffffffffffffff1687611364565b1115610a8857610a88630dc8b1f560e21b610ca6565b6000610aaa87873360025460ff8a1690600160a01b900463ffffffff16610d09565b60008181526007602052604090205490915060ff1615610ad457610ad463220bf11360e01b610ca6565b610b148185858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e1592505050565b610b2857610b2863300262ab60e21b610ca6565b6000818152600760205260409020805460ff191660011790556003546001600160a01b036101009091041663a9059cbb610b5f3390565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018a90526044016020604051808303816000875af1158015610bac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd09190611342565b50604080518881526020810188905260ff871681830152905133917fdadd43a69c1dbdbdb43d87bcfd7ec888cf40f1acffd41af07a1205812b0d42e7919081900360600190a250610c2060018055565b505050505050565b610c30610d6b565b6001600160a01b038116610c9a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b610ca381610dc5565b50565b8060005260046000fd5b600260015403610d025760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c91565b6002600155565b60408051602081018790529081018590526001600160a01b038416606082015263ffffffff8084166080830152821660a0820152600090610d619060c001604051602081830303815290604052805160209091012090565b9695505050505050565b6000546001600160a01b031633146108675760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c91565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610e7882610e72856040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90610e92565b6002546001600160a01b0390811691161490505b92915050565b6000806000610ea18585610eb6565b91509150610eae81610efb565b509392505050565b6000808251604103610eec5760208301516040840151606085015160001a610ee087828585611045565b94509450505050610ef4565b506000905060025b9250929050565b6000816004811115610f0f57610f0f611377565b03610f175750565b6001816004811115610f2b57610f2b611377565b03610f785760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610c91565b6002816004811115610f8c57610f8c611377565b03610fd95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610c91565b6003816004811115610fed57610fed611377565b03610ca35760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610c91565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561107c5750600090506003611100565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156110d0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166110f957600060019250925050611100565b9150600090505b94509492505050565b80356001600160a01b038116811461112057600080fd5b919050565b60006020828403121561113757600080fd5b61114082611109565b9392505050565b803563ffffffff8116811461112057600080fd5b6000806040838503121561116e57600080fd5b8235915061117e60208401611147565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156111bf578351835292840192918401916001016111a3565b50909695505050505050565b6000602082840312156111dd57600080fd5b5035919050565b600080604083850312156111f757600080fd5b61120083611109565b946020939093013593505050565b60006020828403121561122057600080fd5b813567ffffffffffffffff8116811461114057600080fd5b60006020828403121561124a57600080fd5b61114082611147565b60008060008060006080868803121561126b57600080fd5b8535945060208601359350604086013560ff8116811461128a57600080fd5b9250606086013567ffffffffffffffff808211156112a757600080fd5b818801915088601f8301126112bb57600080fd5b8135818111156112ca57600080fd5b8960208285010111156112dc57600080fd5b9699959850939650602001949392505050565b60006020828403121561130157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff81811683821601908082111561133b5761133b611308565b5092915050565b60006020828403121561135457600080fd5b8151801515811461114057600080fd5b80820180821115610e8c57610e8c611308565b634e487b7160e01b600052602160045260246000fdfea264697066735822122090536e3845605210ff03a1610eb191f29b4d73028bc808459725830bae7f5ccd64736f6c63430008140033

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

000000000000000000000000849d88b9002a9845a28eaa390401684956d7331e000000000000000000000000d2d3948d13c1ecceeb9d71a29cc3337e50bc44470000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _signerAddr (address): 0x849d88B9002a9845a28Eaa390401684956D7331e
Arg [1] : _tokenAddr (address): 0xd2D3948d13C1ECcEEB9D71a29cc3337e50bc4447
Arg [2] : _delay (uint64): 0

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000849d88b9002a9845a28eaa390401684956d7331e
Arg [1] : 000000000000000000000000d2d3948d13c1ecceeb9d71a29cc3337e50bc4447
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000


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.