Contract 0xaad5c6f00541695f89ad2bc6f2e2848bdb154008

Contract Overview

Balance:
0 MATIC

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x6937221d954ef6bfa692825b694a09c093660f4e985c4120d3da1f242877dc05Add Draw221031972021-11-30 16:04:37169 days 4 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.00016984453.5
0x1aa9533b1d8f2317a77b735d3ad0de3f42e26bcfaf66299b3f43080f8cfcfac0Claim ERC721Rewa...219545822021-11-26 17:05:03173 days 3 hrs ago0xd73aa5a475f162a0dae61fb346f6f1f2236c4406 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0002068263
0xe1752ff6bc2206cd69461bc2ebc0a2d1a34f7ebe1f01a3483350a98d0a253025Claim ERC721Rewa...219545792021-11-26 17:04:57173 days 3 hrs ago0xd73aa5a475f162a0dae61fb346f6f1f2236c4406 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0002068263
0x1d5197be9c467e9493c87997dd1756c65392402d68c7ab4a23f172b54f7cc833Claim ERC721Rewa...219462352021-11-26 12:05:17173 days 8 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0002068263
0xc59d9fa9679874b2ff924a69976c3af4c394233162d40848966e793adb494d4dFinalise Draw219453732021-11-26 11:35:41173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.000703993.5
0xfce09e95eb43b6de2a7d0fd0ffd281a11962b63350d94752deabec80086e688aStart Close Draw219452932021-11-26 11:32:57173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0008670133.5
0xc2dcdefd76b1bbe04936c10af020a2abffa2caa8b85c706b38438f9faf25bbe8Add Entrant To D...219452772021-11-26 11:32:21173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
0xbdda036827cb5730092c1302915f568b47d602d44a7bf92b7bf6a33ad53eb441Add Entrant To D...219452092021-11-26 11:30:01173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
0xd06c64ecd0aa17325ad1f43f87d7ade09148d029356a5cf72cf492424efa88e9Add Entrant To D...219452022021-11-26 11:29:47173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
0xe1c1fbbc089cc80d40963ffccaf17b0f0f3286e6ef8264f6e7dd9f0057ebe5daAdd Entrant To D...219451852021-11-26 11:29:13173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
0x7c4becf2c8cd62088f5a775e004d104a5f90f0c77a83e722c567b8febc4b7ff5Add Entrant To D...219449872021-11-26 11:22:25173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
0xba82529c48c731ea50795abfa087a91d8c5faeb8ec7e2f6a00304a93982f777bAdd Entrant To D...219449832021-11-26 11:22:17173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
0xec109ca852b3dec5a00a55de98e16f79a5b16fe98d7b850440d9cd159e788953Add Entrant To D...219449782021-11-26 11:22:07173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0002670183
0x3e86446d997709a9d31c8779d1ea52100a123f44030ce0578f66d3df466bb265Add ERC721To Dra...219445112021-11-26 11:06:01173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.00038206353.5
0xee635fbd27cf7c6cee07a7f1583fc02e39dd1745696d8f71e3d86aba609d803dAdd ERC721To Dra...219444922021-11-26 11:05:23173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.00038206353.5
0x587f99f4cd227f06a624346843d2b32e651a33286ad59dfa0fae5ee41a217a5fAdd ERC721To Dra...219444782021-11-26 11:04:55173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.00038206353.5
0x8fa2d6b21e9ba6be4f3184d41b563f8821ae05b166ca4fc2f020b0dc71b3183aAdd ERC721To Dra...219444422021-11-26 11:03:39173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.00050176353.5
0x1236850ef319eccdc0364b7422046e71a2164134feac2906ad115f864b3532c6Add Draw219442012021-11-26 10:55:25173 days 9 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0001455813
0xe1a557493a09f1a0d57437c673a88cfd8242605cc079d134d27c70a65b08bf07Claim ERC721Rewa...219430562021-11-26 10:16:03173 days 10 hrs ago0xd73aa5a475f162a0dae61fb346f6f1f2236c4406 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.000206793
0xf738e149284105419fed7da8a30fdcd1c33f72b3976691d45cfff00cf14e0539Claim ERC721Rewa...219430542021-11-26 10:15:59173 days 10 hrs ago0xd73aa5a475f162a0dae61fb346f6f1f2236c4406 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0002068263
0x1ea2802d2e4a919941ea92946198f8a33381029a79f337fae7dc4ec602fcc758Finalise Draw219137902021-11-25 16:41:46174 days 4 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0007039483.5
0x08d4088179db06295acb5e6a01587dd3df4c2ee0624f4eea181cf44e7c5df5deStart Close Draw219136652021-11-25 16:37:32174 days 4 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0008670133.5
0xded6a63ae86bb9809098e0270ee216a17a4f3a482732ec5d3470d11773f3f78aAdd Entrant To D...219135622021-11-25 16:33:58174 days 4 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
0x14bb7b7ed2f70b945196106217c4e2f74fe5fddca8166fd4714c45d30bccac2aAdd ERC721To Dra...219135602021-11-25 16:33:54174 days 4 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.00038206353.5
0x722890a13613dc51f2885aa2e74e4af893bf58c1c5e0be67e1f0f7b92b9d844aAdd Entrant To D...219134802021-11-25 16:31:10174 days 4 hrs ago0xc211b02f5a7fe05d5ec30dc4348fab51c41b72f1 IN  0xaad5c6f00541695f89ad2bc6f2e2848bdb1540080 MATIC0.0003267543
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RandomNFTAirdropMasterV1

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2021-11-12
*/

// File: contracts/IRandomNFTAirdropMasterV1.sol


pragma solidity ^0.8.2;

interface IRandomNFTAirdropMasterV1 {
    /**
     * Fired when a draw has been added via addDraw()
     */
    event DrawCreated(bytes32 drawUUID, address instanceAddress);
    /**
     * Fired by a worker call to startCloseDraw()
     */
    event DrawCloseStarted(bytes32 drawUUID, bytes32 vrfRequestId);
    /**
     * Fired by internal call triggered by Chainlink VRF coordinator
     * once this has been emitted, worker can call finaliseDraw()
     */
    event DrawCloseVRFComplete(bytes32 drawUUID);
    /**
     *Fired by worker call to finaliseDraw()
     */
    event DrawCloseFinished(bytes32 drawUUID);
    /**
     * Fired by worker call to addEntrantToDraw()
     */
    event DrawEntrantAdded(
        bytes32 drawUUID,
        bytes32 entrantId,
        address entrant
    );
    /**
     * Fired by admin call to addERC721ToDraw()
     */
    event ERC721RewardAdded(
        bytes32 drawUUID,
        address nftTokenAddress,
        uint256 nftTokenId,
        address addedBy,
        uint256 rewardIndex
    );
    /**
     * Fired by admin call to cancelERC721InDraw()
     */
    event ERC721RewardCancelled(bytes32 drawUUID, address sentTo);
    /**
     * When worker calls finaliseDraw(), it will iterate over all rewards assigning them and fire off this event via the internal call _assignERC721Winner
     */
    event DrawERC721RewardAssigned(
        bytes32 drawUUID,
        uint256 rewardIndex,
        address winnerAddress,
        bytes32 entrantId
    );
    /**
     * Fired when user claims their reward via claimERC721RewardFromDraw()
     */
    event DrawERC721RewardClaimed(
        bytes32 drawUUID,
        uint256 rewardIndex,
        address winnerAddress
    );
    /**
     * Fired when emergencyCancellation() is called
     */
    event DrawCancelled(bytes32 drawUUID);
}

// File: contracts/RandomNFTAirdrop.lib.sol


pragma solidity ^0.8.2;

