MATIC Price: $0.729435 (+0.69%)
Gas: 30 GWei
 

Overview

Max Total Supply

12,518 PFARM

Holders

888

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Balance
6 PFARM
0xBDe71e8Fe0f7497FE19e38737Cfe958CB2212c1f
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
PolyFarmer

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 2 runs

Other Settings:
default evmVersion
File 1 of 20 : PolyFarmer.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "openzeppelin-solidity/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "./Corn.sol";

interface FarmerMetadata {
  function tokenMetadata(
    uint256 tokenId,
    uint16[7] calldata traits
  ) external view returns (string memory);
}

contract PolyFarmer is ERC721A, Ownable, VRFConsumerBase {
  bytes32 internal keyHash;
  uint256 internal fee;
  uint256 public freeSupply = 3000;
  uint256 public maxSupply = 20000;
  uint256 public purchased;
  uint256 public blockIncrement = 200 ether;
  uint256 public saleStatus;
  uint256 constant public limitFree = 3;
  mapping(address=>uint256) public freeMintTimestamp;
  mapping(address=>uint256) public limitPerAddress;
  mapping(address=>bool) public whitelistAddresses;
  mapping(string=>uint256[]) public buckets;
  Corn corn;
  FarmerMetadata metadata;
  string unrevealedMetadata;
  PolyFarmer previousContract;

  struct Traits {
    uint128 tokenId;
    uint16 gender;
    uint16 skin;
    uint16 hair;
    uint16 clothes;
    uint16 hat;
    uint16 mouth;
    uint16 eyes;
  }

  mapping(bytes32=>bool) public traitsTaken;
  mapping(uint256=>Traits) public tokenTraits;

  uint256 public nextRevealed;

  constructor(address _corn, address _metadata, address _previousContract, address _vrf, address _link, bytes32 _keyHash, uint256 _fee) ERC721A("PolyFarmer", "PFARM") VRFConsumerBase(_vrf, _link) {
    corn = Corn(_corn);
    previousContract = PolyFarmer(_previousContract);
    keyHash = _keyHash;
    fee = _fee;
    metadata = FarmerMetadata(_metadata);

    buckets['gender'] = [maxSupply/2 + 100, maxSupply/2 + 100];
    buckets['skin'] = [2100, 4100, 4100, 4100, 4100, 2100];
    buckets['hair'] = [2300, 2300, 2300, 2300, 1600, 1600, 1200, 1200, 1200, 950, 950, 750, 550, 350, 100];
    buckets['clothes'] = [3090, 2900, 2890, 2690, 2490, 2290, 1890, 1490, 990, 590, 390, 100];
    buckets['hat'] = [4090, 4900, 3900, 3900, 1900, 1900, 1900, 590, 490, 100];
    buckets['mouth'] = [1290, 1290, 1900, 1900, 990, 990, 990, 990, 990, 990, 890, 890, 890, 890, 790, 790, 690, 690, 590, 590, 590, 590, 590, 390, 390, 390, 150, 190, 190, 90, 50, 10];
    buckets['eyes'] = [1590, 1590, 1590, 1390, 1390, 1390, 1390, 1190, 1900, 990, 990, 990, 790, 790, 790, 790, 590, 590, 590, 390, 390, 390, 150, 90, 50, 10];

    // require(IERC20(_link).approve(msg.sender, type(uint256).max));
    IERC20(_link).approve(msg.sender, type(uint256).max);
  }

  function totalMinted(address account) public view returns (uint256) {
    return _numberMinted(account);
  }

  function cost(uint256 amount) public view returns (uint256) {
    if (_currentIndex < freeSupply) {
      return 0;
    }
    uint256 blockCount = (_currentIndex - freeSupply) / 500;
    return (200 ether + blockIncrement * blockCount) * amount;
  }

  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    require(tokenId < _currentIndex, "Token doesn't exist");
    if (tokenId >= nextRevealed) {
      return unrevealedMetadata;
    }
    Traits memory traits = tokenTraits[tokenId];
    return metadata.tokenMetadata(tokenId, [traits.gender, traits.skin, traits.hair, traits.clothes, traits.hat, traits.mouth, traits.eyes]);
  }

  function whitelistMint() public {
    require(saleStatus == 1, "Whitelist mint not available");
    require(whitelistAddresses[msg.sender], "Not in whitelist");
    require(purchased < freeSupply, "Sold out");

    purchased++;
    limitPerAddress[msg.sender]++;
    whitelistAddresses[msg.sender] = false;

    _mint(msg.sender, 1, "", false);
    requestRandomness(keyHash, fee);
  }

  function freeMint() public {
    require(saleStatus == 2, "Free mint not available");
    require(limitPerAddress[msg.sender] < limitFree, "Reached free mint limit");
    require(purchased < freeSupply, "Sold out");
    require(freeMintTimestamp[msg.sender] < block.timestamp, "You must wait between txs");
    
    purchased++;
    freeMintTimestamp[msg.sender] = block.timestamp;
    limitPerAddress[msg.sender]++;

    _mint(msg.sender, 1, "", false);
    requestRandomness(keyHash, fee);
  }

  function purchase(uint256 amount) public {
    uint256 totalCost = cost(amount);
    require(purchased >= freeSupply && saleStatus == 2, "Public mint not available");
    require(corn.balanceOf(msg.sender) >= totalCost && corn.allowance(msg.sender, address(this)) >= totalCost, "You must send enough CORN");
    require(amount > 0 && amount <= 20, "Too many or too few per tx");
    require(purchased + amount <= maxSupply, "Sold out");

    purchased += amount;
    corn.burn(msg.sender, totalCost);
    _mint(msg.sender, amount, "", false);

    for (uint16 i = 0; i < amount; i++) {
      requestRandomness(keyHash, fee);
    }
  }

  function getTrait(string memory traitType, uint256 seed) internal view returns (uint16) {
    uint256[] memory bucket = buckets[traitType];
    uint256 total = 0;
    for (uint256 i = 0; i < bucket.length; i++) {
      total += bucket[i];
    }
    seed = seed % total;
    for (uint16 i = 0; i < bucket.length; i++) {
      uint256 chance = bucket[i];
      if (seed < chance) {
        return i;
      }
      seed -= chance;
    }
    revert("No trait remaining");
  }

  function fulfillRandomness(bytes32, uint256 randomness) internal override {
    uint256 tokenId = nextRevealed++;
    require(tokenId < purchased, "Wrong tokenId");
    while(true) {
      uint16 gender = getTrait('gender', uint256(keccak256(abi.encode(randomness, 1))));
      uint16 skin = getTrait('skin', uint256(keccak256(abi.encode(randomness, 2))));
      uint16 hair = getTrait('hair', uint256(keccak256(abi.encode(randomness, 3))));
      uint16 clothes = getTrait('clothes', uint256(keccak256(abi.encode(randomness, 4))));
      uint16 hat = getTrait('hat', uint256(keccak256(abi.encode(randomness, 4))));
      uint16 mouth = getTrait('mouth', uint256(keccak256(abi.encode(randomness, 6))));
      uint16 eyes = getTrait('eyes', uint256(keccak256(abi.encode(randomness, 7))));
      bytes32 hsh = keccak256(abi.encode(gender, skin, hair, clothes, hat, mouth, eyes));
      if (!traitsTaken[hsh]) {
        buckets['gender'][gender]--;
        buckets['skin'][skin]--;
        buckets['hair'][hair]--;
        buckets['clothes'][clothes]--;
        buckets['hat'][hat]--;
        buckets['mouth'][mouth]--;
        buckets['eyes'][eyes]--;
        traitsTaken[hsh] = true;
        tokenTraits[tokenId] = Traits(uint128(tokenId), gender, skin, hair, clothes, hat, mouth, eyes);
        return;
      }
    }
  }

  function airdropPreviousTokens(uint256 until) public onlyOwner {
    uint256 prevPurchased = previousContract.purchased();
    uint256 nReveal = previousContract.nextRevealed();
    require(purchased <= until && until < prevPurchased, "All done");
    for (uint256 i = purchased; i <= until; i++) {
      if (i < nReveal) {
        (
          uint128 tokenId,
          uint16 gender,
          uint16 skin,
          uint16 hair,
          uint16 clothes,
          uint16 hat,
          uint16 mouth,
          uint16 eyes
        ) = previousContract.tokenTraits(i);
        bytes32 hsh = keccak256(abi.encode(gender, skin, hair, clothes, hat, mouth, eyes));
        buckets['gender'][gender]--;
        buckets['skin'][skin]--;
        buckets['hair'][hair]--;
        buckets['clothes'][clothes]--;
        buckets['hat'][hat]--;
        buckets['mouth'][mouth]--;
        buckets['eyes'][eyes]--;
        traitsTaken[hsh] = true;
        tokenTraits[tokenId] = Traits(tokenId, gender, skin, hair, clothes, hat, mouth, eyes);
        nextRevealed++;
      } else {
        requestRandomness(keyHash, fee);
      }
      address account = previousContract.ownerOf(i);
      _mint(account, 1, "", false);
    }
    purchased = until + 1;
  }

  function requestReveal(uint256 amount) public onlyOwner {
    for (uint16 i = 0; i < amount; i++) {
      requestRandomness(keyHash, fee);
    }
  }

  function setBlockIncrement(uint256 _increment) public onlyOwner {
    blockIncrement = _increment;
  }

  function setSaleStatus(uint256 _status) public onlyOwner {
    saleStatus = _status;
  }

  function setUnrevealedMetadata(string calldata _metadata) public onlyOwner {
    unrevealedMetadata = _metadata;
  }

  function setWhitelistAddresses(address[] calldata addresses, bool status) public onlyOwner {
    for (uint256 i = 0; i < addresses.length; i++) {
      whitelistAddresses[addresses[i]] = status;
    }
  }

  function setMetadataContract(address _metadata) public onlyOwner {
    metadata = FarmerMetadata(_metadata);
  }
  
  function setCorn(address _corn) public onlyOwner {
    corn = Corn(_corn);
  }
}

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

