ETH Price: $3,123.57 (+1.16%)
Gas: 5 Gwei

Contract

0x6E9c5296Bd3d976933ab4D71e231C3001ee9Ff5C
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim202743222024-07-10 6:31:4725 hrs ago1720593107IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000929928.65035849
Claim201676832024-06-25 9:04:3515 days ago1719306275IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000521364.18471673
Claim201499902024-06-22 21:41:2318 days ago1719092483IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000227531.82627694
Claim201405052024-06-21 13:50:1119 days ago1718977811IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000814617.57774537
Claim201215012024-06-18 22:04:3522 days ago1718748275IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000733086.81936223
Claim201168662024-06-18 6:28:4723 days ago1718692127IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000563834.52597458
Claim201105232024-06-17 9:10:2323 days ago1718615423IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000365353.39860672
Claim200808032024-06-13 5:25:2328 days ago1718256323IN
0x6E9c5296...01ee9Ff5C
0 ETH0.001048259.75330317
Claim200587842024-06-10 3:36:1131 days ago1717990571IN
0x6E9c5296...01ee9Ff5C
0 ETH0.00036164
Claim200325462024-06-06 11:39:5934 days ago1717673999IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0018333817.05460628
Claim200197022024-06-04 16:38:3536 days ago1717519115IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0020426819.00156794
Claim200161722024-06-04 4:48:3537 days ago1717476515IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000537265
Claim200078572024-06-03 0:56:5938 days ago1717376219IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000969399.01751486
Claim199920522024-05-31 19:58:5940 days ago1717185539IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000826637.69037829
Claim199903062024-05-31 14:08:1140 days ago1717164491IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0025012323.27227898
Claim199876222024-05-31 5:06:5941 days ago1717132019IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000735046.83829164
Claim199813142024-05-30 7:56:4742 days ago1717055807IN
0x6E9c5296...01ee9Ff5C
0 ETH0.001462113.60237735
Claim199753282024-05-29 11:49:1142 days ago1716983351IN
0x6E9c5296...01ee9Ff5C
0 ETH0.001193399.57864901
Claim199688652024-05-28 14:08:5943 days ago1716905339IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0021803624.12196812
Claim199688632024-05-28 14:08:3543 days ago1716905315IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0026861324.98710845
Claim199492282024-05-25 20:18:2346 days ago1716668303IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000521974.85552551
Claim199388072024-05-24 9:19:5947 days ago1716542399IN
0x6E9c5296...01ee9Ff5C
0 ETH0.000759067.0609909
Claim199347902024-05-23 19:52:5948 days ago1716493979IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0012151911.30407615
Claim199337852024-05-23 16:30:3548 days ago1716481835IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0012087913.37146816
Claim199337812024-05-23 16:29:4748 days ago1716481787IN
0x6E9c5296...01ee9Ff5C
0 ETH0.0013509612.56842212
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WrabDistributorV2

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : WrabDistributorV2.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.5/contracts/utils/cryptography/ECDSA.sol";

