Contract 0x7c09194d33686e9b4dda51a5221340f484919446 2

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xb9565f29bd8937304cd1e0571d780fbef7b550899a0c057553419aebd4d8b205Upgrade Mike300005132022-06-26 0:47:496 days 1 hr ago0x8a5e7a2467dcc8003bdb3f6318497b4de194a67d IN  Matic Mike: MIKE Token0 MATIC0.005781141655 34.088126088
0xfa1130e3532a6eabe3457de471ffa3cac3bef3617fdd01a9a152d2a7fa0038d0Upgrade Mike300004932022-06-26 0:47:056 days 1 hr ago0x8a5e7a2467dcc8003bdb3f6318497b4de194a67d IN  Matic Mike: MIKE Token0 MATIC0.00595993985 35.142398025
0xc61ff4224884abaa12c55367963eab0e09f0d4cb6f11d0b15f340bf69205bd3fExecute Meta Tra...298745852022-06-22 17:04:499 days 9 hrs ago0x3ce07ad298ee2b3aabea8c8b3f496c3acc51e647 IN  Matic Mike: MIKE Token0 MATIC0.007208769460.2
0x4e975a65a2c7036ece033771a90a9e69f653843a2a6ea681da0e24a860114e80Set Approval For...298352572022-06-21 16:49:2710 days 9 hrs ago0xeb9089f029d5cee7941d90d9bbb5018c2645caaf IN  Matic Mike: MIKE Token0 MATIC0.000887234677 33.194952021
0xbdead9c45a30f4fd82f25ab9e73c633bdc5ae5b8a7c3ade97433845ccbeaa64cUpgrade Mike298059472022-06-20 22:35:1011 days 3 hrs ago0xcd982d2ed8d2ef9a801ff6aecdec9ab081896145 IN  Matic Mike: MIKE Token0 MATIC0.00509963673530.069676615
0x6af005d77cccad46b21ec5103b4f81044cb705521b18b9b53c2e69552a6a3220Upgrade Mike298059162022-06-20 22:34:0811 days 3 hrs ago0xcd982d2ed8d2ef9a801ff6aecdec9ab081896145 IN  Matic Mike: MIKE Token0 MATIC0.00509963842330.069686569
0x2aee896add3099519125cf1ed17aabba0d5244bff07a98e919d4f5bd6e66fcb4Execute Meta Tra...297443482022-06-19 6:53:5012 days 19 hrs ago0x3ce07ad298ee2b3aabea8c8b3f496c3acc51e647 IN  Matic Mike: MIKE Token0 MATIC0.0069328428104.2
0xfcabd92a617062ff450cb639cadc6e755302c73ca84bbb18386a36b6a197b750Set Approval For...297361652022-06-19 1:57:3113 days 25 mins ago0x8d97794029930ae1ec82b44e1f368801bbb2d03a IN  Matic Mike: MIKE Token0 MATIC0.001447333097 31.039999521
0xb2f7cd4b7463cfba47eba898b9e87fa0ebbc7f02fded70012ec394fcb82f831eUpgrade Mike297343272022-06-19 0:52:1113 days 1 hr ago0x8a5e7a2467dcc8003bdb3f6318497b4de194a67d IN  Matic Mike: MIKE Token0 MATIC0.005817320177 34.301450388
0x8bae843bd5f6c4ae54c9145c623793390171d2ef82a21789bce1e0977e5f00b1Set Approval For...296713742022-06-17 9:21:3014 days 17 hrs ago0xb7db6634ffbf3af457d88c72f609433297cb1487 IN  Matic Mike: MIKE Token0 MATIC0.00144733312 31.04
0xef6c2b5ab783d22d772c3ba4ee9ccb581164ba16b9e2b6b1da196039e59d7e3aSafe Transfer Fr...296659742022-06-17 6:09:1314 days 20 hrs ago0x6e4d602cc4893e1fa9fb1bc702e9a2c37522fcc4 IN  Matic Mike: MIKE Token0 MATIC0.002606677533 30.069993578
0x30d52f36094566a9175dbaf657d1a630c0f0d4f672a8d017191ec015a69b8442Execute Meta Tra...296415102022-06-16 15:20:1515 days 11 hrs ago0x3ce07ad298ee2b3aabea8c8b3f496c3acc51e647 IN  Matic Mike: MIKE Token0 MATIC0.0225910992206.4
0x56af118bb53ce770859dda541b7e078330a5ffc1582e17a987209ff02c90d5baExecute Meta Tra...296415002022-06-16 15:19:5515 days 11 hrs ago0x3ce07ad298ee2b3aabea8c8b3f496c3acc51e647 IN  Matic Mike: MIKE Token0 MATIC0.0547265500
0x8d74a11d346b39ad4fe56788e78cc5f85b6979a8c7cf1901f770adaa1f81484dExecute Meta Tra...295996622022-06-15 13:42:4616 days 12 hrs ago0x3ce07ad298ee2b3aabea8c8b3f496c3acc51e647 IN  Matic Mike: MIKE Token0 MATIC0.0260231664311.2
0x692ad0a40a7ca63986e50d8493b6f5ebcf46336ffeb23faf4ba1b42a241d6268Set Approval For...295958202022-06-15 11:16:2016 days 15 hrs ago0xf61b87f3d93e7d6fbab06d8eb0844b223045665e IN  Matic Mike: MIKE Token0 MATIC0.001742100233 37.361676114
0x4aab2a35cec55d2771b78baad97fcafa631592c2b6986f73ff4ab708ab0f1893Upgrade Mike295315662022-06-13 21:26:2818 days 4 hrs ago0xbc3c3ea5a547b579ebd14e24b4b14fdb44c08a8b IN  Matic Mike: MIKE Token0 MATIC0.005087942448 30.000722007
0x461ef52f45c2775256ac68edef674a3a8c120d5828d28864c5f37f353e8837d0Upgrade Mike295314222022-06-13 21:21:3218 days 5 hrs ago0xbc3c3ea5a547b579ebd14e24b4b14fdb44c08a8b IN  Matic Mike: MIKE Token0 MATIC0.005090515901 30.015896208
0x52e78adb4319ea62c306d4f0f3fae06a2de33b4d598a44a760c26113fb87a834Execute Meta Tra...295303252022-06-13 20:43:4918 days 5 hrs ago0x3ce07ad298ee2b3aabea8c8b3f496c3acc51e647 IN  Matic Mike: MIKE Token0 MATIC0.0087146628104.2
0x2839a1510ee3db0da8dd030241b525b207f5c8f6c74f4a1797d9387021b5f16eExecute Meta Tra...294674862022-06-12 7:04:0219 days 19 hrs ago0x3ce07ad298ee2b3aabea8c8b3f496c3acc51e647 IN  Matic Mike: MIKE Token0 MATIC0.010468488684.6
0x144d4c879d2b0552be40b19b8bf9294c2c666e241bef67a87c5c8255bdc5f87fUpgrade Mike293833352022-06-10 5:20:1421 days 21 hrs ago0x8a5e7a2467dcc8003bdb3f6318497b4de194a67d IN  Matic Mike: MIKE Token0 MATIC0.006255183 36.883280071
0xf2ba7960a1af818bde483d30710c09fc6e28189b46d1a9bf4e4abca294671557Upgrade Mike293830242022-06-10 5:08:1221 days 21 hrs ago0x8a5e7a2467dcc8003bdb3f6318497b4de194a67d IN  Matic Mike: MIKE Token0 MATIC0.005382109816 31.73526078
0x9679aeabc81f4133c2bf8f242787d2776983b1703cde22b330d5df453084d3f0Upgrade Mike293829992022-06-10 5:07:2221 days 21 hrs ago0x8a5e7a2467dcc8003bdb3f6318497b4de194a67d IN  Matic Mike: MIKE Token0 MATIC0.006067516114 35.776714473
0x4339770d76d7b2b1b08ee6bf0bae2d5cd8ab2b726eeeb3d8c1487b4fffa4ecf9Upgrade Mike293829752022-06-10 5:06:3021 days 21 hrs ago0x8a5e7a2467dcc8003bdb3f6318497b4de194a67d IN  Matic Mike: MIKE Token0 MATIC0.005932321777 34.97954985
0x558880f61c2368cb0930a15c9aae4755eb40c627d71c57bd5ad264388c4fb6e6Upgrade Mike292382122022-06-06 14:04:5125 days 12 hrs ago0x4a47096e0ddd4eed05ef00f0f081bc7700c6dd75 IN  Matic Mike: MIKE Token0 MATIC0.005087820016 30.000000096
0xfc520a0deb91f116faab1919739230f4933ee3888400b5d243a041fb5435f07dUpgrade Mike292382102022-06-06 14:04:4725 days 12 hrs ago0x4a47096e0ddd4eed05ef00f0f081bc7700c6dd75 IN  Matic Mike: MIKE Token0 MATIC0.005473285123 32.272870054
[ Download CSV Export 

OVERVIEW

Matic Mike is on-chain-generated metadata and graphics NFT with a unique ERC20 -> ERC721 token injection method that allows metadata to change, all on-chain. Matic Mike uses a separate data contract to pull metadata, power levels, and additional traits.

Latest 1 internal transaction
Parent Txn Hash Block From To Value
0xe60692c8613acada3f1727c38de060c7bafd5f1d8b6f77d94001d2a8b10d487f204891502021-10-22 13:43:40252 days 12 hrs ago Matic Mike: MIKE TokenMatic Mike: Deployer3,250 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MaticMike

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 919 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 25 : MaticMike.sol
// contracts/MaticMike.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./bridge/MaticMint.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IHgh.sol";
import "./IMikeData.sol";
import "./MaticMikeLibrary.sol";

contract MaticMike is 
    ERC721Enumerable, 
    VRFConsumerBase, 
    IChildToken,
    AccessControlMixin,
    NativeMetaTransaction,
    ContextMixin,
    Ownable  {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;

    bytes32 public constant DEPOSITOR_ROLE = keccak256("DEPOSITOR_ROLE");
    mapping (uint256 => bool) public withdrawnTokens;

    // limit batching of tokens due to gas limit restrictions
    uint256 public constant BATCH_LIMIT = 20;

    event WithdrawnBatch(address indexed user, uint256[] tokenIds);
    event TransferWithMetadata(address indexed from, address indexed to, uint256 indexed tokenId, bytes metaData);
/*
    Matic Mike is a unique fully decentralized NFT built on Polygon.

    Unique features include 
    - Upgrading your NFT all on-chain, possibly increasing your NFTs rarity.
    - We call this NFT Token Injection - Using an ERC20 to Inject Power into your NFT
    - PvE Features - Battling another contract to add undiscovered traits during initial mint.
    - Burn Rerolls and Staking Functionality - custom HGH token accompanying this contract.
    - PvP Features - An additional contract is being launched for wagering  and battling.
    - Power Levels - NFT traits include a power level association, which is used in the random
    number generation for PvE and PvP features. Higher power levels slightly increase outcome.
    - 100% on chain metadata and image generation, wagering, battling, and future functionality.
    - Launched on Polygon Network for gas costs associated with staking, minting, upgrading, PvP, 
    PvE and burn rerolls.
    - Chainlink VRF integration for upgrading for true verified random number generation
    - Multi-Contract design for on chain Data generation through multiple sources of contracts

    Portions of this contract for creating a metadata hash for initial trait setup
    are partially recycled from Anonymice. The code has been studied to be
    fully understood and expanded upon, and we have been transparent
    with Mouse Dev about using portions of his contract to build off of.

    Be sure to support us as well as other developers trying to 
    push the envelope and expand utility in blockchain as this is the 
    start of something much bigger than just a game.
*/

    using MaticMikeLibrary for uint8;

    // Mappings
    mapping(string => bool) hashToMinted;
    mapping(uint256 => string) internal tokenIdToHash;
    

    // Minting Maps
    mapping(address => uint256) purchased;
    mapping(address => bool) whitelist;

    // VRF and Staking Maps
    mapping(bytes32 => uint256) private requestIdToToken;
    
    // Booleans
    bool public active = false;
    bool public whitelistActive = false;
    bool public burnRerollActive = false;
    bool public donationActive = false;

    //uint256
    uint256 UPGRADE_CHANCE = 9349;
    uint256 UPGRADE_COST = 1000000000000000000;
    uint256 SEED_NONCE = 0;
    uint256 private fee;

    //uint8
    uint8 MAX_PER_WALLET = 10;

    // bytes32
    bytes32 private keyHash;

    //uint arrays
    uint16[][8] TIERS;

    //address
    address hghAddress;
    address iDataAddress;

    address _owner;
    address nullAddress = 0x0000000000000000000000000000000000000000;

    // Mainnet LINK
    // TOKEN        0xb0897686c545045aFc77CF20eC7A532E3120E0F1
    // Coordinator  0x3d2341ADb2D31f1c5530cDC622016af293177AE0
    // Key Hash     0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da

    // Mainnet PoS Bridge
    // Depositor 0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa

    constructor() 
        VRFConsumerBase(0x3d2341ADb2D31f1c5530cDC622016af293177AE0, 0xb0897686c545045aFc77CF20eC7A532E3120E0F1)
        ERC721("Matic Mike", "MIKE")
    {
        _owner = msg.sender;
        _setupContractId("MikeMintableERC721");
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());

        _setupRole(DEPOSITOR_ROLE, 0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa);
        _initializeEIP712("Matic Mike");

        // Chainlink Info
        keyHash = 0xf86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da;
        fee = 0.0001 * 10 ** 18; // 0.0001 LINK

        // Clothing
        TIERS[0] = [25, 75, 1000, 1400, 1500, 1750, 1750, 2500];
        // Eyes
        TIERS[1] = [50, 150, 750, 1250, 1350, 1450, 1666, 1666, 1668];
        // Hair
        TIERS[2] = [200, 250, 300, 500, 1050, 1925, 1925, 1925, 1925];
        // Mouth
        TIERS[3] = [200, 300, 1000, 1000, 2000, 2750, 2750];
        // Tattoos
        TIERS[4] = [150, 350, 500, 1500, 1500, 2500, 3500]; 
        // Earrings
        TIERS[5] = [50, 50, 100, 400, 450, 500, 700, 1800, 2000, 3500];
        // Nipple Rings
        TIERS[6] = [300, 800, 900, 1000, 1100, 5900];
        // Body
        TIERS[7] = [50, 100, 500, 1220, 1870, 1870, 1870, 2520];
    }

    /* POLYGON POS BRIDGE TO ALLOW TRANSFER OF TOKENS TO ETHEREUM MAINNET */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, AccessControl) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    function _msgSender()
        internal
        override
        view
        returns (address sender)
    {
        return ContextMixin.msgSender();
    }

    /**
     * @notice called when token is deposited on root chain
     * @dev Should be callable only by ChildChainManager
     * Should handle deposit by minting the required tokenId(s) for user
     * Should set `withdrawnTokens` mapping to `false` for the tokenId being deposited
     * Minting can also be done by other functions
     * @param user user address for whom deposit is being done
     * @param depositData abi encoded tokenIds. Batch deposit also supported.
     */
    function deposit(address user, bytes calldata depositData)
        external
        override
        only(DEPOSITOR_ROLE)
    {

        // deposit single
        if (depositData.length == 32) {
            uint256 tokenId = abi.decode(depositData, (uint256));
            withdrawnTokens[tokenId] = false;
            _mint(user, tokenId);

        // deposit batch
        } else {
            uint256[] memory tokenIds = abi.decode(depositData, (uint256[]));
            uint256 length = tokenIds.length;
            for (uint256 i; i < length; i++) {
                withdrawnTokens[tokenIds[i]] = false;
                _mint(user, tokenIds[i]);
            }
        }

    }

    /**
     * @notice called when user wants to withdraw token back to root chain
     * @dev Should handle withraw by burning user's token.
     * Should set `withdrawnTokens` mapping to `true` for the tokenId being withdrawn
     * This transaction will be verified when exiting on root chain
     * @param tokenId tokenId to withdraw
     */
    function withdraw(uint256 tokenId) external {
        require(_msgSender() == ownerOf(tokenId), "ChildMintableERC721: INVALID_TOKEN_OWNER");
        withdrawnTokens[tokenId] = true;
        _burn(tokenId);
    }

    /**
     * @notice called when user wants to withdraw multiple tokens back to root chain
     * @dev Should burn user's tokens. This transaction will be verified when exiting on root chain
     * @param tokenIds tokenId list to withdraw
     */
    function withdrawBatch(uint256[] calldata tokenIds) external {

        uint256 length = tokenIds.length;
        require(length <= BATCH_LIMIT, "ChildMintableERC721: EXCEEDS_BATCH_LIMIT");

        // Iteratively burn ERC721 tokens, for performing
        // batch withdraw
        for (uint256 i; i < length; i++) {

            uint256 tokenId = tokenIds[i];

            require(_msgSender() == ownerOf(tokenId), string(abi.encodePacked("ChildMintableERC721: INVALID_TOKEN_OWNER ", tokenId)));
            withdrawnTokens[tokenId] = true;
            _burn(tokenId);

        }

        // At last emit this event, which will be used
        // in MintableERC721 predicate contract on L1
        // while verifying burn proof
        emit WithdrawnBatch(_msgSender(), tokenIds);

    }

    /**
     * @notice called when user wants to withdraw token back to root chain with token URI
     * @dev Should handle withraw by burning user's token.
     * Should set `withdrawnTokens` mapping to `true` for the tokenId being withdrawn
     * This transaction will be verified when exiting on root chain
     *
     * @param tokenId tokenId to withdraw
     */
    function withdrawWithMetadata(uint256 tokenId) external {

        require(_msgSender() == ownerOf(tokenId), "ChildMintableERC721: INVALID_TOKEN_OWNER");
        withdrawnTokens[tokenId] = true;

        // Encoding metadata associated with tokenId & emitting event
        emit TransferWithMetadata(ownerOf(tokenId), address(0), tokenId, this.encodeTokenMetadata(tokenId));

        _burn(tokenId);

    }

    /**
     * @dev This method is supposed to be called by client when withdrawing token with metadata
     * and pass return value of this function as second paramter of `withdrawWithMetadata` method
     * @param tokenId Token for which URI to be fetched
     */
    function encodeTokenMetadata(uint256 tokenId) external view virtual returns (bytes memory) {
        // Ethereum chain will pull MetaData live from Polygon
        return abi.encode(""); 
    }

    /**
     * @notice Example function to handle minting tokens on matic chain
     * @dev Minting can be done as per requirement,
     * This implementation allows only admin to mint tokens but it can be changed as per requirement
     * Should verify if token is withdrawn by checking `withdrawnTokens` mapping
     * @param user user for whom tokens are being minted
     * @param tokenId tokenId to mint
     */
    function mint(address user, uint256 tokenId) public only(DEFAULT_ADMIN_ROLE) {
        require(!withdrawnTokens[tokenId], "ChildMintableERC721: TOKEN_EXISTS_ON_ROOT_CHAIN");
        _mint(user, tokenId);
    }

    /* END POLYGON POS FUNCTIONS */

    /*

    Owner functions

    */

    /**
    * @dev Whitelist activation for a short time before sales activation
    */
    function activateWhitelist() public onlyOwner {
        whitelistActive = true;
        active = false;
    }

    /**
    * @dev Add to Whitelist
    */
    function addToWhitelist(address[] memory _whitelist) public onlyOwner {
        for(uint256 i=0; i<_whitelist.length; i++){
            whitelist[_whitelist[i]] = true;
        }
    }

    /**
    * @dev Sales activation setter. If any issues occur can flip it off.
    * @param val is true or false
    */
    function activateSale(bool val) public onlyOwner {
        whitelistActive = false;
        active = val;
    }

    /**
    * @dev Contract addresses set here. Interface will be the major contract added for dynamic integration in future.
    * @param _address is the address of the Contracts
    */

    function setHghAddress(address _address) public onlyOwner{
        hghAddress = _address;
    }

    function setIDataAddress(address _address) public onlyOwner{
        iDataAddress = _address;
    }

    /**
    * @dev Burn reroll activation
    * @param _roll is true or false
    * @param _donation is true or false
    */
    function activateRollAndDonation(bool _roll, bool _donation) public onlyOwner {
        burnRerollActive = _roll;
        donationActive = _donation;
    }

    /**
    * @dev Set upgrade cost if it's too low or high
    * @param amount is value in wei
    */
    function setUpgradeCost(uint256 amount) public onlyOwner {
        UPGRADE_COST = amount;
    }

    /*

    Minting, upgrades, and other public functions

    */

    /**
    * @dev public upgrade function that calls burns HGH and calls chainlink VRF
    * @param _tokenId is the NFT ID Number to be upgraded if successful.
    */
    function upgradeMike(uint256 _tokenId) public returns (bytes32){
        require(ownerOf(_tokenId) == msg.sender, "Sender not owner of supplied token");
        require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK.");
        //burn current HGH cost for upgrade
        IHgh(hghAddress).burnFrom(msg.sender, UPGRADE_COST);
        
        bytes32 requestId = requestRandomness(keyHash, fee);
        requestIdToToken[requestId] = _tokenId;

        return requestId;
    }


    /*

    Internal Functions

    */

    /**
    * @dev Fulfills chainlink VRF. Upgrade Attempt.
    * @param requestId is the chainlink request id
    * @param randomness is the uint256 random number we will work off of.
    */
    function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
        // set to 0 for now for testing
        require((randomness % 10000) >= UPGRADE_CHANCE, "Bad roll, upgrade attempt failed");

        uint256 _traitRoll = (randomness % 8) + 1;

        string memory tokenHash = _tokenIdToHash(requestIdToToken[requestId]);

        uint8 thisTraitIndex = MaticMikeLibrary.parseInt(
            MaticMikeLibrary.substring(tokenHash, _traitRoll, _traitRoll + 1)
        );

        uint8 startIndex = 0;
        string memory newHash;

        if(thisTraitIndex > 0){
            if((randomness % thisTraitIndex) == 0 && thisTraitIndex > 1){
                startIndex = thisTraitIndex - 2;
            }
            else{
                startIndex = thisTraitIndex - 1;
            }
            

            while(true){
                // create new hash
                if(_traitRoll == 8){
                    newHash = string(abi.encodePacked(MaticMikeLibrary.substring(tokenHash, 0, 8), MaticMikeLibrary.toString(startIndex)));
                }
                else{
                    newHash = string(
                        abi.encodePacked(
                            MaticMikeLibrary.substring(tokenHash, 0, _traitRoll), 
                            MaticMikeLibrary.toString(startIndex), 
                            MaticMikeLibrary.substring(tokenHash, _traitRoll+1, 9)
                        )
                    );
                }

                // check if hash exists
                if (!hashToMinted[newHash]){
                    // successful mint. Update token hash and increase HGH cost to upgrade by 3
                    hashToMinted[tokenHash] = false;
                    tokenIdToHash[requestIdToToken[requestId]] = newHash;
                    hashToMinted[newHash] = true;
                    UPGRADE_COST = UPGRADE_COST + 3000000000000000000;
                    break;
                }
                else if(startIndex == 0){
                    // unsuccessful mint no mint
                    break;
                }
                else{
                    // continue to next tier of upgrade
                    startIndex--;
                }
            }
        }
    }

    /*

    Read Functions

    */

    /**
    * @dev Get whitelistActive
    */
    function isWhitelistActive() 
        public 
        view 
        returns (bool)
    {
        // interface to pull from MaticMikeData contract
        // pass in hash and tokenid
        return whitelistActive;
    }

    /**
    * @dev Get burnRerollActive
    * @param _address is to check if you're on whitelist.
    */
    function isOnWhitelist(address _address)
        public 
        view 
        returns (bool)
    {
        return whitelist[_address];
    }

    /**
    * @dev Get burnRerollActive
    */
    function isBurnRerollActive() 
        public 
        view 
        returns (bool)
    {
        // interface to pull from MaticMikeData contract
        // pass in hash and tokenid
        return burnRerollActive;
    }

    /**
    * @dev Get donationActive
    */
    function isDonationActive() 
        public 
        view 
        returns (bool)
    {
        // interface to pull from MaticMikeData contract
        // pass in hash and tokenid
        return donationActive;
    }

    /**
    * @dev Get upgrade cost
    */
    function getUpgradeCost() public view returns(uint256){
        return UPGRADE_COST;
    }

    /**
    * @dev Get total mints
    */
    function getTotalMints() public view returns(uint256){
        return _tokenIds.current();
    }

    /**
    * @dev Get Power Level by addition of trait power levels as well as external contracts
    * @param _tokenId token id of Matic Mike
    */
    function getPowerLevel(uint256 _tokenId) 
        public 
        view 
        returns (uint16)
    {
        // interface to pull from MaticMikeData contract
        // pass in hash and tokenid
        return IData(iDataAddress).getPowerLevel(tokenIdToHash[_tokenId], _tokenId);
    }

    /**
     * @dev Returns the SVG and metadata for a token Id for Ethereum Chain
     * @param _tokenId The tokenId to return the SVG and metadata for.
     */
    function getPosBridgeTokenURI(uint256 _tokenId)
        public
        view
        returns (string memory)
    {
        require(bytes(tokenIdToHash[_tokenId]).length != 0, "Token not minted");
        return
            string(
                abi.encodePacked(
                    "data:application/json;base64,",
                    MaticMikeLibrary.encode(
                        bytes(
                            string(
                                abi.encodePacked(
                                    '{"name": "Matic Mike #',
                                    MaticMikeLibrary.toString(_tokenId),
                                    '", "description": "This is the official Matic Mike Ethereum Bridge for the Matic Mike Club NFT on Polygon.", "image": "data:image/svg+xml;base64,',
                                    IData(iDataAddress).hashToSVG(tokenIdToHash[_tokenId], _tokenId),
                                    '","attributes":',
                                        IData(iDataAddress).hashToMetadata(tokenIdToHash[_tokenId], _tokenId),
                                    "}"
                                    )
                                )
                            )
                        )
                    )
                );
    }

    /**
     * @dev Returns the SVG and metadata for a token Id
     * @param _tokenId The tokenId to return the SVG and metadata for.
     */
    function tokenURI(uint256 _tokenId)
        public
        view
        override
        returns (string memory)
    {
        require(_exists(_tokenId));

        return
            string(
                abi.encodePacked(
                    "data:application/json;base64,",
                    MaticMikeLibrary.encode(
                        bytes(
                            string(
                                abi.encodePacked(
                                    '{"name": "Matic Mike #',
                                    MaticMikeLibrary.toString(_tokenId),
                                    '", "description": "Matic Mike is a collection of 10000 NFTs on the Polygon Chain with Ethereum Bridge. Fully on-chain.", "image": "data:image/svg+xml;base64,',
                                    IData(iDataAddress).hashToSVG(tokenIdToHash[_tokenId], _tokenId),
                                    '","attributes":',
                                        IData(iDataAddress).hashToMetadata(tokenIdToHash[_tokenId], _tokenId),
                                    "}"
                                    )
                                )
                            )
                        )
                    )
                );
    }

    /**
     * @dev Returns a hash for a given tokenId
     * @param _tokenId The tokenId to return the hash for.
     */
    function _tokenIdToHash(uint256 _tokenId)
        public
        view
        returns (string memory)
    {
        string memory tokenHash = tokenIdToHash[_tokenId];
        //If this is a burned token, override the previous hash
        if (ownerOf(_tokenId) == 0x000000000000000000000000000000000000dEaD) {
            tokenHash = string(
                abi.encodePacked(
                    "1",
                    MaticMikeLibrary.substring(tokenHash, 1, 9)
                )
            );
        }

        return tokenHash;
    }

    /**
     * @dev Returns the wallet of a given wallet. Mainly for ease for frontend devs.
     * @param _wallet The wallet to get the tokens of.
     */
    function walletOfOwner(address _wallet)
        public
        view
        returns (uint256[] memory)
    {
        uint256 tokenCount = balanceOf(_wallet);

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

    /*
    Mint Functions
    */

     /**
     * @dev Converts a digit from 0 - 10000 into its corresponding rarity based on the given rarity tier.
     *      PUTS power level (10000-rarity) into the power level for token id which will be used to calculate
     *      battles. 
     * @param _randinput The input from 0 - 10000 to use for rarity gen.
     * @param _rarityTier The tier to use.
     */
    function rarityGen(uint256 _randinput, uint8 _rarityTier)
        internal
        view
        returns (string memory)
    {
        uint16 currentLowerBound = 0;
        for (uint8 i = 0; i < TIERS[_rarityTier].length; i++) {
            uint16 thisPercentage = TIERS[_rarityTier][i];
            if (
                _randinput >= currentLowerBound &&
                _randinput < currentLowerBound + thisPercentage
            ) return i.toString();
            currentLowerBound = currentLowerBound + thisPercentage;
        }
        revert();
    }

    /**
     * @dev Generates a 9 digit hash from a tokenId, address, and random number.
     * @param _t The token id to be used within the hash.
     * @param _a The address to be used within the hash.
     * @param _c The custom nonce to be used within the hash.
     */
    function hash(
        uint256 _t,
        address _a,
        uint256 _c
    ) internal returns (string memory) {
        require(_c < 10);

        string memory currentHash = "0";

        for (uint8 i = 0; i < 8; i++) {
            SEED_NONCE++;
            uint16 _randinput = uint16(
                uint256(
                    keccak256(
                        abi.encodePacked(
                            block.timestamp,
                            block.difficulty,
                            _t,
                            _a,
                            _c,
                            SEED_NONCE
                        )
                    )
                ) % 10000
            );

            currentHash = string(
                abi.encodePacked(currentHash, rarityGen(_randinput, i))
            );
        }

        if (hashToMinted[currentHash]) return hash(_t, _a, _c + 1);

        return currentHash;
    }

    /**
     * @dev Returns the current HGH cost for minting
     */
    function currentHghCost() public view returns (uint256) {
        if (_tokenIds.current() >= 2500 && _tokenIds.current() <= 4000)
            return 1000000000000000000;
        if (_tokenIds.current() > 4000 && _tokenIds.current() <= 6000)
            return 2000000000000000000;
        if (_tokenIds.current() > 6000 && _tokenIds.current() <= 8000)
            return 3000000000000000000;
        if (_tokenIds.current() > 8000 && _tokenIds.current() <= 10000)
            return 4000000000000000000;

        revert();
    }

    /**
     * @dev Mint internal, can be used in donation mint and HGH mint
     */
    function mintInternal() internal {
        require(_tokenIds.current() < 10000);
        require(!MaticMikeLibrary.isContract(msg.sender));

        tokenIdToHash[_tokenIds.current()] = hash(_tokenIds.current(), msg.sender, 0);

        hashToMinted[tokenIdToHash[_tokenIds.current()]] = true;
        purchased[msg.sender] = purchased[msg.sender] + 1;
        
        _mint(msg.sender, _tokenIds.current());
        _tokenIds.increment();
    }

    /**
     * @dev Mints new tokens.
     */
    function mintMike() public {
        if (msg.sender != _owner) {
            require(active, "Sale is not active currently.");
            require(purchased[msg.sender] + 1 <= MAX_PER_WALLET, "Only 10 mints per wallet allowed");
        }
        
        require(_tokenIds.current() < 10000, "Total supply exceeded.");
        if (_tokenIds.current() < 2500) return mintInternal();

        IHgh(hghAddress).burnFrom(msg.sender, currentHghCost());

        return mintInternal();
    }

    /**
     * @dev Mints new tokens with 50 MATIC donation
     */
    function donationMint() public payable {
        if (msg.sender != _owner) {
            require(active, "Sale is not active currently.");
        }
        require(purchased[msg.sender] + 1 <= MAX_PER_WALLET, "Only 10 mints per wallet allowed");
        require(_tokenIds.current() < 10000, "Total supply exceeded.");
        require(donationActive, "Donation Mint not yet Active");

        require(50000000000000000000 == msg.value, "Insuffient amount sent.");

        return mintInternal();
    }

    /**
     * @dev 1 Mint per whitelist
     */
    function whitelistMint() public{
        require(whitelistActive, "Whitelist is not active currently.");
        require(_tokenIds.current() < 10000, "Total supply exceeded.");
        require(whitelist[msg.sender], "You are not on the whitelist");

        whitelist[msg.sender] = false;
        return mintInternal();
    }

    /**
     * @dev Burns and mints new.
     * @param _tokenId The token to burn.
     */
    function burnForMint(uint256 _tokenId) public {
        require(ownerOf(_tokenId) == msg.sender);
        require(burnRerollActive, "Burn rerolls not currently active");
        require(_tokenIds.current() < 10000, "No mints left.");

        //Burn token
        _transfer(
            msg.sender,
            0x000000000000000000000000000000000000dEaD,
            _tokenId
        );

        mintInternal();
    }

    /**
     * @dev Sends contract balance to owner
     */
    function withdrawAll() public payable onlyOwner {
        (bool success, ) = payable(msg.sender).call{
            value: address(this).balance
        }("");
        require(success, "Failed to send Ether");
    }
}

