MATIC Price: $1.02 (-1.08%)
Gas: 96 GWei
 
Transaction Hash
Method
Block
From
To
Value
Set Approval For...541111322024-02-29 20:22:535 hrs 18 mins ago1709238173IN
0xb4859a...9Ff32C0A
0 MATIC0.0041089569.05457061
Set Approval For...541098162024-02-29 19:35:196 hrs 5 mins ago1709235319IN
0xb4859a...9Ff32C0A
0 MATIC0.00644059108.239865
Safe Transfer Fr...541057342024-02-29 17:08:438 hrs 32 mins ago1709226523IN
0xb4859a...9Ff32C0A
0 MATIC0.00648296135.78877755
Set Approval For...540993712024-02-29 13:21:3612 hrs 19 mins ago1709212896IN
0xb4859a...9Ff32C0A
0 MATIC0.0057489396.47960784
Set Approval For...540936822024-02-29 9:58:4515 hrs 42 mins ago1709200725IN
0xb4859a...9Ff32C0A
0 MATIC0.0049776383.65356102
Set Approval For...540921122024-02-29 9:02:3616 hrs 38 mins ago1709197356IN
0xb4859a...9Ff32C0A
0 MATIC0.0080087134.59321592
Safe Transfer Fr...540910972024-02-29 8:25:3417 hrs 15 mins ago1709195134IN
0xb4859a...9Ff32C0A
0 MATIC0.00813333139.34816066
Safe Transfer Fr...540877292024-02-29 6:23:4819 hrs 17 mins ago1709187828IN
0xb4859a...9Ff32C0A
0 MATIC0.00538408112.77214619
Safe Transfer Fr...540876272024-02-29 6:20:1019 hrs 20 mins ago1709187610IN
0xb4859a...9Ff32C0A
0 MATIC0.0043686891.50413025
Safe Transfer Fr...540875202024-02-29 6:16:2419 hrs 24 mins ago1709187384IN
0xb4859a...9Ff32C0A
0 MATIC0.0041243678.49506568
Set Approval For...540743082024-02-28 22:15:111 day 3 hrs ago1709158511IN
0xb4859a...9Ff32C0A
0 MATIC0.0039311665.9735133
Safe Transfer Fr...540729502024-02-28 21:25:251 day 4 hrs ago1709155525IN
0xb4859a...9Ff32C0A
0 MATIC0.004001261.76694417
Safe Transfer Fr...540724032024-02-28 21:05:511 day 4 hrs ago1709154351IN
0xb4859a...9Ff32C0A
0 MATIC0.0029700262.20866318
Safe Transfer Fr...540723542024-02-28 21:04:071 day 4 hrs ago1709154247IN
0xb4859a...9Ff32C0A
0 MATIC0.0036498169.46336255
Safe Transfer Fr...540722642024-02-28 21:00:551 day 4 hrs ago1709154055IN
0xb4859a...9Ff32C0A
0 MATIC0.0034892566.40760538
Set Approval For...540682482024-02-28 18:37:391 day 7 hrs ago1709145459IN
0xb4859a...9Ff32C0A
0 MATIC0.01332643223.96246504
Safe Transfer Fr...540621442024-02-28 14:54:361 day 10 hrs ago1709132076IN
0xb4859a...9Ff32C0A
0 MATIC0.00609334115.96880322
Safe Transfer Fr...540589332024-02-28 12:58:011 day 12 hrs ago1709125081IN
0xb4859a...9Ff32C0A
0 MATIC0.005733498.23021816
Set Approval For...540564492024-02-28 11:28:261 day 14 hrs ago1709119706IN
0xb4859a...9Ff32C0A
0 MATIC0.00917878154.25758609
Set Approval For...540560712024-02-28 11:14:301 day 14 hrs ago1709118870IN
0xb4859a...9Ff32C0A
0 MATIC0.00811271136.14910621
Set Approval For...540372392024-02-27 23:28:582 days 2 hrs ago1709076538IN
0xb4859a...9Ff32C0A
0 MATIC0.0042178870.88532738
Safe Transfer Fr...540364312024-02-27 22:54:542 days 2 hrs ago1709074494IN
0xb4859a...9Ff32C0A
0 MATIC0.00591286197.39814158
Safe Transfer Fr...540364302024-02-27 22:54:522 days 2 hrs ago1709074492IN
0xb4859a...9Ff32C0A
0 MATIC0.01152153197.39814158
Safe Transfer Fr...540228692024-02-27 14:37:232 days 11 hrs ago1709044643IN
0xb4859a...9Ff32C0A
0 MATIC0.0033298972.18353605
Safe Transfer Fr...540205602024-02-27 13:15:252 days 12 hrs ago1709039725IN
0xb4859a...9Ff32C0A
0 MATIC0.0045654795.62605186
View all transactions

Parent Txn Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Pookyball

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 23 : Pookyball.sol
// SPDX-License-Identifier: MIT
// Pooky Game Contracts (Pookyball.sol)
pragma solidity ^0.8.17;

import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "../interfaces/IPookyball.sol";
import "../types/PookyballMetadata.sol";
import "../types/PookyballRarity.sol";

/**
 * @title Pookyball
 * @author Pooky Engineering Team
 *
 * @notice Pookyball is ERC721 token representing Pookyball NFTs. Balls are mintable by other Pooky game contracts.
 * This contract does not hold any aspect of the Pooky gameplay and only serves as Pookyball information storage.
 *
 * In order to enforce the creator fees on secondary sales, we chose to adhere to the Operator Filter Registry
 * standard that was initially developed by OpenSea.
 * For more information, see https://github.com/ProjectOpenSea/operator-filter-registry
 *
 * Roles:
 * - DEFAULT_ADMIN_ROLE can add/remove roles.
 * - MINTER role can mint new tokens.
 * - GAME role can change the mutable token metadata (level and PXP).
 */