library RandomNFTAirdrop {
    enum DrawStatus {
        ACCEPTING_ENTRANTS,
        ENTRANTS_CLOSED,
        PENDING_ASSIGNMENT,
        REWARDS_ASSIGNED,
        CANCELLED
    }

    enum RewardStatus {
        UNASSIGNED,
        ASSIGNED,
        CLAIMED
    }

    struct ERC721Reward {
        address nftTokenAddress;
        uint256 tokenId;
        address addedBy;
        /*
         * address(0) until winner is decided
         */
        address winner;
        RewardStatus status;
    }

    struct ERC20Reward {
        address tokenAddress;
        uint256 amount;
        address addedBy;
        /*
         * address(0) until winner is decided
         */
        address winner;
        RewardStatus status;
    }

    struct VRFRequestState {
        bytes32 drawUUID;
        address drawInstanceAddress;
        bool fulfilled;
        uint256 countOfRewards;
        uint256 countOfEntrants;
        uint256 randomValue;
    }

    struct Entrant {
        address entrantAddress;
        bytes32 entrantId;
    }

    function _getWinningEntrantIndexes(
        uint256 seed,
        uint256 winnerCount,
        uint256 entrantCount
    ) internal pure returns (uint256[] memory) {
        uint256[] memory expandedValues = new uint256[](winnerCount);
        for (uint256 i = 0; i < winnerCount; i++) {
            expandedValues[i] = (uint256(keccak256(abi.encode(seed, i))) %
                entrantCount);
        }
        return expandedValues;
    }
}

// File: contracts/IRandomNFTAirdropDrawV1.sol


pragma solidity ^0.8.2;


interface IRandomNFTAirdropDrawV1 {
    /**
     * Returns draw UUID that was used in deployment of contract
     */
    function getDrawUUID() external view returns (bytes32);

    /**
     * Gets the amount of ERC721 rewards
     */
    function getCountOfERC721Rewards() external view returns (uint256);

    /**
     * Gets the amount of entrants to this draw
     */
    function getCountOfEntrants() external view returns (uint256);

    /**
     * Adds an ERC721 reward
     *
     * Called by master contract
     */
    function addERC721Reward(
        address addedBy,
        address nftTokenAddress,
        uint256 tokenId
    ) external returns (uint256);

    /**
     * Returns details of an individual ERC721 reward
     */
    function getERC721RewardInfo(uint256 rewardIndex)
        external
        view
        returns (RandomNFTAirdrop.ERC721Reward memory);

    // /**
    //  * Cancels an ERC721 reward
    //  *
    //  * Draw must still be open to new entrants and reward unassigned
    //  */
    // function cancelERC721Reward(uint256) external returns (address);

    /**
     * Closes a draw to new entrants
     */
    function closeDraw() external;

    /**
     * Assigns a reward to an address
     *
     * Reward must be unassigned
     */
    function assignERC721Reward(uint256 rewardIndex, uint256 winnerIndex)
        external
        returns (RandomNFTAirdrop.Entrant memory winner);

    /**
     * Sends an ERC721 reward to a winner
     * Reward must be assigned to the caller and status assigned (not claimed)
     */
    function claimERC721Reward(uint256 rewardIndex) external returns (address);

    /**
     * Adds an entry into this draw
     *
     * Can only be done if the draww status is accepting entrants
     */
    function addEntrant(bytes32 entrantId, address entrant) external;

    /**
     * Emergency use incase of issue with contract
     */
    function emergencyCancellation() external;
}

// File: @chainlink/contracts/src/v0.8/VRFRequestIDBase.sol


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: @chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol


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: @chainlink/contracts/src/v0.8/VRFConsumerBase.sol


pragma solidity ^0.8.0;



