MATIC Price: $0.688238 (-3.37%)
Gas: 35 GWei
 
Transaction Hash
Method
Block
From
To
Value
Mint569979052024-05-15 13:28:254 days ago1715779705IN
0x57F48000...E43FEE41c
27.5 MATIC0.0053440231.56358038
Mint569907412024-05-15 9:01:474 days ago1715763707IN
0x57F48000...E43FEE41c
27.5 MATIC0.0053992431.8896722
Mint569757702024-05-14 23:20:524 days ago1715728852IN
0x57F48000...E43FEE41c
27.5 MATIC0.005079330.00000003
Mint569582352024-05-14 12:09:365 days ago1715688576IN
0x57F48000...E43FEE41c
27.5 MATIC0.006344137.47033822
Mint568498082024-05-11 17:20:497 days ago1715448049IN
0x57F48000...E43FEE41c
27.5 MATIC0.005079330.00000003
Mint568086582024-05-10 16:43:568 days ago1715359436IN
0x57F48000...E43FEE41c
27.5 MATIC0.0088257147.3456943
Mint568068222024-05-10 15:37:328 days ago1715355452IN
0x57F48000...E43FEE41c
110 MATIC0.0103859650.33861184
Mint567678322024-05-09 16:18:159 days ago1715271495IN
0x57F48000...E43FEE41c
27.5 MATIC0.0121127371.54682659
Mint567664682024-05-09 15:28:029 days ago1715268482IN
0x57F48000...E43FEE41c
110 MATIC0.04958163240.31191103
Mint567375482024-05-08 21:42:3210 days ago1715204552IN
0x57F48000...E43FEE41c
110 MATIC0.0075648936.66546137
Mint567366292024-05-08 21:09:2810 days ago1715202568IN
0x57F48000...E43FEE41c
27.5 MATIC0.005079330.00000003
Mint567328352024-05-08 18:47:0310 days ago1715194023IN
0x57F48000...E43FEE41c
110 MATIC0.0061896630.00000003
Mint567252252024-05-08 14:06:0111 days ago1715177161IN
0x57F48000...E43FEE41c
27.5 MATIC0.0070429337.78196781
Mint567217332024-05-08 11:58:2111 days ago1715169501IN
0x57F48000...E43FEE41c
27.5 MATIC0.005079330.00000025
Mint567183582024-05-08 9:52:4911 days ago1715161969IN
0x57F48000...E43FEE41c
27.5 MATIC0.005079330.00000005
Mint567146652024-05-08 7:40:1011 days ago1715154010IN
0x57F48000...E43FEE41c
27.5 MATIC0.0060809435.91601221
Mint566902062024-05-07 16:54:2511 days ago1715100865IN
0x57F48000...E43FEE41c
27.5 MATIC0.005079330.00000002
Mint566831952024-05-07 12:31:2412 days ago1715085084IN
0x57F48000...E43FEE41c
27.5 MATIC0.0060577935.77929927
Mint566830682024-05-07 12:26:0612 days ago1715084766IN
0x57F48000...E43FEE41c
27.5 MATIC0.0050789430.00000014
Mint566455722024-05-06 13:15:1613 days ago1715001316IN
0x57F48000...E43FEE41c
110 MATIC0.0063513533.56561961
Mint566256622024-05-06 0:28:5913 days ago1714955339IN
0x57F48000...E43FEE41c
110 MATIC0.0061896630.00000004
Mint565267612024-05-03 10:13:4616 days ago1714731226IN
0x57F48000...E43FEE41c
110 MATIC0.0056766630.00000018
Mint565266962024-05-03 10:10:5516 days ago1714731055IN
0x57F48000...E43FEE41c
110 MATIC0.0056766630.00000016
Mint565008842024-05-02 17:00:5516 days ago1714669255IN
0x57F48000...E43FEE41c
27.5 MATIC0.0067466739.84805545
Mint564672542024-05-01 18:57:5917 days ago1714589879IN
0x57F48000...E43FEE41c
27.5 MATIC0.0164854997.3687161
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
570689432024-05-17 11:28:162 days ago1715945296
0x57F48000...E43FEE41c
27.5 MATIC
570689432024-05-17 11:28:162 days ago1715945296
0x57F48000...E43FEE41c
27.5 MATIC
570411632024-05-16 17:28:072 days ago1715880487
0x57F48000...E43FEE41c
27.5 MATIC
570411632024-05-16 17:28:072 days ago1715880487
0x57F48000...E43FEE41c
27.5 MATIC
570355912024-05-16 13:48:143 days ago1715867294
0x57F48000...E43FEE41c
27.5 MATIC
570355912024-05-16 13:48:143 days ago1715867294
0x57F48000...E43FEE41c
27.5 MATIC
569979052024-05-15 13:28:254 days ago1715779705
0x57F48000...E43FEE41c
27.5 MATIC
569974322024-05-15 13:11:074 days ago1715778667
0x57F48000...E43FEE41c
27.5 MATIC
569974322024-05-15 13:11:074 days ago1715778667
0x57F48000...E43FEE41c
27.5 MATIC
569907412024-05-15 9:01:474 days ago1715763707
0x57F48000...E43FEE41c
27.5 MATIC
569757702024-05-14 23:20:524 days ago1715728852
0x57F48000...E43FEE41c
27.5 MATIC
569666742024-05-14 17:23:234 days ago1715707403
0x57F48000...E43FEE41c
27.5 MATIC
569666742024-05-14 17:23:234 days ago1715707403
0x57F48000...E43FEE41c
27.5 MATIC
569665762024-05-14 17:19:254 days ago1715707165
0x57F48000...E43FEE41c
27.5 MATIC
569665762024-05-14 17:19:254 days ago1715707165
0x57F48000...E43FEE41c
27.5 MATIC
569582352024-05-14 12:09:365 days ago1715688576
0x57F48000...E43FEE41c
27.5 MATIC
568905472024-05-12 18:32:316 days ago1715538751
0x57F48000...E43FEE41c
440 MATIC
568905472024-05-12 18:32:316 days ago1715538751
0x57F48000...E43FEE41c
440 MATIC
568892232024-05-12 17:44:336 days ago1715535873
0x57F48000...E43FEE41c
110 MATIC
568892232024-05-12 17:44:336 days ago1715535873
0x57F48000...E43FEE41c
110 MATIC
568498082024-05-11 17:20:497 days ago1715448049
0x57F48000...E43FEE41c
27.5 MATIC
568086582024-05-10 16:43:568 days ago1715359436
0x57F48000...E43FEE41c
27.5 MATIC
568068222024-05-10 15:37:328 days ago1715355452
0x57F48000...E43FEE41c
110 MATIC
567968672024-05-10 9:40:059 days ago1715334005
0x57F48000...E43FEE41c
27.5 MATIC
567968672024-05-10 9:40:059 days ago1715334005
0x57F48000...E43FEE41c
27.5 MATIC
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RefillableSale

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : RefillableSale.sol
// SPDX-License-Identifier: MIT
// Pooky Game Contracts (mint/RefillableSale.sol)
pragma solidity ^0.8.18;

