ETH Price: $3,097.08 (-1.74%)

Token

Seed Phrase (SEED)
 

Overview

Max Total Supply

1,293 SEED

Holders

554

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
zhiihz.eth
Balance
2 SEED
0xA45e4DA10f86579FF2D37CBf29Fc7B27C08A22fA
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Welcome to ‘Seed Phrase’ Seed Phrase is a ‘Crypto Native’ fully on-chain collection. Every decision in this project has been made with the available blockchain technologies in mind.

# Exchange Pair Price  24H Volume % Volume
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
SeedPhrase

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 300 runs

Other Settings:
default evmVersion
File 1 of 30 : SeedPhrase.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
import "./SeedPhrasePricing.sol";
import "../interfaces/IN.sol";
import "../interfaces/IRarible.sol";
import "../interfaces/IKarmaScore.sol";
import "../interfaces/INOwnerResolver.sol";
import "../libraries/NilProtocolUtils.sol";
import "../libraries/SeedPhraseUtils.sol";

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                                                                    //
// ░██████╗███████╗███████╗██████╗░  ██████╗░██╗░░██╗██████╗░░█████╗░░██████╗███████╗ //
// ██╔════╝██╔════╝██╔════╝██╔══██╗  ██╔══██╗██║░░██║██╔══██╗██╔══██╗██╔════╝██╔════╝ //
// ╚█████╗░█████╗░░█████╗░░██║░░██║  ██████╔╝███████║██████╔╝███████║╚█████╗░█████╗░░ //
// ░╚═══██╗██╔══╝░░██╔══╝░░██║░░██║  ██╔═══╝░██╔══██║██╔══██╗██╔══██║░╚═══██╗██╔══╝░░ //
// ██████╔╝███████╗███████╗██████╔╝  ██║░░░░░██║░░██║██║░░██║██║░░██║██████╔╝███████╗ //
// ╚═════╝░╚══════╝╚══════╝╚═════╝░  ╚═╝░░░░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═════╝░╚══════╝ //
//                                                                                    //
//                                                                                    //
//  Title: Seed Phrase                                                                //
//  Devs: Harry Faulkner & maximonee (twitter.com/maximonee_)                         //
//  Description: This contract provides minting for the                               //
//               Seed Phrase NFT by Sean Elliott                                      //
//               (twitter.com/seanelliottoc)                                          //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

contract SeedPhrase is SeedPhrasePricing, VRFConsumerBase {
    using Strings for uint256;
    using Strings for uint16;
    using Strings for uint8;
    using Counters for Counters.Counter;
    using SeedPhraseUtils for SeedPhraseUtils.Random;

    Counters.Counter private _doublePanelTokens;
    Counters.Counter private _tokenIds;

    address private _owner;

    // Tracks whether an n has been used already to mint
    mapping(uint256 => bool) public override nUsed;

    mapping(PreSaleType => uint16) public presaleLimits;

    address[] private genesisSketchAddresses;
    uint16[] private bipWordIds = new uint16[](2048);

    IRarible public immutable rarible;
    INOwnerResolver public immutable nOwnerResolver;
    IKarmaScore public immutable karma;

    struct Maps {
        // Map double panel tokens to burned singles
        mapping(uint256 => uint256[2]) burnedTokensPairings;
        // Mapping of valid double panel pairings (BIP39 IDs)
        mapping(uint16 => uint16) doubleWordPairings;
        // Stores the guarenteed token rarity for a double panel
        mapping(uint256 => uint8) doubleTokenRarity;
        mapping(address => bool) ogAddresses;
        // Map token to their unique seed
        mapping(uint256 => bytes32) tokenSeed;
    }

    struct Config {
        bool preSaleActive;
        bool publicSaleActive;
        bool isSaleHalted;
        bool bipWordsShuffled;
        bool vrfNumberGenerated;
        bool isBurnActive;
        bool isOwnerSupplyMinted;
        bool isGsAirdropComplete;
        uint8 ownerSupply;
        uint16 maxPublicMint;
        uint16 karmaRequirement;
        uint32 preSaleLaunchTime;
        uint32 publicSaleLaunchTime;
        uint256 doubleBurnTokens;
        uint256 linkFee;
        uint256 raribleTokenId;
        uint256 vrfRandomValue;
        address vrfCoordinator;
        address linkToken;
        bytes32 vrfKeyHash;
    }

    struct ContractAddresses {
        address n;
        address masterMint;
        address dao;
        address nOwnersRegistry;
        address vrfCoordinator;
        address linkToken;
        address karmaAddress;
        address rarible;
    }

    Config private config;
    Maps private maps;

    event Burnt(address to, uint256 firstBurntToken, uint256 secondBurntToken, uint256 doublePaneledToken);

    DerivativeParameters params = DerivativeParameters(false, false, 0, 2048, 4);

    constructor(
        ContractAddresses memory contractAddresses,
        bytes32 _vrfKeyHash,
        uint256 _linkFee
    )
        SeedPhrasePricing(
            "Seed Phrase",
            "SEED",
            IN(contractAddresses.n),
            params,
            30000000000000000,
            60000000000000000,
            contractAddresses.masterMint,
            contractAddresses.dao
        )
        VRFConsumerBase(contractAddresses.vrfCoordinator, contractAddresses.linkToken)
    {
        // Start token IDs at 1
        _tokenIds.increment();

        presaleLimits[PreSaleType.N] = 400;
        presaleLimits[PreSaleType.Karma] = 800;
        presaleLimits[PreSaleType.GenesisSketch] = 40;
        presaleLimits[PreSaleType.OG] = 300;
        presaleLimits[PreSaleType.GM] = 300;

        nOwnerResolver = INOwnerResolver(contractAddresses.nOwnersRegistry);
        rarible = IRarible(contractAddresses.rarible);
        karma = IKarmaScore(contractAddresses.karmaAddress);

        // Initialize Config struct
        config.maxPublicMint = 8;
        config.ownerSupply = 20;
        config.preSaleLaunchTime = 1639591200;
        config.publicSaleLaunchTime = 1639598400;
        config.raribleTokenId = 706480;
        config.karmaRequirement = 1020;

        config.vrfCoordinator = contractAddresses.vrfCoordinator;
        config.linkToken = contractAddresses.linkToken;
        config.linkFee = _linkFee;
        config.vrfKeyHash = _vrfKeyHash;

        _owner = 0x7F05F27CC5D83C3e879C53882de13Cc1cbCe8a8c;
    }

    function owner() external view virtual returns (address) {
        return _owner;
    }

    function setOwner(address owner_) external onlyAdmin {
        _owner = owner_;
    }

    function contractURI() public pure returns (string memory) {
        return "https://www.seedphrase.codes/metadata/seedphrase-metadata.json";
    }

    function getVrfSeed() external onlyAdmin returns (bytes32) {
        require(!config.vrfNumberGenerated, "SP:VRF_ALREADY_CALLED");
        require(LINK.balanceOf(address(this)) >= config.linkFee, "SP:NOT_ENOUGH_LINK");
        return requestRandomness(config.vrfKeyHash, config.linkFee);
    }

    function fulfillRandomness(bytes32, uint256 randomNumber) internal override {
        config.vrfRandomValue = randomNumber;
        config.vrfNumberGenerated = true;
    }

    function _getTokenSeed(uint256 tokenId) internal view returns (bytes32) {
        return maps.tokenSeed[tokenId];
    }

    function _getBipWordIdFromTokenId(uint256 tokenId) internal view returns (uint16) {
        return bipWordIds[tokenId - 1];
    }

    function tokenSVG(uint256 tokenId) public view virtual returns (string memory svg, bytes memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        SeedPhraseUtils.Random memory random = SeedPhraseUtils.Random({
            seed: uint256(_getTokenSeed(tokenId)),
            offsetBit: 0
        });

        uint16 bipWordId;
        uint16 secondBipWordId = 0;
        uint8 rarityValue = 0;
        if (tokenId >= 3000) {
            uint256[2] memory tokens = maps.burnedTokensPairings[tokenId];
            bipWordId = _getBipWordIdFromTokenId(tokens[0]);
            secondBipWordId = _getBipWordIdFromTokenId(tokens[1]);
            rarityValue = maps.doubleTokenRarity[tokenId];
        } else {
            bipWordId = _getBipWordIdFromTokenId(tokenId);
        }

        (bytes memory traits, SeedPhraseUtils.Attrs memory attributes) = SeedPhraseUtils.getTraitsAndAttributes(
            bipWordId,
            secondBipWordId,
            rarityValue,
            random
        );

        return (SeedPhraseUtils.render(random, attributes), traits);
    }

    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        (string memory output, bytes memory traits) = tokenSVG(tokenId);

        return SeedPhraseUtils.getTokenURI(output, traits, tokenId);
    }

    /**
    Updates the presale state for n holders
     */
    function setPreSaleState(bool _preSaleActiveState) external onlyAdmin {
        config.preSaleActive = _preSaleActiveState;
    }

    /**
    Updates the public sale state for non-n holders
     */
    function setPublicSaleState(bool _publicSaleActiveState) external onlyAdmin {
        config.publicSaleActive = _publicSaleActiveState;
    }

    function setPreSaleTime(uint32 _time) external onlyAdmin {
        config.preSaleLaunchTime = _time;
    }

    function setPublicSaleTime(uint32 _time) external onlyAdmin {
        config.publicSaleLaunchTime = _time;
    }

    /**
    Give the ability to halt the sale if necessary due to automatic sale enablement based on time
     */
    function setSaleHaltedState(bool _saleHaltedState) external onlyAdmin {
        config.isSaleHalted = _saleHaltedState;
    }

    function setBurnActiveState(bool _burnActiveState) external onlyAdmin {
        config.isBurnActive = _burnActiveState;
    }

    function setGenesisSketchAllowList(address[] calldata addresses) external onlyAdmin {
        genesisSketchAddresses = addresses;
    }

    function setOgAllowList(address[] calldata addresses) external onlyAdmin {
        for (uint256 i = 0; i < addresses.length; i++) {
            maps.ogAddresses[addresses[i]] = true;
        }
    }

    function _isPreSaleActive() internal view returns (bool) {
        return ((block.timestamp >= config.preSaleLaunchTime || config.preSaleActive) && !config.isSaleHalted);
    }

    function _isPublicSaleActive() internal view override returns (bool) {
        return ((block.timestamp >= config.publicSaleLaunchTime || config.publicSaleActive) && !config.isSaleHalted);
    }

    function _canMintPresale(
        address addr,
        uint256 amount,
        bytes memory data
    ) internal view override returns (bool, PreSaleType) {
        if (maps.ogAddresses[addr] && presaleLimits[PreSaleType.OG] - amount >= 0) {
            return (true, PreSaleType.OG);
        }

        bool isGsHolder;
        for (uint256 i = 0; i < genesisSketchAddresses.length; i++) {
            if (genesisSketchAddresses[i] == addr) {
                isGsHolder = true;
            }
        }

        if (isGsHolder && presaleLimits[PreSaleType.GenesisSketch] - amount >= 0) {
            return (true, PreSaleType.GenesisSketch);
        }

        if (rarible.balanceOf(addr, config.raribleTokenId) > 0 && presaleLimits[PreSaleType.GM] - amount > 0) {
            return (true, PreSaleType.GM);
        }

        uint256 karmaScore = SeedPhraseUtils.getKarma(karma, data, addr);
        if (nOwnerResolver.balanceOf(addr) > 0) {
            if (karmaScore >= config.karmaRequirement && presaleLimits[PreSaleType.Karma] - amount >= 0) {
                return (true, PreSaleType.Karma);
            }

            if (presaleLimits[PreSaleType.N] - amount >= 0) {
                return (true, PreSaleType.N);
            }
        }

        return (false, PreSaleType.None);
    }

    function canMint(address account, bytes calldata data) public view virtual override returns (bool) {
        if (config.isBurnActive) {
            return false;
        }

        uint256 balance = balanceOf(account);

        if (_isPublicSaleActive() && (totalMintsAvailable() > 0) && balance < config.maxPublicMint) {
            return true;
        }

        if (_isPreSaleActive()) {
            (bool preSaleEligible, ) = _canMintPresale(account, 1, data);
            return preSaleEligible;
        }

        return false;
    }

    /**
     * @notice Allow a n token holder to bulk mint tokens with id of their n tokens' id
     * @param recipient Recipient of the mint
     * @param tokenIds Ids to be minted
     * @param paid Amount paid for the mint
     */
    function mintWithN(
        address recipient,
        uint256[] calldata tokenIds,
        uint256 paid,
        bytes calldata data
    ) public virtual override nonReentrant {
        uint256 maxTokensToMint = tokenIds.length;
        (bool preSaleEligible, PreSaleType presaleType) = _canMintPresale(recipient, maxTokensToMint, data);

        require(config.bipWordsShuffled && config.vrfNumberGenerated, "SP:ENV_NOT_INIT");
        require(_isPublicSaleActive() || (_isPreSaleActive() && preSaleEligible), "SP:SALE_NOT_ACTIVE");
        require(
            balanceOf(recipient) + maxTokensToMint <= _getMaxMintPerWallet(),
            "NilPass:MINT_ABOVE_MAX_MINT_ALLOWANCE"
        );
        require(!config.isBurnActive, "SP:SALE_OVER");

        require(totalSupply() + maxTokensToMint <= params.maxTotalSupply, "NilPass:MAX_ALLOCATION_REACHED");

        uint256 price = getNextPriceForNHoldersInWei(maxTokensToMint, recipient, data);
        require(paid == price, "NilPass:INVALID_PRICE");

        for (uint256 i = 0; i < maxTokensToMint; i++) {
            require(!nUsed[tokenIds[i]], "SP:N_ALREADY_USED");

            uint256 tokenId = _tokenIds.current();
            require(tokenId <= params.maxTotalSupply, "SP:TOKEN_TOO_HIGH");

            maps.tokenSeed[tokenId] = SeedPhraseUtils.generateSeed(tokenId, config.vrfRandomValue);

            _safeMint(recipient, tokenId);
            _tokenIds.increment();

            nUsed[tokenIds[i]] = true;
        }

        if (preSaleEligible) {
            presaleLimits[presaleType] -= uint16(maxTokensToMint);
        }
    }

    /**
     * @notice Allow anyone to mint a token with the supply id if this pass is unrestricted.
     *         n token holders can use this function without using the n token holders allowance,
     *         this is useful when the allowance is fully utilized.
     * @param recipient Recipient of the mint
     * @param amount Amount of tokens to mint
     * @param paid Amount paid for the mint
     */
    function mint(
        address recipient,
        uint8 amount,
        uint256 paid,
        bytes calldata data
    ) public virtual override nonReentrant {
        (bool preSaleEligible, PreSaleType presaleType) = _canMintPresale(recipient, amount, data);

        require(config.bipWordsShuffled && config.vrfNumberGenerated, "SP:ENV_NOT_INIT");
        require(
            _isPublicSaleActive() ||
                (_isPreSaleActive() &&
                    preSaleEligible &&
                    (presaleType != PreSaleType.N && presaleType != PreSaleType.Karma)),
            "SP:SALE_NOT_ACTIVE"
        );
        require(!config.isBurnActive, "SP:SALE_OVER");

        require(balanceOf(recipient) + amount <= _getMaxMintPerWallet(), "NilPass:MINT_ABOVE_MAX_MINT_ALLOWANCE");
        require(totalSupply() + amount <= params.maxTotalSupply, "NilPass:MAX_ALLOCATION_REACHED");

        uint256 price = getNextPriceForOpenMintInWei(amount, recipient, data);
        require(paid == price, "NilPass:INVALID_PRICE");

        for (uint256 i = 0; i < amount; i++) {
            uint256 tokenId = _tokenIds.current();
            require(tokenId <= params.maxTotalSupply, "SP:TOKEN_TOO_HIGH");
            maps.tokenSeed[tokenId] = SeedPhraseUtils.generateSeed(tokenId, config.vrfRandomValue);

            _safeMint(recipient, tokenId);
            _tokenIds.increment();
        }

        if (preSaleEligible) {
            presaleLimits[presaleType] -= amount;
        }
    }

    function mintOwnerSupply(address account) public nonReentrant onlyAdmin {
        require(!config.isOwnerSupplyMinted, "SP:ALREADY_MINTED");
        require(config.bipWordsShuffled && config.vrfNumberGenerated, "SP:ENV_NOT_INIT");
        require(
            totalSupply() + config.ownerSupply <= params.maxTotalSupply,
            "NilPass:MAX_ALLOCATION_REACHED"
        );

        for (uint256 i = 0; i < config.ownerSupply; i++) {
            uint256 tokenId = _tokenIds.current();
            maps.tokenSeed[tokenId] = SeedPhraseUtils.generateSeed(tokenId, config.vrfRandomValue);

            _mint(account, tokenId);
            _tokenIds.increment();
        }

        config.isOwnerSupplyMinted = true;
    }

    /**
     * @notice Allow anyone to burn two single panels they own in order to mint
     *         a double paneled token.
     * @param firstTokenId Token ID of the first token
     * @param secondTokenId Token ID of the second token
     */
    function burnForDoublePanel(uint256 firstTokenId, uint256 secondTokenId) public nonReentrant {
        require(config.isBurnActive, "SP:BURN_INACTIVE");
        require(ownerOf(firstTokenId) == msg.sender && ownerOf(secondTokenId) == msg.sender, "SP:INCORRECT_OWNER");
        require(firstTokenId != secondTokenId, "SP:EQUAL_TOKENS");
        // Ensure two owned tokens are in Burnable token pairings
        require(
            isValidPairing(_getBipWordIdFromTokenId(firstTokenId), _getBipWordIdFromTokenId(secondTokenId)),
            "SP:INVALID_TOKEN_PAIRING"
        );

        _burn(firstTokenId);
        _burn(secondTokenId);

        // Any Token ID of 3000 or greater indicates it is a double panel e.g. 3000, 3001, 3002...
        uint256 doublePanelTokenId = 3000 + _doublePanelTokens.current();
        maps.tokenSeed[doublePanelTokenId] = SeedPhraseUtils.generateSeed(doublePanelTokenId, config.vrfRandomValue);

        // Get the rarity rating from the burned tokens, store this against the new token
        // Burners are guaranteed their previous strongest trait (at least, could be rarer)
        uint8 rarity1 = SeedPhraseUtils.getRarityRating(_getTokenSeed(firstTokenId));
        uint8 rarity2 = SeedPhraseUtils.getRarityRating(_getTokenSeed(secondTokenId));
        maps.doubleTokenRarity[doublePanelTokenId] = (rarity1 > rarity2 ? rarity1 : rarity2);

        _mint(msg.sender, doublePanelTokenId);

        // Add burned tokens to maps.burnedTokensPairings mapping so we can use them to render the double panels later
        maps.burnedTokensPairings[doublePanelTokenId] = [firstTokenId, secondTokenId];
        _doublePanelTokens.increment();

        emit Burnt(msg.sender, firstTokenId, secondTokenId, doublePanelTokenId);
    }

    function airdropGenesisSketch() public nonReentrant onlyAdmin {
        require(!config.isGsAirdropComplete, "SP:ALREADY_AIRDROPPED");
        require(config.bipWordsShuffled && config.vrfNumberGenerated, "SP:ENV_NOT_INIT");

        uint256 airdropAmount = genesisSketchAddresses.length;
        require(totalSupply() + airdropAmount <= params.maxTotalSupply, "NilPass:MAX_ALLOCATION_REACHED");

        for (uint256 i = 0; i < airdropAmount; i++) {
            uint256 tokenId = _tokenIds.current();
            maps.tokenSeed[tokenId] = SeedPhraseUtils.generateSeed(tokenId, config.vrfRandomValue);

            _mint(genesisSketchAddresses[i], tokenId);
            _tokenIds.increment();
        }

        config.isGsAirdropComplete = true;
    }

    function mintOrphanedPieces(uint256 amount, address addr) public nonReentrant onlyAdmin {
        require(totalMintsAvailable() == 0, "SP:MINT_NOT_OVER");
        
        // _tokenIds - 1 to get the current number of minted tokens (token IDs start at 1)
        uint256 currentSupply = _tokenIds.current() - 1;

        config.doubleBurnTokens = derivativeParams.maxTotalSupply - currentSupply;

        require(config.doubleBurnTokens >= amount, "SP:NOT_ENOUGH_ORPHANS");
        require(currentSupply + amount <= params.maxTotalSupply, "NilPass:MAX_ALLOCATION_REACHED");

        for (uint256 i = 0; i < amount; i++) {
            uint256 tokenId = _tokenIds.current();
            require(tokenId <= params.maxTotalSupply, "SP:TOKEN_TOO_HIGH");

            maps.tokenSeed[tokenId] = SeedPhraseUtils.generateSeed(tokenId, config.vrfRandomValue);

            _mint(addr, tokenId);
            _tokenIds.increment();
        }

        config.doubleBurnTokens -= amount;
    }

    /**
     * @notice Calculate the total available number of mints
     * @return total mint available
     */
    function totalMintsAvailable() public view override returns (uint256) {
        uint256 totalAvailable = derivativeParams.maxTotalSupply - totalSupply();
        if (block.timestamp > config.publicSaleLaunchTime + 18 hours) {
            // Double candle burning starts and decreases max. mintable supply with 1 token per minute.
            uint256 doubleBurn = (block.timestamp - (config.publicSaleLaunchTime + 18 hours)) / 1 minutes;
            totalAvailable = totalAvailable > doubleBurn ? totalAvailable - doubleBurn : 0;
        }

        return totalAvailable;
    }

    function getDoubleBurnedTokens() external view returns (uint256) {
        return config.doubleBurnTokens;
    }

    function _getMaxMintPerWallet() internal view returns (uint128) {
        return _isPublicSaleActive() ? config.maxPublicMint : params.maxMintAllowance;
    }

    function isValidPairing(uint16 first, uint16 second) public view returns (bool) {
        return maps.doubleWordPairings[first] == second;
    }

    function amendPairings(uint16[][] calldata pairings) external onlyAdmin {
        for (uint16 i = 0; i < pairings.length; i++) {
            if (pairings[i].length != 2) {
                continue;
            }

            maps.doubleWordPairings[pairings[i][0]] = pairings[i][1];
        }
    }

    function shuffleBipWords() external onlyAdmin {
        require(config.vrfNumberGenerated, "SP:VRF_NOT_CALLED");
        require(!config.bipWordsShuffled, "SP:ALREADY_SHUFFLED");
        bipWordIds = SeedPhraseUtils.shuffleBipWords(config.vrfRandomValue);
        config.bipWordsShuffled = true;
    }
}