contract Pookyball is IPookyball, ERC721, ERC2981, AccessControl, VRFConsumerBaseV2, DefaultOperatorFilterer {
  using Strings for uint256;

  // Roles
  bytes32 public constant MINTER = keccak256("MINTER");
  bytes32 public constant GAME = keccak256("GAME");

  /// Secondary sales royalties, over 10,000 (5%)
  uint96 public constant ROYALTY = 500;

  /**
   * @notice The prefix of all the Pookyball metadata.
   */
  string public baseURI;

  /**
   * @notice URI of the contract-level metadata.
   * Specified by OpenSea documentation (https://docs.opensea.io/docs/contract-level-metadata).
   */
  string public contractURI;

  /// Last minted tokenId, will always exist
  uint256 public lastTokenId;

  /// Tokens gameplay metadata, see {PookyballMetadata}
  mapping(uint256 => PookyballMetadata) _metadata;

  // VRF parameters
  VRFCoordinatorV2Interface vrfCoordinator;
  bytes32 public vrfKeyHash;
  uint64 public vrfSubId;
  uint16 public vrfMinimumRequestConfirmations;
  uint32 public vrfCallbackGasLimit;
  mapping(uint256 => uint256) vrfRequests;

  constructor(
    string memory _baseURI,
    string memory _contractURI,
    address _receiver,
    address _vrfCoordinator,
    bytes32 _vrfKeyHash,
    uint64 _vrfSubId,
    uint16 _vrfMinimumRequestConfirmations,
    uint32 _vrfCallbackGasLimit
  ) ERC721("Pookyball", "PKYB") VRFConsumerBaseV2(_vrfCoordinator) {
    baseURI = _baseURI;
    contractURI = _contractURI;

    vrfCoordinator = VRFCoordinatorV2Interface(_vrfCoordinator);
    vrfKeyHash = _vrfKeyHash;
    vrfSubId = _vrfSubId;
    vrfMinimumRequestConfirmations = _vrfMinimumRequestConfirmations;
    vrfCallbackGasLimit = _vrfCallbackGasLimit;

    _setDefaultRoyalty(_receiver, ROYALTY);
    _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
  }

  /**
   * @notice Set the URI of the contract-level metadata.
   * @dev We keep this function as an escape hatch in case of a migration to another token metadata platform.
   * Requirements:
   * - Only DEFAULT_ADMIN_ROLE role can set the contract URI.
   */
  function setContractURI(string memory newContractURI) external onlyRole(DEFAULT_ADMIN_ROLE) {
    contractURI = newContractURI;
  }

  /**
   * @notice Change the base URI of the tokens URI.
   * @dev We keep this function as an escape hatch in case of a migration to another token metadata platform.
   * Requirements:
   * - Only DEFAULT_ADMIN_ROLE role can set base URI.
   */
  function setBaseURI(string memory newBaseURI) external onlyRole(DEFAULT_ADMIN_ROLE) {
    baseURI = newBaseURI;
  }

  /**
   * @notice Metadata URI of the token {tokenId}.
   * @dev See {IERC721Metadata-tokenURI}.
   * Requirements:
   * - Ball {tokenId} should exist (minted and not burned).
   */
  function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
    _requireMinted(tokenId);
    return string(abi.encodePacked(baseURI, tokenId.toString()));
  }

  /**
   * @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) {
    _requireMinted(tokenId);
    return _metadata[tokenId];
  }

  /**
   * @notice Change the secondary sale royalties receiver address.
   * @dev Requirements:
   * - Only DEFAULT_ADMIN_ROLE role can set base URI.
   */
  function setERC2981Receiver(address newReceiver) external onlyRole(DEFAULT_ADMIN_ROLE) {
    _setDefaultRoyalty(newReceiver, ROYALTY);
  }

  /**
   * @notice Mint a new Pookyball token with a given rarity. Level, PXP and seed are set to zero, entropy is
   * requested to the VRF coordinator.
   * @dev Requirements:
   * - sender must have the MINTER role.
   * - `recipients` and `rarities` arguments must have the same size
   */
  function mint(
    address[] memory recipients,
    PookyballRarity[] memory rarities
  ) external onlyRole(MINTER) returns (uint256) {
    // Check the arguments length
    if (recipients.length != rarities.length) {
      revert ArgumentSizeMismatch(recipients.length, rarities.length);
    }

    for (uint i = 0; i < recipients.length; i++) {
      _mint(recipients[i], ++lastTokenId);
      _metadata[lastTokenId] = PookyballMetadata(rarities[i], 0, 0, 0);
    }

    uint256 requestId = vrfCoordinator.requestRandomWords(
      vrfKeyHash,
      vrfSubId,
      vrfMinimumRequestConfirmations,
      vrfCallbackGasLimit,
      uint32(recipients.length)
    );
    vrfRequests[requestId] = lastTokenId;

    return lastTokenId;
  }

  /**
   * @notice Change the level of a Pookyball token.
   * @dev Requirements:
   * - sender must have the GAME role.
   * - Pookyball {tokenId} should exist (minted and not burned).
   */
  function setLevel(uint256 tokenId, uint256 newLevel) external onlyRole(GAME) {
    _requireMinted(tokenId);
    _metadata[tokenId].level = newLevel;
    emit LevelChanged(tokenId, newLevel);
  }

  /**
   * @notice Change the PXP of a Pookyball token.
   * @dev Requirements:
   * - sender must have the GAME role.
   * - Pookyball {tokenId} should exist (minted and not burned).
   */
  function setPXP(uint256 tokenId, uint256 newPXP) external onlyRole(GAME) {
    _requireMinted(tokenId);
    _metadata[tokenId].pxp = newPXP;
    emit PXPChanged(tokenId, newPXP);
  }

  /**
   * @notice Receive the entropy from the VRF coordinator.
   * @dev randomWords will only have one word as entropy is requested per token.
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
    uint256 tokenId = vrfRequests[requestId];

    // Apply the random words
    for (uint i = 0; i < randomWords.length; i++) {
      _metadata[tokenId - i].seed = randomWords[i];
      emit SeedSet(tokenId - i, randomWords[i]);
    }
  }

  /**
   * @notice IERC165 declaration.
   * @dev Supports the following `interfaceId`s:
   * - IERC165: 0x01ffc9a7
   * - IERC721: 0x80ac58cd
   * - IERC721Metadata: 0x5b5e139f
   * - IERC2981: 0x2a55205a
   */
  function supportsInterface(
    bytes4 interfaceId
  ) public view virtual override(IERC165, ERC721, ERC2981, AccessControl) returns (bool) {
    return super.supportsInterface(interfaceId);
  }

  /**
   * Operator Filter Registry implementation
   * @dev See {IERC721-setApprovalForAll}.
   */
  function setApprovalForAll(
    address operator,
    bool approved
  ) public override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) {
    super.setApprovalForAll(operator, approved);
  }

  /**
   * Operator Filter Registry implementation
   * @dev See {IERC721-approve}.
   */
  function approve(
    address operator,
    uint256 tokenId
  ) public override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) {
    super.approve(operator, tokenId);
  }

  /**
   * Operator Filter Registry implementation
   * @dev See {IERC721-transferFrom}.
   */
  function transferFrom(
    address from,
    address to,
    uint256 tokenId
  ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
    super.transferFrom(from, to, tokenId);
  }

  /**
   * Operator Filter Registry implementation
   * @dev See {IERC721-safeTransferFrom}.
   */
  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId
  ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
    super.safeTransferFrom(from, to, tokenId);
  }

  /**
   * Operator Filter Registry implementation
   * @dev See {IERC721-safeTransferFrom}.
   */
  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId,
    bytes memory data
  ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
    super.safeTransferFrom(from, to, tokenId, data);
  }
}

File 2 of 23 : VRFCoordinatorV2Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;

  /*
   * @notice Check to see if there exists a request commitment consumers
   * for all consumers and keyhashes for a given sub.
   * @param subId - ID of the subscription
   * @return true if there exists at least one unfulfilled request for the subscription, false
   * otherwise.
   */
  function pendingRequestExists(uint64 subId) external view returns (bool);
}

