ETH Price: $2,600.10 (+0.35%)
Gas: 1 Gwei

Contract

0xD2b8805d08dcAba2BcBE63372ea0c75A690C8513
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Transaction Hash
Method
Block
From
To
Withdraw Native ...195597222024-04-01 8:13:47131 days ago1711959227IN
0xD2b8805d...A690C8513
0 ETH0.0007213420.2119464
Withdraw Token195596842024-04-01 8:05:59131 days ago1711958759IN
0xD2b8805d...A690C8513
0 ETH0.001393919.61898978
Deposit Token165223912023-01-30 21:41:11557 days ago1675114871IN
0xD2b8805d...A690C8513
0 ETH0.0004401218.24803847
Deposit Token165222862023-01-30 21:19:59557 days ago1675113599IN
0xD2b8805d...A690C8513
0 ETH0.0019129521.67458512
Deposit Token165222202023-01-30 21:06:47557 days ago1675112807IN
0xD2b8805d...A690C8513
0 ETH0.0022491225.49040347
Withdraw Native ...165221832023-01-30 20:59:23557 days ago1675112363IN
0xD2b8805d...A690C8513
0 ETH0.0006171718.60242857
Withdraw Native ...165221732023-01-30 20:57:23557 days ago1675112243IN
0xD2b8805d...A690C8513
0 ETH0.0007235921.85747876
Withdraw Token165221602023-01-30 20:54:47557 days ago1675112087IN
0xD2b8805d...A690C8513
0 ETH0.0011506120.0757193
Deposit Native T...165221532023-01-30 20:53:23557 days ago1675112003IN
0xD2b8805d...A690C8513
0.013 ETH0.0010013122.26226034
Deposit Token165221502023-01-30 20:52:47557 days ago1675111967IN
0xD2b8805d...A690C8513
0 ETH0.0018377722.01718347
Deposit Token165219922023-01-30 20:20:59557 days ago1675110059IN
0xD2b8805d...A690C8513
0 ETH0.0019445422.03550972
Deposit Native T...165219442023-01-30 20:11:23557 days ago1675109483IN
0xD2b8805d...A690C8513
0.322013 ETH0.0012092826.88606811
Deposit Token165218992023-01-30 20:02:11557 days ago1675108931IN
0xD2b8805d...A690C8513
0 ETH0.0022228525.19158956
Deposit Token165218702023-01-30 19:56:23557 days ago1675108583IN
0xD2b8805d...A690C8513
0 ETH0.0019164621.71437088
Deposit Native T...165218302023-01-30 19:48:11557 days ago1675108091IN
0xD2b8805d...A690C8513
0.79 ETH0.0010623823.6201092
Deposit Native T...165217952023-01-30 19:41:11557 days ago1675107671IN
0xD2b8805d...A690C8513
0.161099 ETH0.0012475727.73733897
Deposit Native T...165217202023-01-30 19:26:11557 days ago1675106771IN
0xD2b8805d...A690C8513
0.011 ETH0.0013587930.21026409
Deposit Native T...165217132023-01-30 19:24:47557 days ago1675106687IN
0xD2b8805d...A690C8513
0.01611 ETH0.0013466529.94029164
Deposit Native T...165216902023-01-30 19:20:11557 days ago1675106411IN
0xD2b8805d...A690C8513
0.164956 ETH0.0014926833.18703617
Deposit Token165216632023-01-30 19:14:47558 days ago1675106087IN
0xD2b8805d...A690C8513
0 ETH0.0038578446.23158899
Deposit Native T...165216362023-01-30 19:09:23558 days ago1675105763IN
0xD2b8805d...A690C8513
0.5 ETH0.0009884621.97672003
Deposit Native T...165215892023-01-30 18:59:59558 days ago1675105199IN
0xD2b8805d...A690C8513
0.079208 ETH0.0007543416.7715041
Deposit Native T...165215472023-01-30 18:51:35558 days ago1675104695IN
0xD2b8805d...A690C8513
0.06 ETH0.0007555416.79803969
Deposit Token165215142023-01-30 18:44:59558 days ago1675104299IN
0xD2b8805d...A690C8513
0 ETH0.0018960921.497226
Deposit Native T...165214392023-01-30 18:29:59558 days ago1675103399IN
0xD2b8805d...A690C8513
0.1 ETH0.0010400123.12265451
View all transactions