import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import { IPookyball } from "../interfaces/IPookyball.sol";
import { PookyballRarity } from "../types/PookyballRarity.sol";

struct Item {
  /// Supply of the current sale
  uint256 supply;
  /// Total number of tokens minted during all the sales
  uint256 minted;
  /// Total supply of all the sales
  uint256 totalSupply;
  /// The token price in native currency wei
  uint256 price;
}

struct Refill {
  /// The Pookyball rarity (0=COMMON, 1=RARE, 2=EPIC, 3=LEGENDARY)
  PookyballRarity rarity;
  /// The refill token quantity
  uint256 quantity;
  /// The token price in native currency wei
  uint256 price;
}

/**
 * @title RefillableSale
 * @author Mathieu Bour
 * @notice Allow Pookyball players to mint one or multiple Pookyball tokens.
 * This contract is refillable, meaning that an authorized SELLER account is allowed to change the available
 * balls/rarities.
 * The sale might also be closed at some point, see `closedUntil` for the next mint window!
 */
contract RefillableSale is AccessControlEnumerable {
  bytes32 public constant SELLER = keccak256("SELLER");
  PookyballRarity[] public rarities = [
    PookyballRarity.COMMON,
    PookyballRarity.RARE,
    PookyballRarity.EPIC,
    PookyballRarity.LEGENDARY
  ];

  /// The available mintable items mapped by rarity.
  mapping(PookyballRarity => Item) public items;

  /// The Pookyball ERC721 token (cannot be changed).
  IPookyball public immutable pookyball;
  /// The address of Pooky's treasury (cannot be changed).
  address public immutable treasury;
  /// The date when next mint window will open (compared to block.timestamp).
  uint256 public closedUntil;

  /// Fired when a sale is made
  event Sale(address indexed account, PookyballRarity indexed rarity, uint256 quantity, uint256 value);

  /// Thrown when a mint is attempt before the sale opens.
  error Closed(uint256 closedUntil);
  /// Thrown when a mint would exceed the template supply.
  error InsufficientSupply(PookyballRarity rarity, uint256 remaining);
  /// Thrown when the msg.value of the mint function does not cover the mint cost.
  error InsufficientValue(uint256 expected, uint256 actual);
  /// Thrown when the native transfer has failed.
  error TransferFailed(address recipient, uint256 amount);

  /**
   * @param _pookyball The Pookyball ERC721 token address.
   * @param _treasury The Pooky's treasury address.
   * @param admin The AccessControl admin address.
   * @param sellers The initial SELLER addresses.
   */
  constructor(IPookyball _pookyball, address _treasury, address admin, address[] memory sellers) {
    pookyball = _pookyball;
    treasury = _treasury;
    _grantRole(DEFAULT_ADMIN_ROLE, admin);

    uint256 l = sellers.length;
    for (uint256 i = 0; i < l; i++) {
      _grantRole(SELLER, sellers[i]);
    }

    // Default prices
    items[PookyballRarity.COMMON] = Item(0, 0, 0, 20 ether);
    items[PookyballRarity.RARE] = Item(0, 0, 0, 80 ether);
    items[PookyballRarity.EPIC] = Item(0, 0, 0, 320 ether);
    items[PookyballRarity.LEGENDARY] = Item(0, 0, 0, 1280 ether);
  }

  function getTemplates() external view returns (Item[] memory) {
    uint256 l = rarities.length;
    Item[] memory output = new Item[](l);

    for (uint256 i = 0; i < l; i++) {
      output[i] = items[rarities[i]];
    }

    return output;
  }

  /**
   * @notice Checks if the sale is open.
   */
  function isClosed() public view returns (bool) {
    return closedUntil == 0 || block.timestamp < closedUntil;
  }

  /**
   * @notice return the ineligibility reason of a set of parameters.
   * Required for Paper.xyz custom contract integrations.
   * See https://docs.withpaper.com/reference/eligibilitymethod
   * @return The reason why the parameters are invalid; empty string if teh parameters are valid.
   */
  function eligible(PookyballRarity rarity, uint256 quantity) external view returns (string memory) {
    if (isClosed()) {
      return "sale is closed";
    }

    Item memory item = items[rarity];
    if (item.minted + quantity > item.totalSupply) {
      return "insufficient supply";
    }

    return "";
  }

  /**
   * @notice Mint one or more Pookyball token to a account.
   * @dev Requirements:
   * - sale must be open
   * - item should exists (check with the InsufficientSupply error)
   * - item should have enough supply
   * - enough native currency should be sent to cover the mint price
   */
  function mint(PookyballRarity rarity, address recipient, uint256 quantity) external payable {
    if (isClosed()) {
      revert Closed(closedUntil);
    }

    Item memory item = items[rarity];

    if (item.minted + quantity > item.totalSupply) {
      revert InsufficientSupply(rarity, item.totalSupply - item.minted);
    }

    if (msg.value < quantity * item.price) {
      revert InsufficientValue(quantity * item.price, msg.value);
    }

    // Build the arrays for the batched mint
    address[] memory recipients = new address[](quantity);
    PookyballRarity[] memory rarities_ = new PookyballRarity[](quantity);

    for (uint256 i = 0; i < quantity; i++) {
      recipients[i] = recipient;
      rarities_[i] = rarity;
    }

    // Actual Pookyball token mint
    pookyball.mint(recipients, rarities_);
    items[rarity].minted += quantity;

    // Forward the funds to the treasury wallet
    (bool sent, ) = treasury.call{ value: msg.value }("");
    if (!sent) {
      revert TransferFailed(treasury, msg.value);
    }

    emit Sale(recipient, rarity, quantity, msg.value);
  }

  /**
   * @notice Restock the sale items.
   * @param refills Array of the modifications to apply.
   * @param _closedUntil Update the opening of the sale; a date in the past opens the sale immediately.
   * @dev Requirements:
   * - msg.sender must have the SELLER role
   */
  function restock(Refill[] memory refills, uint256 _closedUntil) external onlyRole(SELLER) {
    uint256 len = refills.length;
    for (uint256 i = 0; i < len; i++) {
      PookyballRarity rarity = refills[i].rarity;
      items[rarity].price = refills[i].price;
      items[rarity].totalSupply = items[rarity].minted + refills[i].quantity;
      items[rarity].supply = refills[i].quantity;
    }

    closedUntil = _closedUntil;
  }
}