import "openzeppelin-solidity/contracts/access/Ownable.sol";

contract Handlers is Ownable {
  mapping(address=>bool) public handlers;

  function addHandler(address h) public onlyOwner {
    handlers[h] = true;
  }

  function removeHandler(address h) public onlyOwner {
    handlers[h] = false;
  }

  modifier isHandler() {
    address sender = _msgSender();
    require(owner() == sender || handlers[sender], "Handlers: Unauthorized");
    _;
  }
}

File 3 of 20 : Corn.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "./Handlers.sol";

contract Corn is ERC20, Handlers {
  constructor() ERC20("CORN", "CORN") {}

  function mint(address account, uint256 amount) public isHandler {
    _mint(account, amount);
  }

  function burn(address account, uint256 amount) public {
    if (msg.sender != account) {
      uint256 allow = allowance(account, msg.sender);
      require(allow >= amount, "Unauthorized");
      _approve(account, msg.sender, allow - amount);
    }
    _burn(account, amount);
  }
}

File 4 of 20 : IERC165.sol
// 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);
}

File 5 of 20 : ERC165.sol
// 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;
    }
}

File 6 of 20 : Strings.sol
// 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);
    }
}

File 7 of 20 : Context.sol
// 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;
    }
}

File 8 of 20 : Address.sol
// 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);
            }
        }
    }
}

File 9 of 20 : IERC721Metadata.sol
// 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 10 of 20 : IERC721Enumerable.sol
// 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);
}

File 11 of 20 : 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);
}

File 12 of 20 : IERC721.sol
// 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;
}

File 13 of 20 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 14 of 20 : IERC20.sol
// 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);
}

File 15 of 20 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens 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 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 16 of 20 : Ownable.sol
// 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);
    }
}

File 17 of 20 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import 'openzeppelin-solidity/contracts/token/ERC721/IERC721.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import 'openzeppelin-solidity/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import 'openzeppelin-solidity/contracts/utils/Address.sol';
import 'openzeppelin-solidity/contracts/utils/Context.sol';
import 'openzeppelin-solidity/contracts/utils/Strings.sol';
import 'openzeppelin-solidity/contracts/utils/introspection/ERC165.sol';

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintedQueryForZeroAddress();
error BurnedQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerIndexOutOfBounds();
error OwnerQueryForNonexistentToken();
error TokenIndexOutOfBounds();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**128 - 1 (max value of uint128).
 */
contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
    using Address for address;
    using Strings for uint256;

    // Compiler will pack this into a single 256bit word.
    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
    }

    // Compiler will pack the following 
    // _currentIndex and _burnCounter into a single 256bit word.
    
    // The tokenId of the next token to be minted.
    uint128 internal _currentIndex;

    // The number of tokens burned.
    uint128 internal _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned. See ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

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

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex times
        unchecked {
            return _currentIndex - _burnCounter;    
        }
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenByIndex(uint256 index) public view override returns (uint256) {
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (!ownership.burned) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }
        revert TokenIndexOutOfBounds();
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first.
     * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
        if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds();
        uint256 numMintedSoFar = _currentIndex;
        uint256 tokenIdsIdx;
        address currOwnershipAddr;

        // Counter overflow is impossible as the loop breaks when
        // uint256 i is equal to another uint256 numMintedSoFar.
        unchecked {
            for (uint256 i; i < numMintedSoFar; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    if (tokenIdsIdx == index) {
                        return i;
                    }
                    tokenIdsIdx++;
                }
            }
        }

        // Execution should never reach this point.
        revert();
    }

    /**
     * @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 ||
            interfaceId == type(IERC721Enumerable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    function _numberMinted(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert MintedQueryForZeroAddress();
        return uint256(_addressData[owner].numberMinted);
    }

    function _numberBurned(address owner) internal view returns (uint256) {
        if (owner == address(0)) revert BurnedQueryForZeroAddress();
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        uint256 curr = tokenId;

        unchecked {
            if (curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // Invariant: 
                    // There will always be an ownership that has an address and is not burned 
                    // before an ownership that does not have an address and is not burned.
                    // Hence, curr will not underflow.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return ownershipOf(tokenId).addr;
    }

    /**
     * @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) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        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 override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public override {
        if (operator == _msgSender()) revert ApproveToCaller();

        _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 {
        _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 {
        _transfer(from, to, tokenId);
        if (!_checkOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    /**
     * @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`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return tokenId < _currentIndex && !_ownerships[tokenId].burned;
    }

    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, quantity, '');
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        _mint(to, quantity, _data, true);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _mint(
        address to,
        uint256 quantity,
        bytes memory _data,
        bool safe
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 3.4e38 (2**128) - 1
        // updatedIndex overflows if _currentIndex + quantity > 3.4e38 (2**128) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;

            for (uint256 i; i < quantity; i++) {
                emit Transfer(address(0), to, updatedIndex);
                if (safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data)) {
                    revert TransferToNonERC721ReceiverImplementer();
                }
                updatedIndex++;
            }

            _currentIndex = uint128(updatedIndex);
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) private {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
            isApprovedForAll(prevOwnership.addr, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128.
        unchecked {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            _ownerships[tokenId].addr = to;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @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 {
        TokenOwnership memory prevOwnership = ownershipOf(tokenId);

        _beforeTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

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

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as tokenId would have to be 2**128.
        unchecked {
            _addressData[prevOwnership.addr].balance -= 1;
            _addressData[prevOwnership.addr].numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            _ownerships[tokenId].addr = prevOwnership.addr;
            _ownerships[tokenId].startTimestamp = uint64(block.timestamp);
            _ownerships[tokenId].burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            if (_ownerships[nextTokenId].addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId < _currentIndex) {
                    _ownerships[nextTokenId].addr = prevOwnership.addr;
                    _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(prevOwnership.addr, address(0), tokenId);
        _afterTokenTransfers(prevOwnership.addr, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked { 
            _burnCounter++;
        }
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        address owner
    ) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(owner, 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(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert TransferToNonERC721ReceiverImplementer();
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * 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, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     * And also called after one token has been burned.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

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

interface LinkTokenInterface {

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

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

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

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

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

  function increaseApproval(
    address spender,
    uint256 subtractedValue
  ) external;

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

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

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

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

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

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

}

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

contract VRFRequestIDBase {

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

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

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

import "./interfaces/LinkTokenInterface.sol";

import "./VRFRequestIDBase.sol";

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_corn","type":"address"},{"internalType":"address","name":"_metadata","type":"address"},{"internalType":"address","name":"_previousContract","type":"address"},{"internalType":"address","name":"_vrf","type":"address"},{"internalType":"address","name":"_link","type":"address"},{"internalType":"bytes32","name":"_keyHash","type":"bytes32"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"MintedQueryForZeroAddress","type":"error"},{"inputs":[],"name":"OwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TokenIndexOutOfBounds","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"until","type":"uint256"}],"name":"airdropPreviousTokens","outputs":[],"stateMutability":"nonpayable","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":[],"name":"blockIncrement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"buckets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"freeMintTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freeSupply","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":"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":"limitFree","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"limitPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextRevealed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"purchase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"purchased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"requestReveal","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":"saleStatus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256","name":"_increment","type":"uint256"}],"name":"setBlockIncrement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_corn","type":"address"}],"name":"setCorn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_metadata","type":"address"}],"name":"setMetadataContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_status","type":"uint256"}],"name":"setSaleStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_metadata","type":"string"}],"name":"setUnrevealedMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setWhitelistAddresses","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":"","type":"uint256"}],"name":"tokenTraits","outputs":[{"internalType":"uint128","name":"tokenId","type":"uint128"},{"internalType":"uint16","name":"gender","type":"uint16"},{"internalType":"uint16","name":"skin","type":"uint16"},{"internalType":"uint16","name":"hair","type":"uint16"},{"internalType":"uint16","name":"clothes","type":"uint16"},{"internalType":"uint16","name":"hat","type":"uint16"},{"internalType":"uint16","name":"mouth","type":"uint16"},{"internalType":"uint16","name":"eyes","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"traitsTaken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistAddresses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMint","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052610bb8600b55614e20600c55680ad78ebc5ac6200000600e553480156200002a57600080fd5b50604051620042fa380380620042fa8339810160408190526200004d9162000849565b604080518082018252600a8152692837b63ca330b936b2b960b11b602080830191825283518085019094526005845264504641524d60d81b90840152815187938793929091620000a09160019162000705565b508051620000b690600290602084019062000705565b505050620000d3620000cd620006af60201b60201c565b620006b3565b6001600160601b0319606092831b811660a052911b16608052601480546001600160a01b038981166001600160a01b031992831617909255601780548884169083161790556009849055600a839055601580549289169290911691909117905560408051808201909152600c54819062000150906002906200091e565b6200015d906064620008f7565b81526020016002600c546200017391906200091e565b62000180906064620008f7565b90526040516533b2b73232b960d11b8152601390600601908152604051908190036020019020620001b391600262000794565b506040805160c0810182526108348082526110046020830181905282840181905260608301819052608083015260a082015290516339b5b4b760e11b815260139060040190815260405190819003602001902062000213916006620007d1565b50604080516101e0810182526108fc8082526020820181905281830181905260608201526106406080820181905260a08201526104b060c0820181905260e082018190526101008201526103b661012082018190526101408201526102ee61016082015261022661018082015261015e6101a082015260646101c08201529051633430b4b960e11b8152601390600401908152604051908190036020019020620002bf91600f620007d1565b506040805161018081018252610c128152610b546020820152610b4a81830152610a8260608201526109ba60808201526108f260a082015261076260c08201526105d260e08201526103de61010082015261024e6101208201526101866101408201526064610160820152905166636c6f7468657360c81b81526013906007019081526040519081900360200190206200035b91600c620007d1565b506040805161014081018252610ffa81526113246020820152610f3c818301819052606082015261076c6080820181905260a0820181905260c082015261024e60e08201526101ea61010082015260646101208201529051621a185d60ea1b8152601390600301908152604051908190036020019020620003de91600a620007d1565b50604080516104008101825261050a808252602082015261076c81830181905260608201526103de6080820181905260a0820181905260c0820181905260e08201819052610100820181905261012082015261037a6101408201819052610160820181905261018082018190526101a08201526103166101c082018190526101e08201526102b2610200820181905261022082015261024e6102408201819052610260820181905261028082018190526102a082018190526102c08201526101866102e082018190526103008201819052610320820152609661034082015260be6103608201819052610380820152605a6103a082015260326103c0820152600a6103e08201529051640dadeeae8d60db1b8152601390600501908152602001604051809103902090602062000516929190620007d1565b506040805161034081018252610636808252602082018190528183015261056e606082018190526080820181905260a0820181905260c08201526104a660e082015261076c6101008201526103de6101208201819052610140820181905261016082015261031661018082018190526101a082018190526101c082018190526101e082015261024e61020082018190526102208201819052610240820152610186610260820181905261028082018190526102a082015260966102c0820152605a6102e08201526032610300820152600a6103208201529051636579657360e01b81526013906004019081526040519081900360200190206200061b91601a620007d1565b5060405163095ea7b360e01b815233600482015260001960248201526001600160a01b0384169063095ea7b390604401602060405180830381600087803b1580156200066657600080fd5b505af11580156200067b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620006a19190620008cc565b50505050505050506200097e565b3390565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620007139062000941565b90600052602060002090601f01602090048101928262000737576000855562000782565b82601f106200075257805160ff191683800117855562000782565b8280016001018555821562000782579182015b828111156200078257825182559160200191906001019062000765565b506200079092915062000815565b5090565b8280548282559060005260206000209081019282156200078257916020028201828111156200078257825182559160200191906001019062000765565b82805482825590600052602060002090810192821562000782579160200282015b8281111562000782578251829061ffff16905591602001919060010190620007f2565b5b8082111562000790576000815560010162000816565b80516001600160a01b03811681146200084457600080fd5b919050565b600080600080600080600060e0888a0312156200086557600080fd5b62000870886200082c565b965062000880602089016200082c565b955062000890604089016200082c565b9450620008a0606089016200082c565b9350620008b0608089016200082c565b925060a0880151915060c0880151905092959891949750929550565b600060208284031215620008df57600080fd5b81518015158114620008f057600080fd5b9392505050565b600082198211156200091957634e487b7160e01b600052601160045260246000fd5b500190565b6000826200093c57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c908216806200095657607f821691505b602082108114156200097857634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c60a05160601c613949620009b16000396000818161159a01526122b20152600061228301526139496000f3fe608060405234801561001057600080fd5b50600436106102195760003560e01c80623d47901461021e57806301ffc9a71461024457806306fdde03146102675780630728f40f1461027c578063081812fc14610285578063095ea7b3146102a557806318160ddd146102ba57806323b872dd146102dc57806324a6ab0c146102ef5780632f745c59146102f8578063328d61941461030b57806340261cdd1461031357806342842e0e146103265780634f6ccce71461033957806350b410d81461034c57806355f862cf1461035f5780635872fa7a1461037f5780635b70ea9f146103885780636352211e1461039057806369ddd67d146103a357806370a08231146103c6578063715018a6146103d957806379ed355c146103e1578063804f43cd146103f4578063879f9c96146103fc5780638bb35905146104055780638da5cb5b146104185780639097548d1461042057806394985ddd1461043357806395d89b4114610446578063a22cb4651461044e578063a8d9bb7714610461578063ae5ee69c14610474578063b88d4fde14610487578063bb209a4a1461049a578063c87b56dd146104ba578063d5abeb01146104cd578063d9376c3d146104d6578063e05c57bf146104e9578063e5187f43146105af578063e985e9c5146105c2578063efef39a1146105fe578063f29f15af14610611578063f2e1df6514610624578063f2fde38b14610647578063f9020e331461065a575b600080fd5b61023161022c366004613010565b610663565b6040519081526020015b60405180910390f35b61025761025236600461327a565b610674565b604051901515815260200161023b565b61026f6106df565b60405161023b91906135e6565b610231601a5481565b61029861029336600461323f565b610771565b60405161023b919061356e565b6102b86102b3366004613171565b6107b5565b005b6102316000546001600160801b03600160801b82048116918116919091031690565b6102b86102ea366004613083565b610843565b610231600b5481565b610231610306366004613171565b61084e565b610231600381565b6102b861032136600461323f565b61094a565b6102b8610334366004613083565b6109b6565b61023161034736600461323f565b6109d1565b6102b861035a36600461323f565b610a7b565b61023161036d366004613010565b60106020526000908152604090205481565b610231600e5481565b6102b8610aaf565b61029861039e36600461323f565b610c41565b6102576103b1366004613010565b60126020526000908152604090205460ff1681565b6102316103d4366004613010565b610c53565b6102b8610ca1565b6102b86103ef3660046132b4565b610cdc565b6102b8610d17565b610231600d5481565b6102b861041336600461323f565b610e44565b6102986114ff565b61023161042e36600461323f565b61150e565b6102b8610441366004613258565b61158f565b61026f611611565b6102b861045c366004613143565b611620565b6102b861046f36600461319d565b6116b6565b6102b8610482366004613010565b61175c565b6102b86104953660046130c4565b6117ad565b6102316104a8366004613010565b60116020526000908152604090205481565b61026f6104c836600461323f565b6117e1565b610231600c5481565b6102316104e436600461339b565b611b1e565b61055c6104f736600461323f565b6019602052600090815260409020546001600160801b0381169061ffff600160801b8204811691600160901b8104821691600160a01b8204811691600160b01b8104821691600160c01b8204811691600160d01b8104821691600160e01b9091041688565b604080516001600160801b03909916895261ffff97881660208a01529587169588019590955292851660608701529084166080860152831660a0850152821660c08401521660e08201526101000161023b565b6102b86105bd366004613010565b611b5e565b6102576105d036600461304a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6102b861060c36600461323f565b611baf565b6102b861061f36600461323f565b611ebf565b61025761063236600461323f565b60186020526000908152604090205460ff1681565b6102b8610655366004613010565b611ef3565b610231600f5481565b600061066e82611f90565b92915050565b60006001600160e01b031982166380ac58cd60e01b14806106a557506001600160e01b03198216635b5e139f60e01b145b806106c057506001600160e01b0319821663780e9d6360e01b145b8061066e57506301ffc9a760e01b6001600160e01b031983161461066e565b6060600180546106ee906137d6565b80601f016020809104026020016040519081016040528092919081815260200182805461071a906137d6565b80156107675780601f1061073c57610100808354040283529160200191610767565b820191906000526020600020905b81548152906001019060200180831161074a57829003601f168201915b5050505050905090565b600061077c82611fe5565b610799576040516333d1c03960e21b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b60006107c082610c41565b9050806001600160a01b0316836001600160a01b031614156107f55760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610815575061081381336105d0565b155b15610833576040516367d9dca160e11b815260040160405180910390fd5b61083e838383612019565b505050565b61083e838383612075565b600061085983610c53565b8210610878576040516306ed618760e11b815260040160405180910390fd5b600080546001600160801b03169080805b8381101561094457600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615801592820192909252906108f0575061093c565b80516001600160a01b03161561090557805192505b876001600160a01b0316836001600160a01b0316141561093a57868414156109335750935061066e92505050565b6001909301925b505b600101610889565b50600080fd5b336109536114ff565b6001600160a01b0316146109825760405162461bcd60e51b8152600401610979906135f9565b60405180910390fd5b60005b818161ffff1610156109b25761099f600954600a5461227f565b50806109aa81613811565b915050610985565b5050565b61083e838383604051806020016040528060008152506117ad565b600080546001600160801b031681805b82811015610a6157600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290610a585785831415610a515750949350505050565b6001909201915b506001016109e1565b506040516329c8c00760e21b815260040160405180910390fd5b33610a846114ff565b6001600160a01b031614610aaa5760405162461bcd60e51b8152600401610979906135f9565b600e55565b600f54600214610afb5760405162461bcd60e51b815260206004820152601760248201527646726565206d696e74206e6f7420617661696c61626c6560481b6044820152606401610979565b33600090815260116020526040902054600311610b545760405162461bcd60e51b815260206004820152601760248201527614995858da195908199c9959481b5a5b9d081b1a5b5a5d604a1b6044820152606401610979565b600b54600d5410610b775760405162461bcd60e51b81526004016109799061362e565b336000908152601060205260409020544211610bd15760405162461bcd60e51b8152602060048201526019602482015278596f75206d7573742077616974206265747765656e2074787360381b6044820152606401610979565b600d8054906000610be183613833565b909155505033600090815260106020908152604080832042905560119091528120805491610c0e83613833565b9190505550610c30336001604051806020016040528060008152506000612412565b610c3e600954600a5461227f565b50565b6000610c4c82612582565b5192915050565b60006001600160a01b038216610c7c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600460205260409020546001600160401b031690565b33610caa6114ff565b6001600160a01b031614610cd05760405162461bcd60e51b8152600401610979906135f9565b610cda60006126a4565b565b33610ce56114ff565b6001600160a01b031614610d0b5760405162461bcd60e51b8152600401610979906135f9565b61083e60168383612f22565b600f54600114610d685760405162461bcd60e51b815260206004820152601c60248201527b57686974656c697374206d696e74206e6f7420617661696c61626c6560201b6044820152606401610979565b3360009081526012602052604090205460ff16610dba5760405162461bcd60e51b815260206004820152601060248201526f139bdd081a5b881dda1a5d195b1a5cdd60821b6044820152606401610979565b600b54600d5410610ddd5760405162461bcd60e51b81526004016109799061362e565b600d8054906000610ded83613833565b9091555050336000908152601160205260408120805491610e0d83613833565b9091555050336000818152601260209081526040808320805460ff1916905580519182019052818152610c30929160019190612412565b33610e4d6114ff565b6001600160a01b031614610e735760405162461bcd60e51b8152600401610979906135f9565b601754604080516343cfce4b60e11b815290516000926001600160a01b03169163879f9c96916004808301926020929190829003018186803b158015610eb857600080fd5b505afa158015610ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef09190613498565b90506000601760009054906101000a90046001600160a01b03166001600160a01b0316630728f40f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4257600080fd5b505afa158015610f56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7a9190613498565b905082600d5411158015610f8d57508183105b610fc45760405162461bcd60e51b8152602060048201526008602482015267416c6c20646f6e6560c01b6044820152606401610979565b600d545b8381116114eb578181101561142c5760175460405163e05c57bf60e01b81526004810183905260009182918291829182918291829182916001600160a01b039091169063e05c57bf906024016101006040518083038186803b15801561102d57600080fd5b505afa158015611041573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106591906133f3565b975097509750975097509750975097506000878787878787876040516020016110949796959493929190613650565b60405160208183030381529060405280519060200120905060136040516110ba9061354c565b90815260200160405180910390208861ffff16815481106110dd576110dd61388e565b600091825260208220018054916110f3836137bf565b91905055506013604051611106906134f9565b90815260200160405180910390208761ffff16815481106111295761112961388e565b6000918252602082200180549161113f836137bf565b919050555060136040516111529061353c565b90815260200160405180910390208661ffff16815481106111755761117561388e565b6000918252602082200180549161118b836137bf565b9190505550601360405161119e90613529565b90815260200160405180910390208561ffff16815481106111c1576111c161388e565b600091825260208220018054916111d7836137bf565b919050555060136040516111ea9061351a565b90815260200160405180910390208461ffff168154811061120d5761120d61388e565b60009182526020822001805491611223836137bf565b9190505550601360405161123690613509565b90815260200160405180910390208361ffff16815481106112595761125961388e565b6000918252602082200180549161126f836137bf565b919050555060136040516112829061355e565b90815260200160405180910390208261ffff16815481106112a5576112a561388e565b600091825260208220018054916112bb836137bf565b909155505060008181526018602090815260408083208054600160ff199091161790558051610100810182526001600160801b038d811680835261ffff8e81168487019081528e82168587019081528e8316606087019081528e8416608088019081528e851660a089019081528e861660c08a019081528e871660e08b01908152978d526019909b52988b2097518854945193519251915199519a51965197166001600160901b031990941693909317600160801b928516929092029190911763ffffffff60901b1916600160901b9184169190910261ffff60a01b191617600160a01b918316919091021763ffffffff60b01b1916600160b01b9582169590950261ffff60c01b191694909417600160c01b958516959095029490941763ffffffff60d01b1916600160d01b9484169490940261ffff60e01b191693909317600160e01b9390921692909202179055601a80549161141983613833565b919050555050505050505050505061143c565b61143a600954600a5461227f565b505b6017546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e9060240160206040518083038186803b15801561148157600080fd5b505afa158015611495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b9919061302d565b90506114d8816001604051806020016040528060008152506000612412565b50806114e381613833565b915050610fc8565b506114f7836001613731565b600d55505050565b6007546001600160a01b031690565b600b546000805490916001600160801b03909116101561153057506000919050565b600b546000805490916101f49161155091906001600160801b031661377c565b61155a9190613749565b90508281600e5461156b919061375d565b61157e90680ad78ebc5ac6200000613731565b611588919061375d565b9392505050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116075760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610979565b6109b282826126f6565b6060600280546106ee906137d6565b6001600160a01b03821633141561164a5760405163b06307db60e01b815260040160405180910390fd5b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b336116bf6114ff565b6001600160a01b0316146116e55760405162461bcd60e51b8152600401610979906135f9565b60005b828110156117565781601260008686858181106117075761170761388e565b905060200201602081019061171c9190613010565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061174e81613833565b9150506116e8565b50505050565b336117656114ff565b6001600160a01b03161461178b5760405162461bcd60e51b8152600401610979906135f9565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6117b8848484612075565b6117c484848484612cb2565b611756576040516368d2bf6b60e11b815260040160405180910390fd5b6000546060906001600160801b031682106118345760405162461bcd60e51b8152602060048201526013602482015272151bdad95b88191bd95cdb89dd08195e1a5cdd606a1b6044820152606401610979565b601a5482106118cf576016805461184a906137d6565b80601f0160208091040260200160405190810160405280929190818152602001828054611876906137d6565b80156118c35780601f10611898576101008083540402835291602001916118c3565b820191906000526020600020905b8154815290600101906020018083116118a657829003601f168201915b50505050509050919050565b600060196000848152602001908152602001600020604051806101000160405290816000820160009054906101000a90046001600160801b03166001600160801b03166001600160801b031681526020016000820160109054906101000a900461ffff1661ffff1661ffff1681526020016000820160129054906101000a900461ffff1661ffff1661ffff1681526020016000820160149054906101000a900461ffff1661ffff1661ffff1681526020016000820160169054906101000a900461ffff1661ffff1661ffff1681526020016000820160189054906101000a900461ffff1661ffff1661ffff16815260200160008201601a9054906101000a900461ffff1661ffff1661ffff16815260200160008201601c9054906101000a900461ffff1661ffff1661ffff16815250509050601560009054906101000a90046001600160a01b03166001600160a01b031663c39f238f846040518060e00160405280856020015161ffff1661ffff168152602001856040015161ffff1661ffff168152602001856060015161ffff1661ffff168152602001856080015161ffff1661ffff1681526020018560a0015161ffff1661ffff1681526020018560c0015161ffff1661ffff1681526020018560e0015161ffff1661ffff168152506040518363ffffffff1660e01b8152600401611aca92919061368c565b60006040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115889190810190613325565b81516020818401810180516013825292820191850191909120919052805482908110611b4957600080fd5b90600052602060002001600091509150505481565b33611b676114ff565b6001600160a01b031614611b8d5760405162461bcd60e51b8152600401610979906135f9565b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6000611bba8261150e565b9050600b54600d5410158015611bd25750600f546002145b611c1a5760405162461bcd60e51b81526020600482015260196024820152785075626c6963206d696e74206e6f7420617661696c61626c6560381b6044820152606401610979565b6014546040516370a0823160e01b815282916001600160a01b0316906370a0823190611c4a90339060040161356e565b60206040518083038186803b158015611c6257600080fd5b505afa158015611c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9a9190613498565b10158015611d275750601454604051636eb1769f60e11b815233600482015230602482015282916001600160a01b03169063dd62ed3e9060440160206040518083038186803b158015611cec57600080fd5b505afa158015611d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d249190613498565b10155b611d6f5760405162461bcd60e51b81526020600482015260196024820152782cb7ba9036bab9ba1039b2b7321032b737bab3b41021a7a92760391b6044820152606401610979565b600082118015611d80575060148211155b611dc95760405162461bcd60e51b815260206004820152601a6024820152790a8dede40dac2dcf240dee440e8dede40cccaee40e0cae440e8f60331b6044820152606401610979565b600c5482600d54611dda9190613731565b1115611df85760405162461bcd60e51b81526004016109799061362e565b81600d6000828254611e0a9190613731565b9091555050601454604051632770a7eb60e21b8152336004820152602481018390526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b158015611e5b57600080fd5b505af1158015611e6f573d6000803e3d6000fd5b50505050611e8f3383604051806020016040528060008152506000612412565b60005b828161ffff16101561083e57611eac600954600a5461227f565b5080611eb781613811565b915050611e92565b33611ec86114ff565b6001600160a01b031614611eee5760405162461bcd60e51b8152600401610979906135f9565b600f55565b33611efc6114ff565b6001600160a01b031614611f225760405162461bcd60e51b8152600401610979906135f9565b6001600160a01b038116611f875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610979565b610c3e816126a4565b60006001600160a01b038216611fb9576040516335ebb31960e01b815260040160405180910390fd5b506001600160a01b0316600090815260046020526040902054600160401b90046001600160401b031690565b600080546001600160801b03168210801561066e575050600090815260036020526040902054600160e01b900460ff161590565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061208082612582565b80519091506000906001600160a01b0316336001600160a01b031614806120ae575081516120ae90336105d0565b806120c95750336120be84610771565b6001600160a01b0316145b9050806120e957604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b03161461211e5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03841661214557604051633a954ecd60e21b815260040160405180910390fd5b6121556000848460000151612019565b6001600160a01b03858116600090815260046020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600390945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116612247576000546001600160801b031681101561224757825160008281526003602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03166000805160206138f483398151915260405160405180910390a45b5050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f0000000000000000000000000000000000000000000000000000000000000000848660006040516020016122ef929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161231c939291906135bf565b602060405180830381600087803b15801561233657600080fd5b505af115801561234a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236e9190613222565b50600083815260086020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120938790529190526123ca906001613731565b60008581526008602052604090205561240a8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b949350505050565b6000546001600160801b03166001600160a01b03851661244457604051622e076360e81b815260040160405180910390fd5b836124625760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260046020908152604080832080546001600160801b031981166001600160401b038083168c018116918217600160401b6001600160401b031990941690921783900481168c018116909202179091558584526003909252822080546001600160e01b031916909317600160a01b42909216919091021790915581905b8581101561255c5760405182906001600160a01b038916906000906000805160206138f4833981519152908290a483801561253257506125306000888488612cb2565b155b15612550576040516368d2bf6b60e11b815260040160405180910390fd5b600191820191016124ed565b50600080546001600160801b0319166001600160801b0392909216919091179055612278565b60408051606081018252600080825260208201819052918101829052905482906001600160801b031681101561268b57600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906126895780516001600160a01b031615612620579392505050565b5060001901600081815260036020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215612684579392505050565b612620565b505b604051636f96cda160e11b815260040160405180910390fd5b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601a80546000918261270783613833565b919050559050600d54811061274e5760405162461bcd60e51b815260206004820152600d60248201526c15dc9bdb99c81d1bdad95b9259609a1b6044820152606401610979565b60006127a46040518060400160405280600681526020016533b2b73232b960d11b8152508460016040516020016127869291906136c9565b6040516020818303038152906040528051906020012060001c612dc0565b905060006127dc6040518060400160405280600481526020016339b5b4b760e11b8152508560026040516020016127869291906136c9565b90506000612814604051806040016040528060048152602001633430b4b960e11b8152508660036040516020016127869291906136c9565b9050600061284f60405180604001604052806007815260200166636c6f7468657360c81b8152508760046040516020016127869291906136c9565b90506000612886604051806040016040528060038152602001621a185d60ea1b8152508860046040516020016127869291906136c9565b905060006128bf604051806040016040528060058152602001640dadeeae8d60db1b8152508960066040516020016127869291906136c9565b905060006128f7604051806040016040528060048152602001636579657360e01b8152508a60076040516020016127869291906136c9565b90506000878787878787876040516020016129189796959493929190613650565b60408051601f1981840301815291815281516020928301206000818152601890935291205490915060ff16612ca55760136040516129559061354c565b90815260200160405180910390208861ffff16815481106129785761297861388e565b6000918252602082200180549161298e836137bf565b919050555060136040516129a1906134f9565b90815260200160405180910390208761ffff16815481106129c4576129c461388e565b600091825260208220018054916129da836137bf565b919050555060136040516129ed9061353c565b90815260200160405180910390208661ffff1681548110612a1057612a1061388e565b60009182526020822001805491612a26836137bf565b91905055506013604051612a3990613529565b90815260200160405180910390208561ffff1681548110612a5c57612a5c61388e565b60009182526020822001805491612a72836137bf565b91905055506013604051612a859061351a565b90815260200160405180910390208461ffff1681548110612aa857612aa861388e565b60009182526020822001805491612abe836137bf565b91905055506013604051612ad190613509565b90815260200160405180910390208361ffff1681548110612af457612af461388e565b60009182526020822001805491612b0a836137bf565b91905055506013604051612b1d9061355e565b90815260200160405180910390208261ffff1681548110612b4057612b4061388e565b60009182526020822001805491612b56836137bf565b909155505060009081526018602090815260408083208054600160ff199091161790558051610100810182526001600160801b038c8116825261ffff9b8c168285019081529a8c16828401908152998c1660608301908152988c1660808301908152978c1660a08301908152968c1660c08301908152958c1660e083019081529c855260199093529220915182549851975196519551945193519a5191166001600160901b031990981697909717600160801b968916969096029590951763ffffffff60901b1916600160901b9488169490940261ffff60a01b191693909317600160a01b928716929092029190911763ffffffff60b01b1916600160b01b9186169190910261ffff60c01b191617600160c01b918516919091021763ffffffff60d01b1916600160d01b9484169490940261ffff60e01b191693909317600160e01b91909216021790555050565b505050505050505061274e565b60006001600160a01b0384163b15612db557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612cf6903390899088908890600401613582565b602060405180830381600087803b158015612d1057600080fd5b505af1925050508015612d40575060408051601f3d908101601f19168201909252612d3d91810190613297565b60015b612d9b573d808015612d6e576040519150601f19603f3d011682016040523d82523d6000602084013e612d73565b606091505b508051612d93576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061240a565b506001949350505050565b600080601384604051612dd391906134dd565b9081526040805191829003602090810183208054808302850183019093528284529190830182828015612e2557602002820191906000526020600020905b815481526020019060010190808311612e11575b505050505090506000805b8251811015612e7257828181518110612e4b57612e4b61388e565b602002602001015182612e5e9190613731565b915080612e6a81613833565b915050612e30565b50612e7d818561384e565b935060005b82518161ffff161015612ee4576000838261ffff1681518110612ea757612ea761388e565b6020026020010151905080861015612ec45750925061066e915050565b612ece818761377c565b9550508080612edc90613811565b915050612e82565b5060405162461bcd60e51b81526020600482015260126024820152714e6f2074726169742072656d61696e696e6760701b6044820152606401610979565b828054612f2e906137d6565b90600052602060002090601f016020900481019282612f505760008555612f96565b82601f10612f695782800160ff19823516178555612f96565b82800160010185558215612f96579182015b82811115612f96578235825591602001919060010190612f7b565b50612fa2929150612fa6565b5090565b5b80821115612fa25760008155600101612fa7565b6000612fce612fc98461370a565b6136da565b9050828152838383011115612fe257600080fd5b828260208301376000602084830101529392505050565b805161ffff8116811461300b57600080fd5b919050565b60006020828403121561302257600080fd5b8135611588816138ba565b60006020828403121561303f57600080fd5b8151611588816138ba565b6000806040838503121561305d57600080fd5b8235613068816138ba565b91506020830135613078816138ba565b809150509250929050565b60008060006060848603121561309857600080fd5b83356130a3816138ba565b925060208401356130b3816138ba565b929592945050506040919091013590565b600080600080608085870312156130da57600080fd5b84356130e5816138ba565b935060208501356130f5816138ba565b92506040850135915060608501356001600160401b0381111561311757600080fd5b8501601f8101871361312857600080fd5b61313787823560208401612fbb565b91505092959194509250565b6000806040838503121561315657600080fd5b8235613161816138ba565b91506020830135613078816138cf565b6000806040838503121561318457600080fd5b823561318f816138ba565b946020939093013593505050565b6000806000604084860312156131b257600080fd5b83356001600160401b03808211156131c957600080fd5b818601915086601f8301126131dd57600080fd5b8135818111156131ec57600080fd5b8760208260051b850101111561320157600080fd5b60209283019550935050840135613217816138cf565b809150509250925092565b60006020828403121561323457600080fd5b8151611588816138cf565b60006020828403121561325157600080fd5b5035919050565b6000806040838503121561326b57600080fd5b50508035926020909101359150565b60006020828403121561328c57600080fd5b8135611588816138dd565b6000602082840312156132a957600080fd5b8151611588816138dd565b600080602083850312156132c757600080fd5b82356001600160401b03808211156132de57600080fd5b818501915085601f8301126132f257600080fd5b81358181111561330157600080fd5b86602082850101111561331357600080fd5b60209290920196919550909350505050565b60006020828403121561333757600080fd5b81516001600160401b0381111561334d57600080fd5b8201601f8101841361335e57600080fd5b805161336c612fc98261370a565b81815285602083850101111561338157600080fd5b613392826020830160208601613793565b95945050505050565b600080604083850312156133ae57600080fd5b82356001600160401b038111156133c457600080fd5b8301601f810185136133d557600080fd5b6133e485823560208401612fbb565b95602094909401359450505050565b600080600080600080600080610100898b03121561341057600080fd5b88516001600160801b038116811461342757600080fd5b975061343560208a01612ff9565b965061344360408a01612ff9565b955061345160608a01612ff9565b945061345f60808a01612ff9565b935061346d60a08a01612ff9565b925061347b60c08a01612ff9565b915061348960e08a01612ff9565b90509295985092959890939650565b6000602082840312156134aa57600080fd5b5051919050565b600081518084526134c9816020860160208601613793565b601f01601f19169290920160200192915050565b600082516134ef818460208701613793565b9190910192915050565b6339b5b4b760e11b815260040190565b640dadeeae8d60db1b815260050190565b621a185d60ea1b815260030190565b66636c6f7468657360c81b815260070190565b633430b4b960e11b815260040190565b6533b2b73232b960d11b815260060190565b636579657360e01b815260040190565b6001600160a01b0391909116815260200190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906135b5908301846134b1565b9695505050505050565b60018060a01b038416815282602082015260606040820152600061339260608301846134b1565b60208152600061158860208301846134b1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526008908201526714dbdb19081bdd5d60c21b604082015260600190565b61ffff978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b828152610100810160208083018460005b60078110156136be57815161ffff168352918301919083019060010161369d565b505050509392505050565b91825260ff16602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715613702576137026138a4565b604052919050565b60006001600160401b03821115613723576137236138a4565b50601f01601f191660200190565b6000821982111561374457613744613862565b500190565b60008261375857613758613878565b500490565b600081600019048311821515161561377757613777613862565b500290565b60008282101561378e5761378e613862565b500390565b60005b838110156137ae578181015183820152602001613796565b838111156117565750506000910152565b6000816137ce576137ce613862565b506000190190565b600181811c908216806137ea57607f821691505b6020821081141561380b57634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff8083168181141561382957613829613862565b6001019392505050565b600060001982141561384757613847613862565b5060010190565b60008261385d5761385d613878565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c3e57600080fd5b8015158114610c3e57600080fd5b6001600160e01b031981168114610c3e57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f64a16914bbfa4f7882df67961da914d70fa8430b661dce9ef338d522d310eb364736f6c634300080700330000000000000000000000001aa75e1254868e6663bb7a2792c0c23c340e38d60000000000000000000000005aede623dc9cf1e22edc0e568c95a5815dbd16d400000000000000000000000072c5f207a6e56f1959c91d1826c9aa3e8fdcf4660000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da00000000000000000000000000000000000000000000000000005af3107a4000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102195760003560e01c80623d47901461021e57806301ffc9a71461024457806306fdde03146102675780630728f40f1461027c578063081812fc14610285578063095ea7b3146102a557806318160ddd146102ba57806323b872dd146102dc57806324a6ab0c146102ef5780632f745c59146102f8578063328d61941461030b57806340261cdd1461031357806342842e0e146103265780634f6ccce71461033957806350b410d81461034c57806355f862cf1461035f5780635872fa7a1461037f5780635b70ea9f146103885780636352211e1461039057806369ddd67d146103a357806370a08231146103c6578063715018a6146103d957806379ed355c146103e1578063804f43cd146103f4578063879f9c96146103fc5780638bb35905146104055780638da5cb5b146104185780639097548d1461042057806394985ddd1461043357806395d89b4114610446578063a22cb4651461044e578063a8d9bb7714610461578063ae5ee69c14610474578063b88d4fde14610487578063bb209a4a1461049a578063c87b56dd146104ba578063d5abeb01146104cd578063d9376c3d146104d6578063e05c57bf146104e9578063e5187f43146105af578063e985e9c5146105c2578063efef39a1146105fe578063f29f15af14610611578063f2e1df6514610624578063f2fde38b14610647578063f9020e331461065a575b600080fd5b61023161022c366004613010565b610663565b6040519081526020015b60405180910390f35b61025761025236600461327a565b610674565b604051901515815260200161023b565b61026f6106df565b60405161023b91906135e6565b610231601a5481565b61029861029336600461323f565b610771565b60405161023b919061356e565b6102b86102b3366004613171565b6107b5565b005b6102316000546001600160801b03600160801b82048116918116919091031690565b6102b86102ea366004613083565b610843565b610231600b5481565b610231610306366004613171565b61084e565b610231600381565b6102b861032136600461323f565b61094a565b6102b8610334366004613083565b6109b6565b61023161034736600461323f565b6109d1565b6102b861035a36600461323f565b610a7b565b61023161036d366004613010565b60106020526000908152604090205481565b610231600e5481565b6102b8610aaf565b61029861039e36600461323f565b610c41565b6102576103b1366004613010565b60126020526000908152604090205460ff1681565b6102316103d4366004613010565b610c53565b6102b8610ca1565b6102b86103ef3660046132b4565b610cdc565b6102b8610d17565b610231600d5481565b6102b861041336600461323f565b610e44565b6102986114ff565b61023161042e36600461323f565b61150e565b6102b8610441366004613258565b61158f565b61026f611611565b6102b861045c366004613143565b611620565b6102b861046f36600461319d565b6116b6565b6102b8610482366004613010565b61175c565b6102b86104953660046130c4565b6117ad565b6102316104a8366004613010565b60116020526000908152604090205481565b61026f6104c836600461323f565b6117e1565b610231600c5481565b6102316104e436600461339b565b611b1e565b61055c6104f736600461323f565b6019602052600090815260409020546001600160801b0381169061ffff600160801b8204811691600160901b8104821691600160a01b8204811691600160b01b8104821691600160c01b8204811691600160d01b8104821691600160e01b9091041688565b604080516001600160801b03909916895261ffff97881660208a01529587169588019590955292851660608701529084166080860152831660a0850152821660c08401521660e08201526101000161023b565b6102b86105bd366004613010565b611b5e565b6102576105d036600461304a565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6102b861060c36600461323f565b611baf565b6102b861061f36600461323f565b611ebf565b61025761063236600461323f565b60186020526000908152604090205460ff1681565b6102b8610655366004613010565b611ef3565b610231600f5481565b600061066e82611f90565b92915050565b60006001600160e01b031982166380ac58cd60e01b14806106a557506001600160e01b03198216635b5e139f60e01b145b806106c057506001600160e01b0319821663780e9d6360e01b145b8061066e57506301ffc9a760e01b6001600160e01b031983161461066e565b6060600180546106ee906137d6565b80601f016020809104026020016040519081016040528092919081815260200182805461071a906137d6565b80156107675780601f1061073c57610100808354040283529160200191610767565b820191906000526020600020905b81548152906001019060200180831161074a57829003601f168201915b5050505050905090565b600061077c82611fe5565b610799576040516333d1c03960e21b815260040160405180910390fd5b506000908152600560205260409020546001600160a01b031690565b60006107c082610c41565b9050806001600160a01b0316836001600160a01b031614156107f55760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610815575061081381336105d0565b155b15610833576040516367d9dca160e11b815260040160405180910390fd5b61083e838383612019565b505050565b61083e838383612075565b600061085983610c53565b8210610878576040516306ed618760e11b815260040160405180910390fd5b600080546001600160801b03169080805b8381101561094457600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff1615801592820192909252906108f0575061093c565b80516001600160a01b03161561090557805192505b876001600160a01b0316836001600160a01b0316141561093a57868414156109335750935061066e92505050565b6001909301925b505b600101610889565b50600080fd5b336109536114ff565b6001600160a01b0316146109825760405162461bcd60e51b8152600401610979906135f9565b60405180910390fd5b60005b818161ffff1610156109b25761099f600954600a5461227f565b50806109aa81613811565b915050610985565b5050565b61083e838383604051806020016040528060008152506117ad565b600080546001600160801b031681805b82811015610a6157600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290610a585785831415610a515750949350505050565b6001909201915b506001016109e1565b506040516329c8c00760e21b815260040160405180910390fd5b33610a846114ff565b6001600160a01b031614610aaa5760405162461bcd60e51b8152600401610979906135f9565b600e55565b600f54600214610afb5760405162461bcd60e51b815260206004820152601760248201527646726565206d696e74206e6f7420617661696c61626c6560481b6044820152606401610979565b33600090815260116020526040902054600311610b545760405162461bcd60e51b815260206004820152601760248201527614995858da195908199c9959481b5a5b9d081b1a5b5a5d604a1b6044820152606401610979565b600b54600d5410610b775760405162461bcd60e51b81526004016109799061362e565b336000908152601060205260409020544211610bd15760405162461bcd60e51b8152602060048201526019602482015278596f75206d7573742077616974206265747765656e2074787360381b6044820152606401610979565b600d8054906000610be183613833565b909155505033600090815260106020908152604080832042905560119091528120805491610c0e83613833565b9190505550610c30336001604051806020016040528060008152506000612412565b610c3e600954600a5461227f565b50565b6000610c4c82612582565b5192915050565b60006001600160a01b038216610c7c576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600460205260409020546001600160401b031690565b33610caa6114ff565b6001600160a01b031614610cd05760405162461bcd60e51b8152600401610979906135f9565b610cda60006126a4565b565b33610ce56114ff565b6001600160a01b031614610d0b5760405162461bcd60e51b8152600401610979906135f9565b61083e60168383612f22565b600f54600114610d685760405162461bcd60e51b815260206004820152601c60248201527b57686974656c697374206d696e74206e6f7420617661696c61626c6560201b6044820152606401610979565b3360009081526012602052604090205460ff16610dba5760405162461bcd60e51b815260206004820152601060248201526f139bdd081a5b881dda1a5d195b1a5cdd60821b6044820152606401610979565b600b54600d5410610ddd5760405162461bcd60e51b81526004016109799061362e565b600d8054906000610ded83613833565b9091555050336000908152601160205260408120805491610e0d83613833565b9091555050336000818152601260209081526040808320805460ff1916905580519182019052818152610c30929160019190612412565b33610e4d6114ff565b6001600160a01b031614610e735760405162461bcd60e51b8152600401610979906135f9565b601754604080516343cfce4b60e11b815290516000926001600160a01b03169163879f9c96916004808301926020929190829003018186803b158015610eb857600080fd5b505afa158015610ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef09190613498565b90506000601760009054906101000a90046001600160a01b03166001600160a01b0316630728f40f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4257600080fd5b505afa158015610f56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7a9190613498565b905082600d5411158015610f8d57508183105b610fc45760405162461bcd60e51b8152602060048201526008602482015267416c6c20646f6e6560c01b6044820152606401610979565b600d545b8381116114eb578181101561142c5760175460405163e05c57bf60e01b81526004810183905260009182918291829182918291829182916001600160a01b039091169063e05c57bf906024016101006040518083038186803b15801561102d57600080fd5b505afa158015611041573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106591906133f3565b975097509750975097509750975097506000878787878787876040516020016110949796959493929190613650565b60405160208183030381529060405280519060200120905060136040516110ba9061354c565b90815260200160405180910390208861ffff16815481106110dd576110dd61388e565b600091825260208220018054916110f3836137bf565b91905055506013604051611106906134f9565b90815260200160405180910390208761ffff16815481106111295761112961388e565b6000918252602082200180549161113f836137bf565b919050555060136040516111529061353c565b90815260200160405180910390208661ffff16815481106111755761117561388e565b6000918252602082200180549161118b836137bf565b9190505550601360405161119e90613529565b90815260200160405180910390208561ffff16815481106111c1576111c161388e565b600091825260208220018054916111d7836137bf565b919050555060136040516111ea9061351a565b90815260200160405180910390208461ffff168154811061120d5761120d61388e565b60009182526020822001805491611223836137bf565b9190505550601360405161123690613509565b90815260200160405180910390208361ffff16815481106112595761125961388e565b6000918252602082200180549161126f836137bf565b919050555060136040516112829061355e565b90815260200160405180910390208261ffff16815481106112a5576112a561388e565b600091825260208220018054916112bb836137bf565b909155505060008181526018602090815260408083208054600160ff199091161790558051610100810182526001600160801b038d811680835261ffff8e81168487019081528e82168587019081528e8316606087019081528e8416608088019081528e851660a089019081528e861660c08a019081528e871660e08b01908152978d526019909b52988b2097518854945193519251915199519a51965197166001600160901b031990941693909317600160801b928516929092029190911763ffffffff60901b1916600160901b9184169190910261ffff60a01b191617600160a01b918316919091021763ffffffff60b01b1916600160b01b9582169590950261ffff60c01b191694909417600160c01b958516959095029490941763ffffffff60d01b1916600160d01b9484169490940261ffff60e01b191693909317600160e01b9390921692909202179055601a80549161141983613833565b919050555050505050505050505061143c565b61143a600954600a5461227f565b505b6017546040516331a9108f60e11b8152600481018390526000916001600160a01b031690636352211e9060240160206040518083038186803b15801561148157600080fd5b505afa158015611495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b9919061302d565b90506114d8816001604051806020016040528060008152506000612412565b50806114e381613833565b915050610fc8565b506114f7836001613731565b600d55505050565b6007546001600160a01b031690565b600b546000805490916001600160801b03909116101561153057506000919050565b600b546000805490916101f49161155091906001600160801b031661377c565b61155a9190613749565b90508281600e5461156b919061375d565b61157e90680ad78ebc5ac6200000613731565b611588919061375d565b9392505050565b336001600160a01b037f0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae016146116075760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610979565b6109b282826126f6565b6060600280546106ee906137d6565b6001600160a01b03821633141561164a5760405163b06307db60e01b815260040160405180910390fd5b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b336116bf6114ff565b6001600160a01b0316146116e55760405162461bcd60e51b8152600401610979906135f9565b60005b828110156117565781601260008686858181106117075761170761388e565b905060200201602081019061171c9190613010565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790558061174e81613833565b9150506116e8565b50505050565b336117656114ff565b6001600160a01b03161461178b5760405162461bcd60e51b8152600401610979906135f9565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6117b8848484612075565b6117c484848484612cb2565b611756576040516368d2bf6b60e11b815260040160405180910390fd5b6000546060906001600160801b031682106118345760405162461bcd60e51b8152602060048201526013602482015272151bdad95b88191bd95cdb89dd08195e1a5cdd606a1b6044820152606401610979565b601a5482106118cf576016805461184a906137d6565b80601f0160208091040260200160405190810160405280929190818152602001828054611876906137d6565b80156118c35780601f10611898576101008083540402835291602001916118c3565b820191906000526020600020905b8154815290600101906020018083116118a657829003601f168201915b50505050509050919050565b600060196000848152602001908152602001600020604051806101000160405290816000820160009054906101000a90046001600160801b03166001600160801b03166001600160801b031681526020016000820160109054906101000a900461ffff1661ffff1661ffff1681526020016000820160129054906101000a900461ffff1661ffff1661ffff1681526020016000820160149054906101000a900461ffff1661ffff1661ffff1681526020016000820160169054906101000a900461ffff1661ffff1661ffff1681526020016000820160189054906101000a900461ffff1661ffff1661ffff16815260200160008201601a9054906101000a900461ffff1661ffff1661ffff16815260200160008201601c9054906101000a900461ffff1661ffff1661ffff16815250509050601560009054906101000a90046001600160a01b03166001600160a01b031663c39f238f846040518060e00160405280856020015161ffff1661ffff168152602001856040015161ffff1661ffff168152602001856060015161ffff1661ffff168152602001856080015161ffff1661ffff1681526020018560a0015161ffff1661ffff1681526020018560c0015161ffff1661ffff1681526020018560e0015161ffff1661ffff168152506040518363ffffffff1660e01b8152600401611aca92919061368c565b60006040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115889190810190613325565b81516020818401810180516013825292820191850191909120919052805482908110611b4957600080fd5b90600052602060002001600091509150505481565b33611b676114ff565b6001600160a01b031614611b8d5760405162461bcd60e51b8152600401610979906135f9565b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6000611bba8261150e565b9050600b54600d5410158015611bd25750600f546002145b611c1a5760405162461bcd60e51b81526020600482015260196024820152785075626c6963206d696e74206e6f7420617661696c61626c6560381b6044820152606401610979565b6014546040516370a0823160e01b815282916001600160a01b0316906370a0823190611c4a90339060040161356e565b60206040518083038186803b158015611c6257600080fd5b505afa158015611c76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c9a9190613498565b10158015611d275750601454604051636eb1769f60e11b815233600482015230602482015282916001600160a01b03169063dd62ed3e9060440160206040518083038186803b158015611cec57600080fd5b505afa158015611d00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d249190613498565b10155b611d6f5760405162461bcd60e51b81526020600482015260196024820152782cb7ba9036bab9ba1039b2b7321032b737bab3b41021a7a92760391b6044820152606401610979565b600082118015611d80575060148211155b611dc95760405162461bcd60e51b815260206004820152601a6024820152790a8dede40dac2dcf240dee440e8dede40cccaee40e0cae440e8f60331b6044820152606401610979565b600c5482600d54611dda9190613731565b1115611df85760405162461bcd60e51b81526004016109799061362e565b81600d6000828254611e0a9190613731565b9091555050601454604051632770a7eb60e21b8152336004820152602481018390526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b158015611e5b57600080fd5b505af1158015611e6f573d6000803e3d6000fd5b50505050611e8f3383604051806020016040528060008152506000612412565b60005b828161ffff16101561083e57611eac600954600a5461227f565b5080611eb781613811565b915050611e92565b33611ec86114ff565b6001600160a01b031614611eee5760405162461bcd60e51b8152600401610979906135f9565b600f55565b33611efc6114ff565b6001600160a01b031614611f225760405162461bcd60e51b8152600401610979906135f9565b6001600160a01b038116611f875760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610979565b610c3e816126a4565b60006001600160a01b038216611fb9576040516335ebb31960e01b815260040160405180910390fd5b506001600160a01b0316600090815260046020526040902054600160401b90046001600160401b031690565b600080546001600160801b03168210801561066e575050600090815260036020526040902054600160e01b900460ff161590565b60008281526005602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b600061208082612582565b80519091506000906001600160a01b0316336001600160a01b031614806120ae575081516120ae90336105d0565b806120c95750336120be84610771565b6001600160a01b0316145b9050806120e957604051632ce44b5f60e11b815260040160405180910390fd5b846001600160a01b031682600001516001600160a01b03161461211e5760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03841661214557604051633a954ecd60e21b815260040160405180910390fd5b6121556000848460000151612019565b6001600160a01b03858116600090815260046020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600390945282852080546001600160e01b031916909417600160a01b429092169190910217909255908601808352912054909116612247576000546001600160801b031681101561224757825160008281526003602090815260409091208054918601516001600160401b0316600160a01b026001600160e01b03199092166001600160a01b03909316929092171790555b5082846001600160a01b0316866001600160a01b03166000805160206138f483398151915260405160405180910390a45b5050505050565b60007f000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f16001600160a01b0316634000aea07f0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0848660006040516020016122ef929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161231c939291906135bf565b602060405180830381600087803b15801561233657600080fd5b505af115801561234a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236e9190613222565b50600083815260086020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a0909101909252815191830191909120938790529190526123ca906001613731565b60008581526008602052604090205561240a8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b949350505050565b6000546001600160801b03166001600160a01b03851661244457604051622e076360e81b815260040160405180910390fd5b836124625760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260046020908152604080832080546001600160801b031981166001600160401b038083168c018116918217600160401b6001600160401b031990941690921783900481168c018116909202179091558584526003909252822080546001600160e01b031916909317600160a01b42909216919091021790915581905b8581101561255c5760405182906001600160a01b038916906000906000805160206138f4833981519152908290a483801561253257506125306000888488612cb2565b155b15612550576040516368d2bf6b60e11b815260040160405180910390fd5b600191820191016124ed565b50600080546001600160801b0319166001600160801b0392909216919091179055612278565b60408051606081018252600080825260208201819052918101829052905482906001600160801b031681101561268b57600081815260036020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906126895780516001600160a01b031615612620579392505050565b5060001901600081815260036020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215612684579392505050565b612620565b505b604051636f96cda160e11b815260040160405180910390fd5b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601a80546000918261270783613833565b919050559050600d54811061274e5760405162461bcd60e51b815260206004820152600d60248201526c15dc9bdb99c81d1bdad95b9259609a1b6044820152606401610979565b60006127a46040518060400160405280600681526020016533b2b73232b960d11b8152508460016040516020016127869291906136c9565b6040516020818303038152906040528051906020012060001c612dc0565b905060006127dc6040518060400160405280600481526020016339b5b4b760e11b8152508560026040516020016127869291906136c9565b90506000612814604051806040016040528060048152602001633430b4b960e11b8152508660036040516020016127869291906136c9565b9050600061284f60405180604001604052806007815260200166636c6f7468657360c81b8152508760046040516020016127869291906136c9565b90506000612886604051806040016040528060038152602001621a185d60ea1b8152508860046040516020016127869291906136c9565b905060006128bf604051806040016040528060058152602001640dadeeae8d60db1b8152508960066040516020016127869291906136c9565b905060006128f7604051806040016040528060048152602001636579657360e01b8152508a60076040516020016127869291906136c9565b90506000878787878787876040516020016129189796959493929190613650565b60408051601f1981840301815291815281516020928301206000818152601890935291205490915060ff16612ca55760136040516129559061354c565b90815260200160405180910390208861ffff16815481106129785761297861388e565b6000918252602082200180549161298e836137bf565b919050555060136040516129a1906134f9565b90815260200160405180910390208761ffff16815481106129c4576129c461388e565b600091825260208220018054916129da836137bf565b919050555060136040516129ed9061353c565b90815260200160405180910390208661ffff1681548110612a1057612a1061388e565b60009182526020822001805491612a26836137bf565b91905055506013604051612a3990613529565b90815260200160405180910390208561ffff1681548110612a5c57612a5c61388e565b60009182526020822001805491612a72836137bf565b91905055506013604051612a859061351a565b90815260200160405180910390208461ffff1681548110612aa857612aa861388e565b60009182526020822001805491612abe836137bf565b91905055506013604051612ad190613509565b90815260200160405180910390208361ffff1681548110612af457612af461388e565b60009182526020822001805491612b0a836137bf565b91905055506013604051612b1d9061355e565b90815260200160405180910390208261ffff1681548110612b4057612b4061388e565b60009182526020822001805491612b56836137bf565b909155505060009081526018602090815260408083208054600160ff199091161790558051610100810182526001600160801b038c8116825261ffff9b8c168285019081529a8c16828401908152998c1660608301908152988c1660808301908152978c1660a08301908152968c1660c08301908152958c1660e083019081529c855260199093529220915182549851975196519551945193519a5191166001600160901b031990981697909717600160801b968916969096029590951763ffffffff60901b1916600160901b9488169490940261ffff60a01b191693909317600160a01b928716929092029190911763ffffffff60b01b1916600160b01b9186169190910261ffff60c01b191617600160c01b918516919091021763ffffffff60d01b1916600160d01b9484169490940261ffff60e01b191693909317600160e01b91909216021790555050565b505050505050505061274e565b60006001600160a01b0384163b15612db557604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612cf6903390899088908890600401613582565b602060405180830381600087803b158015612d1057600080fd5b505af1925050508015612d40575060408051601f3d908101601f19168201909252612d3d91810190613297565b60015b612d9b573d808015612d6e576040519150601f19603f3d011682016040523d82523d6000602084013e612d73565b606091505b508051612d93576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061240a565b506001949350505050565b600080601384604051612dd391906134dd565b9081526040805191829003602090810183208054808302850183019093528284529190830182828015612e2557602002820191906000526020600020905b815481526020019060010190808311612e11575b505050505090506000805b8251811015612e7257828181518110612e4b57612e4b61388e565b602002602001015182612e5e9190613731565b915080612e6a81613833565b915050612e30565b50612e7d818561384e565b935060005b82518161ffff161015612ee4576000838261ffff1681518110612ea757612ea761388e565b6020026020010151905080861015612ec45750925061066e915050565b612ece818761377c565b9550508080612edc90613811565b915050612e82565b5060405162461bcd60e51b81526020600482015260126024820152714e6f2074726169742072656d61696e696e6760701b6044820152606401610979565b828054612f2e906137d6565b90600052602060002090601f016020900481019282612f505760008555612f96565b82601f10612f695782800160ff19823516178555612f96565b82800160010185558215612f96579182015b82811115612f96578235825591602001919060010190612f7b565b50612fa2929150612fa6565b5090565b5b80821115612fa25760008155600101612fa7565b6000612fce612fc98461370a565b6136da565b9050828152838383011115612fe257600080fd5b828260208301376000602084830101529392505050565b805161ffff8116811461300b57600080fd5b919050565b60006020828403121561302257600080fd5b8135611588816138ba565b60006020828403121561303f57600080fd5b8151611588816138ba565b6000806040838503121561305d57600080fd5b8235613068816138ba565b91506020830135613078816138ba565b809150509250929050565b60008060006060848603121561309857600080fd5b83356130a3816138ba565b925060208401356130b3816138ba565b929592945050506040919091013590565b600080600080608085870312156130da57600080fd5b84356130e5816138ba565b935060208501356130f5816138ba565b92506040850135915060608501356001600160401b0381111561311757600080fd5b8501601f8101871361312857600080fd5b61313787823560208401612fbb565b91505092959194509250565b6000806040838503121561315657600080fd5b8235613161816138ba565b91506020830135613078816138cf565b6000806040838503121561318457600080fd5b823561318f816138ba565b946020939093013593505050565b6000806000604084860312156131b257600080fd5b83356001600160401b03808211156131c957600080fd5b818601915086601f8301126131dd57600080fd5b8135818111156131ec57600080fd5b8760208260051b850101111561320157600080fd5b60209283019550935050840135613217816138cf565b809150509250925092565b60006020828403121561323457600080fd5b8151611588816138cf565b60006020828403121561325157600080fd5b5035919050565b6000806040838503121561326b57600080fd5b50508035926020909101359150565b60006020828403121561328c57600080fd5b8135611588816138dd565b6000602082840312156132a957600080fd5b8151611588816138dd565b600080602083850312156132c757600080fd5b82356001600160401b03808211156132de57600080fd5b818501915085601f8301126132f257600080fd5b81358181111561330157600080fd5b86602082850101111561331357600080fd5b60209290920196919550909350505050565b60006020828403121561333757600080fd5b81516001600160401b0381111561334d57600080fd5b8201601f8101841361335e57600080fd5b805161336c612fc98261370a565b81815285602083850101111561338157600080fd5b613392826020830160208601613793565b95945050505050565b600080604083850312156133ae57600080fd5b82356001600160401b038111156133c457600080fd5b8301601f810185136133d557600080fd5b6133e485823560208401612fbb565b95602094909401359450505050565b600080600080600080600080610100898b03121561341057600080fd5b88516001600160801b038116811461342757600080fd5b975061343560208a01612ff9565b965061344360408a01612ff9565b955061345160608a01612ff9565b945061345f60808a01612ff9565b935061346d60a08a01612ff9565b925061347b60c08a01612ff9565b915061348960e08a01612ff9565b90509295985092959890939650565b6000602082840312156134aa57600080fd5b5051919050565b600081518084526134c9816020860160208601613793565b601f01601f19169290920160200192915050565b600082516134ef818460208701613793565b9190910192915050565b6339b5b4b760e11b815260040190565b640dadeeae8d60db1b815260050190565b621a185d60ea1b815260030190565b66636c6f7468657360c81b815260070190565b633430b4b960e11b815260040190565b6533b2b73232b960d11b815260060190565b636579657360e01b815260040190565b6001600160a01b0391909116815260200190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906135b5908301846134b1565b9695505050505050565b60018060a01b038416815282602082015260606040820152600061339260608301846134b1565b60208152600061158860208301846134b1565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526008908201526714dbdb19081bdd5d60c21b604082015260600190565b61ffff978816815295871660208701529386166040860152918516606085015284166080840152831660a083015290911660c082015260e00190565b828152610100810160208083018460005b60078110156136be57815161ffff168352918301919083019060010161369d565b505050509392505050565b91825260ff16602082015260400190565b604051601f8201601f191681016001600160401b0381118282101715613702576137026138a4565b604052919050565b60006001600160401b03821115613723576137236138a4565b50601f01601f191660200190565b6000821982111561374457613744613862565b500190565b60008261375857613758613878565b500490565b600081600019048311821515161561377757613777613862565b500290565b60008282101561378e5761378e613862565b500390565b60005b838110156137ae578181015183820152602001613796565b838111156117565750506000910152565b6000816137ce576137ce613862565b506000190190565b600181811c908216806137ea57607f821691505b6020821081141561380b57634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff8083168181141561382957613829613862565b6001019392505050565b600060001982141561384757613847613862565b5060010190565b60008261385d5761385d613878565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c3e57600080fd5b8015158114610c3e57600080fd5b6001600160e01b031981168114610c3e57600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220f64a16914bbfa4f7882df67961da914d70fa8430b661dce9ef338d522d310eb364736f6c63430008070033

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

0000000000000000000000001aa75e1254868e6663bb7a2792c0c23c340e38d60000000000000000000000005aede623dc9cf1e22edc0e568c95a5815dbd16d400000000000000000000000072c5f207a6e56f1959c91d1826c9aa3e8fdcf4660000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da00000000000000000000000000000000000000000000000000005af3107a4000

-----Decoded View---------------
Arg [0] : _corn (address): 0x1Aa75e1254868e6663BB7A2792c0C23c340e38d6
Arg [1] : _metadata (address): 0x5AEDe623Dc9Cf1e22eDc0e568C95A5815dbd16d4
Arg [2] : _previousContract (address): 0x72C5F207a6e56f1959c91d1826C9aa3E8fdcF466
Arg [3] : _vrf (address): 0x3d2341ADb2D31f1c5530cDC622016af293177AE0
Arg [4] : _link (address): 0xb0897686c545045aFc77CF20eC7A532E3120E0F1
Arg [5] : _keyHash (bytes32): 0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [6] : _fee (uint256): 100000000000000

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000001aa75e1254868e6663bb7a2792c0c23c340e38d6
Arg [1] : 0000000000000000000000005aede623dc9cf1e22edc0e568c95a5815dbd16d4
Arg [2] : 00000000000000000000000072c5f207a6e56f1959c91d1826c9aa3e8fdcf466
Arg [3] : 0000000000000000000000003d2341adb2d31f1c5530cdc622016af293177ae0
Arg [4] : 000000000000000000000000b0897686c545045afc77cf20ec7a532e3120e0f1
Arg [5] : f86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da
Arg [6] : 00000000000000000000000000000000000000000000000000005af3107a4000


Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.