Latest 3 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
195597222024-04-01 8:13:47131 days ago1711959227
0xD2b8805d...A690C8513
0.59150999 ETH
165221832023-01-30 20:59:23557 days ago1675112363
0xD2b8805d...A690C8513
35 ETH
165221732023-01-30 20:57:23557 days ago1675112243
0xD2b8805d...A690C8513
35 wei
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PolarDepositContract

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

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

pragma solidity 0.8.16;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

interface AggregatorV3Interface {
    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int answer,
            uint startedAt,
            uint updatedAt,
            uint80 answeredInRound
        );
}

error NotAllowedInPrivateSale(address account);

contract PolarDepositContract is AccessControl, EIP712 {
    using SafeERC20 for IERC20;
    
    AggregatorV3Interface internal priceFeed;

    event DepositedToken(address indexed tokenAddress, address indexed sender, uint256 quantity, uint256 status, uint256 amount);
    event WithdrawedToken(address indexed tokenAddress, address indexed recipient, uint256 amount);
    
    error InvalidPrivateSaleAddress(address account);

    bytes32 public constant DEPOSIT_ROLE = keccak256("DEPOSIT_ROLE");
    
    bytes32 constant public DEPOSIT_TYPEHASH = keccak256("DepositToken(address account,uint256 quantity,uint256 amount,uint256 deadline,uint256 nonce,uint256 status,bool isWhitelisted)");

    address private immutable _acceptToken;

    mapping(address => uint256) private _accountNonces;

    uint256 public constant PUBLIC_SALE_PRICE = 25; // 0.025 with 3 decimals
    uint256 public constant QUANTITY_DECIMAL = 1e6; // 6 decimals

    constructor(
        address acceptToken, 
        address owner, 
        address priceAggregator, 
        address depositRoleAccount
    ) EIP712("PolarDepositContract", "1.0.0") {
        _acceptToken = acceptToken;
        priceFeed = AggregatorV3Interface(priceAggregator);
        _setupRole(DEFAULT_ADMIN_ROLE, owner);
        _setupRole(DEPOSIT_ROLE, depositRoleAccount);
    }

    /**
    @dev Setup deposit role
     */
    function setupDepositRole(address account) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _grantRole(DEPOSIT_ROLE, account);
    }
    
    /**
     * @dev Return nonce
     */
    function getAccountNonce(address account) external view returns(uint256) {
        return _accountNonces[account];
    }

    /**
    @dev Deposit Token
    @param quantity NFT items quantity
    @param amount deposit token amount
    @param deadline deposit deadline
    @param signature hashed signature
    * Contract can not execute this function
    */
    function depositToken(
        uint256 quantity, 
        uint256 amount, 
        uint256 deadline, 
        uint256 status, 
        bool isWhitelisted,
        bytes calldata signature
    ) external {
        require(_msgSender() == tx.origin, "Contract address is not allowed");
        require(block.timestamp <= deadline, "Invalid expiration in deposit");
        require(status > 0, "Sale is not started yet");
        if(status == 1 && !isWhitelisted) revert NotAllowedInPrivateSale(_msgSender());
        uint256 validNonce = _accountNonces[_msgSender()];
        require(_verify(_hash(_msgSender(), quantity, amount, deadline, validNonce, status, isWhitelisted), signature), "Invalid signature");

        unchecked {
            ++ _accountNonces[_msgSender()];
        }
        IERC20(_acceptToken).safeTransferFrom(_msgSender(), address(this), amount);
        emit DepositedToken(_acceptToken, _msgSender(), quantity, status, amount);
    }
    
    function depositNativeToken() payable external {
        ( , int nativeTokenPrice, , , ) = priceFeed.latestRoundData();

        uint depositedTokenPriceInUsd = msg.value * uint(nativeTokenPrice) / 1 ether;
        uint quantity = depositedTokenPriceInUsd * 1e3 * QUANTITY_DECIMAL / PUBLIC_SALE_PRICE / 1e8;
        // Send zero address to indicate native token
        emit DepositedToken(address(0), _msgSender(), quantity, 2, msg.value);
    }

    function _hash(address account, uint256 quantity, uint256 amount, uint256 deadline, uint256 nonce, uint256 status, bool isWhitelisted)
    internal view returns (bytes32)
    {
        return _hashTypedDataV4(keccak256(abi.encode(
            DEPOSIT_TYPEHASH,
            account,
            quantity,
            amount,
            deadline,
            nonce,
            status,
            isWhitelisted
        )));
    }

    function _verify(bytes32 digest, bytes memory signature)
    internal view returns (bool)
    {
        return hasRole(DEPOSIT_ROLE, ECDSA.recover(digest, signature));
    }

    /**
    @dev Withdraw Token
    * only Admin can execute this function
     */
    function withdrawToken(address recipient, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        IERC20(_acceptToken).safeTransfer(recipient, amount);
        emit WithdrawedToken(_acceptToken, recipient, amount);
    }

    /// @dev Withdraw native token
    function withdrawNativeToken(address recipient, uint256 amount) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(address(this).balance >= amount, "Not enough balance");
        (bool sent, ) = payable(recipient).call{value: amount}("");
        require(sent, "Failed to send Native Token");
        emit WithdrawedToken(address(0), recipient, amount);
    }
}