File 1 of 16 : 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 1 of 16 : AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

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

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {_grantRole} to track enumerable memberships
     */
    function _grantRole(bytes32 role, address account) internal virtual override {
        super._grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {_revokeRole} to track enumerable memberships
     */
    function _revokeRole(bytes32 role, address account) internal virtual override {
        super._revokeRole(role, account);
        _roleMembers[role].remove(account);
    }
}

File 1 of 16 : 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 1 of 16 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 1 of 16 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 1 of 16 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 1 of 16 : 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 1 of 16 : 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 1 of 16 : 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 1 of 16 : 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 1 of 16 : 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 1 of 16 : 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 1 of 16 : IPookyball.sol
// SPDX-License-Identifier: MIT
// Pooky Game Contracts (interfaces/IPookyball.sol)
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/access/IAccessControl.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "../types/PookyballMetadata.sol";

/**
 * @title IPookyball
 * @author Mathieu Bour
 * @notice Minimal Pookyball interface.
 */
interface IPookyball is IAccessControl, IERC2981, IERC721 {
  /// Fired when the seed of a Pookyball token is set by the VRFCoordinator
  event SeedSet(uint256 indexed tokenId, uint256 seed);
  /// Fired when the level of a Pookyball token is changed
  event LevelChanged(uint256 indexed tokenId, uint256 level);
  /// Fired when the PXP of a Pookyball token is changed
  event PXPChanged(uint256 indexed tokenId, uint256 amount);

  /// Thrown when the length of two parameters mismatch. Used in the mint batched function.
  error ArgumentSizeMismatch(uint256 x, uint256 y);

  /**
   * @notice PookyballMetadata of the token {tokenId}.
   * @dev Requirements:
   * - Pookyball {tokenId} should exist (minted and not burned).
   */
  function metadata(uint256 tokenId) external view returns (PookyballMetadata memory);

  /**
   * @notice Change the secondary sale royalties receiver address.
   */
  function setERC2981Receiver(address newReceiver) external;

  /**
   * @notice Mint a new Pookyball token with a given rarity.
   */
  function mint(address[] memory recipients, PookyballRarity[] memory rarities) external returns (uint256);

  /**
   * @notice Change the level of a Pookyball token.
   * @dev Requirements:
   * - Pookyball {tokenId} should exist (minted and not burned).
   */
  function setLevel(uint256 tokenId, uint256 newLevel) external;

  /**
   * @notice Change the PXP of a Pookyball token.
   * @dev Requirements:
   * - Pookyball {tokenId} should exist (minted and not burned).
   */
  function setPXP(uint256 tokenId, uint256 newPXP) external;
}

File 2 of 16 : PookyballMetadata.sol
// SPDX-License-Identifier: MIT
// Pooky Game Contracts (types/PookyballMetadata.sol)
pragma solidity ^0.8.17;

import "./PookyballRarity.sol";

/**
 * @title PookyballMetadata
 * @notice Pookyballs NFT have the following features:
 * - rarity: integer enum.
 * - level: token level, can be increase by spending token experiences points (PXP).
 * - pxp: token experience points.
 * - seed: a random uint256 word provided by Chainlink VRF service that will be used by Pooky's NFT generator
 *     back-end to generate the NFT visuals and in-game statistics\.
 */
struct PookyballMetadata {
  PookyballRarity rarity;
  uint256 level;
  uint256 pxp;
  uint256 seed;
}

File 2 of 16 : PookyballRarity.sol
// SPDX-License-Identifier: MIT
// Pooky Game Contracts (types/PookyballRarity.sol)
pragma solidity ^0.8.17;