File 3 of 23 : VRFConsumerBaseV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness. It ensures 2 things:
 * @dev 1. The fulfillment came from the VRFCoordinator
 * @dev 2. The consumer contract implements fulfillRandomWords.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash). Create subscription, fund it
 * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
 * @dev subscription management functions).
 * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
 * @dev callbackGasLimit, numWords),
 * @dev see (VRFCoordinatorInterface for a description of the arguments).
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomWords method.
 *
 * @dev The randomness argument to fulfillRandomWords is a set of random words
 * @dev generated from your requestId and the blockHash of the request.
 *
 * @dev If your contract could have concurrent requests open, you can use the
 * @dev requestId returned from requestRandomWords to track which response is associated
 * @dev with which randomness request.
 * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ.
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request. It is for this reason that
 * @dev that you can signal to an oracle you'd like them to wait longer before
 * @dev responding to the request (however this is not enforced in the contract
 * @dev and so remains effective only in the case of unmodified oracle software).
 */
abstract contract VRFConsumerBaseV2 {
  error OnlyCoordinatorCanFulfill(address have, address want);
  address private immutable vrfCoordinator;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   */
  constructor(address _vrfCoordinator) {
    vrfCoordinator = _vrfCoordinator;
  }

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomWords the VRF output expanded to the requested number of words
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
    if (msg.sender != vrfCoordinator) {
      revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
    }
    fulfillRandomWords(requestId, randomWords);
  }
}

File 4 of 23 : 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 5 of 23 : 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 6 of 23 : 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 7 of 23 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

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

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @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.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _ownerOf(tokenId) != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId, 1);

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256, /* firstTokenId */
        uint256 batchSize
    ) internal virtual {
        if (batchSize > 1) {
            if (from != address(0)) {
                _balances[from] -= batchSize;
            }
            if (to != address(0)) {
                _balances[to] += batchSize;
            }
        }
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}
}

File 9 of 23 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 10 of 23 : 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 11 of 23 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 12 of 23 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 13 of 23 : 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 14 of 23 : 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 15 of 23 : 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 16 of 23 : 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 17 of 23 : 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 18 of 23 : 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 19 of 23 : 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 20 of 23 : PookyballRarity.sol
// SPDX-License-Identifier: MIT
// Pooky Game Contracts (types/PookyballRarity.sol)
pragma solidity ^0.8.17;

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

File 21 of 23 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {OperatorFilterer} from "./OperatorFilterer.sol";

/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 */
abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

File 22 of 23 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function unregister(address addr) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

File 23 of 23 : OperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";

/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (subscribe) {
                OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    OPERATOR_FILTER_REGISTRY.register(address(this));
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"string","name":"_contractURI","type":"string"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"bytes32","name":"_vrfKeyHash","type":"bytes32"},{"internalType":"uint64","name":"_vrfSubId","type":"uint64"},{"internalType":"uint16","name":"_vrfMinimumRequestConfirmations","type":"uint16"},{"internalType":"uint32","name":"_vrfCallbackGasLimit","type":"uint32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"},{"internalType":"uint256","name":"y","type":"uint256"}],"name":"ArgumentSizeMismatch","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"level","type":"uint256"}],"name":"LevelChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PXPChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"seed","type":"uint256"}],"name":"SeedSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROYALTY","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"metadata","outputs":[{"components":[{"internalType":"enum PookyballRarity","name":"rarity","type":"uint8"},{"internalType":"uint256","name":"level","type":"uint256"},{"internalType":"uint256","name":"pxp","type":"uint256"},{"internalType":"uint256","name":"seed","type":"uint256"}],"internalType":"struct PookyballMetadata","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"enum PookyballRarity[]","name":"rarities","type":"uint8[]"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newContractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newReceiver","type":"address"}],"name":"setERC2981Receiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"newLevel","type":"uint256"}],"name":"setLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"newPXP","type":"uint256"}],"name":"setPXP","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":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vrfCallbackGasLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfMinimumRequestConfirmations","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfSubId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"}]