File 2 of 30 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 3 of 30 : 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 4 of 30 : 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 5 of 30 : 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 6 of 30 : 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);
  }
}

File 7 of 30 : SeedPhrasePricing.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "../core/NilPassCore.sol";

abstract contract SeedPhrasePricing is NilPassCore {
    uint256 preSalePrice;
    uint256 publicSalePrice;

    constructor(
        string memory name,
        string memory symbol,
        IN n,
        DerivativeParameters memory derivativeParams,
        uint256 preSalePrice_,
        uint256 publicSalePrice_,
        address masterMint,
        address dao
    ) NilPassCore(name, symbol, n, derivativeParams, masterMint, dao) {
        preSalePrice = preSalePrice_;
        publicSalePrice = publicSalePrice_;
    }

    enum PreSaleType {
        GenesisSketch,
        OG,
        GM,
        Karma,
        N,
        None
    }

    function _canMintPresale(
        address addr,
        uint256 amount,
        bytes memory data
    ) internal view virtual returns (bool, PreSaleType);

    function _isPublicSaleActive() internal view virtual returns (bool);

    /**
     * @notice Returns the next price for an N mint
     */
    function getNextPriceForNHoldersInWei(
        uint256 numberOfMints,
        address account,
        bytes memory data
    ) public view override returns (uint256) {
        (bool preSaleEligible, ) = _canMintPresale(account, numberOfMints, data);
        uint256 price = preSaleEligible && !_isPublicSaleActive() ? preSalePrice : publicSalePrice;
        return numberOfMints * price;
    }

    /**
     * @notice Returns the next price for an open mint
     */
    function getNextPriceForOpenMintInWei(
        uint256 numberOfMints,
        address account,
        bytes memory data
    ) public view override returns (uint256) {
        (bool preSaleEligible, ) = _canMintPresale(account, numberOfMints, data);
        uint256 price = preSaleEligible && !_isPublicSaleActive() ? preSalePrice : publicSalePrice;
        return numberOfMints * price;
    }
}

File 8 of 30 : IN.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";

interface IN is IERC721Enumerable, IERC721Metadata {
    function getFirst(uint256 tokenId) external view returns (uint256);

    function getSecond(uint256 tokenId) external view returns (uint256);

    function getThird(uint256 tokenId) external view returns (uint256);

    function getFourth(uint256 tokenId) external view returns (uint256);

    function getFifth(uint256 tokenId) external view returns (uint256);

    function getSixth(uint256 tokenId) external view returns (uint256);

    function getSeventh(uint256 tokenId) external view returns (uint256);

    function getEight(uint256 tokenId) external view returns (uint256);
}

File 9 of 30 : IRarible.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";

interface IRarible is IERC721Enumerable, IERC721Metadata {
    function balanceOf(address _owner, uint256 _id) external view returns (uint256);
}

File 10 of 30 : IKarmaScore.sol
//SPDX-License-Identifier: MIT
/**
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(     (@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@           @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(   @@@@@@@@@@@@@@@@@@@@(            @@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@         @@@@@@@@@@@@@@@             @@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@           @@@@@@@@@@@(            @@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@      @@@@@@@@@@@@             @@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@(            @@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@     @@@@@@@     @@@@@@@             @@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@(         @@(         @@(            @@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@          @@          @@           @@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@     @@@@@@@     @@@@@@@     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(     @@@@@@@     @@@@@@@     @@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@           @           @           @@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@(            @@@         @@@         @@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@             @@@@@@@     @@@@@@@     @@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@(            @@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@             @@@@@@@@@@@       @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@(            @@@@@@@@@@@@           @@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@             @@@@@@@@@@@@@@@         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@(            @@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@           @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@(     @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 */
pragma solidity >=0.8.4;

interface IKarmaScore {
    function verify(
        address account,
        uint256 score,
        bytes calldata data
    ) external view returns (bool);

    function merkleRoot() external view returns (bytes32);

    function setMerkleRoot(bytes32 _merkleRoot) external;
}

File 11 of 30 : INOwnerResolver.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

interface INOwnerResolver {
    function ownerOf(uint256 nid) external view returns (address);

    function balanceOf(address account) external view returns (uint256);

    function nOwned(address owner) external view returns (uint256[] memory);
}

File 12 of 30 : NilProtocolUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

library NilProtocolUtils {
    bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /// [MIT License]
    /// @title Base64
    /// @notice Provides a function for encoding some bytes in base64
    /// @author Brecht Devos <[email protected]>

    /// @notice Encodes some bytes to the base64 representation
    function base64encode(bytes memory data) external pure returns (string memory) {
        uint256 len = data.length;
        if (len == 0) return "";

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

        // Add some extra buffer at the end
        bytes memory result = new bytes(encodedLen + 32);

        bytes memory table = TABLE;

        assembly {
            let tablePtr := add(table, 1)
            let resultPtr := add(result, 32)

            for {
                let i := 0
            } lt(i, len) {

            } {
                i := add(i, 3)
                let input := and(mload(add(data, i)), 0xffffff)

                let out := mload(add(tablePtr, and(shr(18, input), 0x3F)))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(12, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(shr(6, input), 0x3F))), 0xFF))
                out := shl(8, out)
                out := add(out, and(mload(add(tablePtr, and(input, 0x3F))), 0xFF))
                out := shl(224, out)

                mstore(resultPtr, out)

                resultPtr := add(resultPtr, 4)
            }

            switch mod(len, 3)
            case 1 {
                mstore(sub(resultPtr, 2), shl(240, 0x3d3d))
            }
            case 2 {
                mstore(sub(resultPtr, 1), shl(248, 0x3d))
            }

            mstore(result, encodedLen)
        }

        return string(result);
    }

    // @notice converts number to string
    function stringify(uint256 value) external pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT license
        // 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);
    }
}

File 13 of 30 : SeedPhraseUtils.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

import "@openzeppelin/contracts/utils/Strings.sol";
import "../interfaces/IKarmaScore.sol";
import "./NilProtocolUtils.sol";
import "../libraries/NilProtocolUtils.sol";

