Contract 0x83f82414b5065bB9A85E330C67B4A10f798F4eD2

Token Contract 
 
 
Txn Hash
Method
Block
From
To
Value
0x9954380d2b3752e5ed6095f4847d1d64bb5347ca37a986d8933c318704ba4819Transfer From161488712022-12-09 18:15:596 hrs 55 mins ago0x99fdb1af7389c345c6ef06d527157a47638b879e IN  KaijuMutant: MUTANT Token0 Ether0.00143158 35.19488379
0xdd71a23d215f4692349e26007f47f375b32f91e4ed7915e009be06e8e57ffef8Transfer From161485292022-12-09 17:07:118 hrs 4 mins ago0x99fdb1af7389c345c6ef06d527157a47638b879e IN  KaijuMutant: MUTANT Token0 Ether0.00394054 96.8764872
0xe67af4b42309076dec117c77dea9577207ad1ee386c4dfe604e0920ca8d7e6f7Safe Transfer Fr...161450712022-12-09 5:29:2319 hrs 42 mins ago0x0a2c2cead92586a4ba3f6fa9c61a2b9ce2529b6d IN  KaijuMutant: MUTANT Token0 Ether0.00067613 13.90968235
0x1524cee115faa0e220468c3779a5183a55c39824795ce395da4502a1dd5863edSet Approval For...161448882022-12-09 4:52:3520 hrs 19 mins agoENS Name bootylover.eth IN  KaijuMutant: MUTANT Token0 Ether0.00066544 14.37926983
0x7ddfe33076271283962aad26a304187b7ed0e61fe11716b111c940cbf1a59be1Safe Transfer Fr...161442312022-12-09 2:40:3522 hrs 31 mins agoENS Name nftunker.eth IN  KaijuMutant: MUTANT Token0 Ether0.00097295 15.97081785
0x4c7b9ad116477a48e24c84f7134fa027ac15a52e3a714b7c96d87eda55bc5160Safe Transfer Fr...161441462022-12-09 2:23:3522 hrs 48 mins ago0x126be82b3edad59f41d40417187c62f9b82e8e92 IN  KaijuMutant: MUTANT Token0 Ether0.00086283 14.16316796
0x7281e0a10e92d01d1f1ecc38fc8d0f0e914b687bef3f78b1a70bee6b5977cbd5Set Approval For...161437172022-12-09 0:57:351 day 14 mins ago0x9ab85cc1fbd4ab2a37d251c0a5c21cb32e1ac314 IN  KaijuMutant: MUTANT Token0 Ether0.00064699 13.9734742
0x83f3cd33a406da8265601d68ea78cde5cf595ecf70627e0ea42cfe3ded2140e2Set Approval For...161422772022-12-08 20:08:111 day 5 hrs ago0x23ab249e094f17b525089d27d656b030731b5dba IN  KaijuMutant: MUTANT Token0 Ether0.00084539 18.26764442
0xe5d6eb1a9a5b4408cab7e0fcb99b857e4cab607674e82e0e3b3a023979cb3ee6Set Approval For...161413372022-12-08 16:59:111 day 8 hrs agoENS Name diamondzxc.eth IN  KaijuMutant: MUTANT Token0 Ether0.0007098 15.32987576
0x2190e5d58da15fba7fb70ee2b4a67f064c878edf73f559da2651750bbdfc6a15Safe Transfer Fr...161413192022-12-08 16:55:351 day 8 hrs ago0xc8fe50fad44172660633acc2345a25bdc850d277 IN  KaijuMutant: MUTANT Token0 Ether0.00087008 14.28210367
0x74ea4c3adee9708d05f11ca208e9ad34becc669bae3d878b9b8117c4756b1674Set Approval For...161393222022-12-08 10:13:351 day 14 hrs ago0x2507f5f7622cc7097630dd6e060719e063778b2b IN  KaijuMutant: MUTANT Token0 Ether0.00066106 14.27716424
0xacabfa0629c07f326b217db88f7dc56a14859988955c92fc33f2b449d5044e95Safe Transfer Fr...161373512022-12-08 3:37:111 day 21 hrs agoENS Name slav1.eth IN  KaijuMutant: MUTANT Token0 Ether0.00095895 15.74096337
0x1ad6ed6ca9e6664032d2b01deef868087e6e878bb8e8738cf054251c9d28a340Set Approval For...161366942022-12-08 1:25:231 day 23 hrs ago0xc96e9ef5c3fbee9ba2da09cee395896c7ec88616 IN  KaijuMutant: MUTANT Token0 Ether0.00070746 15.27935292
0xe8cd416e67940db9c5e63ea009c5f9be9a6889cd4187f2eb6857afd307908eb2Set Approval For...161363402022-12-08 0:14:112 days 57 mins agoENS Name mondoggg.eth IN  KaijuMutant: MUTANT Token0 Ether0.00060984 13.17794789
0xe3878b6f635a4d106f34dc747181d405451b678428dab931f99649e85f2ab4b1Safe Transfer Fr...161339552022-12-07 16:15:472 days 8 hrs ago0x40211a9c8a1fefdafe58fd60bbdb067050d769cc IN  KaijuMutant: MUTANT Token0 Ether0.00066383 15.14884384
0x379acc04ad9a5cd724193ddf143ed706949c0ef4a8725df4f7d13f1b85d52c1cSafe Transfer Fr...161339512022-12-07 16:14:592 days 8 hrs agoENS Name kansei-kaiju-vault.eth IN  KaijuMutant: MUTANT Token0 Ether0.00096072 14.62087086
0xa729cc87359e820c62293ed113a56b41e1ad435673a83d12bca6c371f43ca517Safe Transfer Fr...161336322022-12-07 15:10:232 days 10 hrs ago0x2507f5f7622cc7097630dd6e060719e063778b2b IN  KaijuMutant: MUTANT Token0 Ether0.00109211 16.6173988
0x2820552e65de16afb4f4ad4e3249a7fe2394a7971843414ce0cd52a0e476f4acSet Approval For...161334142022-12-07 14:26:472 days 10 hrs agoENS Name enterthegarden.eth IN  KaijuMutant: MUTANT Token0 Ether0.00065849 14.22170981
0xcbbb26cd38dc5ddc0b7358f1c4cdc7e58370af07b7922f82d86ea76480329379Set Approval For...161333382022-12-07 14:11:352 days 11 hrs ago0xc8fe50fad44172660633acc2345a25bdc850d277 IN  KaijuMutant: MUTANT Token0 Ether0.00076084 16.44075557
0x32ee2844e9e0329a695c35da1cefb82856aa26df7ebcab4977e27e4d2ba9683cSet Approval For...161330242022-12-07 13:08:352 days 12 hrs agoENS Name kansei.eth IN  KaijuMutant: MUTANT Token0 Ether0.00070368 15.20570342
0xcc395f6cb6177f9dc6ee524961b5e82538db72d56fc3c4f66cabce77fce478adSet Approval For...161330142022-12-07 13:06:352 days 12 hrs ago0x40211a9c8a1fefdafe58fd60bbdb067050d769cc IN  KaijuMutant: MUTANT Token0 Ether0.00074634 16.12740193
0xb19972766aaf4d43f050e92481973805dbe53f64c3c7fb79aabe15996122495cSet Approval For...161277382022-12-06 19:07:233 days 6 hrs ago0xa5f8756147a4ebfb40bd32f4c789534b9fc1e017 IN  KaijuMutant: MUTANT Token0 Ether0.00102491 22.14681122
0xf018f7b834520cd9f54e47aea434b938163b13d50e10676311c12f3650d62fa3Set Approval For...161264302022-12-06 14:44:233 days 10 hrs ago0x54402407e68f8128faccc371500eee8f74b17a4b IN  KaijuMutant: MUTANT Token0 Ether0.00091568 19.78666613
0x216a9e41253c9af5d3be988677309c6c06bd800f9245300c04e906b63a2de2c6Safe Transfer Fr...161260302022-12-06 13:23:593 days 11 hrs ago0x1d55402f326779ad38e378114cd71c0a67c72113 IN  KaijuMutant: MUTANT Token0 Ether0.00066101 15.08452842
0xe8021f58546a343c3d7257f4cd87df619233327f9d450d55837acbbfb198df98Safe Transfer Fr...161260052022-12-06 13:18:473 days 11 hrs ago0x54402407e68f8128faccc371500eee8f74b17a4b IN  KaijuMutant: MUTANT Token0 Ether0.00086619 13.1798388
[ Download CSV Export 

OVERVIEW

Lab notes: Unstable regulation of $RWASTE lead to all subjects of KaijuKingz Collection 001 to become dangerously unstable. As a result, a new collection has been created utilizing better calibration calculations.

Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xba7f336fa82c474cef5c434da8c3e1717a634fa27f384a5cabd500f244f98dbd142697742022-02-24 16:13:16288 days 8 hrs ago KaijuMutant: MUTANT TokenKaijuMutant: Deployer122.78772 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Mutants

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 4000 runs

Other Settings:
default evmVersion
File 1 of 21 : Mutants.sol
//SPDX-License-Identifier: Unlicense
//
////$$   /$$           /$$                                               
//| $$  /$$/          |__/                                               
//| $$ /$$/   /$$$$$$  /$$ /$$ /$$   /$$                                 
//| $$$$$/   |____  $$| $$|__/| $$  | $$                                 
//| $$  $$    /$$$$$$$| $$ /$$| $$  | $$                                 
//| $$\  $$  /$$__  $$| $$| $$| $$  | $$                                 
//| $$ \  $$|  $$$$$$$| $$| $$|  $$$$$$/                                 
//|__/  \__/ \_______/|__/| $$ \______/                                  
//                  /$$  | $$                                           
// /$$   /$$ /$$    |  $$$$$$/                                           
//| $$  /$$/|__/     \______/                                            
//| $$ /$$/  /$$ /$$$$$$$   /$$$$$$  /$$$$$$$$                           
//| $$$$$/  | $$| $$__  $$ /$$__  $$|____ /$$/                           
//| $$  $$  | $$| $$  \ $$| $$  \ $$   /$$$$/                            
//| $$\  $$ | $$| $$  | $$| $$  | $$  /$$__/                             
//| $$ \  $$| $$| $$  | $$|  $$$$$$$ /$$$$$$$$                           
//|__/  \__/|__/|__/  |__/ \____  $$|________/                           
//                         /$$  \ $$                                     
//                       |  $$$$$$/                                     
//                         \______/                                            
///$$      /$$             /$$                          /$$             
//| $$$    /$$$            | $$                         | $$             
//| $$$$  /$$$$ /$$   /$$ /$$$$$$   /$$$$$$  /$$$$$$$  /$$$$$$   /$$$$$$$
//| $$ $$/$$ $$| $$  | $$|_  $$_/  |____  $$| $$__  $$|_  $$_/  /$$_____/
//| $$  $$$| $$| $$  | $$  | $$     /$$$$$$$| $$  \ $$  | $$   |  $$$$$$ 
//| $$\  $ | $$| $$  | $$  | $$ /$$/$$__  $$| $$  | $$  | $$ /$$\____  $$
//| $$ \/  | $$|  $$$$$$/  |  $$$$/  $$$$$$$| $$  | $$  |  $$$$//$$$$$$$/
//|__/     |__/ \______/    \___/  \_______/|__/  |__/   \___/ |_______/ 
//
//
// Thanks to all the homies that have supported us from the start! 
// To any of the homies just joining - we hope you enjoy your stay ;)


pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

import "./interfaces/IFailedExperiments.sol";
import "./interfaces/IMutants.sol";
import "./interfaces/IScales.sol";

contract Mutants is IMutants, ERC721, Ownable, ReentrancyGuard, VRFConsumerBase {
  using ECDSA for bytes32;

  bytes32 internal immutable LINK_KEY_HASH;
  uint256 internal immutable LINK_FEE;
  uint256 internal TOKEN_OFFSET;
  string internal PROVENANCE_HASH;
  string internal _baseTokenURI;

  IScales public SCALES;
  IFailedExperiments public immutable FAILED_EXPERIMENTS;
  uint256 public constant FAILED_EXPERIMENTS_SUPPLY = 1815;
  uint256 public constant CLAIM_LIMIT = 25;
  uint256 public constant override MAX_SUPPLY = 4000;
  uint256 public constant MAX_MINTABLE = MAX_SUPPLY - FAILED_EXPERIMENTS_SUPPLY;
  uint256 public constant MAX_TIER = 6;
  uint256 constant public MINT_PRICE = 0.06666 ether;
  uint256 public constant UPGRADE_COST = 150 ether;

  bool public revealed;
  address public signer;
  string public metadataURI;
  string public placeholderURI;
  uint256 public mintableSupply;
  uint256 public override totalSupply;
  mapping(uint256 => uint256) public override tier;
  mapping(bytes => bool) public signatureUsed;
  mapping(bytes4 => bool) public functionLocked;

  constructor(
    address failedExperiments,
    address vrfCoordinator,
    address linkToken,
    bytes32 keyHash,
    uint256 linkFee
  )
    ERC721("KaijuMutant", "MUTANT")
    VRFConsumerBase(vrfCoordinator, linkToken)
  {
    FAILED_EXPERIMENTS = IFailedExperiments(failedExperiments);
    LINK_KEY_HASH = keyHash;
    LINK_FEE = linkFee;
  }

  /**
   * @notice Modifier applied to functions that will be disabled when they're no longer needed
   */
  modifier lockable() {
    require(!functionLocked[msg.sig], "Function is locked");
    _;
  }

  /**
   * @notice Lock individual functions that are no longer needed
   * @dev Only affects functions with the lockable modifier
   * @param id First 4 bytes of the calldata (i.e. function identifier)
   */
  function lockFunction(bytes4 id) public onlyOwner {
    functionLocked[id] = true;
  }

  /**
   * @notice Override ERC721 _baseURI function to use base URI pattern
   */
  function _baseURI() internal view virtual override returns (string memory) {
    return _baseTokenURI;
  }

  /**
   * @notice Return token metadata
   * @param tokenId to return metadata for
   * @return token URI for the specified token
   */
  function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
    require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

    return revealed ? ERC721.tokenURI(tokenId) : placeholderURI;
  }

  /**
   * @notice Token offset is added to the token ID (wrapped on overflow) to get metadata asset index
   */
  function tokenOffset() public view returns (uint256) {
    require(TOKEN_OFFSET != 0, "Offset is not set");

    return TOKEN_OFFSET;
  }

  /**
   * @notice Provenance hash is used as proof that token metadata has not been modified
   */
  function provenanceHash() public view returns (string memory) {
    require(bytes(PROVENANCE_HASH).length != 0, "Provenance hash is not set");

    return PROVENANCE_HASH;
  }

  /**
   * @notice Set token offset using Chainlink VRF
   * @dev https://docs.chain.link/docs/chainlink-vrf/
   * @dev Can only be set once
   * @dev Provenance hash must already be set
   */
  function setTokenOffset() public onlyOwner {
    require(TOKEN_OFFSET == 0, "Offset is already set");
    provenanceHash();

    requestRandomness(LINK_KEY_HASH, LINK_FEE);
  }

  /**
   * @notice Set provenance hash
   * @dev Can only be set once
   * @param _provenanceHash metadata proof string
   */
  function setProvenanceHash(string memory _provenanceHash) public onlyOwner {
    require(bytes(PROVENANCE_HASH).length == 0, "Provenance hash is already set");

    PROVENANCE_HASH = _provenanceHash;
  }

  /**
   * @notice Flip token metadata to revealed
   * @dev Can only be revealed after token offset has been set
   */
  function flipRevealed() public lockable onlyOwner {
    tokenOffset();

    revealed = !revealed;
  }

  /**
   * @notice Set SCALES token address
   * @param scales address of SCALES ERC20 token contract
   */
  function setScales(address scales) public lockable onlyOwner {
    SCALES = IScales(scales);
  }

  /**
   * @notice Set signature signing address
   * @param _signer address of account used to create mint signatures
   */
  function setSigner(address _signer) public lockable onlyOwner {
    signer = _signer;
  }

  /**
   * @notice Set base token URI
   * @param URI base metadata URI to be prepended to token ID
   */
  function setBaseTokenURI(string memory URI) public lockable onlyOwner {
    _baseTokenURI = URI;
  }

  /**
   * @notice Set base token URI
   * @param URI base metadata URI to be prepended to token ID
   */
  function setMetadataURI(string memory URI) public lockable onlyOwner {
    metadataURI = URI;
  }

  /**
   * @notice Set placeholder token URI
   * @param URI placeholder metadata returned before reveal
   */
  function setPlaceholderURI(string memory URI) public onlyOwner {
    placeholderURI = URI;
  }

  /**
   * @notice Callback function for Chainlink VRF request randomness call
   * @dev Maximum offset value is the maximum token supply - 1
   */
  function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
    TOKEN_OFFSET = randomness % MAX_SUPPLY;
  }

  /**
   * @notice Claim a mutant by burning a failed experiment
   * @param tokenIds of the failed experiments to be burned
   */
  function claim(uint256[] calldata tokenIds) public nonReentrant {
    require(
      FAILED_EXPERIMENTS.isApprovedForAll(_msgSender(), address(this)),
      "Contract not approved"
    );
    require(tokenIds.length <= CLAIM_LIMIT, "Exceeds claim limit");

    for (uint256 i = 0; i < tokenIds.length; i++) {
      FAILED_EXPERIMENTS.transferFrom(
        _msgSender(),
        address(0x000000000000000000000000000000000000dEaD),
        tokenIds[i]
      );

      _safeMint(_msgSender(), tokenIds[i]);
    }

    totalSupply += tokenIds.length;
  }

  /**
   * @notice Mint a mutant using a signature
   * @param amount of mutants to mint
   * @param signature created by signer account
   */
  function mint(uint256 amount, bytes memory signature) public payable nonReentrant {
    require(!signatureUsed[signature], "Signature already used");

    require(signer == ECDSA.recover(
      ECDSA.toEthSignedMessageHash(keccak256(abi.encodePacked(_msgSender(), amount, msg.value == 0))),
      signature
    ), "Invalid signature");

    require(msg.value == 0 || msg.value == MINT_PRICE * amount , "Invalid Ether amount sent");
    require(mintableSupply + amount <= MAX_MINTABLE,             "Insufficient supply");

    signatureUsed[signature] = true;

    for (uint256 i = 0; i < amount; i++) {
      _safeMint(_msgSender(), FAILED_EXPERIMENTS_SUPPLY + mintableSupply);
      mintableSupply += 1;
    }

    totalSupply += amount;
  }

  /**
   * @notice Spend scales to upgrade mutant tier
   * @param tokenId of the mutant to upgrade
   */
  function upgrade(uint256 tokenId) public nonReentrant {
    require(tier[tokenId] < MAX_TIER,         "Mutant already fully upgraded");
    require(ownerOf(tokenId) == _msgSender(), "Caller not token owner");

    SCALES.spend(_msgSender(), UPGRADE_COST);

    tier[tokenId] += 1;
  }

  /**
   * @notice Withdraw all ETH transferred to the contract
   */
  function withdraw() external onlyOwner {
    Address.sendValue(payable(_msgSender()), address(this).balance);
  }

  /**
   * @notice Reclaim any unused LINK
   * @param amount of LINK to withdraw
   */
  function withdrawLINK(uint256 amount) external onlyOwner {
    LINK.transfer(_msgSender(), amount);
  }
}