enum PookyballRarity {
  COMMON,
  RARE,
  EPIC,
  LEGENDARY,
  MYTHIC
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IPookyball","name":"_pookyball","type":"address"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"admin","type":"address"},{"internalType":"address[]","name":"sellers","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"closedUntil","type":"uint256"}],"name":"Closed","type":"error"},{"inputs":[{"internalType":"enum PookyballRarity","name":"rarity","type":"uint8"},{"internalType":"uint256","name":"remaining","type":"uint256"}],"name":"InsufficientSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"expected","type":"uint256"},{"internalType":"uint256","name":"actual","type":"uint256"}],"name":"InsufficientValue","type":"error"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"enum PookyballRarity","name":"rarity","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Sale","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SELLER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closedUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum PookyballRarity","name":"rarity","type":"uint8"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"eligible","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTemplates","outputs":[{"components":[{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"minted","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct Item[]","name":"","type":"tuple[]"}],"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":[],"name":"isClosed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum PookyballRarity","name":"","type":"uint8"}],"name":"items","outputs":[{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"uint256","name":"minted","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum PookyballRarity","name":"rarity","type":"uint8"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"pookyball","outputs":[{"internalType":"contract IPookyball","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rarities","outputs":[{"internalType":"enum PookyballRarity","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum PookyballRarity","name":"rarity","type":"uint8"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct Refill[]","name":"refills","type":"tuple[]"},{"internalType":"uint256","name":"_closedUntil","type":"uint256"}],"name":"restock","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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