File 2 of 25 : MaticMint.sol
// contracts/bridge/MaticMint.sol
// SPDX-License-Identifier: MIT

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

pragma solidity ^0.8.0;

// File: contracts/common/AccessControlMixin.sol


contract AccessControlMixin is AccessControl {
    string private _revertMsg;
    function _setupContractId(string memory contractId) internal {
        _revertMsg = string(abi.encodePacked(contractId, ": INSUFFICIENT_PERMISSIONS"));
    }

    modifier only(bytes32 role) {
        require(
            hasRole(role, _msgSender()),
            _revertMsg
        );
        _;
    }
}

// File: contracts/child/ChildToken/IChildToken.sol

interface IChildToken {
    function deposit(address user, bytes calldata depositData) external;
}

// File: contracts/common/Initializable.sol

contract Initializable {
    bool inited = false;

    modifier initializer() {
        require(!inited, "already inited");
        _;
        inited = true;
    }
}

// File: contracts/common/EIP712Base.sol


contract EIP712Base is Initializable {
    struct EIP712Domain {
        string name;
        string version;
        address verifyingContract;
        bytes32 salt;
    }

    string constant public ERC712_VERSION = "1";

    bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256(
        bytes(
            "EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)"
        )
    );
    bytes32 internal domainSeperator;

    // supposed to be called once while initializing.
    // one of the contractsa that inherits this contract follows proxy pattern
    // so it is not possible to do this in a constructor
    function _initializeEIP712(
        string memory name
    )
        internal
        initializer
    {
        _setDomainSeperator(name);
    }

    function _setDomainSeperator(string memory name) internal {
        domainSeperator = keccak256(
            abi.encode(
                EIP712_DOMAIN_TYPEHASH,
                keccak256(bytes(name)),
                keccak256(bytes(ERC712_VERSION)),
                address(this),
                bytes32(getChainId())
            )
        );
    }

    function getDomainSeperator() public view returns (bytes32) {
        return domainSeperator;
    }

    function getChainId() public view returns (uint256) {
        uint256 id;
        assembly {
            id := chainid()
        }
        return id;
    }

    /**
     * Accept message hash and returns hash message in EIP712 compatible form
     * So that it can be used to recover signer from signature signed using EIP712 formatted data
     * https://eips.ethereum.org/EIPS/eip-712
     * "\\x19" makes the encoding deterministic
     * "\\x01" is the version byte to make it compatible to EIP-191
     */
    function toTypedMessageHash(bytes32 messageHash)
        internal
        view
        returns (bytes32)
    {
        return
            keccak256(
                abi.encodePacked("\x19\x01", getDomainSeperator(), messageHash)
            );
    }
}

