ETH Price: $1,987.06 (-2.09%)
Gas: 0.2 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

TokenTracker

Multichain Info

1 address found via
Transaction Hash
Method
Block
From
To
Set Approval For...233724252025-09-16 1:42:35168 days ago1757986955IN
0x7B2121CC...735df2357
0 ETH0.000055591.20521947
Withdraw Proceed...172451392023-05-12 15:52:231026 days ago1683906743IN
0x7B2121CC...735df2357
0 ETH0.0061727191.57788659
Set Approval For...139871562022-01-11 23:14:591511 days ago1641942899IN
0x7B2121CC...735df2357
0 ETH0.00826161178.77639936
Set Approval For...139528882022-01-06 16:15:431517 days ago1641485743IN
0x7B2121CC...735df2357
0 ETH0.00776805168.09615715
Transfer From134837482021-10-25 1:57:311590 days ago1635127051IN
0x7B2121CC...735df2357
0 ETH0.00871644100.73556037
Transfer From134837462021-10-25 1:56:441590 days ago1635127004IN
0x7B2121CC...735df2357
0 ETH0.01070758110.59043619
Transfer From134837452021-10-25 1:56:201590 days ago1635126980IN
0x7B2121CC...735df2357
0 ETH0.0095569698.7065672
Transfer From134836882021-10-25 1:41:381590 days ago1635126098IN
0x7B2121CC...735df2357
0 ETH0.0091324497.13089761
Transfer From134717002021-10-23 4:27:341592 days ago1634963254IN
0x7B2121CC...735df2357
0 ETH0.0056840765.69053171
Public Mint134681152021-10-22 15:09:401593 days ago1634915380IN
0x7B2121CC...735df2357
1.2 ETH0.0186047182.88210864
Public Mint134680462021-10-22 14:55:471593 days ago1634914547IN
0x7B2121CC...735df2357
0.1 ETH0.0190204785.80460022
Public Mint134657592021-10-22 6:10:421593 days ago1634883042IN
0x7B2121CC...735df2357
0.05 ETH0.014419565.0488471
Transfer134643932021-10-22 0:56:261593 days ago1634864186IN
0x7B2121CC...735df2357
0.005 ETH0.0016121376.76815742
Withdraw Proceed...134642342021-10-22 0:21:391593 days ago1634862099IN
0x7B2121CC...735df2357
0 ETH0.0073820879.88922582
Public Mint134618912021-10-21 15:46:471594 days ago1634831207IN
0x7B2121CC...735df2357
0.05 ETH0.02867431129.354716
Public Mint134594672021-10-21 6:39:261594 days ago1634798366IN
0x7B2121CC...735df2357
0.05 ETH0.0117379652.95194874
Public Mint134592002021-10-21 5:39:491594 days ago1634794789IN
0x7B2121CC...735df2357
0.1 ETH0.0260263164.07329515
Public Mint134591732021-10-21 5:32:521594 days ago1634794372IN
0x7B2121CC...735df2357
0.05 ETH0.0142259864.17583504
Set Approval For...134591712021-10-21 5:31:171594 days ago1634794277IN
0x7B2121CC...735df2357
0 ETH0.002663957.64523927
Public Mint134591002021-10-21 5:14:491594 days ago1634793289IN
0x7B2121CC...735df2357
0.05 ETH0.0139026562.71724643
Public Mint134589382021-10-21 4:39:121594 days ago1634791152IN
0x7B2121CC...735df2357
0.05 ETH0.0131675559.40106924
Public Mint134588902021-10-21 4:27:291594 days ago1634790449IN
0x7B2121CC...735df2357
0.05 ETH0.0130271258.03454256
Public Mint134588542021-10-21 4:20:431594 days ago1634790043IN
0x7B2121CC...735df2357
0.05 ETH0.0130023658.65586188
Public Mint134588542021-10-21 4:20:431594 days ago1634790043IN
0x7B2121CC...735df2357
0.1 ETH0.0236615458.65586188
Public Mint134586812021-10-21 3:37:171594 days ago1634787437IN
0x7B2121CC...735df2357
0.1 ETH0.0262519565.07739249
View all transactions

Latest 8 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer172451392023-05-12 15:52:231026 days ago1683906743
0x7B2121CC...735df2357
0.54 ETH
Transfer172451392023-05-12 15:52:231026 days ago1683906743
0x7B2121CC...735df2357
0.54 ETH
Transfer172451392023-05-12 15:52:231026 days ago1683906743
0x7B2121CC...735df2357
0.0675 ETH
Transfer172451392023-05-12 15:52:231026 days ago1683906743
0x7B2121CC...735df2357
0.2025 ETH
-134642342021-10-22 0:21:391593 days ago1634862099
0x7B2121CC...735df2357
0.54 ETH
-134642342021-10-22 0:21:391593 days ago1634862099
0x7B2121CC...735df2357
0.54 ETH
-134642342021-10-22 0:21:391593 days ago1634862099
0x7B2121CC...735df2357
0.0675 ETH
-134642342021-10-22 0:21:391593 days ago1634862099
0x7B2121CC...735df2357
0.2025 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MFMT_VRFBingo_WLv2

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

//@version 0.3.0

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

