ETH Price: $3,789.67 (+3.50%)
Gas: 6 Gwei

Contract

0x80AdCc91426e04CE5Ec9A75B670B2203737bDA6c
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Buy Mystery Box197815982024-05-02 9:39:1119 days ago1714642751IN
0x80AdCc91...3737bDA6c
0 ETH0.001774638.13929135
Buy Mystery Box197813592024-05-02 8:51:1119 days ago1714639871IN
0x80AdCc91...3737bDA6c
0 ETH0.001662837.06746213
Buy Mystery Box197749722024-05-01 11:26:3520 days ago1714562795IN
0x80AdCc91...3737bDA6c
0 ETH0.002383688.84550037
Buy Mystery Box197722282024-05-01 2:13:5920 days ago1714529639IN
0x80AdCc91...3737bDA6c
0 ETH0.002613497.77558082
Buy Mystery Box197708242024-04-30 21:31:4721 days ago1714512707IN
0x80AdCc91...3737bDA6c
0 ETH0.002496678.2196299
Buy Mystery Box197706012024-04-30 20:46:5921 days ago1714510019IN
0x80AdCc91...3737bDA6c
0 ETH0.002307469.7734223
Buy Mystery Box197700692024-04-30 18:59:1121 days ago1714503551IN
0x80AdCc91...3737bDA6c
0 ETH0.00319310.9753533
Buy Mystery Box197693362024-04-30 16:31:5921 days ago1714494719IN
0x80AdCc91...3737bDA6c
0 ETH0.0042632218.0210571
Buy Mystery Box197693292024-04-30 16:30:3521 days ago1714494635IN
0x80AdCc91...3737bDA6c
0 ETH0.0064228817.72725479
Buy Mystery Box197693102024-04-30 16:26:4721 days ago1714494407IN
0x80AdCc91...3737bDA6c
0 ETH0.0027047115.57691669
Buy Mystery Box197685752024-04-30 13:58:5921 days ago1714485539IN
0x80AdCc91...3737bDA6c
0 ETH0.0057767720.15762715
Buy Mystery Box197675822024-04-30 10:38:5921 days ago1714473539IN
0x80AdCc91...3737bDA6c
0 ETH0.003432669.47419269
Buy Mystery Box197675632024-04-30 10:35:1121 days ago1714473311IN
0x80AdCc91...3737bDA6c
0 ETH0.0039883210.96246567
Buy Mystery Box197670602024-04-30 8:53:3521 days ago1714467215IN
0x80AdCc91...3737bDA6c
0 ETH0.0043484512.06000446
Buy Mystery Box197670592024-04-30 8:53:2321 days ago1714467203IN
0x80AdCc91...3737bDA6c
0 ETH0.0040255111.88371316
Buy Mystery Box197670562024-04-30 8:52:4721 days ago1714467167IN
0x80AdCc91...3737bDA6c
0 ETH0.0046571812.89980212
Buy Mystery Box197670552024-04-30 8:52:3521 days ago1714467155IN
0x80AdCc91...3737bDA6c
0 ETH0.0046196512.86563862
Buy Mystery Box197670552024-04-30 8:52:3521 days ago1714467155IN
0x80AdCc91...3737bDA6c
0 ETH0.0046337812.865896
Buy Mystery Box197670522024-04-30 8:51:5921 days ago1714467119IN
0x80AdCc91...3737bDA6c
0 ETH0.0049575213.77531505
Buy Mystery Box197670502024-04-30 8:51:3521 days ago1714467095IN
0x80AdCc91...3737bDA6c
0 ETH0.005457114.93782974
Buy Mystery Box197670492024-04-30 8:51:2321 days ago1714467083IN
0x80AdCc91...3737bDA6c
0 ETH0.0050260415.13631215
Buy Mystery Box197670472024-04-30 8:50:5921 days ago1714467059IN
0x80AdCc91...3737bDA6c
0 ETH0.0044683914.99686408
Buy Mystery Box197670462024-04-30 8:50:4721 days ago1714467047IN
0x80AdCc91...3737bDA6c
0 ETH0.0048320413.42664197
Buy Mystery Box197670442024-04-30 8:50:2321 days ago1714467023IN
0x80AdCc91...3737bDA6c
0 ETH0.004338312.08208583
Buy Mystery Box197670432024-04-30 8:50:1121 days ago1714467011IN
0x80AdCc91...3737bDA6c
0 ETH0.004191412.62272806
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:
StonesDrop

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 15 : StonesDrop.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./interfaces/ICollectionV3.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/AggregatorInterface.sol";
import "./interfaces/IFarm.sol";