60a06040523480156200001157600080fd5b50604051620031a4380380620031a483398101604081905262000034916200056a565b733cc6cdda760b79bafa08df41ecfa224f810dceb660018660405180604001604052806009815260200168141bdbdade58985b1b60ba1b815250604051806040016040528060048152602001632825aca160e11b81525081600090816200009c9190620006d1565b506001620000ab8282620006d1565b5050506001600160a01b03166080526daaeb6d7670e522a718067333cd4e3b15620001ff5780156200014d57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200012e57600080fd5b505af115801562000143573d6000803e3d6000fd5b50505050620001ff565b6001600160a01b038216156200019e5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000113565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620001e557600080fd5b505af1158015620001fa573d6000803e3d6000fd5b505050505b5060099050620002108982620006d1565b50600a6200021f8882620006d1565b50600d80546001600160a01b0319166001600160a01b038716179055600e849055600f80546001600160401b0385166001600160501b0319909116176801000000000000000061ffff8516021763ffffffff60501b19166a010000000000000000000063ffffffff8416021790556200029b866101f4620002b6565b620002a8600033620003bb565b50505050505050506200079d565b6127106001600160601b03821611156200032a5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003825760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640162000321565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600655565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff166200045c5760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200041b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200048857600080fd5b81516001600160401b0380821115620004a557620004a562000460565b604051601f8301601f19908116603f01168101908282118183101715620004d057620004d062000460565b81604052838152602092508683858801011115620004ed57600080fd5b600091505b83821015620005115785820183015181830184015290820190620004f2565b600093810190920192909252949350505050565b80516001600160a01b03811681146200053d57600080fd5b919050565b805161ffff811681146200053d57600080fd5b805163ffffffff811681146200053d57600080fd5b600080600080600080600080610100898b0312156200058857600080fd5b88516001600160401b0380821115620005a057600080fd5b620005ae8c838d0162000476565b995060208b0151915080821115620005c557600080fd5b620005d38c838d0162000476565b9850620005e360408c0162000525565b9750620005f360608c0162000525565b965060808b0151955060a08b0151915080821682146200061257600080fd5b5092506200062360c08a0162000542565b91506200063360e08a0162000555565b90509295985092959890939650565b600181811c908216806200065757607f821691505b6020821081036200067857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620006cc57600081815260208120601f850160051c81016020861015620006a75750805b601f850160051c820191505b81811015620006c857828155600101620006b3565b5050505b505050565b81516001600160401b03811115620006ed57620006ed62000460565b6200070581620006fe845462000642565b846200067e565b602080601f8311600181146200073d5760008415620007245750858301515b600019600386901b1c1916600185901b178555620006c8565b600085815260208120601f198616915b828110156200076e578886015182559484019460019091019084016200074d565b50858210156200078d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516129e4620007c0600039600081816106f7015261073901526129e46000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80636c0360eb1161013b578063b7cf12cf116100b8578063e3684e391161007c578063e3684e3914610575578063e8a3d48514610595578063e985e9c51461059d578063f84ddf0b146105d9578063fe6d8124146105e257600080fd5b8063b7cf12cf14610516578063b88d4fde14610529578063c87b56dd1461053c578063d36d68981461054f578063d547741f1461056257600080fd5b8063938e3d7b116100ff578063938e3d7b146104cd57806395d89b41146104e05780639b14e5d3146104e8578063a217fddf146104fb578063a22cb4651461050357600080fd5b80636c0360eb1461046b57806370a082311461047357806370a93b36146104865780638704a2081461049957806391d14854146104ba57600080fd5b80632a55205a116101c957806341f434341161018d57806341f43434146103f557806342842e0e1461040a57806355f804b31461041d5780636174da30146104305780636352211e1461045857600080fd5b80632a55205a146103465780632f2ff15d14610378578063326156401461038b57806336568abe146103b65780633b7ed734146103c957600080fd5b8063095ea7b311610210578063095ea7b3146102c15780631fe543e3146102d657806323b872dd146102e9578063248a9ca3146102fc57806327730d121461031f57600080fd5b806301ffc9a714610242578063041d443e1461026a57806306fdde0314610281578063081812fc14610296575b600080fd5b610255610250366004611f8e565b610609565b60405190151581526020015b60405180910390f35b610273600e5481565b604051908152602001610261565b61028961061a565b6040516102619190611ffb565b6102a96102a436600461200e565b6106ac565b6040516001600160a01b039091168152602001610261565b6102d46102cf366004612043565b6106d3565b005b6102d46102e43660046120d6565b6106ec565b6102d46102f7366004612177565b610779565b61027361030a36600461200e565b60009081526008602052604090206001015490565b6102737fd13d8e3c8822ff4d0a39994f3616e22d61c97585cee7a1baf4e9a875726b5f1581565b6103596103543660046121b3565b6107a4565b604080516001600160a01b039093168352602083019190915201610261565b6102d46103863660046121d5565b610850565b600f5461039e906001600160401b031681565b6040516001600160401b039091168152602001610261565b6102d46103c43660046121d5565b610875565b600f546103e090600160501b900463ffffffff1681565b60405163ffffffff9091168152602001610261565b6102a96daaeb6d7670e522a718067333cd4e81565b6102d4610418366004612177565b6108ef565b6102d461042b366004612258565b610914565b600f5461044590600160401b900461ffff1681565b60405161ffff9091168152602001610261565b6102a961046636600461200e565b61092b565b61028961098b565b6102736104813660046122a0565b610a19565b6102d46104943660046121b3565b610a9f565b6104a26101f481565b6040516001600160601b039091168152602001610261565b6102556104c83660046121d5565b610b27565b6102d46104db366004612258565b610b52565b610289610b69565b6102d46104f63660046122a0565b610b78565b610273600081565b6102d46105113660046122c9565b610b8f565b6102d46105243660046121b3565b610ba3565b6102d4610537366004612300565b610c1e565b61028961054a36600461200e565b610c4b565b61027361055d3660046123f0565b610c88565b6102d46105703660046121d5565b610ea7565b61058861058336600461200e565b610ecc565b60405161026191906124c5565b610289610f6b565b6102556105ab366004612512565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b610273600b5481565b6102737ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc981565b600061061482610f78565b92915050565b6060600080546106299061253c565b80601f01602080910402602001604051908101604052809291908181526020018280546106559061253c565b80156106a25780601f10610677576101008083540402835291602001916106a2565b820191906000526020600020905b81548152906001019060200180831161068557829003601f168201915b5050505050905090565b60006106b782610f9d565b506000908152600460205260409020546001600160a01b031690565b816106dd81610fff565b6106e783836110b8565b505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461076b5760405163073e64fd60e21b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b61077582826111c8565b5050565b826001600160a01b03811633146107935761079333610fff565b61079e84848461128e565b50505050565b60008281526007602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916108195750604080518082019091526006546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610838906001600160601b03168761258c565b61084291906125a3565b915196919550909350505050565b60008281526008602052604090206001015461086b816112bf565b6106e783836112c9565b6001600160a01b03811633146108e55760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610762565b610775828261134f565b826001600160a01b03811633146109095761090933610fff565b61079e8484846113b6565b600061091f816112bf565b60096106e78382612613565b6000818152600260205260408120546001600160a01b0316806106145760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610762565b600980546109989061253c565b80601f01602080910402602001604051908101604052809291908181526020018280546109c49061253c565b8015610a115780601f106109e657610100808354040283529160200191610a11565b820191906000526020600020905b8154815290600101906020018083116109f457829003601f168201915b505050505081565b60006001600160a01b038216610a835760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610762565b506001600160a01b031660009081526003602052604090205490565b7fd13d8e3c8822ff4d0a39994f3616e22d61c97585cee7a1baf4e9a875726b5f15610ac9816112bf565b610ad283610f9d565b6000838152600c6020526040908190206001018390555183907f8bdaee675270281b7bc2d5b9ced20517ecf5ce96158973ef78072a7bc1491b4490610b1a9085815260200190565b60405180910390a2505050565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610b5d816112bf565b600a6106e78382612613565b6060600180546106299061253c565b6000610b83816112bf565b610775826101f46113d1565b81610b9981610fff565b6106e783836114ce565b7fd13d8e3c8822ff4d0a39994f3616e22d61c97585cee7a1baf4e9a875726b5f15610bcd816112bf565b610bd683610f9d565b6000838152600c6020526040908190206002018390555183907f334246ed50b046a9933ddd38bbb387c51e3709753687788af1c5207d3689761b90610b1a9085815260200190565b836001600160a01b0381163314610c3857610c3833610fff565b610c44858585856114d9565b5050505050565b6060610c5682610f9d565b6009610c618361150b565b604051602001610c729291906126d2565b6040516020818303038152906040529050919050565b60007ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9610cb4816112bf565b8251845114610ce3578351835160405163990d9df760e01b815260048101929092526024820152604401610762565b60005b8451811015610dd657610d25858281518110610d0457610d04612759565b6020026020010151600b60008154610d1b9061276f565b918290555061159d565b6040518060800160405280858381518110610d4257610d42612759565b60200260200101516004811115610d5b57610d5b6124af565b81526000602080830182905260408084018390526060909301829052600b548252600c90522081518154829060ff19166001836004811115610d9f57610d9f6124af565b0217905550602082015160018201556040820151600282015560609091015160039091015580610dce8161276f565b915050610ce6565b50600d54600e54600f5486516040516305d3b1d360e41b815260048101939093526001600160401b038216602484015261ffff600160401b830416604484015263ffffffff600160501b909204821660648401521660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015610e65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e899190612788565b600b5460009182526010602052604090912081905595945050505050565b600082815260086020526040902060010154610ec2816112bf565b6106e7838361134f565b610ef8604080516080810190915280600081526020016000815260200160008152602001600081525090565b610f0182610f9d565b6000828152600c6020526040908190208151608081019092528054829060ff166004811115610f3257610f326124af565b6004811115610f4357610f436124af565b8152600182015460208201526002820154604082015260039091015460609091015292915050565b600a80546109989061253c565b60006001600160e01b03198216637965db0b60e01b1480610614575061061482611736565b6000818152600260205260409020546001600160a01b0316610ffc5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610762565b50565b6daaeb6d7670e522a718067333cd4e3b15610ffc57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561106c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109091906127a1565b610ffc57604051633b79c77360e21b81526001600160a01b0382166004820152602401610762565b60006110c38261092b565b9050806001600160a01b0316836001600160a01b0316036111305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610762565b336001600160a01b038216148061114c575061114c81336105ab565b6111be5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610762565b6106e7838361175b565b600082815260106020526040812054905b825181101561079e578281815181106111f4576111f4612759565b6020026020010151600c6000838561120c91906127be565b815260208101919091526040016000206003015561122a81836127be565b7f14296754697e325872a9c14eb682f467bc46b15a78ae9420d7a13a7cd3833b2c84838151811061125d5761125d612759565b602002602001015160405161127491815260200190565b60405180910390a2806112868161276f565b9150506111d9565b61129833826117c9565b6112b45760405162461bcd60e51b8152600401610762906127d1565b6106e7838383611848565b610ffc81336119b9565b6112d38282610b27565b6107755760008281526008602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561130b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6113598282610b27565b156107755760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6106e783838360405180602001604052806000815250610c1e565b6127106001600160601b038216111561143f5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610762565b6001600160a01b0382166114955760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610762565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600655565b610775338383611a12565b6114e333836117c9565b6114ff5760405162461bcd60e51b8152600401610762906127d1565b61079e84848484611ae0565b6060600061151883611b13565b60010190506000816001600160401b038111156115375761153761206d565b6040519080825280601f01601f191660200182016040528015611561576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461156b57509392505050565b6001600160a01b0382166115f35760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610762565b6000818152600260205260409020546001600160a01b0316156116585760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610762565b611666600083836001611beb565b6000818152600260205260409020546001600160a01b0316156116cb5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610762565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b0319821663152a902d60e11b1480610614575061061482611c73565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906117908261092b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806117d58361092b565b9050806001600160a01b0316846001600160a01b0316148061181c57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806118405750836001600160a01b0316611835846106ac565b6001600160a01b0316145b949350505050565b826001600160a01b031661185b8261092b565b6001600160a01b0316146118815760405162461bcd60e51b81526004016107629061281e565b6001600160a01b0382166118e35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610762565b6118f08383836001611beb565b826001600160a01b03166119038261092b565b6001600160a01b0316146119295760405162461bcd60e51b81526004016107629061281e565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6119c38282610b27565b610775576119d081611cc3565b6119db836020611cd5565b6040516020016119ec929190612863565b60408051601f198184030181529082905262461bcd60e51b825261076291600401611ffb565b816001600160a01b0316836001600160a01b031603611a735760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610762565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611aeb848484611848565b611af784848484611e77565b61079e5760405162461bcd60e51b8152600401610762906128d8565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611b525772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611b7e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611b9c57662386f26fc10000830492506010015b6305f5e1008310611bb4576305f5e100830492506008015b6127108310611bc857612710830492506004015b60648310611bda576064830492506002015b600a83106106145760010192915050565b600181111561079e576001600160a01b03841615611c31576001600160a01b03841660009081526003602052604081208054839290611c2b9084906127be565b90915550505b6001600160a01b0383161561079e576001600160a01b03831660009081526003602052604081208054839290611c6890849061292a565b909155505050505050565b60006001600160e01b031982166380ac58cd60e01b1480611ca457506001600160e01b03198216635b5e139f60e01b145b8061061457506301ffc9a760e01b6001600160e01b0319831614610614565b60606106146001600160a01b03831660145b60606000611ce483600261258c565b611cef90600261292a565b6001600160401b03811115611d0657611d0661206d565b6040519080825280601f01601f191660200182016040528015611d30576020820181803683370190505b509050600360fc1b81600081518110611d4b57611d4b612759565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611d7a57611d7a612759565b60200101906001600160f81b031916908160001a9053506000611d9e84600261258c565b611da990600161292a565b90505b6001811115611e21576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ddd57611ddd612759565b1a60f81b828281518110611df357611df3612759565b60200101906001600160f81b031916908160001a90535060049490941c93611e1a8161293d565b9050611dac565b508315611e705760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610762565b9392505050565b60006001600160a01b0384163b15611f6d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ebb903390899088908890600401612954565b6020604051808303816000875af1925050508015611ef6575060408051601f3d908101601f19168201909252611ef391810190612991565b60015b611f53573d808015611f24576040519150601f19603f3d011682016040523d82523d6000602084013e611f29565b606091505b508051600003611f4b5760405162461bcd60e51b8152600401610762906128d8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611840565b506001949350505050565b6001600160e01b031981168114610ffc57600080fd5b600060208284031215611fa057600080fd5b8135611e7081611f78565b60005b83811015611fc6578181015183820152602001611fae565b50506000910152565b60008151808452611fe7816020860160208601611fab565b601f01601f19169290920160200192915050565b602081526000611e706020830184611fcf565b60006020828403121561202057600080fd5b5035919050565b80356001600160a01b038116811461203e57600080fd5b919050565b6000806040838503121561205657600080fd5b61205f83612027565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156120ab576120ab61206d565b604052919050565b60006001600160401b038211156120cc576120cc61206d565b5060051b60200190565b600080604083850312156120e957600080fd5b823591506020808401356001600160401b0381111561210757600080fd5b8401601f8101861361211857600080fd5b803561212b612126826120b3565b612083565b81815260059190911b8201830190838101908883111561214a57600080fd5b928401925b828410156121685783358252928401929084019061214f565b80955050505050509250929050565b60008060006060848603121561218c57600080fd5b61219584612027565b92506121a360208501612027565b9150604084013590509250925092565b600080604083850312156121c657600080fd5b50508035926020909101359150565b600080604083850312156121e857600080fd5b823591506121f860208401612027565b90509250929050565b60006001600160401b0383111561221a5761221a61206d565b61222d601f8401601f1916602001612083565b905082815283838301111561224157600080fd5b828260208301376000602084830101529392505050565b60006020828403121561226a57600080fd5b81356001600160401b0381111561228057600080fd5b8201601f8101841361229157600080fd5b61184084823560208401612201565b6000602082840312156122b257600080fd5b611e7082612027565b8015158114610ffc57600080fd5b600080604083850312156122dc57600080fd5b6122e583612027565b915060208301356122f5816122bb565b809150509250929050565b6000806000806080858703121561231657600080fd5b61231f85612027565b935061232d60208601612027565b92506040850135915060608501356001600160401b0381111561234f57600080fd5b8501601f8101871361236057600080fd5b61236f87823560208401612201565b91505092959194509250565b600082601f83011261238c57600080fd5b8135602061239c612126836120b3565b828152600592831b85018201928282019190878511156123bb57600080fd5b8387015b858110156123e35780358281106123d65760008081fd5b84529284019284016123bf565b5090979650505050505050565b6000806040838503121561240357600080fd5b82356001600160401b038082111561241a57600080fd5b818501915085601f83011261242e57600080fd5b8135602061243e612126836120b3565b82815260059290921b8401810191818101908984111561245d57600080fd5b948201945b838610156124825761247386612027565b82529482019490820190612462565b9650508601359250508082111561249857600080fd5b506124a58582860161237b565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b81516080820190600581106124ea57634e487b7160e01b600052602160045260246000fd5b8083525060208301516020830152604083015160408301526060830151606083015292915050565b6000806040838503121561252557600080fd5b61252e83612027565b91506121f860208401612027565b600181811c9082168061255057607f821691505b60208210810361257057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761061457610614612576565b6000826125c057634e487b7160e01b600052601260045260246000fd5b500490565b601f8211156106e757600081815260208120601f850160051c810160208610156125ec5750805b601f850160051c820191505b8181101561260b578281556001016125f8565b505050505050565b81516001600160401b0381111561262c5761262c61206d565b6126408161263a845461253c565b846125c5565b602080601f831160018114612675576000841561265d5750858301515b600019600386901b1c1916600185901b17855561260b565b600085815260208120601f198616915b828110156126a457888601518255948401946001909101908401612685565b50858210156126c25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008084546126e08161253c565b600182811680156126f8576001811461270d5761273c565b60ff198416875282151583028701945061273c565b8860005260208060002060005b858110156127335781548a82015290840190820161271a565b50505082870194505b505050508351612750818360208801611fab565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b60006001820161278157612781612576565b5060010190565b60006020828403121561279a57600080fd5b5051919050565b6000602082840312156127b357600080fd5b8151611e70816122bb565b8181038181111561061457610614612576565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161289b816017850160208801611fab565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516128cc816028840160208801611fab565b01602801949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b8082018082111561061457610614612576565b60008161294c5761294c612576565b506000190190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061298790830184611fcf565b9695505050505050565b6000602082840312156129a357600080fd5b8151611e7081611f7856fea264697066735822122061d5fd3ccbe0d45addaecbdf2f68e037df27440abe474323b6cbd27ca9d51b8a64736f6c6343000811003300000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000598895f50951186efdcb160764a538f353894027000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067cc294a196eeeb44da2888d17c0625cc88d70d9760a69d58d853ba6581a9ab0cd000000000000000000000000000000000000000000000000000000000000024a000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000002625a0000000000000000000000000000000000000000000000000000000000000001868747470733a2f2f746f6b656e732e706f6f6b792e67672f0000000000000000000000000000000000000000000000000000000000000000000000000000003068747470733a2f2f7374617469632e706f6f6b792e67672f636f6e7472616374732f506f6f6b7962616c6c2e6a736f6e00000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061023d5760003560e01c80636c0360eb1161013b578063b7cf12cf116100b8578063e3684e391161007c578063e3684e3914610575578063e8a3d48514610595578063e985e9c51461059d578063f84ddf0b146105d9578063fe6d8124146105e257600080fd5b8063b7cf12cf14610516578063b88d4fde14610529578063c87b56dd1461053c578063d36d68981461054f578063d547741f1461056257600080fd5b8063938e3d7b116100ff578063938e3d7b146104cd57806395d89b41146104e05780639b14e5d3146104e8578063a217fddf146104fb578063a22cb4651461050357600080fd5b80636c0360eb1461046b57806370a082311461047357806370a93b36146104865780638704a2081461049957806391d14854146104ba57600080fd5b80632a55205a116101c957806341f434341161018d57806341f43434146103f557806342842e0e1461040a57806355f804b31461041d5780636174da30146104305780636352211e1461045857600080fd5b80632a55205a146103465780632f2ff15d14610378578063326156401461038b57806336568abe146103b65780633b7ed734146103c957600080fd5b8063095ea7b311610210578063095ea7b3146102c15780631fe543e3146102d657806323b872dd146102e9578063248a9ca3146102fc57806327730d121461031f57600080fd5b806301ffc9a714610242578063041d443e1461026a57806306fdde0314610281578063081812fc14610296575b600080fd5b610255610250366004611f8e565b610609565b60405190151581526020015b60405180910390f35b610273600e5481565b604051908152602001610261565b61028961061a565b6040516102619190611ffb565b6102a96102a436600461200e565b6106ac565b6040516001600160a01b039091168152602001610261565b6102d46102cf366004612043565b6106d3565b005b6102d46102e43660046120d6565b6106ec565b6102d46102f7366004612177565b610779565b61027361030a36600461200e565b60009081526008602052604090206001015490565b6102737fd13d8e3c8822ff4d0a39994f3616e22d61c97585cee7a1baf4e9a875726b5f1581565b6103596103543660046121b3565b6107a4565b604080516001600160a01b039093168352602083019190915201610261565b6102d46103863660046121d5565b610850565b600f5461039e906001600160401b031681565b6040516001600160401b039091168152602001610261565b6102d46103c43660046121d5565b610875565b600f546103e090600160501b900463ffffffff1681565b60405163ffffffff9091168152602001610261565b6102a96daaeb6d7670e522a718067333cd4e81565b6102d4610418366004612177565b6108ef565b6102d461042b366004612258565b610914565b600f5461044590600160401b900461ffff1681565b60405161ffff9091168152602001610261565b6102a961046636600461200e565b61092b565b61028961098b565b6102736104813660046122a0565b610a19565b6102d46104943660046121b3565b610a9f565b6104a26101f481565b6040516001600160601b039091168152602001610261565b6102556104c83660046121d5565b610b27565b6102d46104db366004612258565b610b52565b610289610b69565b6102d46104f63660046122a0565b610b78565b610273600081565b6102d46105113660046122c9565b610b8f565b6102d46105243660046121b3565b610ba3565b6102d4610537366004612300565b610c1e565b61028961054a36600461200e565b610c4b565b61027361055d3660046123f0565b610c88565b6102d46105703660046121d5565b610ea7565b61058861058336600461200e565b610ecc565b60405161026191906124c5565b610289610f6b565b6102556105ab366004612512565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b610273600b5481565b6102737ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc981565b600061061482610f78565b92915050565b6060600080546106299061253c565b80601f01602080910402602001604051908101604052809291908181526020018280546106559061253c565b80156106a25780601f10610677576101008083540402835291602001916106a2565b820191906000526020600020905b81548152906001019060200180831161068557829003601f168201915b5050505050905090565b60006106b782610f9d565b506000908152600460205260409020546001600160a01b031690565b816106dd81610fff565b6106e783836110b8565b505050565b336001600160a01b037f000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067161461076b5760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000ae975071be8f8ee67addbc1a82488f1c248580671660248201526044015b60405180910390fd5b61077582826111c8565b5050565b826001600160a01b03811633146107935761079333610fff565b61079e84848461128e565b50505050565b60008281526007602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916108195750604080518082019091526006546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610838906001600160601b03168761258c565b61084291906125a3565b915196919550909350505050565b60008281526008602052604090206001015461086b816112bf565b6106e783836112c9565b6001600160a01b03811633146108e55760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610762565b610775828261134f565b826001600160a01b03811633146109095761090933610fff565b61079e8484846113b6565b600061091f816112bf565b60096106e78382612613565b6000818152600260205260408120546001600160a01b0316806106145760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610762565b600980546109989061253c565b80601f01602080910402602001604051908101604052809291908181526020018280546109c49061253c565b8015610a115780601f106109e657610100808354040283529160200191610a11565b820191906000526020600020905b8154815290600101906020018083116109f457829003601f168201915b505050505081565b60006001600160a01b038216610a835760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610762565b506001600160a01b031660009081526003602052604090205490565b7fd13d8e3c8822ff4d0a39994f3616e22d61c97585cee7a1baf4e9a875726b5f15610ac9816112bf565b610ad283610f9d565b6000838152600c6020526040908190206001018390555183907f8bdaee675270281b7bc2d5b9ced20517ecf5ce96158973ef78072a7bc1491b4490610b1a9085815260200190565b60405180910390a2505050565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610b5d816112bf565b600a6106e78382612613565b6060600180546106299061253c565b6000610b83816112bf565b610775826101f46113d1565b81610b9981610fff565b6106e783836114ce565b7fd13d8e3c8822ff4d0a39994f3616e22d61c97585cee7a1baf4e9a875726b5f15610bcd816112bf565b610bd683610f9d565b6000838152600c6020526040908190206002018390555183907f334246ed50b046a9933ddd38bbb387c51e3709753687788af1c5207d3689761b90610b1a9085815260200190565b836001600160a01b0381163314610c3857610c3833610fff565b610c44858585856114d9565b5050505050565b6060610c5682610f9d565b6009610c618361150b565b604051602001610c729291906126d2565b6040516020818303038152906040529050919050565b60007ff0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9610cb4816112bf565b8251845114610ce3578351835160405163990d9df760e01b815260048101929092526024820152604401610762565b60005b8451811015610dd657610d25858281518110610d0457610d04612759565b6020026020010151600b60008154610d1b9061276f565b918290555061159d565b6040518060800160405280858381518110610d4257610d42612759565b60200260200101516004811115610d5b57610d5b6124af565b81526000602080830182905260408084018390526060909301829052600b548252600c90522081518154829060ff19166001836004811115610d9f57610d9f6124af565b0217905550602082015160018201556040820151600282015560609091015160039091015580610dce8161276f565b915050610ce6565b50600d54600e54600f5486516040516305d3b1d360e41b815260048101939093526001600160401b038216602484015261ffff600160401b830416604484015263ffffffff600160501b909204821660648401521660848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015610e65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e899190612788565b600b5460009182526010602052604090912081905595945050505050565b600082815260086020526040902060010154610ec2816112bf565b6106e7838361134f565b610ef8604080516080810190915280600081526020016000815260200160008152602001600081525090565b610f0182610f9d565b6000828152600c6020526040908190208151608081019092528054829060ff166004811115610f3257610f326124af565b6004811115610f4357610f436124af565b8152600182015460208201526002820154604082015260039091015460609091015292915050565b600a80546109989061253c565b60006001600160e01b03198216637965db0b60e01b1480610614575061061482611736565b6000818152600260205260409020546001600160a01b0316610ffc5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610762565b50565b6daaeb6d7670e522a718067333cd4e3b15610ffc57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561106c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109091906127a1565b610ffc57604051633b79c77360e21b81526001600160a01b0382166004820152602401610762565b60006110c38261092b565b9050806001600160a01b0316836001600160a01b0316036111305760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610762565b336001600160a01b038216148061114c575061114c81336105ab565b6111be5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610762565b6106e7838361175b565b600082815260106020526040812054905b825181101561079e578281815181106111f4576111f4612759565b6020026020010151600c6000838561120c91906127be565b815260208101919091526040016000206003015561122a81836127be565b7f14296754697e325872a9c14eb682f467bc46b15a78ae9420d7a13a7cd3833b2c84838151811061125d5761125d612759565b602002602001015160405161127491815260200190565b60405180910390a2806112868161276f565b9150506111d9565b61129833826117c9565b6112b45760405162461bcd60e51b8152600401610762906127d1565b6106e7838383611848565b610ffc81336119b9565b6112d38282610b27565b6107755760008281526008602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561130b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6113598282610b27565b156107755760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6106e783838360405180602001604052806000815250610c1e565b6127106001600160601b038216111561143f5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610762565b6001600160a01b0382166114955760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610762565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600655565b610775338383611a12565b6114e333836117c9565b6114ff5760405162461bcd60e51b8152600401610762906127d1565b61079e84848484611ae0565b6060600061151883611b13565b60010190506000816001600160401b038111156115375761153761206d565b6040519080825280601f01601f191660200182016040528015611561576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461156b57509392505050565b6001600160a01b0382166115f35760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610762565b6000818152600260205260409020546001600160a01b0316156116585760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610762565b611666600083836001611beb565b6000818152600260205260409020546001600160a01b0316156116cb5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610762565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b0319821663152a902d60e11b1480610614575061061482611c73565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906117908261092b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806117d58361092b565b9050806001600160a01b0316846001600160a01b0316148061181c57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806118405750836001600160a01b0316611835846106ac565b6001600160a01b0316145b949350505050565b826001600160a01b031661185b8261092b565b6001600160a01b0316146118815760405162461bcd60e51b81526004016107629061281e565b6001600160a01b0382166118e35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610762565b6118f08383836001611beb565b826001600160a01b03166119038261092b565b6001600160a01b0316146119295760405162461bcd60e51b81526004016107629061281e565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6119c38282610b27565b610775576119d081611cc3565b6119db836020611cd5565b6040516020016119ec929190612863565b60408051601f198184030181529082905262461bcd60e51b825261076291600401611ffb565b816001600160a01b0316836001600160a01b031603611a735760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610762565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611aeb848484611848565b611af784848484611e77565b61079e5760405162461bcd60e51b8152600401610762906128d8565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611b525772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611b7e576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611b9c57662386f26fc10000830492506010015b6305f5e1008310611bb4576305f5e100830492506008015b6127108310611bc857612710830492506004015b60648310611bda576064830492506002015b600a83106106145760010192915050565b600181111561079e576001600160a01b03841615611c31576001600160a01b03841660009081526003602052604081208054839290611c2b9084906127be565b90915550505b6001600160a01b0383161561079e576001600160a01b03831660009081526003602052604081208054839290611c6890849061292a565b909155505050505050565b60006001600160e01b031982166380ac58cd60e01b1480611ca457506001600160e01b03198216635b5e139f60e01b145b8061061457506301ffc9a760e01b6001600160e01b0319831614610614565b60606106146001600160a01b03831660145b60606000611ce483600261258c565b611cef90600261292a565b6001600160401b03811115611d0657611d0661206d565b6040519080825280601f01601f191660200182016040528015611d30576020820181803683370190505b509050600360fc1b81600081518110611d4b57611d4b612759565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611d7a57611d7a612759565b60200101906001600160f81b031916908160001a9053506000611d9e84600261258c565b611da990600161292a565b90505b6001811115611e21576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611ddd57611ddd612759565b1a60f81b828281518110611df357611df3612759565b60200101906001600160f81b031916908160001a90535060049490941c93611e1a8161293d565b9050611dac565b508315611e705760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610762565b9392505050565b60006001600160a01b0384163b15611f6d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611ebb903390899088908890600401612954565b6020604051808303816000875af1925050508015611ef6575060408051601f3d908101601f19168201909252611ef391810190612991565b60015b611f53573d808015611f24576040519150601f19603f3d011682016040523d82523d6000602084013e611f29565b606091505b508051600003611f4b5760405162461bcd60e51b8152600401610762906128d8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611840565b506001949350505050565b6001600160e01b031981168114610ffc57600080fd5b600060208284031215611fa057600080fd5b8135611e7081611f78565b60005b83811015611fc6578181015183820152602001611fae565b50506000910152565b60008151808452611fe7816020860160208601611fab565b601f01601f19169290920160200192915050565b602081526000611e706020830184611fcf565b60006020828403121561202057600080fd5b5035919050565b80356001600160a01b038116811461203e57600080fd5b919050565b6000806040838503121561205657600080fd5b61205f83612027565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156120ab576120ab61206d565b604052919050565b60006001600160401b038211156120cc576120cc61206d565b5060051b60200190565b600080604083850312156120e957600080fd5b823591506020808401356001600160401b0381111561210757600080fd5b8401601f8101861361211857600080fd5b803561212b612126826120b3565b612083565b81815260059190911b8201830190838101908883111561214a57600080fd5b928401925b828410156121685783358252928401929084019061214f565b80955050505050509250929050565b60008060006060848603121561218c57600080fd5b61219584612027565b92506121a360208501612027565b9150604084013590509250925092565b600080604083850312156121c657600080fd5b50508035926020909101359150565b600080604083850312156121e857600080fd5b823591506121f860208401612027565b90509250929050565b60006001600160401b0383111561221a5761221a61206d565b61222d601f8401601f1916602001612083565b905082815283838301111561224157600080fd5b828260208301376000602084830101529392505050565b60006020828403121561226a57600080fd5b81356001600160401b0381111561228057600080fd5b8201601f8101841361229157600080fd5b61184084823560208401612201565b6000602082840312156122b257600080fd5b611e7082612027565b8015158114610ffc57600080fd5b600080604083850312156122dc57600080fd5b6122e583612027565b915060208301356122f5816122bb565b809150509250929050565b6000806000806080858703121561231657600080fd5b61231f85612027565b935061232d60208601612027565b92506040850135915060608501356001600160401b0381111561234f57600080fd5b8501601f8101871361236057600080fd5b61236f87823560208401612201565b91505092959194509250565b600082601f83011261238c57600080fd5b8135602061239c612126836120b3565b828152600592831b85018201928282019190878511156123bb57600080fd5b8387015b858110156123e35780358281106123d65760008081fd5b84529284019284016123bf565b5090979650505050505050565b6000806040838503121561240357600080fd5b82356001600160401b038082111561241a57600080fd5b818501915085601f83011261242e57600080fd5b8135602061243e612126836120b3565b82815260059290921b8401810191818101908984111561245d57600080fd5b948201945b838610156124825761247386612027565b82529482019490820190612462565b9650508601359250508082111561249857600080fd5b506124a58582860161237b565b9150509250929050565b634e487b7160e01b600052602160045260246000fd5b81516080820190600581106124ea57634e487b7160e01b600052602160045260246000fd5b8083525060208301516020830152604083015160408301526060830151606083015292915050565b6000806040838503121561252557600080fd5b61252e83612027565b91506121f860208401612027565b600181811c9082168061255057607f821691505b60208210810361257057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761061457610614612576565b6000826125c057634e487b7160e01b600052601260045260246000fd5b500490565b601f8211156106e757600081815260208120601f850160051c810160208610156125ec5750805b601f850160051c820191505b8181101561260b578281556001016125f8565b505050505050565b81516001600160401b0381111561262c5761262c61206d565b6126408161263a845461253c565b846125c5565b602080601f831160018114612675576000841561265d5750858301515b600019600386901b1c1916600185901b17855561260b565b600085815260208120601f198616915b828110156126a457888601518255948401946001909101908401612685565b50858210156126c25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008084546126e08161253c565b600182811680156126f8576001811461270d5761273c565b60ff198416875282151583028701945061273c565b8860005260208060002060005b858110156127335781548a82015290840190820161271a565b50505082870194505b505050508351612750818360208801611fab565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b60006001820161278157612781612576565b5060010190565b60006020828403121561279a57600080fd5b5051919050565b6000602082840312156127b357600080fd5b8151611e70816122bb565b8181038181111561061457610614612576565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161289b816017850160208801611fab565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516128cc816028840160208801611fab565b01602801949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b8082018082111561061457610614612576565b60008161294c5761294c612576565b506000190190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061298790830184611fcf565b9695505050505050565b6000602082840312156129a357600080fd5b8151611e7081611f7856fea264697066735822122061d5fd3ccbe0d45addaecbdf2f68e037df27440abe474323b6cbd27ca9d51b8a64736f6c63430008110033

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