contract MFMT_VRFBingo_WLv2 is ERC721Enumerable, Ownable, ReentrancyGuard, VRFConsumerBase {
    
    //Team
    address tm0 = 0x5d9f5a2d4B8AA3C4f40d42CAf0fC492A6B0Beed3;   //0
    address tm1 = 0xb4ce5faeB2228Bf48Ea7f5545eA0CD5d53F95a16;   //1
    address tm2 = 0xa6119DC1F2Fc434130A8b3724F09DFd27ACcF599;   //2
    address tm3 = 0xf83ECDa13505d20E21AB0edcF1A9883477D8dc64;   //3
    
    //Presale verification Setup
    using ECDSA for bytes32;
    address signerAdmin = 0x88EbCC12aa77674E0795F2AC0E4e3e418391E65c;
    bytes32 private hashSecret = 0xb891fdff1f58d05a6ba75ae7e0fc9d95bf50b9397e86d863f9904a82ae4dd7bd;
    
    //Mainnet VRF Setup
    address LinkToken = 0x514910771AF9Ca656af840dff83E8264EcF986CA;
    address VRFCoordinator = 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952;
    bytes32 internal keyHash;
    uint internal fee;

    /* Player Reward Setup */

    //Minted token ID to player
    mapping (uint => address) public mintToAddress;

    //Batches to entries of tokenIds
    mapping (uint => uint[]) private mintEntries;

    //Minted token IDs to reward status
    enum ChosenStatus { nulled, pending, wasChosen }
    ChosenStatus chosen;
    mapping (uint => ChosenStatus) public chosenMints;

    //Past rewarded token IDs for accounting
    mapping (uint => bool) public pastRewardMints;

    /* Accounting events */
    event RequestedRandom(uint currentTokenId, bytes32 requestId);
    event WinnerChosen(uint batch, uint tokenId, uint windex);
    event RewardPayed(address winner, uint tokenId);

    /* ERC721 Sale Setup */
    string baseTokenURI;

    uint public constant MAX_TOKENS = 10_000;                   //10,000 Tokens
    uint public constant TXN_MINT_LIMIT = 19;                   //19 per txn, 950000000 gwei
    uint public mintPrice = 0.05 ether;                         //0.05 ether, 50000000 gwei
    uint private reward = mintPrice * 10;                       //Reward 10x

    /* Batching Rate Setup */
    uint private constant MAGIC_NUMBA = 25;                     //How many randomNumbas via expansion
    uint private constant BATCH_SIZE = 40;                      //Number of tokens in a batch
    uint constant ROUNDS_PER_CALL = 5;                          //Number of batches processed per fulfillment.
    uint public currentBatch = 1;                               //Current batch pointer
    uint public nextProcBatch = 1;                              //Last time pointers equivalent

    bool public preSaleOn;                                      //default false, toggle to open presale first
    bool public salePaused = true;                              //set true, toggle to open public sale next

    constructor(string memory _baseTokenURI, string memory name, string memory symbol) payable
    VRFConsumerBase(VRFCoordinator, LinkToken)
    ERC721(name, symbol)
    {
      setBaseURI(_baseTokenURI);
      keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445;
      fee = 2 * 10 ** 18;                                       //2 LINK
    }
    
    function presaleMint(
        uint _amount,
        bytes32 _payload,
        bytes memory _signature,
        uint _nonce
    ) external payable {
        require( preSaleOn == true,                         "PNO" );
        require( hashTransaction(_nonce, msg.sender) == _payload, "HCF" );
        require( matchSignerAdmin(_payload, _signature),    "USP" );
        _mint(_amount);
    }
    
    function publicMint(uint _amount) external payable {
        require( !salePaused,                               "CIP" );
        _mint(_amount);
    }

    function _mint(uint _amount) internal {
        //Local version of state
        uint _supply = totalSupply();
        uint _batchCounter = currentBatch;

        require( _supply + _amount <= MAX_TOKENS,           "XTS" );
        require( _amount <= TXN_MINT_LIMIT,                 "XTL" );
        require( msg.value >= mintPrice * _amount,          "WEA" );

        for(uint i; i < _amount; i++){
            uint tokenId = _supply + i;

            _safeMint(msg.sender, tokenId);                  //Optimistic Mint
            mintToAddress[tokenId] = msg.sender;             //Account mint to player
            chosenMints[tokenId] = ChosenStatus.pending;     //Account status
            mintEntries[_batchCounter].push(tokenId);        //Assign it to a batch within Entries mapping, keyed by entry offset.

            //Check our batch fullness
            if (mintEntries[_batchCounter].length == BATCH_SIZE) {
               /**
                 * @dev Check if batch is filled &
                 * issue a VRF call if enough to assess.
                */

                if (_batchCounter % ROUNDS_PER_CALL == 0 ) {
                    bytes32 _receipt = callVRF();
                    //Log receipt for the current supply/tokenId
                    emit RequestedRandom(_supply, _receipt);
                }
                //Next Batch
                _batchCounter++;
            } //call check
        } //mint loop
        //store result of local loop processing
        currentBatch = _batchCounter;
    }

    function callVRF() internal returns (bytes32 requestId) {
        require(LINK.balanceOf(address(this)) > fee);
        return requestRandomness(keyHash, fee);
    }

    //In case of stuckage, call VRF direct and emit event
    function nudgeVRF() external onlyOwner {
        bytes32 _receipt = callVRF();
        uint _supply = totalSupply();
        //Log receipt
        emit RequestedRandom(_supply, _receipt);
    }

    //In case of stuckage, nudge with last randomNumba from calldata
    //Users can verify this was correct on-chain
    function nudgeChoose(uint randomNumba) external onlyOwner {
        require( nextProcBatch <= (MAX_TOKENS / BATCH_SIZE),        "FBR");
        require( mintEntries[nextProcBatch].length == BATCH_SIZE,   "NBR");
        expandedAndChoose(randomNumba);
    }

    //200k gas maximum execution
    function fulfillRandomness(bytes32, uint256 randomness) internal override {
        expandedAndChoose(randomness);
    }

    function expandedAndChoose(uint randomness) internal {
        uint[] memory expandedVals = expandRanged(randomness, MAGIC_NUMBA);
        chooseWinners(expandedVals);
    }

    function expandRanged(uint _randomNumba, uint _n) internal pure returns (uint[] memory expandedValues) {
    //1-dim fixed-size array with length MAGIC_NUMBA.
    expandedValues = new uint[](_n);
    for (uint i = 0; i < _n; i++) {
        //BATCH_SIZE is the modulo for ranged expansion (0..BATCH_SIZE -1)
        expandedValues[i] = uint(keccak256(abi.encode(_randomNumba, i))) % (BATCH_SIZE -1);
    }
    return expandedValues;
    }

    /**
    * For each round, process a full batch
    * locating winning tokens with the random expanded values as indices,
    * then keeping account of winners for later claim.
    **/
    function chooseWinners(uint[] memory expandedVals) private {
        //Local version of state
        uint expand_length = expandedVals.length;
        uint _procBatch = nextProcBatch;
        //5% of mints
        uint _numerator = BATCH_SIZE/20;
        uint _start;
        uint _end;

        //Process the next full batches for winners
        //Runs ROUNDS_PER_CALL times from 0.
        for (uint b = 0; b < ROUNDS_PER_CALL; b++) {
            uint[] memory slicedRandoms = new uint[](_numerator);
            uint this_batch = _procBatch + b;

            //Take a chunk and move along the list by the offset each loop
            if (b == 0) {
                _start = expand_length - _numerator;
                _end = expand_length - 1;
            } else {
                _start = _start - _numerator;
                _end = _end - _numerator;
            }

            //Populate target indices - redo with exampleBytes[:5] to save on loop
            uint r = 0;
            for (uint s = _start; s <= _end; s++ ) {
                slicedRandoms[r] = expandedVals[s];
                r++;
            }

            for (uint i = 0; i < _numerator; i++) {
                uint winDex = slicedRandoms[i];
                //Find which tokenID is in this position
                uint winToken = mintEntries[this_batch][winDex];

                //Verify token entry not already chosen or been claimed in past
                if (chosenMints[winToken] == ChosenStatus.wasChosen
                    || pastRewardMints[winToken] == true) {
                    //Offset the double-pick
                    winToken = mintEntries[this_batch][(BATCH_SIZE -1) - winDex]; //Always valid index!
                }

                //Set token as winner & emit Event
                chosenMints[winToken] = ChosenStatus.wasChosen;
                emit WinnerChosen(this_batch, winToken, winDex);
            }
            if (_start == 0) break; //end of values, do not slice further.
        } //end batch loop

        nextProcBatch = _procBatch + ROUNDS_PER_CALL; //store result of local processing, ROUNDS_PER_CALL
    }

    function getMintStatus(uint _tokenId) external view returns (ChosenStatus) {
        return chosenMints[_tokenId];
    }

    function getMintEntry(uint batch, uint entry) external view returns (uint _tokenId) {
        return mintEntries[batch][entry];
    }

    function walletOfTokenOwner(address _tokenOwner) external view returns(uint[] memory) {
        uint tokenCount = balanceOf(_tokenOwner);

        uint[] memory tokensId = new uint[](tokenCount);
        for(uint i; i < tokenCount; i++){
            tokensId[i] = tokenOfOwnerByIndex(_tokenOwner, i);
        }
        return tokensId;
    }

    /**
     * Player-initiated withdrawal
     * Array of token IDs checked against accounting structures
     * Pays out here if pass, revert early or skip on funny business
     */
    function withdrawReward(uint[] memory _tokenIds) external nonReentrant() {
        //Local version of state
        uint _length = _tokenIds.length;
        uint _reward = reward;

        require( msg.sender == tx.origin,                       "NDC");
        require( address(this).balance >= _reward * _length,    "P2L");
        //For each of the players tokens
        for (uint i = 0; i < _length; i++) {
            uint _tokenId = _tokenIds[i];
            //Must be original minter, otherwise skip
            if (msg.sender != mintToAddress[_tokenId]) continue;
            //Must be marked winner and not previously claimed
            if (chosenMints[_tokenId] == ChosenStatus.wasChosen && pastRewardMints[_tokenId] == false ) {
                //Optimistic accounting for status, reward history separately.
                pastRewardMints[_tokenId] = true;

                //address _winner = mintToAddress[_tokenId];
                //Pay out the reward to winner
                payable(msg.sender).transfer(_reward);
                //Log payout event
                emit RewardPayed(msg.sender, _tokenId);
            }
        }
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return baseTokenURI;
    }

    function setBaseURI(string memory baseURI) public onlyOwner {
        baseTokenURI = baseURI;
    }

    function setPrice(uint _newPrice) external onlyOwner {
        mintPrice = _newPrice;
    }

    function pubSaleToggle() external onlyOwner {
        preSaleOn = false;
        salePaused = !salePaused;
    }

    function preSaleToggle() external onlyOwner {
        preSaleOn = !preSaleOn;
    }

    /**
    * Contract balance payout to team via owner withdrawal
    */
    function withdrawProceeds() external onlyOwner {
        uint cincoCut = address(this).balance/20;
        uint quinceCut = cincoCut * 3;
        uint cuarentaCut = (address(this).balance/5) * 2;

        //Fallthrough payouts
        payable(tm0).send(quinceCut);                           //15%
        payable(tm1).send(cincoCut);                            //5%
        payable(tm2).send(cuarentaCut);                         //40%
        payable(tm3).send(cuarentaCut);                         //40%
        payable(msg.sender).transfer(address(this).balance);    //Remainder, if any failures, to owner
    }

    /**
     * @dev Recover any ERC20 tokens sent to contract, in this case LINK
     */
    function withdrawTokens(IERC20 _token) external onlyOwner {
        require(address(_token) != address(0));

        _token.transfer(msg.sender, _token.balanceOf(address(this)));
    }

    /** Presale offline signing verification **/
    function hashTransaction(uint _nonce, address _sender) internal view returns (bytes32) {
        bytes32 _hash = keccak256(abi.encode(_sender, hashSecret, _nonce)).toEthSignedMessageHash();
    	return _hash;
	}

	function matchSignerAdmin(bytes32 _payload, bytes memory _signature) internal view returns (bool) {
		return signerAdmin == _payload.recover(_signature);
	}
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     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);
  }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