contract StonesDrop is ReentrancyGuard, AccessControl {
    /**  Events **/
    event MysteryBoxDropped(
        uint8 tier,
        address collection,
        uint256 id,
        address user,
        uint32 version
    );
    /** Structs **/
    struct Item {
        uint256 startTokenId;
        uint256 endTokenId;
        ICollectionV3 collection;
    }
    struct Tier {
        uint16 available;
        uint256 amount;
        uint16 rewards;
    }
    struct Purchase {
        uint256 amount;
        uint32 version;
    }
    /* Storage */
    mapping(address => Purchase) public bought;
    // General drop paramaters
    IFarm public stone;
    uint256 public maxPerWallet;
    uint256 public startTime;
    uint256 public endTime;
    Tier[] public tiers;

    // Tree data structure
    // About 40% gas cost reduction by using uint16. Limited to max 64K nfts.
    Item[] public items;
    uint16[] public tree;
    uint16 start_leaf;
    uint16 tree_length;
    uint32 current_version;

    address[] nftHolderAddresses;

    constructor() {
        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
        current_version = 0;
    }

    modifier isStarted() {
        require(
            startTime <= block.timestamp && endTime > block.timestamp,
            "Drop has not started yet!"
        );
        _;
    }

    /** Public functions **/
    /*
     * Get the number of available boxes for a tier
     */
    function getAvailable(uint8 _tier) public view returns (uint256) {
        if (_tier >= tiers.length) {
            return 0;
        }

        return tiers[_tier].available;
    }

    /*
     *This function picks random card and mints this random card to user
     */
    function buyMysteryBox(
        uint8 _tier,
        uint8 quantity
    ) external isStarted nonReentrant {
        address _user = _msgSender();
        require(_tier < tiers.length, "Invalid tier id");
        require(tiers[_tier].available >= quantity, "Sold out");

        if (bought[_user].version != current_version) {
            bought[_user].amount = 0;
            bought[_user].version = current_version;
        }
        require(
            bought[_user].amount + quantity <= maxPerWallet,
            "Limit per wallet reached"
        );
        bought[_user].amount += quantity;
        uint256 _amount = tiers[_tier].amount * quantity;
        uint256 _stones = stone.rewardedStones(_user);
        require(_stones >= _amount, "You do not have enough stones!");
        require(stone.payment(_user, _amount), "Payment was unsuccessful");
        tiers[_tier].available -= quantity;
        for (uint8 j = 0; j < quantity; j++) {
            for (uint256 i = 0; i < tiers[_tier].rewards; i++) {
                (ICollectionV3 collection, uint256 tokenId) = _pickNft(
                    j * quantity + i
                );
                mint(collection, _user, tokenId);
                emit MysteryBoxDropped(
                    _tier,
                    address(collection),
                    tokenId,
                    _user,
                    current_version
                );
            }
        }
    }

    function mint(
        ICollectionV3 collection,
        address user,
        uint256 tokenId
    ) internal {
        for (uint8 i = 0; i < nftHolderAddresses.length; i++) {
            if (collection.balanceOf(nftHolderAddresses[i], tokenId) > 0) {
                collection.safeTransferFrom(
                    nftHolderAddresses[i],
                    user,
                    tokenId,
                    1,
                    ""
                );
                return;
            }
        }
        collection.mint(user, tokenId);
    }

    function setNftHolderAddresses(
        address[] memory _nftHolderAddresses
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        delete nftHolderAddresses;
        for (uint8 i = 0; i < _nftHolderAddresses.length; i++) {
            nftHolderAddresses.push(_nftHolderAddresses[i]);
        }
    }

    /** Code for managing drop paramaters **/
    function setGeneralDropParamaters(
        address _stone,
        uint256 _maxPerWallet,
        uint256 _startTime,
        uint256 _endTime
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        stone = IFarm(_stone);
        maxPerWallet = _maxPerWallet;
        startTime = _startTime;
        endTime = _endTime;
    }

    function setTiersParamaters(
        Tier[] calldata _tiers
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        delete tiers;
        for (uint256 i = 0; i < _tiers.length; i++) {
            tiers.push(_tiers[i]);
        }
    }

    /** Code related to the tree structure used to store items in the pack **/
    function resetItems() public onlyRole(DEFAULT_ADMIN_ROLE) {
        delete items;
        start_leaf = 0;
        tree_length = 0;
        delete tree;
        current_version += 1;
    }

    function addItems(
        Item[] calldata _items
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        for (uint256 i = 0; i < _items.length; i++) {
            items.push(_items[i]);
        }
    }

    function preCompute() public onlyRole(DEFAULT_ADMIN_ROLE) {
        uint64 log;
        while (2 ** log < items.length) {
            log++;
        }
        start_leaf = uint16((2 ** log) - 1);
        tree_length = uint16(2 ** (log + 1) - 1);
        tree = new uint16[](tree_length);

        uint64 j = 0;
        for (
            uint64 i = uint64(start_leaf);
            (i < tree_length) && (j < items.length);
            i++
        ) {
            tree[i] = uint16(
                items[i - start_leaf].endTokenId -
                    items[i - start_leaf].startTokenId +
                    1
            );

            j++;
        }
        if (tree_length > 1) {
            for (uint256 i = (2 ** log) - 2; i >= 1; i--) {
                tree[i] = tree[2 * i + 1] + tree[2 * i + 2];
            }
            tree[0] = tree[1] + tree[2];
        }
    }

    function _pickNft(uint256 seed) internal returns (ICollectionV3, uint256) {
        uint16 position = uint16(_getRandom(tree[0], seed));
        uint16 item = _findPosition(position);

        _removeOne(item);
        require(
            items[item].startTokenId <= items[item].endTokenId,
            "Nft reward soldout"
        );
        uint256 tokenId = items[item].startTokenId;
        ICollectionV3 collection = items[item].collection;
        items[item].startTokenId += 1;
        return (collection, tokenId);
    }

    function _getRandom(
        uint256 gamerange,
        uint256 seed
    ) internal view returns (uint256) {
        return
            1 +
            (uint256(
                keccak256(
                    abi.encodePacked(
                        block.timestamp,
                        block.difficulty,
                        keccak256(abi.encodePacked(block.coinbase)),
                        seed
                    )
                )
            ) % gamerange);
    }

    function _findPosition(uint16 value) internal view returns (uint16) {
        uint16 i = 0;
        require(tree[0] >= value, "Value is bigger than remaining elements");

        while (2 * i + 2 < tree_length) {
            uint16 left = 2 * i + 1;
            uint16 right = 2 * i + 2;

            if (value <= tree[left]) {
                i = left;
            } else {
                i = right;
                value = value - tree[left];
            }
        }

        return i - start_leaf;
    }

    function _removeOne(uint16 position) internal {
        uint16 i = position + start_leaf;
        require(tree[i] > 0, "Element is already containing 0 values");

        tree[i]--;

        while (i > 0) {
            if (i % 2 == 1) {
                i++;
            }
            uint16 parent = (i / 2) - 1;
            tree[parent] = tree[i - 1] + tree[i];
            i = parent;
        }
    }
}

File 2 of 15 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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(account),
                        " 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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    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`.
     *
     * May emit a {RoleRevoked} event.
     */
    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.
     *
     * May emit a {RoleGranted} event.
     *
     * [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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

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

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

File 5 of 15 : 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 6 of 15 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 7 of 15 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 8 of 15 : 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 9 of 15 : 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);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

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

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

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

File 12 of 15 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 13 of 15 : AggregatorInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.12;

interface AggregatorInterface {
  function latestAnswer() external view returns (int256 answer);
}

File 14 of 15 : ICollectionV3.sol
// SPDX-License-Identifier: MIT
// Latest stable version of solidity
pragma solidity 0.8.12;

interface ICollectionV3 {
    function initialize(
        string memory uri,
        uint256 _total,
        uint256 _whitelistedStartTime,
        uint256 _startTime,
        uint256 _endTime,
        uint256 _amount,
        uint256 _percent,
        address _admin,
        address _facAddress
    ) external;

    function __CollectionV3_init_unchained(
        string memory uri,
        uint256 _total,
        uint256 _whitelistedStartTime,
        uint256 _startTime,
        uint256 _endTime,
        uint256 _amount,
        uint256 _percent,
        address _admin,
        address _facAddress
    ) external;