library SeedPhraseUtils {
    using Strings for uint256;
    using Strings for uint16;
    using Strings for uint8;

    struct Random {
        uint256 seed;
        uint256 offsetBit;
    }

    struct Colors {
        string background;
        string panel;
        string panel2;
        string panelStroke;
        string selectedCircleStroke;
        string selectedCircleFill;
        string selectedCircleFill2;
        string negativeCircleStroke;
        string negativeCircleFill;
        string blackOrWhite;
        string dynamicOpacity;
        string backgroundCircle;
    }

    struct Attrs {
        bool showStroke;
        bool border;
        bool showPanel;
        bool backgroundSquare;
        bool bigBackgroundCircle;
        bool showGrid;
        bool backgroundCircles;
        bool greyscale;
        bool doublePanel;
        uint16 bipWordId;
        uint16 secondBipWordId;
    }

    uint8 internal constant strokeWeight = 7;
    uint16 internal constant segmentSize = 100;
    uint16 internal constant radius = 50;
    uint16 internal constant padding = 10;
    uint16 internal constant viewBox = 1600;
    uint16 internal constant panelWidth = segmentSize * 4;
    uint16 internal constant panelHeight = segmentSize * 10;
    uint16 internal constant singlePanelX = (segmentSize * 6);
    uint16 internal constant doublePanel1X = (segmentSize * 3);
    uint16 internal constant doublePanel2X = doublePanel1X + (segmentSize * 6);
    uint16 internal constant panelY = (segmentSize * 3);

    function generateSeed(uint256 tokenId, uint256 vrfRandomValue) external view returns (bytes32) {
        return keccak256(abi.encode(tokenId, block.timestamp, block.difficulty, vrfRandomValue));
    }

    function _shouldAddTrait(
        bool isTrue,
        bytes memory trueName,
        bytes memory falseName,
        uint8 prevRank,
        uint8 newRank,
        bytes memory traits
    ) internal pure returns (bytes memory, uint8) {
        if (isTrue) {
            traits = abi.encodePacked(traits, ',{"value": "', trueName, '"}');
        }
        // Only add the falsy trait if it's named (e.g. there's no negative version of "greyscale")
        else if (falseName.length != 0) {
            traits = abi.encodePacked(traits, ',{"value": "', falseName, '"}');
        }

        // Return new (higher rank if trait is true)
        return (traits, (isTrue ? newRank : prevRank));
    }

    function tokenTraits(Attrs memory attributes) internal pure returns (bytes memory traits, uint8 rarityRating) {
        rarityRating = 0;
        traits = abi.encodePacked("[");
        // Add both words to trait if a double panel
        if (attributes.doublePanel) {
            traits = abi.encodePacked(
                traits,
                '{"trait_type": "Double Panel BIP39 IDs", "value": "',
                attributes.bipWordId.toString(),
                " - ",
                attributes.secondBipWordId.toString(),
                '"},',
                '{"value": "Double Panel"}'
            );
        } else {
            traits = abi.encodePacked(
                traits,
                '{"trait_type": "BIP39 ID",  "display_type": "number", "max_value": 2048, "value": ',
                attributes.bipWordId.toString(),
                "}"
            );
        }
        // Stroke trait - rank 1
        (traits, rarityRating) = _shouldAddTrait(
            !attributes.showStroke,
            "No Stroke",
            "OG Stroke",
            rarityRating,
            1,
            traits
        );
        // Border - rank 2
        (traits, rarityRating) = _shouldAddTrait(attributes.border, "Border", "", rarityRating, 2, traits);
        // No Panel - rank 3
        (traits, rarityRating) = _shouldAddTrait(
            !attributes.showPanel,
            "No Panel",
            "OG Panel",
            rarityRating,
            3,
            traits
        );
        // Symmetry Group Square - rank 4
        (traits, rarityRating) = _shouldAddTrait(
            attributes.backgroundSquare,
            "Group Square",
            "",
            rarityRating,
            4,
            traits
        );
        // Symmetry Group Circle - rank 5
        (traits, rarityRating) = _shouldAddTrait(
            attributes.bigBackgroundCircle,
            "Group Circle",
            "",
            rarityRating,
            5,
            traits
        );
        // Caged - rank 6
        (traits, rarityRating) = _shouldAddTrait(attributes.showGrid, "Caged", "", rarityRating, 6, traits);
        // Bubblewrap - rank 7
        (traits, rarityRating) = _shouldAddTrait(
            attributes.backgroundCircles,
            "Bubblewrap",
            "",
            rarityRating,
            7,
            traits
        );
        // Monochrome - rank 8
        (traits, rarityRating) = _shouldAddTrait(attributes.greyscale, "Monochrome", "", rarityRating, 8, traits);

        traits = abi.encodePacked(traits, "]");
    }

    /**
     * @notice Generates the art defining attributes
     * @param bipWordId bip39 word id
     * @param secondBipWordId ^ only for a double panel
     * @param random RNG
     * @param predefinedRarity double panels trait to carry over
     * @return attributes struct
     */
    function tokenAttributes(
        uint16 bipWordId,
        uint16 secondBipWordId,
        Random memory random,
        uint8 predefinedRarity
    ) internal pure returns (Attrs memory attributes) {
        attributes = Attrs({
            showStroke: (predefinedRarity == 1) ? false : _boolPercentage(random, 70), // rank 1
            border: (predefinedRarity == 2) ? true : _boolPercentage(random, 30), // rank 2
            showPanel: (predefinedRarity == 3) ? false : _boolPercentage(random, 80), // rank 3
            backgroundSquare: (predefinedRarity == 4) ? true : _boolPercentage(random, 18), // rank 4
            bigBackgroundCircle: (predefinedRarity == 5) ? true : _boolPercentage(random, 12), // rank = 5
            showGrid: (predefinedRarity == 6) ? true : _boolPercentage(random, 6), // rank 6
            backgroundCircles: (predefinedRarity == 7) ? true : _boolPercentage(random, 4), // rank 7
            greyscale: (predefinedRarity == 8) ? true : _boolPercentage(random, 2), // rank 8
            bipWordId: bipWordId,
            doublePanel: (secondBipWordId > 0),
            secondBipWordId: secondBipWordId
        });

        // Rare attributes should always superseed less-rare
        // If greyscale OR grid is true then turn on stroke (as it is required)
        if (attributes.showGrid || attributes.greyscale) {
            attributes.showStroke = true;
        }
        // backgroundCircles superseeds grid (they cannot co-exist)
        if (attributes.backgroundCircles) {
            attributes.showGrid = false;
        }
        // Border cannot be on if background shapes are turned on
        if (attributes.bigBackgroundCircle || attributes.backgroundSquare) {
            attributes.border = false;
            // Big Background Shapes cannot co-exist
            if (attributes.bigBackgroundCircle) {
                attributes.backgroundSquare = false;
            }
        }
    }

    /**
     * @notice Converts a tokenId (uint256) into the formats needed to generate the art
     * @param tokenId tokenId (also the BIP39 word)
     * @return tokenArray with prepended 0's (if tokenId is less that 4 digits) also returns in string format
     */
    function _transformTokenId(uint256 tokenId) internal pure returns (uint8[4] memory tokenArray, string memory) {
        bytes memory tokenString;
        uint8 digit;

        for (int8 i = 3; i >= 0; i--) {
            digit = uint8(tokenId % 10); // This returns the final digit in the token
            if (tokenId > 0) {
                tokenId = tokenId / 10; // this removes the last digit from the token as we've grabbed the digit already
                tokenArray[uint8(i)] = digit;
            }
            tokenString = abi.encodePacked(digit.toString(), tokenString);
        }

        return (tokenArray, string(tokenString));
    }

    function _renderText(string memory text, string memory color) internal pure returns (bytes memory svg) {
        svg = abi.encodePacked(
            "<text x='1500' y='1500' text-anchor='end' style='font:700 36px &quot;Courier New&quot;;fill:",
            color,
            ";opacity:.4'>#",
            text,
            "</text>"
        );

        return svg;
    }

    function _backgroundShapeSizing(Random memory random, Attrs memory attributes)
        internal
        pure
        returns (uint16, uint16)
    {
        uint256 idx;
        // If we DON'T have a 'doublePanel' or 'no panel' we can return the default sizing
        if (!attributes.doublePanel && attributes.showPanel) {
            uint16[2][6] memory defaultSizing = [
                [1275, 200],
                [1150, 375],
                [900, 300],
                [925, 225],
                [850, 150],
                [775, 125]
            ];
            idx = SeedPhraseUtils._next(random, 0, defaultSizing.length);
            return (defaultSizing[idx][0], defaultSizing[idx][1]);
        }

        // Otherwise we need to return some slightly different data
        if (attributes.bigBackgroundCircle) {
            uint16[2][4] memory restrictedCircleDimensions = [[1150, 150], [1275, 200], [1300, 100], [1350, 200]];
            idx = SeedPhraseUtils._next(random, 0, restrictedCircleDimensions.length);
            return (restrictedCircleDimensions[idx][0], restrictedCircleDimensions[idx][1]);
        }

        // Else we can assume that it is backgroundSquares
        uint16[2][4] memory restrictedSquareDimensions = [[1150, 50], [1100, 125], [1275, 200], [1300, 150]];
        idx = SeedPhraseUtils._next(random, 0, restrictedSquareDimensions.length);
        return (restrictedSquareDimensions[idx][0], restrictedSquareDimensions[idx][1]);
    }

    function _getStrokeStyle(
        bool showStroke,
        string memory color,
        string memory opacity,
        uint8 customStrokeWeight
    ) internal pure returns (bytes memory strokeStyle) {
        if (showStroke) {
            strokeStyle = abi.encodePacked(
                " style='stroke-opacity:",
                opacity,
                ";stroke:",
                color,
                ";stroke-width:",
                customStrokeWeight.toString(),
                "' "
            );

            return strokeStyle;
        }
    }

    function _getPalette(Random memory random, Attrs memory attributes) internal pure returns (Colors memory) {
        string[6] memory selectedPallet;
        uint8[6] memory lumosity;
        if (attributes.greyscale) {
            selectedPallet = ["#f8f9fa", "#c3c4c4", "#909091", "#606061", "#343435", "#0a0a0b"];
            lumosity = [249, 196, 144, 96, 52, 10];
        } else {
            uint256 randPalette = SeedPhraseUtils._next(random, 0, 25);
            if (randPalette == 0) {
                selectedPallet = ["#ffe74c", "#ff5964", "#ffffff", "#6bf178", "#35a7ff", "#5b3758"];
                lumosity = [225, 125, 255, 204, 149, 65];
            } else if (randPalette == 1) {
                selectedPallet = ["#ff0000", "#ff8700", "#e4ff33", "#a9ff1f", "#0aefff", "#0a33ff"];
                lumosity = [54, 151, 235, 221, 191, 57];
            } else if (randPalette == 2) {
                selectedPallet = ["#f433ab", "#cb04a5", "#934683", "#65334d", "#2d1115", "#e0e2db"];
                lumosity = [101, 58, 91, 64, 23, 225];
            } else if (randPalette == 3) {
                selectedPallet = ["#f08700", "#f6aa28", "#f9d939", "#00a6a6", "#bbdef0", "#23556c"];
                lumosity = [148, 177, 212, 131, 216, 76];
            } else if (randPalette == 4) {
                selectedPallet = ["#f7e6de", "#e5b59e", "#cb7d52", "#bb8f77", "#96624a", "#462b20"];
                lumosity = [233, 190, 138, 151, 107, 48];
            } else if (randPalette == 5) {
                selectedPallet = ["#f61379", "#d91cbc", "#da81ee", "#5011e4", "#4393ef", "#8edef6"];
                lumosity = [75, 80, 156, 46, 137, 207];
            } else if (randPalette == 6) {
                selectedPallet = ["#010228", "#006aa3", "#005566", "#2ac1df", "#82dded", "#dbf5fa"];
                lumosity = [5, 88, 68, 163, 203, 240];
            } else if (randPalette == 7) {
                selectedPallet = ["#f46036", "#5b85aa", "#414770", "#372248", "#171123", "#f7f5fb"];
                lumosity = [124, 127, 73, 41, 20, 246];
            } else if (randPalette == 8) {
                selectedPallet = ["#393d3f", "#fdfdff", "#c6c5b9", "#62929e", "#546a7b", "#c52233"];
                lumosity = [60, 253, 196, 137, 103, 70];
            } else if (randPalette == 9) {
                selectedPallet = ["#002626", "#0e4749", "#95c623", "#e55812", "#efe7da", "#8ddbe0"];
                lumosity = [30, 59, 176, 113, 232, 203];
            } else if (randPalette == 10) {
                selectedPallet = ["#03071e", "#62040d", "#d00000", "#e85d04", "#faa307", "#ffcb47"];
                lumosity = [8, 25, 44, 116, 170, 205];
            } else if (randPalette == 11) {
                selectedPallet = ["#f56a00", "#ff931f", "#ffd085", "#20003d", "#7b2cbf", "#c698eb"];
                lumosity = [128, 162, 213, 11, 71, 168];
            } else if (randPalette == 12) {
                selectedPallet = ["#800016", "#ffffff", "#ff002b", "#407ba7", "#004e89", "#00043a"];
                lumosity = [29, 255, 57, 114, 66, 7];
            } else if (randPalette == 13) {
                selectedPallet = ["#d6d6d6", "#f9f7dc", "#ffee32", "#ffd100", "#202020", "#6c757d"];
                lumosity = [214, 245, 228, 204, 32, 116];
            } else if (randPalette == 14) {
                selectedPallet = ["#fff5d6", "#ccc5b9", "#403d39", "#252422", "#eb5e28", "#bb4111"];
                lumosity = [245, 198, 61, 36, 120, 87];
            } else if (randPalette == 15) {
                selectedPallet = ["#0c0f0a", "#ff206e", "#fbff12", "#41ead4", "#6c20fd", "#ffffff"];
                lumosity = [14, 85, 237, 196, 224, 255];
            } else if (randPalette == 16) {
                selectedPallet = ["#fdd8d8", "#f67979", "#e51010", "#921314", "#531315", "#151315"];
                lumosity = [224, 148, 61, 46, 33, 20];
            } else if (randPalette == 17) {
                selectedPallet = ["#000814", "#002752", "#0066cc", "#f5bc00", "#ffd60a", "#ffee99"];
                lumosity = [7, 34, 88, 187, 208, 235];
            } else if (randPalette == 18) {
                selectedPallet = ["#010b14", "#022d4f", "#fdfffc", "#2ec4b6", "#e71d36", "#ff990a"];
                lumosity = [10, 38, 254, 163, 74, 164];
            } else if (randPalette == 19) {
                selectedPallet = ["#fd650d", "#d90368", "#820263", "#291720", "#06efa9", "#0d5943"];
                lumosity = [127, 56, 36, 27, 184, 71];
            } else if (randPalette == 20) {
                selectedPallet = ["#002914", "#005200", "#34a300", "#70e000", "#aef33f", "#e0ff85"];
                lumosity = [31, 59, 128, 184, 215, 240];
            } else if (randPalette == 21) {
                selectedPallet = ["#001413", "#fafffe", "#6f0301", "#a92d04", "#f6b51d", "#168eb6"];
                lumosity = [16, 254, 26, 68, 184, 119];
            } else if (randPalette == 22) {
                selectedPallet = ["#6a1f10", "#d53e20", "#f7d1ca", "#c4f3fd", "#045362", "#fffbfa"];
                lumosity = [46, 92, 217, 234, 67, 252];
            } else if (randPalette == 23) {
                selectedPallet = ["#6b42ff", "#a270ff", "#dda1f7", "#ffd6eb", "#ff8fb2", "#f56674"];
                lumosity = [88, 133, 180, 224, 169, 133];
            } else if (randPalette == 24) {
                selectedPallet = ["#627132", "#273715", "#99a271", "#fefae1", "#e0a35c", "#bf6b21"];
                lumosity = [105, 49, 157, 249, 171, 120];
            }
        }

        // Randomize pallet order here...
        return _shufflePallet(random, selectedPallet, lumosity, attributes);
    }

    function _shufflePallet(
        Random memory random,
        string[6] memory hexColors,
        uint8[6] memory lumaValues,
        Attrs memory attributes
    ) internal pure returns (Colors memory) {
        // Shuffle colors and luma values with the same index
        for (uint8 i = 0; i < hexColors.length; i++) {
            // n = Pick random i > (array length - i)
            uint256 n = i + SeedPhraseUtils._next(random, 0, (hexColors.length - i));
            // temp = Temporarily store value from array[n]
            string memory tempHex = hexColors[n];
            uint8 tempLuma = lumaValues[n];
            // Swap n value with i value
            hexColors[n] = hexColors[i];
            hexColors[i] = tempHex;
            lumaValues[n] = lumaValues[i];
            lumaValues[i] = tempLuma;
        }

        Colors memory pallet = Colors({
            background: hexColors[0],
            panel: hexColors[1],
            panel2: "", // panel2 should match selected circles
            panelStroke: hexColors[2],
            selectedCircleStroke: hexColors[2], // Match panel stroke
            negativeCircleStroke: hexColors[3],
            negativeCircleFill: hexColors[4],
            selectedCircleFill: hexColors[5],
            selectedCircleFill2: "", // should match panel1
            backgroundCircle: "",
            blackOrWhite: lumaValues[0] < 150 ? "#fff" : "#000",
            dynamicOpacity: lumaValues[0] < 150 ? "0.08" : "0.04"
        });

        if (attributes.doublePanel) {
            pallet.panel2 = pallet.selectedCircleFill;
            pallet.selectedCircleFill2 = pallet.panel;
        }

        if (attributes.bigBackgroundCircle) {
            // Set background circle colors here
            pallet.backgroundCircle = pallet.background;
            pallet.background = pallet.panel;
            // Luma based on 'new background', previous background is used for bgCircleColor)
            pallet.blackOrWhite = lumaValues[1] < 150 ? "#fff" : "#000";
            pallet.dynamicOpacity = lumaValues[1] < 150 ? "0.08" : "0.04";
        }

        return pallet;
    }

    /// @notice get an random number between (min and max) using seed and offseting bits
    ///         this function assumes that max is never bigger than 0xffffff (hex color with opacity included)
    /// @dev this function is simply used to get random number using a seed.
    ///      if does bitshifting operations to try to reuse the same seed as much as possible.
    ///      should be enough for anyth
    /// @param random the randomizer
    /// @param min the minimum
    /// @param max the maximum
    /// @return result the resulting pseudo random number
    function _next(
        Random memory random,
        uint256 min,
        uint256 max
    ) internal pure returns (uint256 result) {
        uint256 newSeed = random.seed;
        uint256 newOffset = random.offsetBit + 3;

        uint256 maxOffset = 4;
        uint256 mask = 0xf;
        if (max > 0xfffff) {
            mask = 0xffffff;
            maxOffset = 24;
        } else if (max > 0xffff) {
            mask = 0xfffff;
            maxOffset = 20;
        } else if (max > 0xfff) {
            mask = 0xffff;
            maxOffset = 16;
        } else if (max > 0xff) {
            mask = 0xfff;
            maxOffset = 12;
        } else if (max > 0xf) {
            mask = 0xff;
            maxOffset = 8;
        }

        // if offsetBit is too high to get the max number
        // just get new seed and restart offset to 0
        if (newOffset > (256 - maxOffset)) {
            newOffset = 0;
            newSeed = uint256(keccak256(abi.encode(newSeed)));
        }

        uint256 offseted = (newSeed >> newOffset);
        uint256 part = offseted & mask;
        result = min + (part % (max - min));

        random.seed = newSeed;
        random.offsetBit = newOffset;
    }

    function _boolPercentage(Random memory random, uint256 percentage) internal pure returns (bool) {
        // E.G. If percentage = 30, and random = 0-29 we return true
        // Percentage = 1, random = 0 (TRUE)
        return (SeedPhraseUtils._next(random, 0, 100) < percentage);
    }

    /// @param random source of randomness (based on tokenSeed)
    /// @param attributes art attributes
    /// @return the json
    function render(SeedPhraseUtils.Random memory random, SeedPhraseUtils.Attrs memory attributes)
        external
        pure
        returns (string memory)
    {
        // Get color pallet
        SeedPhraseUtils.Colors memory pallet = SeedPhraseUtils._getPalette(random, attributes);

        //  Start SVG (viewbox & static patterns)
        bytes memory svg = abi.encodePacked(
            "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1600'><path fill='",
            pallet.background,
            "' ",
            SeedPhraseUtils._getStrokeStyle(attributes.border, pallet.blackOrWhite, "0.3", 50),
            " d='M0 0h1600v1600H0z'/>",
            "  <pattern id='panelCircles' x='0' y='0' width='.25' height='.1' patternUnits='objectBoundingBox'>",
            "<circle cx='50' cy='50' r='40' fill='",
            pallet.negativeCircleFill,
            "' ",
            SeedPhraseUtils._getStrokeStyle(attributes.showStroke, pallet.negativeCircleStroke, "1", strokeWeight),
            " /></pattern>"
        );
        // Render optional patterns (grid OR background circles)
        if (attributes.backgroundCircles) {
            svg = abi.encodePacked(
                svg,
                "<pattern id='backgroundCircles' x='0' y='0' width='100' height='100'",
                " patternUnits='userSpaceOnUse'><circle cx='50' cy='50' r='40' fill='",
                pallet.blackOrWhite,
                "' style='fill-opacity: ",
                pallet.dynamicOpacity,
                ";'></circle></pattern><path fill='url(#backgroundCircles)' d='M0 0h1600v1600H0z'/>"
            );
        } else if (attributes.showGrid) {
            svg = abi.encodePacked(
                svg,
                "<pattern id='grid' x='0' y='0' width='100' height='100'",
                " patternUnits='userSpaceOnUse'><rect x='0' y='0' width='100' height='100' fill='none' ",
                SeedPhraseUtils._getStrokeStyle(true, pallet.blackOrWhite, pallet.dynamicOpacity, strokeWeight),
                " /></pattern><path fill='url(#grid)' d='M0 0h1600v1600H0z'/>"
            );
        }
        if (attributes.bigBackgroundCircle) {
            (uint16 shapeSize, uint16 stroke) = SeedPhraseUtils._backgroundShapeSizing(random, attributes);
            // uint16 centerCircle = (viewBox / 2); // Viewbox = 1600, Center = 800
            svg = abi.encodePacked(
                svg,
                "<circle cx='800' cy='800' r='",
                (shapeSize / 2).toString(),
                "' fill='",
                pallet.backgroundCircle,
                "' stroke='",
                pallet.negativeCircleStroke,
                "' style='stroke-width:",
                stroke.toString(),
                ";stroke-opacity:0.3'/>"
            );
        } else if (attributes.backgroundSquare) {
            (uint16 shapeSize, uint16 stroke) = SeedPhraseUtils._backgroundShapeSizing(random, attributes);
            uint16 centerSquare = ((viewBox - shapeSize) / 2);
            svg = abi.encodePacked(
                svg,
                "<rect x='",
                centerSquare.toString(),
                "' y='",
                centerSquare.toString(),
                "' width='",
                shapeSize.toString(),
                "' height='",
                shapeSize.toString(),
                "' fill='",
                pallet.backgroundCircle,
                "' stroke='",
                pallet.negativeCircleStroke,
                "' style='stroke-width:",
                stroke.toString(),
                ";stroke-opacity:0.3'/>"
            );
        }

        // Double panel (only if holder has burned two tokens from the defined pairings)
        if (attributes.doublePanel) {
            (uint8[4] memory firstBipIndexArray, string memory firstBipIndexStr) = SeedPhraseUtils._transformTokenId(
                attributes.bipWordId
            );
            (uint8[4] memory secondBipIndexArray, string memory secondBipIndexStr) = SeedPhraseUtils._transformTokenId(
                attributes.secondBipWordId
            );

            svg = abi.encodePacked(
                svg,
                _renderSinglePanel(firstBipIndexArray, attributes, pallet, doublePanel1X, false),
                _renderSinglePanel(secondBipIndexArray, attributes, pallet, doublePanel2X, true)
            );

            // Create text
            bytes memory combinedText = abi.encodePacked(firstBipIndexStr, " - #", secondBipIndexStr);
            svg = abi.encodePacked(
                svg,
                SeedPhraseUtils._renderText(string(combinedText), pallet.blackOrWhite),
                "</svg>"
            );
        }
        // Single Panel
        else {
            (uint8[4] memory bipIndexArray, string memory bipIndexStr) = SeedPhraseUtils._transformTokenId(
                attributes.bipWordId
            );
            svg = abi.encodePacked(svg, _renderSinglePanel(bipIndexArray, attributes, pallet, singlePanelX, false));

            // Add closing text and svg element
            svg = abi.encodePacked(svg, SeedPhraseUtils._renderText(bipIndexStr, pallet.blackOrWhite), "</svg>");
        }

        return string(svg);
    }

    function _renderSinglePanel(
        uint8[4] memory bipIndexArray,
        SeedPhraseUtils.Attrs memory attributes,
        SeedPhraseUtils.Colors memory pallet,
        uint16 panelX,
        bool secondPanel
    ) internal pure returns (bytes memory panelSvg) {
        // Draw panels
        bool squareEdges = (attributes.doublePanel && attributes.backgroundSquare);
        if (attributes.showPanel) {
            panelSvg = abi.encodePacked(
                "<rect x='",
                (panelX - padding).toString(),
                "' y='",
                (panelY - padding).toString(),
                "' width='",
                (panelWidth + (padding * 2)).toString(),
                "' height='",
                (panelHeight + (padding * 2)).toString(),
                "' rx='",
                (squareEdges ? 0 : radius).toString(),
                "' fill='",
                (secondPanel ? pallet.panel2 : pallet.panel),
                "' ",
                SeedPhraseUtils._getStrokeStyle(attributes.showStroke, pallet.panelStroke, "1", strokeWeight),
                "/>"
            );
        }
        // Fill panel with negative circles, should resemble M600 300h400v1000H600z
        panelSvg = abi.encodePacked(
            panelSvg,
            "<path fill='url(#panelCircles)' d='M",
            panelX.toString(),
            " ",
            panelY.toString(),
            "h",
            panelWidth.toString(),
            "v",
            panelHeight.toString(),
            "H",
            panelX.toString(),
            "z'/>"
        );
        // Draw selected circles
        panelSvg = abi.encodePacked(
            panelSvg,
            _renderSelectedCircles(bipIndexArray, pallet, attributes.showStroke, panelX, secondPanel)
        );
    }

    function _renderSelectedCircles(
        uint8[4] memory bipIndexArray,
        SeedPhraseUtils.Colors memory pallet,
        bool showStroke,
        uint16 panelX,
        bool secondPanel
    ) internal pure returns (bytes memory svg) {
        for (uint8 i = 0; i < bipIndexArray.length; i++) {
            svg = abi.encodePacked(
                svg,
                "<circle cx='",
                (panelX + (segmentSize * i) + radius).toString(),
                "' cy='",
                (panelY + (segmentSize * bipIndexArray[i]) + radius).toString(),
                "' r='41' fill='", // Increase the size a tiny bit here (+1) to hide negative circle outline
                (secondPanel ? pallet.selectedCircleFill2 : pallet.selectedCircleFill),
                "' ",
                SeedPhraseUtils._getStrokeStyle(showStroke, pallet.selectedCircleStroke, "1", strokeWeight),
                " />"
            );
        }
    }

    function getRarityRating(bytes32 tokenSeed) external pure returns (uint8) {
        SeedPhraseUtils.Random memory random = SeedPhraseUtils.Random({ seed: uint256(tokenSeed), offsetBit: 0 });
        (, uint8 rarityRating) = SeedPhraseUtils.tokenTraits(SeedPhraseUtils.tokenAttributes(0, 0, random, 0));

        return rarityRating;
    }

    function getTraitsAndAttributes(
        uint16 bipWordId,
        uint16 secondBipWordId,
        uint8 rarityValue,
        SeedPhraseUtils.Random memory random
    ) external pure returns (bytes memory, SeedPhraseUtils.Attrs memory) {
        SeedPhraseUtils.Attrs memory attributes = SeedPhraseUtils.tokenAttributes(
            bipWordId,
            secondBipWordId,
            random,
            rarityValue
        );

        (bytes memory traits, ) = SeedPhraseUtils.tokenTraits(attributes);

        return (traits, attributes);
    }

    function getKarma(IKarmaScore karma, bytes memory data, address account) external view returns (uint256) {
        if (data.length > 0) {
            (, uint256 karmaScore, ) = abi.decode(data, (address, uint256, bytes32[]));
            if (karma.verify(account, karmaScore, data)) {
                return account == address(0) ? 1000 : karmaScore;
            }
        }
        return 1000;
    }

    function shuffleBipWords(uint256 randomValue) external pure returns (uint16[] memory) {
        uint16 size = 2048;
        uint16[] memory result = new uint16[](size);

        // Initialize array.
        for (uint16 i = 0; i < size; i++) {
            result[i] = i + 1;
        }

        // Set the initial randomness based on the provided entropy from VRF.
        bytes32 random = keccak256(abi.encodePacked(randomValue));

        // Set the last item of the array which will be swapped.
        uint16 lastItem = size - 1;

        // We need to do `size - 1` iterations to completely shuffle the array.
        for (uint16 i = 1; i < size - 1; i++) {
            // Select a number based on the randomness.
            uint16 selectedItem = uint16(uint256(random) % lastItem);

            // Swap items `selected_item <> last_item`.
            (result[lastItem], result[selectedItem]) = (result[selectedItem], result[lastItem]);

            // Decrease the size of the possible shuffle
            // to preserve the already shuffled items.
            // The already shuffled items are at the end of the array.
            lastItem--;

            // Generate new randomness.
            random = keccak256(abi.encodePacked(random));
        }

        return result;
    }

    function getDescriptionPt1() internal pure returns (string memory) {
        return "\"Seed Phrase is a 'Crypto Native' *fully* on-chain collection.\\n\\nA '*SEED*' is unique, it represents a single word from the BIP-0039 word list (the most commonly used word list to generate a seed/recovery phrase, think of it as a dictionary that only holds 2048 words).\\n\\n***Your 'SEED*' = *Your 'WORD*' in the list.**  \\nClick [here](https://www.seedphrase.codes/token?id=";

    }

    function getDescriptionPt2() internal pure returns (string memory) {
        return ") to decipher *your 'SEED*' and find out which word it translates to!\\n\\nFor Licensing, T&Cs or any other info, please visit: [www.seedphrase.codes](https://www.seedphrase.codes/).\"";
    }

    function getTokenURI(string memory output, bytes memory traits, uint256 tokenId) external pure returns (string memory) {
        return string(
            abi.encodePacked(
                "data:application/json;base64,",
                    NilProtocolUtils.base64encode(
                    bytes(
                        string(
                            abi.encodePacked(
                                '{"name": "Seed Phrase #',
                                    NilProtocolUtils.stringify(tokenId),
                                '", "image": "data:image/svg+xml;base64,',
                                    NilProtocolUtils.base64encode(bytes(output)),
                                '", "attributes": ',
                                traits,
                                ', "description": ',
                                getDescriptionPt1(),
                                tokenId.toString(),
                                getDescriptionPt2(),
                                "}"
                            )
                        )
                    )
                )
            )
        );
    }

}

File 14 of 30 : 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 15 of 30 : 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 16 of 30 : 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 17 of 30 : 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 18 of 30 : 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 19 of 30 : 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 20 of 30 : 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 21 of 30 : 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 22 of 30 : 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 23 of 30 : NilPassCore.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "../interfaces/IN.sol";
import "../interfaces/INilPass.sol";
import "../interfaces/IPricingStrategy.sol";

/**
 * @title NilPassCore contract
 * @author Tony Snark
 * @notice This contract provides basic functionalities to allow minting using the NilPass
 * @dev This contract should be used only for testing or testnet deployments
 */