00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000598895f50951186efdcb160764a538f353894027000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067cc294a196eeeb44da2888d17c0625cc88d70d9760a69d58d853ba6581a9ab0cd000000000000000000000000000000000000000000000000000000000000024a000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000002625a0000000000000000000000000000000000000000000000000000000000000001868747470733a2f2f746f6b656e732e706f6f6b792e67672f0000000000000000000000000000000000000000000000000000000000000000000000000000003068747470733a2f2f7374617469632e706f6f6b792e67672f636f6e7472616374732f506f6f6b7962616c6c2e6a736f6e00000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _baseURI (string): https://tokens.pooky.gg/
Arg [1] : _contractURI (string): https://static.pooky.gg/contracts/Pookyball.json
Arg [2] : _receiver (address): 0x598895F50951186eFdCB160764a538f353894027
Arg [3] : _vrfCoordinator (address): 0xAE975071Be8F8eE67addBC1A82488F1C24858067
Arg [4] : _vrfKeyHash (bytes32): 0xcc294a196eeeb44da2888d17c0625cc88d70d9760a69d58d853ba6581a9ab0cd
Arg [5] : _vrfSubId (uint64): 586
Arg [6] : _vrfMinimumRequestConfirmations (uint16): 10
Arg [7] : _vrfCallbackGasLimit (uint32): 2500000

-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [2] : 000000000000000000000000598895f50951186efdcb160764a538f353894027
Arg [3] : 000000000000000000000000ae975071be8f8ee67addbc1a82488f1c24858067
Arg [4] : cc294a196eeeb44da2888d17c0625cc88d70d9760a69d58d853ba6581a9ab0cd
Arg [5] : 000000000000000000000000000000000000000000000000000000000000024a
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 00000000000000000000000000000000000000000000000000000000002625a0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000018
Arg [9] : 68747470733a2f2f746f6b656e732e706f6f6b792e67672f0000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000030
Arg [11] : 68747470733a2f2f7374617469632e706f6f6b792e67672f636f6e7472616374
Arg [12] : 732f506f6f6b7962616c6c2e6a736f6e00000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.