File 2 of 12 : 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 3 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

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

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

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

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 12 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 5 of 12 : draft-EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

File 6 of 12 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
    }

    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");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' 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) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        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.
            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 if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } 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 (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // 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 7 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 12 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 9 of 12 : 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 12 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 11 of 12 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 12 of 12 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"acceptToken","type":"address"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"priceAggregator","type":"address"},{"internalType":"address","name":"depositRoleAccount","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"InvalidPrivateSaleAddress","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"NotAllowedInPrivateSale","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"status","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawedToken","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_SALE_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"QUANTITY_DECIMAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"depositNativeToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"status","type":"uint256"},{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"depositToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"setupDepositRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawNativeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101606040523480156200001257600080fd5b5060405162001d1038038062001d10833981016040819052620000359162000271565b604080518082018252601481527f506f6c61724465706f736974436f6e74726163740000000000000000000000006020808301918252835180850190945260058452640312e302e360dc1b908401528151902060e08190527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c6101008190524660a0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6200012c8184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6080523060c05261012052505050506001600160a01b0384811661014052600180546001600160a01b0319169184169190911790556200016e600084620001a4565b6200019a7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238482620001a4565b50505050620002ce565b620001b08282620001b4565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001b0576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002103390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200026c57600080fd5b919050565b600080600080608085870312156200028857600080fd5b620002938562000254565b9350620002a36020860162000254565b9250620002b36040860162000254565b9150620002c36060860162000254565b905092959194509250565b60805160a05160c05160e0516101005161012051610140516119d26200033e6000396000818161061c015281816106660152818161095d015261099001526000611078015260006110c7015260006110a201526000610ffb015260006110250152600061104f01526119d26000f3fe6080604052600436106100fe5760003560e01c8063536c6bfa11610095578063a217fddf11610064578063a217fddf146102bd578063bb25436b146102d2578063d126199f146102e9578063d547741f1461031f578063eea16b841461033f57600080fd5b8063536c6bfa1461025557806379433d8b1461027557806391d148541461027d5780639e281a981461029d57600080fd5b8063353efdcf116100d1578063353efdcf146101ad57806336568abe146101e157806348825e94146102015780634edb86eb1461023557600080fd5b806301ffc9a71461010357806307e89ec014610138578063248a9ca31461015b5780632f2ff15d1461018b575b600080fd5b34801561010f57600080fd5b5061012361011e3660046115e0565b61035f565b60405190151581526020015b60405180910390f35b34801561014457600080fd5b5061014d601981565b60405190815260200161012f565b34801561016757600080fd5b5061014d61017636600461160a565b60009081526020819052604090206001015490565b34801561019757600080fd5b506101ab6101a636600461163f565b610396565b005b3480156101b957600080fd5b5061014d7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238481565b3480156101ed57600080fd5b506101ab6101fc36600461163f565b6103c0565b34801561020d57600080fd5b5061014d7f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d81565b34801561024157600080fd5b506101ab610250366004611679565b610443565b34801561026157600080fd5b506101ab610270366004611725565b6106c3565b6101ab6107fd565b34801561028957600080fd5b5061012361029836600461163f565b61091c565b3480156102a957600080fd5b506101ab6102b8366004611725565b610945565b3480156102c957600080fd5b5061014d600081565b3480156102de57600080fd5b5061014d620f424081565b3480156102f557600080fd5b5061014d61030436600461174f565b6001600160a01b031660009081526002602052604090205490565b34801561032b57600080fd5b506101ab61033a36600461163f565b6109e9565b34801561034b57600080fd5b506101ab61035a36600461174f565b610a0e565b60006001600160e01b03198216637965db0b60e01b148061039057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546103b181610a43565b6103bb8383610a50565b505050565b6001600160a01b03811633146104355760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61043f8282610ad4565b5050565b3332146104925760405162461bcd60e51b815260206004820152601f60248201527f436f6e74726163742061646472657373206973206e6f7420616c6c6f77656400604482015260640161042c565b844211156104e25760405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642065787069726174696f6e20696e206465706f736974000000604482015260640161042c565b600084116105325760405162461bcd60e51b815260206004820152601760248201527f53616c65206973206e6f74207374617274656420796574000000000000000000604482015260640161042c565b836001148015610540575082155b156105605760405163051d131f60e31b815233600482015260240161042c565b33600081815260026020526040902054906105c090610584908a8a8a868b8b610b39565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610bd292505050565b6106005760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015260640161042c565b3360008181526002602052604090208054600101905561064c907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690308a610c09565b6040805189815260208101879052808201899052905133917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d9181900360600190a35050505050505050565b60006106ce81610a43565b814710156107135760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015260640161042c565b6000836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610760576040519150601f19603f3d011682016040523d82523d6000602084013e610765565b606091505b50509050806107b65760405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64204e617469766520546f6b656e0000000000604482015260640161042c565b6040518381526001600160a01b038516906000907f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a259060200160405180910390a350505050565b60015460408051633fabe5a360e21b815290516000926001600160a01b03169163feaf968c9160048083019260a09291908290030181865afa158015610847573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086b9190611784565b5050509150506000670de0b6b3a7640000823461088891906117ea565b6108929190611809565b905060006305f5e1006019620f42406108ad856103e86117ea565b6108b791906117ea565b6108c19190611809565b6108cb9190611809565b6040805182815260026020820152349181019190915290915033906000907faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d906060015b60405180910390a3505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600061095081610a43565b6109846001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168484610c7a565b826001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a258460405161090f91815260200190565b600082815260208190526040902060010154610a0481610a43565b6103bb8383610ad4565b6000610a1981610a43565b61043f7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238483610a50565b610a4d8133610caa565b50565b610a5a828261091c565b61043f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a903390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610ade828261091c565b1561043f576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080517f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d60208201526001600160a01b03891691810191909152606081018790526080810186905260a0810185905260c0810184905260e08101839052811515610100820152600090610bc6906101200160405160208183030381529060405280519060200120610d0e565b98975050505050505050565b6000610c027f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd23846102988585610d5c565b9392505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610c749085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610d80565b50505050565b6040516001600160a01b0383166024820152604481018290526103bb90849063a9059cbb60e01b90606401610c3d565b610cb4828261091c565b61043f57610ccc816001600160a01b03166014610e52565b610cd7836020610e52565b604051602001610ce892919061184f565b60408051601f198184030181529082905262461bcd60e51b825261042c916004016118c4565b6000610390610d1b610fee565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610d6b8585611115565b91509150610d7881611183565b509392505050565b6000610dd5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113399092919063ffffffff16565b8051909150156103bb5780806020019051810190610df391906118f7565b6103bb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161042c565b60606000610e618360026117ea565b610e6c906002611914565b67ffffffffffffffff811115610e8457610e84611927565b6040519080825280601f01601f191660200182016040528015610eae576020820181803683370190505b509050600360fc1b81600081518110610ec957610ec961193d565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610ef857610ef861193d565b60200101906001600160f81b031916908160001a9053506000610f1c8460026117ea565b610f27906001611914565b90505b6001811115610f9f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610f5b57610f5b61193d565b1a60f81b828281518110610f7157610f7161193d565b60200101906001600160f81b031916908160001a90535060049490941c93610f9881611953565b9050610f2a565b508315610c025760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161042c565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561104757507f000000000000000000000000000000000000000000000000000000000000000046145b1561107157507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b600080825160410361114b5760208301516040840151606085015160001a61113f87828585611350565b9450945050505061117c565b8251604003611174576020830151604084015161116986838361143d565b93509350505061117c565b506000905060025b9250929050565b60008160048111156111975761119761196a565b0361119f5750565b60018160048111156111b3576111b361196a565b036112005760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161042c565b60028160048111156112145761121461196a565b036112615760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161042c565b60038160048111156112755761127561196a565b036112cd5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161042c565b60048160048111156112e1576112e161196a565b03610a4d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161042c565b60606113488484600085611476565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113875750600090506003611434565b8460ff16601b1415801561139f57508460ff16601c14155b156113b05750600090506004611434565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611404573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661142d57600060019250925050611434565b9150600090505b94509492505050565b6000806001600160ff1b0383168161145a60ff86901c601b611914565b905061146887828885611350565b935093505050935093915050565b6060824710156114d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161042c565b6001600160a01b0385163b61152e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161042c565b600080866001600160a01b0316858760405161154a9190611980565b60006040518083038185875af1925050503d8060008114611587576040519150601f19603f3d011682016040523d82523d6000602084013e61158c565b606091505b509150915061159c8282866115a7565b979650505050505050565b606083156115b6575081610c02565b8251156115c65782518084602001fd5b8160405162461bcd60e51b815260040161042c91906118c4565b6000602082840312156115f257600080fd5b81356001600160e01b031981168114610c0257600080fd5b60006020828403121561161c57600080fd5b5035919050565b80356001600160a01b038116811461163a57600080fd5b919050565b6000806040838503121561165257600080fd5b8235915061166260208401611623565b90509250929050565b8015158114610a4d57600080fd5b600080600080600080600060c0888a03121561169457600080fd5b8735965060208801359550604088013594506060880135935060808801356116bb8161166b565b925060a088013567ffffffffffffffff808211156116d857600080fd5b818a0191508a601f8301126116ec57600080fd5b8135818111156116fb57600080fd5b8b602082850101111561170d57600080fd5b60208301945080935050505092959891949750929550565b6000806040838503121561173857600080fd5b61174183611623565b946020939093013593505050565b60006020828403121561176157600080fd5b610c0282611623565b805169ffffffffffffffffffff8116811461163a57600080fd5b600080600080600060a0868803121561179c57600080fd5b6117a58661176a565b94506020860151935060408601519250606086015191506117c86080870161176a565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611804576118046117d4565b500290565b60008261182657634e487b7160e01b600052601260045260246000fd5b500490565b60005b8381101561184657818101518382015260200161182e565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161188781601785016020880161182b565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516118b881602884016020880161182b565b01602801949350505050565b60208152600082518060208401526118e381604085016020870161182b565b601f01601f19169190910160400192915050565b60006020828403121561190957600080fd5b8151610c028161166b565b80820180821115610390576103906117d4565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081611962576119626117d4565b506000190190565b634e487b7160e01b600052602160045260246000fd5b6000825161199281846020870161182b565b919091019291505056fea26469706673582212207333ca7e89ca8696683827f5a80b37377a7100b6525a9fe3fca430beff518be364736f6c63430008100033000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000028d78c4108ff7201cd3ce857dc246100fc7c6bac0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b841900000000000000000000000060f433b642b0f6da7838f981c1f2e3925c627467

Deployed Bytecode

0x6080604052600436106100fe5760003560e01c8063536c6bfa11610095578063a217fddf11610064578063a217fddf146102bd578063bb25436b146102d2578063d126199f146102e9578063d547741f1461031f578063eea16b841461033f57600080fd5b8063536c6bfa1461025557806379433d8b1461027557806391d148541461027d5780639e281a981461029d57600080fd5b8063353efdcf116100d1578063353efdcf146101ad57806336568abe146101e157806348825e94146102015780634edb86eb1461023557600080fd5b806301ffc9a71461010357806307e89ec014610138578063248a9ca31461015b5780632f2ff15d1461018b575b600080fd5b34801561010f57600080fd5b5061012361011e3660046115e0565b61035f565b60405190151581526020015b60405180910390f35b34801561014457600080fd5b5061014d601981565b60405190815260200161012f565b34801561016757600080fd5b5061014d61017636600461160a565b60009081526020819052604090206001015490565b34801561019757600080fd5b506101ab6101a636600461163f565b610396565b005b3480156101b957600080fd5b5061014d7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238481565b3480156101ed57600080fd5b506101ab6101fc36600461163f565b6103c0565b34801561020d57600080fd5b5061014d7f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d81565b34801561024157600080fd5b506101ab610250366004611679565b610443565b34801561026157600080fd5b506101ab610270366004611725565b6106c3565b6101ab6107fd565b34801561028957600080fd5b5061012361029836600461163f565b61091c565b3480156102a957600080fd5b506101ab6102b8366004611725565b610945565b3480156102c957600080fd5b5061014d600081565b3480156102de57600080fd5b5061014d620f424081565b3480156102f557600080fd5b5061014d61030436600461174f565b6001600160a01b031660009081526002602052604090205490565b34801561032b57600080fd5b506101ab61033a36600461163f565b6109e9565b34801561034b57600080fd5b506101ab61035a36600461174f565b610a0e565b60006001600160e01b03198216637965db0b60e01b148061039057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546103b181610a43565b6103bb8383610a50565b505050565b6001600160a01b03811633146104355760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61043f8282610ad4565b5050565b3332146104925760405162461bcd60e51b815260206004820152601f60248201527f436f6e74726163742061646472657373206973206e6f7420616c6c6f77656400604482015260640161042c565b844211156104e25760405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642065787069726174696f6e20696e206465706f736974000000604482015260640161042c565b600084116105325760405162461bcd60e51b815260206004820152601760248201527f53616c65206973206e6f74207374617274656420796574000000000000000000604482015260640161042c565b836001148015610540575082155b156105605760405163051d131f60e31b815233600482015260240161042c565b33600081815260026020526040902054906105c090610584908a8a8a868b8b610b39565b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610bd292505050565b6106005760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015260640161042c565b3360008181526002602052604090208054600101905561064c907f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b031690308a610c09565b6040805189815260208101879052808201899052905133917f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b0316917faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d9181900360600190a35050505050505050565b60006106ce81610a43565b814710156107135760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b604482015260640161042c565b6000836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610760576040519150601f19603f3d011682016040523d82523d6000602084013e610765565b606091505b50509050806107b65760405162461bcd60e51b815260206004820152601b60248201527f4661696c656420746f2073656e64204e617469766520546f6b656e0000000000604482015260640161042c565b6040518381526001600160a01b038516906000907f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a259060200160405180910390a350505050565b60015460408051633fabe5a360e21b815290516000926001600160a01b03169163feaf968c9160048083019260a09291908290030181865afa158015610847573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086b9190611784565b5050509150506000670de0b6b3a7640000823461088891906117ea565b6108929190611809565b905060006305f5e1006019620f42406108ad856103e86117ea565b6108b791906117ea565b6108c19190611809565b6108cb9190611809565b6040805182815260026020820152349181019190915290915033906000907faeb7dfde5847914a0b1021473b079501e5ef6515ff9d5d715b394ba9f0ec492d906060015b60405180910390a3505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600061095081610a43565b6109846001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48168484610c7a565b826001600160a01b03167f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb486001600160a01b03167f831b761adc67e6d0ff0ee6c930a7ff8af83c2dfece4a584fca7e7e8dd2b70a258460405161090f91815260200190565b600082815260208190526040902060010154610a0481610a43565b6103bb8383610ad4565b6000610a1981610a43565b61043f7f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd238483610a50565b610a4d8133610caa565b50565b610a5a828261091c565b61043f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610a903390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610ade828261091c565b1561043f576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080517f401501d56d1d5ee8acdb0a163eb7dc6e6a78fc43426d2c9f100abee62de2933d60208201526001600160a01b03891691810191909152606081018790526080810186905260a0810185905260c0810184905260e08101839052811515610100820152600090610bc6906101200160405160208183030381529060405280519060200120610d0e565b98975050505050505050565b6000610c027f2561bf26f818282a3be40719542054d2173eb0d38539e8a8d3cff22f29fd23846102988585610d5c565b9392505050565b6040516001600160a01b0380851660248301528316604482015260648101829052610c749085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610d80565b50505050565b6040516001600160a01b0383166024820152604481018290526103bb90849063a9059cbb60e01b90606401610c3d565b610cb4828261091c565b61043f57610ccc816001600160a01b03166014610e52565b610cd7836020610e52565b604051602001610ce892919061184f565b60408051601f198184030181529082905262461bcd60e51b825261042c916004016118c4565b6000610390610d1b610fee565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000610d6b8585611115565b91509150610d7881611183565b509392505050565b6000610dd5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166113399092919063ffffffff16565b8051909150156103bb5780806020019051810190610df391906118f7565b6103bb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161042c565b60606000610e618360026117ea565b610e6c906002611914565b67ffffffffffffffff811115610e8457610e84611927565b6040519080825280601f01601f191660200182016040528015610eae576020820181803683370190505b509050600360fc1b81600081518110610ec957610ec961193d565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610ef857610ef861193d565b60200101906001600160f81b031916908160001a9053506000610f1c8460026117ea565b610f27906001611914565b90505b6001811115610f9f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610f5b57610f5b61193d565b1a60f81b828281518110610f7157610f7161193d565b60200101906001600160f81b031916908160001a90535060049490941c93610f9881611953565b9050610f2a565b508315610c025760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161042c565b6000306001600160a01b037f000000000000000000000000d2b8805d08dcaba2bcbe63372ea0c75a690c85131614801561104757507f000000000000000000000000000000000000000000000000000000000000000146145b1561107157507fc6a967fb1050a250080a5871a257b4891e90339298070c03ba3fd2e52601068490565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f04c03e7a74bad61579c63978269e400830f6c136b8073d193e28062755791b22828401527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b600080825160410361114b5760208301516040840151606085015160001a61113f87828585611350565b9450945050505061117c565b8251604003611174576020830151604084015161116986838361143d565b93509350505061117c565b506000905060025b9250929050565b60008160048111156111975761119761196a565b0361119f5750565b60018160048111156111b3576111b361196a565b036112005760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161042c565b60028160048111156112145761121461196a565b036112615760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161042c565b60038160048111156112755761127561196a565b036112cd5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161042c565b60048160048111156112e1576112e161196a565b03610a4d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161042c565b60606113488484600085611476565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156113875750600090506003611434565b8460ff16601b1415801561139f57508460ff16601c14155b156113b05750600090506004611434565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611404573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661142d57600060019250925050611434565b9150600090505b94509492505050565b6000806001600160ff1b0383168161145a60ff86901c601b611914565b905061146887828885611350565b935093505050935093915050565b6060824710156114d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161042c565b6001600160a01b0385163b61152e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161042c565b600080866001600160a01b0316858760405161154a9190611980565b60006040518083038185875af1925050503d8060008114611587576040519150601f19603f3d011682016040523d82523d6000602084013e61158c565b606091505b509150915061159c8282866115a7565b979650505050505050565b606083156115b6575081610c02565b8251156115c65782518084602001fd5b8160405162461bcd60e51b815260040161042c91906118c4565b6000602082840312156115f257600080fd5b81356001600160e01b031981168114610c0257600080fd5b60006020828403121561161c57600080fd5b5035919050565b80356001600160a01b038116811461163a57600080fd5b919050565b6000806040838503121561165257600080fd5b8235915061166260208401611623565b90509250929050565b8015158114610a4d57600080fd5b600080600080600080600060c0888a03121561169457600080fd5b8735965060208801359550604088013594506060880135935060808801356116bb8161166b565b925060a088013567ffffffffffffffff808211156116d857600080fd5b818a0191508a601f8301126116ec57600080fd5b8135818111156116fb57600080fd5b8b602082850101111561170d57600080fd5b60208301945080935050505092959891949750929550565b6000806040838503121561173857600080fd5b61174183611623565b946020939093013593505050565b60006020828403121561176157600080fd5b610c0282611623565b805169ffffffffffffffffffff8116811461163a57600080fd5b600080600080600060a0868803121561179c57600080fd5b6117a58661176a565b94506020860151935060408601519250606086015191506117c86080870161176a565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611804576118046117d4565b500290565b60008261182657634e487b7160e01b600052601260045260246000fd5b500490565b60005b8381101561184657818101518382015260200161182e565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161188781601785016020880161182b565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516118b881602884016020880161182b565b01602801949350505050565b60208152600082518060208401526118e381604085016020870161182b565b601f01601f19169190910160400192915050565b60006020828403121561190957600080fd5b8151610c028161166b565b80820180821115610390576103906117d4565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081611962576119626117d4565b506000190190565b634e487b7160e01b600052602160045260246000fd5b6000825161199281846020870161182b565b919091019291505056fea26469706673582212207333ca7e89ca8696683827f5a80b37377a7100b6525a9fe3fca430beff518be364736f6c63430008100033

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

000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000028d78c4108ff7201cd3ce857dc246100fc7c6bac0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b841900000000000000000000000060f433b642b0f6da7838f981c1f2e3925c627467

-----Decoded View---------------
Arg [0] : acceptToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [1] : owner (address): 0x28d78C4108FF7201cd3CE857dC246100fC7c6BAc
Arg [2] : priceAggregator (address): 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
Arg [3] : depositRoleAccount (address): 0x60F433b642B0f6dA7838f981C1F2E3925c627467

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [1] : 00000000000000000000000028d78c4108ff7201cd3ce857dc246100fc7c6bac
Arg [2] : 0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [3] : 00000000000000000000000060f433b642b0f6da7838f981c1f2e3925c627467


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  ]
[ 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.