610140604052600060c0908152600160e05260026101008190526003610120526200002c9160046200054a565b503480156200003a57600080fd5b5060405162002131380380620021318339810160408190526200005d9162000676565b6001600160a01b03808516608052831660a0526200007d600083620003f4565b805160005b81811015620000ee57620000d97fe27592a68a79c541972a95a186227e8435146610cb2d3eb8f8589c9a507d61b2848381518110620000c557620000c56200078a565b6020026020010151620003f460201b60201c565b80620000e581620007a0565b91505062000082565b50506040805160808082018352600080835260208084018281528486018381526801158e460913d000006060808801918252858052600380865297517f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff5592517f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92f005590517f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92f0155517f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92f0255855180850187528381528083018481528188018581526804563918244f4000008385019081526001875288865292517fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c5590517fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054d55517fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054e55517fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054f5585518085018752838152808301848152818801858152681158e460913d0000008385019081526002875288865292517fc3a24b0501bd2c13a7e57f2db4369ec4c223447539fc0724a9d55ac4a06ebd4d5590517fc3a24b0501bd2c13a7e57f2db4369ec4c223447539fc0724a9d55ac4a06ebd4e55517fc3a24b0501bd2c13a7e57f2db4369ec4c223447539fc0724a9d55ac4a06ebd4f55517fc3a24b0501bd2c13a7e57f2db4369ec4c223447539fc0724a9d55ac4a06ebd505585519384018652828452838201838152958401838152684563918244f40000009185019182529285905293905290517fcbc4e5fb02c3d1de23a9f1e014b4d2ee5aeaea9505df5e855c9210bf472495af5591517fcbc4e5fb02c3d1de23a9f1e014b4d2ee5aeaea9505df5e855c9210bf472495b05590517fcbc4e5fb02c3d1de23a9f1e014b4d2ee5aeaea9505df5e855c9210bf472495b155517fcbc4e5fb02c3d1de23a9f1e014b4d2ee5aeaea9505df5e855c9210bf472495b25550620007c892505050565b6200040b82826200043760201b62000e661760201c565b60008281526001602090815260409091206200043291839062000eea620004d8821b17901c565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620004d4576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620004933390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000620004ef836001600160a01b038416620004f8565b90505b92915050565b60008181526001830160205260408120546200054157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004f2565b506000620004f2565b82805482825590600052602060002090601f01602090048101928215620005f65791602002820160005b83821115620005c557835183826101000a81548160ff02191690836004811115620005a357620005a36200061f565b0217905550926020019260010160208160000104928301926001030262000574565b8015620005f45782816101000a81549060ff0219169055600101602081600001049283019260010302620005c5565b505b506200060492915062000608565b5090565b5b8082111562000604576000815560010162000609565b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03811681146200064b57600080fd5b50565b80516200065b8162000635565b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156200068d57600080fd5b84516200069a8162000635565b80945050602080860151620006af8162000635565b6040870151909450620006c28162000635565b60608701519093506001600160401b0380821115620006e057600080fd5b818801915088601f830112620006f557600080fd5b8151818111156200070a576200070a62000660565b8060051b604051601f19603f8301168101818110858211171562000732576200073262000660565b60405291825284820192508381018501918b8311156200075157600080fd5b938501935b828510156200077a576200076a856200064e565b8452938501939285019262000756565b989b979a50959850505050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201620007c157634e487b7160e01b600052601160045260246000fd5b5060010190565b60805160a05161192e620008036000396000818161028401528181610d550152610dd501526000818161016b0152610c7d015261192e6000f3fe60806040526004361061011f5760003560e01c8063a217fddf116100a0578063ca6d91b211610064578063ca6d91b21461037a578063d547741f146103a7578063e64ae119146103c7578063eebab8ef146103e9578063fbd1a97b146103fc57600080fd5b8063a217fddf146102e6578063bca93eba146102fb578063c2b6b58c1461032f578063c989643514610344578063ca15c8731461035a57600080fd5b80632f2ff15d116100e75780632f2ff15d1461023257806336568abe1461025257806361d027b3146102725780639010d07c146102a657806391d14854146102c657600080fd5b806301ffc9a714610124578063109876831461015957806317b8e1cf146101a5578063248a9ca3146101d257806324b8f3b914610210575b600080fd5b34801561013057600080fd5b5061014461013f366004611388565b610460565b60405190151581526020015b60405180910390f35b34801561016557600080fd5b5061018d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610150565b3480156101b157600080fd5b506101c56101c03660046113b2565b61048b565b6040516101509190611403565b3480156101de57600080fd5b506102026101ed3660046113b2565b60009081526020819052604090206001015490565b604051908152602001610150565b34801561021c57600080fd5b5061023061022b366004611495565b6104bf565b005b34801561023e57600080fd5b5061023061024d36600461158b565b610681565b34801561025e57600080fd5b5061023061026d36600461158b565b6106ab565b34801561027e57600080fd5b5061018d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102b257600080fd5b5061018d6102c13660046115b7565b61072e565b3480156102d257600080fd5b506101446102e136600461158b565b61074d565b3480156102f257600080fd5b50610202600081565b34801561030757600080fd5b506102027fe27592a68a79c541972a95a186227e8435146610cb2d3eb8f8589c9a507d61b281565b34801561033b57600080fd5b50610144610776565b34801561035057600080fd5b5061020260045481565b34801561036657600080fd5b506102026103753660046113b2565b61078f565b34801561038657600080fd5b5061039a6103953660046115d9565b6107a6565b6040516101509190611627565b3480156103b357600080fd5b506102306103c236600461158b565b6108a5565b3480156103d357600080fd5b506103dc6108ca565b604051610150919061165a565b6102306103f73660046116be565b610a26565b34801561040857600080fd5b506104406104173660046116fa565b600360208190526000918252604090912080546001820154600283015492909301549092919084565b604080519485526020850193909352918301526060820152608001610150565b60006001600160e01b03198216635a05180f60e01b1480610485575061048582610eff565b92915050565b6002818154811061049b57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b7fe27592a68a79c541972a95a186227e8435146610cb2d3eb8f8589c9a507d61b26104e981610f34565b825160005b8181101561067857600085828151811061050a5761050a611715565b602002602001015160000151905085828151811061052a5761052a611715565b6020026020010151604001516003600083600481111561054c5761054c6113cb565b600481111561055d5761055d6113cb565b81526020019081526020016000206003018190555085828151811061058457610584611715565b602002602001015160200151600360008360048111156105a6576105a66113cb565b60048111156105b7576105b76113cb565b8152602001908152602001600020600101546105d39190611741565b600360008360048111156105e9576105e96113cb565b60048111156105fa576105fa6113cb565b81526020019081526020016000206002018190555085828151811061062157610621611715565b60200260200101516020015160036000836004811115610643576106436113cb565b6004811115610654576106546113cb565b8152602081019190915260400160002055508061067081611754565b9150506104ee565b50505060045550565b60008281526020819052604090206001015461069c81610f34565b6106a68383610f41565b505050565b6001600160a01b03811633146107205760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61072a8282610f63565b5050565b60008281526001602052604081206107469083610f85565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006004546000148061078a575060045442105b905090565b600081815260016020526040812061048590610f91565b60606107b0610776565b156107e0575060408051808201909152600e81526d1cd85b19481a5cc818db1bdcd95960921b6020820152610485565b6000600360008560048111156107f8576107f86113cb565b6004811115610809576108096113cb565b81526020808201929092526040908101600020815160808101835281548152600182015493810184905260028201549281018390526003909101546060820152925090610857908590611741565b111561088e575050604080518082019091526013815272696e73756666696369656e7420737570706c7960681b6020820152610485565b505060408051602081019091526000815292915050565b6000828152602081905260409020600101546108c081610f34565b6106a68383610f63565b60025460609060008167ffffffffffffffff8111156108eb576108eb611411565b60405190808252806020026020018201604052801561094757816020015b6109346040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001906001900390816109095790505b50905060005b82811015610a1f57600360006002838154811061096c5761096c611715565b90600052602060002090602091828204019190069054906101000a900460ff16600481111561099d5761099d6113cb565b60048111156109ae576109ae6113cb565b8152602001908152602001600020604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050828281518110610a0157610a01611715565b60200260200101819052508080610a1790611754565b91505061094d565b5092915050565b610a2e610776565b15610a505760048054604051636cc09e7b60e01b815291820152602401610717565b600060036000856004811115610a6857610a686113cb565b6004811115610a7957610a796113cb565b81526020808201929092526040908101600020815160808101835281548152600182015493810184905260028201549281018390526003909101546060820152925090610ac7908490611741565b1115610afd578381602001518260400151610ae2919061176d565b604051632e9cb32760e21b8152600401610717929190611780565b6060810151610b0c908361179b565b341015610b45576060810151610b22908361179b565b604051631c102d6360e21b81526004810191909152346024820152604401610717565b60008267ffffffffffffffff811115610b6057610b60611411565b604051908082528060200260200182016040528015610b89578160200160208202803683370190505b50905060008367ffffffffffffffff811115610ba757610ba7611411565b604051908082528060200260200182016040528015610bd0578160200160208202803683370190505b50905060005b84811015610c655785838281518110610bf157610bf1611715565b60200260200101906001600160a01b031690816001600160a01b03168152505086828281518110610c2457610c24611715565b60200260200101906004811115610c3d57610c3d6113cb565b90816004811115610c5057610c506113cb565b90525080610c5d81611754565b915050610bd6565b50604051631a6dad1360e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063d36d689890610cb490859085906004016117b2565b6020604051808303816000875af1158015610cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf7919061183d565b508360036000886004811115610d0f57610d0f6113cb565b6004811115610d2057610d206113cb565b81526020019081526020016000206001016000828254610d409190611741565b90915550506040516000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169034908381818185875af1925050503d8060008114610db0576040519150601f19603f3d011682016040523d82523d6000602084013e610db5565b606091505b5050905080610e0857604051630e21dcbb60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166004820152346024820152604401610717565b866004811115610e1a57610e1a6113cb565b604080518781523460208201526001600160a01b038916917f1ec0c95078c890035e941915909bcfe875eca2b01352f0caaf74680fe1d297ce910160405180910390a350505050505050565b610e70828261074d565b61072a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610ea63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610746836001600160a01b038416610f9b565b60006001600160e01b03198216637965db0b60e01b148061048557506301ffc9a760e01b6001600160e01b0319831614610485565b610f3e8133610fea565b50565b610f4b8282610e66565b60008281526001602052604090206106a69082610eea565b610f6d8282611043565b60008281526001602052604090206106a690826110a8565b600061074683836110bd565b6000610485825490565b6000818152600183016020526040812054610fe257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610485565b506000610485565b610ff4828261074d565b61072a57611001816110e7565b61100c8360206110f9565b60405160200161101d929190611856565b60408051601f198184030181529082905262461bcd60e51b825261071791600401611627565b61104d828261074d565b1561072a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610746836001600160a01b038416611295565b60008260000182815481106110d4576110d4611715565b9060005260206000200154905092915050565b60606104856001600160a01b03831660145b6060600061110883600261179b565b611113906002611741565b67ffffffffffffffff81111561112b5761112b611411565b6040519080825280601f01601f191660200182016040528015611155576020820181803683370190505b509050600360fc1b8160008151811061117057611170611715565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061119f5761119f611715565b60200101906001600160f81b031916908160001a90535060006111c384600261179b565b6111ce906001611741565b90505b6001811115611246576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061120257611202611715565b1a60f81b82828151811061121857611218611715565b60200101906001600160f81b031916908160001a90535060049490941c9361123f816118cb565b90506111d1565b5083156107465760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610717565b6000818152600183016020526040812054801561137e5760006112b960018361176d565b85549091506000906112cd9060019061176d565b90508181146113325760008660000182815481106112ed576112ed611715565b906000526020600020015490508087600001848154811061131057611310611715565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611343576113436118e2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610485565b6000915050610485565b60006020828403121561139a57600080fd5b81356001600160e01b03198116811461074657600080fd5b6000602082840312156113c457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b600581106113ff57634e487b7160e01b600052602160045260246000fd5b9052565b6020810161048582846113e1565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561144a5761144a611411565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561147957611479611411565b604052919050565b80356005811061149057600080fd5b919050565b60008060408084860312156114a957600080fd5b833567ffffffffffffffff808211156114c157600080fd5b818601915086601f8301126114d557600080fd5b81356020828211156114e9576114e9611411565b6114f7818360051b01611450565b8281528181019350606092830285018201928a84111561151657600080fd5b948201945b838610156115655780868c0312156115335760008081fd5b61153b611427565b61154487611481565b8152868401358482015287870135888201528552948501949382019361151b565b50999701359750505050505050565b80356001600160a01b038116811461149057600080fd5b6000806040838503121561159e57600080fd5b823591506115ae60208401611574565b90509250929050565b600080604083850312156115ca57600080fd5b50508035926020909101359150565b600080604083850312156115ec57600080fd5b6115f583611481565b946020939093013593505050565b60005b8381101561161e578181015183820152602001611606565b50506000910152565b6020815260008251806020840152611646816040850160208701611603565b601f01601f19169190910160400192915050565b602080825282518282018190526000919060409081850190868401855b828110156116b157815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101611677565b5091979650505050505050565b6000806000606084860312156116d357600080fd5b6116dc84611481565b92506116ea60208501611574565b9150604084013590509250925092565b60006020828403121561170c57600080fd5b61074682611481565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156104855761048561172b565b6000600182016117665761176661172b565b5060010190565b818103818111156104855761048561172b565b6040810161178e82856113e1565b8260208301529392505050565b80820281158282048414176104855761048561172b565b604080825283519082018190526000906020906060840190828701845b828110156117f45781516001600160a01b0316845292840192908401906001016117cf565b5050508381038285015284518082528583019183019060005b81811015611830576118208385516113e1565b928401929184019160010161180d565b5090979650505050505050565b60006020828403121561184f57600080fd5b5051919050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161188e816017850160208801611603565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516118bf816028840160208801611603565b01602801949350505050565b6000816118da576118da61172b565b506000190190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b1b6da4fb00abe4c4ad917de05ccd14f0c9e41b0d7a69cf0ede78b2037cba38164736f6c63430008120033000000000000000000000000b4859acd9b0a65ca4897c31e5cb5160d9ff32c0a00000000000000000000000096224b6a800294f40c547f7ec0952ea2225260400000000000000000000000003cc4f4372f83ad3c577ed6e1aae3d244a1b955d500000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e73b648f6de254101052e126c0499c32ed736a37000000000000000000000000481074326ac46c7bc52f0b25d2f7aaf40f586472