File 5 of 19 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @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` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * 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 override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        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 {}
}

// SPDX-License-Identifier: MIT

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;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract VRFRequestIDBase {

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

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface LinkTokenInterface {

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

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

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

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

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

  function increaseApproval(
    address spender,
    uint256 subtractedValue
  ) external;

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

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

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

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

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

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

}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT

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);
    }
}

// SPDX-License-Identifier: MIT

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);
            }
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 18 of 19 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

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);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"string","name":"_baseTokenURI","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"currentTokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"requestId","type":"bytes32"}],"name":"RequestedRandom","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"RewardPayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"batch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"windex","type":"uint256"}],"name":"WinnerChosen","type":"event"},{"inputs":[],"name":"MAX_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TXN_MINT_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"chosenMints","outputs":[{"internalType":"enum MFMT_VRFBingo_WLv2.ChosenStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"batch","type":"uint256"},{"internalType":"uint256","name":"entry","type":"uint256"}],"name":"getMintEntry","outputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getMintStatus","outputs":[{"internalType":"enum MFMT_VRFBingo_WLv2.ChosenStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintToAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextProcBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"randomNumba","type":"uint256"}],"name":"nudgeChoose","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nudgeVRF","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pastRewardMints","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preSaleOn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preSaleToggle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes32","name":"_payload","type":"bytes32"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"uint256","name":"_nonce","type":"uint256"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"pubSaleToggle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"salePaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPrice","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenOwner","type":"address"}],"name":"walletOfTokenOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawProceeds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"withdrawReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052600d80546001600160a01b0319908116735d9f5a2d4b8aa3c4f40d42caf0fc492a6b0beed317909155600e8054821673b4ce5faeb2228bf48ea7f5545ea0cd5d53f95a16179055600f8054821673a6119dc1f2fc434130a8b3724f09dfd27accf59917905560108054821673f83ecda13505d20e21ab0edcf1a9883477d8dc641790556011805482167388ebcc12aa77674e0795f2ac0e4e3e418391e65c1790557fb891fdff1f58d05a6ba75ae7e0fc9d95bf50b9397e86d863f9904a82ae4dd7bd60125560138054821673514910771af9ca656af840dff83e8264ecf986ca1790556014805490911673f0d54349addcf704f77ae15b96510dea15cb795217905566b1a2bc2ec50000601d8190556200012090600a620004de565b601e556001601f8190556020556021805461ff00191661010017905560405162004234388190039081908339810160408190526200015e916200044d565b60145460135483516001600160a01b039283169290911690849084906200018d906000906020850190620002f0565b508051620001a3906001906020840190620002f0565b505050620001c0620001ba6200022260201b60201c565b62000226565b6001600b556001600160601b0319606092831b811660a052911b16608052620001e98362000278565b50507faa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af44560155550671bc16d674ec800006016556200055f565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600a546001600160a01b03163314620002d75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b8051620002ec90601c906020840190620002f0565b5050565b828054620002fe906200050c565b90600052602060002090601f0160209004810192826200032257600085556200036d565b82601f106200033d57805160ff19168380011785556200036d565b828001600101855582156200036d579182015b828111156200036d57825182559160200191906001019062000350565b506200037b9291506200037f565b5090565b5b808211156200037b576000815560010162000380565b600082601f830112620003a857600080fd5b81516001600160401b0380821115620003c557620003c562000549565b604051601f8301601f19908116603f01168101908282118183101715620003f057620003f062000549565b816040528381526020925086838588010111156200040d57600080fd5b600091505b8382101562000431578582018301518183018401529082019062000412565b83821115620004435760008385830101525b9695505050505050565b6000806000606084860312156200046357600080fd5b83516001600160401b03808211156200047b57600080fd5b620004898783880162000396565b94506020860151915080821115620004a057600080fd5b620004ae8783880162000396565b93506040860151915080821115620004c557600080fd5b50620004d48682870162000396565b9150509250925092565b60008160001904831182151516156200050757634e487b7160e01b600052601160045260246000fd5b500290565b600181811c908216806200052157607f821691505b602082108114156200054357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c613c9b620005996000396000818161159b0152612ca10152600081816124380152612c720152613c9b6000f3fe6080604052600436106102e75760003560e01c8063715018a611610184578063a52abcc6116100d6578063e985e9c51161008a578063fd7d67f711610064578063fd7d67f71461084f578063ff0cf4de14610862578063ff7f219c1461087757600080fd5b8063e985e9c5146107d0578063f2fde38b14610819578063f47c84c51461083957600080fd5b8063c6f05fdd116100bb578063c6f05fdd1461077b578063c87b56dd14610790578063d1e84621146107b057600080fd5b8063a52abcc614610725578063b88d4fde1461075b57600080fd5b80639038e6931161013857806395d89b411161011257806395d89b41146106d6578063a22cb465146106eb578063a2be7c291461070b57600080fd5b80639038e6931461068157806391b7f5ed1461069657806394985ddd146106b657600080fd5b80637df14138116101695780637df14138146106035780638a845fa5146106335780638da5cb5b1461066357600080fd5b8063715018a6146105d857806376cd940e146105ed57600080fd5b806345313d291161023d5780635a07bb50116101f15780636352211e116101cb5780636352211e146105825780636817c76c146105a257806370a08231146105b857600080fd5b80635a07bb50146105395780635c33eb421461054e5780635d08c1ae1461056357600080fd5b80634f6ccce7116102225780634f6ccce7146104bc578063522b2e88146104dc57806355f804b31461051957600080fd5b806345313d291461046f57806349df728c1461049c57600080fd5b806318160ddd1161029f5780632db11544116102795780632db115441461041c5780632f745c591461042f57806342842e0e1461044f57600080fd5b806318160ddd146103bd57806322709627146103dc57806323b872dd146103fc57600080fd5b8063081812fc116102d0578063081812fc14610343578063095ea7b31461037b5780630fede7221461039d57600080fd5b806301ffc9a7146102ec57806306fdde0314610321575b600080fd5b3480156102f857600080fd5b5061030c61030736600461382b565b61088d565b60405190151581526020015b60405180910390f35b34801561032d57600080fd5b506103366108d1565b6040516103189190613a6c565b34801561034f57600080fd5b5061036361035e3660046138ae565b610963565b6040516001600160a01b039091168152602001610318565b34801561038757600080fd5b5061039b610396366004613713565b6109fd565b005b3480156103a957600080fd5b5061039b6103b83660046138ae565b610b2f565b3480156103c957600080fd5b506008545b604051908152602001610318565b3480156103e857600080fd5b506103ce6103f7366004613809565b610c55565b34801561040857600080fd5b5061039b610417366004613638565b610c88565b61039b61042a3660046138ae565b610d0f565b34801561043b57600080fd5b506103ce61044a366004613713565b610d70565b34801561045b57600080fd5b5061039b61046a366004613638565b610e18565b34801561047b57600080fd5b5061048f61048a3660046135e2565b610e33565b6040516103189190613a00565b3480156104a857600080fd5b5061039b6104b73660046135e2565b610ed5565b3480156104c857600080fd5b506103ce6104d73660046138ae565b611045565b3480156104e857600080fd5b5061050c6104f73660046138ae565b6000908152601a602052604090205460ff1690565b6040516103189190613a44565b34801561052557600080fd5b5061039b610534366004613865565b6110e9565b34801561054557600080fd5b5061039b611156565b34801561055a57600080fd5b5061039b6111c4565b34801561056f57600080fd5b5060215461030c90610100900460ff1681565b34801561058e57600080fd5b5061036361059d3660046138ae565b61123e565b3480156105ae57600080fd5b506103ce601d5481565b3480156105c457600080fd5b506103ce6105d33660046135e2565b6112c9565b3480156105e457600080fd5b5061039b611363565b3480156105f957600080fd5b506103ce601f5481565b34801561060f57600080fd5b5061030c61061e3660046138ae565b601b6020526000908152604090205460ff1681565b34801561063f57600080fd5b5061050c61064e3660046138ae565b601a6020526000908152604090205460ff1681565b34801561066f57600080fd5b50600a546001600160a01b0316610363565b34801561068d57600080fd5b5061039b6113c9565b3480156106a257600080fd5b5061039b6106b13660046138ae565b611531565b3480156106c257600080fd5b5061039b6106d1366004613809565b611590565b3480156106e257600080fd5b50610336611612565b3480156106f757600080fd5b5061039b6107063660046136e5565b611621565b34801561071757600080fd5b5060215461030c9060ff1681565b34801561073157600080fd5b506103636107403660046138ae565b6017602052600090815260409020546001600160a01b031681565b34801561076757600080fd5b5061039b610776366004613679565b6116e6565b34801561078757600080fd5b5061039b61176e565b34801561079c57600080fd5b506103366107ab3660046138ae565b61181f565b3480156107bc57600080fd5b5061039b6107cb36600461373f565b611908565b3480156107dc57600080fd5b5061030c6107eb3660046135ff565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561082557600080fd5b5061039b6108343660046135e2565b611b43565b34801561084557600080fd5b506103ce61271081565b61039b61085d3660046138e0565b611c22565b34801561086e57600080fd5b506103ce601381565b34801561088357600080fd5b506103ce60205481565b60006001600160e01b031982167f780e9d630000000000000000000000000000000000000000000000000000000014806108cb57506108cb82611d30565b92915050565b6060600080546108e090613b3e565b80601f016020809104026020016040519081016040528092919081815260200182805461090c90613b3e565b80156109595780601f1061092e57610100808354040283529160200191610959565b820191906000526020600020905b81548152906001019060200180831161093c57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166109e15760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610a088261123e565b9050806001600160a01b0316836001600160a01b03161415610a925760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084016109d8565b336001600160a01b0382161480610aae5750610aae81336107eb565b610b205760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109d8565b610b2a8383611dcb565b505050565b600a546001600160a01b03163314610b895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b610b966028612710613ac8565b6020541115610be75760405162461bcd60e51b815260206004820152600360248201527f464252000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60208054600090815260189091526040902054602814610c495760405162461bcd60e51b815260206004820152600360248201527f4e4252000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b610c5281611e39565b50565b6000828152601860205260408120805483908110610c7557610c75613c00565b9060005260206000200154905092915050565b610c923382611e51565b610d045760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016109d8565b610b2a838383611f48565b602154610100900460ff1615610d675760405162461bcd60e51b815260206004820152600360248201527f434950000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b610c5281612120565b6000610d7b836112c9565b8210610def5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016109d8565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610b2a838383604051806020016040528060008152506116e6565b60606000610e40836112c9565b905060008167ffffffffffffffff811115610e5d57610e5d613c16565b604051908082528060200260200182016040528015610e86578160200160208202803683370190505b50905060005b82811015610ecd57610e9e8582610d70565b828281518110610eb057610eb0613c00565b602090810291909101015280610ec581613b79565b915050610e8c565b509392505050565b600a546001600160a01b03163314610f2f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6001600160a01b038116610f4257600080fd5b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b158015610f8b57600080fd5b505afa158015610f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc391906138c7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561100957600080fd5b505af115801561101d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104191906137ec565b5050565b600061105060085490565b82106110c45760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016109d8565b600882815481106110d7576110d7613c00565b90600052602060002001549050919050565b600a546001600160a01b031633146111435760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b805161104190601c9060208401906134d1565b600a546001600160a01b031633146111b05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6021805460ff19811660ff90911615179055565b600a546001600160a01b0316331461121e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6021805461010060ff19821681900460ff16150261ffff19909116179055565b6000818152600260205260408120546001600160a01b0316806108cb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016109d8565b60006001600160a01b0382166113475760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016109d8565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b031633146113bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6113c7600061233b565b565b600a546001600160a01b031633146114235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6000611430601447613ac8565b9050600061143f826003613adc565b9050600061144e600547613ac8565b611459906002613adc565b600d546040519192506001600160a01b03169083156108fc029084906000818181858888f15050600e546040516001600160a01b03909116935086156108fc0292508691506000818181858888f15050600f546040516001600160a01b03909116935084156108fc0292508491506000818181858888f150506010546040516001600160a01b03909116935084156108fc0292508491506000818181858888f150506040513393504780156108fc02935091506000818181858888f1935050505015801561152b573d6000803e3d6000fd5b50505050565b600a546001600160a01b0316331461158b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b601d55565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116085760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016109d8565b611041828261238d565b6060600180546108e090613b3e565b6001600160a01b03821633141561167a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109d8565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6116f03383611e51565b6117625760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016109d8565b61152b84848484612396565b600a546001600160a01b031633146117c85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b60006117d2612414565b905060006117df60085490565b60408051828152602081018590529192507fb5ee2a8e4d580ba63b19bba3cb6bdd37c94f2714a32896bb448c8266f1ce1efa910160405180910390a15050565b6000818152600260205260409020546060906001600160a01b03166118ac5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084016109d8565b60006118b66124cf565b905060008151116118d65760405180602001604052806000815250611901565b806118e0846124de565b6040516020016118f1929190613964565b6040516020818303038152906040525b9392505050565b6002600b54141561195b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109d8565b6002600b558051601e543332146119b45760405162461bcd60e51b815260206004820152600360248201527f4e4443000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b6119be8282613adc565b471015611a0d5760405162461bcd60e51b815260206004820152600360248201527f50324c000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60005b82811015611b38576000848281518110611a2c57611a2c613c00565b602090810291909101810151600081815260179092526040909120549091506001600160a01b03163314611a605750611b26565b60026000828152601a602052604090205460ff166002811115611a8557611a85613bd4565b148015611aa157506000818152601b602052604090205460ff16155b15611b24576000818152601b6020526040808220805460ff1916600117905551339185156108fc02918691818181858888f19350505050158015611ae9573d6000803e3d6000fd5b5060408051338152602081018390527fd900805a27b7703e31fb9e9354185823953c374ef77ff9a979e8489f93a6889f910160405180910390a15b505b80611b3081613b79565b915050611a10565b50506001600b555050565b600a546001600160a01b03163314611b9d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6001600160a01b038116611c195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016109d8565b610c528161233b565b60215460ff161515600114611c795760405162461bcd60e51b815260206004820152600360248201527f504e4f000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b82611c848233612610565b14611cd15760405162461bcd60e51b815260206004820152600360248201527f484346000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b611cdb83836126a9565b611d275760405162461bcd60e51b815260206004820152600360248201527f555350000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b61152b84612120565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480611d9357506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806108cb57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108cb565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611e008261123e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611e468260196126cd565b905061104181612798565b6000818152600260205260408120546001600160a01b0316611eca5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109d8565b6000611ed58361123e565b9050806001600160a01b0316846001600160a01b03161480611f105750836001600160a01b0316611f0584610963565b6001600160a01b0316145b80611f4057506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611f5b8261123e565b6001600160a01b031614611fd75760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016109d8565b6001600160a01b0382166120525760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016109d8565b61205d838383612a44565b612068600082611dcb565b6001600160a01b0383166000908152600360205260408120805460019290612091908490613afb565b90915550506001600160a01b03821660009081526003602052604081208054600192906120bf908490613ab0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061212b60085490565b601f5490915061271061213e8484613ab0565b111561218c5760405162461bcd60e51b815260206004820152600360248201527f585453000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60138311156121dd5760405162461bcd60e51b815260206004820152600360248201527f58544c000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b82601d546121eb9190613adc565b34101561223a5760405162461bcd60e51b815260206004820152600360248201527f574541000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60005b838110156123335760006122518285613ab0565b905061225d3382612afc565b600081815260176020908152604080832080546001600160a01b03191633179055601a8252808320805460ff19166001908117909155868452601883529083208054918201815580845291832001839055908490525460281415612320576122c6600584613b94565b6123125760006122d4612414565b60408051878152602081018390529192507fb5ee2a8e4d580ba63b19bba3cb6bdd37c94f2714a32896bb448c8266f1ce1efa910160405180910390a1505b8261231c81613b79565b9350505b508061232b81613b79565b91505061223d565b50601f555050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61104181611e39565b6123a1848484611f48565b6123ad84848484612b16565b61152b5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109d8565b6016546040516370a0823160e01b8152306004820152600091906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b15801561247a57600080fd5b505afa15801561248e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b291906138c7565b116124bc57600080fd5b6124ca601554601654612c6e565b905090565b6060601c80546108e090613b3e565b60608161251e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612548578061253281613b79565b91506125419050600a83613ac8565b9150612522565b60008167ffffffffffffffff81111561256357612563613c16565b6040519080825280601f01601f19166020018201604052801561258d576020820181803683370190505b5090505b8415611f40576125a2600183613afb565b91506125af600a86613b94565b6125ba906030613ab0565b60f81b8183815181106125cf576125cf613c00565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612609600a86613ac8565b9450612591565b601254604080516001600160a01b038416602082015290810191909152606081018390526000908190611f4090608001604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60006126b58383612df9565b6011546001600160a01b039182169116149392505050565b60608167ffffffffffffffff8111156126e8576126e8613c16565b604051908082528060200260200182016040528015612711578160200160208202803683370190505b50905060005b828110156127915761272b60016028613afb565b60408051602081018790529081018390526060016040516020818303038152906040528051906020012060001c6127629190613b94565b82828151811061277457612774613c00565b60209081029190910101528061278981613b79565b915050612717565b5092915050565b805160205460006127ab60146028613ac8565b905060008060005b6005811015612a2d5760008467ffffffffffffffff8111156127d7576127d7613c16565b604051908082528060200260200182016040528015612800578160200160208202803683370190505b509050600061280f8388613ab0565b905082612834576128208689613afb565b945061282d600189613afb565b935061284d565b61283e8686613afb565b945061284a8685613afb565b93505b6000855b8581116128af578a818151811061286a5761286a613c00565b602002602001015184838151811061288457612884613c00565b60209081029190910101528161289981613b79565b92505080806128a790613b79565b915050612851565b5060005b87811015612a095760008482815181106128cf576128cf613c00565b6020026020010151905060006018600086815260200190815260200160002082815481106128ff576128ff613c00565b600091825260209091200154905060026000828152601a602052604090205460ff16600281111561293257612932613bd4565b148061295157506000818152601b602052604090205460ff1615156001145b156129995760008581526018602052604090208261297160016028613afb565b61297b9190613afb565b8154811061298b5761298b613c00565b906000526020600020015490505b6000818152601a6020908152604091829020805460ff1916600217905581518781529081018390529081018390527f7a2852674dd02b705d896dc9d4aac43e762c2b46675f9159cb511323ed462c0d9060600160405180910390a150508080612a0190613b79565b9150506128b3565b5085612a1757505050612a2d565b5050508080612a2590613b79565b9150506127b3565b50612a39600585613ab0565b602055505050505050565b6001600160a01b038316612a9f57612a9a81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612ac2565b816001600160a01b0316836001600160a01b031614612ac257612ac28382612e15565b6001600160a01b038216612ad957610b2a81612eb2565b826001600160a01b0316826001600160a01b031614610b2a57610b2a8282612f61565b611041828260405180602001604052806000815250612fa5565b60006001600160a01b0384163b15612c6357604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612b5a903390899088908890600401613993565b602060405180830381600087803b158015612b7457600080fd5b505af1925050508015612ba4575060408051601f3d908101601f19168201909252612ba191810190613848565b60015b612c49573d808015612bd2576040519150601f19603f3d011682016040523d82523d6000602084013e612bd7565b606091505b508051612c415760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109d8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f40565b506001949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000084866000604051602001612cde929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401612d0b939291906139cf565b602060405180830381600087803b158015612d2557600080fd5b505af1158015612d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5d91906137ec565b506000838152600c6020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052919052612db9906001613ab0565b6000858152600c6020526040902055611f408482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6000806000612e088585613023565b91509150610ecd81613093565b60006001612e22846112c9565b612e2c9190613afb565b600083815260076020526040902054909150808214612e7f576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612ec490600190613afb565b60008381526009602052604081205460088054939450909284908110612eec57612eec613c00565b906000526020600020015490508060088381548110612f0d57612f0d613c00565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612f4557612f45613bea565b6001900381819060005260206000200160009055905550505050565b6000612f6c836112c9565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b612faf838361324e565b612fbc6000848484612b16565b610b2a5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109d8565b60008082516041141561305a5760208301516040840151606085015160001a61304e8782858561339c565b9450945050505061308c565b8251604014156130845760208301516040840151613079868383613489565b93509350505061308c565b506000905060025b9250929050565b60008160048111156130a7576130a7613bd4565b14156130b05750565b60018160048111156130c4576130c4613bd4565b14156131125760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109d8565b600281600481111561312657613126613bd4565b14156131745760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109d8565b600381600481111561318857613188613bd4565b14156131e15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109d8565b60048160048111156131f5576131f5613bd4565b1415610c525760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016109d8565b6001600160a01b0382166132a45760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109d8565b6000818152600260205260409020546001600160a01b0316156133095760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109d8565b61331560008383612a44565b6001600160a01b038216600090815260036020526040812080546001929061333e908490613ab0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156133d35750600090506003613480565b8460ff16601b141580156133eb57508460ff16601c14155b156133fc5750600090506004613480565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613450573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661347957600060019250925050613480565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b016134c38782888561339c565b935093505050935093915050565b8280546134dd90613b3e565b90600052602060002090601f0160209004810192826134ff5760008555613545565b82601f1061351857805160ff1916838001178555613545565b82800160010185558215613545579182015b8281111561354557825182559160200191906001019061352a565b50613551929150613555565b5090565b5b808211156135515760008155600101613556565b600067ffffffffffffffff83111561358457613584613c16565b613597601f8401601f1916602001613a7f565b90508281528383830111156135ab57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126135d357600080fd5b6119018383356020850161356a565b6000602082840312156135f457600080fd5b813561190181613c2c565b6000806040838503121561361257600080fd5b823561361d81613c2c565b9150602083013561362d81613c2c565b809150509250929050565b60008060006060848603121561364d57600080fd5b833561365881613c2c565b9250602084013561366881613c2c565b929592945050506040919091013590565b6000806000806080858703121561368f57600080fd5b843561369a81613c2c565b935060208501356136aa81613c2c565b925060408501359150606085013567ffffffffffffffff8111156136cd57600080fd5b6136d9878288016135c2565b91505092959194509250565b600080604083850312156136f857600080fd5b823561370381613c2c565b9150602083013561362d81613c41565b6000806040838503121561372657600080fd5b823561373181613c2c565b946020939093013593505050565b6000602080838503121561375257600080fd5b823567ffffffffffffffff8082111561376a57600080fd5b818501915085601f83011261377e57600080fd5b81358181111561379057613790613c16565b8060051b91506137a1848301613a7f565b8181528481019084860184860187018a10156137bc57600080fd5b600095505b838610156137df5780358352600195909501949186019186016137c1565b5098975050505050505050565b6000602082840312156137fe57600080fd5b815161190181613c41565b6000806040838503121561381c57600080fd5b50508035926020909101359150565b60006020828403121561383d57600080fd5b813561190181613c4f565b60006020828403121561385a57600080fd5b815161190181613c4f565b60006020828403121561387757600080fd5b813567ffffffffffffffff81111561388e57600080fd5b8201601f8101841361389f57600080fd5b611f408482356020840161356a565b6000602082840312156138c057600080fd5b5035919050565b6000602082840312156138d957600080fd5b5051919050565b600080600080608085870312156138f657600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561391b57600080fd5b613927878288016135c2565b949793965093946060013593505050565b60008151808452613950816020860160208601613b12565b601f01601f19169290920160200192915050565b60008351613976818460208801613b12565b83519083019061398a818360208801613b12565b01949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526139c56080830184613938565b9695505050505050565b6001600160a01b03841681528260208201526060604082015260006139f76060830184613938565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015613a3857835183529284019291840191600101613a1c565b50909695505050505050565b6020810160038310613a6657634e487b7160e01b600052602160045260246000fd5b91905290565b6020815260006119016020830184613938565b604051601f8201601f1916810167ffffffffffffffff81118282101715613aa857613aa8613c16565b604052919050565b60008219821115613ac357613ac3613ba8565b500190565b600082613ad757613ad7613bbe565b500490565b6000816000190483118215151615613af657613af6613ba8565b500290565b600082821015613b0d57613b0d613ba8565b500390565b60005b83811015613b2d578181015183820152602001613b15565b8381111561152b5750506000910152565b600181811c90821680613b5257607f821691505b60208210811415613b7357634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613b8d57613b8d613ba8565b5060010190565b600082613ba357613ba3613bbe565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c5257600080fd5b8015158114610c5257600080fd5b6001600160e01b031981168114610c5257600080fdfea26469706673582212206f23bb0facb3c1653af279e09dcd8003b71f3d07df5e8d054badbfc815e5363164736f6c63430008070033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d616f38366544534c713978546e414862695641674b654d7a34315773535157637645794458757650395831722f00000000000000000000000000000000000000000000000000000000000000000000000000000000000b4d6f6e65792054726565730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005474d464d54000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102e75760003560e01c8063715018a611610184578063a52abcc6116100d6578063e985e9c51161008a578063fd7d67f711610064578063fd7d67f71461084f578063ff0cf4de14610862578063ff7f219c1461087757600080fd5b8063e985e9c5146107d0578063f2fde38b14610819578063f47c84c51461083957600080fd5b8063c6f05fdd116100bb578063c6f05fdd1461077b578063c87b56dd14610790578063d1e84621146107b057600080fd5b8063a52abcc614610725578063b88d4fde1461075b57600080fd5b80639038e6931161013857806395d89b411161011257806395d89b41146106d6578063a22cb465146106eb578063a2be7c291461070b57600080fd5b80639038e6931461068157806391b7f5ed1461069657806394985ddd146106b657600080fd5b80637df14138116101695780637df14138146106035780638a845fa5146106335780638da5cb5b1461066357600080fd5b8063715018a6146105d857806376cd940e146105ed57600080fd5b806345313d291161023d5780635a07bb50116101f15780636352211e116101cb5780636352211e146105825780636817c76c146105a257806370a08231146105b857600080fd5b80635a07bb50146105395780635c33eb421461054e5780635d08c1ae1461056357600080fd5b80634f6ccce7116102225780634f6ccce7146104bc578063522b2e88146104dc57806355f804b31461051957600080fd5b806345313d291461046f57806349df728c1461049c57600080fd5b806318160ddd1161029f5780632db11544116102795780632db115441461041c5780632f745c591461042f57806342842e0e1461044f57600080fd5b806318160ddd146103bd57806322709627146103dc57806323b872dd146103fc57600080fd5b8063081812fc116102d0578063081812fc14610343578063095ea7b31461037b5780630fede7221461039d57600080fd5b806301ffc9a7146102ec57806306fdde0314610321575b600080fd5b3480156102f857600080fd5b5061030c61030736600461382b565b61088d565b60405190151581526020015b60405180910390f35b34801561032d57600080fd5b506103366108d1565b6040516103189190613a6c565b34801561034f57600080fd5b5061036361035e3660046138ae565b610963565b6040516001600160a01b039091168152602001610318565b34801561038757600080fd5b5061039b610396366004613713565b6109fd565b005b3480156103a957600080fd5b5061039b6103b83660046138ae565b610b2f565b3480156103c957600080fd5b506008545b604051908152602001610318565b3480156103e857600080fd5b506103ce6103f7366004613809565b610c55565b34801561040857600080fd5b5061039b610417366004613638565b610c88565b61039b61042a3660046138ae565b610d0f565b34801561043b57600080fd5b506103ce61044a366004613713565b610d70565b34801561045b57600080fd5b5061039b61046a366004613638565b610e18565b34801561047b57600080fd5b5061048f61048a3660046135e2565b610e33565b6040516103189190613a00565b3480156104a857600080fd5b5061039b6104b73660046135e2565b610ed5565b3480156104c857600080fd5b506103ce6104d73660046138ae565b611045565b3480156104e857600080fd5b5061050c6104f73660046138ae565b6000908152601a602052604090205460ff1690565b6040516103189190613a44565b34801561052557600080fd5b5061039b610534366004613865565b6110e9565b34801561054557600080fd5b5061039b611156565b34801561055a57600080fd5b5061039b6111c4565b34801561056f57600080fd5b5060215461030c90610100900460ff1681565b34801561058e57600080fd5b5061036361059d3660046138ae565b61123e565b3480156105ae57600080fd5b506103ce601d5481565b3480156105c457600080fd5b506103ce6105d33660046135e2565b6112c9565b3480156105e457600080fd5b5061039b611363565b3480156105f957600080fd5b506103ce601f5481565b34801561060f57600080fd5b5061030c61061e3660046138ae565b601b6020526000908152604090205460ff1681565b34801561063f57600080fd5b5061050c61064e3660046138ae565b601a6020526000908152604090205460ff1681565b34801561066f57600080fd5b50600a546001600160a01b0316610363565b34801561068d57600080fd5b5061039b6113c9565b3480156106a257600080fd5b5061039b6106b13660046138ae565b611531565b3480156106c257600080fd5b5061039b6106d1366004613809565b611590565b3480156106e257600080fd5b50610336611612565b3480156106f757600080fd5b5061039b6107063660046136e5565b611621565b34801561071757600080fd5b5060215461030c9060ff1681565b34801561073157600080fd5b506103636107403660046138ae565b6017602052600090815260409020546001600160a01b031681565b34801561076757600080fd5b5061039b610776366004613679565b6116e6565b34801561078757600080fd5b5061039b61176e565b34801561079c57600080fd5b506103366107ab3660046138ae565b61181f565b3480156107bc57600080fd5b5061039b6107cb36600461373f565b611908565b3480156107dc57600080fd5b5061030c6107eb3660046135ff565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561082557600080fd5b5061039b6108343660046135e2565b611b43565b34801561084557600080fd5b506103ce61271081565b61039b61085d3660046138e0565b611c22565b34801561086e57600080fd5b506103ce601381565b34801561088357600080fd5b506103ce60205481565b60006001600160e01b031982167f780e9d630000000000000000000000000000000000000000000000000000000014806108cb57506108cb82611d30565b92915050565b6060600080546108e090613b3e565b80601f016020809104026020016040519081016040528092919081815260200182805461090c90613b3e565b80156109595780601f1061092e57610100808354040283529160200191610959565b820191906000526020600020905b81548152906001019060200180831161093c57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166109e15760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610a088261123e565b9050806001600160a01b0316836001600160a01b03161415610a925760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084016109d8565b336001600160a01b0382161480610aae5750610aae81336107eb565b610b205760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016109d8565b610b2a8383611dcb565b505050565b600a546001600160a01b03163314610b895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b610b966028612710613ac8565b6020541115610be75760405162461bcd60e51b815260206004820152600360248201527f464252000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60208054600090815260189091526040902054602814610c495760405162461bcd60e51b815260206004820152600360248201527f4e4252000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b610c5281611e39565b50565b6000828152601860205260408120805483908110610c7557610c75613c00565b9060005260206000200154905092915050565b610c923382611e51565b610d045760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016109d8565b610b2a838383611f48565b602154610100900460ff1615610d675760405162461bcd60e51b815260206004820152600360248201527f434950000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b610c5281612120565b6000610d7b836112c9565b8210610def5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016109d8565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b610b2a838383604051806020016040528060008152506116e6565b60606000610e40836112c9565b905060008167ffffffffffffffff811115610e5d57610e5d613c16565b604051908082528060200260200182016040528015610e86578160200160208202803683370190505b50905060005b82811015610ecd57610e9e8582610d70565b828281518110610eb057610eb0613c00565b602090810291909101015280610ec581613b79565b915050610e8c565b509392505050565b600a546001600160a01b03163314610f2f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6001600160a01b038116610f4257600080fd5b6040516370a0823160e01b81523060048201526001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b158015610f8b57600080fd5b505afa158015610f9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc391906138c7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561100957600080fd5b505af115801561101d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104191906137ec565b5050565b600061105060085490565b82106110c45760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016109d8565b600882815481106110d7576110d7613c00565b90600052602060002001549050919050565b600a546001600160a01b031633146111435760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b805161104190601c9060208401906134d1565b600a546001600160a01b031633146111b05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6021805460ff19811660ff90911615179055565b600a546001600160a01b0316331461121e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6021805461010060ff19821681900460ff16150261ffff19909116179055565b6000818152600260205260408120546001600160a01b0316806108cb5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016109d8565b60006001600160a01b0382166113475760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016109d8565b506001600160a01b031660009081526003602052604090205490565b600a546001600160a01b031633146113bd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6113c7600061233b565b565b600a546001600160a01b031633146114235760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6000611430601447613ac8565b9050600061143f826003613adc565b9050600061144e600547613ac8565b611459906002613adc565b600d546040519192506001600160a01b03169083156108fc029084906000818181858888f15050600e546040516001600160a01b03909116935086156108fc0292508691506000818181858888f15050600f546040516001600160a01b03909116935084156108fc0292508491506000818181858888f150506010546040516001600160a01b03909116935084156108fc0292508491506000818181858888f150506040513393504780156108fc02935091506000818181858888f1935050505015801561152b573d6000803e3d6000fd5b50505050565b600a546001600160a01b0316331461158b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b601d55565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795216146116085760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0060448201526064016109d8565b611041828261238d565b6060600180546108e090613b3e565b6001600160a01b03821633141561167a5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016109d8565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6116f03383611e51565b6117625760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016109d8565b61152b84848484612396565b600a546001600160a01b031633146117c85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b60006117d2612414565b905060006117df60085490565b60408051828152602081018590529192507fb5ee2a8e4d580ba63b19bba3cb6bdd37c94f2714a32896bb448c8266f1ce1efa910160405180910390a15050565b6000818152600260205260409020546060906001600160a01b03166118ac5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084016109d8565b60006118b66124cf565b905060008151116118d65760405180602001604052806000815250611901565b806118e0846124de565b6040516020016118f1929190613964565b6040516020818303038152906040525b9392505050565b6002600b54141561195b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109d8565b6002600b558051601e543332146119b45760405162461bcd60e51b815260206004820152600360248201527f4e4443000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b6119be8282613adc565b471015611a0d5760405162461bcd60e51b815260206004820152600360248201527f50324c000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60005b82811015611b38576000848281518110611a2c57611a2c613c00565b602090810291909101810151600081815260179092526040909120549091506001600160a01b03163314611a605750611b26565b60026000828152601a602052604090205460ff166002811115611a8557611a85613bd4565b148015611aa157506000818152601b602052604090205460ff16155b15611b24576000818152601b6020526040808220805460ff1916600117905551339185156108fc02918691818181858888f19350505050158015611ae9573d6000803e3d6000fd5b5060408051338152602081018390527fd900805a27b7703e31fb9e9354185823953c374ef77ff9a979e8489f93a6889f910160405180910390a15b505b80611b3081613b79565b915050611a10565b50506001600b555050565b600a546001600160a01b03163314611b9d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109d8565b6001600160a01b038116611c195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016109d8565b610c528161233b565b60215460ff161515600114611c795760405162461bcd60e51b815260206004820152600360248201527f504e4f000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b82611c848233612610565b14611cd15760405162461bcd60e51b815260206004820152600360248201527f484346000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b611cdb83836126a9565b611d275760405162461bcd60e51b815260206004820152600360248201527f555350000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b61152b84612120565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480611d9357506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806108cb57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108cb565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611e008261123e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611e468260196126cd565b905061104181612798565b6000818152600260205260408120546001600160a01b0316611eca5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016109d8565b6000611ed58361123e565b9050806001600160a01b0316846001600160a01b03161480611f105750836001600160a01b0316611f0584610963565b6001600160a01b0316145b80611f4057506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611f5b8261123e565b6001600160a01b031614611fd75760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016109d8565b6001600160a01b0382166120525760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016109d8565b61205d838383612a44565b612068600082611dcb565b6001600160a01b0383166000908152600360205260408120805460019290612091908490613afb565b90915550506001600160a01b03821660009081526003602052604081208054600192906120bf908490613ab0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061212b60085490565b601f5490915061271061213e8484613ab0565b111561218c5760405162461bcd60e51b815260206004820152600360248201527f585453000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60138311156121dd5760405162461bcd60e51b815260206004820152600360248201527f58544c000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b82601d546121eb9190613adc565b34101561223a5760405162461bcd60e51b815260206004820152600360248201527f574541000000000000000000000000000000000000000000000000000000000060448201526064016109d8565b60005b838110156123335760006122518285613ab0565b905061225d3382612afc565b600081815260176020908152604080832080546001600160a01b03191633179055601a8252808320805460ff19166001908117909155868452601883529083208054918201815580845291832001839055908490525460281415612320576122c6600584613b94565b6123125760006122d4612414565b60408051878152602081018390529192507fb5ee2a8e4d580ba63b19bba3cb6bdd37c94f2714a32896bb448c8266f1ce1efa910160405180910390a1505b8261231c81613b79565b9350505b508061232b81613b79565b91505061223d565b50601f555050565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61104181611e39565b6123a1848484611f48565b6123ad84848484612b16565b61152b5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109d8565b6016546040516370a0823160e01b8152306004820152600091906001600160a01b037f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca16906370a082319060240160206040518083038186803b15801561247a57600080fd5b505afa15801561248e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b291906138c7565b116124bc57600080fd5b6124ca601554601654612c6e565b905090565b6060601c80546108e090613b3e565b60608161251e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612548578061253281613b79565b91506125419050600a83613ac8565b9150612522565b60008167ffffffffffffffff81111561256357612563613c16565b6040519080825280601f01601f19166020018201604052801561258d576020820181803683370190505b5090505b8415611f40576125a2600183613afb565b91506125af600a86613b94565b6125ba906030613ab0565b60f81b8183815181106125cf576125cf613c00565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612609600a86613ac8565b9450612591565b601254604080516001600160a01b038416602082015290810191909152606081018390526000908190611f4090608001604051602081830303815290604052805190602001206040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60006126b58383612df9565b6011546001600160a01b039182169116149392505050565b60608167ffffffffffffffff8111156126e8576126e8613c16565b604051908082528060200260200182016040528015612711578160200160208202803683370190505b50905060005b828110156127915761272b60016028613afb565b60408051602081018790529081018390526060016040516020818303038152906040528051906020012060001c6127629190613b94565b82828151811061277457612774613c00565b60209081029190910101528061278981613b79565b915050612717565b5092915050565b805160205460006127ab60146028613ac8565b905060008060005b6005811015612a2d5760008467ffffffffffffffff8111156127d7576127d7613c16565b604051908082528060200260200182016040528015612800578160200160208202803683370190505b509050600061280f8388613ab0565b905082612834576128208689613afb565b945061282d600189613afb565b935061284d565b61283e8686613afb565b945061284a8685613afb565b93505b6000855b8581116128af578a818151811061286a5761286a613c00565b602002602001015184838151811061288457612884613c00565b60209081029190910101528161289981613b79565b92505080806128a790613b79565b915050612851565b5060005b87811015612a095760008482815181106128cf576128cf613c00565b6020026020010151905060006018600086815260200190815260200160002082815481106128ff576128ff613c00565b600091825260209091200154905060026000828152601a602052604090205460ff16600281111561293257612932613bd4565b148061295157506000818152601b602052604090205460ff1615156001145b156129995760008581526018602052604090208261297160016028613afb565b61297b9190613afb565b8154811061298b5761298b613c00565b906000526020600020015490505b6000818152601a6020908152604091829020805460ff1916600217905581518781529081018390529081018390527f7a2852674dd02b705d896dc9d4aac43e762c2b46675f9159cb511323ed462c0d9060600160405180910390a150508080612a0190613b79565b9150506128b3565b5085612a1757505050612a2d565b5050508080612a2590613b79565b9150506127b3565b50612a39600585613ab0565b602055505050505050565b6001600160a01b038316612a9f57612a9a81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612ac2565b816001600160a01b0316836001600160a01b031614612ac257612ac28382612e15565b6001600160a01b038216612ad957610b2a81612eb2565b826001600160a01b0316826001600160a01b031614610b2a57610b2a8282612f61565b611041828260405180602001604052806000815250612fa5565b60006001600160a01b0384163b15612c6357604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612b5a903390899088908890600401613993565b602060405180830381600087803b158015612b7457600080fd5b505af1925050508015612ba4575060408051601f3d908101601f19168201909252612ba191810190613848565b60015b612c49573d808015612bd2576040519150601f19603f3d011682016040523d82523d6000602084013e612bd7565b606091505b508051612c415760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109d8565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f40565b506001949350505050565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795284866000604051602001612cde929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401612d0b939291906139cf565b602060405180830381600087803b158015612d2557600080fd5b505af1158015612d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5d91906137ec565b506000838152600c6020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052919052612db9906001613ab0565b6000858152600c6020526040902055611f408482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6000806000612e088585613023565b91509150610ecd81613093565b60006001612e22846112c9565b612e2c9190613afb565b600083815260076020526040902054909150808214612e7f576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612ec490600190613afb565b60008381526009602052604081205460088054939450909284908110612eec57612eec613c00565b906000526020600020015490508060088381548110612f0d57612f0d613c00565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612f4557612f45613bea565b6001900381819060005260206000200160009055905550505050565b6000612f6c836112c9565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b612faf838361324e565b612fbc6000848484612b16565b610b2a5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60648201526084016109d8565b60008082516041141561305a5760208301516040840151606085015160001a61304e8782858561339c565b9450945050505061308c565b8251604014156130845760208301516040840151613079868383613489565b93509350505061308c565b506000905060025b9250929050565b60008160048111156130a7576130a7613bd4565b14156130b05750565b60018160048111156130c4576130c4613bd4565b14156131125760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016109d8565b600281600481111561312657613126613bd4565b14156131745760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016109d8565b600381600481111561318857613188613bd4565b14156131e15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016109d8565b60048160048111156131f5576131f5613bd4565b1415610c525760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016109d8565b6001600160a01b0382166132a45760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016109d8565b6000818152600260205260409020546001600160a01b0316156133095760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016109d8565b61331560008383612a44565b6001600160a01b038216600090815260036020526040812080546001929061333e908490613ab0565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156133d35750600090506003613480565b8460ff16601b141580156133eb57508460ff16601c14155b156133fc5750600090506004613480565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613450573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661347957600060019250925050613480565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831660ff84901c601b016134c38782888561339c565b935093505050935093915050565b8280546134dd90613b3e565b90600052602060002090601f0160209004810192826134ff5760008555613545565b82601f1061351857805160ff1916838001178555613545565b82800160010185558215613545579182015b8281111561354557825182559160200191906001019061352a565b50613551929150613555565b5090565b5b808211156135515760008155600101613556565b600067ffffffffffffffff83111561358457613584613c16565b613597601f8401601f1916602001613a7f565b90508281528383830111156135ab57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126135d357600080fd5b6119018383356020850161356a565b6000602082840312156135f457600080fd5b813561190181613c2c565b6000806040838503121561361257600080fd5b823561361d81613c2c565b9150602083013561362d81613c2c565b809150509250929050565b60008060006060848603121561364d57600080fd5b833561365881613c2c565b9250602084013561366881613c2c565b929592945050506040919091013590565b6000806000806080858703121561368f57600080fd5b843561369a81613c2c565b935060208501356136aa81613c2c565b925060408501359150606085013567ffffffffffffffff8111156136cd57600080fd5b6136d9878288016135c2565b91505092959194509250565b600080604083850312156136f857600080fd5b823561370381613c2c565b9150602083013561362d81613c41565b6000806040838503121561372657600080fd5b823561373181613c2c565b946020939093013593505050565b6000602080838503121561375257600080fd5b823567ffffffffffffffff8082111561376a57600080fd5b818501915085601f83011261377e57600080fd5b81358181111561379057613790613c16565b8060051b91506137a1848301613a7f565b8181528481019084860184860187018a10156137bc57600080fd5b600095505b838610156137df5780358352600195909501949186019186016137c1565b5098975050505050505050565b6000602082840312156137fe57600080fd5b815161190181613c41565b6000806040838503121561381c57600080fd5b50508035926020909101359150565b60006020828403121561383d57600080fd5b813561190181613c4f565b60006020828403121561385a57600080fd5b815161190181613c4f565b60006020828403121561387757600080fd5b813567ffffffffffffffff81111561388e57600080fd5b8201601f8101841361389f57600080fd5b611f408482356020840161356a565b6000602082840312156138c057600080fd5b5035919050565b6000602082840312156138d957600080fd5b5051919050565b600080600080608085870312156138f657600080fd5b8435935060208501359250604085013567ffffffffffffffff81111561391b57600080fd5b613927878288016135c2565b949793965093946060013593505050565b60008151808452613950816020860160208601613b12565b601f01601f19169290920160200192915050565b60008351613976818460208801613b12565b83519083019061398a818360208801613b12565b01949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526139c56080830184613938565b9695505050505050565b6001600160a01b03841681528260208201526060604082015260006139f76060830184613938565b95945050505050565b6020808252825182820181905260009190848201906040850190845b81811015613a3857835183529284019291840191600101613a1c565b50909695505050505050565b6020810160038310613a6657634e487b7160e01b600052602160045260246000fd5b91905290565b6020815260006119016020830184613938565b604051601f8201601f1916810167ffffffffffffffff81118282101715613aa857613aa8613c16565b604052919050565b60008219821115613ac357613ac3613ba8565b500190565b600082613ad757613ad7613bbe565b500490565b6000816000190483118215151615613af657613af6613ba8565b500290565b600082821015613b0d57613b0d613ba8565b500390565b60005b83811015613b2d578181015183820152602001613b15565b8381111561152b5750506000910152565b600181811c90821680613b5257607f821691505b60208210811415613b7357634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613b8d57613b8d613ba8565b5060010190565b600082613ba357613ba3613bbe565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c5257600080fd5b8015158114610c5257600080fd5b6001600160e01b031981168114610c5257600080fdfea26469706673582212206f23bb0facb3c1653af279e09dcd8003b71f3d07df5e8d054badbfc815e5363164736f6c63430008070033

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

000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d616f38366544534c713978546e414862695641674b654d7a34315773535157637645794458757650395831722f00000000000000000000000000000000000000000000000000000000000000000000000000000000000b4d6f6e65792054726565730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005474d464d54000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _baseTokenURI (string): ipfs://Qmao86eDSLq9xTnAHbiVAgKeMz41WsSQWcvEyDXuvP9X1r/
Arg [1] : name (string): Money Trees
Arg [2] : symbol (string): GMFMT

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [4] : 697066733a2f2f516d616f38366544534c713978546e414862695641674b654d
Arg [5] : 7a34315773535157637645794458757650395831722f00000000000000000000
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [7] : 4d6f6e6579205472656573000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [9] : 474d464d54000000000000000000000000000000000000000000000000000000


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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