// File: contracts/common/NativeMetaTransaction.sol

contract NativeMetaTransaction is EIP712Base {
    using SafeMath for uint256;
    bytes32 private constant META_TRANSACTION_TYPEHASH = keccak256(
        bytes(
            "MetaTransaction(uint256 nonce,address from,bytes functionSignature)"
        )
    );
    event MetaTransactionExecuted(
        address userAddress,
        address payable relayerAddress,
        bytes functionSignature
    );
    mapping(address => uint256) nonces;

    /*
     * Meta transaction structure.
     * No point of including value field here as if user is doing value transfer then he has the funds to pay for gas
     * He should call the desired function directly in that case.
     */
    struct MetaTransaction {
        uint256 nonce;
        address from;
        bytes functionSignature;
    }

    function executeMetaTransaction(
        address userAddress,
        bytes memory functionSignature,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) public payable returns (bytes memory) {
        MetaTransaction memory metaTx = MetaTransaction({
            nonce: nonces[userAddress],
            from: userAddress,
            functionSignature: functionSignature
        });

        require(
            verify(userAddress, metaTx, sigR, sigS, sigV),
            "Signer and signature do not match"
        );

        // increase nonce for user (to avoid re-use)
        nonces[userAddress] = nonces[userAddress].add(1);

        emit MetaTransactionExecuted(
            userAddress,
            payable(msg.sender),
            functionSignature
        );

        // Append userAddress and relayer address at the end to extract it from calling context
        (bool success, bytes memory returnData) = address(this).call(
            abi.encodePacked(functionSignature, userAddress)
        );
        require(success, "Function call not successful");

        return returnData;
    }

    function hashMetaTransaction(MetaTransaction memory metaTx)
        internal
        pure
        returns (bytes32)
    {
        return
            keccak256(
                abi.encode(
                    META_TRANSACTION_TYPEHASH,
                    metaTx.nonce,
                    metaTx.from,
                    keccak256(metaTx.functionSignature)
                )
            );
    }

    function getNonce(address user) public view returns (uint256 nonce) {
        nonce = nonces[user];
    }

    function verify(
        address signer,
        MetaTransaction memory metaTx,
        bytes32 sigR,
        bytes32 sigS,
        uint8 sigV
    ) internal view returns (bool) {
        require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER");
        return
            signer ==
            ecrecover(
                toTypedMessageHash(hashMetaTransaction(metaTx)),
                sigV,
                sigR,
                sigS
            );
    }
}