contract WrabDistributorV2 is Ownable {
    using SafeERC20 for IERC20;

    address public tokenAddress;
    address private signerAddress;
    bool public claimOpen;

    mapping(bytes32 => bool) private claimedSignatures;
    mapping(address => uint256) public userClaimedTokens;

    event Claimed(address account, uint256 amount);

    constructor(address _tokenAddress, address _signerAddress) {
        tokenAddress = _tokenAddress;
        signerAddress = _signerAddress;
    }

    function claim(
        uint256 amount,
        uint256 createdAtMs,
        bytes memory signature
    ) public virtual {
        address userAddress = msg.sender;
        bytes32 signatureHash = keccak256(signature);
        require(claimOpen, "Claim is not active.");
        require(
            verifySignature(userAddress, amount, createdAtMs, signature),
            "Invalid Signature."
        );
        require(!claimedSignatures[signatureHash], "Already claimed.");

        uint256 claimedAmount = userClaimedTokens[userAddress];
        userClaimedTokens[userAddress] = amount + claimedAmount;
        claimedSignatures[signatureHash] = true;
        IERC20(tokenAddress).safeTransfer(userAddress, amount * 10**18);

        emit Claimed(userAddress, amount);
    }

    function verifySignature(
        address userAddress,
        uint256 amount,
        uint256 createdAtMs,
        bytes memory signature
    ) private view returns (bool) {
        bytes32 messageHash = getMessageHash(userAddress, amount, createdAtMs);
        bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(
            messageHash
        );

        return ECDSA.recover(ethSignedMessageHash, signature) == signerAddress;
    }

    function getMessageHash(
        address userAddress,
        uint256 wrabAmount,
        uint256 createdAtMs
    ) private pure returns (bytes32) {
        return
            keccak256(abi.encodePacked(userAddress, wrabAmount, createdAtMs));
    }

    function hasClaimedSignature(bytes memory signature)
        public
        view
        returns (bool)
    {
        bytes32 signatureHash = keccak256(signature);

        return claimedSignatures[signatureHash];
    }

    // Owner only methods
    function setClaimOpen(bool claimOpen_) external onlyOwner {
        claimOpen = claimOpen_;
    }

    function setSigner(address signerAddress_) external onlyOwner {
        signerAddress = signerAddress_;
    }

    /**
     * @dev Withdraw excess tokens left in the contract
     */
    function withdraw(uint256 amount) external onlyOwner {
        IERC20(tokenAddress).safeTransfer(msg.sender, amount * 10**18);
    }
}

File 2 of 11 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @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 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

File 3 of 11 : 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);
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

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

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

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