File 2 of 21 : IScales.sol
//SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

import "./ISpendable.sol";

interface IScales is ISpendable {}

File 3 of 21 : IMutants.sol
//SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IMutants is IERC721 {
  function MAX_SUPPLY() external view returns (uint256);
  function totalSupply() external view returns (uint256);
  function tier(uint256) external view returns (uint256);
}

File 4 of 21 : IFailedExperiments.sol
//SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IFailedExperiments is IERC721 {}

File 5 of 21 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 6 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 7 of 21 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        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) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        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 overriden 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 owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        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: transfer caller is not owner nor 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: transfer caller is not owner nor 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 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 _owners[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) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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);

        _balances[to] += 1;
        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

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

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

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {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 a {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 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 {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 9 of 21 : VRFConsumerBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

/** ****************************************************************************
 * @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.
 * *****************************************************************************
 * @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, _link) 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), and have told you the minimum LINK
 * @dev price for VRF service. Make sure your contract has sufficient LINK, and
 * @dev call requestRandomness(keyHash, fee, seed), where seed is the input you
 * @dev want to generate randomness from.
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomness method.
 *
 * @dev The randomness argument to fulfillRandomness is the actual random value
 * @dev generated from your seed.
 *
 * @dev The requestId argument is generated from the keyHash and the seed by
 * @dev makeRequestId(keyHash, seed). If your contract could have concurrent
 * @dev requests open, you can use the requestId to track which seed is
 * @dev associated with which randomness. See VRFRequestIDBase.sol for more
 * @dev details. (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. (Which is critical to making unpredictable randomness! See the
 * @dev next section.)
 *
 * *****************************************************************************
 * @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 ultimate input to the VRF is mixed with the block hash of the
 * @dev block in which the request is made, user-provided seeds have no impact
 * @dev on its economic security properties. They are only included for API
 * @dev compatability with previous versions of this contract.
 *
 * @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.
 */
abstract contract VRFConsumerBase is VRFRequestIDBase {
  /**
   * @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 VRFConsumerBase 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 randomness the VRF output
   */
  function fulfillRandomness(bytes32 requestId, uint256 randomness) internal virtual;

  /**
   * @dev In order to keep backwards compatibility we have kept the user
   * seed field around. We remove the use of it because given that the blockhash
   * enters later, it overrides whatever randomness the used seed provides.
   * Given that it adds no security, and can easily lead to misunderstandings,
   * we have removed it from usage and can now provide a simpler API.
   */
  uint256 private constant USER_SEED_PLACEHOLDER = 0;

  /**
   * @notice requestRandomness initiates a request for VRF output given _seed
   *
   * @dev The fulfillRandomness method receives the output, once it's provided
   * @dev by the Oracle, and verified by the vrfCoordinator.
   *
   * @dev The _keyHash must already be registered with the VRFCoordinator, and
   * @dev the _fee must exceed the fee specified during registration of the
   * @dev _keyHash.
   *
   * @dev The _seed parameter is vestigial, and is kept only for API
   * @dev compatibility with older versions. It can't *hurt* to mix in some of
   * @dev your own randomness, here, but it's not necessary because the VRF
   * @dev oracle will mix the hash of the block containing your request into the
   * @dev VRF seed it ultimately uses.
   *
   * @param _keyHash ID of public key against which randomness is generated
   * @param _fee The amount of LINK to send with the request
   *
   * @return requestId unique ID for this request
   *
   * @dev The returned requestId can be used to distinguish responses to
   * @dev concurrent requests. It is passed as the first argument to
   * @dev fulfillRandomness.
   */
  function requestRandomness(bytes32 _keyHash, uint256 _fee) internal returns (bytes32 requestId) {
    LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
    // This is the seed passed to VRFCoordinator. The oracle will mix this with
    // the hash of the block containing this request to obtain the seed/input
    // which is finally passed to the VRF cryptographic machinery.
    uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
    // nonces[_keyHash] must stay in sync with
    // VRFCoordinator.nonces[_keyHash][this], which was incremented by the above
    // successful LINK.transferAndCall (in VRFCoordinator.randomnessRequest).
    // This provides protection against the user repeating their input seed,
    // which would result in a predictable/duplicate output, if multiple such
    // requests appeared in the same block.
    nonces[_keyHash] = nonces[_keyHash] + 1;
    return makeRequestId(_keyHash, vRFSeed);
  }

  LinkTokenInterface internal immutable LINK;
  address private immutable vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 => uint256) /* keyHash */ /* nonce */
    private nonces;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   * @param _link address of LINK token contract
   *
   * @dev https://docs.chain.link/docs/link-token-contracts
   */
  constructor(address _vrfCoordinator, address _link) {
    vrfCoordinator = _vrfCoordinator;
    LINK = LinkTokenInterface(_link);
  }

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external {
    require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
    fulfillRandomness(requestId, randomness);
  }
}

File 10 of 21 : ISpendable.sol
//SPDX-License-Identifier: Unlicense

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ISpendable is IERC20 {
  function getSpendable(address) external view returns (uint256);
  function spend(address, uint256) external;
  function credit(address, uint256) external;
}

File 11 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

File 16 of 21 : 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 17 of 21 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 18 of 21 : VRFRequestIDBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFRequestIDBase {
  /**
   * @notice returns the seed which is actually input to the VRF coordinator
   *
   * @dev To prevent repetition of VRF output due to repetition of the
   * @dev user-supplied seed, that seed is combined in a hash with the
   * @dev user-specific nonce, and the address of the consuming contract. The
   * @dev risk of repetition is mostly mitigated by inclusion of a blockhash in
   * @dev the final seed, but the nonce does protect against repetition in
   * @dev requests which are included in a single block.
   *
   * @param _userSeed VRF seed input provided by user
   * @param _requester Address of the requesting contract
   * @param _nonce User-specific nonce at the time of the request
   */
  function makeVRFInputSeed(
    bytes32 _keyHash,
    uint256 _userSeed,
    address _requester,
    uint256 _nonce
  ) internal pure returns (uint256) {
    return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
  }

  /**
   * @notice Returns the id for this request
   * @param _keyHash The serviceAgreement ID to be used for this request
   * @param _vRFInputSeed The seed to be passed directly to the VRF
   * @return The id for this request
   *
   * @dev Note that _vRFInputSeed is not the seed passed by the consuming
   * @dev contract, but the one generated by makeVRFInputSeed
   */
  function makeRequestId(bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) {
    return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
  }
}

File 19 of 21 : LinkTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {
  function allowance(address owner, address spender) external view returns (uint256 remaining);

  function approve(address spender, uint256 value) external returns (bool success);

  function balanceOf(address owner) external view returns (uint256 balance);

  function decimals() external view returns (uint8 decimalPlaces);

  function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);

  function increaseApproval(address spender, uint256 subtractedValue) external;

  function name() external view returns (string memory tokenName);

  function symbol() external view returns (string memory tokenSymbol);

  function totalSupply() external view returns (uint256 totalTokensIssued);

  function transfer(address to, uint256 value) external returns (bool success);

  function transferAndCall(
    address to,
    uint256 value,
    bytes calldata data
  ) external returns (bool success);

  function transferFrom(
    address from,
    address to,
    uint256 value
  ) external returns (bool success);
}

File 20 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"failedExperiments","type":"address"},{"internalType":"address","name":"vrfCoordinator","type":"address"},{"internalType":"address","name":"linkToken","type":"address"},{"internalType":"bytes32","name":"keyHash","type":"bytes32"},{"internalType":"uint256","name":"linkFee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":"CLAIM_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FAILED_EXPERIMENTS","outputs":[{"internalType":"contract IFailedExperiments","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FAILED_EXPERIMENTS_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINTABLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SCALES","outputs":[{"internalType":"contract IScales","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPGRADE_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipRevealed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"name":"functionLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"id","type":"bytes4"}],"name":"lockFunction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"metadataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintableSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"placeholderURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenanceHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"URI","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"URI","type":"string"}],"name":"setMetadataURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"URI","type":"string"}],"name":"setPlaceholderURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_provenanceHash","type":"string"}],"name":"setProvenanceHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"scales","type":"address"}],"name":"setScales","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setTokenOffset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"signatureUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOffset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"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":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawLINK","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101206040523480156200001257600080fd5b50604051620040033803806200400383398101604081905262000035916200020e565b604080518082018252600b81526a12d85a5a9d535d5d185b9d60aa1b60208083019182528351808501909452600684526513555510539560d21b908401528151879387939290916200008a916000916200014b565b508051620000a09060019060208401906200014b565b505050620000bd620000b7620000f560201b60201c565b620000f9565b60016007556001600160601b0319606092831b811660a05290821b811660805295901b9094166101005260c052505060e052620002a7565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b82805462000159906200026a565b90600052602060002090601f0160209004810192826200017d5760008555620001c8565b82601f106200019857805160ff1916838001178555620001c8565b82800160010185558215620001c8579182015b82811115620001c8578251825591602001919060010190620001ab565b50620001d6929150620001da565b5090565b5b80821115620001d65760008155600101620001db565b80516001600160a01b03811681146200020957600080fd5b919050565b600080600080600060a0868803121562000226578081fd5b6200023186620001f1565b94506200024160208701620001f1565b93506200025160408701620001f1565b6060870151608090970151959894975095949392505050565b6002810460018216806200027f57607f821691505b60208210811415620002a157634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c60a05160601c60c05160e0516101005160601c613cf26200031160003960008181610fe1015281816111c101526112a601526000610bff01526000610bde0152600081816115ec0152611d830152600081816116f90152611d540152613cf26000f3fe6080604052600436106103345760003560e01c80636dda34db116101b0578063bbadfe76116100ec578063cc5c095c11610095578063db7fd4081161006f578063db7fd4081461085b578063dc8c57b41461086e578063e985e9c514610883578063f2fde38b146108a357610334565b8063cc5c095c14610811578063d3ada9b014610826578063d70dc71a1461083b57610334565b8063c50197d0116100c6578063c50197d0146107c7578063c6ab67a3146107dc578063c87b56dd146107f157610334565b8063bbadfe761461077d578063c002d23d1461079d578063c0b1c04e146107b257610334565b806394985ddd11610159578063af3a19c711610133578063af3a19c714610708578063b88d4fde1461071d578063bb10c8291461073d578063bb84e74f1461075d57610334565b806394985ddd146106b357806395d89b41146106d3578063a22cb465146106e857610334565b80637313cba91161018a5780637313cba914610669578063750521f51461067e5780638da5cb5b1461069e57610334565b80636dda34db1461061457806370a0823114610634578063715018a61461065457610334565b806332cb6b0c1161027f57806342842e0e116102285780635183022711610202578063518302271461059f5780636352211e146105b45780636ba4c138146105d45780636c19e783146105f457610334565b806342842e0e1461054a578063437c2f211461056a57806345977d031461057f57610334565b80633b2c3fb6116102595780633b2c3fb61461050b5780633ccfd60b146105205780633f879faf1461053557610334565b806332cb6b0c146104b657806334531828146104cb5780633574a2dd146104eb57610334565b806310969523116102e157806323b872dd116102bb57806323b872dd146104615780632d062c3f1461048157806330176e131461049657610334565b8063109695231461040a57806318160ddd1461042a578063238ac9331461044c57610334565b8063081812fc11610312578063081812fc146103a6578063095ea7b3146103d35780630f1876a2146103f557610334565b806301ffc9a71461033957806303ee438c1461036f57806306fdde0314610391575b600080fd5b34801561034557600080fd5b50610359610354366004612d97565b6108c3565b6040516103669190613078565b60405180910390f35b34801561037b57600080fd5b5061038461096d565b60405161036691906130c5565b34801561039d57600080fd5b506103846109fb565b3480156103b257600080fd5b506103c66103c1366004612e48565b610a8d565b6040516103669190612fa0565b3480156103df57600080fd5b506103f36103ee366004612cc2565b610ad9565b005b34801561040157600080fd5b506103f3610b71565b34801561041657600080fd5b506103f3610425366004612e02565b610c26565b34801561043657600080fd5b5061043f610ca8565b6040516103669190613b01565b34801561045857600080fd5b506103c6610cae565b34801561046d57600080fd5b506103f361047c366004612beb565b610cbd565b34801561048d57600080fd5b5061043f610cf5565b3480156104a257600080fd5b506103f36104b1366004612e02565b610d02565b3480156104c257600080fd5b5061043f610da6565b3480156104d757600080fd5b506103f36104e6366004612d97565b610dac565b3480156104f757600080fd5b506103f3610506366004612e02565b610e28565b34801561051757600080fd5b506103f3610e7a565b34801561052c57600080fd5b506103f3610f61565b34801561054157600080fd5b5061043f610fb3565b34801561055657600080fd5b506103f3610565366004612beb565b610fc4565b34801561057657600080fd5b506103c6610fdf565b34801561058b57600080fd5b506103f361059a366004612e48565b611003565b3480156105ab57600080fd5b50610359611139565b3480156105c057600080fd5b506103c66105cf366004612e48565b61115a565b3480156105e057600080fd5b506103f36105ef366004612ceb565b61118f565b34801561060057600080fd5b506103f361060f366004612b9f565b6113c2565b34801561062057600080fd5b5061043f61062f366004612e48565b611482565b34801561064057600080fd5b5061043f61064f366004612b9f565b611494565b34801561066057600080fd5b506103f36114d8565b34801561067557600080fd5b50610384611521565b34801561068a57600080fd5b506103f3610699366004612e02565b61152e565b3480156106aa57600080fd5b506103c66115d2565b3480156106bf57600080fd5b506103f36106ce366004612d76565b6115e1565b3480156106df57600080fd5b50610384611633565b3480156106f457600080fd5b506103f3610703366004612c8c565b611642565b34801561071457600080fd5b5061043f611654565b34801561072957600080fd5b506103f3610738366004612c26565b611659565b34801561074957600080fd5b50610359610758366004612dcf565b611698565b34801561076957600080fd5b506103f3610778366004612e48565b6116b8565b34801561078957600080fd5b50610359610798366004612d97565b61179e565b3480156107a957600080fd5b5061043f6117b3565b3480156107be57600080fd5b5061043f6117be565b3480156107d357600080fd5b506103c66117c4565b3480156107e857600080fd5b506103846117d3565b3480156107fd57600080fd5b5061038461080c366004612e48565b61180f565b34801561081d57600080fd5b5061043f6118f1565b34801561083257600080fd5b5061043f6118f7565b34801561084757600080fd5b506103f3610856366004612b9f565b6118fc565b6103f3610869366004612e60565b6119bc565b34801561087a57600080fd5b5061043f611ba2565b34801561088f57600080fd5b5061035961089e366004612bb9565b611bce565b3480156108af57600080fd5b506103f36108be366004612b9f565b611bfc565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061095657507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610965575061096582611c6a565b90505b919050565b600e805461097a90613bb6565b80601f01602080910402602001604051908101604052809291908181526020018280546109a690613bb6565b80156109f35780601f106109c8576101008083540402835291602001916109f3565b820191906000526020600020905b8154815290600101906020018083116109d657829003601f168201915b505050505081565b606060008054610a0a90613bb6565b80601f0160208091040260200160405190810160405280929190818152602001828054610a3690613bb6565b8015610a835780601f10610a5857610100808354040283529160200191610a83565b820191906000526020600020905b815481529060010190602001808311610a6657829003601f168201915b5050505050905090565b6000610a9882611cb4565b610abd5760405162461bcd60e51b8152600401610ab4906137a0565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610ae48261115a565b9050806001600160a01b0316836001600160a01b03161415610b185760405162461bcd60e51b8152600401610ab49061396b565b806001600160a01b0316610b2a611cd1565b6001600160a01b03161480610b465750610b468161089e611cd1565b610b625760405162461bcd60e51b8152600401610ab4906135f7565b610b6c8383611cd5565b505050565b610b79611cd1565b6001600160a01b0316610b8a6115d2565b6001600160a01b031614610bb05760405162461bcd60e51b8152600401610ab49061386b565b60095415610bd05760405162461bcd60e51b8152600401610ab4906137fd565b610bd86117d3565b50610c237f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000611d50565b50565b610c2e611cd1565b6001600160a01b0316610c3f6115d2565b6001600160a01b031614610c655760405162461bcd60e51b8152600401610ab49061386b565b600a8054610c7290613bb6565b159050610c915760405162461bcd60e51b8152600401610ab49061343b565b8051610ca490600a906020840190612a60565b5050565b60115481565b600d546001600160a01b031681565b610cce610cc8611cd1565b82611e93565b610cea5760405162461bcd60e51b8152600401610ab4906139ff565b610b6c838383611f10565b680821ab0d441498000081565b600080357fffffffff000000000000000000000000000000000000000000000000000000001681526014602052604090205460ff1615610d545760405162461bcd60e51b8152600401610ab4906138a0565b610d5c611cd1565b6001600160a01b0316610d6d6115d2565b6001600160a01b031614610d935760405162461bcd60e51b8152600401610ab49061386b565b8051610ca490600b906020840190612a60565b610fa081565b610db4611cd1565b6001600160a01b0316610dc56115d2565b6001600160a01b031614610deb5760405162461bcd60e51b8152600401610ab49061386b565b7fffffffff00000000000000000000000000000000000000000000000000000000166000908152601460205260409020805460ff19166001179055565b610e30611cd1565b6001600160a01b0316610e416115d2565b6001600160a01b031614610e675760405162461bcd60e51b8152600401610ab49061386b565b8051610ca490600f906020840190612a60565b600080357fffffffff000000000000000000000000000000000000000000000000000000001681526014602052604090205460ff1615610ecc5760405162461bcd60e51b8152600401610ab4906138a0565b610ed4611cd1565b6001600160a01b0316610ee56115d2565b6001600160a01b031614610f0b5760405162461bcd60e51b8152600401610ab49061386b565b610f13611ba2565b50600c80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff8116740100000000000000000000000000000000000000009182900460ff1615909102179055565b610f69611cd1565b6001600160a01b0316610f7a6115d2565b6001600160a01b031614610fa05760405162461bcd60e51b8152600401610ab49061386b565b610fb1610fab611cd1565b47612050565b565b610fc1610717610fa0613b73565b81565b610b6c83838360405180602001604052806000815250611659565b7f000000000000000000000000000000000000000000000000000000000000000081565b600260075414156110265760405162461bcd60e51b8152600401610ab490613a93565b60026007556000818152601260205260409020546006116110595760405162461bcd60e51b8152600401610ab490613a5c565b611061611cd1565b6001600160a01b03166110738261115a565b6001600160a01b0316146110995760405162461bcd60e51b8152600401610ab4906139c8565b600c546001600160a01b031663af7d6ca36110b2611cd1565b680821ab0d44149800006040518363ffffffff1660e01b81526004016110d992919061302e565b600060405180830381600087803b1580156110f357600080fd5b505af1158015611107573d6000803e3d6000fd5b505050600082815260126020526040812080546001935090919061112c908490613b0a565b9091555050600160075550565b600c5474010000000000000000000000000000000000000000900460ff1681565b6000818152600260205260408120546001600160a01b0316806109655760405162461bcd60e51b8152600401610ab4906136b1565b600260075414156111b25760405162461bcd60e51b8152600401610ab490613a93565b60026007556001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663e985e9c56111ee611cd1565b306040518363ffffffff1660e01b815260040161120c929190612fb4565b60206040518083038186803b15801561122457600080fd5b505afa158015611238573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125c9190612d5a565b6112785760405162461bcd60e51b8152600401610ab490613404565b60198111156112995760405162461bcd60e51b8152600401610ab4906131a3565b60005b8181101561139e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166323b872dd6112db611cd1565b61dead8686868181106112fe57634e487b7160e01b600052603260045260246000fd5b905060200201356040518463ffffffff1660e01b815260040161132393929190612fce565b600060405180830381600087803b15801561133d57600080fd5b505af1158015611351573d6000803e3d6000fd5b5050505061138c611360611cd1565b84848481811061138057634e487b7160e01b600052603260045260246000fd5b905060200201356120ec565b8061139681613bf1565b91505061129c565b5081819050601160008282546113b49190613b0a565b909155505060016007555050565b600080357fffffffff000000000000000000000000000000000000000000000000000000001681526014602052604090205460ff16156114145760405162461bcd60e51b8152600401610ab4906138a0565b61141c611cd1565b6001600160a01b031661142d6115d2565b6001600160a01b0316146114535760405162461bcd60e51b8152600401610ab49061386b565b600d805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60126020526000908152604090205481565b60006001600160a01b0382166114bc5760405162461bcd60e51b8152600401610ab490613654565b506001600160a01b031660009081526003602052604090205490565b6114e0611cd1565b6001600160a01b03166114f16115d2565b6001600160a01b0316146115175760405162461bcd60e51b8152600401610ab49061386b565b610fb16000612106565b600f805461097a90613bb6565b600080357fffffffff000000000000000000000000000000000000000000000000000000001681526014602052604090205460ff16156115805760405162461bcd60e51b8152600401610ab4906138a0565b611588611cd1565b6001600160a01b03166115996115d2565b6001600160a01b0316146115bf5760405162461bcd60e51b8152600401610ab49061386b565b8051610ca490600e906020840190612a60565b6006546001600160a01b031690565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116295760405162461bcd60e51b8152600401610ab490613934565b610ca48282612165565b606060018054610a0a90613bb6565b610ca461164d611cd1565b8383612178565b600681565b61166a611664611cd1565b83611e93565b6116865760405162461bcd60e51b8152600401610ab4906139ff565b6116928484848461221b565b50505050565b805160208183018101805160138252928201919093012091525460ff1681565b6116c0611cd1565b6001600160a01b03166116d16115d2565b6001600160a01b0316146116f75760405162461bcd60e51b8152600401610ab49061386b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb61172e611cd1565b836040518363ffffffff1660e01b815260040161174c92919061302e565b602060405180830381600087803b15801561176657600080fd5b505af115801561177a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca49190612d5a565b60146020526000908152604090205460ff1681565b66ecd2eab4ba400081565b61071781565b600c546001600160a01b031681565b6060600a80546117e290613bb6565b151590506118025760405162461bcd60e51b8152600401610ab490613aca565b600a8054610a0a90613bb6565b606061181a82611cb4565b6118365760405162461bcd60e51b8152600401610ab4906138d7565b600c5474010000000000000000000000000000000000000000900460ff166118e857600f805461186590613bb6565b80601f016020809104026020016040519081016040528092919081815260200182805461189190613bb6565b80156118de5780601f106118b3576101008083540402835291602001916118de565b820191906000526020600020905b8154815290600101906020018083116118c157829003601f168201915b5050505050610965565b6109658261224e565b60105481565b601981565b600080357fffffffff000000000000000000000000000000000000000000000000000000001681526014602052604090205460ff161561194e5760405162461bcd60e51b8152600401610ab4906138a0565b611956611cd1565b6001600160a01b03166119676115d2565b6001600160a01b03161461198d5760405162461bcd60e51b8152600401610ab49061386b565b600c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600260075414156119df5760405162461bcd60e51b8152600401610ab490613a93565b60026007556040516013906119f5908390612f21565b9081526040519081900360200190205460ff1615611a255760405162461bcd60e51b8152600401610ab490613302565b611a69611a63611a33611cd1565b604051611a4891908690341590602001612ed1565b604051602081830303815290604052805190602001206122d1565b82612301565b600d546001600160a01b03908116911614611a965760405162461bcd60e51b8152600401610ab490613472565b341580611ab25750611aaf8266ecd2eab4ba4000613b36565b34145b611ace5760405162461bcd60e51b8152600401610ab4906132cb565b611adc610717610fa0613b73565b82601054611aea9190613b0a565b1115611b085760405162461bcd60e51b8152600401610ab490613834565b6001601382604051611b1a9190612f21565b908152604051908190036020019020805491151560ff1990921691909117905560005b82811015611b8f57611b64611b50611cd1565b601054611b5f90610717613b0a565b6120ec565b600160106000828254611b779190613b0a565b90915550819050611b8781613bf1565b915050611b3d565b5081601160008282546113b49190613b0a565b600060095460001415611bc75760405162461bcd60e51b8152600401610ab4906133cd565b5060095490565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b611c04611cd1565b6001600160a01b0316611c156115d2565b6001600160a01b031614611c3b5760405162461bcd60e51b8152600401610ab49061386b565b6001600160a01b038116611c615760405162461bcd60e51b8152600401610ab4906131da565b610c2381612106565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f01ffc9a70000000000000000000000000000000000000000000000000000000014919050565b6000908152600260205260409020546001600160a01b0316151590565b3390565b6000818152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190611d178261115a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000084866000604051602001611db7929190612f13565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401611de493929190613047565b602060405180830381600087803b158015611dfe57600080fd5b505af1158015611e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e369190612d5a565b50600083815260086020526040812054611e5590859083903090612325565b600085815260086020526040902054909150611e72906001613b0a565b600085815260086020526040902055611e8b848261235f565b949350505050565b6000611e9e82611cb4565b611eba5760405162461bcd60e51b8152600401610ab49061359a565b6000611ec58361115a565b9050806001600160a01b0316846001600160a01b03161480611f005750836001600160a01b0316611ef584610a8d565b6001600160a01b0316145b80611e8b5750611e8b8185611bce565b826001600160a01b0316611f238261115a565b6001600160a01b031614611f495760405162461bcd60e51b8152600401610ab490613237565b6001600160a01b038216611f6f5760405162461bcd60e51b8152600401610ab490613339565b611f7a838383610b6c565b611f85600082611cd5565b6001600160a01b0383166000908152600360205260408120805460019290611fae908490613b73565b90915550506001600160a01b0382166000908152600360205260408120805460019290611fdc908490613b0a565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610b6c838383610b6c565b804710156120705760405162461bcd60e51b8152600401610ab490613563565b6000826001600160a01b03168260405161208990612f9d565b60006040518083038185875af1925050503d80600081146120c6576040519150601f19603f3d011682016040523d82523d6000602084013e6120cb565b606091505b5050905080610b6c5760405162461bcd60e51b8152600401610ab4906134a9565b610ca4828260405180602001604052806000815250612392565b600680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612171610fa082613c2a565b6009555050565b816001600160a01b0316836001600160a01b031614156121aa5760405162461bcd60e51b8152600401610ab490613396565b6001600160a01b0383811660008181526005602090815260408083209487168084529490915290819020805460ff1916851515179055517f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319061220e908590613078565b60405180910390a3505050565b612226848484611f10565b612232848484846123c5565b6116925760405162461bcd60e51b8152600401610ab490613146565b606061225982611cb4565b6122755760405162461bcd60e51b8152600401610ab4906138d7565b600061227f61250e565b9050600081511161229f57604051806020016040528060008152506122ca565b806122a98461251d565b6040516020016122ba929190612f3d565b6040516020818303038152906040525b9392505050565b6000816040516020016122e49190612f6c565b604051602081830303815290604052805190602001209050919050565b6000806000612310858561266c565b9150915061231d816126dc565b509392505050565b60008484848460405160200161233e9493929190613083565b60408051601f19818403018152919052805160209091012095945050505050565b60008282604051602001612374929190612f13565b60405160208183030381529060405280519060200120905092915050565b61239c8383612809565b6123a960008484846123c5565b610b6c5760405162461bcd60e51b8152600401610ab490613146565b60006123d9846001600160a01b03166128fd565b1561250657836001600160a01b031663150b7a026123f5611cd1565b8786866040518563ffffffff1660e01b81526004016124179493929190612ff2565b602060405180830381600087803b15801561243157600080fd5b505af1925050508015612461575060408051601f3d908101601f1916820190925261245e91810190612db3565b60015b6124bb573d80801561248f576040519150601f19603f3d011682016040523d82523d6000602084013e612494565b606091505b5080516124b35760405162461bcd60e51b8152600401610ab490613146565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611e8b565b506001611e8b565b6060600b8054610a0a90613bb6565b60608161255e575060408051808201909152600181527f30000000000000000000000000000000000000000000000000000000000000006020820152610968565b8160005b8115612588578061257281613bf1565b91506125819050600a83613b22565b9150612562565b60008167ffffffffffffffff8111156125b157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156125db576020820181803683370190505b5090505b8415611e8b576125f0600183613b73565b91506125fd600a86613c2a565b612608906030613b0a565b60f81b81838151811061262b57634e487b7160e01b600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612665600a86613b22565b94506125df565b6000808251604114156126a35760208301516040840151606085015160001a6126978782858561292e565b945094505050506126d5565b8251604014156126cd57602083015160408401516126c2868383612a0e565b9350935050506126d5565b506000905060025b9250929050565b60008160048111156126fe57634e487b7160e01b600052602160045260246000fd5b141561270957610c23565b600181600481111561272b57634e487b7160e01b600052602160045260246000fd5b14156127495760405162461bcd60e51b8152600401610ab4906130d8565b600281600481111561276b57634e487b7160e01b600052602160045260246000fd5b14156127895760405162461bcd60e51b8152600401610ab49061310f565b60038160048111156127ab57634e487b7160e01b600052602160045260246000fd5b14156127c95760405162461bcd60e51b8152600401610ab490613506565b60048160048111156127eb57634e487b7160e01b600052602160045260246000fd5b1415610c235760405162461bcd60e51b8152600401610ab49061370e565b6001600160a01b03821661282f5760405162461bcd60e51b8152600401610ab49061376b565b61283881611cb4565b156128555760405162461bcd60e51b8152600401610ab490613294565b61286160008383610b6c565b6001600160a01b038216600090815260036020526040812080546001929061288a908490613b0a565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610ca460008383610b6c565b600080826001600160a01b0316803b806020016040519081016040528181526000908060200190933c511192915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156129655750600090506003612a05565b8460ff16601b1415801561297d57508460ff16601c14155b1561298e5750600090506004612a05565b6000600187878787604051600081526020016040526040516129b394939291906130a7565b6020604051602081039080840390855afa1580156129d5573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166129fe57600060019250925050612a05565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681612a4460ff86901c601b613b0a565b9050612a528782888561292e565b935093505050935093915050565b828054612a6c90613bb6565b90600052602060002090601f016020900481019282612a8e5760008555612ad4565b82601f10612aa757805160ff1916838001178555612ad4565b82800160010185558215612ad4579182015b82811115612ad4578251825591602001919060010190612ab9565b50612ae0929150612ae4565b5090565b5b80821115612ae05760008155600101612ae5565b600067ffffffffffffffff80841115612b1457612b14613c6a565b6040516020601f19601f8701168201018181108382111715612b3857612b38613c6a565b604052848152915081838501861015612b5057600080fd5b8484602083013760006020868301015250509392505050565b80356001600160a01b038116811461096857600080fd5b600082601f830112612b90578081fd5b6122ca83833560208501612af9565b600060208284031215612bb0578081fd5b6122ca82612b69565b60008060408385031215612bcb578081fd5b612bd483612b69565b9150612be260208401612b69565b90509250929050565b600080600060608486031215612bff578081fd5b612c0884612b69565b9250612c1660208501612b69565b9150604084013590509250925092565b60008060008060808587031215612c3b578081fd5b612c4485612b69565b9350612c5260208601612b69565b925060408501359150606085013567ffffffffffffffff811115612c74578182fd5b612c8087828801612b80565b91505092959194509250565b60008060408385031215612c9e578182fd5b612ca783612b69565b91506020830135612cb781613c80565b809150509250929050565b60008060408385031215612cd4578182fd5b612cdd83612b69565b946020939093013593505050565b60008060208385031215612cfd578182fd5b823567ffffffffffffffff80821115612d14578384fd5b818501915085601f830112612d27578384fd5b813581811115612d35578485fd5b8660208083028501011115612d48578485fd5b60209290920196919550909350505050565b600060208284031215612d6b578081fd5b81516122ca81613c80565b60008060408385031215612d88578182fd5b50508035926020909101359150565b600060208284031215612da8578081fd5b81356122ca81613c8e565b600060208284031215612dc4578081fd5b81516122ca81613c8e565b600060208284031215612de0578081fd5b813567ffffffffffffffff811115612df6578182fd5b611e8b84828501612b80565b600060208284031215612e13578081fd5b813567ffffffffffffffff811115612e29578182fd5b8201601f81018413612e39578182fd5b611e8b84823560208401612af9565b600060208284031215612e59578081fd5b5035919050565b60008060408385031215612e72578182fd5b82359150602083013567ffffffffffffffff811115612e8f578182fd5b612e9b85828601612b80565b9150509250929050565b60008151808452612ebd816020860160208601613b8a565b601f01601f19169290920160200192915050565b60609390931b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001683526014830191909152151560f81b603482015260350190565b918252602082015260400190565b60008251612f33818460208701613b8a565b9190910192915050565b60008351612f4f818460208801613b8a565b835190830190612f63818360208801613b8a565b01949350505050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b90565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006001600160a01b038087168352808616602084015250836040830152608060608301526130246080830184612ea5565b9695505050505050565b6001600160a01b03929092168252602082015260400190565b60006001600160a01b03851682528360208301526060604083015261306f6060830184612ea5565b95945050505050565b901515815260200190565b93845260208401929092526001600160a01b03166040830152606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526122ca6020830184612ea5565b60208082526018908201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604082015260600190565b6020808252601f908201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527f63656976657220696d706c656d656e7465720000000000000000000000000000606082015260800190565b60208082526013908201527f4578636565647320636c61696d206c696d697400000000000000000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201527f6f776e6572000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601c908201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604082015260600190565b60208082526019908201527f496e76616c696420457468657220616d6f756e742073656e7400000000000000604082015260600190565b60208082526016908201527f5369676e617475726520616c7265616479207573656400000000000000000000604082015260600190565b60208082526024908201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460408201527f7265737300000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604082015260600190565b60208082526011908201527f4f6666736574206973206e6f7420736574000000000000000000000000000000604082015260600190565b60208082526015908201527f436f6e7472616374206e6f7420617070726f7665640000000000000000000000604082015260600190565b6020808252601e908201527f50726f76656e616e6365206861736820697320616c7265616479207365740000604082015260600190565b60208082526011908201527f496e76616c6964207369676e6174757265000000000000000000000000000000604082015260600190565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60408201527f7565000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601d908201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604082015260600190565b6020808252602c908201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860408201527f697374656e7420746f6b656e0000000000000000000000000000000000000000606082015260800190565b60208082526038908201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760408201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606082015260800190565b6020808252602a908201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560408201527f726f206164647265737300000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460408201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60408201527f7565000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b6020808252602c908201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860408201527f697374656e7420746f6b656e0000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f4f666673657420697320616c7265616479207365740000000000000000000000604082015260600190565b60208082526013908201527f496e73756666696369656e7420737570706c7900000000000000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526012908201527f46756e6374696f6e206973206c6f636b65640000000000000000000000000000604082015260600190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000606082015260800190565b6020808252601f908201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c00604082015260600190565b60208082526021908201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560408201527f7200000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526016908201527f43616c6c6572206e6f7420746f6b656e206f776e657200000000000000000000604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60408201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606082015260800190565b6020808252601d908201527f4d7574616e7420616c72656164792066756c6c79207570677261646564000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601a908201527f50726f76656e616e63652068617368206973206e6f7420736574000000000000604082015260600190565b90815260200190565b60008219821115613b1d57613b1d613c3e565b500190565b600082613b3157613b31613c54565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613b6e57613b6e613c3e565b500290565b600082821015613b8557613b85613c3e565b500390565b60005b83811015613ba5578181015183820152602001613b8d565b838111156116925750506000910152565b600281046001821680613bca57607f821691505b60208210811415613beb57634e487b7160e01b600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613c2357613c23613c3e565b5060010190565b600082613c3957613c39613c54565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610c2357600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114610c2357600080fdfea2646970667358221220d38451499acd81e5c96b6a782425ecbaf13d7280fec8f5cfbc1bf6c37f4fd07164736f6c634300080000330000000000000000000000001685133a98e1d4fc1fe8e25b7493d186c37b6b24000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

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

0000000000000000000000001685133a98e1d4fc1fe8e25b7493d186c37b6b24000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986caaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

-----Decoded View---------------
Arg [0] : failedExperiments (address): 0x1685133a98E1D4fC1fe8e25b7493D186c37B6B24
Arg [1] : vrfCoordinator (address): 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952
Arg [2] : linkToken (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [3] : keyHash (bytes32): 0xaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [4] : linkFee (uint256): 2000000000000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000001685133a98e1d4fc1fe8e25b7493d186c37b6b24
Arg [1] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [2] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [3] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [4] : 0000000000000000000000000000000000000000000000001bc16d674ec80000


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.