Deployed Bytecode

0x60806040526004361061011f5760003560e01c8063a217fddf116100a0578063ca6d91b211610064578063ca6d91b21461037a578063d547741f146103a7578063e64ae119146103c7578063eebab8ef146103e9578063fbd1a97b146103fc57600080fd5b8063a217fddf146102e6578063bca93eba146102fb578063c2b6b58c1461032f578063c989643514610344578063ca15c8731461035a57600080fd5b80632f2ff15d116100e75780632f2ff15d1461023257806336568abe1461025257806361d027b3146102725780639010d07c146102a657806391d14854146102c657600080fd5b806301ffc9a714610124578063109876831461015957806317b8e1cf146101a5578063248a9ca3146101d257806324b8f3b914610210575b600080fd5b34801561013057600080fd5b5061014461013f366004611388565b610460565b60405190151581526020015b60405180910390f35b34801561016557600080fd5b5061018d7f000000000000000000000000b4859acd9b0a65ca4897c31e5cb5160d9ff32c0a81565b6040516001600160a01b039091168152602001610150565b3480156101b157600080fd5b506101c56101c03660046113b2565b61048b565b6040516101509190611403565b3480156101de57600080fd5b506102026101ed3660046113b2565b60009081526020819052604090206001015490565b604051908152602001610150565b34801561021c57600080fd5b5061023061022b366004611495565b6104bf565b005b34801561023e57600080fd5b5061023061024d36600461158b565b610681565b34801561025e57600080fd5b5061023061026d36600461158b565b6106ab565b34801561027e57600080fd5b5061018d7f00000000000000000000000096224b6a800294f40c547f7ec0952ea22252604081565b3480156102b257600080fd5b5061018d6102c13660046115b7565b61072e565b3480156102d257600080fd5b506101446102e136600461158b565b61074d565b3480156102f257600080fd5b50610202600081565b34801561030757600080fd5b506102027fe27592a68a79c541972a95a186227e8435146610cb2d3eb8f8589c9a507d61b281565b34801561033b57600080fd5b50610144610776565b34801561035057600080fd5b5061020260045481565b34801561036657600080fd5b506102026103753660046113b2565b61078f565b34801561038657600080fd5b5061039a6103953660046115d9565b6107a6565b6040516101509190611627565b3480156103b357600080fd5b506102306103c236600461158b565b6108a5565b3480156103d357600080fd5b506103dc6108ca565b604051610150919061165a565b6102306103f73660046116be565b610a26565b34801561040857600080fd5b506104406104173660046116fa565b600360208190526000918252604090912080546001820154600283015492909301549092919084565b604080519485526020850193909352918301526060820152608001610150565b60006001600160e01b03198216635a05180f60e01b1480610485575061048582610eff565b92915050565b6002818154811061049b57600080fd5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b7fe27592a68a79c541972a95a186227e8435146610cb2d3eb8f8589c9a507d61b26104e981610f34565b825160005b8181101561067857600085828151811061050a5761050a611715565b602002602001015160000151905085828151811061052a5761052a611715565b6020026020010151604001516003600083600481111561054c5761054c6113cb565b600481111561055d5761055d6113cb565b81526020019081526020016000206003018190555085828151811061058457610584611715565b602002602001015160200151600360008360048111156105a6576105a66113cb565b60048111156105b7576105b76113cb565b8152602001908152602001600020600101546105d39190611741565b600360008360048111156105e9576105e96113cb565b60048111156105fa576105fa6113cb565b81526020019081526020016000206002018190555085828151811061062157610621611715565b60200260200101516020015160036000836004811115610643576106436113cb565b6004811115610654576106546113cb565b8152602081019190915260400160002055508061067081611754565b9150506104ee565b50505060045550565b60008281526020819052604090206001015461069c81610f34565b6106a68383610f41565b505050565b6001600160a01b03811633146107205760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61072a8282610f63565b5050565b60008281526001602052604081206107469083610f85565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60006004546000148061078a575060045442105b905090565b600081815260016020526040812061048590610f91565b60606107b0610776565b156107e0575060408051808201909152600e81526d1cd85b19481a5cc818db1bdcd95960921b6020820152610485565b6000600360008560048111156107f8576107f86113cb565b6004811115610809576108096113cb565b81526020808201929092526040908101600020815160808101835281548152600182015493810184905260028201549281018390526003909101546060820152925090610857908590611741565b111561088e575050604080518082019091526013815272696e73756666696369656e7420737570706c7960681b6020820152610485565b505060408051602081019091526000815292915050565b6000828152602081905260409020600101546108c081610f34565b6106a68383610f63565b60025460609060008167ffffffffffffffff8111156108eb576108eb611411565b60405190808252806020026020018201604052801561094757816020015b6109346040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001906001900390816109095790505b50905060005b82811015610a1f57600360006002838154811061096c5761096c611715565b90600052602060002090602091828204019190069054906101000a900460ff16600481111561099d5761099d6113cb565b60048111156109ae576109ae6113cb565b8152602001908152602001600020604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050828281518110610a0157610a01611715565b60200260200101819052508080610a1790611754565b91505061094d565b5092915050565b610a2e610776565b15610a505760048054604051636cc09e7b60e01b815291820152602401610717565b600060036000856004811115610a6857610a686113cb565b6004811115610a7957610a796113cb565b81526020808201929092526040908101600020815160808101835281548152600182015493810184905260028201549281018390526003909101546060820152925090610ac7908490611741565b1115610afd578381602001518260400151610ae2919061176d565b604051632e9cb32760e21b8152600401610717929190611780565b6060810151610b0c908361179b565b341015610b45576060810151610b22908361179b565b604051631c102d6360e21b81526004810191909152346024820152604401610717565b60008267ffffffffffffffff811115610b6057610b60611411565b604051908082528060200260200182016040528015610b89578160200160208202803683370190505b50905060008367ffffffffffffffff811115610ba757610ba7611411565b604051908082528060200260200182016040528015610bd0578160200160208202803683370190505b50905060005b84811015610c655785838281518110610bf157610bf1611715565b60200260200101906001600160a01b031690816001600160a01b03168152505086828281518110610c2457610c24611715565b60200260200101906004811115610c3d57610c3d6113cb565b90816004811115610c5057610c506113cb565b90525080610c5d81611754565b915050610bd6565b50604051631a6dad1360e31b81526001600160a01b037f000000000000000000000000b4859acd9b0a65ca4897c31e5cb5160d9ff32c0a169063d36d689890610cb490859085906004016117b2565b6020604051808303816000875af1158015610cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf7919061183d565b508360036000886004811115610d0f57610d0f6113cb565b6004811115610d2057610d206113cb565b81526020019081526020016000206001016000828254610d409190611741565b90915550506040516000906001600160a01b037f00000000000000000000000096224b6a800294f40c547f7ec0952ea222526040169034908381818185875af1925050503d8060008114610db0576040519150601f19603f3d011682016040523d82523d6000602084013e610db5565b606091505b5050905080610e0857604051630e21dcbb60e11b81526001600160a01b037f00000000000000000000000096224b6a800294f40c547f7ec0952ea222526040166004820152346024820152604401610717565b866004811115610e1a57610e1a6113cb565b604080518781523460208201526001600160a01b038916917f1ec0c95078c890035e941915909bcfe875eca2b01352f0caaf74680fe1d297ce910160405180910390a350505050505050565b610e70828261074d565b61072a576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610ea63390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610746836001600160a01b038416610f9b565b60006001600160e01b03198216637965db0b60e01b148061048557506301ffc9a760e01b6001600160e01b0319831614610485565b610f3e8133610fea565b50565b610f4b8282610e66565b60008281526001602052604090206106a69082610eea565b610f6d8282611043565b60008281526001602052604090206106a690826110a8565b600061074683836110bd565b6000610485825490565b6000818152600183016020526040812054610fe257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610485565b506000610485565b610ff4828261074d565b61072a57611001816110e7565b61100c8360206110f9565b60405160200161101d929190611856565b60408051601f198184030181529082905262461bcd60e51b825261071791600401611627565b61104d828261074d565b1561072a576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610746836001600160a01b038416611295565b60008260000182815481106110d4576110d4611715565b9060005260206000200154905092915050565b60606104856001600160a01b03831660145b6060600061110883600261179b565b611113906002611741565b67ffffffffffffffff81111561112b5761112b611411565b6040519080825280601f01601f191660200182016040528015611155576020820181803683370190505b509050600360fc1b8160008151811061117057611170611715565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061119f5761119f611715565b60200101906001600160f81b031916908160001a90535060006111c384600261179b565b6111ce906001611741565b90505b6001811115611246576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061120257611202611715565b1a60f81b82828151811061121857611218611715565b60200101906001600160f81b031916908160001a90535060049490941c9361123f816118cb565b90506111d1565b5083156107465760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610717565b6000818152600183016020526040812054801561137e5760006112b960018361176d565b85549091506000906112cd9060019061176d565b90508181146113325760008660000182815481106112ed576112ed611715565b906000526020600020015490508087600001848154811061131057611310611715565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611343576113436118e2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610485565b6000915050610485565b60006020828403121561139a57600080fd5b81356001600160e01b03198116811461074657600080fd5b6000602082840312156113c457600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b600581106113ff57634e487b7160e01b600052602160045260246000fd5b9052565b6020810161048582846113e1565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561144a5761144a611411565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561147957611479611411565b604052919050565b80356005811061149057600080fd5b919050565b60008060408084860312156114a957600080fd5b833567ffffffffffffffff808211156114c157600080fd5b818601915086601f8301126114d557600080fd5b81356020828211156114e9576114e9611411565b6114f7818360051b01611450565b8281528181019350606092830285018201928a84111561151657600080fd5b948201945b838610156115655780868c0312156115335760008081fd5b61153b611427565b61154487611481565b8152868401358482015287870135888201528552948501949382019361151b565b50999701359750505050505050565b80356001600160a01b038116811461149057600080fd5b6000806040838503121561159e57600080fd5b823591506115ae60208401611574565b90509250929050565b600080604083850312156115ca57600080fd5b50508035926020909101359150565b600080604083850312156115ec57600080fd5b6115f583611481565b946020939093013593505050565b60005b8381101561161e578181015183820152602001611606565b50506000910152565b6020815260008251806020840152611646816040850160208701611603565b601f01601f19169190910160400192915050565b602080825282518282018190526000919060409081850190868401855b828110156116b157815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101611677565b5091979650505050505050565b6000806000606084860312156116d357600080fd5b6116dc84611481565b92506116ea60208501611574565b9150604084013590509250925092565b60006020828403121561170c57600080fd5b61074682611481565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156104855761048561172b565b6000600182016117665761176661172b565b5060010190565b818103818111156104855761048561172b565b6040810161178e82856113e1565b8260208301529392505050565b80820281158282048414176104855761048561172b565b604080825283519082018190526000906020906060840190828701845b828110156117f45781516001600160a01b0316845292840192908401906001016117cf565b5050508381038285015284518082528583019183019060005b81811015611830576118208385516113e1565b928401929184019160010161180d565b5090979650505050505050565b60006020828403121561184f57600080fd5b5051919050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161188e816017850160208801611603565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516118bf816028840160208801611603565b01602801949350505050565b6000816118da576118da61172b565b506000190190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220b1b6da4fb00abe4c4ad917de05ccd14f0c9e41b0d7a69cf0ede78b2037cba38164736f6c63430008120033

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