// File: contracts/common/ContextMixin.sol


abstract contract ContextMixin {
    function msgSender()
        internal
        view
        returns (address payable sender)
    {
        if (msg.sender == address(this)) {
            bytes memory array = msg.data;
            uint256 index = msg.data.length;
            assembly {
                // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
                sender := and(
                    mload(add(array, index)),
                    0xffffffffffffffffffffffffffffffffffffffff
                )
            }
        } else {
            sender = payable(msg.sender);
        }
        return sender;
    }
}

File 3 of 25 : MaticMikeLibrary.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library MaticMikeLibrary {

    // Originally Anonymice Library utilizing the same functions for encoding as well as generic toString/parseInt
    // We love anonymice.

    // Additional library will be added eventually for storing, drawing, and reading trait struct. This is to prevent
    // out of gas issues during the mapping of pixels to the grid.

    string internal constant TABLE =
        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    function encode(bytes memory data) internal pure returns (string memory) {
        if (data.length == 0) return "";

        // load the table into memory
        string memory table = TABLE;

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((data.length + 2) / 3);

        // add some extra buffer at the end required for the writing
        string memory result = new string(encodedLen + 32);

        assembly {
            // set the actual output length
            mstore(result, encodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 3 bytes at a time
            for {

            } lt(dataPtr, endPtr) {

            } {
                dataPtr := add(dataPtr, 3)

                // read 3 bytes
                let input := mload(dataPtr)

                // write 4 characters
                mstore(
                    resultPtr,
                    shl(248, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                )
                resultPtr := add(resultPtr, 1)
                mstore(
                    resultPtr,
                    shl(248, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                )
                resultPtr := add(resultPtr, 1)
                mstore(
                    resultPtr,
                    shl(248, mload(add(tablePtr, and(shr(6, input), 0x3F))))
                )
                resultPtr := add(resultPtr, 1)
                mstore(
                    resultPtr,
                    shl(248, mload(add(tablePtr, and(input, 0x3F))))
                )
                resultPtr := add(resultPtr, 1)
            }

            // padding with '='
            switch mod(mload(data), 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }
        }

        return result;
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        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);
    }

    function parseInt(string memory _a)
        internal
        pure
        returns (uint8 _parsedInt)
    {
        bytes memory bresult = bytes(_a);
        uint8 mint = 0;
        for (uint8 i = 0; i < bresult.length; i++) {
            if (
                (uint8(uint8(bresult[i])) >= 48) &&
                (uint8(uint8(bresult[i])) <= 57)
            ) {
                mint *= 10;
                mint += uint8(bresult[i]) - 48;
            }
        }
        return mint;
    }

    function substring(
        string memory str,
        uint256 startIndex,
        uint256 endIndex
    ) internal pure returns (string memory) {
        bytes memory strBytes = bytes(str);
        bytes memory result = new bytes(endIndex - startIndex);
        for (uint256 i = startIndex; i < endIndex; i++) {
            result[i - startIndex] = strBytes[i];
        }
        return string(result);
    }

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

File 4 of 25 : IMikeData.sol
// contracts/IHgh.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IData {
    function hashToMetadata(string memory _hash, uint256 _tokenId) external view returns (string memory);
    function hashToSVG(string memory _hash, uint256 _tokenId) external view returns (string memory);
    function getPowerLevel(string memory _hash, uint256 _tokenId) external view returns (uint16);
}

File 5 of 25 : IHgh.sol
// contracts/IHgh.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

interface IHgh is IERC20 {
    function burnFrom(address account, uint256 amount) external;
}

File 6 of 25 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 7 of 25 : 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 8 of 25 : 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 9 of 25 : 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 10 of 25 : Counters.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 11 of 25 : 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 12 of 25 : 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 13 of 25 : 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 14 of 25 : 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 15 of 25 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 16 of 25 : 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 17 of 25 : 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 18 of 25 : ERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        _transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

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

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

File 19 of 25 : 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 20 of 25 : 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 21 of 25 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 22 of 25 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

File 23 of 25 : 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 24 of 25 : 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 25 of 25 : 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": 919
  },
  "evmVersion": "london",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"userAddress","type":"address"},{"indexed":false,"internalType":"address payable","name":"relayerAddress","type":"address"},{"indexed":false,"internalType":"bytes","name":"functionSignature","type":"bytes"}],"name":"MetaTransactionExecuted","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"metaData","type":"bytes"}],"name":"TransferWithMetadata","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"WithdrawnBatch","type":"event"},{"inputs":[],"name":"BATCH_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEPOSITOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ERC712_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"_tokenIdToHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_roll","type":"bool"},{"internalType":"bool","name":"_donation","type":"bool"}],"name":"activateRollAndDonation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"val","type":"bool"}],"name":"activateSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"activateWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"active","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_whitelist","type":"address[]"}],"name":"addToWhitelist","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":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"burnForMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnRerollActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentHghCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bytes","name":"depositData","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"donationActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"donationMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"encodeTokenMetadata","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"bytes","name":"functionSignature","type":"bytes"},{"internalType":"bytes32","name":"sigR","type":"bytes32"},{"internalType":"bytes32","name":"sigS","type":"bytes32"},{"internalType":"uint8","name":"sigV","type":"uint8"}],"name":"executeMetaTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeperator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getPosBridgeTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getPowerLevel","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalMints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUpgradeCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBurnRerollActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isDonationActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isOnWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWhitelistActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintMike","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setHghAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setIDataAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setUpgradeCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"upgradeMike","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"withdrawBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawWithMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawnTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60c0604052600d805460ff199081169091556018805463ffffffff19169055612485601955670de0b6b3a7640000601a556000601b55601d8054909116600a179055602a80546001600160a01b03191690553480156200005e57600080fd5b50604080518082018252600a8152694d61746963204d696b6560b01b6020808301918252835180850190945260048452634d494b4560e01b908401528151733d2341adb2d31f1c5530cdc622016af293177ae09373b0897686c545045afc77cf20ec7a532e3120e0f193929091620000d991600091620007a2565b508051620000ef906001906020840190620007a2565b5050506001600160601b0319606092831b811660a052911b166080526200011f62000119620004e0565b620004fc565b602980546001600160a01b031916331790556040805180820190915260128152714d696b654d696e7461626c6545524337323160701b602082015262000165906200054e565b6200017b600062000175620004e0565b6200058b565b620001bb7f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a973a6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa6200058b565b60408051808201909152600a8152694d61746963204d696b6560b01b6020820152620001e79062000597565b7ff86195cf7690c55907b2b611ebb7343a6f649bff128701cc542f0569e2c549da601e55655af3107a4000601c55604080516101008101825260198152604b60208201526103e89181019190915261057860608201526105dc60808201526106d660a0820181905260c08201526109c460e08201526200026c90601f90600862000831565b50604080516101208101825260328152609660208201526102ee918101919091526104e2606082015261054660808201526105aa60a082015261068260c0820181905260e0820152610684610100820152601f6001620002d192910190600962000831565b50604080516101208101825260c8815260fa602082015261012c918101919091526101f4606082015261041a608082015261078560a0820181905260c0820181905260e082018190526101008201526200033090602190600962000831565b506040805160e08101825260c8815261012c60208201526103e891810182905260608101919091526107d06080820152610abe60a0820181905260c08201526200037f90602290600762000831565b506040805160e0810182526096815261015e60208201526101f4918101919091526105dc6060820181905260808201526109c460a0820152610dac60c0820152620003cf90602390600762000831565b5060408051610140810182526032808252602082015260649181019190915261019060608201526101c260808201526101f460a08201526102bc60c082015261070860e08201526107d0610100820152610dac6101208201526200043890602490600a62000831565b506040805160c08101825261012c81526103206020820152610384918101919091526103e8606082015261044c608082015261170c60a08201526200048290602590600662000831565b50604080516101008101825260328152606460208201526101f4918101919091526104c4606082015261074e6080820181905260a0820181905260c08201526109d860e0820152620004d990602690600862000831565b506200098e565b6000620004f7620005fb60201b6200323f1760201c565b905090565b601080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80604051602001620005619190620008ee565b604051602081830303815290604052600c908051906020019062000587929190620007a2565b5050565b6200058782826200065a565b600d5460ff1615620005e05760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481a5b9a5d195960921b604482015260640160405180910390fd5b620005eb8162000700565b50600d805460ff19166001179055565b6000333014156200065457600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150620006579050565b50335b90565b6000828152600b602090815260408083206001600160a01b038516845290915290205460ff1662000587576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620006bc620004e0565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6040518060800160405280604f815260200162006951604f9139805160209182012082519282019290922060408051808201825260018152603160f81b90840152805180840194909452838101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608401523060808401524660a0808501919091528151808503909101815260c090930190528151910120600e55565b828054620007b09062000951565b90600052602060002090601f016020900481019282620007d457600085556200081f565b82601f10620007ef57805160ff19168380011785556200081f565b828001600101855582156200081f579182015b828111156200081f57825182559160200191906001019062000802565b506200082d929150620008d7565b5090565b82805482825590600052602060002090600f016010900481019282156200081f5791602002820160005b838211156200089d57835183826101000a81548161ffff021916908361ffff16021790555092602001926002016020816001010492830192600103026200085b565b8015620008cd5782816101000a81549061ffff02191690556002016020816001010492830192600103026200089d565b50506200082d9291505b5b808211156200082d5760008155600101620008d8565b6000825160005b81811015620009115760208186018101518583015201620008f5565b8181111562000921576000828501525b507f3a20494e53554646494349454e545f5045524d495353494f4e53000000000000920191825250601a01919050565b600181811c908216806200096657607f821691505b602082108114156200098857634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c60a05160601c615f89620009c8600039600081816124800152613e89015260008181611b670152613e5a0152615f896000f3fe60806040526004361061042e5760003560e01c80636687adc01161022857806395d89b4111610128578063bd20185c116100bb578063cf4f31c71161008a578063d547741f1161006f578063d547741f14610c6c578063e985e9c514610c8c578063f2fde38b14610cd557600080fd5b8063cf4f31c714610c19578063d2e59bfe14610c3957600080fd5b8063bd20185c14610ba4578063c4ef71c714610bb9578063c87b56dd14610bd9578063cf2c52cb14610bf957600080fd5b8063a3b0b5a3116100f7578063a3b0b5a314610b1b578063a4014c2314610b4f578063a5e584dc14610b64578063b88d4fde14610b8457600080fd5b806395d89b4114610ab15780639c8d415614610ac6578063a217fddf14610ae6578063a22cb46514610afb57600080fd5b806380a45f82116101bb57806389e877a31161018a57806391d148541161016f57806391d1485414610a3657806394985ddd14610a7c5780639559c0bd14610a9c57600080fd5b806389e877a314610a035780638da5cb5b14610a1857600080fd5b806380a45f82146109b357806381e5bfac146109d35780638402470d146109f3578063853828b6146109fb57600080fd5b8063715018a6116101f7578063715018a614610949578063715223791461095e5780637f6497831461097e578063804f43cd1461099e57600080fd5b80636687adc0146108d55780636e854c32146108f35780636ec0dfe51461091457806370a082311461092957600080fd5b806323b872dd116103335780633a3ab672116102c65780634f6ccce7116102955780635ca517291161027a5780635ca51729146108755780636352211e146108955780636484a50f146108b557600080fd5b80634f6ccce714610838578063524513d61461085857600080fd5b80633a3ab6721461079257806340c10f19146107cb57806342842e0e146107eb578063438b63001461080b57600080fd5b80632f2ff15d116103025780632f2ff15d1461071f5780632f745c591461073f5780633408e4701461075f57806336568abe1461077257600080fd5b806323b872dd14610679578063248a9ca3146106995780632d0335ab146106c95780632e1a7d4d146106ff57600080fd5b80630c53c51c116103c657806317d440b9116103955780631ec942581161037a5780631ec942581461062457806320379ee51461064457806322cec5f01461065957600080fd5b806317d440b9146105f057806318160ddd1461060f57600080fd5b80630c53c51c146105715780630f7e597014610584578063120754d0146105b15780631653c39a146105d057600080fd5b806306fdde031161040257806306fdde03146104d257806307a974fc146104e7578063081812fc14610517578063095ea7b31461054f57600080fd5b80625ea3071461043357806301ffc9a71461046957806302ce58131461049957806302fb0c5e146104b8575b600080fd5b34801561043f57600080fd5b5061045361044e3660046153b6565b610cf5565b6040516104609190615b7f565b60405180910390f35b34801561047557600080fd5b50610489610484366004615414565b610dec565b6040519015158152602001610460565b3480156104a557600080fd5b5060185461048990610100900460ff1681565b3480156104c457600080fd5b506018546104899060ff1681565b3480156104de57600080fd5b50610453610df7565b3480156104f357600080fd5b506104896105023660046153b6565b60126020526000908152604090205460ff1681565b34801561052357600080fd5b506105376105323660046153b6565b610e89565b6040516001600160a01b039091168152602001610460565b34801561055b57600080fd5b5061056f61056a366004615194565b610f23565b005b61045361057f366004615118565b61104b565b34801561059057600080fd5b50610453604051806040016040528060018152602001603160f81b81525081565b3480156105bd57600080fd5b50601a545b604051908152602001610460565b3480156105dc57600080fd5b506104536105eb3660046153b6565b611235565b3480156105fc57600080fd5b506018546301000000900460ff16610489565b34801561061b57600080fd5b506008546105c2565b34801561063057600080fd5b5061056f61063f366004614f6c565b611268565b34801561065057600080fd5b50600e546105c2565b34801561066557600080fd5b5061056f610674366004615398565b6112f1565b34801561068557600080fd5b5061056f610694366004614fba565b61138a565b3480156106a557600080fd5b506105c26106b43660046153b6565b6000908152600b602052604090206001015490565b3480156106d557600080fd5b506105c26106e4366004614f6c565b6001600160a01b03166000908152600f602052604090205490565b34801561070b57600080fd5b5061056f61071a3660046153b6565b611418565b34801561072b57600080fd5b5061056f61073a3660046153cf565b6114be565b34801561074b57600080fd5b506105c261075a366004615194565b6114eb565b34801561076b57600080fd5b50466105c2565b34801561077e57600080fd5b5061056f61078d3660046153cf565b611593565b34801561079e57600080fd5b506104896107ad366004614f6c565b6001600160a01b031660009081526016602052604090205460ff1690565b3480156107d757600080fd5b5061056f6107e6366004615194565b61162f565b3480156107f757600080fd5b5061056f610806366004614fba565b6116ed565b34801561081757600080fd5b5061082b610826366004614f6c565b611708565b6040516104609190615b3b565b34801561084457600080fd5b506105c26108533660046153b6565b6117aa565b34801561086457600080fd5b50601854610100900460ff16610489565b34801561088157600080fd5b506104536108903660046153b6565b61184e565b3480156108a157600080fd5b506105376108b03660046153b6565b611a23565b3480156108c157600080fd5b506105c26108d03660046153b6565b611aae565b3480156108e157600080fd5b5060185462010000900460ff16610489565b3480156108ff57600080fd5b50601854610489906301000000900460ff1681565b34801561092057600080fd5b506105c2611ce1565b34801561093557600080fd5b506105c2610944366004614f6c565b611cf1565b34801561095557600080fd5b5061056f611d8b565b34801561096a57600080fd5b5061056f6109793660046153b6565b611dfe565b34801561098a57600080fd5b5061056f6109993660046151be565b611e6a565b3480156109aa57600080fd5b5061056f611f39565b3480156109bf57600080fd5b506018546104899062010000900460ff1681565b3480156109df57600080fd5b5061056f6109ee366004614f6c565b61208d565b61056f612116565b61056f6122fe565b348015610a0f57600080fd5b5061056f6123fd565b348015610a2457600080fd5b506010546001600160a01b0316610537565b348015610a4257600080fd5b50610489610a513660046153cf565b6000918252600b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b348015610a8857600080fd5b5061056f610a973660046153f2565b612475565b348015610aa857600080fd5b506105c2601481565b348015610abd57600080fd5b506104536124f7565b348015610ad257600080fd5b5061056f610ae136600461525d565b612506565b348015610af257600080fd5b506105c2600081565b348015610b0757600080fd5b5061056f610b1636600461505e565b6126e0565b348015610b2757600080fd5b506105c27f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a981565b348015610b5b57600080fd5b506105c26127e2565b348015610b7057600080fd5b5061056f610b7f3660046153b6565b6128b9565b348015610b9057600080fd5b5061056f610b9f366004614ff6565b612a28565b348015610bb057600080fd5b5061056f612abd565b348015610bc557600080fd5b5061056f610bd43660046153b6565b612c86565b348015610be557600080fd5b50610453610bf43660046153b6565b612d73565b348015610c0557600080fd5b5061056f610c14366004615095565b612edb565b348015610c2557600080fd5b5061056f610c3436600461535e565b613009565b348015610c4557600080fd5b50610c59610c543660046153b6565b613084565b60405161ffff9091168152602001610460565b348015610c7857600080fd5b5061056f610c873660046153cf565b61312b565b348015610c9857600080fd5b50610489610ca7366004614f87565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610ce157600080fd5b5061056f610cf0366004614f6c565b613153565b600081815260146020526040812080546060929190610d1390615d94565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3f90615d94565b8015610d8c5780601f10610d6157610100808354040283529160200191610d8c565b820191906000526020600020905b815481529060010190602001808311610d6f57829003601f168201915b50505050509050610d9c83611a23565b6001600160a01b031661dead6001600160a01b03161415610de657610dc4816001600961329c565b604051602001610dd491906156f3565b60405160208183030381529060405290505b92915050565b6000610de682613383565b606060008054610e0690615d94565b80601f0160208091040260200160405190810160405280929190818152602001828054610e3290615d94565b8015610e7f5780601f10610e5457610100808354040283529160200191610e7f565b820191906000526020600020905b815481529060010190602001808311610e6257829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610f075760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610f2e82611a23565b9050806001600160a01b0316836001600160a01b03161415610f9c5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610efe565b806001600160a01b0316610fae6133c1565b6001600160a01b03161480610fca5750610fca81610ca76133c1565b61103c5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610efe565b61104683836133cb565b505050565b60408051606081810183526001600160a01b0388166000818152600f6020908152908590205484528301529181018690526110898782878787613439565b6110df5760405162461bcd60e51b815260206004820152602160248201527f5369676e657220616e64207369676e617475726520646f206e6f74206d6174636044820152600d60fb1b6064820152608401610efe565b6001600160a01b0387166000908152600f6020526040902054611103906001613541565b6001600160a01b0388166000908152600f60205260409081902091909155517f5845892132946850460bff5a0083f71031bc5bf9aadcd40f1de79423eac9b10b9061115390899033908a90615a4d565b60405180910390a1600080306001600160a01b0316888a60405160200161117b929190615593565b60408051601f198184030181529082905261119591615577565b6000604051808303816000865af19150503d80600081146111d2576040519150601f19603f3d011682016040523d82523d6000602084013e6111d7565b606091505b5091509150816112295760405162461bcd60e51b815260206004820152601c60248201527f46756e6374696f6e2063616c6c206e6f74207375636365737366756c000000006044820152606401610efe565b98975050505050505050565b606060405160200161125290602080825260009082015260400190565b6040516020818303038152906040529050919050565b6112706133c1565b6001600160a01b031661128b6010546001600160a01b031690565b6001600160a01b0316146112cf5760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b602780546001600160a01b0319166001600160a01b0392909216919091179055565b6112f96133c1565b6001600160a01b03166113146010546001600160a01b031690565b6001600160a01b0316146113585760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b6018805463ffff00001916620100009315159390930263ff000000191692909217630100000091151591909102179055565b61139b6113956133c1565b8261354d565b61140d5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610efe565b611046838383613644565b61142181611a23565b6001600160a01b03166114326133c1565b6001600160a01b0316146114995760405162461bcd60e51b815260206004820152602860248201527f4368696c644d696e7461626c654552433732313a20494e56414c49445f544f4b60448201526722a72fa7aba722a960c11b6064820152608401610efe565b6000818152601260205260409020805460ff191660011790556114bb8161381c565b50565b6000828152600b60205260409020600101546114e1816114dc6133c1565b6138c3565b6110468383613943565b60006114f683611cf1565b821061156a5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610efe565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61159b6133c1565b6001600160a01b0316816001600160a01b0316146116215760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610efe565b61162b82826139e6565b5050565b600061163d81610a516133c1565b600c9061165d5760405162461bcd60e51b8152600401610efe9190615b92565b5060008281526012602052604090205460ff16156116e35760405162461bcd60e51b815260206004820152602f60248201527f4368696c644d696e7461626c654552433732313a20544f4b454e5f455849535460448201527f535f4f4e5f524f4f545f434841494e00000000000000000000000000000000006064820152608401610efe565b6110468383613a87565b61104683838360405180602001604052806000815250612a28565b6060600061171583611cf1565b905060008167ffffffffffffffff81111561173257611732615e76565b60405190808252806020026020018201604052801561175b578160200160208202803683370190505b50905060005b828110156117a25761177385826114eb565b82828151811061178557611785615e60565b60209081029190910101528061179a81615dcf565b915050611761565b509392505050565b60006117b560085490565b82106118295760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610efe565b6008828154811061183c5761183c615e60565b90600052602060002001549050919050565b600081815260146020526040902080546060919061186b90615d94565b151590506118bb5760405162461bcd60e51b815260206004820152601060248201527f546f6b656e206e6f74206d696e746564000000000000000000000000000000006044820152606401610efe565b611a136118c783613bd5565b60285460008581526014602052604090819020905163ad9adfe360e01b81526001600160a01b039092169163ad9adfe391611906918890600401615ba5565b60006040518083038186803b15801561191e57600080fd5b505afa158015611932573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261195a919081019061544e565b60285460008681526014602052604090819020905163b9e6cfad60e01b81526001600160a01b039092169163b9e6cfad91611999918990600401615ba5565b60006040518083038186803b1580156119b157600080fd5b505afa1580156119c5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526119ed919081019061544e565b6040516020016119ff93929190615874565b604051602081830303815290604052613cd3565b60405160200161125291906156ae565b6000818152600260205260408120546001600160a01b031680610de65760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610efe565b600033611aba83611a23565b6001600160a01b031614611b365760405162461bcd60e51b815260206004820152602260248201527f53656e646572206e6f74206f776e6572206f6620737570706c69656420746f6b60448201527f656e0000000000000000000000000000000000000000000000000000000000006064820152608401610efe565b601c546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015611bb157600080fd5b505afa158015611bc5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be991906154bb565b1015611c375760405162461bcd60e51b815260206004820152601060248201527f4e6f7420656e6f756768204c494e4b2e000000000000000000000000000000006044820152606401610efe565b602754601a546040517f79cc679000000000000000000000000000000000000000000000000000000000815233600482015260248101919091526001600160a01b03909116906379cc679090604401600060405180830381600087803b158015611ca057600080fd5b505af1158015611cb4573d6000803e3d6000fd5b505050506000611cc8601e54601c54613e56565b6000818152601760205260409020939093555090919050565b6000611cec60115490565b905090565b60006001600160a01b038216611d6f5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610efe565b506001600160a01b031660009081526003602052604090205490565b611d936133c1565b6001600160a01b0316611dae6010546001600160a01b031690565b6001600160a01b031614611df25760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b611dfc6000613fe1565b565b611e066133c1565b6001600160a01b0316611e216010546001600160a01b031690565b6001600160a01b031614611e655760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b601a55565b611e726133c1565b6001600160a01b0316611e8d6010546001600160a01b031690565b6001600160a01b031614611ed15760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b60005b815181101561162b57600160166000848481518110611ef557611ef5615e60565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580611f3181615dcf565b915050611ed4565b601854610100900460ff16611fb65760405162461bcd60e51b815260206004820152602260248201527f57686974656c697374206973206e6f74206163746976652063757272656e746c60448201527f792e0000000000000000000000000000000000000000000000000000000000006064820152608401610efe565b612710611fc260115490565b1061200f5760405162461bcd60e51b815260206004820152601660248201527f546f74616c20737570706c792065786365656465642e000000000000000000006044820152606401610efe565b3360009081526016602052604090205460ff1661206e5760405162461bcd60e51b815260206004820152601c60248201527f596f7520617265206e6f74206f6e207468652077686974656c697374000000006044820152606401610efe565b336000908152601660205260409020805460ff19169055611dfc614033565b6120956133c1565b6001600160a01b03166120b06010546001600160a01b031690565b6001600160a01b0316146120f45760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b602880546001600160a01b0319166001600160a01b0392909216919091179055565b6029546001600160a01b0316331461217a5760185460ff1661217a5760405162461bcd60e51b815260206004820152601d60248201527f53616c65206973206e6f74206163746976652063757272656e746c792e0000006044820152606401610efe565b601d543360009081526015602052604090205460ff9091169061219e906001615c61565b11156121ec5760405162461bcd60e51b815260206004820181905260248201527f4f6e6c79203130206d696e7473207065722077616c6c657420616c6c6f7765646044820152606401610efe565b6127106121f860115490565b106122455760405162461bcd60e51b815260206004820152601660248201527f546f74616c20737570706c792065786365656465642e000000000000000000006044820152606401610efe565b6018546301000000900460ff1661229e5760405162461bcd60e51b815260206004820152601c60248201527f446f6e6174696f6e204d696e74206e6f742079657420416374697665000000006044820152606401610efe565b346802b5e3af16b1880000146122f65760405162461bcd60e51b815260206004820152601760248201527f496e7375666669656e7420616d6f756e742073656e742e0000000000000000006044820152606401610efe565b611dfc614033565b6123066133c1565b6001600160a01b03166123216010546001600160a01b031690565b6001600160a01b0316146123655760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b604051600090339047908381818185875af1925050503d80600081146123a7576040519150601f19603f3d011682016040523d82523d6000602084013e6123ac565b606091505b50509050806114bb5760405162461bcd60e51b815260206004820152601460248201527f4661696c656420746f2073656e642045746865720000000000000000000000006044820152606401610efe565b6124056133c1565b6001600160a01b03166124206010546001600160a01b031690565b6001600160a01b0316146124645760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b6018805461ffff1916610100179055565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146124ed5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610efe565b61162b8282614130565b606060018054610e0690615d94565b80601481111561257e5760405162461bcd60e51b815260206004820152602860248201527f4368696c644d696e7461626c654552433732313a20455843454544535f42415460448201527f43485f4c494d49540000000000000000000000000000000000000000000000006064820152608401610efe565b60005b8181101561269057600084848381811061259d5761259d615e60565b9050602002013590506125af81611a23565b6001600160a01b03166125c06133c1565b6001600160a01b0316148160405160200161262d91907f4368696c644d696e7461626c654552433732313a20494e56414c49445f544f4b81527f454e5f4f574e45522000000000000000000000000000000000000000000000006020820152602981019190915260490190565b6040516020818303038152906040529061265a5760405162461bcd60e51b8152600401610efe9190615b7f565b506000818152601260205260409020805460ff1916600117905561267d8161381c565b508061268881615dcf565b915050612581565b506126996133c1565b6001600160a01b03167ff871896b17e9cb7a64941c62c188a4f5c621b86800e3d15452ece01ce56073df84846040516126d3929190615ae6565b60405180910390a2505050565b6126e86133c1565b6001600160a01b0316826001600160a01b031614156127495760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610efe565b80600560006127566133c1565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff19169215159290921790915561279a6133c1565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127d6911515815260200190565b60405180910390a35050565b60006109c46127f060115490565b101580156128085750610fa061280560115490565b11155b1561281a5750670de0b6b3a764000090565b610fa061282660115490565b11801561283d575061177061283a60115490565b11155b1561284f5750671bc16d674ec8000090565b61177061285b60115490565b1180156128725750611f4061286f60115490565b11155b1561288457506729a2241af62c000090565b611f4061289060115490565b1180156128a757506127106128a460115490565b11155b1561042e5750673782dace9d90000090565b6128c281611a23565b6001600160a01b03166128d36133c1565b6001600160a01b03161461293a5760405162461bcd60e51b815260206004820152602860248201527f4368696c644d696e7461626c654552433732313a20494e56414c49445f544f4b60448201526722a72fa7aba722a960c11b6064820152608401610efe565b6000818152601260205260408120805460ff19166001179055819061295e82611a23565b6001600160a01b03167ff94915c6d1fd521cee85359239227480c7e8776d7caf1fc3bacad5c269b66a14306001600160a01b0316631653c39a866040518263ffffffff1660e01b81526004016129b691815260200190565b60006040518083038186803b1580156129ce57600080fd5b505afa1580156129e2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612a0a919081019061544e565b604051612a179190615b7f565b60405180910390a46114bb8161381c565b612a39612a336133c1565b8361354d565b612aab5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610efe565b612ab7848484846143bc565b50505050565b6029546001600160a01b03163314612b935760185460ff16612b215760405162461bcd60e51b815260206004820152601d60248201527f53616c65206973206e6f74206163746976652063757272656e746c792e0000006044820152606401610efe565b601d543360009081526015602052604090205460ff90911690612b45906001615c61565b1115612b935760405162461bcd60e51b815260206004820181905260248201527f4f6e6c79203130206d696e7473207065722077616c6c657420616c6c6f7765646044820152606401610efe565b612710612b9f60115490565b10612bec5760405162461bcd60e51b815260206004820152601660248201527f546f74616c20737570706c792065786365656465642e000000000000000000006044820152606401610efe565b6109c4612bf860115490565b1015612c0657611dfc614033565b6027546001600160a01b03166379cc679033612c206127e2565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b158015612c6657600080fd5b505af1158015612c7a573d6000803e3d6000fd5b50505050611dfc614033565b33612c9082611a23565b6001600160a01b031614612ca357600080fd5b60185462010000900460ff16612d055760405162461bcd60e51b815260206004820152602160248201527f4275726e207265726f6c6c73206e6f742063757272656e746c792061637469766044820152606560f81b6064820152608401610efe565b612710612d1160115490565b10612d5e5760405162461bcd60e51b815260206004820152600e60248201527f4e6f206d696e7473206c6566742e0000000000000000000000000000000000006044820152606401610efe565b612d6b3361dead83613644565b6114bb614033565b6000818152600260205260409020546060906001600160a01b0316612d9757600080fd5b611a13612da383613bd5565b60285460008581526014602052604090819020905163ad9adfe360e01b81526001600160a01b039092169163ad9adfe391612de2918890600401615ba5565b60006040518083038186803b158015612dfa57600080fd5b505afa158015612e0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612e36919081019061544e565b60285460008681526014602052604090819020905163b9e6cfad60e01b81526001600160a01b039092169163b9e6cfad91612e75918990600401615ba5565b60006040518083038186803b158015612e8d57600080fd5b505afa158015612ea1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612ec9919081019061544e565b6040516020016119ff9392919061571c565b7f8f4f2da22e8ac8f11e15f9fc141cddbb5deea8800186560abb6e68c5496619a9612f0881610a516133c1565b600c90612f285760405162461bcd60e51b8152600401610efe9190615b92565b506020821415612f68576000612f40838501856153b6565b6000818152601260205260409020805460ff191690559050612f628582613a87565b50612ab7565b6000612f76838501856152d2565b805190915060005b8181101561300057600060126000858481518110612f9e57612f9e615e60565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550612fee87848381518110612fe157612fe1615e60565b6020026020010151613a87565b80612ff881615dcf565b915050612f7e565b50505050505050565b6130116133c1565b6001600160a01b031661302c6010546001600160a01b031690565b6001600160a01b0316146130705760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b6018805461ffff1916911515919091179055565b60285460008281526014602052604080822090517f64cd0d2c00000000000000000000000000000000000000000000000000000000815291926001600160a01b0316916364cd0d2c916130db918690600401615ba5565b60206040518083038186803b1580156130f357600080fd5b505afa158015613107573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de69190615497565b6000828152600b6020526040902060010154613149816114dc6133c1565b61104683836139e6565b61315b6133c1565b6001600160a01b03166131766010546001600160a01b031690565b6001600160a01b0316146131ba5760405162461bcd60e51b81526020600482018190526024820152600080516020615f348339815191526044820152606401610efe565b6001600160a01b0381166132365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610efe565b6114bb81613fe1565b60003330141561329657600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b031691506132999050565b50335b90565b60608360006132ab8585615cfa565b67ffffffffffffffff8111156132c3576132c3615e76565b6040519080825280601f01601f1916602001820160405280156132ed576020820181803683370190505b509050845b848110156133775782818151811061330c5761330c615e60565b01602001517fff00000000000000000000000000000000000000000000000000000000000000168261333e8884615cfa565b8151811061334e5761334e615e60565b60200101906001600160f81b031916908160001a9053508061336f81615dcf565b9150506132f2565b509150505b9392505050565b60006001600160e01b031982167f7965db0b000000000000000000000000000000000000000000000000000000001480610de65750610de682614445565b6000611cec61323f565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061340082611a23565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006001600160a01b0386166134b75760405162461bcd60e51b815260206004820152602560248201527f4e61746976654d6574615472616e73616374696f6e3a20494e56414c49445f5360448201527f49474e45520000000000000000000000000000000000000000000000000000006064820152608401610efe565b60016134ca6134c587614483565b614500565b6040805160008152602081018083529290925260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015613518573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614905095945050505050565b600061337c8284615c61565b6000818152600260205260408120546001600160a01b03166135c65760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610efe565b60006135d183611a23565b9050806001600160a01b0316846001600160a01b0316148061360c5750836001600160a01b031661360184610e89565b6001600160a01b0316145b8061363c57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661365782611a23565b6001600160a01b0316146136d35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610efe565b6001600160a01b03821661374e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610efe565b61375983838361454b565b6137646000826133cb565b6001600160a01b038316600090815260036020526040812080546001929061378d908490615cfa565b90915550506001600160a01b03821660009081526003602052604081208054600192906137bb908490615c61565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600061382782611a23565b90506138358160008461454b565b6138406000836133cb565b6001600160a01b0381166000908152600360205260408120805460019290613869908490615cfa565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000828152600b602090815260408083206001600160a01b038516845290915290205460ff1661162b57613901816001600160a01b03166014614603565b61390c836020614603565b60405160200161391d9291906159cc565b60408051601f198184030181529082905262461bcd60e51b8252610efe91600401615b7f565b6000828152600b602090815260408083206001600160a01b038516845290915290205460ff1661162b576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff191660011790556139a26133c1565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152600b602090815260408083206001600160a01b038516845290915290205460ff161561162b576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff19169055613a436133c1565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b6001600160a01b038216613add5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610efe565b6000818152600260205260409020546001600160a01b031615613b425760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610efe565b613b4e6000838361454b565b6001600160a01b0382166000908152600360205260408120805460019290613b77908490615c61565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b606081613bf95750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613c235780613c0d81615dcf565b9150613c1c9050600a83615c9e565b9150613bfd565b60008167ffffffffffffffff811115613c3e57613c3e615e76565b6040519080825280601f01601f191660200182016040528015613c68576020820181803683370190505b5090505b841561363c57613c7d600183615cfa565b9150613c8a600a86615e0a565b613c95906030615c61565b60f81b818381518110613caa57613caa615e60565b60200101906001600160f81b031916908160001a905350613ccc600a86615c9e565b9450613c6c565b6060815160001415613cf357505060408051602081019091526000815290565b6000604051806060016040528060408152602001615ef46040913990506000600384516002613d229190615c61565b613d2c9190615c9e565b613d37906004615cb2565b90506000613d46826020615c61565b67ffffffffffffffff811115613d5e57613d5e615e76565b6040519080825280601f01601f191660200182016040528015613d88576020820181803683370190505b509050818152600183018586518101602084015b81831015613df65760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401613d9c565b600389510660018114613e105760028114613e3c57613e48565b7f3d3d000000000000000000000000000000000000000000000000000000000000600119830152613e48565b603d60f81b6000198301525b509398975050505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f000000000000000000000000000000000000000000000000000000000000000084866000604051602001613ec6929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b8152600401613ef393929190615abe565b602060405180830381600087803b158015613f0d57600080fd5b505af1158015613f21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f45919061537b565b506000838152600a6020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052919052613fa1906001615c61565b6000858152600a602052604090205561363c8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b601080546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61271061403f60115490565b1061404957600080fd5b333b1561405557600080fd5b61406961406160115490565b3360006147ac565b6014600061407660115490565b81526020019081526020016000209080519060200190614097929190614e31565b5060016013601460006140a960115490565b81526020019081526020016000206040516140c4919061563c565b9081526040805160209281900383019020805460ff191693151593909317909255336000908152601590915220546140fd906001615c61565b336000818152601560205260409020919091556141229061411d60115490565b613a87565b611dfc601180546001019055565b60195461413f61271083615e0a565b101561418d5760405162461bcd60e51b815260206004820181905260248201527f42616420726f6c6c2c207570677261646520617474656d7074206661696c65646044820152606401610efe565b600061419a600883615e0a565b6141a5906001615c61565b600084815260176020526040812054919250906141c190610cf5565b905060006141e26141dd83856141d8816001615c61565b61329c565b6148f4565b90506000606060ff831615613000576141fe60ff841687615e0a565b15801561420e575060018360ff16115b156142255761421e600284615d11565b9150614233565b614230600184615d11565b91505b846008141561427c57614249846000600861329c565b6142558360ff16613bd5565b6040516020016142669291906155ca565b60405160208183030381529060405290506142ce565b6142888460008761329c565b6142948360ff16613bd5565b6142aa866142a3896001615c61565b600961329c565b6040516020016142bc939291906155f9565b60405160208183030381529060405290505b6013816040516142de9190615577565b9081526040519081900360200190205460ff1661439d5760006013856040516143079190615577565b9081526040805160209281900383019020805460ff1916931515939093179092556000898152601782528281205481526014825291909120825161434d92840190614e31565b5060016013826040516143609190615577565b908152604051908190036020019020805491151560ff19909216919091179055601a54614395906729a2241af62c0000615c61565b601a55613000565b60ff82166143aa57613000565b816143b481615d77565b925050614233565b6143c7848484613644565b6143d3848484846149aa565b612ab75760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610efe565b60006001600160e01b031982167f780e9d63000000000000000000000000000000000000000000000000000000001480610de65750610de682614b2a565b6000604051806080016040528060438152602001615eb160439139805160209182012083518483015160408087015180519086012090516144e3950193845260208401929092526001600160a01b03166040830152606082015260800190565b604051602081830303815290604052805190602001209050919050565b600061450b600e5490565b6040517f190100000000000000000000000000000000000000000000000000000000000060208201526022810191909152604281018390526062016144e3565b6001600160a01b0383166145a6576145a181600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6145c9565b816001600160a01b0316836001600160a01b0316146145c9576145c98382614bc5565b6001600160a01b0382166145e05761104681614c62565b826001600160a01b0316826001600160a01b031614611046576110468282614d11565b60606000614612836002615cb2565b61461d906002615c61565b67ffffffffffffffff81111561463557614635615e76565b6040519080825280601f01601f19166020018201604052801561465f576020820181803683370190505b509050600360fc1b8160008151811061467a5761467a615e60565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106146a9576146a9615e60565b60200101906001600160f81b031916908160001a90535060006146cd846002615cb2565b6146d8906001615c61565b90505b600181111561475d577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061471957614719615e60565b1a60f81b82828151811061472f5761472f615e60565b60200101906001600160f81b031916908160001a90535060049490941c9361475681615d60565b90506146db565b50831561337c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610efe565b6060600a82106147bb57600080fd5b6040805180820190915260018152600360fc1b602082015260005b60088160ff1610156148ae57601b80549060006147f283615dcf565b9091555050601b54604080514260208201524491810191909152606080820189905287901b6bffffffffffffffffffffffff191660808201526094810186905260b48101919091526000906127109060d4016040516020818303038152906040528051906020012060001c6148679190615e0a565b9050826148788261ffff1684614d55565b6040516020016148899291906155ca565b60405160208183030381529060405292505080806148a690615dea565b9150506147d6565b506013816040516148bf9190615577565b9081526040519081900360200190205460ff161561363c576148ec85856148e7866001615c61565b6147ac565b91505061337c565b60008181805b82518160ff1610156117a2576030838260ff168151811061491d5761491d615e60565b016020015160f81c1080159061495057506039838260ff168151811061494557614945615e60565b016020015160f81c11155b1561499857614960600a83615cd1565b91506030838260ff168151811061497957614979615e60565b016020015161498b919060f81c615d11565b6149959083615c79565b91505b806149a281615dea565b9150506148fa565b60006001600160a01b0384163b15614b2257836001600160a01b031663150b7a026149d36133c1565b8786866040518563ffffffff1660e01b81526004016149f59493929190615a82565b602060405180830381600087803b158015614a0f57600080fd5b505af1925050508015614a3f575060408051601f3d908101601f19168201909252614a3c91810190615431565b60015b614aef573d808015614a6d576040519150601f19603f3d011682016040523d82523d6000602084013e614a72565b606091505b508051614ae75760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610efe565b805181602001fd5b6001600160e01b0319167f150b7a020000000000000000000000000000000000000000000000000000000014905061363c565b50600161363c565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480614b8d57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610de657507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610de6565b60006001614bd284611cf1565b614bdc9190615cfa565b600083815260076020526040902054909150808214614c2f576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090614c7490600190615cfa565b60008381526009602052604081205460088054939450909284908110614c9c57614c9c615e60565b906000526020600020015490508060088381548110614cbd57614cbd615e60565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480614cf557614cf5615e4a565b6001900381819060005260206000200160009055905550505050565b6000614d1c83611cf1565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60606000805b601f8460ff1660088110614d7157614d71615e60565b015460ff82161015614e2b576000601f8560ff1660088110614d9557614d95615e60565b018260ff1681548110614daa57614daa615e60565b90600052602060002090601091828204019190066002029054906101000a900461ffff1690508261ffff168610158015614df05750614de98184615c44565b61ffff1686105b15614e0b57614e018260ff16613bd5565b9350505050610de6565b614e158184615c44565b9250508080614e2390615dea565b915050614d5b565b50600080fd5b828054614e3d90615d94565b90600052602060002090601f016020900481019282614e5f5760008555614ea5565b82601f10614e7857805160ff1916838001178555614ea5565b82800160010185558215614ea5579182015b82811115614ea5578251825591602001919060010190614e8a565b50614eb1929150614eb5565b5090565b5b80821115614eb15760008155600101614eb6565b6000614edd614ed884615c1c565b615bc7565b9050828152838383011115614ef157600080fd5b61337c836020830184615d34565b80356001600160a01b0381168114614f1657600080fd5b919050565b600082601f830112614f2c57600080fd5b8135614f3a614ed882615c1c565b818152846020838601011115614f4f57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215614f7e57600080fd5b61337c82614eff565b60008060408385031215614f9a57600080fd5b614fa383614eff565b9150614fb160208401614eff565b90509250929050565b600080600060608486031215614fcf57600080fd5b614fd884614eff565b9250614fe660208501614eff565b9150604084013590509250925092565b6000806000806080858703121561500c57600080fd5b61501585614eff565b935061502360208601614eff565b925060408501359150606085013567ffffffffffffffff81111561504657600080fd5b61505287828801614f1b565b91505092959194509250565b6000806040838503121561507157600080fd5b61507a83614eff565b9150602083013561508a81615e8c565b809150509250929050565b6000806000604084860312156150aa57600080fd5b6150b384614eff565b9250602084013567ffffffffffffffff808211156150d057600080fd5b818601915086601f8301126150e457600080fd5b8135818111156150f357600080fd5b87602082850101111561510557600080fd5b6020830194508093505050509250925092565b600080600080600060a0868803121561513057600080fd5b61513986614eff565b9450602086013567ffffffffffffffff81111561515557600080fd5b61516188828901614f1b565b9450506040860135925060608601359150608086013560ff8116811461518657600080fd5b809150509295509295909350565b600080604083850312156151a757600080fd5b6151b083614eff565b946020939093013593505050565b600060208083850312156151d157600080fd5b823567ffffffffffffffff8111156151e857600080fd5b8301601f810185136151f957600080fd5b8035615207614ed882615bf8565b80828252848201915084840188868560051b870101111561522757600080fd5b600094505b838510156152515761523d81614eff565b83526001949094019391850191850161522c565b50979650505050505050565b6000806020838503121561527057600080fd5b823567ffffffffffffffff8082111561528857600080fd5b818501915085601f83011261529c57600080fd5b8135818111156152ab57600080fd5b8660208260051b85010111156152c057600080fd5b60209290920196919550909350505050565b600060208083850312156152e557600080fd5b823567ffffffffffffffff8111156152fc57600080fd5b8301601f8101851361530d57600080fd5b803561531b614ed882615bf8565b80828252848201915084840188868560051b870101111561533b57600080fd5b600094505b83851015615251578035835260019490940193918501918501615340565b60006020828403121561537057600080fd5b813561337c81615e8c565b60006020828403121561538d57600080fd5b815161337c81615e8c565b600080604083850312156153ab57600080fd5b823561507a81615e8c565b6000602082840312156153c857600080fd5b5035919050565b600080604083850312156153e257600080fd5b82359150614fb160208401614eff565b6000806040838503121561540557600080fd5b50508035926020909101359150565b60006020828403121561542657600080fd5b813561337c81615e9a565b60006020828403121561544357600080fd5b815161337c81615e9a565b60006020828403121561546057600080fd5b815167ffffffffffffffff81111561547757600080fd5b8201601f8101841361548857600080fd5b61363c84825160208401614eca565b6000602082840312156154a957600080fd5b815161ffff8116811461337c57600080fd5b6000602082840312156154cd57600080fd5b5051919050565b600081518084526154ec816020860160208601615d34565b601f01601f19169290920160200192915050565b6000815461550d81615d94565b80855260206001838116801561552a576001811461553e5761556c565b60ff1985168884015260408801955061556c565b866000528260002060005b858110156155645781548a8201860152908301908401615549565b890184019650505b505050505092915050565b60008251615589818460208701615d34565b9190910192915050565b600083516155a5818460208801615d34565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b600083516155dc818460208801615d34565b8351908301906155f0818360208801615d34565b01949350505050565b6000845161560b818460208901615d34565b84519083019061561f818360208901615d34565b8451910190615632818360208801615d34565b0195945050505050565b600080835461564a81615d94565b600182811680156156625760018114615673576156a2565b60ff198416875282870194506156a2565b8760005260208060002060005b858110156156995781548a820152908401908201615680565b50505082870194505b50929695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516156e681601d850160208701615d34565b91909101601d0192915050565b603160f81b81526000825161570f816001850160208701615d34565b9190910160010192915050565b7f7b226e616d65223a20224d61746963204d696b65202300000000000000000000815260008451615754816016850160208901615d34565b7f222c20226465736372697074696f6e223a20224d61746963204d696b652069736016918401918201527f206120636f6c6c656374696f6e206f66203130303030204e465473206f6e207460368201527f686520506f6c79676f6e20436861696e207769746820457468657265756d204260568201527f72696467652e2046756c6c79206f6e2d636861696e2e222c2022696d6167652260768201527f3a2022646174613a696d6167652f7376672b786d6c3b6261736536342c000000609682015284516158298160b3840160208901615d34565b6e11161130ba3a3934b13aba32b9911d60891b60b3929091019182015283516158598160c2840160208801615d34565b607d60f81b60c2929091019182015260c30195945050505050565b7f7b226e616d65223a20224d61746963204d696b652023000000000000000000008152600084516158ac816016850160208901615d34565b7f222c20226465736372697074696f6e223a20225468697320697320746865206f6016918401918201527f6666696369616c204d61746963204d696b6520457468657265756d204272696460368201527f676520666f7220746865204d61746963204d696b6520436c7562204e4654206f60568201527f6e20506f6c79676f6e2e222c2022696d616765223a2022646174613a696d616760768201527f652f7376672b786d6c3b6261736536342c000000000000000000000000000000609682015284516159818160a7840160208901615d34565b6e11161130ba3a3934b13aba32b9911d60891b60a7929091019182015283516159b18160b6840160208801615d34565b607d60f81b60b6929091019182015260b70195945050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615a04816017850160208801615d34565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351615a41816028840160208801615d34565b01602801949350505050565b60006001600160a01b03808616835280851660208401525060606040830152615a7960608301846154d4565b95945050505050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152615ab460808301846154d4565b9695505050505050565b6001600160a01b0384168152826020820152606060408201526000615a7960608301846154d4565b6020815281602082015260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115615b1f57600080fd5b8260051b80856040850137600092016040019182525092915050565b6020808252825182820181905260009190848201906040850190845b81811015615b7357835183529284019291840191600101615b57565b50909695505050505050565b60208152600061337c60208301846154d4565b60208152600061337c6020830184615500565b604081526000615bb86040830185615500565b90508260208301529392505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715615bf057615bf0615e76565b604052919050565b600067ffffffffffffffff821115615c1257615c12615e76565b5060051b60200190565b600067ffffffffffffffff821115615c3657615c36615e76565b50601f01601f191660200190565b600061ffff8083168185168083038211156155f0576155f0615e1e565b60008219821115615c7457615c74615e1e565b500190565b600060ff821660ff84168060ff03821115615c9657615c96615e1e565b019392505050565b600082615cad57615cad615e34565b500490565b6000816000190483118215151615615ccc57615ccc615e1e565b500290565b600060ff821660ff84168160ff0481118215151615615cf257615cf2615e1e565b029392505050565b600082821015615d0c57615d0c615e1e565b500390565b600060ff821660ff841680821015615d2b57615d2b615e1e565b90039392505050565b60005b83811015615d4f578181015183820152602001615d37565b83811115612ab75750506000910152565b600081615d6f57615d6f615e1e565b506000190190565b600060ff821680615d8a57615d8a615e1e565b6000190192915050565b600181811c90821680615da857607f821691505b60208210811415615dc957634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415615de357615de3615e1e565b5060010190565b600060ff821660ff811415615e0157615e01615e1e565b60010192915050565b600082615e1957615e19615e34565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146114bb57600080fd5b6001600160e01b0319811681146114bb57600080fdfe4d6574615472616e73616374696f6e2875696e74323536206e6f6e63652c616464726573732066726f6d2c62797465732066756e6374696f6e5369676e6174757265294142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220b2fcef5a002a7ef975071cacb77f085835bc136057652a7f2b6308092fd654ad64736f6c63430008070033454950373132446f6d61696e28737472696e67206e616d652c737472696e672076657273696f6e2c6164647265737320766572696679696e67436f6e74726163742c627974657333322073616c7429

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.