    function addExternalAddresses(
        address _token,
        address _stone,
        address _treasure
    ) external;

    function recoverToken(address _token) external;

    function changeOnlyWhitelisted(bool _status) external;

    function buy(address buyer, uint256 _id) external;

    function mint(address to, uint256 _id) external;

    function mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amount_
    ) external;

    function addPayees(
        address[] memory payees_,
        uint256[] memory sharePerc_
    ) external;

    function _addPayee(address account, uint256 sharePerc_) external;

    function release() external;

    function getAmountPer(uint256 sharePerc) external view returns (uint256);

    function calcPerc(
        uint256 _amount,
        uint256 _percent
    ) external pure returns (uint256);

    function calcTrasAndShare() external view returns (uint256, uint256);

    function setStarTime(uint256 _starTime) external;

    function setEndTime(uint256 _endTime) external;

    function setWhiteListUser(address _addr) external;

    function setBatchWhiteListUser(address[] calldata _addr) external;

    function setAmount(uint256 _amount) external;

    function delShare(address account) external;

    function totalReleased() external view returns (uint256);

    function released(address account) external view returns (uint256);

    function shares(address account) external view returns (uint256);

    function allShares() external view returns (address[] memory);

    function available() external view returns (uint256);

    function balanceOf(
        address account,
        uint256 id
    ) external view returns (uint256);

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) external;
}

File 15 of 15 : IFarm.sol
// SPDX-License-Identifier: MIT
// Latest stable version of solidity
pragma solidity 0.8.12;

interface IFarm {
    function payment(address buyer, uint256 amount) external returns (bool);