File 5 of 11 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.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 `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 6 of 11 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/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 7 of 11 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 8 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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 9 of 11 : 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 10 of 11 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 11 of 11 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 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 256, 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 << 3) < value ? 1 : 0);
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_signerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","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"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"createdAtMs","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"hasClaimedSignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"claimOpen_","type":"bool"}],"name":"setClaimOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signerAddress_","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenAddress","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":"address","name":"","type":"address"}],"name":"userClaimedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801562000010575f80fd5b5060405162001cf938038062001cf983398181016040528101906200003691906200020b565b620000566200004a620000de60201b60201c565b620000e560201b60201c565b8160015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505062000250565b5f33905090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f620001d582620001aa565b9050919050565b620001e781620001c9565b8114620001f2575f80fd5b50565b5f815190506200020581620001dc565b92915050565b5f8060408385031215620002245762000223620001a6565b5b5f6200023385828601620001f5565b92505060206200024685828601620001f5565b9150509250929050565b611a9b806200025e5f395ff3fe608060405234801561000f575f80fd5b50600436106100a7575f3560e01c80636c19e7831161006f5780636c19e78314610161578063715018a61461017d5780637273df66146101875780638da5cb5b146101a35780639d76ea58146101c1578063f2fde38b146101df576100a7565b80631258c5a8146100ab5780632e1a7d4d146100db5780634ad82cf3146100f75780634b8bcb58146101275780635eddd15714610145575b5f80fd5b6100c560048036038101906100c09190610fa8565b6101fb565b6040516100d29190611009565b60405180910390f35b6100f560048036038101906100f09190611055565b61022d565b005b610111600480360381019061010c91906110da565b610297565b60405161011e9190611114565b60405180910390f35b61012f6102ac565b60405161013c9190611009565b60405180910390f35b61015f600480360381019061015a919061112d565b6102bf565b005b61017b600480360381019061017691906110da565b61051d565b005b610185610568565b005b6101a1600480360381019061019c91906111c3565b61057b565b005b6101ab6105a0565b6040516101b891906111fd565b60405180910390f35b6101c96105c7565b6040516101d691906111fd565b60405180910390f35b6101f960048036038101906101f491906110da565b6105ec565b005b5f808280519060200120905060035f8281526020019081526020015f205f9054906101000a900460ff16915050919050565b61023561066e565b61029433670de0b6b3a76400008361024d9190611243565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ec9092919063ffffffff16565b50565b6004602052805f5260405f205f915090505481565b600260149054906101000a900460ff1681565b5f3390505f82805190602001209050600260149054906101000a900460ff1661031d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610314906112de565b60405180910390fd5b61032982868686610772565b610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90611346565b60405180910390fd5b60035f8281526020019081526020015f205f9054906101000a900460ff16156103c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103bd906113ae565b60405180910390fd5b5f60045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050808661041391906113cc565b60045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550600160035f8481526020019081526020015f205f6101000a81548160ff0219169083151502179055506104dc83670de0b6b3a7640000886104959190611243565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ec9092919063ffffffff16565b7fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a838760405161050d9291906113ff565b60405180910390a1505050505050565b61052561066e565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61057061066e565b6105795f6107f2565b565b61058361066e565b80600260146101000a81548160ff02191690831515021790555050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6105f461066e565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065990611496565b60405180910390fd5b61066b816107f2565b50565b6106766108b3565b73ffffffffffffffffffffffffffffffffffffffff166106946105a0565b73ffffffffffffffffffffffffffffffffffffffff16146106ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e1906114fe565b60405180910390fd5b565b61076d8363a9059cbb60e01b848460405160240161070b9291906113ff565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506108ba565b505050565b5f8061077f868686610980565b90505f61078b826109b5565b905060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107cf82866109e8565b73ffffffffffffffffffffffffffffffffffffffff161492505050949350505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f61091b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610a0d9092919063ffffffff16565b90505f8151148061093c57508080602001905181019061093b9190611530565b5b61097b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610972906115cb565b60405180910390fd5b505050565b5f8383836040516020016109969392919061164e565b6040516020818303038152906040528051906020012090509392505050565b5f7f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f5281601c52603c5f209050919050565b5f805f6109f58585610a24565b91509150610a0281610a70565b819250505092915050565b6060610a1b84845f85610bd5565b90509392505050565b5f806041835103610a61575f805f602086015192506040860151915060608601515f1a9050610a5587828585610c9e565b94509450505050610a69565b5f6002915091505b9250929050565b5f6004811115610a8357610a8261168a565b5b816004811115610a9657610a9561168a565b5b0315610bd25760016004811115610ab057610aaf61168a565b5b816004811115610ac357610ac261168a565b5b03610b03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afa90611701565b60405180910390fd5b60026004811115610b1757610b1661168a565b5b816004811115610b2a57610b2961168a565b5b03610b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6190611769565b60405180910390fd5b60036004811115610b7e57610b7d61168a565b5b816004811115610b9157610b9061168a565b5b03610bd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc8906117f7565b60405180910390fd5b5b50565b606082471015610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1190611885565b60405180910390fd5b5f808673ffffffffffffffffffffffffffffffffffffffff168587604051610c42919061190f565b5f6040518083038185875af1925050503d805f8114610c7c576040519150601f19603f3d011682016040523d82523d5f602084013e610c81565b606091505b5091509150610c9287838387610d76565b92505050949350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0835f1c1115610cd6575f600391509150610d6d565b5f6001878787876040515f8152602001604052604051610cf99493929190611958565b6020604051602081039080840390855afa158015610d19573d5f803e3d5ffd5b5050506020604051035190505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d65575f60019250925050610d6d565b805f92509250505b94509492505050565b60608315610dd7575f835103610dcf57610d8f85610dea565b610dce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc5906119e5565b60405180910390fd5b5b829050610de2565b610de18383610e0c565b5b949350505050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f82511115610e1e5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e529190611a45565b60405180910390fd5b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610eba82610e74565b810181811067ffffffffffffffff82111715610ed957610ed8610e84565b5b80604052505050565b5f610eeb610e5b565b9050610ef78282610eb1565b919050565b5f67ffffffffffffffff821115610f1657610f15610e84565b5b610f1f82610e74565b9050602081019050919050565b828183375f83830152505050565b5f610f4c610f4784610efc565b610ee2565b905082815260208101848484011115610f6857610f67610e70565b5b610f73848285610f2c565b509392505050565b5f82601f830112610f8f57610f8e610e6c565b5b8135610f9f848260208601610f3a565b91505092915050565b5f60208284031215610fbd57610fbc610e64565b5b5f82013567ffffffffffffffff811115610fda57610fd9610e68565b5b610fe684828501610f7b565b91505092915050565b5f8115159050919050565b61100381610fef565b82525050565b5f60208201905061101c5f830184610ffa565b92915050565b5f819050919050565b61103481611022565b811461103e575f80fd5b50565b5f8135905061104f8161102b565b92915050565b5f6020828403121561106a57611069610e64565b5b5f61107784828501611041565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6110a982611080565b9050919050565b6110b98161109f565b81146110c3575f80fd5b50565b5f813590506110d4816110b0565b92915050565b5f602082840312156110ef576110ee610e64565b5b5f6110fc848285016110c6565b91505092915050565b61110e81611022565b82525050565b5f6020820190506111275f830184611105565b92915050565b5f805f6060848603121561114457611143610e64565b5b5f61115186828701611041565b935050602061116286828701611041565b925050604084013567ffffffffffffffff81111561118357611182610e68565b5b61118f86828701610f7b565b9150509250925092565b6111a281610fef565b81146111ac575f80fd5b50565b5f813590506111bd81611199565b92915050565b5f602082840312156111d8576111d7610e64565b5b5f6111e5848285016111af565b91505092915050565b6111f78161109f565b82525050565b5f6020820190506112105f8301846111ee565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61124d82611022565b915061125883611022565b925082820261126681611022565b9150828204841483151761127d5761127c611216565b5b5092915050565b5f82825260208201905092915050565b7f436c61696d206973206e6f74206163746976652e0000000000000000000000005f82015250565b5f6112c8601483611284565b91506112d382611294565b602082019050919050565b5f6020820190508181035f8301526112f5816112bc565b9050919050565b7f496e76616c6964205369676e61747572652e00000000000000000000000000005f82015250565b5f611330601283611284565b915061133b826112fc565b602082019050919050565b5f6020820190508181035f83015261135d81611324565b9050919050565b7f416c726561647920636c61696d65642e000000000000000000000000000000005f82015250565b5f611398601083611284565b91506113a382611364565b602082019050919050565b5f6020820190508181035f8301526113c58161138c565b9050919050565b5f6113d682611022565b91506113e183611022565b92508282019050808211156113f9576113f8611216565b5b92915050565b5f6040820190506114125f8301856111ee565b61141f6020830184611105565b9392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611480602683611284565b915061148b82611426565b604082019050919050565b5f6020820190508181035f8301526114ad81611474565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f6114e8602083611284565b91506114f3826114b4565b602082019050919050565b5f6020820190508181035f830152611515816114dc565b9050919050565b5f8151905061152a81611199565b92915050565b5f6020828403121561154557611544610e64565b5b5f6115528482850161151c565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e5f8201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b5f6115b5602a83611284565b91506115c08261155b565b604082019050919050565b5f6020820190508181035f8301526115e2816115a9565b9050919050565b5f8160601b9050919050565b5f6115ff826115e9565b9050919050565b5f611610826115f5565b9050919050565b6116286116238261109f565b611606565b82525050565b5f819050919050565b61164861164382611022565b61162e565b82525050565b5f6116598286611617565b6014820191506116698285611637565b6020820191506116798284611637565b602082019150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b7f45434453413a20696e76616c6964207369676e617475726500000000000000005f82015250565b5f6116eb601883611284565b91506116f6826116b7565b602082019050919050565b5f6020820190508181035f830152611718816116df565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e677468005f82015250565b5f611753601f83611284565b915061175e8261171f565b602082019050919050565b5f6020820190508181035f83015261178081611747565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f6117e1602283611284565b91506117ec82611787565b604082019050919050565b5f6020820190508181035f83015261180e816117d5565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f5f8201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b5f61186f602683611284565b915061187a82611815565b604082019050919050565b5f6020820190508181035f83015261189c81611863565b9050919050565b5f81519050919050565b5f81905092915050565b5f5b838110156118d45780820151818401526020810190506118b9565b5f8484015250505050565b5f6118e9826118a3565b6118f381856118ad565b93506119038185602086016118b7565b80840191505092915050565b5f61191a82846118df565b915081905092915050565b5f819050919050565b61193781611925565b82525050565b5f60ff82169050919050565b6119528161193d565b82525050565b5f60808201905061196b5f83018761192e565b6119786020830186611949565b611985604083018561192e565b611992606083018461192e565b95945050505050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000005f82015250565b5f6119cf601d83611284565b91506119da8261199b565b602082019050919050565b5f6020820190508181035f8301526119fc816119c3565b9050919050565b5f81519050919050565b5f611a1782611a03565b611a218185611284565b9350611a318185602086016118b7565b611a3a81610e74565b840191505092915050565b5f6020820190508181035f830152611a5d8184611a0d565b90509291505056fea26469706673582212201afa6bf261643cc89b1e3c692da825232620398661e5837c3385b14038f49a5764736f6c6343000818003300000000000000000000000045d74446748fb432f05e7a85bd974abb7af5c2850000000000000000000000005a5c7aab607f466255adf432546a85af6c3a1bc7

Deployed Bytecode

0x608060405234801561000f575f80fd5b50600436106100a7575f3560e01c80636c19e7831161006f5780636c19e78314610161578063715018a61461017d5780637273df66146101875780638da5cb5b146101a35780639d76ea58146101c1578063f2fde38b146101df576100a7565b80631258c5a8146100ab5780632e1a7d4d146100db5780634ad82cf3146100f75780634b8bcb58146101275780635eddd15714610145575b5f80fd5b6100c560048036038101906100c09190610fa8565b6101fb565b6040516100d29190611009565b60405180910390f35b6100f560048036038101906100f09190611055565b61022d565b005b610111600480360381019061010c91906110da565b610297565b60405161011e9190611114565b60405180910390f35b61012f6102ac565b60405161013c9190611009565b60405180910390f35b61015f600480360381019061015a919061112d565b6102bf565b005b61017b600480360381019061017691906110da565b61051d565b005b610185610568565b005b6101a1600480360381019061019c91906111c3565b61057b565b005b6101ab6105a0565b6040516101b891906111fd565b60405180910390f35b6101c96105c7565b6040516101d691906111fd565b60405180910390f35b6101f960048036038101906101f491906110da565b6105ec565b005b5f808280519060200120905060035f8281526020019081526020015f205f9054906101000a900460ff16915050919050565b61023561066e565b61029433670de0b6b3a76400008361024d9190611243565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ec9092919063ffffffff16565b50565b6004602052805f5260405f205f915090505481565b600260149054906101000a900460ff1681565b5f3390505f82805190602001209050600260149054906101000a900460ff1661031d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610314906112de565b60405180910390fd5b61032982868686610772565b610368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161035f90611346565b60405180910390fd5b60035f8281526020019081526020015f205f9054906101000a900460ff16156103c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103bd906113ae565b60405180910390fd5b5f60045f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050808661041391906113cc565b60045f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550600160035f8481526020019081526020015f205f6101000a81548160ff0219169083151502179055506104dc83670de0b6b3a7640000886104959190611243565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ec9092919063ffffffff16565b7fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a838760405161050d9291906113ff565b60405180910390a1505050505050565b61052561066e565b8060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61057061066e565b6105795f6107f2565b565b61058361066e565b80600260146101000a81548160ff02191690831515021790555050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6105f461066e565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065990611496565b60405180910390fd5b61066b816107f2565b50565b6106766108b3565b73ffffffffffffffffffffffffffffffffffffffff166106946105a0565b73ffffffffffffffffffffffffffffffffffffffff16146106ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e1906114fe565b60405180910390fd5b565b61076d8363a9059cbb60e01b848460405160240161070b9291906113ff565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506108ba565b505050565b5f8061077f868686610980565b90505f61078b826109b5565b905060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107cf82866109e8565b73ffffffffffffffffffffffffffffffffffffffff161492505050949350505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f61091b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610a0d9092919063ffffffff16565b90505f8151148061093c57508080602001905181019061093b9190611530565b5b61097b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610972906115cb565b60405180910390fd5b505050565b5f8383836040516020016109969392919061164e565b6040516020818303038152906040528051906020012090509392505050565b5f7f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f5281601c52603c5f209050919050565b5f805f6109f58585610a24565b91509150610a0281610a70565b819250505092915050565b6060610a1b84845f85610bd5565b90509392505050565b5f806041835103610a61575f805f602086015192506040860151915060608601515f1a9050610a5587828585610c9e565b94509450505050610a69565b5f6002915091505b9250929050565b5f6004811115610a8357610a8261168a565b5b816004811115610a9657610a9561168a565b5b0315610bd25760016004811115610ab057610aaf61168a565b5b816004811115610ac357610ac261168a565b5b03610b03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afa90611701565b60405180910390fd5b60026004811115610b1757610b1661168a565b5b816004811115610b2a57610b2961168a565b5b03610b6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6190611769565b60405180910390fd5b60036004811115610b7e57610b7d61168a565b5b816004811115610b9157610b9061168a565b5b03610bd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc8906117f7565b60405180910390fd5b5b50565b606082471015610c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1190611885565b60405180910390fd5b5f808673ffffffffffffffffffffffffffffffffffffffff168587604051610c42919061190f565b5f6040518083038185875af1925050503d805f8114610c7c576040519150601f19603f3d011682016040523d82523d5f602084013e610c81565b606091505b5091509150610c9287838387610d76565b92505050949350505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0835f1c1115610cd6575f600391509150610d6d565b5f6001878787876040515f8152602001604052604051610cf99493929190611958565b6020604051602081039080840390855afa158015610d19573d5f803e3d5ffd5b5050506020604051035190505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d65575f60019250925050610d6d565b805f92509250505b94509492505050565b60608315610dd7575f835103610dcf57610d8f85610dea565b610dce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc5906119e5565b60405180910390fd5b5b829050610de2565b610de18383610e0c565b5b949350505050565b5f808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b5f82511115610e1e5781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e529190611a45565b60405180910390fd5b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610eba82610e74565b810181811067ffffffffffffffff82111715610ed957610ed8610e84565b5b80604052505050565b5f610eeb610e5b565b9050610ef78282610eb1565b919050565b5f67ffffffffffffffff821115610f1657610f15610e84565b5b610f1f82610e74565b9050602081019050919050565b828183375f83830152505050565b5f610f4c610f4784610efc565b610ee2565b905082815260208101848484011115610f6857610f67610e70565b5b610f73848285610f2c565b509392505050565b5f82601f830112610f8f57610f8e610e6c565b5b8135610f9f848260208601610f3a565b91505092915050565b5f60208284031215610fbd57610fbc610e64565b5b5f82013567ffffffffffffffff811115610fda57610fd9610e68565b5b610fe684828501610f7b565b91505092915050565b5f8115159050919050565b61100381610fef565b82525050565b5f60208201905061101c5f830184610ffa565b92915050565b5f819050919050565b61103481611022565b811461103e575f80fd5b50565b5f8135905061104f8161102b565b92915050565b5f6020828403121561106a57611069610e64565b5b5f61107784828501611041565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6110a982611080565b9050919050565b6110b98161109f565b81146110c3575f80fd5b50565b5f813590506110d4816110b0565b92915050565b5f602082840312156110ef576110ee610e64565b5b5f6110fc848285016110c6565b91505092915050565b61110e81611022565b82525050565b5f6020820190506111275f830184611105565b92915050565b5f805f6060848603121561114457611143610e64565b5b5f61115186828701611041565b935050602061116286828701611041565b925050604084013567ffffffffffffffff81111561118357611182610e68565b5b61118f86828701610f7b565b9150509250925092565b6111a281610fef565b81146111ac575f80fd5b50565b5f813590506111bd81611199565b92915050565b5f602082840312156111d8576111d7610e64565b5b5f6111e5848285016111af565b91505092915050565b6111f78161109f565b82525050565b5f6020820190506112105f8301846111ee565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61124d82611022565b915061125883611022565b925082820261126681611022565b9150828204841483151761127d5761127c611216565b5b5092915050565b5f82825260208201905092915050565b7f436c61696d206973206e6f74206163746976652e0000000000000000000000005f82015250565b5f6112c8601483611284565b91506112d382611294565b602082019050919050565b5f6020820190508181035f8301526112f5816112bc565b9050919050565b7f496e76616c6964205369676e61747572652e00000000000000000000000000005f82015250565b5f611330601283611284565b915061133b826112fc565b602082019050919050565b5f6020820190508181035f83015261135d81611324565b9050919050565b7f416c726561647920636c61696d65642e000000000000000000000000000000005f82015250565b5f611398601083611284565b91506113a382611364565b602082019050919050565b5f6020820190508181035f8301526113c58161138c565b9050919050565b5f6113d682611022565b91506113e183611022565b92508282019050808211156113f9576113f8611216565b5b92915050565b5f6040820190506114125f8301856111ee565b61141f6020830184611105565b9392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611480602683611284565b915061148b82611426565b604082019050919050565b5f6020820190508181035f8301526114ad81611474565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f6114e8602083611284565b91506114f3826114b4565b602082019050919050565b5f6020820190508181035f830152611515816114dc565b9050919050565b5f8151905061152a81611199565b92915050565b5f6020828403121561154557611544610e64565b5b5f6115528482850161151c565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e5f8201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b5f6115b5602a83611284565b91506115c08261155b565b604082019050919050565b5f6020820190508181035f8301526115e2816115a9565b9050919050565b5f8160601b9050919050565b5f6115ff826115e9565b9050919050565b5f611610826115f5565b9050919050565b6116286116238261109f565b611606565b82525050565b5f819050919050565b61164861164382611022565b61162e565b82525050565b5f6116598286611617565b6014820191506116698285611637565b6020820191506116798284611637565b602082019150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b7f45434453413a20696e76616c6964207369676e617475726500000000000000005f82015250565b5f6116eb601883611284565b91506116f6826116b7565b602082019050919050565b5f6020820190508181035f830152611718816116df565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e677468005f82015250565b5f611753601f83611284565b915061175e8261171f565b602082019050919050565b5f6020820190508181035f83015261178081611747565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f6117e1602283611284565b91506117ec82611787565b604082019050919050565b5f6020820190508181035f83015261180e816117d5565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f5f8201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b5f61186f602683611284565b915061187a82611815565b604082019050919050565b5f6020820190508181035f83015261189c81611863565b9050919050565b5f81519050919050565b5f81905092915050565b5f5b838110156118d45780820151818401526020810190506118b9565b5f8484015250505050565b5f6118e9826118a3565b6118f381856118ad565b93506119038185602086016118b7565b80840191505092915050565b5f61191a82846118df565b915081905092915050565b5f819050919050565b61193781611925565b82525050565b5f60ff82169050919050565b6119528161193d565b82525050565b5f60808201905061196b5f83018761192e565b6119786020830186611949565b611985604083018561192e565b611992606083018461192e565b95945050505050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000005f82015250565b5f6119cf601d83611284565b91506119da8261199b565b602082019050919050565b5f6020820190508181035f8301526119fc816119c3565b9050919050565b5f81519050919050565b5f611a1782611a03565b611a218185611284565b9350611a318185602086016118b7565b611a3a81610e74565b840191505092915050565b5f6020820190508181035f830152611a5d8184611a0d565b90509291505056fea26469706673582212201afa6bf261643cc89b1e3c692da825232620398661e5837c3385b14038f49a5764736f6c63430008180033

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

00000000000000000000000045d74446748fb432f05e7a85bd974abb7af5c2850000000000000000000000005a5c7aab607f466255adf432546a85af6c3a1bc7

-----Decoded View---------------
Arg [0] : _tokenAddress (address): 0x45D74446748fB432F05E7a85bD974aBB7af5C285
Arg [1] : _signerAddress (address): 0x5a5C7aAb607F466255ADf432546a85Af6c3A1Bc7

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000045d74446748fb432f05e7a85bd974abb7af5c285
Arg [1] : 0000000000000000000000005a5c7aab607f466255adf432546a85af6c3a1bc7


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.