/** ****************************************************************************
 * @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     constuctor(<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 constant private 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 immutable internal LINK;
  address immutable private vrfCoordinator;

  // Nonces for each VRF key from which randomness has been requested.
  //
  // Must stay in sync with VRFCoordinator[_keyHash][this]
  mapping(bytes32 /* keyHash */ => uint256 /* 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: @openzeppelin/contracts/utils/math/SafeMath.sol



pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

// File: @openzeppelin/contracts/access/IAccessControl.sol



pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/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: @openzeppelin/contracts/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: @openzeppelin/contracts/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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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: @openzeppelin/contracts/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: @openzeppelin/contracts/utils/introspection/IERC165.sol



pragma solidity ^0.8.0;

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

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol



pragma solidity ^0.8.0;


/**
 * @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: @openzeppelin/contracts/access/AccessControl.sol



pragma solidity ^0.8.0;





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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

// File: @openzeppelin/contracts/token/ERC721/IERC721.sol



pragma solidity ^0.8.0;


/**
 * @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: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol



pragma solidity ^0.8.0;


/**
 * @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: @openzeppelin/contracts/token/ERC721/ERC721.sol



pragma solidity ^0.8.0;








/**
 * @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 {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_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);
    }

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

    /**
     * @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 of token that is not own");
        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);
    }

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

// File: contracts/RandomNFTAirdropMasterV1.sol


pragma solidity ^0.8.2;








contract RandomNFTAirdropMasterV1 is
    AccessControl,
    VRFConsumerBase,
    IRandomNFTAirdropMasterV1
{
    using Address for address;
    using SafeMath for uint256;

    bytes32 public constant WORKER_ROLE = keccak256("WORKER_ROLE");

    bytes32 keyHash;
    uint256 linkFee;

    /**
     * Maps draw UUID to draw instance address
     */
    mapping(bytes32 => address) public drawContracts;

    /**
     * Maps VRF request ID to VRFRequestState
     */
    mapping(bytes32 => RandomNFTAirdrop.VRFRequestState) public vrfRequests;

    // Master

    constructor(
        bytes32 _keyHash,
        uint256 _linkFee,
        address _vrfCoordinatorAddress,
        address _linkTokenAddress
    ) VRFConsumerBase(_vrfCoordinatorAddress, _linkTokenAddress) {
        keyHash = _keyHash;
        linkFee = _linkFee;

        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _setupRole(WORKER_ROLE, _msgSender());
    }

    /**
     * Add Draw class
     */
    function addDraw(bytes32 drawUUID, address drawAddress)
        public
        onlyRole(WORKER_ROLE)
    {
        address drawCheck = drawContracts[drawUUID];
        require(
            drawCheck == address(0),
            "RandomNFTAirdropMasterV1: Draw UUID already used"
        );

        drawContracts[drawUUID] = drawAddress;

        emit DrawCreated(drawUUID, drawAddress);
    }

    /**
     * Returns a draw instance address from a given drawUUID
     */
    function getDrawAddress(bytes32 drawUUID) public view returns (address) {
        address drawAddress = drawContracts[drawUUID];
        require(
            drawAddress != address(0),
            "RandomNFTAirdropMasterV1: Draw not found"
        );

        return (drawAddress);
    }

    /**
     * Adds an ERC721 to a draw
     * Note: ERC721 token should be approved for master contract to transfer before calling this
     */
    function addERC721ToDraw(
        bytes32 drawUUID,
        address nftTokenAddress,
        uint256 nftTokenId
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        address drawAddress = getDrawAddress(drawUUID);
        ERC721 nftContract = ERC721(nftTokenAddress);

        IRandomNFTAirdropDrawV1 drawInstance = IRandomNFTAirdropDrawV1(
            drawAddress
        );

        // Transfer NFT to draw instance

        nftContract.transferFrom(_msgSender(), drawAddress, nftTokenId);
        uint256 rewardIndex = drawInstance.addERC721Reward(
            _msgSender(),
            nftTokenAddress,
            nftTokenId
        );

        emit ERC721RewardAdded(
            drawUUID,
            nftTokenAddress,
            nftTokenId,
            _msgSender(),
            rewardIndex
        );
    }

    // /**
    //  * Cancels and refunds an ERC721 from a draw instance
    //  */
    // function cancelERC721InDraw(bytes32 drawUUID, uint256 index)
    //     public
    //     onlyRole(DEFAULT_ADMIN_ROLE)
    // {
    //     address sentTo = IRandomNFTAirdropDrawV1(getDrawAddress(drawUUID))
    //         .cancelERC721Reward(index);
    //     emit ERC721RewardCancelled(drawUUID, sentTo);
    // }

    /**
     * Adds an entrant to a draw instance
     */
    function addEntrantToDraw(
        bytes32 drawUUID,
        bytes32 entrantId,
        address entrant
    ) public onlyRole(WORKER_ROLE) {
        IRandomNFTAirdropDrawV1(getDrawAddress(drawUUID)).addEntrant(
            entrantId,
            entrant
        );
        emit DrawEntrantAdded(drawUUID, entrantId, entrant);
    }

    /**
     * Claims an ERC721 reward and sends it to winner
     */
    function claimERC721RewardFromDraw(bytes32 drawUUID, uint256 index) public {
        emit DrawERC721RewardClaimed(
            drawUUID,
            index,
            IRandomNFTAirdropDrawV1(getDrawAddress(drawUUID)).claimERC721Reward(
                index
            )
        );
    }

    /**
     * Assigns a ERC721 reward a winner
     */
    function _assignERC721Winner(
        bytes32 drawUUID,
        uint256 rewardIndex,
        uint256 winnerIndex
    ) internal {
        RandomNFTAirdrop.Entrant memory winner = IRandomNFTAirdropDrawV1(
            getDrawAddress(drawUUID)
        ).assignERC721Reward(rewardIndex, winnerIndex);
        emit DrawERC721RewardAssigned(
            drawUUID,
            rewardIndex,
            winner.entrantAddress,
            winner.entrantId
        );
    }

    /**
     * Starts a draw close process, once VRF has been assigned `finaliseDraw` can be called
     */
    function startCloseDraw(bytes32 drawUUID) public onlyRole(WORKER_ROLE) {
        address drawAddress = getDrawAddress(drawUUID);
        IRandomNFTAirdropDrawV1 drawInstance = IRandomNFTAirdropDrawV1(
            drawAddress
        );

        uint256 amountOfRewards = drawInstance.getCountOfERC721Rewards();
        uint256 amountOfEntrants = drawInstance.getCountOfEntrants();

        require(
            LINK.balanceOf(address(this)) >= linkFee,
            "RandomNFTAirdropMasterV1: Not enough LINK balance"
        );

        drawInstance.closeDraw();
        bytes32 vrfRequestId = requestRandomness(keyHash, linkFee);
        vrfRequests[vrfRequestId] = RandomNFTAirdrop.VRFRequestState(
            drawUUID,
            drawAddress,
            false,
            amountOfRewards,
            amountOfEntrants,
            0
        );

        emit DrawCloseStarted(drawUUID, vrfRequestId);
    }

    /**
     * This is called by chainlink's VRF system and provides the random data we use to allocate the rewards
     */
    function fulfillRandomness(bytes32 requestId, uint256 randomness)
        internal
        override
    {
        vrfRequests[requestId].fulfilled = true;
        vrfRequests[requestId].randomValue = randomness;

        emit DrawCloseVRFComplete(vrfRequests[requestId].drawUUID);
    }

    /**
     * Completes draw reward allocation (invoked by IG)
     *
     * Note: This function should only be called AFTER the VRF request is fulled
     * (when DrawCloseVRFComplete event has been emitted)
     */
    function finaliseDraw(bytes32 requestId) public onlyRole(WORKER_ROLE) {
        RandomNFTAirdrop.VRFRequestState memory requestState = vrfRequests[
            requestId
        ];
        require(
            requestState.fulfilled,
            "RandomNFTAirdropMasterV1: VRF request not fulfilled"
        );
        uint256[] memory winningEntrantIndexes = RandomNFTAirdrop
            ._getWinningEntrantIndexes(
                requestState.randomValue,
                requestState.countOfRewards,
                requestState.countOfEntrants
            );

        for (
            uint256 rewardIndex = 0;
            rewardIndex < requestState.countOfRewards;
            rewardIndex++
        ) {
            uint256 winnerIndex = winningEntrantIndexes[rewardIndex];
            _assignERC721Winner(
                requestState.drawUUID,
                rewardIndex,
                winnerIndex
            );
        }

        emit DrawCloseFinished(requestState.drawUUID);
    }

    /**
     * Remove link tokens
     */
    function removeLink(uint256 amount, address recipient)
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        LINK.transfer(recipient, amount);
    }

    /**
     * Emergency cancellation for a draw instance
     */
    function emergencyCancellation(bytes32 drawUUID)
        public
        onlyRole(DEFAULT_ADMIN_ROLE)
    {
        IRandomNFTAirdropDrawV1(getDrawAddress(drawUUID))
            .emergencyCancellation();

        emit DrawCancelled(drawUUID);
    }
}

Contract ABI