000000000000000000000000b4859acd9b0a65ca4897c31e5cb5160d9ff32c0a00000000000000000000000096224b6a800294f40c547f7ec0952ea2225260400000000000000000000000003cc4f4372f83ad3c577ed6e1aae3d244a1b955d500000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000002000000000000000000000000e73b648f6de254101052e126c0499c32ed736a37000000000000000000000000481074326ac46c7bc52f0b25d2f7aaf40f586472

-----Decoded View---------------
Arg [0] : _pookyball (address): 0xb4859acd9B0A65CA4897c31e5cb5160D9Ff32C0A
Arg [1] : _treasury (address): 0x96224B6a800294F40c547f7Ec0952eA222526040
Arg [2] : admin (address): 0x3CC4F4372F83ad3C577eD6e1Aae3D244A1b955D5
Arg [3] : sellers (address[]): 0xe73B648F6DE254101052e126C0499c32ed736a37,0x481074326aC46C7BC52f0b25D2F7Aaf40f586472

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000b4859acd9b0a65ca4897c31e5cb5160d9ff32c0a
Arg [1] : 00000000000000000000000096224b6a800294f40c547f7ec0952ea222526040
Arg [2] : 0000000000000000000000003cc4f4372f83ad3c577ed6e1aae3d244a1b955d5
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [5] : 000000000000000000000000e73b648f6de254101052e126c0499c32ed736a37
Arg [6] : 000000000000000000000000481074326ac46c7bc52f0b25d2f7aaf40f586472


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.