    function rewardedStones(address staker) external view returns (uint256);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"tier","type":"uint8"},{"indexed":false,"internalType":"address","name":"collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint32","name":"version","type":"uint32"}],"name":"MysteryBoxDropped","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"startTokenId","type":"uint256"},{"internalType":"uint256","name":"endTokenId","type":"uint256"},{"internalType":"contract ICollectionV3","name":"collection","type":"address"}],"internalType":"struct StonesDrop.Item[]","name":"_items","type":"tuple[]"}],"name":"addItems","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"bought","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"version","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_tier","type":"uint8"},{"internalType":"uint8","name":"quantity","type":"uint8"}],"name":"buyMysteryBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_tier","type":"uint8"}],"name":"getAvailable","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":"uint256","name":"","type":"uint256"}],"name":"items","outputs":[{"internalType":"uint256","name":"startTokenId","type":"uint256"},{"internalType":"uint256","name":"endTokenId","type":"uint256"},{"internalType":"contract ICollectionV3","name":"collection","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preCompute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetItems","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":"_stone","type":"address"},{"internalType":"uint256","name":"_maxPerWallet","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"}],"name":"setGeneralDropParamaters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_nftHolderAddresses","type":"address[]"}],"name":"setNftHolderAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint16","name":"available","type":"uint16"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint16","name":"rewards","type":"uint16"}],"internalType":"struct StonesDrop.Tier[]","name":"_tiers","type":"tuple[]"}],"name":"setTiersParamaters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stone","outputs":[{"internalType":"contract IFarm","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint16","name":"available","type":"uint16"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint16","name":"rewards","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tree","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600160009081556100229033610037565b600a805463ffffffff60201b191690556100bf565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166100bb5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45b5050565b61268b80620000cf6000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c80634196d0b8116100c3578063a217fddf1161007c578063a217fddf14610331578063acec599e14610339578063bfb231d214610341578063d547741f14610378578063d5f1c5aa1461038b578063dc3175501461039e57600080fd5b80634196d0b81461029f578063453c2310146102b2578063457110e8146102bb578063667022fd146102ce57806378e979251461031557806391d148541461031e57600080fd5b8063248a9ca311610115578063248a9ca3146102135780632f2ff15d14610237578063313529361461024a5780633197cbb61461027057806336568abe146102795780633c6f38291461028c57600080fd5b80630167eb851461015257806301ffc9a714610182578063039af9eb146101a5578063142cbfe4146101dd5780631e1a0c0c146101f2575b600080fd5b600354610165906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610195610190366004611e6c565b6103a6565b6040519015158152602001610179565b6101b86101b3366004611e96565b6103dd565b6040805161ffff94851681526020810193909352921691810191909152606001610179565b6101f06101eb366004611ec5565b610416565b005b610205610200366004611ef8565b61098f565b604051908152602001610179565b610205610221366004611e96565b6000908152600160208190526040909120015490565b6101f0610245366004611f33565b6109d7565b61025d610258366004611e96565b610a02565b60405161ffff9091168152602001610179565b61020560065481565b6101f0610287366004611f33565b610a3a565b6101f061029a366004611f79565b610ab4565b6101f06102ad366004612088565b610b3e565b61020560045481565b6101f06102c9366004612088565b610bbd565b6102fb6102dc3660046120c9565b6002602052600090815260409020805460019091015463ffffffff1682565b6040805192835263ffffffff909116602083015201610179565b61020560055481565b61019561032c366004611f33565b610c2a565b610205600081565b6101f0610c55565b61035461034f366004611e96565b610cc8565b6040805193845260208401929092526001600160a01b031690820152606001610179565b6101f0610386366004611f33565b610d04565b6101f06103993660046120e6565b610d2a565b6101f0610d65565b60006001600160e01b03198216637965db0b60e01b14806103d757506301ffc9a760e01b6001600160e01b03198316145b92915050565b600781815481106103ed57600080fd5b600091825260209091206003909102018054600182015460029092015461ffff91821693501683565b4260055411158015610429575042600654115b61047a5760405162461bcd60e51b815260206004820152601960248201527f44726f7020686173206e6f74207374617274656420796574210000000000000060448201526064015b60405180910390fd5b610482611191565b600754339060ff8416106104ca5760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1a595c881a59608a1b6044820152606401610471565b8160ff1660078460ff16815481106104e4576104e4612121565b600091825260209091206003909102015461ffff1610156105325760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b6044820152606401610471565b600a546001600160a01b03821660009081526002602052604090206001015463ffffffff90811664010000000090920416146105ac576001600160a01b0381166000908152600260205260408120908155600a546001909101805464010000000090920463ffffffff1663ffffffff199092169190911790555b6004546001600160a01b0382166000908152600260205260409020546105d69060ff85169061214d565b11156106245760405162461bcd60e51b815260206004820152601860248201527f4c696d6974207065722077616c6c6574207265616368656400000000000000006044820152606401610471565b6001600160a01b0381166000908152600260205260408120805460ff8516929061064f90849061214d565b9250508190555060008260ff1660078560ff168154811061067257610672612121565b90600052602060002090600302016001015461068e9190612165565b6003546040516375c7e97360e01b81526001600160a01b038581166004830152929350600092909116906375c7e97390602401602060405180830381865afa1580156106de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107029190612184565b9050818110156107545760405162461bcd60e51b815260206004820152601e60248201527f596f7520646f206e6f74206861766520656e6f7567682073746f6e65732100006044820152606401610471565b6003546040516367a09c2360e01b81526001600160a01b03858116600483015260248201859052909116906367a09c23906044016020604051808303816000875af11580156107a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cb919061219d565b6108175760405162461bcd60e51b815260206004820152601860248201527f5061796d656e742077617320756e7375636365737366756c00000000000000006044820152606401610471565b8360ff1660078660ff168154811061083157610831612121565b600091825260208220600390910201805490919061085490849061ffff166121bf565b92506101000a81548161ffff021916908361ffff16021790555060005b8460ff168160ff16101561097d5760005b60078760ff168154811061089857610898612121565b600091825260209091206002600390920201015461ffff1681101561096a576000806108da836108c88a876121e2565b60ff166108d5919061214d565b6111eb565b915091506108e9828883611394565b600a546040805160ff8c1681526001600160a01b038581166020830152918101849052908916606082015264010000000090910463ffffffff1660808201527fb48a3f4dab3b7d9c6a59f8fd2b97e1336ce85b34bc2c9bc96b59f964cfa7b0c39060a00160405180910390a1505080806109629061220b565b915050610882565b508061097581612226565b915050610871565b5050505061098b6001600055565b5050565b60075460009060ff8316106109a657506000919050565b60078260ff16815481106109bc576109bc612121565b600091825260209091206003909102015461ffff1692915050565b600082815260016020819052604090912001546109f381611579565b6109fd8383611586565b505050565b60098181548110610a1257600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b6001600160a01b0381163314610aaa5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610471565b61098b82826115f1565b6000610abf81611579565b610acb600b6000611cce565b60005b82518160ff1610156109fd57600b838260ff1681518110610af157610af1612121565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b0390921691909117905580610b3681612226565b915050610ace565b6000610b4981611579565b610b5560076000611cec565b60005b82811015610bb7576007848483818110610b7457610b74612121565b835460018101855560009485526020909420606090910292909201926003029091019050610ba2828261225a565b50508080610baf9061220b565b915050610b58565b50505050565b6000610bc881611579565b60005b82811015610bb7576008848483818110610be757610be7612121565b835460018101855560009485526020909420606090910292909201926003029091019050610c1582826122a9565b50508080610c229061220b565b915050610bcb565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610c6081611579565b610c6c60086000611d0d565b600a805463ffffffff19169055610c8560096000611d2e565b6001600a60048282829054906101000a900463ffffffff16610ca791906122e8565b92506101000a81548163ffffffff021916908363ffffffff16021790555050565b60088181548110610cd857600080fd5b60009182526020909120600390910201805460018201546002909201549092506001600160a01b031683565b60008281526001602081905260409091200154610d2081611579565b6109fd83836115f1565b6000610d3581611579565b50600380546001600160a01b0319166001600160a01b039590951694909417909355600491909155600555600655565b6000610d7081611579565b60005b600854610d818260026123ec565b1015610d995780610d9181612401565b915050610d73565b6001610da68260026123ec565b610db09190612428565b600a805461ffff191661ffff929092169190911790556001610dd2828261243f565b610ddd9060026123ec565b610de79190612428565b600a805463ffff000019166201000061ffff938416810291909117918290559004166001600160401b03811115610e2057610e20611f63565b604051908082528060200260200182016040528015610e49578160200160208202803683370190505b508051610e5e91600991602090910190611d53565b50600a5460009061ffff165b600a5462010000900461ffff166001600160401b038216108015610e9857506008546001600160401b038316105b15610f9b57600a54600890610eb19061ffff1683612461565b6001600160401b031681548110610eca57610eca612121565b6000918252602090912060039091020154600a54600890610eef9061ffff1684612461565b6001600160401b031681548110610f0857610f08612121565b906000526020600020906003020160010154610f249190612428565b610f2f90600161214d565b6009826001600160401b031681548110610f4b57610f4b612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508180610f8590612401565b9250508080610f9390612401565b915050610e6a565b50600a5460016201000090910461ffff1611156109fd5760006002610fc084826123ec565b610fca9190612428565b90505b600181106110ce576009610fe2826002612165565b610fed90600261214d565b81548110610ffd57610ffd612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff1660098260026110309190612165565b61103b90600161214d565b8154811061104b5761104b612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff166110799190612481565b6009828154811061108c5761108c612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555080806110c69061249e565b915050610fcd565b5060096002815481106110e3576110e3612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600960018154811061111b5761111b612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff166111499190612481565b600960008154811061115d5761115d612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550505050565b600260005414156111e45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610471565b6002600055565b600080600061122f600960008154811061120757611207612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff1685611658565b9050600061123c826116de565b905061124781611894565b60088161ffff168154811061125e5761125e612121565b90600052602060002090600302016001015460088261ffff168154811061128757611287612121565b90600052602060002090600302016000015411156112dc5760405162461bcd60e51b815260206004820152601260248201527113999d081c995dd85c99081cdbdb191bdd5d60721b6044820152606401610471565b600060088261ffff16815481106112f5576112f5612121565b9060005260206000209060030201600001549050600060088361ffff168154811061132257611322612121565b906000526020600020906003020160020160009054906101000a90046001600160a01b03169050600160088461ffff168154811061136257611362612121565b90600052602060002090600302016000016000828254611382919061214d565b90915550909791965090945050505050565b60005b600b5460ff82161015611511576000846001600160a01b031662fdd58e600b8460ff16815481106113ca576113ca612121565b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b03909116600482015260248101869052604401602060405180830381865afa158015611421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114459190612184565b11156114ff57836001600160a01b031663f242432a600b8360ff168154811061147057611470612121565b600091825260208220015460405160e084901b6001600160e01b03191681526001600160a01b0391821660048201529087166024820152604481018690526001606482015260a0608482015260a481019190915260c401600060405180830381600087803b1580156114e157600080fd5b505af11580156114f5573d6000803e3d6000fd5b5050505050505050565b8061150981612226565b915050611397565b506040516340c10f1960e01b81526001600160a01b038381166004830152602482018390528416906340c10f1990604401600060405180830381600087803b15801561155c57600080fd5b505af1158015611570573d6000803e3d6000fd5b50505050505050565b6115838133611ac8565b50565b6115908282610c2a565b61098b5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6115fb8282610c2a565b1561098b5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080514160601b6bffffffffffffffffffffffff191660208083019190915282516014818403018152603483018452805190820120426054840152446074840152609483015260b48083018590528351808403909101815260d490920190925280519101206000906116cc9084906124cb565b6116d790600161214d565b9392505050565b600080600090508261ffff1660096000815481106116fe576116fe612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff16101561177e5760405162461bcd60e51b815260206004820152602760248201527f56616c756520697320626967676572207468616e2072656d61696e696e6720656044820152666c656d656e747360c81b6064820152608401610471565b600a5462010000900461ffff166117968260026124df565b6117a1906002612481565b61ffff1610156118835760006117b88260026124df565b6117c3906001612481565b905060006117d28360026124df565b6117dd906002612481565b905060098261ffff16815481106117f6576117f6612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff168561ffff16116118305781925061187c565b80925060098261ffff168154811061184a5761184a612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff168561187991906121bf565b94505b505061177e565b600a546116d79061ffff16826121bf565b600a546000906118a89061ffff1683612481565b9050600060098261ffff16815481106118c3576118c3612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff16116119415760405162461bcd60e51b815260206004820152602660248201527f456c656d656e7420697320616c726561647920636f6e7461696e696e6720302060448201526576616c75657360d01b6064820152608401610471565b60098161ffff168154811061195857611958612121565b906000526020600020906010918282040191900660020281819054906101000a900461ffff168092919061198b90612509565b91906101000a81548161ffff021916908361ffff160217905550505b61ffff81161561098b576119bc600282612527565b61ffff16600114156119d657806119d281612548565b9150505b600060016119e5600284612560565b6119ef91906121bf565b905060098261ffff1681548110611a0857611a08612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff166009611a376001856121bf565b61ffff1681548110611a4b57611a4b612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff16611a799190612481565b60098261ffff1681548110611a9057611a90612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550809150506119a7565b611ad28282610c2a565b61098b57611adf81611b21565b611aea836020611b33565b604051602001611afb9291906125ad565b60408051601f198184030181529082905262461bcd60e51b825261047191600401612622565b60606103d76001600160a01b03831660145b60606000611b42836002612165565b611b4d90600261214d565b6001600160401b03811115611b6457611b64611f63565b6040519080825280601f01601f191660200182016040528015611b8e576020820181803683370190505b509050600360fc1b81600081518110611ba957611ba9612121565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611bd857611bd8612121565b60200101906001600160f81b031916908160001a9053506000611bfc846002612165565b611c0790600161214d565b90505b6001811115611c7f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611c3b57611c3b612121565b1a60f81b828281518110611c5157611c51612121565b60200101906001600160f81b031916908160001a90535060049490941c93611c788161249e565b9050611c0a565b5083156116d75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610471565b50805460008255906000526020600020908101906115839190611dfc565b50805460008255600302906000526020600020908101906115839190611e11565b50805460008255600302906000526020600020908101906115839190611e3f565b50805460008255600f0160109004906000526020600020908101906115839190611dfc565b82805482825590600052602060002090600f01601090048101928215611dec5791602002820160005b83821115611dbc57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611d7c565b8015611dea5782816101000a81549061ffff0219169055600201602081600101049283019260010302611dbc565b505b50611df8929150611dfc565b5090565b5b80821115611df85760008155600101611dfd565b5b80821115611df857805461ffff199081168255600060018301556002820180549091169055600301611e12565b5b80821115611df857600080825560018201556002810180546001600160a01b0319169055600301611e40565b600060208284031215611e7e57600080fd5b81356001600160e01b0319811681146116d757600080fd5b600060208284031215611ea857600080fd5b5035919050565b803560ff81168114611ec057600080fd5b919050565b60008060408385031215611ed857600080fd5b611ee183611eaf565b9150611eef60208401611eaf565b90509250929050565b600060208284031215611f0a57600080fd5b6116d782611eaf565b6001600160a01b038116811461158357600080fd5b8035611ec081611f13565b60008060408385031215611f4657600080fd5b823591506020830135611f5881611f13565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611f8c57600080fd5b82356001600160401b0380821115611fa357600080fd5b818501915085601f830112611fb757600080fd5b813581811115611fc957611fc9611f63565b8060051b604051601f19603f83011681018181108582111715611fee57611fee611f63565b60405291825284820192508381018501918883111561200c57600080fd5b938501935b828510156120315761202285611f28565b84529385019392850192612011565b98975050505050505050565b60008083601f84011261204f57600080fd5b5081356001600160401b0381111561206657600080fd5b60208301915083602060608302850101111561208157600080fd5b9250929050565b6000806020838503121561209b57600080fd5b82356001600160401b038111156120b157600080fd5b6120bd8582860161203d565b90969095509350505050565b6000602082840312156120db57600080fd5b81356116d781611f13565b600080600080608085870312156120fc57600080fd5b843561210781611f13565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561216057612160612137565b500190565b600081600019048311821515161561217f5761217f612137565b500290565b60006020828403121561219657600080fd5b5051919050565b6000602082840312156121af57600080fd5b815180151581146116d757600080fd5b600061ffff838116908316818110156121da576121da612137565b039392505050565b600060ff821660ff84168160ff048111821515161561220357612203612137565b029392505050565b600060001982141561221f5761221f612137565b5060010190565b600060ff821660ff81141561223d5761223d612137565b60010192915050565b6000813561ffff811681146103d757600080fd5b61227961226683612246565b825461ffff191661ffff91909116178255565b6020820135600182015561098b61229260408401612246565b6002830161ffff821661ffff198254161781555050565b81358155602082013560018201556002810160408301356122c981611f13565b81546001600160a01b0319166001600160a01b03919091161790555050565b600063ffffffff80831681851680830382111561230757612307612137565b01949350505050565b600181815b8085111561234b57816000190482111561233157612331612137565b8085161561233e57918102915b93841c9390800290612315565b509250929050565b600082612362575060016103d7565b8161236f575060006103d7565b8160018114612385576002811461238f576123ab565b60019150506103d7565b60ff8411156123a0576123a0612137565b50506001821b6103d7565b5060208310610133831016604e8410600b84101617156123ce575081810a6103d7565b6123d88383612310565b806000190482111561220357612203612137565b60006116d76001600160401b03841683612353565b60006001600160401b038083168181141561241e5761241e612137565b6001019392505050565b60008282101561243a5761243a612137565b500390565b60006001600160401b0380831681851680830382111561230757612307612137565b60006001600160401b03838116908316818110156121da576121da612137565b600061ffff80831681851680830382111561230757612307612137565b6000816124ad576124ad612137565b506000190190565b634e487b7160e01b600052601260045260246000fd5b6000826124da576124da6124b5565b500690565b600061ffff8083168185168183048111821515161561250057612500612137565b02949350505050565b600061ffff82168061251d5761251d612137565b6000190192915050565b600061ffff8084168061253c5761253c6124b5565b92169190910692915050565b600061ffff8083168181141561241e5761241e612137565b600061ffff80841680612575576125756124b5565b92169190910492915050565b60005b8381101561259c578181015183820152602001612584565b83811115610bb75750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516125e5816017850160208801612581565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612616816028840160208801612581565b01602801949350505050565b6020815260008251806020840152612641816040850160208701612581565b601f01601f1916919091016040019291505056fea2646970667358221220e0ed158a46428a527801e189279589df53294433d0b424492a412e25b159628864736f6c634300080c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80634196d0b8116100c3578063a217fddf1161007c578063a217fddf14610331578063acec599e14610339578063bfb231d214610341578063d547741f14610378578063d5f1c5aa1461038b578063dc3175501461039e57600080fd5b80634196d0b81461029f578063453c2310146102b2578063457110e8146102bb578063667022fd146102ce57806378e979251461031557806391d148541461031e57600080fd5b8063248a9ca311610115578063248a9ca3146102135780632f2ff15d14610237578063313529361461024a5780633197cbb61461027057806336568abe146102795780633c6f38291461028c57600080fd5b80630167eb851461015257806301ffc9a714610182578063039af9eb146101a5578063142cbfe4146101dd5780631e1a0c0c146101f2575b600080fd5b600354610165906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610195610190366004611e6c565b6103a6565b6040519015158152602001610179565b6101b86101b3366004611e96565b6103dd565b6040805161ffff94851681526020810193909352921691810191909152606001610179565b6101f06101eb366004611ec5565b610416565b005b610205610200366004611ef8565b61098f565b604051908152602001610179565b610205610221366004611e96565b6000908152600160208190526040909120015490565b6101f0610245366004611f33565b6109d7565b61025d610258366004611e96565b610a02565b60405161ffff9091168152602001610179565b61020560065481565b6101f0610287366004611f33565b610a3a565b6101f061029a366004611f79565b610ab4565b6101f06102ad366004612088565b610b3e565b61020560045481565b6101f06102c9366004612088565b610bbd565b6102fb6102dc3660046120c9565b6002602052600090815260409020805460019091015463ffffffff1682565b6040805192835263ffffffff909116602083015201610179565b61020560055481565b61019561032c366004611f33565b610c2a565b610205600081565b6101f0610c55565b61035461034f366004611e96565b610cc8565b6040805193845260208401929092526001600160a01b031690820152606001610179565b6101f0610386366004611f33565b610d04565b6101f06103993660046120e6565b610d2a565b6101f0610d65565b60006001600160e01b03198216637965db0b60e01b14806103d757506301ffc9a760e01b6001600160e01b03198316145b92915050565b600781815481106103ed57600080fd5b600091825260209091206003909102018054600182015460029092015461ffff91821693501683565b4260055411158015610429575042600654115b61047a5760405162461bcd60e51b815260206004820152601960248201527f44726f7020686173206e6f74207374617274656420796574210000000000000060448201526064015b60405180910390fd5b610482611191565b600754339060ff8416106104ca5760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1a595c881a59608a1b6044820152606401610471565b8160ff1660078460ff16815481106104e4576104e4612121565b600091825260209091206003909102015461ffff1610156105325760405162461bcd60e51b815260206004820152600860248201526714dbdb19081bdd5d60c21b6044820152606401610471565b600a546001600160a01b03821660009081526002602052604090206001015463ffffffff90811664010000000090920416146105ac576001600160a01b0381166000908152600260205260408120908155600a546001909101805464010000000090920463ffffffff1663ffffffff199092169190911790555b6004546001600160a01b0382166000908152600260205260409020546105d69060ff85169061214d565b11156106245760405162461bcd60e51b815260206004820152601860248201527f4c696d6974207065722077616c6c6574207265616368656400000000000000006044820152606401610471565b6001600160a01b0381166000908152600260205260408120805460ff8516929061064f90849061214d565b9250508190555060008260ff1660078560ff168154811061067257610672612121565b90600052602060002090600302016001015461068e9190612165565b6003546040516375c7e97360e01b81526001600160a01b038581166004830152929350600092909116906375c7e97390602401602060405180830381865afa1580156106de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107029190612184565b9050818110156107545760405162461bcd60e51b815260206004820152601e60248201527f596f7520646f206e6f74206861766520656e6f7567682073746f6e65732100006044820152606401610471565b6003546040516367a09c2360e01b81526001600160a01b03858116600483015260248201859052909116906367a09c23906044016020604051808303816000875af11580156107a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107cb919061219d565b6108175760405162461bcd60e51b815260206004820152601860248201527f5061796d656e742077617320756e7375636365737366756c00000000000000006044820152606401610471565b8360ff1660078660ff168154811061083157610831612121565b600091825260208220600390910201805490919061085490849061ffff166121bf565b92506101000a81548161ffff021916908361ffff16021790555060005b8460ff168160ff16101561097d5760005b60078760ff168154811061089857610898612121565b600091825260209091206002600390920201015461ffff1681101561096a576000806108da836108c88a876121e2565b60ff166108d5919061214d565b6111eb565b915091506108e9828883611394565b600a546040805160ff8c1681526001600160a01b038581166020830152918101849052908916606082015264010000000090910463ffffffff1660808201527fb48a3f4dab3b7d9c6a59f8fd2b97e1336ce85b34bc2c9bc96b59f964cfa7b0c39060a00160405180910390a1505080806109629061220b565b915050610882565b508061097581612226565b915050610871565b5050505061098b6001600055565b5050565b60075460009060ff8316106109a657506000919050565b60078260ff16815481106109bc576109bc612121565b600091825260209091206003909102015461ffff1692915050565b600082815260016020819052604090912001546109f381611579565b6109fd8383611586565b505050565b60098181548110610a1257600080fd5b9060005260206000209060109182820401919006600202915054906101000a900461ffff1681565b6001600160a01b0381163314610aaa5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610471565b61098b82826115f1565b6000610abf81611579565b610acb600b6000611cce565b60005b82518160ff1610156109fd57600b838260ff1681518110610af157610af1612121565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b0390921691909117905580610b3681612226565b915050610ace565b6000610b4981611579565b610b5560076000611cec565b60005b82811015610bb7576007848483818110610b7457610b74612121565b835460018101855560009485526020909420606090910292909201926003029091019050610ba2828261225a565b50508080610baf9061220b565b915050610b58565b50505050565b6000610bc881611579565b60005b82811015610bb7576008848483818110610be757610be7612121565b835460018101855560009485526020909420606090910292909201926003029091019050610c1582826122a9565b50508080610c229061220b565b915050610bcb565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610c6081611579565b610c6c60086000611d0d565b600a805463ffffffff19169055610c8560096000611d2e565b6001600a60048282829054906101000a900463ffffffff16610ca791906122e8565b92506101000a81548163ffffffff021916908363ffffffff16021790555050565b60088181548110610cd857600080fd5b60009182526020909120600390910201805460018201546002909201549092506001600160a01b031683565b60008281526001602081905260409091200154610d2081611579565b6109fd83836115f1565b6000610d3581611579565b50600380546001600160a01b0319166001600160a01b039590951694909417909355600491909155600555600655565b6000610d7081611579565b60005b600854610d818260026123ec565b1015610d995780610d9181612401565b915050610d73565b6001610da68260026123ec565b610db09190612428565b600a805461ffff191661ffff929092169190911790556001610dd2828261243f565b610ddd9060026123ec565b610de79190612428565b600a805463ffff000019166201000061ffff938416810291909117918290559004166001600160401b03811115610e2057610e20611f63565b604051908082528060200260200182016040528015610e49578160200160208202803683370190505b508051610e5e91600991602090910190611d53565b50600a5460009061ffff165b600a5462010000900461ffff166001600160401b038216108015610e9857506008546001600160401b038316105b15610f9b57600a54600890610eb19061ffff1683612461565b6001600160401b031681548110610eca57610eca612121565b6000918252602090912060039091020154600a54600890610eef9061ffff1684612461565b6001600160401b031681548110610f0857610f08612121565b906000526020600020906003020160010154610f249190612428565b610f2f90600161214d565b6009826001600160401b031681548110610f4b57610f4b612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508180610f8590612401565b9250508080610f9390612401565b915050610e6a565b50600a5460016201000090910461ffff1611156109fd5760006002610fc084826123ec565b610fca9190612428565b90505b600181106110ce576009610fe2826002612165565b610fed90600261214d565b81548110610ffd57610ffd612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff1660098260026110309190612165565b61103b90600161214d565b8154811061104b5761104b612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff166110799190612481565b6009828154811061108c5761108c612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff16021790555080806110c69061249e565b915050610fcd565b5060096002815481106110e3576110e3612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff16600960018154811061111b5761111b612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff166111499190612481565b600960008154811061115d5761115d612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550505050565b600260005414156111e45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610471565b6002600055565b600080600061122f600960008154811061120757611207612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff1685611658565b9050600061123c826116de565b905061124781611894565b60088161ffff168154811061125e5761125e612121565b90600052602060002090600302016001015460088261ffff168154811061128757611287612121565b90600052602060002090600302016000015411156112dc5760405162461bcd60e51b815260206004820152601260248201527113999d081c995dd85c99081cdbdb191bdd5d60721b6044820152606401610471565b600060088261ffff16815481106112f5576112f5612121565b9060005260206000209060030201600001549050600060088361ffff168154811061132257611322612121565b906000526020600020906003020160020160009054906101000a90046001600160a01b03169050600160088461ffff168154811061136257611362612121565b90600052602060002090600302016000016000828254611382919061214d565b90915550909791965090945050505050565b60005b600b5460ff82161015611511576000846001600160a01b031662fdd58e600b8460ff16815481106113ca576113ca612121565b60009182526020909120015460405160e083901b6001600160e01b03191681526001600160a01b03909116600482015260248101869052604401602060405180830381865afa158015611421573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114459190612184565b11156114ff57836001600160a01b031663f242432a600b8360ff168154811061147057611470612121565b600091825260208220015460405160e084901b6001600160e01b03191681526001600160a01b0391821660048201529087166024820152604481018690526001606482015260a0608482015260a481019190915260c401600060405180830381600087803b1580156114e157600080fd5b505af11580156114f5573d6000803e3d6000fd5b5050505050505050565b8061150981612226565b915050611397565b506040516340c10f1960e01b81526001600160a01b038381166004830152602482018390528416906340c10f1990604401600060405180830381600087803b15801561155c57600080fd5b505af1158015611570573d6000803e3d6000fd5b50505050505050565b6115838133611ac8565b50565b6115908282610c2a565b61098b5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6115fb8282610c2a565b1561098b5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b604080514160601b6bffffffffffffffffffffffff191660208083019190915282516014818403018152603483018452805190820120426054840152446074840152609483015260b48083018590528351808403909101815260d490920190925280519101206000906116cc9084906124cb565b6116d790600161214d565b9392505050565b600080600090508261ffff1660096000815481106116fe576116fe612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff16101561177e5760405162461bcd60e51b815260206004820152602760248201527f56616c756520697320626967676572207468616e2072656d61696e696e6720656044820152666c656d656e747360c81b6064820152608401610471565b600a5462010000900461ffff166117968260026124df565b6117a1906002612481565b61ffff1610156118835760006117b88260026124df565b6117c3906001612481565b905060006117d28360026124df565b6117dd906002612481565b905060098261ffff16815481106117f6576117f6612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff1661ffff168561ffff16116118305781925061187c565b80925060098261ffff168154811061184a5761184a612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff168561187991906121bf565b94505b505061177e565b600a546116d79061ffff16826121bf565b600a546000906118a89061ffff1683612481565b9050600060098261ffff16815481106118c3576118c3612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff16116119415760405162461bcd60e51b815260206004820152602660248201527f456c656d656e7420697320616c726561647920636f6e7461696e696e6720302060448201526576616c75657360d01b6064820152608401610471565b60098161ffff168154811061195857611958612121565b906000526020600020906010918282040191900660020281819054906101000a900461ffff168092919061198b90612509565b91906101000a81548161ffff021916908361ffff160217905550505b61ffff81161561098b576119bc600282612527565b61ffff16600114156119d657806119d281612548565b9150505b600060016119e5600284612560565b6119ef91906121bf565b905060098261ffff1681548110611a0857611a08612121565b60009182526020909120601082040154600f9091166002026101000a900461ffff166009611a376001856121bf565b61ffff1681548110611a4b57611a4b612121565b90600052602060002090601091828204019190066002029054906101000a900461ffff16611a799190612481565b60098261ffff1681548110611a9057611a90612121565b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550809150506119a7565b611ad28282610c2a565b61098b57611adf81611b21565b611aea836020611b33565b604051602001611afb9291906125ad565b60408051601f198184030181529082905262461bcd60e51b825261047191600401612622565b60606103d76001600160a01b03831660145b60606000611b42836002612165565b611b4d90600261214d565b6001600160401b03811115611b6457611b64611f63565b6040519080825280601f01601f191660200182016040528015611b8e576020820181803683370190505b509050600360fc1b81600081518110611ba957611ba9612121565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611bd857611bd8612121565b60200101906001600160f81b031916908160001a9053506000611bfc846002612165565b611c0790600161214d565b90505b6001811115611c7f576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611c3b57611c3b612121565b1a60f81b828281518110611c5157611c51612121565b60200101906001600160f81b031916908160001a90535060049490941c93611c788161249e565b9050611c0a565b5083156116d75760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610471565b50805460008255906000526020600020908101906115839190611dfc565b50805460008255600302906000526020600020908101906115839190611e11565b50805460008255600302906000526020600020908101906115839190611e3f565b50805460008255600f0160109004906000526020600020908101906115839190611dfc565b82805482825590600052602060002090600f01601090048101928215611dec5791602002820160005b83821115611dbc57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302611d7c565b8015611dea5782816101000a81549061ffff0219169055600201602081600101049283019260010302611dbc565b505b50611df8929150611dfc565b5090565b5b80821115611df85760008155600101611dfd565b5b80821115611df857805461ffff199081168255600060018301556002820180549091169055600301611e12565b5b80821115611df857600080825560018201556002810180546001600160a01b0319169055600301611e40565b600060208284031215611e7e57600080fd5b81356001600160e01b0319811681146116d757600080fd5b600060208284031215611ea857600080fd5b5035919050565b803560ff81168114611ec057600080fd5b919050565b60008060408385031215611ed857600080fd5b611ee183611eaf565b9150611eef60208401611eaf565b90509250929050565b600060208284031215611f0a57600080fd5b6116d782611eaf565b6001600160a01b038116811461158357600080fd5b8035611ec081611f13565b60008060408385031215611f4657600080fd5b823591506020830135611f5881611f13565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611f8c57600080fd5b82356001600160401b0380821115611fa357600080fd5b818501915085601f830112611fb757600080fd5b813581811115611fc957611fc9611f63565b8060051b604051601f19603f83011681018181108582111715611fee57611fee611f63565b60405291825284820192508381018501918883111561200c57600080fd5b938501935b828510156120315761202285611f28565b84529385019392850192612011565b98975050505050505050565b60008083601f84011261204f57600080fd5b5081356001600160401b0381111561206657600080fd5b60208301915083602060608302850101111561208157600080fd5b9250929050565b6000806020838503121561209b57600080fd5b82356001600160401b038111156120b157600080fd5b6120bd8582860161203d565b90969095509350505050565b6000602082840312156120db57600080fd5b81356116d781611f13565b600080600080608085870312156120fc57600080fd5b843561210781611f13565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561216057612160612137565b500190565b600081600019048311821515161561217f5761217f612137565b500290565b60006020828403121561219657600080fd5b5051919050565b6000602082840312156121af57600080fd5b815180151581146116d757600080fd5b600061ffff838116908316818110156121da576121da612137565b039392505050565b600060ff821660ff84168160ff048111821515161561220357612203612137565b029392505050565b600060001982141561221f5761221f612137565b5060010190565b600060ff821660ff81141561223d5761223d612137565b60010192915050565b6000813561ffff811681146103d757600080fd5b61227961226683612246565b825461ffff191661ffff91909116178255565b6020820135600182015561098b61229260408401612246565b6002830161ffff821661ffff198254161781555050565b81358155602082013560018201556002810160408301356122c981611f13565b81546001600160a01b0319166001600160a01b03919091161790555050565b600063ffffffff80831681851680830382111561230757612307612137565b01949350505050565b600181815b8085111561234b57816000190482111561233157612331612137565b8085161561233e57918102915b93841c9390800290612315565b509250929050565b600082612362575060016103d7565b8161236f575060006103d7565b8160018114612385576002811461238f576123ab565b60019150506103d7565b60ff8411156123a0576123a0612137565b50506001821b6103d7565b5060208310610133831016604e8410600b84101617156123ce575081810a6103d7565b6123d88383612310565b806000190482111561220357612203612137565b60006116d76001600160401b03841683612353565b60006001600160401b038083168181141561241e5761241e612137565b6001019392505050565b60008282101561243a5761243a612137565b500390565b60006001600160401b0380831681851680830382111561230757612307612137565b60006001600160401b03838116908316818110156121da576121da612137565b600061ffff80831681851680830382111561230757612307612137565b6000816124ad576124ad612137565b506000190190565b634e487b7160e01b600052601260045260246000fd5b6000826124da576124da6124b5565b500690565b600061ffff8083168185168183048111821515161561250057612500612137565b02949350505050565b600061ffff82168061251d5761251d612137565b6000190192915050565b600061ffff8084168061253c5761253c6124b5565b92169190910692915050565b600061ffff8083168181141561241e5761241e612137565b600061ffff80841680612575576125756124b5565b92169190910492915050565b60005b8381101561259c578181015183820152602001612584565b83811115610bb75750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516125e5816017850160208801612581565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612616816028840160208801612581565b01602801949350505050565b6020815260008251806020840152612641816040850160208701612581565b601f01601f1916919091016040019291505056fea2646970667358221220e0ed158a46428a527801e189279589df53294433d0b424492a412e25b159628864736f6c634300080c0033

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.