abstract contract NilPassCore is ERC721Enumerable, ReentrancyGuard, AccessControl, INilPass, IPricingStrategy {
    uint128 public constant MAX_MULTI_MINT_AMOUNT = 32;
    uint128 public constant MAX_N_TOKEN_ID = 8888;
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN");
    bytes32 public constant DAO_ROLE = keccak256("DAO");

    IN public immutable n;
    uint16 public reserveMinted;
    uint256 public mintedOutsideNRange;
    address public masterMint;
    DerivativeParameters public derivativeParams;
    uint128 maxTokenId;

    struct DerivativeParameters {
        bool onlyNHolders;
        bool supportsTokenId;
        uint16 reservedAllowance;
        uint128 maxTotalSupply;
        uint128 maxMintAllowance;
    }

    event Minted(address to, uint256 tokenId);

    /**
     * @notice Construct an NilPassCore instance
     * @param name Name of the token
     * @param symbol Symbol of the token
     * @param n_ Address of your n instance (only for testing)
     * @param derivativeParams_ Parameters describing the derivative settings
     * @param masterMint_ Address of the master mint contract
     * @param dao_ Address of the NIL DAO
     */
    constructor(
        string memory name,
        string memory symbol,
        IN n_,
        DerivativeParameters memory derivativeParams_,
        address masterMint_,
        address dao_
    ) ERC721(name, symbol) {
        derivativeParams = derivativeParams_;
        require(derivativeParams.maxTotalSupply > 0, "NilPass:INVALID_SUPPLY");
        require(
            !derivativeParams.onlyNHolders ||
                (derivativeParams.onlyNHolders && derivativeParams.maxTotalSupply <= MAX_N_TOKEN_ID),
            "NilPass:INVALID_SUPPLY"
        );
        require(derivativeParams.maxTotalSupply >= derivativeParams.reservedAllowance, "NilPass:INVALID_ALLOWANCE");
        require(masterMint_ != address(0), "NilPass:INVALID_MASTERMINT");
        require(dao_ != address(0), "NilPass:INVALID_DAO");
        n = n_;
        masterMint = masterMint_;
        derivativeParams.maxMintAllowance = derivativeParams.maxMintAllowance < MAX_MULTI_MINT_AMOUNT
            ? derivativeParams.maxMintAllowance
            : MAX_MULTI_MINT_AMOUNT;
        maxTokenId = derivativeParams.maxTotalSupply > MAX_N_TOKEN_ID
            ? derivativeParams.maxTotalSupply
            : MAX_N_TOKEN_ID;
        _setupRole(ADMIN_ROLE, msg.sender);
        _setupRole(DAO_ROLE, dao_);
        _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);
        _setRoleAdmin(DAO_ROLE, DAO_ROLE);
    }

    modifier onlyAdmin() {
        require(hasRole(ADMIN_ROLE, msg.sender), "Nil:ACCESS_DENIED");
        _;
    }

    modifier onlyDAO() {
        require(hasRole(DAO_ROLE, msg.sender), "Nil:ACCESS_DENIED");
        _;
    }

    /**
     * @notice Allow anyone to mint a token with the supply id if this pass is unrestricted.
     *         n token holders can use this function without using the n token holders allowance,
     *         this is useful when the allowance is fully utilized.
     */
    function mint(
        address,
        uint8,
        uint256,
        bytes calldata
    ) public virtual override nonReentrant {
        require(false, "MINTING DISABLED");
    }

    /**
     * @notice Allow anyone to mint multiple tokens with the provided IDs if this pass is unrestricted.
     *         n token holders can use this function without using the n token holders allowance,
     *         this is useful when the allowance is fully utilized.
     */
    function mintTokenId(
        address,
        uint256[] calldata,
        uint256,
        bytes calldata
    ) public virtual override nonReentrant {
        require(false, "MINTING DISABLED");
    }

    /**
     * @notice Allow a n token holder to bulk mint tokens with id of their n tokens' id
     */
    function mintWithN(
        address,
        uint256[] calldata,
        uint256,
        bytes calldata
    ) public virtual override nonReentrant {
        require(false, "MINTING DISABLED");
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`
     */
    function _safeMint(address to, uint256 tokenId) internal virtual override {
        require(msg.sender == masterMint, "NilPass:INVALID_MINTER");
        super._safeMint(to, tokenId);
        emit Minted(to, tokenId);
    }

    /**
     * @notice Set the exclusivity flag to only allow N holders to mint
     * @param status Boolean to enable or disable N holder exclusivity
     */
    function setOnlyNHolders(bool status) public onlyAdmin {
        derivativeParams.onlyNHolders = status;
    }

    /**
     * @notice Calculate the currently available number of reserved tokens for n token holders
     * @return Reserved mint available
     */
    function nHoldersMintsAvailable() public view returns (uint256) {
        return derivativeParams.reservedAllowance - reserveMinted;
    }

    /**
     * @notice Calculate the currently available number of open mints
     * @return Open mint available
     */
    function openMintsAvailable() public view returns (uint256) {
        uint256 maxOpenMints = derivativeParams.maxTotalSupply - derivativeParams.reservedAllowance;
        uint256 currentOpenMints = totalSupply() - reserveMinted;
        return maxOpenMints - currentOpenMints;
    }

    /**
     * @notice Calculate the total available number of mints
     * @return total mint available
     */
    function totalMintsAvailable() public view virtual override returns (uint256) {
        return nHoldersMintsAvailable() + openMintsAvailable();
    }

    function mintParameters() external view override returns (INilPass.MintParams memory) {
        return
            INilPass.MintParams({
                reservedAllowance: derivativeParams.reservedAllowance,
                maxTotalSupply: derivativeParams.maxTotalSupply,
                openMintsAvailable: openMintsAvailable(),
                totalMintsAvailable: totalMintsAvailable(),
                nHoldersMintsAvailable: nHoldersMintsAvailable(),
                nHolderPriceInWei: getNextPriceForNHoldersInWei(1, address(0x1), ""),
                openPriceInWei: getNextPriceForOpenMintInWei(1, address(0x1), ""),
                totalSupply: totalSupply(),
                onlyNHolders: derivativeParams.onlyNHolders,
                maxMintAllowance: derivativeParams.maxMintAllowance,
                supportsTokenId: derivativeParams.supportsTokenId
            });
    }

    /**
     * @notice Check if a token with an Id exists
     * @param tokenId The token Id to check for
     */
    function tokenExists(uint256 tokenId) external view override returns (bool) {
        return _exists(tokenId);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC721Enumerable, IERC165, AccessControl)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }

    function maxTotalSupply() external view override returns (uint256) {
        return derivativeParams.maxTotalSupply;
    }

    function reservedAllowance() public view returns (uint16) {
        return derivativeParams.reservedAllowance;
    }

    function getNextPriceForNHoldersInWei(
        uint256 numberOfMints,
        address account,
        bytes memory data
    ) public view virtual override returns (uint256);

    function getNextPriceForOpenMintInWei(
        uint256 numberOfMints,
        address account,
        bytes memory data
    ) public view virtual override returns (uint256);

    function canMint(address account, bytes calldata data) external view virtual override returns (bool);
}

File 24 of 30 : 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 25 of 30 : 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 26 of 30 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 27 of 30 : INilPass.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";

interface INilPass is IERC721Enumerable {
    struct MintParams {
        uint256 reservedAllowance;
        uint256 maxTotalSupply;
        uint256 nHoldersMintsAvailable;
        uint256 openMintsAvailable;
        uint256 totalMintsAvailable;
        uint256 nHolderPriceInWei;
        uint256 openPriceInWei;
        uint256 totalSupply;
        uint256 maxMintAllowance;
        bool onlyNHolders;
        bool supportsTokenId;
    }

    function mint(
        address recipient,
        uint8 amount,
        uint256 paid,
        bytes calldata data
    ) external;

    function mintTokenId(
        address recipient,
        uint256[] calldata tokenIds,
        uint256 paid,
        bytes calldata data
    ) external;

    function mintWithN(
        address recipient,
        uint256[] calldata tokenIds,
        uint256 paid,
        bytes calldata data
    ) external;

    function totalMintsAvailable() external view returns (uint256);

    function maxTotalSupply() external view returns (uint256);

    function mintParameters() external view returns (MintParams memory);

    function tokenExists(uint256 tokenId) external view returns (bool);

    function canMint(address account, bytes calldata data) external view returns (bool);

    function nUsed(uint256 nid) external view returns (bool);
}

File 28 of 30 : IPricingStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;

interface IPricingStrategy {
    /**
     * @notice Returns the next price for an N mint
     */
    function getNextPriceForNHoldersInWei(
        uint256 numberOfMints,
        address account,
        bytes memory data
    ) external view returns (uint256);

    /**
     * @notice Returns the next price for an open mint
     */
    function getNextPriceForOpenMintInWei(
        uint256 numberOfMints,
        address account,
        bytes memory data
    ) external view returns (uint256);
}

File 29 of 30 : 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 30 of 30 : 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;
}

Settings
{
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 300
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {
    "contracts/libraries/SeedPhraseUtils.sol": {
      "SeedPhraseUtils": "0x0612405007bef3dcb751057819480e89f32a03e0"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"n","type":"address"},{"internalType":"address","name":"masterMint","type":"address"},{"internalType":"address","name":"dao","type":"address"},{"internalType":"address","name":"nOwnersRegistry","type":"address"},{"internalType":"address","name":"vrfCoordinator","type":"address"},{"internalType":"address","name":"linkToken","type":"address"},{"internalType":"address","name":"karmaAddress","type":"address"},{"internalType":"address","name":"rarible","type":"address"}],"internalType":"struct SeedPhrase.ContractAddresses","name":"contractAddresses","type":"tuple"},{"internalType":"bytes32","name":"_vrfKeyHash","type":"bytes32"},{"internalType":"uint256","name":"_linkFee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"firstBurntToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secondBurntToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"doublePaneledToken","type":"uint256"}],"name":"Burnt","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Minted","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"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DAO_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MULTI_MINT_AMOUNT","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_N_TOKEN_ID","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"airdropGenesisSketch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[][]","name":"pairings","type":"uint16[][]"}],"name":"amendPairings","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":"firstTokenId","type":"uint256"},{"internalType":"uint256","name":"secondTokenId","type":"uint256"}],"name":"burnForDoublePanel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"canMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"derivativeParams","outputs":[{"internalType":"bool","name":"onlyNHolders","type":"bool"},{"internalType":"bool","name":"supportsTokenId","type":"bool"},{"internalType":"uint16","name":"reservedAllowance","type":"uint16"},{"internalType":"uint128","name":"maxTotalSupply","type":"uint128"},{"internalType":"uint128","name":"maxMintAllowance","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDoubleBurnedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfMints","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"getNextPriceForNHoldersInWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfMints","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"getNextPriceForOpenMintInWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"getVrfSeed","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","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":[{"internalType":"uint16","name":"first","type":"uint16"},{"internalType":"uint16","name":"second","type":"uint16"}],"name":"isValidPairing","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"karma","outputs":[{"internalType":"contract IKarmaScore","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterMint","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint8","name":"amount","type":"uint8"},{"internalType":"uint256","name":"paid","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"addr","type":"address"}],"name":"mintOrphanedPieces","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"mintOwnerSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintParameters","outputs":[{"components":[{"internalType":"uint256","name":"reservedAllowance","type":"uint256"},{"internalType":"uint256","name":"maxTotalSupply","type":"uint256"},{"internalType":"uint256","name":"nHoldersMintsAvailable","type":"uint256"},{"internalType":"uint256","name":"openMintsAvailable","type":"uint256"},{"internalType":"uint256","name":"totalMintsAvailable","type":"uint256"},{"internalType":"uint256","name":"nHolderPriceInWei","type":"uint256"},{"internalType":"uint256","name":"openPriceInWei","type":"uint256"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"maxMintAllowance","type":"uint256"},{"internalType":"bool","name":"onlyNHolders","type":"bool"},{"internalType":"bool","name":"supportsTokenId","type":"bool"}],"internalType":"struct INilPass.MintParams","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"mintTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256","name":"paid","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintWithN","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintedOutsideNRange","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"n","outputs":[{"internalType":"contract IN","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nHoldersMintsAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nOwnerResolver","outputs":[{"internalType":"contract INOwnerResolver","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openMintsAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum SeedPhrasePricing.PreSaleType","name":"","type":"uint8"}],"name":"presaleLimits","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rarible","outputs":[{"internalType":"contract IRarible","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":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserveMinted","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reservedAllowance","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","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":"bool","name":"_burnActiveState","type":"bool"}],"name":"setBurnActiveState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"setGenesisSketchAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"name":"setOgAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setOnlyNHolders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_preSaleActiveState","type":"bool"}],"name":"setPreSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_time","type":"uint32"}],"name":"setPreSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_publicSaleActiveState","type":"bool"}],"name":"setPublicSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_time","type":"uint32"}],"name":"setPublicSaleTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_saleHaltedState","type":"bool"}],"name":"setSaleHaltedState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shuffleBipWords","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":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"tokenSVG","outputs":[{"internalType":"string","name":"svg","type":"string"},{"internalType":"bytes","name":"","type":"bytes"}],"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":"totalMintsAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]

61080061014081815262010160604052906101606201000080368337505081516200003292601b92506020019062000881565b506040805160a08101825260008082526020820181905291810191909152610800606082015260046080909101819052602980546001600160a01b03191665080000000000179055602a80546001600160801b03191690911790553480156200009a57600080fd5b506040516200692138038062006921833981016040819052620000bd91620009e2565b60808084015160a080860151604080518082018252600b81526a536565642050687261736560a81b602080830191825283518085018552600481526314d1515160e21b818301528b518551978801865260295460ff80821615158a5261010082041615158985015261ffff62010000820416898801526001600160801b03640100000000909104811660608a0152602a541699880199909952908b0151938b015183519798959793969195949193666a94d74f4300009366d529ae9e860000939291899189918991899187918791879187916200019d9160009162000931565b508051620001b390600190602084019062000931565b50506001600a55508251600f805460208601516040870151606088015161ffff1990931694151561ff00191694909417610100911515919091021762010000600160a01b0319166201000061ffff90941693909302600160201b600160a01b031916929092176401000000006001600160801b03938416810291909117918290556080860151601080546001600160801b031916918516919091179055900416620002a55760405162461bcd60e51b815260206004820152601660248201527f4e696c506173733a494e56414c49445f535550504c590000000000000000000060448201526064015b60405180910390fd5b600f5460ff161580620002dc5750600f5460ff168015620002dc5750600f546122b86401000000009091046001600160801b031611155b6200032a5760405162461bcd60e51b815260206004820152601660248201527f4e696c506173733a494e56414c49445f535550504c590000000000000000000060448201526064016200029c565b600f5462010000810461ffff166401000000009091046001600160801b03161015620003995760405162461bcd60e51b815260206004820152601960248201527f4e696c506173733a494e56414c49445f414c4c4f57414e43450000000000000060448201526064016200029c565b6001600160a01b038216620003f15760405162461bcd60e51b815260206004820152601a60248201527f4e696c506173733a494e56414c49445f4d41535445524d494e5400000000000060448201526064016200029c565b6001600160a01b038116620004495760405162461bcd60e51b815260206004820152601360248201527f4e696c506173733a494e56414c49445f44414f0000000000000000000000000060448201526064016200029c565b606084901b6001600160601b031916608052600e80546001600160a01b0319166001600160a01b03841617905560105460206001600160801b039091161062000494576020620004a1565b6010546001600160801b03165b601080546001600160801b0319166001600160801b03928316179055600f546122b864010000000090910490911611620004de576122b8620004f3565b600f5464010000000090046001600160801b03165b601180546001600160801b0319166001600160801b03929092169190911790556200052e600080516020620069018339815191523362000779565b62000549600080516020620068e18339815191528262000779565b62000564600080516020620069018339815191528062000789565b6200057f600080516020620068e18339815191528062000789565b5050506012969096555050506013919091555050505050606092831b6001600160601b031990811660c0529190921b1660a05250620005cb6016620007d4602090811b6200375a17901c565b60196020527f77e53f5d8115e854915e54bd6f2fd46db8b881fe7106ff61c7d2a90a39a8983b805461ffff19908116610190179091557f3e323a6e0522b016fa22111dfed945f89456f9f44f69eac00209d92607a5b94080546103209083161790557fd2ac945fcc0096878c763e37d6929b78378c1a2defabde8ba7ee5ed1d6e7a5b28054821660281790557ffc941c3961fb6541da34150022cddf959da0fb2353866a6bfbd249c2da092914805461012c908316811790915560026000527f6f678ad17c55bce407239525f4bf7f1fe99197d3eb69bfdd9a0db84a9a11b5818054909216179055606083810151811b6001600160601b03199081166101005260e080860151831b8216905260c085015190911b1661012052601c8054620ac7b0601f55600160401b600160a81b0319167461ba494061ba2d2003fc00081400000000000000001790556080830151602180546001600160a01b03199081166001600160a01b039384161790915560a09094015160228054861691909216179055601e5560235560178054737f05f27cc5d83c3e879c53882de13cc1cbce8a8c921691909117905562000b25565b620007858282620007dd565b5050565b6000828152600b6020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b80546001019055565b6000828152600b602090815260408083206001600160a01b038516845290915290205460ff1662000785576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200083d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b82805482825590600052602060002090600f016010900481019282156200091f5791602002820160005b83821115620008ed57835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302620008ab565b80156200091d5782816101000a81549061ffff0219169055600201602081600101049283019260010302620008ed565b505b506200092d929150620009ae565b5090565b8280546200093f9062000ae8565b90600052602060002090601f0160209004810192826200096357600085556200091f565b82601f106200097e57805160ff19168380011785556200091f565b828001600101855582156200091f579182015b828111156200091f57825182559160200191906001019062000991565b5b808211156200092d5760008155600101620009af565b80516001600160a01b0381168114620009dd57600080fd5b919050565b6000806000838503610140811215620009fa57600080fd5b6101008082121562000a0b57600080fd5b60405191508082016001600160401b038111838210171562000a3d57634e487b7160e01b600052604160045260246000fd5b60405262000a4b86620009c5565b825262000a5b60208701620009c5565b602083015262000a6e60408701620009c5565b604083015262000a8160608701620009c5565b606083015262000a9460808701620009c5565b608083015262000aa760a08701620009c5565b60a083015262000aba60c08701620009c5565b60c083015262000acd60e08701620009c5565b60e08301528501516101209095015190969495509392505050565b600181811c9082168062000afd57607f821691505b6020821081141562000b1f57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160601c60a05160601c60c05160601c60e05160601c6101005160601c6101205160601c615d3762000baa600039600081816107ee01526139c00152600081816107010152613a6101526000818161098b01526138bb015260008181612a370152614401015260008181612e7f01526143d2015260006106100152615d376000f3fe608060405234801561001057600080fd5b50600436106104265760003560e01c80637287a0cf1161022b578063acfdba7d11610130578063d547741f116100b8578063e9c2651811610087578063e9c2651814610a27578063e9e2422914610453578063ecd8f38c14610a4e578063ef354b2314610a61578063f944399b14610a7457600080fd5b8063d547741f146109c8578063d96cf1a9146109db578063e8a3d485146109e3578063e985e9c5146109eb57600080fd5b8063c38f477e116100ff578063c38f477e1461096b578063c5de34a01461097e578063c6d0ffd714610986578063c83faacd146109ad578063c87b56dd146109b557600080fd5b8063acfdba7d14610924578063ae5a583f1461092c578063af4909f214610935578063b88d4fde1461095857600080fd5b80639293a5c7116101b35780639bac5f7a116101825780639bac5f7a146108cd5780639e54c0a2146108ee578063a1866ff314610901578063a217fddf14610909578063a22cb4651461091157600080fd5b80639293a5c71461088c57806392affc581461089f57806394985ddd146108b257806395d89b41146108c557600080fd5b806383dd58d7116101fa57806383dd58d7146108385780638416b6961461084d57806386c1f226146108555780638da5cb5b1461086857806391d148541461087957600080fd5b80637287a0cf146107d657806374a8569b146107e957806375b238fc146108105780637a5f188a1461082557600080fd5b80632f2ff15d116103315780634d1d1bc4116102b957806360eb3f541161028857806360eb3f541461075f5780636352211e146107725780636b66f9001461078557806370a082311461079857806370b2115a146107ab57600080fd5b80634d1d1bc4146106fc5780634f6ccce7146107235780635448c45d146107365780635d929f701461073f57600080fd5b80633c33e85e116103005780633c33e85e146106a25780633ca6fb8c146106b557806342842e0e146106c85780634a703a4d146106db5780634c81433f146106ee57600080fd5b80632f2ff15d146106455780632f745c591461065857806336568abe1461066b5780633ab1bcc51461067e57600080fd5b806316eda4be116103b457806323b872dd1161038357806323b872dd146105bd578063248a9ca3146105d05780632ab4d052146105f35780632e52d6061461060b5780632f1f93be1461063257600080fd5b806316eda4be1461050a57806318160ddd146105815780632065163a1461058957806320bc84ce1461059c57600080fd5b806306fdde03116103fb57806306fdde0314610491578063081812fc146104a6578063095ea7b3146104d15780630cb076fa146104e457806313af4035146104f757600080fd5b8062923f9e1461042b578062f11e921461045357806301ffc9a7146104745780630412182614610487575b600080fd5b61043e610439366004615192565b610a87565b60405190151581526020015b60405180910390f35b61046661046136600461542d565b610aa8565b60405190815260200161044a565b61043e610482366004615209565b610af5565b61048f610b00565b005b610499610c8f565b60405161044a919061560b565b6104b96104b4366004615192565b610d21565b6040516001600160a01b03909116815260200161044a565b61048f6104df366004614fc2565b610db6565b61048f6104f236600461505d565b610ecc565b61048f610505366004614dbc565b610f0c565b600f546010546105459160ff8082169261010083049091169161ffff62010000820416916001600160801b03600160201b9092048216911685565b604080519515158652931515602086015261ffff909216928401929092526001600160801b03918216606084015216608082015260a00161044a565b600854610466565b61048f610597366004615158565b610f62565b600f5462010000900461ffff165b60405161ffff909116815260200161044a565b61048f6105cb366004614e0a565b610fa9565b6104666105de366004615192565b6000908152600b602052604090206001015490565b600f54600160201b90046001600160801b0316610466565b6104b97f000000000000000000000000000000000000000000000000000000000000000081565b61048f6106403660046151c4565b610fda565b61048f6106533660046151c4565b6112c4565b610466610666366004614fc2565b6112ea565b61048f6106793660046151c4565b611380565b6105aa61068c366004615378565b60196020526000908152604090205461ffff1681565b600e546104b9906001600160a01b031681565b61048f6106c3366004615158565b6113fe565b61048f6106d6366004614e0a565b611445565b61048f6106e9366004614eae565b611460565b600c546105aa9061ffff1681565b6104b97f000000000000000000000000000000000000000000000000000000000000000081565b610466610731366004615192565b6114c3565b610466600d5481565b610747602081565b6040516001600160801b03909116815260200161044a565b61048f61076d366004615484565b611556565b6104b9610780366004615192565b6115b0565b61048f610793366004614dbc565b611627565b6104666107a6366004614dbc565b6118b0565b61043e6107b93660046153ff565b61ffff918216600090815260256020526040902054821691161490565b61048f6107e436600461505d565b611937565b6104b97f000000000000000000000000000000000000000000000000000000000000000081565b610466600080516020615d0b83398151915281565b61048f610833366004614fec565b6119dd565b610840611e95565b60405161044a9190615812565b610466611fce565b61048f610863366004614eae565b612038565b6017546001600160a01b03166104b9565b61043e6108873660046151c4565b612560565b61048f61089a366004615158565b61258b565b61048f6108ad3660046151e7565b6125d9565b61048f6108c03660046151e7565b612a2c565b610499612ac3565b6108e06108db366004615192565b612ad2565b60405161044a92919061561e565b61043e6108fc366004614f6f565b612d04565b610466612dd7565b610466600081565b61048f61091f366004614f38565b612f59565b61048f61301e565b6107476122b881565b61043e610943366004615192565b60186020526000908152604090205460ff1681565b61048f610966366004614e46565b6132ce565b61048f610979366004615158565b613306565b61046661335a565b6104b97f000000000000000000000000000000000000000000000000000000000000000081565b601d54610466565b6104996109c3366004615192565b613384565b61048f6109d63660046151c4565b613463565b610466613489565b61049961353d565b61043e6109f9366004614dd7565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6104667fd0a4ad96d49edb1c33461cebc6fb2609190f32c904e3c3f5877edb4488dee91e81565b61048f610a5c36600461505d565b61355d565b61048f610a6f366004615484565b6136b0565b61048f610a82366004615158565b61370a565b6000818152600260205260408120546001600160a01b031615155b92915050565b600080610ab6848685613763565b5090506000818015610acd5750610acb613bb9565b155b610ad957601354610add565b6012545b9050610ae98187615ac4565b925050505b9392505050565b6000610aa282613bf9565b610b18600080516020615d0b83398151915233612560565b610b3d5760405162461bcd60e51b8152600401610b3490615679565b60405180910390fd5b601c54600160201b900460ff16610b8a5760405162461bcd60e51b815260206004820152601160248201527014d40e95949197d393d517d0d053131151607a1b6044820152606401610b34565b601c546301000000900460ff1615610bda5760405162461bcd60e51b815260206004820152601360248201527214d40e9053149150511657d4d2155191931151606a1b6044820152606401610b34565b6020546040516371f2dcbd60e01b81526004810191909152730612405007bef3dcb751057819480e89f32a03e0906371f2dcbd9060240160006040518083038186803b158015610c2957600080fd5b505af4158015610c3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c65919081019061509f565b8051610c7991601b91602090910190614b3c565b50601c805463ff00000019166301000000179055565b606060008054610c9e90615b80565b80601f0160208091040260200160405190810160405280929190818152602001828054610cca90615b80565b8015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610d9a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b34565b506000908152600460205260409020546001600160a01b031690565b6000610dc1826115b0565b9050806001600160a01b0316836001600160a01b03161415610e2f5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b34565b336001600160a01b0382161480610e4b5750610e4b81336109f9565b610ebd5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b34565b610ec78383613c1e565b505050565b610ee4600080516020615d0b83398151915233612560565b610f005760405162461bcd60e51b8152600401610b3490615679565b610ec7601a8383614be5565b610f24600080516020615d0b83398151915233612560565b610f405760405162461bcd60e51b8152600401610b3490615679565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b610f7a600080516020615d0b83398151915233612560565b610f965760405162461bcd60e51b8152600401610b3490615679565b600f805460ff1916911515919091179055565b610fb33382613c8c565b610fcf5760405162461bcd60e51b8152600401610b349061578a565b610ec7838383613d7f565b6002600a541415610ffd5760405162461bcd60e51b8152600401610b34906157db565b6002600a5561101a600080516020615d0b83398151915233612560565b6110365760405162461bcd60e51b8152600401610b3490615679565b61103e613489565b1561107e5760405162461bcd60e51b815260206004820152601060248201526f29a81d26a4a72a2fa727aa2fa7ab22a960811b6044820152606401610b34565b6000600161108b60165490565b6110959190615b26565b600f549091506110b6908290600160201b90046001600160801b0316615b26565b601d81905583111561110a5760405162461bcd60e51b815260206004820152601560248201527f53503a4e4f545f454e4f5547485f4f525048414e5300000000000000000000006044820152606401610b34565b602954600160201b90046001600160801b03166111278483615a62565b11156111635760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60005b8381101561129f57600061117960165490565b602954909150600160201b90046001600160801b03168111156111d25760405162461bcd60e51b81526020600482015260116024820152700a6a074a89e968a9cbea89e9ebe90928e9607b1b6044820152606401610b34565b60205460405163020ef84160e11b8152730612405007bef3dcb751057819480e89f32a03e09163041df08291611215918591600401918252602082015260400190565b60206040518083038186803b15801561122d57600080fd5b505af4158015611241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126591906151ab565b60008281526028602052604090205561127e8482613f2a565b61128c601680546001019055565b508061129781615bdd565b915050611166565b5082601c60010160008282546112b59190615b26565b90915550506001600a55505050565b6000828152600b60205260409020600101546112e08133614078565b610ec783836140dc565b60006112f5836118b0565b82106113575760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610b34565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b03811633146113f05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b34565b6113fa8282614162565b5050565b611416600080516020615d0b83398151915233612560565b6114325760405162461bcd60e51b8152600401610b3490615679565b601c805460ff1916911515919091179055565b610ec7838383604051806020016040528060008152506132ce565b6002600a5414156114835760405162461bcd60e51b8152600401610b34906157db565b6002600a5560405162461bcd60e51b815260206004820152601060248201526f13525395125391c8111254d05093115160821b6044820152606401610b34565b60006114ce60085490565b82106115315760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610b34565b6008828154811061154457611544615c3a565b90600052602060002001549050919050565b61156e600080516020615d0b83398151915233612560565b61158a5760405162461bcd60e51b8152600401610b3490615679565b601c805463ffffffff909216600160881b0263ffffffff60881b19909216919091179055565b6000818152600260205260408120546001600160a01b031680610aa25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b34565b6002600a54141561164a5760405162461bcd60e51b8152600401610b34906157db565b6002600a55611667600080516020615d0b83398151915233612560565b6116835760405162461bcd60e51b8152600401610b3490615679565b601c546601000000000000900460ff16156116d45760405162461bcd60e51b815260206004820152601160248201527014d40e9053149150511657d35253951151607a1b6044820152606401610b34565b601c546301000000900460ff1680156116f65750601c54600160201b900460ff165b6117345760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b602954601c54600854600160201b9092046001600160801b031691600160401b90910460ff16906117659190615a62565b11156117a15760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60005b601c54600160401b900460ff1681101561188e5760006117c360165490565b60205460405163020ef84160e11b8152600481018390526024810191909152909150730612405007bef3dcb751057819480e89f32a03e09063041df0829060440160206040518083038186803b15801561181c57600080fd5b505af4158015611830573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185491906151ab565b60008281526028602052604090205561186d8382613f2a565b61187b601680546001019055565b508061188681615bdd565b9150506117a4565b5050601c805466ff000000000000191666010000000000001790556001600a55565b60006001600160a01b03821661191b5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b34565b506001600160a01b031660009081526003602052604090205490565b61194f600080516020615d0b83398151915233612560565b61196b5760405162461bcd60e51b8152600401610b3490615679565b60005b81811015610ec75760016027600085858581811061198e5761198e615c3a565b90506020020160208101906119a39190614dbc565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806119d581615bdd565b91505061196e565b6002600a541415611a005760405162461bcd60e51b8152600401610b34906157db565b6002600a81905550600080611a4f878760ff1686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061376392505050565b601c5491935091506301000000900460ff168015611a765750601c54600160201b900460ff165b611ab45760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b611abc613bb9565b80611b0e5750611aca6141c9565b8015611ad35750815b8015611b0e57506004816005811115611aee57611aee615c0e565b14158015611b0e57506003816005811115611b0b57611b0b615c0e565b14155b611b4f5760405162461bcd60e51b815260206004820152601260248201527153503a53414c455f4e4f545f41435449564560701b6044820152606401610b34565b601c54600160281b900460ff1615611b985760405162461bcd60e51b815260206004820152600c60248201526b29a81d29a0a622afa7ab22a960a11b6044820152606401610b34565b611ba0614203565b6001600160801b03168660ff16611bb6896118b0565b611bc09190615a62565b1115611bde5760405162461bcd60e51b8152600401610b34906156f6565b6029546001600160801b03600160201b9091041660ff8716611bff60085490565b611c099190615a62565b1115611c455760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b6000611c8b8760ff168987878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610aa892505050565b9050808614611cd45760405162461bcd60e51b81526020600482015260156024820152744e696c506173733a494e56414c49445f505249434560581b6044820152606401610b34565b60005b8760ff16811015611e13576000611ced60165490565b602954909150600160201b90046001600160801b0316811115611d465760405162461bcd60e51b81526020600482015260116024820152700a6a074a89e968a9cbea89e9ebe90928e9607b1b6044820152606401610b34565b60205460405163020ef84160e11b8152730612405007bef3dcb751057819480e89f32a03e09163041df08291611d89918591600401918252602082015260400190565b60206040518083038186803b158015611da157600080fd5b505af4158015611db5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd991906151ab565b600082815260286020526040902055611df28a82614233565b611e00601680546001019055565b5080611e0b81615bdd565b915050611cd7565b508215611e86578660ff1660196000846005811115611e3457611e34615c0e565b6005811115611e4557611e45615c0e565b8152602081019190915260400160009081208054909190611e6b90849061ffff16615b0b565b92506101000a81548161ffff021916908361ffff1602179055505b50506001600a55505050505050565b611ef66040518061016001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b6040805161016081018252600f5462010000810461ffff168252600160201b90046001600160801b03166020820152908101611f3061335a565b8152602001611f3d611fce565b8152602001611f4a613489565b8152602001611f6a60018060405180602001604052806000815250610aa8565b8152602001611f8a60018060405180602001604052806000815250610aa8565b8152602001611f9860085490565b81526010546001600160801b03166020820152600f5460ff80821615156040840152610100909104161515606090910152919050565b600f546000908190611ffa9062010000810461ffff1690600160201b90046001600160801b0316615ae3565b600c546001600160801b0391909116915060009061ffff1661201b60085490565b6120259190615b26565b90506120318183615b26565b9250505090565b6002600a54141561205b5760405162461bcd60e51b8152600401610b34906157db565b6002600a55604080516020601f8401819004810282018101909252828152859160009182916120a9918b91869190899089908190840183828082843760009201919091525061376392505050565b601c5491935091506301000000900460ff1680156120d05750601c54600160201b900460ff165b61210e5760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b612116613bb9565b8061212d57506121246141c9565b801561212d5750815b61216e5760405162461bcd60e51b815260206004820152601260248201527153503a53414c455f4e4f545f41435449564560701b6044820152606401610b34565b612176614203565b6001600160801b0316836121898b6118b0565b6121939190615a62565b11156121b15760405162461bcd60e51b8152600401610b34906156f6565b601c54600160281b900460ff16156121fa5760405162461bcd60e51b815260206004820152600c60248201526b29a81d29a0a622afa7ab22a960a11b6044820152606401610b34565b6029546001600160801b03600160201b909104168361221860085490565b6122229190615a62565b111561225e5760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60006122a1848b88888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610aa892505050565b90508087146122ea5760405162461bcd60e51b81526020600482015260156024820152744e696c506173733a494e56414c49445f505249434560581b6044820152606401610b34565b60005b848110156124df57601860008b8b8481811061230b5761230b615c3a565b602090810292909201358352508101919091526040016000205460ff16156123695760405162461bcd60e51b815260206004820152601160248201527014d40e9397d053149150511657d554d151607a1b6044820152606401610b34565b600061237460165490565b602954909150600160201b90046001600160801b03168111156123cd5760405162461bcd60e51b81526020600482015260116024820152700a6a074a89e968a9cbea89e9ebe90928e9607b1b6044820152606401610b34565b60205460405163020ef84160e11b8152730612405007bef3dcb751057819480e89f32a03e09163041df08291612410918591600401918252602082015260400190565b60206040518083038186803b15801561242857600080fd5b505af415801561243c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061246091906151ab565b6000828152602860205260409020556124798c82614233565b612487601680546001019055565b6001601860008d8d8681811061249f5761249f615c3a565b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055505080806124d790615bdd565b9150506122ed565b50821561254f5783601960008460058111156124fd576124fd615c0e565b600581111561250e5761250e615c0e565b815260208101919091526040016000908120805490919061253490849061ffff16615b0b565b92506101000a81548161ffff021916908361ffff1602179055505b50506001600a555050505050505050565b6000918252600b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6125a3600080516020615d0b83398151915233612560565b6125bf5760405162461bcd60e51b8152600401610b3490615679565b601c80549115156101000261ff0019909216919091179055565b6002600a5414156125fc5760405162461bcd60e51b8152600401610b34906157db565b6002600a55601c54600160281b900460ff1661264d5760405162461bcd60e51b815260206004820152601060248201526f53503a4255524e5f494e41435449564560801b6044820152606401610b34565b33612657836115b0565b6001600160a01b031614801561267d575033612672826115b0565b6001600160a01b0316145b6126be5760405162461bcd60e51b815260206004820152601260248201527129a81d24a721a7a92922a1aa2fa7aba722a960711b6044820152606401610b34565b808214156127005760405162461bcd60e51b815260206004820152600f60248201526e53503a455155414c5f544f4b454e5360881b6044820152606401610b34565b61271561270c836142dd565b6107b9836142dd565b6127615760405162461bcd60e51b815260206004820152601860248201527f53503a494e56414c49445f544f4b454e5f50414952494e4700000000000000006044820152606401610b34565b61276a82614327565b61277381614327565b600061277e60155490565b61278a90610bb8615a62565b60205460405163020ef84160e11b8152600481018390526024810191909152909150730612405007bef3dcb751057819480e89f32a03e09063041df0829060440160206040518083038186803b1580156127e357600080fd5b505af41580156127f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061281b91906151ab565b600082815260286020526040808220929092558481528181205491516335bb738d60e11b8152600481019290925290730612405007bef3dcb751057819480e89f32a03e090636b76e71a9060240160206040518083038186803b15801561288157600080fd5b505af4158015612895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b991906154aa565b90506000730612405007bef3dcb751057819480e89f32a03e0636b76e71a6128ed8660009081526028602052604090205490565b6040518263ffffffff1660e01b815260040161290b91815260200190565b60206040518083038186803b15801561292357600080fd5b505af4158015612937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295b91906154aa565b90508060ff168260ff16116129705780612972565b815b6000848152602660205260409020805460ff191660ff9290921691909117905561299c3384613f2a565b604080518082018252868152602080820187905260008681526024909152919091206129c9916002614c38565b506129d8601580546001019055565b6040805133815260208101879052908101859052606081018490527fc2a548f52deca3c045639d538390e23a705f54bc393d78d89120170846b537019060800160405180910390a150506001600a55505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614612aa45760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610b34565b6113fa828260205550601c805464ff000000001916600160201b179055565b606060018054610c9e90615b80565b606080612af6836000908152600260205260409020546001600160a01b0316151590565b612b125760405162461bcd60e51b8152600401610b349061573b565b604080518082018252600085815260286020908152928120548252918101829052908080610bb88710612bc3576000878152602460205260408082208151808301928390529160029082845b815481526020019060010190808311612b5e5750505050509050612b9881600060028110612b8e57612b8e615c3a565b60200201516142dd565b9350612ba5816001612b8e565b60008981526026602052604090205490935060ff169150612bcf9050565b612bcc876142dd565b92505b600080730612405007bef3dcb751057819480e89f32a03e0631eeb3e608686868a6040518563ffffffff1660e01b8152600401612c0f9493929190615962565b60006040518083038186803b158015612c2757600080fd5b505af4158015612c3b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c639190810190615243565b604051630b13af7b60e11b81529193509150730612405007bef3dcb751057819480e89f32a03e0906316275ef690612ca19089908590600401615898565b60006040518083038186803b158015612cb957600080fd5b505af4158015612ccd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612cf59190810190615399565b99919850909650505050505050565b601c54600090600160281b900460ff1615612d2157506000610aee565b6000612d2c856118b0565b9050612d36613bb9565b8015612d4957506000612d47613489565b115b8015612d615750601c54600160481b900461ffff1681105b15612d70576001915050610aee565b612d786141c9565b15612dcc576000612dc186600187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061376392505050565b509250610aee915050565b506000949350505050565b6000612df1600080516020615d0b83398151915233612560565b612e0d5760405162461bcd60e51b8152600401610b3490615679565b601c54600160201b900460ff1615612e675760405162461bcd60e51b815260206004820152601560248201527f53503a5652465f414c52454144595f43414c4c454400000000000000000000006044820152606401610b34565b601e546040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015612ec957600080fd5b505afa158015612edd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0191906151ab565b1015612f445760405162461bcd60e51b815260206004820152601260248201527153503a4e4f545f454e4f5547485f4c494e4b60701b6044820152606401610b34565b602354601e54612f5491906143ce565b905090565b6001600160a01b038216331415612fb25760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b34565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6002600a5414156130415760405162461bcd60e51b8152600401610b34906157db565b6002600a5561305e600080516020615d0b83398151915233612560565b61307a5760405162461bcd60e51b8152600401610b3490615679565b601c54670100000000000000900460ff16156130d85760405162461bcd60e51b815260206004820152601560248201527f53503a414c52454144595f41495244524f5050454400000000000000000000006044820152606401610b34565b601c546301000000900460ff1680156130fa5750601c54600160201b900460ff165b6131385760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b601a546029546001600160801b03600160201b909104168161315960085490565b6131639190615a62565b111561319f5760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60005b818110156132aa5760006131b560165490565b60205460405163020ef84160e11b8152600481018390526024810191909152909150730612405007bef3dcb751057819480e89f32a03e09063041df0829060440160206040518083038186803b15801561320e57600080fd5b505af4158015613222573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324691906151ab565b600082815260286020526040902055601a805461328991908490811061326e5761326e615c3a565b6000918252602090912001546001600160a01b031682613f2a565b613297601680546001019055565b50806132a281615bdd565b9150506131a2565b5050601c805467ff0000000000000019166701000000000000001790556001600a55565b6132d83383613c8c565b6132f45760405162461bcd60e51b8152600401610b349061578a565b61330084848484614559565b50505050565b61331e600080516020615d0b83398151915233612560565b61333a5760405162461bcd60e51b8152600401610b3490615679565b601c8054911515600160281b0265ff000000000019909216919091179055565b600c54600f5460009161337b9161ffff918216916201000090910416615b0b565b61ffff16905090565b6000818152600260205260409020546060906001600160a01b03166133bb5760405162461bcd60e51b8152600401610b349061573b565b6000806133c784612ad2565b60405163224b03fd60e21b81529193509150730612405007bef3dcb751057819480e89f32a03e09063892c0ff49061340790859085908990600401615643565b60006040518083038186803b15801561341f57600080fd5b505af4158015613433573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261345b9190810190615399565b949350505050565b6000828152600b602052604090206001015461347f8133614078565b610ec78383614162565b60008061349560085490565b600f546134b29190600160201b90046001600160801b0316615b26565b601c549091506134d190600160881b900463ffffffff1661fd20615a7a565b63ffffffff1642111561353857601c54600090603c9061350090600160881b900463ffffffff1661fd20615a7a565b6135109063ffffffff1642615b26565b61351a9190615aa2565b905080821161352a576000613534565b6135348183615b26565b9150505b919050565b60606040518060600160405280603e8152602001615cad603e9139905090565b613575600080516020615d0b83398151915233612560565b6135915760405162461bcd60e51b8152600401610b3490615679565b60005b61ffff8116821115610ec75782828261ffff168181106135b6576135b6615c3a565b90506020028101906135c89190615995565b90506002146135d65761369e565b82828261ffff168181106135ec576135ec615c3a565b90506020028101906135fe9190615995565b600181811061360f5761360f615c3a565b905060200201602081019061362491906153e2565b60256000858561ffff861681811061363e5761363e615c3a565b90506020028101906136509190615995565b600081811061366157613661615c3a565b905060200201602081019061367691906153e2565b61ffff90811682526020820192909252604001600020805461ffff1916929091169190911790555b806136a881615bbb565b915050613594565b6136c8600080516020615d0b83398151915233612560565b6136e45760405162461bcd60e51b8152600401610b3490615679565b601c805463ffffffff909216600160681b0263ffffffff60681b19909216919091179055565b613722600080516020615d0b83398151915233612560565b61373e5760405162461bcd60e51b8152600401610b3490615679565b601c8054911515620100000262ff000019909216919091179055565b80546001019055565b6001600160a01b038316600090815260276020526040812054819060ff1680156137c857506001600090815260196020527ffc941c3961fb6541da34150022cddf959da0fb2353866a6bfbd249c2da092914546137c590869061ffff16615b26565b10155b156137d857506001905080613bb1565b6000805b601a5481101561383557866001600160a01b0316601a828154811061380357613803615c3a565b6000918252602090912001546001600160a01b0316141561382357600191505b8061382d81615bdd565b9150506137dc565b5080801561387c5750600080805260196020527fd2ac945fcc0096878c763e37d6929b78378c1a2defabde8ba7ee5ed1d6e7a5b25461387990879061ffff16615b26565b10155b1561388f57600160009250925050613bb1565b601f54604051627eeac760e11b81526001600160a01b03888116600483015260248201929092526000917f0000000000000000000000000000000000000000000000000000000000000000169062fdd58e9060440160206040518083038186803b1580156138fc57600080fd5b505afa158015613910573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061393491906151ab565b11801561397b57506002600090815260196020527f6f678ad17c55bce407239525f4bf7f1fe99197d3eb69bfdd9a0db84a9a11b5815461397990879061ffff16615b26565b115b1561398e57600160029250925050613bb1565b60405163b533ab1f60e01b8152600090730612405007bef3dcb751057819480e89f32a03e09063b533ab1f906139ec907f00000000000000000000000000000000000000000000000000000000000000009089908c906004016155d5565b60206040518083038186803b158015613a0457600080fd5b505af4158015613a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3c91906151ab565b6040516370a0823160e01b81526001600160a01b0389811660048301529192506000917f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b158015613aa357600080fd5b505afa158015613ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613adb91906151ab565b1115613ba657601c546b010000000000000000000000900461ffff168110801590613b4157506003600090815260196020527f3e323a6e0522b016fa22111dfed945f89456f9f44f69eac00209d92607a5b94054613b3e90889061ffff16615b26565b10155b15613b555760016003935093505050613bb1565b6004600090815260196020527f77e53f5d8115e854915e54bd6f2fd46db8b881fe7106ff61c7d2a90a39a8983b54613b9290889061ffff16615b26565b10613ba65760016004935093505050613bb1565b600060059350935050505b935093915050565b601c54600090600160881b900463ffffffff1642101580613be15750601c54610100900460ff165b8015612f54575050601c5462010000900460ff161590565b60006001600160e01b03198216637965db0b60e01b1480610aa25750610aa28261458c565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613c53826115b0565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316613d055760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b34565b6000613d10836115b0565b9050806001600160a01b0316846001600160a01b03161480613d4b5750836001600160a01b0316613d4084610d21565b6001600160a01b0316145b8061345b57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff1661345b565b826001600160a01b0316613d92826115b0565b6001600160a01b031614613dfa5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b34565b6001600160a01b038216613e5c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b34565b613e678383836145b1565b613e72600082613c1e565b6001600160a01b0383166000908152600360205260408120805460019290613e9b908490615b26565b90915550506001600160a01b0382166000908152600360205260408120805460019290613ec9908490615a62565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216613f805760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b34565b6000818152600260205260409020546001600160a01b031615613fe55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b34565b613ff1600083836145b1565b6001600160a01b038216600090815260036020526040812080546001929061401a908490615a62565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6140828282612560565b6113fa5761409a816001600160a01b03166014614669565b6140a5836020614669565b6040516020016140b69291906154f3565b60408051601f198184030181529082905262461bcd60e51b8252610b349160040161560b565b6140e68282612560565b6113fa576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561411e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61416c8282612560565b156113fa576000828152600b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b601c54600090600160681b900463ffffffff1642101580613be15750601c5460ff168015612f54575050601c5462010000900460ff161590565b600061420d613bb9565b6142215750602a546001600160801b031690565b50601c54600160481b900461ffff1690565b600e546001600160a01b0316331461428d5760405162461bcd60e51b815260206004820152601660248201527f4e696c506173733a494e56414c49445f4d494e544552000000000000000000006044820152606401610b34565b6142978282614805565b604080516001600160a01b0384168152602081018390527f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe910160405180910390a15050565b6000601b6142ec600184615b26565b815481106142fc576142fc615c3a565b90600052602060002090601091828204019190066002029054906101000a900461ffff169050919050565b6000614332826115b0565b9050614340816000846145b1565b61434b600083613c1e565b6001600160a01b0381166000908152600360205260408120805460019290614374908490615b26565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634000aea07f00000000000000000000000000000000000000000000000000000000000000008486600060405160200161443e929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161446b939291906155a4565b602060405180830381600087803b15801561448557600080fd5b505af1158015614499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144bd9190615175565b50600083815260146020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052919052614519906001615a62565b60008581526014602052604090205561345b8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b614564848484613d7f565b6145708484848461481f565b6133005760405162461bcd60e51b8152600401610b34906156a4565b60006001600160e01b0319821663780e9d6360e01b1480610aa25750610aa282614929565b6001600160a01b03831661460c5761460781600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61462f565b816001600160a01b0316836001600160a01b03161461462f5761462f8382614979565b6001600160a01b03821661464657610ec781614a16565b826001600160a01b0316826001600160a01b031614610ec757610ec78282614ac5565b60606000614678836002615ac4565b614683906002615a62565b67ffffffffffffffff81111561469b5761469b615c50565b6040519080825280601f01601f1916602001820160405280156146c5576020820181803683370190505b509050600360fc1b816000815181106146e0576146e0615c3a565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061470f5761470f615c3a565b60200101906001600160f81b031916908160001a9053506000614733846002615ac4565b61473e906001615a62565b90505b60018111156147b6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061477257614772615c3a565b1a60f81b82828151811061478857614788615c3a565b60200101906001600160f81b031916908160001a90535060049490941c936147af81615b69565b9050614741565b508315610aee5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b34565b6113fa828260405180602001604052806000815250614b09565b60006001600160a01b0384163b1561492157604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614863903390899088908890600401615568565b602060405180830381600087803b15801561487d57600080fd5b505af19250505080156148ad575060408051601f3d908101601f191682019092526148aa91810190615226565b60015b614907573d8080156148db576040519150601f19603f3d011682016040523d82523d6000602084013e6148e0565b606091505b5080516148ff5760405162461bcd60e51b8152600401610b34906156a4565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061345b565b50600161345b565b60006001600160e01b031982166380ac58cd60e01b148061495a57506001600160e01b03198216635b5e139f60e01b145b80610aa257506301ffc9a760e01b6001600160e01b0319831614610aa2565b60006001614986846118b0565b6149909190615b26565b6000838152600760205260409020549091508082146149e3576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090614a2890600190615b26565b60008381526009602052604081205460088054939450909284908110614a5057614a50615c3a565b906000526020600020015490508060088381548110614a7157614a71615c3a565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480614aa957614aa9615c24565b6001900381819060005260206000200160009055905550505050565b6000614ad0836118b0565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b614b138383613f2a565b614b20600084848461481f565b610ec75760405162461bcd60e51b8152600401610b34906156a4565b82805482825590600052602060002090600f01601090048101928215614bd55791602002820160005b83821115614ba557835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302614b65565b8015614bd35782816101000a81549061ffff0219169055600201602081600101049283019260010302614ba5565b505b50614be1929150614c66565b5090565b828054828255906000526020600020908101928215614bd5579160200282015b82811115614bd55781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614c05565b8260028101928215614bd5579160200282015b82811115614bd5578251825591602001919060010190614c4b565b5b80821115614be15760008155600101614c67565b6000614c8e614c8984615a3a565b615a09565b9050828152838383011115614ca257600080fd5b610aee836020830184615b3d565b80356001600160a01b038116811461353857600080fd5b60008083601f840112614cd957600080fd5b50813567ffffffffffffffff811115614cf157600080fd5b6020830191508360208260051b8501011115614d0c57600080fd5b9250929050565b805161353881615c66565b60008083601f840112614d3057600080fd5b50813567ffffffffffffffff811115614d4857600080fd5b602083019150836020828501011115614d0c57600080fd5b600082601f830112614d7157600080fd5b8135614d7f614c8982615a3a565b818152846020838601011115614d9457600080fd5b816020850160208301376000918101602001919091529392505050565b805161353881615c8d565b600060208284031215614dce57600080fd5b610aee82614cb0565b60008060408385031215614dea57600080fd5b614df383614cb0565b9150614e0160208401614cb0565b90509250929050565b600080600060608486031215614e1f57600080fd5b614e2884614cb0565b9250614e3660208501614cb0565b9150604084013590509250925092565b60008060008060808587031215614e5c57600080fd5b614e6585614cb0565b9350614e7360208601614cb0565b925060408501359150606085013567ffffffffffffffff811115614e9657600080fd5b614ea287828801614d60565b91505092959194509250565b60008060008060008060808789031215614ec757600080fd5b614ed087614cb0565b9550602087013567ffffffffffffffff80821115614eed57600080fd5b614ef98a838b01614cc7565b9097509550604089013594506060890135915080821115614f1957600080fd5b50614f2689828a01614d1e565b979a9699509497509295939492505050565b60008060408385031215614f4b57600080fd5b614f5483614cb0565b91506020830135614f6481615c66565b809150509250929050565b600080600060408486031215614f8457600080fd5b614f8d84614cb0565b9250602084013567ffffffffffffffff811115614fa957600080fd5b614fb586828701614d1e565b9497909650939450505050565b60008060408385031215614fd557600080fd5b614fde83614cb0565b946020939093013593505050565b60008060008060006080868803121561500457600080fd5b61500d86614cb0565b9450602086013561501d81615c9d565b935060408601359250606086013567ffffffffffffffff81111561504057600080fd5b61504c88828901614d1e565b969995985093965092949392505050565b6000806020838503121561507057600080fd5b823567ffffffffffffffff81111561508757600080fd5b61509385828601614cc7565b90969095509350505050565b600060208083850312156150b257600080fd5b825167ffffffffffffffff808211156150ca57600080fd5b818501915085601f8301126150de57600080fd5b8151818111156150f0576150f0615c50565b8060051b9150615101848301615a09565b8181528481019084860184860187018a101561511c57600080fd5b600095505b8386101561514b578051945061513685615c8d565b84835260019590950194918601918601615121565b5098975050505050505050565b60006020828403121561516a57600080fd5b8135610aee81615c66565b60006020828403121561518757600080fd5b8151610aee81615c66565b6000602082840312156151a457600080fd5b5035919050565b6000602082840312156151bd57600080fd5b5051919050565b600080604083850312156151d757600080fd5b82359150614e0160208401614cb0565b600080604083850312156151fa57600080fd5b50508035926020909101359150565b60006020828403121561521b57600080fd5b8135610aee81615c77565b60006020828403121561523857600080fd5b8151610aee81615c77565b60008082840361018081121561525857600080fd5b835167ffffffffffffffff81111561526f57600080fd5b8401601f8101861361528057600080fd5b61528f86825160208401614c7b565b93505061016080601f19830112156152a657600080fd5b6152ae6159df565b91506152bc60208601614d13565b82526152ca60408601614d13565b60208301526152db60608601614d13565b60408301526152ec60808601614d13565b60608301526152fd60a08601614d13565b608083015261530e60c08601614d13565b60a083015261531f60e08601614d13565b60c0830152610100615332818701614d13565b60e0840152610120615345818801614d13565b828501526101409150615359828801614db1565b90840152615368868301614db1565b9083015250919491935090915050565b60006020828403121561538a57600080fd5b813560068110610aee57600080fd5b6000602082840312156153ab57600080fd5b815167ffffffffffffffff8111156153c257600080fd5b8201601f810184136153d357600080fd5b61345b84825160208401614c7b565b6000602082840312156153f457600080fd5b8135610aee81615c8d565b6000806040838503121561541257600080fd5b823561541d81615c8d565b91506020830135614f6481615c8d565b60008060006060848603121561544257600080fd5b8335925061545260208501614cb0565b9150604084013567ffffffffffffffff81111561546e57600080fd5b61547a86828701614d60565b9150509250925092565b60006020828403121561549657600080fd5b813563ffffffff81168114610aee57600080fd5b6000602082840312156154bc57600080fd5b8151610aee81615c9d565b600081518084526154df816020860160208601615b3d565b601f01601f19169290920160200192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161552b816017850160208801615b3d565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161555c816028840160208801615b3d565b01602801949350505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261559a60808301846154c7565b9695505050505050565b6001600160a01b03841681528260208201526060604082015260006155cc60608301846154c7565b95945050505050565b60006001600160a01b038086168352606060208401526155f860608401866154c7565b9150808416604084015250949350505050565b602081526000610aee60208301846154c7565b60408152600061563160408301856154c7565b82810360208401526155cc81856154c7565b60608152600061565660608301866154c7565b828103602084015261566881866154c7565b915050826040830152949350505050565b602080825260119082015270139a5b0e9050d0d154d4d7d11153925151607a1b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4e696c506173733a4d494e545f41424f56455f4d41585f4d494e545f414c4c4f60408201526457414e434560d81b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600061016082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100808401518184015250610120808401516158858285018215159052565b5050610140928301511515919092015290565b82518152602080840151908201526101a0810182511515604083015260208301518015156060840152506040830151801515608084015250606083015180151560a084015250608083015180151560c08401525060a083015180151560e08401525060c083015161010061590f8185018315159052565b60e085015191506101206159268186018415159052565b9085015191506101409061593d8583018415159052565b85015161ffff9081166101608601529401519093166101809092019190915292915050565b61ffff85811682528416602082015260ff8316604082015260a081016155cc606083018480518252602090810151910152565b6000808335601e198436030181126159ac57600080fd5b83018035915067ffffffffffffffff8211156159c757600080fd5b6020019150600581901b3603821315614d0c57600080fd5b604051610160810167ffffffffffffffff81118282101715615a0357615a03615c50565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715615a3257615a32615c50565b604052919050565b600067ffffffffffffffff821115615a5457615a54615c50565b50601f01601f191660200190565b60008219821115615a7557615a75615bf8565b500190565b600063ffffffff808316818516808303821115615a9957615a99615bf8565b01949350505050565b600082615abf57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615615ade57615ade615bf8565b500290565b60006001600160801b0383811690831681811015615b0357615b03615bf8565b039392505050565b600061ffff83811690831681811015615b0357615b03615bf8565b600082821015615b3857615b38615bf8565b500390565b60005b83811015615b58578181015183820152602001615b40565b838111156133005750506000910152565b600081615b7857615b78615bf8565b506000190190565b600181811c90821680615b9457607f821691505b60208210811415615bb557634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff80831681811415615bd357615bd3615bf8565b6001019392505050565b6000600019821415615bf157615bf1615bf8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114615c7457600080fd5b50565b6001600160e01b031981168114615c7457600080fd5b61ffff81168114615c7457600080fd5b60ff81168114615c7457600080fdfe68747470733a2f2f7777772e736565647068726173652e636f6465732f6d657461646174612f736565647068726173652d6d657461646174612e6a736f6e4e696c506173733a4d41585f414c4c4f434154494f4e5f524541434845440000df8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42a164736f6c6343000806000ad0a4ad96d49edb1c33461cebc6fb2609190f32c904e3c3f5877edb4488dee91edf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec4200000000000000000000000005a46f1e545526fb803ff974c790acea34d1f2d60000000000000000000000004be83e8c164a58cf675bdc4a08bdeb7b012dc9570000000000000000000000009073ba45b25774a32cae9bf4a67e49c82a8a37fa000000000000000000000000731b19acaa0ae77aea8bf8515f6dcdb894c248c2000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000442dbf15caebee8d1da4465da443b42815d0ed4b000000000000000000000000d07dc4262bcdbf85190c01c996b4c06a461d2430aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106104265760003560e01c80637287a0cf1161022b578063acfdba7d11610130578063d547741f116100b8578063e9c2651811610087578063e9c2651814610a27578063e9e2422914610453578063ecd8f38c14610a4e578063ef354b2314610a61578063f944399b14610a7457600080fd5b8063d547741f146109c8578063d96cf1a9146109db578063e8a3d485146109e3578063e985e9c5146109eb57600080fd5b8063c38f477e116100ff578063c38f477e1461096b578063c5de34a01461097e578063c6d0ffd714610986578063c83faacd146109ad578063c87b56dd146109b557600080fd5b8063acfdba7d14610924578063ae5a583f1461092c578063af4909f214610935578063b88d4fde1461095857600080fd5b80639293a5c7116101b35780639bac5f7a116101825780639bac5f7a146108cd5780639e54c0a2146108ee578063a1866ff314610901578063a217fddf14610909578063a22cb4651461091157600080fd5b80639293a5c71461088c57806392affc581461089f57806394985ddd146108b257806395d89b41146108c557600080fd5b806383dd58d7116101fa57806383dd58d7146108385780638416b6961461084d57806386c1f226146108555780638da5cb5b1461086857806391d148541461087957600080fd5b80637287a0cf146107d657806374a8569b146107e957806375b238fc146108105780637a5f188a1461082557600080fd5b80632f2ff15d116103315780634d1d1bc4116102b957806360eb3f541161028857806360eb3f541461075f5780636352211e146107725780636b66f9001461078557806370a082311461079857806370b2115a146107ab57600080fd5b80634d1d1bc4146106fc5780634f6ccce7146107235780635448c45d146107365780635d929f701461073f57600080fd5b80633c33e85e116103005780633c33e85e146106a25780633ca6fb8c146106b557806342842e0e146106c85780634a703a4d146106db5780634c81433f146106ee57600080fd5b80632f2ff15d146106455780632f745c591461065857806336568abe1461066b5780633ab1bcc51461067e57600080fd5b806316eda4be116103b457806323b872dd1161038357806323b872dd146105bd578063248a9ca3146105d05780632ab4d052146105f35780632e52d6061461060b5780632f1f93be1461063257600080fd5b806316eda4be1461050a57806318160ddd146105815780632065163a1461058957806320bc84ce1461059c57600080fd5b806306fdde03116103fb57806306fdde0314610491578063081812fc146104a6578063095ea7b3146104d15780630cb076fa146104e457806313af4035146104f757600080fd5b8062923f9e1461042b578062f11e921461045357806301ffc9a7146104745780630412182614610487575b600080fd5b61043e610439366004615192565b610a87565b60405190151581526020015b60405180910390f35b61046661046136600461542d565b610aa8565b60405190815260200161044a565b61043e610482366004615209565b610af5565b61048f610b00565b005b610499610c8f565b60405161044a919061560b565b6104b96104b4366004615192565b610d21565b6040516001600160a01b03909116815260200161044a565b61048f6104df366004614fc2565b610db6565b61048f6104f236600461505d565b610ecc565b61048f610505366004614dbc565b610f0c565b600f546010546105459160ff8082169261010083049091169161ffff62010000820416916001600160801b03600160201b9092048216911685565b604080519515158652931515602086015261ffff909216928401929092526001600160801b03918216606084015216608082015260a00161044a565b600854610466565b61048f610597366004615158565b610f62565b600f5462010000900461ffff165b60405161ffff909116815260200161044a565b61048f6105cb366004614e0a565b610fa9565b6104666105de366004615192565b6000908152600b602052604090206001015490565b600f54600160201b90046001600160801b0316610466565b6104b97f00000000000000000000000005a46f1e545526fb803ff974c790acea34d1f2d681565b61048f6106403660046151c4565b610fda565b61048f6106533660046151c4565b6112c4565b610466610666366004614fc2565b6112ea565b61048f6106793660046151c4565b611380565b6105aa61068c366004615378565b60196020526000908152604090205461ffff1681565b600e546104b9906001600160a01b031681565b61048f6106c3366004615158565b6113fe565b61048f6106d6366004614e0a565b611445565b61048f6106e9366004614eae565b611460565b600c546105aa9061ffff1681565b6104b97f000000000000000000000000731b19acaa0ae77aea8bf8515f6dcdb894c248c281565b610466610731366004615192565b6114c3565b610466600d5481565b610747602081565b6040516001600160801b03909116815260200161044a565b61048f61076d366004615484565b611556565b6104b9610780366004615192565b6115b0565b61048f610793366004614dbc565b611627565b6104666107a6366004614dbc565b6118b0565b61043e6107b93660046153ff565b61ffff918216600090815260256020526040902054821691161490565b61048f6107e436600461505d565b611937565b6104b97f000000000000000000000000442dbf15caebee8d1da4465da443b42815d0ed4b81565b610466600080516020615d0b83398151915281565b61048f610833366004614fec565b6119dd565b610840611e95565b60405161044a9190615812565b610466611fce565b61048f610863366004614eae565b612038565b6017546001600160a01b03166104b9565b61043e6108873660046151c4565b612560565b61048f61089a366004615158565b61258b565b61048f6108ad3660046151e7565b6125d9565b61048f6108c03660046151e7565b612a2c565b610499612ac3565b6108e06108db366004615192565b612ad2565b60405161044a92919061561e565b61043e6108fc366004614f6f565b612d04565b610466612dd7565b610466600081565b61048f61091f366004614f38565b612f59565b61048f61301e565b6107476122b881565b61043e610943366004615192565b60186020526000908152604090205460ff1681565b61048f610966366004614e46565b6132ce565b61048f610979366004615158565b613306565b61046661335a565b6104b97f000000000000000000000000d07dc4262bcdbf85190c01c996b4c06a461d243081565b601d54610466565b6104996109c3366004615192565b613384565b61048f6109d63660046151c4565b613463565b610466613489565b61049961353d565b61043e6109f9366004614dd7565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6104667fd0a4ad96d49edb1c33461cebc6fb2609190f32c904e3c3f5877edb4488dee91e81565b61048f610a5c36600461505d565b61355d565b61048f610a6f366004615484565b6136b0565b61048f610a82366004615158565b61370a565b6000818152600260205260408120546001600160a01b031615155b92915050565b600080610ab6848685613763565b5090506000818015610acd5750610acb613bb9565b155b610ad957601354610add565b6012545b9050610ae98187615ac4565b925050505b9392505050565b6000610aa282613bf9565b610b18600080516020615d0b83398151915233612560565b610b3d5760405162461bcd60e51b8152600401610b3490615679565b60405180910390fd5b601c54600160201b900460ff16610b8a5760405162461bcd60e51b815260206004820152601160248201527014d40e95949197d393d517d0d053131151607a1b6044820152606401610b34565b601c546301000000900460ff1615610bda5760405162461bcd60e51b815260206004820152601360248201527214d40e9053149150511657d4d2155191931151606a1b6044820152606401610b34565b6020546040516371f2dcbd60e01b81526004810191909152730612405007bef3dcb751057819480e89f32a03e0906371f2dcbd9060240160006040518083038186803b158015610c2957600080fd5b505af4158015610c3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c65919081019061509f565b8051610c7991601b91602090910190614b3c565b50601c805463ff00000019166301000000179055565b606060008054610c9e90615b80565b80601f0160208091040260200160405190810160405280929190818152602001828054610cca90615b80565b8015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610d9a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b34565b506000908152600460205260409020546001600160a01b031690565b6000610dc1826115b0565b9050806001600160a01b0316836001600160a01b03161415610e2f5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b34565b336001600160a01b0382161480610e4b5750610e4b81336109f9565b610ebd5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b34565b610ec78383613c1e565b505050565b610ee4600080516020615d0b83398151915233612560565b610f005760405162461bcd60e51b8152600401610b3490615679565b610ec7601a8383614be5565b610f24600080516020615d0b83398151915233612560565b610f405760405162461bcd60e51b8152600401610b3490615679565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b610f7a600080516020615d0b83398151915233612560565b610f965760405162461bcd60e51b8152600401610b3490615679565b600f805460ff1916911515919091179055565b610fb33382613c8c565b610fcf5760405162461bcd60e51b8152600401610b349061578a565b610ec7838383613d7f565b6002600a541415610ffd5760405162461bcd60e51b8152600401610b34906157db565b6002600a5561101a600080516020615d0b83398151915233612560565b6110365760405162461bcd60e51b8152600401610b3490615679565b61103e613489565b1561107e5760405162461bcd60e51b815260206004820152601060248201526f29a81d26a4a72a2fa727aa2fa7ab22a960811b6044820152606401610b34565b6000600161108b60165490565b6110959190615b26565b600f549091506110b6908290600160201b90046001600160801b0316615b26565b601d81905583111561110a5760405162461bcd60e51b815260206004820152601560248201527f53503a4e4f545f454e4f5547485f4f525048414e5300000000000000000000006044820152606401610b34565b602954600160201b90046001600160801b03166111278483615a62565b11156111635760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60005b8381101561129f57600061117960165490565b602954909150600160201b90046001600160801b03168111156111d25760405162461bcd60e51b81526020600482015260116024820152700a6a074a89e968a9cbea89e9ebe90928e9607b1b6044820152606401610b34565b60205460405163020ef84160e11b8152730612405007bef3dcb751057819480e89f32a03e09163041df08291611215918591600401918252602082015260400190565b60206040518083038186803b15801561122d57600080fd5b505af4158015611241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126591906151ab565b60008281526028602052604090205561127e8482613f2a565b61128c601680546001019055565b508061129781615bdd565b915050611166565b5082601c60010160008282546112b59190615b26565b90915550506001600a55505050565b6000828152600b60205260409020600101546112e08133614078565b610ec783836140dc565b60006112f5836118b0565b82106113575760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610b34565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b03811633146113f05760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610b34565b6113fa8282614162565b5050565b611416600080516020615d0b83398151915233612560565b6114325760405162461bcd60e51b8152600401610b3490615679565b601c805460ff1916911515919091179055565b610ec7838383604051806020016040528060008152506132ce565b6002600a5414156114835760405162461bcd60e51b8152600401610b34906157db565b6002600a5560405162461bcd60e51b815260206004820152601060248201526f13525395125391c8111254d05093115160821b6044820152606401610b34565b60006114ce60085490565b82106115315760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610b34565b6008828154811061154457611544615c3a565b90600052602060002001549050919050565b61156e600080516020615d0b83398151915233612560565b61158a5760405162461bcd60e51b8152600401610b3490615679565b601c805463ffffffff909216600160881b0263ffffffff60881b19909216919091179055565b6000818152600260205260408120546001600160a01b031680610aa25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b34565b6002600a54141561164a5760405162461bcd60e51b8152600401610b34906157db565b6002600a55611667600080516020615d0b83398151915233612560565b6116835760405162461bcd60e51b8152600401610b3490615679565b601c546601000000000000900460ff16156116d45760405162461bcd60e51b815260206004820152601160248201527014d40e9053149150511657d35253951151607a1b6044820152606401610b34565b601c546301000000900460ff1680156116f65750601c54600160201b900460ff165b6117345760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b602954601c54600854600160201b9092046001600160801b031691600160401b90910460ff16906117659190615a62565b11156117a15760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60005b601c54600160401b900460ff1681101561188e5760006117c360165490565b60205460405163020ef84160e11b8152600481018390526024810191909152909150730612405007bef3dcb751057819480e89f32a03e09063041df0829060440160206040518083038186803b15801561181c57600080fd5b505af4158015611830573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185491906151ab565b60008281526028602052604090205561186d8382613f2a565b61187b601680546001019055565b508061188681615bdd565b9150506117a4565b5050601c805466ff000000000000191666010000000000001790556001600a55565b60006001600160a01b03821661191b5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b34565b506001600160a01b031660009081526003602052604090205490565b61194f600080516020615d0b83398151915233612560565b61196b5760405162461bcd60e51b8152600401610b3490615679565b60005b81811015610ec75760016027600085858581811061198e5761198e615c3a565b90506020020160208101906119a39190614dbc565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806119d581615bdd565b91505061196e565b6002600a541415611a005760405162461bcd60e51b8152600401610b34906157db565b6002600a81905550600080611a4f878760ff1686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061376392505050565b601c5491935091506301000000900460ff168015611a765750601c54600160201b900460ff165b611ab45760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b611abc613bb9565b80611b0e5750611aca6141c9565b8015611ad35750815b8015611b0e57506004816005811115611aee57611aee615c0e565b14158015611b0e57506003816005811115611b0b57611b0b615c0e565b14155b611b4f5760405162461bcd60e51b815260206004820152601260248201527153503a53414c455f4e4f545f41435449564560701b6044820152606401610b34565b601c54600160281b900460ff1615611b985760405162461bcd60e51b815260206004820152600c60248201526b29a81d29a0a622afa7ab22a960a11b6044820152606401610b34565b611ba0614203565b6001600160801b03168660ff16611bb6896118b0565b611bc09190615a62565b1115611bde5760405162461bcd60e51b8152600401610b34906156f6565b6029546001600160801b03600160201b9091041660ff8716611bff60085490565b611c099190615a62565b1115611c455760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b6000611c8b8760ff168987878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610aa892505050565b9050808614611cd45760405162461bcd60e51b81526020600482015260156024820152744e696c506173733a494e56414c49445f505249434560581b6044820152606401610b34565b60005b8760ff16811015611e13576000611ced60165490565b602954909150600160201b90046001600160801b0316811115611d465760405162461bcd60e51b81526020600482015260116024820152700a6a074a89e968a9cbea89e9ebe90928e9607b1b6044820152606401610b34565b60205460405163020ef84160e11b8152730612405007bef3dcb751057819480e89f32a03e09163041df08291611d89918591600401918252602082015260400190565b60206040518083038186803b158015611da157600080fd5b505af4158015611db5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd991906151ab565b600082815260286020526040902055611df28a82614233565b611e00601680546001019055565b5080611e0b81615bdd565b915050611cd7565b508215611e86578660ff1660196000846005811115611e3457611e34615c0e565b6005811115611e4557611e45615c0e565b8152602081019190915260400160009081208054909190611e6b90849061ffff16615b0b565b92506101000a81548161ffff021916908361ffff1602179055505b50506001600a55505050505050565b611ef66040518061016001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b6040805161016081018252600f5462010000810461ffff168252600160201b90046001600160801b03166020820152908101611f3061335a565b8152602001611f3d611fce565b8152602001611f4a613489565b8152602001611f6a60018060405180602001604052806000815250610aa8565b8152602001611f8a60018060405180602001604052806000815250610aa8565b8152602001611f9860085490565b81526010546001600160801b03166020820152600f5460ff80821615156040840152610100909104161515606090910152919050565b600f546000908190611ffa9062010000810461ffff1690600160201b90046001600160801b0316615ae3565b600c546001600160801b0391909116915060009061ffff1661201b60085490565b6120259190615b26565b90506120318183615b26565b9250505090565b6002600a54141561205b5760405162461bcd60e51b8152600401610b34906157db565b6002600a55604080516020601f8401819004810282018101909252828152859160009182916120a9918b91869190899089908190840183828082843760009201919091525061376392505050565b601c5491935091506301000000900460ff1680156120d05750601c54600160201b900460ff165b61210e5760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b612116613bb9565b8061212d57506121246141c9565b801561212d5750815b61216e5760405162461bcd60e51b815260206004820152601260248201527153503a53414c455f4e4f545f41435449564560701b6044820152606401610b34565b612176614203565b6001600160801b0316836121898b6118b0565b6121939190615a62565b11156121b15760405162461bcd60e51b8152600401610b34906156f6565b601c54600160281b900460ff16156121fa5760405162461bcd60e51b815260206004820152600c60248201526b29a81d29a0a622afa7ab22a960a11b6044820152606401610b34565b6029546001600160801b03600160201b909104168361221860085490565b6122229190615a62565b111561225e5760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60006122a1848b88888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610aa892505050565b90508087146122ea5760405162461bcd60e51b81526020600482015260156024820152744e696c506173733a494e56414c49445f505249434560581b6044820152606401610b34565b60005b848110156124df57601860008b8b8481811061230b5761230b615c3a565b602090810292909201358352508101919091526040016000205460ff16156123695760405162461bcd60e51b815260206004820152601160248201527014d40e9397d053149150511657d554d151607a1b6044820152606401610b34565b600061237460165490565b602954909150600160201b90046001600160801b03168111156123cd5760405162461bcd60e51b81526020600482015260116024820152700a6a074a89e968a9cbea89e9ebe90928e9607b1b6044820152606401610b34565b60205460405163020ef84160e11b8152730612405007bef3dcb751057819480e89f32a03e09163041df08291612410918591600401918252602082015260400190565b60206040518083038186803b15801561242857600080fd5b505af415801561243c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061246091906151ab565b6000828152602860205260409020556124798c82614233565b612487601680546001019055565b6001601860008d8d8681811061249f5761249f615c3a565b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055505080806124d790615bdd565b9150506122ed565b50821561254f5783601960008460058111156124fd576124fd615c0e565b600581111561250e5761250e615c0e565b815260208101919091526040016000908120805490919061253490849061ffff16615b0b565b92506101000a81548161ffff021916908361ffff1602179055505b50506001600a555050505050505050565b6000918252600b602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6125a3600080516020615d0b83398151915233612560565b6125bf5760405162461bcd60e51b8152600401610b3490615679565b601c80549115156101000261ff0019909216919091179055565b6002600a5414156125fc5760405162461bcd60e51b8152600401610b34906157db565b6002600a55601c54600160281b900460ff1661264d5760405162461bcd60e51b815260206004820152601060248201526f53503a4255524e5f494e41435449564560801b6044820152606401610b34565b33612657836115b0565b6001600160a01b031614801561267d575033612672826115b0565b6001600160a01b0316145b6126be5760405162461bcd60e51b815260206004820152601260248201527129a81d24a721a7a92922a1aa2fa7aba722a960711b6044820152606401610b34565b808214156127005760405162461bcd60e51b815260206004820152600f60248201526e53503a455155414c5f544f4b454e5360881b6044820152606401610b34565b61271561270c836142dd565b6107b9836142dd565b6127615760405162461bcd60e51b815260206004820152601860248201527f53503a494e56414c49445f544f4b454e5f50414952494e4700000000000000006044820152606401610b34565b61276a82614327565b61277381614327565b600061277e60155490565b61278a90610bb8615a62565b60205460405163020ef84160e11b8152600481018390526024810191909152909150730612405007bef3dcb751057819480e89f32a03e09063041df0829060440160206040518083038186803b1580156127e357600080fd5b505af41580156127f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061281b91906151ab565b600082815260286020526040808220929092558481528181205491516335bb738d60e11b8152600481019290925290730612405007bef3dcb751057819480e89f32a03e090636b76e71a9060240160206040518083038186803b15801561288157600080fd5b505af4158015612895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b991906154aa565b90506000730612405007bef3dcb751057819480e89f32a03e0636b76e71a6128ed8660009081526028602052604090205490565b6040518263ffffffff1660e01b815260040161290b91815260200190565b60206040518083038186803b15801561292357600080fd5b505af4158015612937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295b91906154aa565b90508060ff168260ff16116129705780612972565b815b6000848152602660205260409020805460ff191660ff9290921691909117905561299c3384613f2a565b604080518082018252868152602080820187905260008681526024909152919091206129c9916002614c38565b506129d8601580546001019055565b6040805133815260208101879052908101859052606081018490527fc2a548f52deca3c045639d538390e23a705f54bc393d78d89120170846b537019060800160405180910390a150506001600a55505050565b336001600160a01b037f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79521614612aa45760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c006044820152606401610b34565b6113fa828260205550601c805464ff000000001916600160201b179055565b606060018054610c9e90615b80565b606080612af6836000908152600260205260409020546001600160a01b0316151590565b612b125760405162461bcd60e51b8152600401610b349061573b565b604080518082018252600085815260286020908152928120548252918101829052908080610bb88710612bc3576000878152602460205260408082208151808301928390529160029082845b815481526020019060010190808311612b5e5750505050509050612b9881600060028110612b8e57612b8e615c3a565b60200201516142dd565b9350612ba5816001612b8e565b60008981526026602052604090205490935060ff169150612bcf9050565b612bcc876142dd565b92505b600080730612405007bef3dcb751057819480e89f32a03e0631eeb3e608686868a6040518563ffffffff1660e01b8152600401612c0f9493929190615962565b60006040518083038186803b158015612c2757600080fd5b505af4158015612c3b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c639190810190615243565b604051630b13af7b60e11b81529193509150730612405007bef3dcb751057819480e89f32a03e0906316275ef690612ca19089908590600401615898565b60006040518083038186803b158015612cb957600080fd5b505af4158015612ccd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612cf59190810190615399565b99919850909650505050505050565b601c54600090600160281b900460ff1615612d2157506000610aee565b6000612d2c856118b0565b9050612d36613bb9565b8015612d4957506000612d47613489565b115b8015612d615750601c54600160481b900461ffff1681105b15612d70576001915050610aee565b612d786141c9565b15612dcc576000612dc186600187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061376392505050565b509250610aee915050565b506000949350505050565b6000612df1600080516020615d0b83398151915233612560565b612e0d5760405162461bcd60e51b8152600401610b3490615679565b601c54600160201b900460ff1615612e675760405162461bcd60e51b815260206004820152601560248201527f53503a5652465f414c52454144595f43414c4c454400000000000000000000006044820152606401610b34565b601e546040516370a0823160e01b81523060048201527f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316906370a082319060240160206040518083038186803b158015612ec957600080fd5b505afa158015612edd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0191906151ab565b1015612f445760405162461bcd60e51b815260206004820152601260248201527153503a4e4f545f454e4f5547485f4c494e4b60701b6044820152606401610b34565b602354601e54612f5491906143ce565b905090565b6001600160a01b038216331415612fb25760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b34565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6002600a5414156130415760405162461bcd60e51b8152600401610b34906157db565b6002600a5561305e600080516020615d0b83398151915233612560565b61307a5760405162461bcd60e51b8152600401610b3490615679565b601c54670100000000000000900460ff16156130d85760405162461bcd60e51b815260206004820152601560248201527f53503a414c52454144595f41495244524f5050454400000000000000000000006044820152606401610b34565b601c546301000000900460ff1680156130fa5750601c54600160201b900460ff165b6131385760405162461bcd60e51b815260206004820152600f60248201526e14d40e91539597d393d517d2539255608a1b6044820152606401610b34565b601a546029546001600160801b03600160201b909104168161315960085490565b6131639190615a62565b111561319f5760405162461bcd60e51b815260206004820152601e6024820152600080516020615ceb8339815191526044820152606401610b34565b60005b818110156132aa5760006131b560165490565b60205460405163020ef84160e11b8152600481018390526024810191909152909150730612405007bef3dcb751057819480e89f32a03e09063041df0829060440160206040518083038186803b15801561320e57600080fd5b505af4158015613222573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061324691906151ab565b600082815260286020526040902055601a805461328991908490811061326e5761326e615c3a565b6000918252602090912001546001600160a01b031682613f2a565b613297601680546001019055565b50806132a281615bdd565b9150506131a2565b5050601c805467ff0000000000000019166701000000000000001790556001600a55565b6132d83383613c8c565b6132f45760405162461bcd60e51b8152600401610b349061578a565b61330084848484614559565b50505050565b61331e600080516020615d0b83398151915233612560565b61333a5760405162461bcd60e51b8152600401610b3490615679565b601c8054911515600160281b0265ff000000000019909216919091179055565b600c54600f5460009161337b9161ffff918216916201000090910416615b0b565b61ffff16905090565b6000818152600260205260409020546060906001600160a01b03166133bb5760405162461bcd60e51b8152600401610b349061573b565b6000806133c784612ad2565b60405163224b03fd60e21b81529193509150730612405007bef3dcb751057819480e89f32a03e09063892c0ff49061340790859085908990600401615643565b60006040518083038186803b15801561341f57600080fd5b505af4158015613433573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261345b9190810190615399565b949350505050565b6000828152600b602052604090206001015461347f8133614078565b610ec78383614162565b60008061349560085490565b600f546134b29190600160201b90046001600160801b0316615b26565b601c549091506134d190600160881b900463ffffffff1661fd20615a7a565b63ffffffff1642111561353857601c54600090603c9061350090600160881b900463ffffffff1661fd20615a7a565b6135109063ffffffff1642615b26565b61351a9190615aa2565b905080821161352a576000613534565b6135348183615b26565b9150505b919050565b60606040518060600160405280603e8152602001615cad603e9139905090565b613575600080516020615d0b83398151915233612560565b6135915760405162461bcd60e51b8152600401610b3490615679565b60005b61ffff8116821115610ec75782828261ffff168181106135b6576135b6615c3a565b90506020028101906135c89190615995565b90506002146135d65761369e565b82828261ffff168181106135ec576135ec615c3a565b90506020028101906135fe9190615995565b600181811061360f5761360f615c3a565b905060200201602081019061362491906153e2565b60256000858561ffff861681811061363e5761363e615c3a565b90506020028101906136509190615995565b600081811061366157613661615c3a565b905060200201602081019061367691906153e2565b61ffff90811682526020820192909252604001600020805461ffff1916929091169190911790555b806136a881615bbb565b915050613594565b6136c8600080516020615d0b83398151915233612560565b6136e45760405162461bcd60e51b8152600401610b3490615679565b601c805463ffffffff909216600160681b0263ffffffff60681b19909216919091179055565b613722600080516020615d0b83398151915233612560565b61373e5760405162461bcd60e51b8152600401610b3490615679565b601c8054911515620100000262ff000019909216919091179055565b80546001019055565b6001600160a01b038316600090815260276020526040812054819060ff1680156137c857506001600090815260196020527ffc941c3961fb6541da34150022cddf959da0fb2353866a6bfbd249c2da092914546137c590869061ffff16615b26565b10155b156137d857506001905080613bb1565b6000805b601a5481101561383557866001600160a01b0316601a828154811061380357613803615c3a565b6000918252602090912001546001600160a01b0316141561382357600191505b8061382d81615bdd565b9150506137dc565b5080801561387c5750600080805260196020527fd2ac945fcc0096878c763e37d6929b78378c1a2defabde8ba7ee5ed1d6e7a5b25461387990879061ffff16615b26565b10155b1561388f57600160009250925050613bb1565b601f54604051627eeac760e11b81526001600160a01b03888116600483015260248201929092526000917f000000000000000000000000d07dc4262bcdbf85190c01c996b4c06a461d2430169062fdd58e9060440160206040518083038186803b1580156138fc57600080fd5b505afa158015613910573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061393491906151ab565b11801561397b57506002600090815260196020527f6f678ad17c55bce407239525f4bf7f1fe99197d3eb69bfdd9a0db84a9a11b5815461397990879061ffff16615b26565b115b1561398e57600160029250925050613bb1565b60405163b533ab1f60e01b8152600090730612405007bef3dcb751057819480e89f32a03e09063b533ab1f906139ec907f000000000000000000000000442dbf15caebee8d1da4465da443b42815d0ed4b9089908c906004016155d5565b60206040518083038186803b158015613a0457600080fd5b505af4158015613a18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3c91906151ab565b6040516370a0823160e01b81526001600160a01b0389811660048301529192506000917f000000000000000000000000731b19acaa0ae77aea8bf8515f6dcdb894c248c216906370a082319060240160206040518083038186803b158015613aa357600080fd5b505afa158015613ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613adb91906151ab565b1115613ba657601c546b010000000000000000000000900461ffff168110801590613b4157506003600090815260196020527f3e323a6e0522b016fa22111dfed945f89456f9f44f69eac00209d92607a5b94054613b3e90889061ffff16615b26565b10155b15613b555760016003935093505050613bb1565b6004600090815260196020527f77e53f5d8115e854915e54bd6f2fd46db8b881fe7106ff61c7d2a90a39a8983b54613b9290889061ffff16615b26565b10613ba65760016004935093505050613bb1565b600060059350935050505b935093915050565b601c54600090600160881b900463ffffffff1642101580613be15750601c54610100900460ff165b8015612f54575050601c5462010000900460ff161590565b60006001600160e01b03198216637965db0b60e01b1480610aa25750610aa28261458c565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613c53826115b0565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316613d055760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b34565b6000613d10836115b0565b9050806001600160a01b0316846001600160a01b03161480613d4b5750836001600160a01b0316613d4084610d21565b6001600160a01b0316145b8061345b57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff1661345b565b826001600160a01b0316613d92826115b0565b6001600160a01b031614613dfa5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b34565b6001600160a01b038216613e5c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b34565b613e678383836145b1565b613e72600082613c1e565b6001600160a01b0383166000908152600360205260408120805460019290613e9b908490615b26565b90915550506001600160a01b0382166000908152600360205260408120805460019290613ec9908490615a62565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216613f805760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b34565b6000818152600260205260409020546001600160a01b031615613fe55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b34565b613ff1600083836145b1565b6001600160a01b038216600090815260036020526040812080546001929061401a908490615a62565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6140828282612560565b6113fa5761409a816001600160a01b03166014614669565b6140a5836020614669565b6040516020016140b69291906154f3565b60408051601f198184030181529082905262461bcd60e51b8252610b349160040161560b565b6140e68282612560565b6113fa576000828152600b602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561411e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61416c8282612560565b156113fa576000828152600b602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b601c54600090600160681b900463ffffffff1642101580613be15750601c5460ff168015612f54575050601c5462010000900460ff161590565b600061420d613bb9565b6142215750602a546001600160801b031690565b50601c54600160481b900461ffff1690565b600e546001600160a01b0316331461428d5760405162461bcd60e51b815260206004820152601660248201527f4e696c506173733a494e56414c49445f4d494e544552000000000000000000006044820152606401610b34565b6142978282614805565b604080516001600160a01b0384168152602081018390527f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe910160405180910390a15050565b6000601b6142ec600184615b26565b815481106142fc576142fc615c3a565b90600052602060002090601091828204019190066002029054906101000a900461ffff169050919050565b6000614332826115b0565b9050614340816000846145b1565b61434b600083613c1e565b6001600160a01b0381166000908152600360205260408120805460019290614374908490615b26565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca6001600160a01b0316634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb79528486600060405160200161443e929190918252602082015260400190565b6040516020818303038152906040526040518463ffffffff1660e01b815260040161446b939291906155a4565b602060405180830381600087803b15801561448557600080fd5b505af1158015614499573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906144bd9190615175565b50600083815260146020818152604080842054815180840189905280830186905230606082015260808082018390528351808303909101815260a090910190925281519183019190912093879052919052614519906001615a62565b60008581526014602052604090205561345b8482604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b614564848484613d7f565b6145708484848461481f565b6133005760405162461bcd60e51b8152600401610b34906156a4565b60006001600160e01b0319821663780e9d6360e01b1480610aa25750610aa282614929565b6001600160a01b03831661460c5761460781600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61462f565b816001600160a01b0316836001600160a01b03161461462f5761462f8382614979565b6001600160a01b03821661464657610ec781614a16565b826001600160a01b0316826001600160a01b031614610ec757610ec78282614ac5565b60606000614678836002615ac4565b614683906002615a62565b67ffffffffffffffff81111561469b5761469b615c50565b6040519080825280601f01601f1916602001820160405280156146c5576020820181803683370190505b509050600360fc1b816000815181106146e0576146e0615c3a565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061470f5761470f615c3a565b60200101906001600160f81b031916908160001a9053506000614733846002615ac4565b61473e906001615a62565b90505b60018111156147b6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061477257614772615c3a565b1a60f81b82828151811061478857614788615c3a565b60200101906001600160f81b031916908160001a90535060049490941c936147af81615b69565b9050614741565b508315610aee5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b34565b6113fa828260405180602001604052806000815250614b09565b60006001600160a01b0384163b1561492157604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614863903390899088908890600401615568565b602060405180830381600087803b15801561487d57600080fd5b505af19250505080156148ad575060408051601f3d908101601f191682019092526148aa91810190615226565b60015b614907573d8080156148db576040519150601f19603f3d011682016040523d82523d6000602084013e6148e0565b606091505b5080516148ff5760405162461bcd60e51b8152600401610b34906156a4565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061345b565b50600161345b565b60006001600160e01b031982166380ac58cd60e01b148061495a57506001600160e01b03198216635b5e139f60e01b145b80610aa257506301ffc9a760e01b6001600160e01b0319831614610aa2565b60006001614986846118b0565b6149909190615b26565b6000838152600760205260409020549091508082146149e3576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090614a2890600190615b26565b60008381526009602052604081205460088054939450909284908110614a5057614a50615c3a565b906000526020600020015490508060088381548110614a7157614a71615c3a565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480614aa957614aa9615c24565b6001900381819060005260206000200160009055905550505050565b6000614ad0836118b0565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b614b138383613f2a565b614b20600084848461481f565b610ec75760405162461bcd60e51b8152600401610b34906156a4565b82805482825590600052602060002090600f01601090048101928215614bd55791602002820160005b83821115614ba557835183826101000a81548161ffff021916908361ffff1602179055509260200192600201602081600101049283019260010302614b65565b8015614bd35782816101000a81549061ffff0219169055600201602081600101049283019260010302614ba5565b505b50614be1929150614c66565b5090565b828054828255906000526020600020908101928215614bd5579160200282015b82811115614bd55781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614c05565b8260028101928215614bd5579160200282015b82811115614bd5578251825591602001919060010190614c4b565b5b80821115614be15760008155600101614c67565b6000614c8e614c8984615a3a565b615a09565b9050828152838383011115614ca257600080fd5b610aee836020830184615b3d565b80356001600160a01b038116811461353857600080fd5b60008083601f840112614cd957600080fd5b50813567ffffffffffffffff811115614cf157600080fd5b6020830191508360208260051b8501011115614d0c57600080fd5b9250929050565b805161353881615c66565b60008083601f840112614d3057600080fd5b50813567ffffffffffffffff811115614d4857600080fd5b602083019150836020828501011115614d0c57600080fd5b600082601f830112614d7157600080fd5b8135614d7f614c8982615a3a565b818152846020838601011115614d9457600080fd5b816020850160208301376000918101602001919091529392505050565b805161353881615c8d565b600060208284031215614dce57600080fd5b610aee82614cb0565b60008060408385031215614dea57600080fd5b614df383614cb0565b9150614e0160208401614cb0565b90509250929050565b600080600060608486031215614e1f57600080fd5b614e2884614cb0565b9250614e3660208501614cb0565b9150604084013590509250925092565b60008060008060808587031215614e5c57600080fd5b614e6585614cb0565b9350614e7360208601614cb0565b925060408501359150606085013567ffffffffffffffff811115614e9657600080fd5b614ea287828801614d60565b91505092959194509250565b60008060008060008060808789031215614ec757600080fd5b614ed087614cb0565b9550602087013567ffffffffffffffff80821115614eed57600080fd5b614ef98a838b01614cc7565b9097509550604089013594506060890135915080821115614f1957600080fd5b50614f2689828a01614d1e565b979a9699509497509295939492505050565b60008060408385031215614f4b57600080fd5b614f5483614cb0565b91506020830135614f6481615c66565b809150509250929050565b600080600060408486031215614f8457600080fd5b614f8d84614cb0565b9250602084013567ffffffffffffffff811115614fa957600080fd5b614fb586828701614d1e565b9497909650939450505050565b60008060408385031215614fd557600080fd5b614fde83614cb0565b946020939093013593505050565b60008060008060006080868803121561500457600080fd5b61500d86614cb0565b9450602086013561501d81615c9d565b935060408601359250606086013567ffffffffffffffff81111561504057600080fd5b61504c88828901614d1e565b969995985093965092949392505050565b6000806020838503121561507057600080fd5b823567ffffffffffffffff81111561508757600080fd5b61509385828601614cc7565b90969095509350505050565b600060208083850312156150b257600080fd5b825167ffffffffffffffff808211156150ca57600080fd5b818501915085601f8301126150de57600080fd5b8151818111156150f0576150f0615c50565b8060051b9150615101848301615a09565b8181528481019084860184860187018a101561511c57600080fd5b600095505b8386101561514b578051945061513685615c8d565b84835260019590950194918601918601615121565b5098975050505050505050565b60006020828403121561516a57600080fd5b8135610aee81615c66565b60006020828403121561518757600080fd5b8151610aee81615c66565b6000602082840312156151a457600080fd5b5035919050565b6000602082840312156151bd57600080fd5b5051919050565b600080604083850312156151d757600080fd5b82359150614e0160208401614cb0565b600080604083850312156151fa57600080fd5b50508035926020909101359150565b60006020828403121561521b57600080fd5b8135610aee81615c77565b60006020828403121561523857600080fd5b8151610aee81615c77565b60008082840361018081121561525857600080fd5b835167ffffffffffffffff81111561526f57600080fd5b8401601f8101861361528057600080fd5b61528f86825160208401614c7b565b93505061016080601f19830112156152a657600080fd5b6152ae6159df565b91506152bc60208601614d13565b82526152ca60408601614d13565b60208301526152db60608601614d13565b60408301526152ec60808601614d13565b60608301526152fd60a08601614d13565b608083015261530e60c08601614d13565b60a083015261531f60e08601614d13565b60c0830152610100615332818701614d13565b60e0840152610120615345818801614d13565b828501526101409150615359828801614db1565b90840152615368868301614db1565b9083015250919491935090915050565b60006020828403121561538a57600080fd5b813560068110610aee57600080fd5b6000602082840312156153ab57600080fd5b815167ffffffffffffffff8111156153c257600080fd5b8201601f810184136153d357600080fd5b61345b84825160208401614c7b565b6000602082840312156153f457600080fd5b8135610aee81615c8d565b6000806040838503121561541257600080fd5b823561541d81615c8d565b91506020830135614f6481615c8d565b60008060006060848603121561544257600080fd5b8335925061545260208501614cb0565b9150604084013567ffffffffffffffff81111561546e57600080fd5b61547a86828701614d60565b9150509250925092565b60006020828403121561549657600080fd5b813563ffffffff81168114610aee57600080fd5b6000602082840312156154bc57600080fd5b8151610aee81615c9d565b600081518084526154df816020860160208601615b3d565b601f01601f19169290920160200192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161552b816017850160208801615b3d565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161555c816028840160208801615b3d565b01602801949350505050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261559a60808301846154c7565b9695505050505050565b6001600160a01b03841681528260208201526060604082015260006155cc60608301846154c7565b95945050505050565b60006001600160a01b038086168352606060208401526155f860608401866154c7565b9150808416604084015250949350505050565b602081526000610aee60208301846154c7565b60408152600061563160408301856154c7565b82810360208401526155cc81856154c7565b60608152600061565660608301866154c7565b828103602084015261566881866154c7565b915050826040830152949350505050565b602080825260119082015270139a5b0e9050d0d154d4d7d11153925151607a1b604082015260600190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4e696c506173733a4d494e545f41424f56455f4d41585f4d494e545f414c4c4f60408201526457414e434560d81b606082015260800190565b6020808252602f908201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60408201526e3732bc34b9ba32b73a103a37b5b2b760891b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600061016082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e0830152610100808401518184015250610120808401516158858285018215159052565b5050610140928301511515919092015290565b82518152602080840151908201526101a0810182511515604083015260208301518015156060840152506040830151801515608084015250606083015180151560a084015250608083015180151560c08401525060a083015180151560e08401525060c083015161010061590f8185018315159052565b60e085015191506101206159268186018415159052565b9085015191506101409061593d8583018415159052565b85015161ffff9081166101608601529401519093166101809092019190915292915050565b61ffff85811682528416602082015260ff8316604082015260a081016155cc606083018480518252602090810151910152565b6000808335601e198436030181126159ac57600080fd5b83018035915067ffffffffffffffff8211156159c757600080fd5b6020019150600581901b3603821315614d0c57600080fd5b604051610160810167ffffffffffffffff81118282101715615a0357615a03615c50565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715615a3257615a32615c50565b604052919050565b600067ffffffffffffffff821115615a5457615a54615c50565b50601f01601f191660200190565b60008219821115615a7557615a75615bf8565b500190565b600063ffffffff808316818516808303821115615a9957615a99615bf8565b01949350505050565b600082615abf57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615615ade57615ade615bf8565b500290565b60006001600160801b0383811690831681811015615b0357615b03615bf8565b039392505050565b600061ffff83811690831681811015615b0357615b03615bf8565b600082821015615b3857615b38615bf8565b500390565b60005b83811015615b58578181015183820152602001615b40565b838111156133005750506000910152565b600081615b7857615b78615bf8565b506000190190565b600181811c90821680615b9457607f821691505b60208210811415615bb557634e487b7160e01b600052602260045260246000fd5b50919050565b600061ffff80831681811415615bd357615bd3615bf8565b6001019392505050565b6000600019821415615bf157615bf1615bf8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114615c7457600080fd5b50565b6001600160e01b031981168114615c7457600080fd5b61ffff81168114615c7457600080fd5b60ff81168114615c7457600080fdfe68747470733a2f2f7777772e736565647068726173652e636f6465732f6d657461646174612f736565647068726173652d6d657461646174612e6a736f6e4e696c506173733a4d41585f414c4c4f434154494f4e5f524541434845440000df8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec42a164736f6c6343000806000a

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

00000000000000000000000005a46f1e545526fb803ff974c790acea34d1f2d60000000000000000000000004be83e8c164a58cf675bdc4a08bdeb7b012dc9570000000000000000000000009073ba45b25774a32cae9bf4a67e49c82a8a37fa000000000000000000000000731b19acaa0ae77aea8bf8515f6dcdb894c248c2000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000442dbf15caebee8d1da4465da443b42815d0ed4b000000000000000000000000d07dc4262bcdbf85190c01c996b4c06a461d2430aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af4450000000000000000000000000000000000000000000000001bc16d674ec80000

-----Decoded View---------------
Arg [0] : contractAddresses (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
Arg [1] : _vrfKeyHash (bytes32): 0xaa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [2] : _linkFee (uint256): 2000000000000000000

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000005a46f1e545526fb803ff974c790acea34d1f2d6
Arg [1] : 0000000000000000000000004be83e8c164a58cf675bdc4a08bdeb7b012dc957
Arg [2] : 0000000000000000000000009073ba45b25774a32cae9bf4a67e49c82a8a37fa
Arg [3] : 000000000000000000000000731b19acaa0ae77aea8bf8515f6dcdb894c248c2
Arg [4] : 000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb7952
Arg [5] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [6] : 000000000000000000000000442dbf15caebee8d1da4465da443b42815d0ed4b
Arg [7] : 000000000000000000000000d07dc4262bcdbf85190c01c996b4c06a461d2430
Arg [8] : aa77729d3466ca35ae8d28b3bbac7cc36a5031efdc430821c02bc31a238af445
Arg [9] : 0000000000000000000000000000000000000000000000001bc16d674ec80000


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

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