[{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint256","name":"_linkFee","type":"uint256"},{"internalType":"address","name":"_vrfCoordinatorAddress","type":"address"},{"internalType":"address","name":"_linkTokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"}],"name":"DrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"}],"name":"DrawCloseFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"vrfRequestId","type":"bytes32"}],"name":"DrawCloseStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"}],"name":"DrawCloseVRFComplete","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"indexed":false,"internalType":"address","name":"instanceAddress","type":"address"}],"name":"DrawCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"rewardIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"winnerAddress","type":"address"},{"indexed":false,"internalType":"bytes32","name":"entrantId","type":"bytes32"}],"name":"DrawERC721RewardAssigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"rewardIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"winnerAddress","type":"address"}],"name":"DrawERC721RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"entrantId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"entrant","type":"address"}],"name":"DrawEntrantAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"indexed":false,"internalType":"address","name":"nftTokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"addedBy","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewardIndex","type":"uint256"}],"name":"ERC721RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"indexed":false,"internalType":"address","name":"sentTo","type":"address"}],"name":"ERC721RewardCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WORKER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"internalType":"address","name":"drawAddress","type":"address"}],"name":"addDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"internalType":"address","name":"nftTokenAddress","type":"address"},{"internalType":"uint256","name":"nftTokenId","type":"uint256"}],"name":"addERC721ToDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"internalType":"bytes32","name":"entrantId","type":"bytes32"},{"internalType":"address","name":"entrant","type":"address"}],"name":"addEntrantToDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"claimERC721RewardFromDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"drawContracts","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"}],"name":"emergencyCancellation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"finaliseDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"}],"name":"getDrawAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"removeLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"}],"name":"startCloseDraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"vrfRequests","outputs":[{"internalType":"bytes32","name":"drawUUID","type":"bytes32"},{"internalType":"address","name":"drawInstanceAddress","type":"address"},{"internalType":"bool","name":"fulfilled","type":"bool"},{"internalType":"uint256","name":"countOfRewards","type":"uint256"},{"internalType":"uint256","name":"countOfEntrants","type":"uint256"},{"internalType":"uint256","name":"randomValue","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c06040523480156200001157600080fd5b5060405162001ceb38038062001ceb83398101604081905262000034916200016f565b6001600160601b0319606083811b821660a05282901b16608052600284905560038390556200006c6000620000663390565b620000a2565b620000987ff1b411d6abb365480ac902cc153c45e9ded5847a2265ce6d01945d253edb6bc73362000066565b50505050620001b9565b620000ae8282620000b2565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000ae576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200010e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160a01b03811681146200016a57600080fd5b919050565b6000806000806080858703121562000185578384fd5b84519350602085015192506200019e6040860162000152565b9150620001ae6060860162000152565b905092959194509250565b60805160601c60a05160601c611af1620001fa600039600081816109fa01526110ba0152600081816104b5015281816107f4015261108b0152611af16000f3fe608060405234801561001057600080fd5b506004361061012b5760003560e01c806391d14854116100ad578063d547741f11610071578063d547741f146102a7578063db531a9c146102ba578063dec04e5f146102cd578063e1837eb714610357578063ef2e1d8e1461036a5761012b565b806391d148541461025357806394985ddd146102665780639aae3d3e146102795780639de1b96b1461028c578063a217fddf1461029f5761012b565b806336568abe116100f457806336568abe146101f25780633dcdedf114610205578063634252dc146102185780637c2602971461022d57806391362838146102405761012b565b80627394891461013057806301ffc9a714610145578063229f77d91461016d578063248a9ca3146101ae5780632f2ff15d146101df575b600080fd5b61014361013e366004611748565b61037d565b005b61015861015336600461181f565b6106e2565b60405190151581526020015b60405180910390f35b61019661017b366004611748565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610164565b6101d16101bc366004611748565b60009081526020819052604090206001015490565b604051908152602001610164565b6101436101ed366004611760565b610719565b610143610200366004611760565b610744565b6101436102133660046118c2565b6107c2565b6101d1600080516020611a9c83398151915281565b61014361023b3660046117c6565b610876565b61019661024e366004611748565b610950565b610158610261366004611760565b6109c6565b6101436102743660046117fe565b6109ef565b610143610287366004611760565b610a71565b61014361029a3660046117fe565b610b68565b6101d1600081565b6101436102b5366004611760565b610c3e565b6101436102c836600461178f565b610c64565b61031c6102db366004611748565b6005602052600090815260409020805460018201546002830154600384015460049094015492936001600160a01b03831693600160a01b90930460ff169286565b604080519687526001600160a01b039095166020870152921515938501939093526060840152608083019190915260a082015260c001610164565b610143610365366004611748565b610dfa565b610143610378366004611748565b610e92565b600080516020611a9c83398151915261039781335b611023565b60006103a283610950565b905060008190506000816001600160a01b031663aeb13dbb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103e457600080fd5b505afa1580156103f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041c91906118aa565b90506000826001600160a01b031663dbc78c7a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561045957600080fd5b505afa15801561046d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049191906118aa565b6003546040516370a0823160e01b8152306004820152919250906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b1580156104f757600080fd5b505afa15801561050b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052f91906118aa565b101561059c5760405162461bcd60e51b815260206004820152603160248201527f52616e646f6d4e465441697264726f704d617374657256313a204e6f7420656e6044820152706f756768204c494e4b2062616c616e636560781b60648201526084015b60405180910390fd5b826001600160a01b031663a0eb55706040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156105d757600080fd5b505af11580156105eb573d6000803e3d6000fd5b5050505060006105ff600254600354611087565b6040805160c0810182528981526001600160a01b0380891660208084019182526000848601818152606086018b8152608087018b815260a088018481528a855260059095529288902096518755935160018701805492511515600160a01b0260ff60a01b19929097166001600160a01b0319909316929092171694909417909355905160028401559051600383015551600490910155519091507f86e373b75200f9686e111e33233912d5f3ea633cab92f7fc33e1c29b76ae1a95906106d19089908490918252602082015260400190565b60405180910390a150505050505050565b60006001600160e01b03198216637965db0b60e01b148061071357506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546107358133610392565b61073f8383611219565b505050565b6001600160a01b03811633146107b45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610593565b6107be828261129d565b5050565b60006107ce8133610392565b60405163a9059cbb60e01b81526001600160a01b038381166004830152602482018590527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b15801561083857600080fd5b505af115801561084c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108709190611728565b50505050565b600080516020611a9c83398151915261088f8133610392565b61089884610950565b6040516309bc2ddd60e31b8152600481018590526001600160a01b0384811660248301529190911690634de16ee890604401600060405180830381600087803b1580156108e457600080fd5b505af11580156108f8573d6000803e3d6000fd5b505060408051878152602081018790526001600160a01b038616918101919091527f16e332550d20e4d078d83007d05fc660dff34a40b4918ff9f1100a1c5c3e52fe925060600190505b60405180910390a150505050565b6000818152600460205260408120546001600160a01b0316806107135760405162461bcd60e51b815260206004820152602860248201527f52616e646f6d4e465441697264726f704d617374657256313a2044726177206e6044820152671bdd08199bdd5b9960c21b6064820152608401610593565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a675760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610593565b6107be8282611302565b600080516020611a9c833981519152610a8a8133610392565b6000838152600460205260409020546001600160a01b03168015610b095760405162461bcd60e51b815260206004820152603060248201527f52616e646f6d4e465441697264726f704d617374657256313a2044726177205560448201526f15525108185b1c9958591e481d5cd95960821b6064820152608401610593565b60008481526004602090815260409182902080546001600160a01b0319166001600160a01b0387169081179091558251878152918201527fb59dc7284f1cfd26b82522a726e9d5b7667bd57ecf3abf2f212ec1a40208b4439101610942565b7f9d109411de9c9c32449c565ba9de3576b92da975092849103b1f68718bfcb40d8282610b9485610950565b6001600160a01b03166272ec71856040518263ffffffff1660e01b8152600401610bc091815260200190565b602060405180830381600087803b158015610bda57600080fd5b505af1158015610bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c12919061170c565b6040805193845260208401929092526001600160a01b0316908201526060015b60405180910390a15050565b600082815260208190526040902060010154610c5a8133610392565b61073f838361129d565b6000610c708133610392565b6000610c7b85610950565b905083816001600160a01b0382166323b872dd336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908616602482015260448101889052606401600060405180830381600087803b158015610cdf57600080fd5b505af1158015610cf3573d6000803e3d6000fd5b505050506000816001600160a01b0316631a02fa40610d0f3390565b6040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908a16602482015260448101899052606401602060405180830381600087803b158015610d5f57600080fd5b505af1158015610d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9791906118aa565b604080518a81526001600160a01b038a1660208201528082018990523360608201526080810183905290519192507f5b8f0866073b023316dd3085693b4e79c28771325ddcfe43403417b7ba4eefd5919081900360a00190a15050505050505050565b6000610e068133610392565b610e0f82610950565b6001600160a01b0316630f016bcc6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e4957600080fd5b505af1158015610e5d573d6000803e3d6000fd5b505050507f0fff0bb25c2702bbd086044c48897aaa8adf2e4b92b28351586c25987f2e406882604051610c3291815260200190565b600080516020611a9c833981519152610eab8133610392565b600082815260056020908152604091829020825160c0810184528154815260018201546001600160a01b03811693820193909352600160a01b90920460ff16151592820183905260028101546060830152600381015460808301526004015460a082015290610f785760405162461bcd60e51b815260206004820152603360248201527f52616e646f6d4e465441697264726f704d617374657256313a205652462072656044820152721c5d595cdd081b9bdd08199d5b199a5b1b1959606a1b6064820152608401610593565b6000610f918260a0015183606001518460800151611360565b905060005b8260600151811015610ff0576000828281518110610fc457634e487b7160e01b600052603260045260246000fd5b60200260200101519050610fdd8460000151838361143b565b5080610fe881611a32565b915050610f96565b5081516040519081527fc49b692c1af9b60ecfd91426727e212ba0faabd5beb3c5ac21732952d5af628290602001610942565b61102d82826109c6565b6107be57611045816001600160a01b03166014611523565b611050836020611523565b604051602001611061929190611900565b60408051601f198184030181529082905262461bcd60e51b8252610593916004016119a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016110f7929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161112493929190611975565b602060405180830381600087803b15801561113e57600080fd5b505af1158015611152573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111769190611728565b50600083815260016020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052908290526111d1916119b8565b6000858152600160205260409020556112118482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b949350505050565b61122382826109c6565b6107be576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556112593390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6112a782826109c6565b156107be576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000828152600560205260409081902060018101805460ff60a01b1916600160a01b179055600481018390555490517f293a07216cacf0f3cce478f6c09a52f9ceb4db17084e2f40f139878495019a7a91610c329190815260200190565b606060008367ffffffffffffffff81111561138b57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156113b4578160200160208202803683370190505b50905060005b8481101561143257604080516020808201899052818301849052825180830384018152606090920190925280519101206113f5908590611a4d565b82828151811061141557634e487b7160e01b600052603260045260246000fd5b60209081029190910101528061142a81611a32565b9150506113ba565b50949350505050565b600061144684610950565b604051630912fb1f60e31b815260048101859052602481018490526001600160a01b039190911690634897d8f8906044016040805180830381600087803b15801561149057600080fd5b505af11580156114a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c89190611847565b805160208201516040519293507f25a5dddec43141efa2a9c7a564c8d9a74d6e84824a4dc74e5f236212521310f392610942928892889293845260208401929092526001600160a01b03166040830152606082015260800190565b606060006115328360026119d0565b61153d9060026119b8565b67ffffffffffffffff81111561156357634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561158d576020820181803683370190505b509050600360fc1b816000815181106115b657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106115f357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006116178460026119d0565b6116229060016119b8565b90505b60018111156116b6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061166457634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061168857634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c936116af81611a1b565b9050611625565b5083156117055760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610593565b9392505050565b60006020828403121561171d578081fd5b815161170581611a83565b600060208284031215611739578081fd5b81518015158114611705578182fd5b600060208284031215611759578081fd5b5035919050565b60008060408385031215611772578081fd5b82359150602083013561178481611a83565b809150509250929050565b6000806000606084860312156117a3578081fd5b8335925060208401356117b581611a83565b929592945050506040919091013590565b6000806000606084860312156117da578283fd5b833592506020840135915060408401356117f381611a83565b809150509250925092565b60008060408385031215611810578182fd5b50508035926020909101359150565b600060208284031215611830578081fd5b81356001600160e01b031981168114611705578182fd5b600060408284031215611858578081fd5b6040516040810181811067ffffffffffffffff8211171561188757634e487b7160e01b83526041600452602483fd5b604052825161189581611a83565b81526020928301519281019290925250919050565b6000602082840312156118bb578081fd5b5051919050565b60008060408385031215611772578182fd5b600081518084526118ec8160208601602086016119ef565b601f01601f19169290920160200192915050565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000825283516119388160178501602088016119ef565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516119698160288401602088016119ef565b01602801949350505050565b600060018060a01b03851682528360208301526060604083015261199c60608301846118d4565b95945050505050565b60006020825261170560208301846118d4565b600082198211156119cb576119cb611a6d565b500190565b60008160001904831182151516156119ea576119ea611a6d565b500290565b60005b83811015611a0a5781810151838201526020016119f2565b838111156108705750506000910152565b600081611a2a57611a2a611a6d565b506000190190565b6000600019821415611a4657611a46611a6d565b5060010190565b600082611a6857634e487b7160e01b81526012600452602481fd5b500690565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611a9857600080fd5b5056fef1b411d6abb365480ac902cc153c45e9ded5847a2265ce6d01945d253edb6bc7a26469706673582212206b08503d465b7f8304f0852b4fb2fb473e830d715b9ddc86d5b7b2a8fd218a3f64736f6c634300080200336e75b569a01ef56d18cab6a8e71e6600d6ce853834d4a5748b720d06f878b3a400000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000008c7382f9d8f56b33781fe506e897a4f1e2d17255000000000000000000000000326c977e6efc84e512bb9c30f76e30c160ed06fb

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

6e75b569a01ef56d18cab6a8e71e6600d6ce853834d4a5748b720d06f878b3a400000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000008c7382f9d8f56b33781fe506e897a4f1e2d17255000000000000000000000000326c977e6efc84e512bb9c30f76e30c160ed06fb

-----Decoded View---------------
Arg [0] : _keyHash (bytes32): 0x6e75b569a01ef56d18cab6a8e71e6600d6ce853834d4a5748b720d06f878b3a4
Arg [1] : _linkFee (uint256): 100000000000000
Arg [2] : _vrfCoordinatorAddress (address): 0x8c7382f9d8f56b33781fe506e897a4f1e2d17255
Arg [3] : _linkTokenAddress (address): 0x326c977e6efc84e512bb9c30f76e30c160ed06fb

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 6e75b569a01ef56d18cab6a8e71e6600d6ce853834d4a5748b720d06f878b3a4
Arg [1] : 00000000000000000000000000000000000000000000000000005af3107a4000
Arg [2] : 0000000000000000000000008c7382f9d8f56b33781fe506e897a4f1e2d17255
Arg [3] : 000000000000000000000000326c977e6efc84e512bb9c30f76e30c160ed06fb


Deployed ByteCode Sourcemap

69024:7845:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;73694:938;;;;;;:::i;:::-;;:::i;:::-;;45319:204;;;;;;:::i;:::-;;:::i;:::-;;;6422:14:1;;6415:22;6397:41;;6385:2;6370:18;45319:204:0;;;;;;;;69392:48;;;;;;:::i;:::-;;;;;;;;;;;;-1:-1:-1;;;;;69392:48:0;;;;;;-1:-1:-1;;;;;5164:32:1;;;5146:51;;5134:2;5119:18;69392:48:0;5101:102:1;46730:123:0;;;;;;:::i;:::-;46796:7;46823:12;;;;;;;;;;:22;;;;46730:123;;;;6595:25:1;;;6583:2;6568:18;46730:123:0;6550:76:1;47115:147:0;;;;;;:::i;:::-;;:::i;48163:218::-;;;;;;:::i;:::-;;:::i;76369:165::-;;;;;;:::i;:::-;;:::i;69209:62::-;;-1:-1:-1;;;;;;;;;;;69209:62:0;;72312:341;;;;;;:::i;:::-;;:::i;70532:295::-;;;;;;:::i;:::-;;:::i;45615:139::-;;;;;;:::i;:::-;;:::i;18849:233::-;;;;;;:::i;:::-;;:::i;70040:404::-;;;;;;:::i;:::-;;:::i;72734:297::-;;;;;;:::i;:::-;;:::i;44706:49::-;;44751:4;44706:49;;47507:149;;;;;;:::i;:::-;;:::i;70984:841::-;;;;;;:::i;:::-;;:::i;69514:71::-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;69514:71:0;;;-1:-1:-1;;;69514:71:0;;;;;;;;;;;;7191:25:1;;;-1:-1:-1;;;;;7252:32:1;;;7247:2;7232:18;;7225:60;7328:14;;7321:22;7301:18;;;7294:50;;;;7375:2;7360:18;;7353:34;7418:3;7403:19;;7396:35;;;;7272:3;7447:19;;7440:35;7178:3;7163:19;69514:71:0;7145:336:1;76611:255:0;;;;;;:::i;:::-;;:::i;75293:1023::-;;;;;;:::i;:::-;;:::i;73694:938::-;-1:-1:-1;;;;;;;;;;;45197:30:0;69247:24;31800:10;45214:12;45197:10;:30::i;:::-;73776:19:::1;73798:24;73813:8;73798:14;:24::i;:::-;73776:46;;73833:36;73910:11;73833:99;;73945:23;73971:12;-1:-1:-1::0;;;;;73971:36:0::1;;:38;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;73945:64;;74020:24;74047:12;-1:-1:-1::0;;;;;74047:31:0::1;;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;74148:7;::::0;74115:29:::1;::::0;-1:-1:-1;;;74115:29:0;;74138:4:::1;74115:29;::::0;::::1;5146:51:1::0;74020:60:0;;-1:-1:-1;74148:7:0;-1:-1:-1;;;;;74115:4:0::1;:14;::::0;::::1;::::0;5119:18:1;;74115:29:0::1;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:40;;74093:139;;;::::0;-1:-1:-1;;;74093:139:0;;10847:2:1;74093:139:0::1;::::0;::::1;10829:21:1::0;10886:2;10866:18;;;10859:30;10925:34;10905:18;;;10898:62;-1:-1:-1;;;10976:18:1;;;10969:47;11033:19;;74093:139:0::1;;;;;;;;;74245:12;-1:-1:-1::0;;;;;74245:22:0::1;;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;74280:20;74303:35;74321:7;;74330;;74303:17;:35::i;:::-;74377:189;::::0;;::::1;::::0;::::1;::::0;;;;;-1:-1:-1;;;;;74377:189:0;;::::1;;::::0;;::::1;::::0;;;-1:-1:-1;74377:189:0;;;;;;;;;;;;;;;;;;;;;;;;74349:25;;;:11:::1;:25:::0;;;;;;;:217;;;;;;74377:189;74349:217;::::1;::::0;;;;::::1;;-1:-1:-1::0;;;74349:217:0::1;-1:-1:-1::0;;;;74349:217:0;;;::::1;-1:-1:-1::0;;;;;;74349:217:0;;::::1;::::0;;;::::1;;::::0;;;::::1;::::0;;;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;::::1;::::0;;::::1;::::0;74584:40;74280:58;;-1:-1:-1;74584:40:0::1;::::0;::::1;::::0;74424:8;;74280:58;;8184:25:1;;;8240:2;8225:18;;8218:34;8172:2;8157:18;;8139:119;74584:40:0::1;;;;;;;;45238:1;;;;;73694:938:::0;;:::o;45319:204::-;45404:4;-1:-1:-1;;;;;;45428:47:0;;-1:-1:-1;;;45428:47:0;;:87;;-1:-1:-1;;;;;;;;;;42749:40:0;;;45479:36;45421:94;45319:204;-1:-1:-1;;45319:204:0:o;47115:147::-;46796:7;46823:12;;;;;;;;;;:22;;;45197:30;45208:4;31800:10;45214:12;31720:98;45197:30;47229:25:::1;47240:4;47246:7;47229:10;:25::i;:::-;47115:147:::0;;;:::o;48163:218::-;-1:-1:-1;;;;;48259:23:0;;31800:10;48259:23;48251:83;;;;-1:-1:-1;;;48251:83:0;;12871:2:1;48251:83:0;;;12853:21:1;12910:2;12890:18;;;12883:30;12949:34;12929:18;;;12922:62;-1:-1:-1;;;13000:18:1;;;12993:45;13055:19;;48251:83:0;12843:237:1;48251:83:0;48347:26;48359:4;48365:7;48347:11;:26::i;:::-;48163:218;;:::o;76369:165::-;44751:4;45197:30;44751:4;31800:10;45214:12;31720:98;45197:30;76494:32:::1;::::0;-1:-1:-1;;;76494:32:0;;-1:-1:-1;;;;;5780:32:1;;;76494::0::1;::::0;::::1;5762:51:1::0;5829:18;;;5822:34;;;76494:4:0::1;:13;::::0;::::1;::::0;5735:18:1;;76494:32:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;76369:165:::0;;;:::o;72312:341::-;-1:-1:-1;;;;;;;;;;;45197:30:0;69247:24;31800:10;45214:12;31720:98;45197:30;72490:24:::1;72505:8;72490:14;:24::i;:::-;72466:117;::::0;-1:-1:-1;;;72466:117:0;;::::1;::::0;::::1;6805:25:1::0;;;-1:-1:-1;;;;;6866:32:1;;;6846:18;;;6839:60;72466::0;;;::::1;::::0;::::1;::::0;6778:18:1;;72466:117:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;-1:-1:-1::0;;72599:46:0::1;::::0;;8465:25:1;;;8521:2;8506:18;;8499:34;;;-1:-1:-1;;;;;8569:32:1;;8549:18;;;8542:60;;;;72599:46:0::1;::::0;-1:-1:-1;8453:2:1;8438:18;;-1:-1:-1;72599:46:0::1;;;;;;;;72312:341:::0;;;;:::o;70532:295::-;70595:7;70637:23;;;:13;:23;;;;;;-1:-1:-1;;;;;70637:23:0;70693:25;70671:115;;;;-1:-1:-1;;;70671:115:0;;12462:2:1;70671:115:0;;;12444:21:1;12501:2;12481:18;;;12474:30;12540:34;12520:18;;;12513:62;-1:-1:-1;;;12591:18:1;;;12584:38;12639:19;;70671:115:0;12434:230:1;45615:139:0;45693:4;45717:12;;;;;;;;;;;-1:-1:-1;;;;;45717:29:0;;;;;;;;;;;;;;;45615:139::o;18849:233::-;18965:10;-1:-1:-1;;;;;18979:14:0;18965:28;;18957:72;;;;-1:-1:-1;;;18957:72:0;;12102:2:1;18957:72:0;;;12084:21:1;12141:2;12121:18;;;12114:30;12180:33;12160:18;;;12153:61;12231:18;;18957:72:0;12074:181:1;18957:72:0;19036:40;19054:9;19065:10;19036:17;:40::i;70040:404::-;-1:-1:-1;;;;;;;;;;;45197:30:0;69247:24;31800:10;45214:12;31720:98;45197:30;70159:17:::1;70179:23:::0;;;:13:::1;:23;::::0;;;;;-1:-1:-1;;;;;70179:23:0::1;70235::::0;;70213:121:::1;;;::::0;-1:-1:-1;;;70213:121:0;;11685:2:1;70213:121:0::1;::::0;::::1;11667:21:1::0;11724:2;11704:18;;;11697:30;11763:34;11743:18;;;11736:62;-1:-1:-1;;;11814:18:1;;;11807:46;11870:19;;70213:121:0::1;11657:238:1::0;70213:121:0::1;70347:23;::::0;;;:13:::1;:23;::::0;;;;;;;;:37;;-1:-1:-1;;;;;;70347:37:0::1;-1:-1:-1::0;;;;;70347:37:0;::::1;::::0;;::::1;::::0;;;70402:34;;6805:25:1;;;6846:18;;;6839:60;70402:34:0::1;::::0;6778:18:1;70402:34:0::1;6760:145:1::0;72734:297:0;72825:198;72863:8;72886:5;72930:24;72945:8;72930:14;:24::i;:::-;-1:-1:-1;;;;;72906:67:0;;72992:5;72906:106;;;;;;;;;;;;;6595:25:1;;6583:2;6568:18;;6550:76;72906:106:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;72825:198;;;8465:25:1;;;8521:2;8506:18;;8499:34;;;;-1:-1:-1;;;;;8569:32:1;8549:18;;;8542:60;8453:2;8438:18;72825:198:0;;;;;;;;72734:297;;:::o;47507:149::-;46796:7;46823:12;;;;;;;;;;:22;;;45197:30;45208:4;31800:10;45214:12;31720:98;45197:30;47622:26:::1;47634:4;47640:7;47622:11;:26::i;70984:841::-:0;44751:4;45197:30;44751:4;31800:10;45214:12;31720:98;45197:30;71153:19:::1;71175:24;71190:8;71175:14;:24::i;:::-;71153:46:::0;-1:-1:-1;71238:15:0;71153:46;-1:-1:-1;;;;;71423:24:0;::::1;;31800:10:::0;71423:63:::1;::::0;-1:-1:-1;;;;;;71423:63:0::1;::::0;;;;;;-1:-1:-1;;;;;5466:15:1;;;71423:63:0::1;::::0;::::1;5448:34:1::0;5518:15;;;5498:18;;;5491:43;5550:18;;;5543:34;;;5383:18;;71423:63:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;71497:19;71519:12;-1:-1:-1::0;;;;;71519:28:0::1;;71562:12;31800:10:::0;31720:98;;71562:12:::1;71519:121;::::0;-1:-1:-1;;;;;;71519:121:0::1;::::0;;;;;;-1:-1:-1;;;;;5466:15:1;;;71519:121:0::1;::::0;::::1;5448:34:1::0;5518:15;;;5498:18;;;5491:43;5550:18;;;5543:34;;;5383:18;;71519:121:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;71658:159;::::0;;7745:25:1;;;-1:-1:-1;;;;;7844:15:1;;7839:2;7824:18;;7817:43;7876:18;;;7869:34;;;31800:10:0;7934:2:1;7919:18;;7912:43;7986:3;7971:19;;7964:35;;;71658:159:0;;71497:143;;-1:-1:-1;71658:159:0::1;::::0;;;;;7732:3:1;71658:159:0;;::::1;45238:1;;;;70984:841:::0;;;;:::o;76611:255::-;44751:4;45197:30;44751:4;31800:10;45214:12;31720:98;45197:30;76754:24:::1;76769:8;76754:14;:24::i;:::-;-1:-1:-1::0;;;;;76730:85:0::1;;:87;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;76835:23;76849:8;76835:23;;;;6595:25:1::0;;6583:2;6568:18;;6550:76;75293:1023:0;-1:-1:-1;;;;;;;;;;;45197:30:0;69247:24;31800:10;45214:12;31720:98;45197:30;75374:52:::1;75429:46:::0;;;:11:::1;:46;::::0;;;;;;;;75374:101;;::::1;::::0;::::1;::::0;;;;;;::::1;::::0;::::1;::::0;-1:-1:-1;;;;;75374:101:0;::::1;::::0;;::::1;::::0;;;;-1:-1:-1;;;75374:101:0;;::::1;;;;;::::0;;;;;;::::1;::::0;::::1;::::0;;;;;::::1;::::0;::::1;::::0;;;;;::::1;;::::0;;;;;;75486:123:::1;;;::::0;-1:-1:-1;;;75486:123:0;;11265:2:1;75486:123:0::1;::::0;::::1;11247:21:1::0;11304:2;11284:18;;;11277:30;11343:34;11323:18;;;11316:62;-1:-1:-1;;;11394:18:1;;;11387:49;11453:19;;75486:123:0::1;11237:241:1::0;75486:123:0::1;75620:38;75661:207;75736:12;:24;;;75779:12;:27;;;75825:12;:28;;;75661:56;:207::i;:::-;75620:248;;75900:19;75881:370;75952:12;:27;;;75938:11;:41;75881:370;;;76034:19;76056:21;76078:11;76056:34;;;;;;-1:-1:-1::0;;;76056:34:0::1;;;;;;;;;;;;;;;76034:56;;76105:134;76143:12;:21;;;76183:11;76213;76105:19;:134::i;:::-;-1:-1:-1::0;75994:13:0;::::1;::::0;::::1;:::i;:::-;;;;75881:370;;;-1:-1:-1::0;76286:21:0;;76268:40:::1;::::0;6595:25:1;;;76268:40:0::1;::::0;6583:2:1;6568:18;76268:40:0::1;6550:76:1::0;46044:497:0;46125:22;46133:4;46139:7;46125;:22::i;:::-;46120:414;;46313:41;46341:7;-1:-1:-1;;;;;46313:41:0;46351:2;46313:19;:41::i;:::-;46427:38;46455:4;46462:2;46427:19;:38::i;:::-;46218:270;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;46218:270:0;;;;;;;;;;-1:-1:-1;;;46164:358:0;;;;;;;:::i;16913:1077::-;17023:17;17058:4;-1:-1:-1;;;;;17058:20:0;;17079:14;17095:4;17112:8;15743:1;17101:43;;;;;;;;8184:25:1;;;8240:2;8225:18;;8218:34;8172:2;8157:18;;8139:119;17101:43:0;;;;;;;;;;;;;17058:87;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;17380:15:0;17464:16;;;:6;:16;;;;;;;;;6783:51;;;;;9447:25:1;;;9488:18;;;9481:34;;;17457:4:0;9531:18:1;;;9524:60;9600:18;;;;9593:34;;;6783:51:0;;;;;;;;;;9419:19:1;;;;6783:51:0;;;6773:62;;;;;;;;;17918:16;;;;;;;;:20;;;:::i;:::-;17899:16;;;;:6;:16;;;;;:39;17952:32;17906:8;17976:7;7400:41;;;;;;;4114:19:1;;;;4149:12;;;4142:28;;;;7400:41:0;;;;;;;;;4186:12:1;;;;7400:41:0;;7390:52;;;;;;7233:215;17952:32;17945:39;16913:1077;-1:-1:-1;;;;16913:1077:0:o;49467:229::-;49542:22;49550:4;49556:7;49542;:22::i;:::-;49537:152;;49581:6;:12;;;;;;;;;;;-1:-1:-1;;;;;49581:29:0;;;;;;;;;:36;;-1:-1:-1;;49581:36:0;49613:4;49581:36;;;49664:12;31800:10;31720:98;;49664:12;-1:-1:-1;;;;;49637:40:0;49655:7;-1:-1:-1;;;;;49637:40:0;49649:4;49637:40;;;;;;;;;;49467:229;;:::o;49704:230::-;49779:22;49787:4;49793:7;49779;:22::i;:::-;49775:152;;;49850:5;49818:12;;;;;;;;;;;-1:-1:-1;;;;;49818:29:0;;;;;;;;;;:37;;-1:-1:-1;;49818:37:0;;;49875:40;31800:10;;49818:12;;49875:40;;49850:5;49875:40;49704:230;;:::o;74767:294::-;74885:22;;;;:11;:22;;;;;;;74920:4;74885:32;;:39;;-1:-1:-1;;;;74885:39:0;-1:-1:-1;;;74885:39:0;;;74935:34;;;:47;;;75021:31;75000:53;;;;;;6595:25:1;;;6583:2;6568:18;;6550:76;3143:450:0;3292:16;3321:31;3369:11;3355:26;;;;;;-1:-1:-1;;;3355:26:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3355:26:0;;3321:60;;3397:9;3392:162;3416:11;3412:1;:15;3392:162;;;3488:19;;;;;;;8184:25:1;;;8225:18;;;8218:34;;;3488:19:0;;;;;;;;;8157:18:1;;;;3488:19:0;;;3478:30;;;;;3470:71;;3529:12;;3470:71;:::i;:::-;3449:14;3464:1;3449:17;;;;;;-1:-1:-1;;;3449:17:0;;;;;;;;;;;;;;;;;;:93;3429:3;;;;:::i;:::-;;;;3392:162;;;-1:-1:-1;3571:14:0;3143:450;-1:-1:-1;;;;3143:450:0:o;73098:477::-;73241:38;73320:24;73335:8;73320:14;:24::i;:::-;73282:118;;-1:-1:-1;;;73282:118:0;;;;;8184:25:1;;;8225:18;;;8218:34;;;-1:-1:-1;;;;;73282:92:0;;;;;;;8157:18:1;;73282:118:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;73504:21;;73540:16;;;;73416:151;;73241:159;;-1:-1:-1;73416:151:0;;;;73455:8;;73478:11;;9447:25:1;;;9503:2;9488:18;;9481:34;;;;-1:-1:-1;;;;;9551:32:1;9546:2;9531:18;;9524:60;9615:2;9600:18;;9593:34;9434:3;9419:19;;9401:232;30637:451:0;30712:13;30738:19;30770:10;30774:6;30770:1;:10;:::i;:::-;:14;;30783:1;30770:14;:::i;:::-;30760:25;;;;;;-1:-1:-1;;;30760:25:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;30760:25:0;;30738:47;;-1:-1:-1;;;30796:6:0;30803:1;30796:9;;;;;;-1:-1:-1;;;30796:9:0;;;;;;;;;;;;:15;-1:-1:-1;;;;;30796:15:0;;;;;;;;;-1:-1:-1;;;30822:6:0;30829:1;30822:9;;;;;;-1:-1:-1;;;30822:9:0;;;;;;;;;;;;:15;-1:-1:-1;;;;;30822:15:0;;;;;;;;-1:-1:-1;30853:9:0;30865:10;30869:6;30865:1;:10;:::i;:::-;:14;;30878:1;30865:14;:::i;:::-;30853:26;;30848:135;30885:1;30881;:5;30848:135;;;-1:-1:-1;;;30933:5:0;30941:3;30933:11;30920:25;;;;;-1:-1:-1;;;30920:25:0;;;;;;;;;;;;30908:6;30915:1;30908:9;;;;;;-1:-1:-1;;;30908:9:0;;;;;;;;;;;;:37;-1:-1:-1;;;;;30908:37:0;;;;;;;;-1:-1:-1;30970:1:0;30960:11;;;;;30888:3;;;:::i;:::-;;;30848:135;;;-1:-1:-1;31001:10:0;;30993:55;;;;-1:-1:-1;;;30993:55:0;;10486:2:1;30993:55:0;;;10468:21:1;;;10505:18;;;10498:30;10564:34;10544:18;;;10537:62;10616:18;;30993:55:0;10458:182:1;30993:55:0;31073:6;30637:451;-1:-1:-1;;;30637:451:0:o;14:261:1:-;;137:2;125:9;116:7;112:23;108:32;105:2;;;158:6;150;143:22;105:2;195:9;189:16;214:31;239:5;214:31;:::i;280:297::-;;400:2;388:9;379:7;375:23;371:32;368:2;;;421:6;413;406:22;368:2;458:9;452:16;511:5;504:13;497:21;490:5;487:32;477:2;;538:6;530;523:22;582:190;;694:2;682:9;673:7;669:23;665:32;662:2;;;715:6;707;700:22;662:2;-1:-1:-1;743:23:1;;652:120;-1:-1:-1;652:120:1:o;777:325::-;;;906:2;894:9;885:7;881:23;877:32;874:2;;;927:6;919;912:22;874:2;968:9;955:23;945:33;;1028:2;1017:9;1013:18;1000:32;1041:31;1066:5;1041:31;:::i;:::-;1091:5;1081:15;;;864:238;;;;;:::o;1107:393::-;;;;1253:2;1241:9;1232:7;1228:23;1224:32;1221:2;;;1274:6;1266;1259:22;1221:2;1315:9;1302:23;1292:33;;1375:2;1364:9;1360:18;1347:32;1388:31;1413:5;1388:31;:::i;:::-;1211:289;;1438:5;;-1:-1:-1;;;1490:2:1;1475:18;;;;1462:32;;1211:289::o;1505:393::-;;;;1651:2;1639:9;1630:7;1626:23;1622:32;1619:2;;;1672:6;1664;1657:22;1619:2;1713:9;1700:23;1690:33;;1770:2;1759:9;1755:18;1742:32;1732:42;;1824:2;1813:9;1809:18;1796:32;1837:31;1862:5;1837:31;:::i;:::-;1887:5;1877:15;;;1609:289;;;;;:::o;1903:258::-;;;2032:2;2020:9;2011:7;2007:23;2003:32;2000:2;;;2053:6;2045;2038:22;2000:2;-1:-1:-1;;2081:23:1;;;2151:2;2136:18;;;2123:32;;-1:-1:-1;1990:171:1:o;2166:306::-;;2277:2;2265:9;2256:7;2252:23;2248:32;2245:2;;;2298:6;2290;2283:22;2245:2;2329:23;;-1:-1:-1;;;;;;2381:32:1;;2371:43;;2361:2;;2433:6;2425;2418:22;2477:684;;2624:2;2612:9;2603:7;2599:23;2595:32;2592:2;;;2645:6;2637;2630:22;2592:2;2683;2677:9;2725:2;2717:6;2713:15;2794:6;2782:10;2779:22;2758:18;2746:10;2743:34;2740:62;2737:2;;;-1:-1:-1;;;2825:36:1;;2884:4;2881:1;2874:15;2917:4;2832:6;2902:20;2737:2;2948;2941:22;2985:16;;3010:31;2985:16;3010:31;:::i;:::-;3050:21;;3125:2;3110:18;;;3104:25;3087:15;;;3080:50;;;;-1:-1:-1;3057:6:1;2582:579;-1:-1:-1;2582:579:1:o;3166:194::-;;3289:2;3277:9;3268:7;3264:23;3260:32;3257:2;;;3310:6;3302;3295:22;3257:2;-1:-1:-1;3338:16:1;;3247:113;-1:-1:-1;3247:113:1:o;3365:325::-;;;3494:2;3482:9;3473:7;3469:23;3465:32;3462:2;;;3515:6;3507;3500:22;3695:257;;3774:5;3768:12;3801:6;3796:3;3789:19;3817:63;3873:6;3866:4;3861:3;3857:14;3850:4;3843:5;3839:16;3817:63;:::i;:::-;3934:2;3913:15;-1:-1:-1;;3909:29:1;3900:39;;;;3941:4;3896:50;;3744:208;-1:-1:-1;;3744:208:1:o;4209:786::-;;4620:25;4615:3;4608:38;4675:6;4669:13;4691:62;4746:6;4741:2;4736:3;4732:12;4725:4;4717:6;4713:17;4691:62;:::i;:::-;-1:-1:-1;;;4812:2:1;4772:16;;;4804:11;;;4797:40;4862:13;;4884:63;4862:13;4933:2;4925:11;;4918:4;4906:17;;4884:63;:::i;:::-;4967:17;4986:2;4963:26;;4598:397;-1:-1:-1;;;;4598:397:1:o;5867:385::-;;6099:1;6095;6090:3;6086:11;6082:19;6074:6;6070:32;6059:9;6052:51;6139:6;6134:2;6123:9;6119:18;6112:34;6182:2;6177;6166:9;6162:18;6155:30;6202:44;6242:2;6231:9;6227:18;6219:6;6202:44;:::i;:::-;6194:52;6042:210;-1:-1:-1;;;;;6042:210:1:o;10060:219::-;;10209:2;10198:9;10191:21;10229:44;10269:2;10258:9;10254:18;10246:6;10229:44;:::i;13520:128::-;;13591:1;13587:6;13584:1;13581:13;13578:2;;;13597:18;;:::i;:::-;-1:-1:-1;13633:9:1;;13568:80::o;13653:168::-;;13759:1;13755;13751:6;13747:14;13744:1;13741:21;13736:1;13729:9;13722:17;13718:45;13715:2;;;13766:18;;:::i;:::-;-1:-1:-1;13806:9:1;;13705:116::o;13826:258::-;13898:1;13908:113;13922:6;13919:1;13916:13;13908:113;;;13998:11;;;13992:18;13979:11;;;13972:39;13944:2;13937:10;13908:113;;;14039:6;14036:1;14033:13;14030:2;;;-1:-1:-1;;14074:1:1;14056:16;;14049:27;13879:205::o;14089:136::-;;14156:5;14146:2;;14165:18;;:::i;:::-;-1:-1:-1;;;14201:18:1;;14136:89::o;14230:135::-;;-1:-1:-1;;14290:17:1;;14287:2;;;14310:18;;:::i;:::-;-1:-1:-1;14357:1:1;14346:13;;14277:88::o;14370:209::-;;14428:1;14418:2;;-1:-1:-1;;;14453:31:1;;14507:4;14504:1;14497:15;14535:4;14460:1;14525:15;14418:2;-1:-1:-1;14564:9:1;;14408:171::o;14584:127::-;14645:10;14640:3;14636:20;14633:1;14626:31;14676:4;14673:1;14666:15;14700:4;14697:1;14690:15;14716:131;-1:-1:-1;;;;;14791:31:1;;14781:42;;14771:2;;14837:1;14834;14827:12;14771:2;14761:86;:::o

Swarm Source

ipfs://6b08503d465b7f8304f0852b4fb2fb473e830d715b9ddc86d5b7b2a8fd218a3f
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading