ETH Price: $3,255.24 (+2.51%)
Gas: 2 Gwei

Contract

0xAF5a8EB6035cb8946D0c8Fe000Aa9289244Ec831
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040148319812022-05-23 21:44:27794 days ago1653342267IN
 Create: DiamondHeistV7
0 ETH0.0908769718.04565838

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DiamondHeistV7

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

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

/**
       .     '     ,      '     ,     .     '   .    
      _________        _________       _________    
   _ /_|_____|_\ _  _ /_|_____|_\ _ _ /_|_____|_\ _ 
     '. \   / .'      '. \   / .'     '. \   / .'   
       '.\ /.'          '.\ /.'         '.\ /.'     
         '.'              '.'             '.'
 
 ██████╗ ██╗ █████╗ ███╗   ███╗ ██████╗ ███╗   ██╗██████╗  
 ██╔══██╗██║██╔══██╗████╗ ████║██╔═══██╗████╗  ██║██╔══██╗ 
 ██║  ██║██║███████║██╔████╔██║██║   ██║██╔██╗ ██║██║  ██║ 
 ██║  ██║██║██╔══██║██║╚██╔╝██║██║   ██║██║╚██╗██║██║  ██║ 
 ██████╔╝██║██║  ██║██║ ╚═╝ ██║╚██████╔╝██║ ╚████║██████╔╝ 
 ╚═════╝ ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚═════╝  
           ██╗  ██╗███████╗██╗███████╗████████╗
           ██║  ██║██╔════╝██║██╔════╝╚══██╔══╝   <'l    
      __   ███████║█████╗  ██║███████╗   ██║       ll    
 (___()'`; ██╔══██║██╔══╝  ██║╚════██║   ██║       llama~
 /,    /`  ██║  ██║███████╗██║███████║   ██║       || || 
 \\"--\\   ╚═╝  ╚═╝╚══════╝╚═╝╚══════╝   ╚═╝       '' '' 

*/

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "./interfaces/ERC721AUpgradeable.sol";
import "./interfaces/IDiamondHeist.sol";
import "./interfaces/IDIAMOND.sol";
import "./interfaces/IStaking.sol";
import "./interfaces/ITraits.sol";
import "./interfaces/IHeistPass.sol";

contract DiamondHeistV7 is
    ERC721AUpgradeable,
    IDiamondHeist,
    OwnableUpgradeable,
    PausableUpgradeable,
    ReentrancyGuardUpgradeable
{
    event LlamaMinted(uint256 indexed tokenId);
    event DogMinted(uint256 indexed tokenId);
    event LlamaBurned(uint256 indexed tokenId);
    event DogBurned(uint256 indexed tokenId);

    // max number of tokens that can be minted - 37,500 in production
    uint256 public constant MAX_TOKENS = 37500;
    // number of tokens that can be claimed for a fee - 20% of MAX_TOKENS
    uint256 public PAID_TOKENS;

    uint256 public MINT_PRICE;

    // whitelist, 10 mints, get a discount, 1 free
    uint16 public constant MAX_COMMUNITY_AMOUNT = 5;
    uint256 public COMMUNITY_SALE_MINT_PRICE;
    bytes32 public whitelistMerkleRoot;
    mapping(address => uint256) public claimed;

    // mapping from tokenId to a struct containing the token's traits
    mapping(uint256 => LlamaDog) public tokenTraits;
    // mapping from hashed(tokenTrait) to the tokenId it's associated with
    // used to ensure there are no duplicates
    mapping(uint256 => uint256) public existingCombinations;

    // list of probabilities for each trait type
    uint8[][14] public rarities;
    // list of aliases for Walker's Alias algorithm
    uint8[][14] public aliases;

    // reference to the Staking for choosing random Dog thieves
    IStaking public staking;
    // reference to $DIAMOND for burning on mint
    IDIAMOND public diamond;
    // reference to Traits
    ITraits public traits;

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() initializer {}

    function initialize() initializer public {
        __ERC721A_init("Diamond Heist", "DIAMONDHEIST");
        __Pausable_init();
        __Ownable_init();
        __ReentrancyGuard_init();
        _pause();

        PAID_TOKENS = 7500;
        MINT_PRICE = .06 ether;
        COMMUNITY_SALE_MINT_PRICE = .04 ether;

        // Llama/Body
        rarities[0] = [255, 61, 122, 30, 183, 224, 142, 30, 214, 173, 214, 122];
        aliases[0] = [0, 0, 0, 7, 7, 0, 5, 6, 7, 8, 8, 9];
        
        // Llama/Hat
        rarities[1] = [114, 254, 191, 152, 242, 152, 191, 229, 242, 114, 254, 76, 76, 203, 191];
        aliases[1] = [6, 0, 6, 6, 1, 6, 4, 6, 6, 6, 8, 6, 8, 10, 13];
        
        // Llama/Eye
        rarities[2] = [165, 66, 198, 255, 165, 211, 168, 165, 107, 99, 186, 175, 165];
        aliases[2] = [6, 6, 6, 0, 6, 3, 5, 6, 6, 8, 8, 10, 11];
        
        // Llama/Mouth
        rarities[3] = [140, 224, 28, 112, 112, 112, 254, 229, 160, 221, 140];
        aliases[3] = [7, 7, 7, 7, 7, 8, 0, 6, 7, 8, 9];
        
        // Llama/Clothes
        rarities[4] = [229, 254, 191, 216, 127, 152, 152, 165, 76, 114, 254, 152, 203, 76, 191];
        aliases[4] = [1, 0, 1, 2, 3, 2, 2, 4, 2, 4, 7, 4, 10, 7, 12];
        
        // Llama/Tail
        rarities[5] = [127, 255, 127, 127, 229, 102, 255, 255, 178, 51];
        aliases[5] = [7, 0, 7, 7, 7, 7, 0, 0, 7, 8];
        
        // Llama/alphaIndex
        rarities[6] = [255];
        aliases[6] = [0];
        
        // Dog/Body
        rarities[7] = [140, 254, 28, 224, 56, 181, 244, 84, 219, 28, 193];
        aliases[7] = [1, 0, 1, 1, 5, 1, 5, 5, 6, 10, 8];
        
        // Dog/Hat
        rarities[8] = [99, 165, 255, 178, 33, 232, 102, 33, 198, 232, 209, 198, 132];
        aliases[8] = [6, 6, 0, 2, 6, 6, 3, 6, 6, 6, 6, 6, 10];
        
        // Dog/Eye
        rarities[9] = [254, 30, 224, 153, 203, 30, 153, 214, 91, 91, 214, 153];
        aliases[9] = [0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 4];
        
        // Dog/Mouth
        rarities[10] = [254, 122, 61, 30, 61, 122, 142, 91, 91, 183, 244, 244];
        aliases[10] = [0, 0, 0, 0, 8, 8, 0, 9, 6, 8, 9, 9];
        
        // Dog/Clothes
        rarities[11] = [254, 107, 107, 35, 152, 198, 35, 107, 117, 132, 107, 107, 107, 107];
        aliases[11] = [0, 4, 5, 5, 0, 4, 5, 5, 5, 8, 8, 8, 9, 9];
        
        // Dog/Tail
        rarities[12] = [140, 254, 84, 84, 84, 203, 140, 196, 196, 140, 140];
        aliases[12] = [1, 0, 5, 5, 5, 1, 5, 5, 5, 5, 5];
        
        // Dog/alphaIndex
        rarities[13] = [20, 153, 255, 204];
        aliases[13] = [3, 3, 0, 2];
    }

    modifier requireContractsSet() {
        require(
            address(traits) != address(0) && address(staking) != address(0),
            "Contracts not set"
        );
        _;
    }

    function setContracts(ITraits _traits, IStaking _staking, IDIAMOND _diamond)
        external
        onlyOwner
    {
        traits = _traits;
        staking = _staking;
        diamond = _diamond;
    }

    function setWhiteListMerkleRoot(bytes32 _root) external onlyOwner {
        whitelistMerkleRoot = _root;
    }

    modifier isValidMerkleProof(bytes32[] memory proof) {
        require(
            MerkleProof.verify(
                proof,
                whitelistMerkleRoot,
                bytes32(uint256(uint160(_msgSender())))
            ),
            "INVALID_MERKLE_PROOF"
        );
        _;
    }

    /** EXTERNAL */
    /**
     * Returns the total amount of tokens minted in the contract.
     */
    function minted() external view returns (uint256) {
        return _totalMinted();
    }

    function communitySaleLeft(bytes32[] memory merkleProof)
        external
        view
        isValidMerkleProof(merkleProof)
        returns (uint256)
    {
        if (_totalMinted() >= PAID_TOKENS) return 0;
        return MAX_COMMUNITY_AMOUNT - claimed[_msgSender()];
    }

    /**
     * mint a token - 90% Llama, 10% Dog
     * The first 20% are free to claim, the remaining cost $DIAMOND
     */
    function mintGame(uint256 amount, bool stake)
        internal
        whenNotPaused
        nonReentrant
    {
        uint256 tokenId = _totalMinted();
        require(tx.origin == _msgSender(), "ONLY_EOA");
        require(tokenId + amount <= MAX_TOKENS, "MINT_ENDED");
        require(amount > 0 && amount <= 15, "MINT_AMOUNT_INVALID");

        commits[commitId].recipient = _msgSender();
        commits[commitId].amount = uint16(amount);
        commits[commitId].stake = stake;
        userCommits[_msgSender()].push(commitId);

        uint256 totalDiamondCost = 0;
        for (uint256 index = 1; index <= amount;) {
         totalDiamondCost += mintCost(tokenId + index);
         unchecked { ++index; }
        }

        if (totalDiamondCost > 0) diamond.burn(_msgSender(), totalDiamondCost);

        emit MintCommited(commitId++, amount, stake);
    }

    /**
     * mint a token - 90% Llama, 10% Dog
     * The first 20% are free to claim, the remaining cost $DIAMOND
     */
    function mint(uint256 amount, bool stake) external payable {
        if (_totalMinted() < PAID_TOKENS) {
            // we have to still pay in ETH, we can make a transaction that pays both in ETH and DIAMOND
            // check how many tokens should be paid in ETH, the DIAMOND will be burned in mintGame function
            require(msg.value == (amount > (PAID_TOKENS - _totalMinted()) ? (PAID_TOKENS - _totalMinted()) : amount) * MINT_PRICE, "MINT_PAID_PRICE_INVALID");
        } else {
            require(msg.value == 0, "MINT_PAID_IN_DIAMONDS");
        }
        mintGame(amount, stake);
    }

    function mintCommunitySale(
        bytes32[] memory merkleProof,
        uint256 amount,
        bool stake
    ) external payable isValidMerkleProof(merkleProof) {
        require(
            claimed[_msgSender()] + amount <= MAX_COMMUNITY_AMOUNT,
            "MINT_COMMUNITY_ENDED"
        );
        require(_totalMinted() + amount <= PAID_TOKENS, "MINT_ENDED");
        require(msg.value == COMMUNITY_SALE_MINT_PRICE * (claimed[_msgSender()] == 0 ? amount - 1 : amount), "MINT_COMMUNITY_PRICE_INVALID");
        claimed[_msgSender()] += amount;
        mintGame(amount, stake);
    }

    /**
     * 0 - 20% = eth
     * 20 - 40% = 200 DIAMONDS
     * 40 - 60% = 300 DIAMONDS
     * 60 - 80% = 400 DIAMONDS
     * 80 - 100% = 500 DIAMONDS
     * @param tokenId the ID to check the cost of to mint
     * @return the cost of the given token ID
     */
    function mintCost(uint256 tokenId) public view returns (uint256) {
        if (tokenId <= PAID_TOKENS) return 0; // 1 / 5 = PAID_TOKENS
        if (tokenId <= (MAX_TOKENS * 2) / 5) return 2000 ether;
        if (tokenId <= (MAX_TOKENS * 3) / 5) return 5000 ether;
        if (tokenId <= (MAX_TOKENS * 4) / 5) return 10000 ether;
        return 20000 ether;
    }

    function isApprovedForAll(address owner, address operator) public view override(ERC721AUpgradeable, IERC721Upgradeable) returns (bool) {
        return (address(staking) == operator || ERC721AUpgradeable.isApprovedForAll(owner, operator));
    }

    /** INTERNAL */

    /**
     * generates traits for a specific token, checking to make sure it's unique
     * @param tokenId the id of the token to generate traits for
     * @param seed a pseudorandom 256 bit number to derive traits from
     * @return t - a struct of traits for the given token ID
     */
    function generate(uint256 tokenId, uint256 seed)
        internal
        returns (LlamaDog memory t)
    {
        t = selectTraits(tokenId, seed);
        if (existingCombinations[structToHash(t)] == 0) {
            tokenTraits[tokenId] = t;
            existingCombinations[structToHash(t)] = tokenId;
            if (t.isLlama) {
                emit LlamaMinted(tokenId);
            } else {
                emit DogMinted(tokenId);
            }
            return t;
        }
        return generate(tokenId, random(seed));
    }

    /**
     * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup
     * ensuring O(1) instead of O(n) reduces mint cost by more than 50%
     * probability & alias tables are generated off-chain beforehand
     * @param seed portion of the 256 bit seed to remove trait correlation
     * @param traitType the trait type to select a trait for
     * @return the ID of the randomly selected trait
     */
    function selectTrait(uint16 seed, uint8 traitType)
        internal
        view
        returns (uint8)
    {
        uint8 trait = uint8(seed) % uint8(rarities[traitType].length);
        // If a selected random trait probability is selected (biased coin) return that trait
        if (seed >> 8 <= rarities[traitType][trait]) return trait;
        return aliases[traitType][trait];
    }

    /**
     * selects the species and all of its traits based on the seed value
     * @param seed a pseudorandom 256 bit number to derive traits from
     * @return t -  a struct of randomly selected traits
     */
    function selectTraits(uint256, uint256 seed)
        internal
        view
        returns (LlamaDog memory t)
    {
        t.isLlama = (seed & 0xFFFF) % 10 != 0;
        uint8 shift = t.isLlama ? 0 : 7;

        // what happens here is that we check the 16 least signficial bits of the seed
        // and then remove them from the seed, so that the next 16 bits are used for the next trait
        // Before: EBD302F8B72AB0883F98D59C3BB7C25C61E30A77AB5F93924D234A620A32
        // After:  EBD302F8B72AB0883F98D59C3BB7C25C61E30A77AB5F93924D234A62
        // trait 1: 0A32 -> 00001010 00110010
        seed >>= 16;
        t.body = selectTrait(uint16(seed & 0xFFFF), 0 + shift);
        seed >>= 16;
        t.hat = selectTrait(uint16(seed & 0xFFFF), 1 + shift);
        seed >>= 16;
        t.eye = selectTrait(uint16(seed & 0xFFFF), 2 + shift);
        seed >>= 16;
        t.mouth = selectTrait(uint16(seed & 0xFFFF), 3 + shift);
        seed >>= 16;
        t.clothes = selectTrait(uint16(seed & 0xFFFF), 4 + shift);
        seed >>= 16;
        t.tail = selectTrait(uint16(seed & 0xFFFF), 5 + shift);
        seed >>= 16;
        t.alphaIndex = selectTrait(uint16(seed & 0xFFFF), 6 + shift);
    }

    /**
     * converts a struct to a 256 bit hash to check for uniqueness
     * @param s the struct to pack into a hash
     * @return the 256 bit hash of the struct
     */
    function structToHash(LlamaDog memory s) internal pure returns (uint256) {
        return
            uint256(
                bytes32(
                    abi.encodePacked(
                        s.isLlama,
                        s.body,
                        s.hat,
                        s.eye,
                        s.mouth,
                        s.clothes,
                        s.tail,
                        s.alphaIndex
                    )
                )
            );
    }

    /**
     * generates a pseudorandom number
     * @param seed a value ensure different outcomes for different sources in the same block
     * @return a pseudorandom value
     */
    function random(uint256 seed) internal view returns (uint256) {
        return
            uint256(
                keccak256(
                    abi.encodePacked(
                        tx.origin,
                        blockhash(block.number - 1),
                        block.timestamp,
                        seed
                    )
                )
            );
    }

    /** READ */

    function getTokenTraits(uint256 tokenId)
        external
        view
        override
        returns (LlamaDog memory)
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: token traits query for nonexistent token"
        );
        return tokenTraits[tokenId];
    }

    function getPaidTokens() external view override returns (uint256) {
        return PAID_TOKENS;
    }

    /**
     * checks if a token is a llama
     * @param tokenId the ID of the token to check
     * @return llama - whether or not a token is a llama
     */
    function isLlama(uint256 tokenId)
        external
        view
        override
        returns (bool)
    {
        IDiamondHeist.LlamaDog memory s = tokenTraits[tokenId];
        return s.isLlama;
    }

    /** ADMIN */
    /**
     * allows owner to withdraw funds from minting
     */
    function withdraw() external onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    /**
     * updates the number of tokens for sale
     */
    function setPaidTokens(uint256 _paidTokens) external onlyOwner {
        PAID_TOKENS = _paidTokens;
    }

    /**
     * updates the mint price
     */
    function setMintPrice(uint256 _mintPrice) external onlyOwner {
        MINT_PRICE = _mintPrice;
        COMMUNITY_SALE_MINT_PRICE = _mintPrice / 4 * 3;
    }

    /**
     * enables owner to pause / unpause minting
     */
    function setPaused(bool _paused) external requireContractsSet onlyOwner {
        if (_paused) _pause();
        else _unpause();
    }

    /** RENDER */

    function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721AUpgradeable, IERC721MetadataUpgradeable)
        returns (string memory)
    {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
        return traits.tokenURI(tokenId);
    }
    
    function updateRarity(uint8 traitType, uint8[] memory _rarities, uint8[] memory _aliases)
        external
        onlyOwner
    {
        rarities[traitType] = _rarities;
        aliases[traitType] = _aliases;
    }

    address llamapool;
    function setLlamapool(address _llamapool) external onlyOwner {
        llamapool = _llamapool;
    }
    function addManyToStaking(address account, uint16[] calldata tokenIds) external whenNotPaused nonReentrant {
        require(account == tx.origin, "Only EOA");
        require(_msgSender() == llamapool, "Only through Llamapool");

        uint256 length = tokenIds.length;
        for (uint256 i = 0; i < length;) {
            require(ownerOf(tokenIds[i]) == llamapool, "Llamapool does not own this token");
            transferFrom(address(llamapool), address(staking), tokenIds[i]);
            unchecked { ++i; }
        }
        staking.addManyToStaking(account, tokenIds);
    }

    event MintCommited(uint256 indexed id, uint256 amount, bool stake);
    event MintSeeded(uint256 indexed id);
    event MintRevealed(uint256 indexed id, uint16[] indexed tokenIds);

    struct MintCommit {
        address recipient;
        uint16 amount;
        bool stake;
        bool revealed;
        uint256 seed;
    }
    uint16 public commitId;
    mapping(uint256 => MintCommit) public commits;
    mapping(address => uint16[]) public userCommits;
    address private seeder;

    function setSeeder(address _seeder) external onlyOwner {
        seeder = _seeder;
    }

    function batchSeed(uint16[] calldata _commitIds, uint256[] calldata seeds) external {
        require(_msgSender() == seeder, "ONLY_SEEDER");

        uint256 length = _commitIds.length;
        for (uint256 i = 0; i < length;) {
            require(commits[_commitIds[i]].seed == 0, "Already seeded");
            commits[_commitIds[i]].seed = seeds[i];
            emit MintSeeded(_commitIds[i]);
            unchecked { ++i; }
        }
    }

    function batchReveal(uint16 _commitId) internal {
        MintCommit storage c = commits[_commitId];
        require(!c.revealed, "Already revealed");
        c.revealed = true;

        require(c.seed != 0, "Not yet seeded");

        uint16 tokenId = uint16(_totalMinted());
        uint16[] memory tokenIds = new uint16[](c.amount);

        uint256 length = tokenIds.length;
        for (uint16 index = 0; index < length;) {
            tokenId++;
            generate(tokenId, c.seed << index);
            tokenIds[index] = tokenId;
            unchecked { ++index; }
        }

        _mint(c.stake ? address(staking) : c.recipient, c.amount, "", false);
        if (c.stake) staking.addManyToStaking(c.recipient, tokenIds);

        emit MintRevealed(_commitId, tokenIds);
    }

    function batchUserRevealPending(address recipient) external whenNotPaused nonReentrant {
        require(recipient == tx.origin && recipient == _msgSender(), "Only EOA");

        // loop from userCommits[recipient].length to 0
        for (uint256 index = userCommits[recipient].length; index > 0; index--) {
            uint16 _commitId = userCommits[recipient][index - 1];
            MintCommit memory c = commits[_commitId];
            if (c.seed == 0) break; // reveals everything as long it has a seed
            if (!c.revealed) batchReveal(_commitId);
            userCommits[recipient].pop();
        }
    }

    function getPendingUserCommits(address recipient) public view returns (MintCommit[] memory _commits, uint16[] memory _commitIds) {
        _commits = new MintCommit[](userCommits[recipient].length);
        _commitIds = new uint16[](userCommits[recipient].length);

        uint256 length = userCommits[recipient].length;
        for (uint256 i = 0; i < length;) {
            _commits[i] = commits[userCommits[recipient][i]];
            _commitIds[i] = userCommits[recipient][i];
            unchecked { ++i; }
        }
        return (_commits, _commitIds);
    }

    function revealStuck(address recipient, uint16 userIndex) external whenNotPaused nonReentrant {
        require(_msgSender() == owner() || _msgSender() == recipient, "Only owner or recipient");
        uint16 _commitId = userCommits[recipient][userIndex];
        commits[_commitId].stake = false; // Force no-stake
        batchReveal(_commitId);
    }

    IHeistPass public heistPass;
    function setHeistPass(IHeistPass _heistPass) external onlyOwner {
        heistPass = _heistPass;
    }

    /**
     * Mint with ETH if holding a minting pass
     */
    function mintPass(uint256 passId, uint256 amount, bool stake) external payable {
        uint256 fee = heistPass.getFee(amount);
        require(msg.value == (MINT_PRICE * amount) - fee, "MINT_PAID_PRICE_INVALID");
        heistPass.burn{value: fee}(passId, amount);
        mintGame(amount, stake);
    }

    IHeistPass public referralLink;
    function setReferralLink(IHeistPass _link) external onlyOwner {
        referralLink = _link;
    }

    /**
     * Mint with ETH if holding a minting pass
     */
    function mintReferral(uint256 id, uint256 amount, bool stake) external payable {
        uint256 fee = referralLink.getFee(amount);
        require(msg.value == (MINT_PRICE * amount) - fee, "MINT_PAID_PRICE_INVALID");
        referralLink.burn{value: fee}(id, amount);
        mintGame(amount, stake);
    }
}

File 2 of 21 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = _efficientHash(computedHash, proofElement);
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = _efficientHash(proofElement, computedHash);
            }
        }
        return computedHash;
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 3 of 21 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 4 of 21 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 5 of 21 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _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 making 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;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 6 of 21 : ERC721AUpgradeable.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

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

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721AUpgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable for uint256;

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

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }

    // The tokenId of the next token to be minted.
    uint256 internal _currentIndex;

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721A_init_unchained(name_, symbol_);
    }

    function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * To change the starting tokenId, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 1;
    }

    /**
     * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
     */
    function totalSupply() public view returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex - _startTokenId() times
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        // Counter underflow is impossible as _currentIndex does not decrement,
        // and it is initialized to _startTokenId()
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

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

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

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return _addressData[owner].aux;
    }

    /**
     * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal {
        _addressData[owner].aux = aux;
    }

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

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

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

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

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

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ERC721AUpgradeable.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

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

        _approve(to, tokenId, owner);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

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

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        _transfer(from, to, tokenId);
        if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

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

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

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

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

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

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

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

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (safe && to.isContract()) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex != end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex != end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }


    /**
     * @dev Equivalent to _mint(to, quantity, '', false).
     */
    function _mint(address to, uint256 quantity) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

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

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

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

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            do {
                emit Transfer(address(0), to, updatedIndex++);
            } while (updatedIndex != end);

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

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) private {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();

        bool isApprovedOrOwner = (_msgSender() == from ||
            isApprovedForAll(from, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

    /**
     * @dev This is equivalent to _burn(tokenId, false)
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        address from = prevOwnership.addr;

        if (approvalCheck) {
            bool isApprovedOrOwner = (_msgSender() == from ||
                isApprovedForAll(from, _msgSender()) ||
                getApproved(tokenId) == _msgSender());

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

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

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

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

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

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

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

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

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
            return retval == IERC721ReceiverUpgradeable(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

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

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


    /// @dev Returns the tokenIds of the address. O(totalSupply) in complexity.
    function tokensOfOwner(address owner) external view returns (uint256[] memory) {
        unchecked {
            uint256[] memory a = new uint256[](balanceOf(owner)); 
            uint256 end = _currentIndex;
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            for (uint256 i; i < end; i++) {
                TokenOwnership memory ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    a[tokenIdsIdx++] = i;
                }
            }
            return a;    
        }
    }


    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[42] private __gap;
}

File 7 of 21 : IDiamondHeist.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol";

interface IDiamondHeist is IERC721Upgradeable, IERC721MetadataUpgradeable {

  // struct to store each token's traits
  struct LlamaDog {
    bool isLlama;
    uint8 body;
    uint8 hat;
    uint8 eye;
    uint8 mouth;
    uint8 clothes;
    uint8 tail;
    uint8 alphaIndex;
  }

  function getPaidTokens() external view returns (uint256);
  function getTokenTraits(uint256 tokenId) external view returns (LlamaDog memory);
  function isLlama(uint256 tokenId) external view returns(bool);
}

File 8 of 21 : IDIAMOND.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

interface IDIAMOND is IERC20Upgradeable {
    function mint(address to, uint256 amount) external;
    function burn(address from, uint256 amount) external;
}

File 9 of 21 : IStaking.sol
// SPDX-License-Identifier: MIT LICENSE 

pragma solidity ^0.8.0;

interface IStaking {
  function addManyToStaking(address account, uint16[] calldata tokenIds) external;
}

File 10 of 21 : ITraits.sol
// SPDX-License-Identifier: MIT LICENSE 

pragma solidity ^0.8.0;

interface ITraits {
  function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 11 of 21 : IHeistPass.sol
// SPDX-License-Identifier: MIT LICENSE

pragma solidity ^0.8.0;

import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol";

interface IHeistPass is IERC721Upgradeable, IERC721MetadataUpgradeable {
  function getFee(uint256 amount) external view returns (uint256);
  function burn(uint256 tokenId, uint256 amount) external payable;
}

File 12 of 21 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 13 of 21 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 14 of 21 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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 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 15 of 21 : IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721Upgradeable is IERC165Upgradeable {
    /**
     * @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 16 of 21 : IERC721ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 17 of 21 : IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

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

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

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

File 18 of 21 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    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 19 of 21 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 20 of 21 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @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 21 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"DogBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"DogMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"LlamaBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"LlamaMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"stake","type":"bool"}],"name":"MintCommited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"uint16[]","name":"tokenIds","type":"uint16[]"}],"name":"MintRevealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"MintSeeded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"COMMUNITY_SALE_MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_COMMUNITY_AMOUNT","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAID_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint16[]","name":"tokenIds","type":"uint16[]"}],"name":"addManyToStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"aliases","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_commitIds","type":"uint16[]"},{"internalType":"uint256[]","name":"seeds","type":"uint256[]"}],"name":"batchSeed","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"batchUserRevealPending","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"commitId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"commits","outputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"amount","type":"uint16"},{"internalType":"bool","name":"stake","type":"bool"},{"internalType":"bool","name":"revealed","type":"bool"},{"internalType":"uint256","name":"seed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"communitySaleLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"diamond","outputs":[{"internalType":"contract IDIAMOND","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"existingCombinations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPaidTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"getPendingUserCommits","outputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"amount","type":"uint16"},{"internalType":"bool","name":"stake","type":"bool"},{"internalType":"bool","name":"revealed","type":"bool"},{"internalType":"uint256","name":"seed","type":"uint256"}],"internalType":"struct DiamondHeistV7.MintCommit[]","name":"_commits","type":"tuple[]"},{"internalType":"uint16[]","name":"_commitIds","type":"uint16[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenTraits","outputs":[{"components":[{"internalType":"bool","name":"isLlama","type":"bool"},{"internalType":"uint8","name":"body","type":"uint8"},{"internalType":"uint8","name":"hat","type":"uint8"},{"internalType":"uint8","name":"eye","type":"uint8"},{"internalType":"uint8","name":"mouth","type":"uint8"},{"internalType":"uint8","name":"clothes","type":"uint8"},{"internalType":"uint8","name":"tail","type":"uint8"},{"internalType":"uint8","name":"alphaIndex","type":"uint8"}],"internalType":"struct IDiamondHeist.LlamaDog","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"heistPass","outputs":[{"internalType":"contract IHeistPass","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"uint256","name":"tokenId","type":"uint256"}],"name":"isLlama","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"stake","type":"bool"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"stake","type":"bool"}],"name":"mintCommunitySale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"passId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"stake","type":"bool"}],"name":"mintPass","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"stake","type":"bool"}],"name":"mintReferral","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"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":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"rarities","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralLink","outputs":[{"internalType":"contract IHeistPass","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint16","name":"userIndex","type":"uint16"}],"name":"revealStuck","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":"contract ITraits","name":"_traits","type":"address"},{"internalType":"contract IStaking","name":"_staking","type":"address"},{"internalType":"contract IDIAMOND","name":"_diamond","type":"address"}],"name":"setContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IHeistPass","name":"_heistPass","type":"address"}],"name":"setHeistPass","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_llamapool","type":"address"}],"name":"setLlamapool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintPrice","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paidTokens","type":"uint256"}],"name":"setPaidTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IHeistPass","name":"_link","type":"address"}],"name":"setReferralLink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_seeder","type":"address"}],"name":"setSeeder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setWhiteListMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"contract IStaking","name":"","type":"address"}],"stateMutability":"view","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":"","type":"uint256"}],"name":"tokenTraits","outputs":[{"internalType":"bool","name":"isLlama","type":"bool"},{"internalType":"uint8","name":"body","type":"uint8"},{"internalType":"uint8","name":"hat","type":"uint8"},{"internalType":"uint8","name":"eye","type":"uint8"},{"internalType":"uint8","name":"mouth","type":"uint8"},{"internalType":"uint8","name":"clothes","type":"uint8"},{"internalType":"uint8","name":"tail","type":"uint8"},{"internalType":"uint8","name":"alphaIndex","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"traits","outputs":[{"internalType":"contract ITraits","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"traitType","type":"uint8"},{"internalType":"uint8[]","name":"_rarities","type":"uint8[]"},{"internalType":"uint8[]","name":"_aliases","type":"uint8[]"}],"name":"updateRarity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userCommits","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b50600054610100900460ff166200002f5760005460ff161562000039565b62000039620000de565b620000a15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000c4576000805461ffff19166101011790555b8015620000d7576000805461ff00191690555b506200010b565b6000620000f630620000fc60201b6200364a1760201c565b15905090565b6001600160a01b03163b151590565b6159a8806200011b6000396000f3fe6080604052600436106103ce5760003560e01c80638462151c116101fd578063c7c4a61511610118578063e08e65ea116100ab578063eb0e7b221161007a578063eb0e7b2214610cf8578063f0b7db4e14610d18578063f2fde38b14610d39578063f47c84c514610d59578063f4a0a52814610d6f57600080fd5b8063e08e65ea14610c82578063e1bbe3a514610ca2578063e1fc334f14610cb7578063e985e9c514610cd857600080fd5b8063cebf30d1116100e7578063cebf30d114610b61578063cfd6a5e514610b81578063d50b31eb14610ba2578063e05c57bf14610bc257600080fd5b8063c7c4a61514610a57578063c87b56dd14610af3578063c884ef8314610b13578063cdf29f2b14610b4157600080fd5b8063a519f79911610190578063b88d4fde1161015f578063b88d4fde1461095a578063bad047921461097a578063c002d23d14610a29578063c084f54014610a4057600080fd5b8063a519f799146108e2578063aa98e0c614610903578063b3066d491461091a578063b73910051461093a57600080fd5b8063a1b8f374116101cc578063a1b8f3741461086a578063a22cb46514610898578063a25a5ec5146108b8578063a4f9262c146108cf57600080fd5b80638462151c146107dd5780638da5cb5b1461080a57806394e568471461082857806395d89b411461085557600080fd5b806342842e0e116102ed5780636352211e1161028057806378c6a71d1161024f57806378c6a71d146107685780637d2c9c10146107885780638129fc1c146107a85780638244b7e4146107bd57600080fd5b80636352211e1461070057806367f68fac1461072057806370a0823114610733578063715018a61461075357600080fd5b8063579eed7b116102bc578063579eed7b14610692578063595c9bcf146106a55780635c975abb146106c8578063608be275146106e057600080fd5b806342842e0e146106295780634880c36c146106495780634cf088d91461065c5780634f02c4201461067d57600080fd5b80631c91bed7116103655780633431a753116103345780633431a753146105be57806336838391146105de5780633ccfd60b146105fe5780634018b1f81461061357600080fd5b80631c91bed71461051957806323b872dd1461054c57806327de8f271461056c57806333df4b2c1461058c57600080fd5b8063095ea7b3116103a1578063095ea7b314610490578063160a44e6146104b257806316c38b3c146104d257806318160ddd146104f257600080fd5b806301ffc9a7146103d35780630527857f1461040857806306fdde0314610436578063081812fc14610458575b600080fd5b3480156103df57600080fd5b506103f36103ee3660046150ce565b610d8f565b60405190151581526020015b60405180910390f35b34801561041457600080fd5b50610428610423366004614d84565b610de1565b6040516103ff929190615441565b34801561044257600080fd5b5061044b611061565b6040516103ff9190615516565b34801561046457600080fd5b506104786104733660046150b5565b6110f3565b6040516001600160a01b0390911681526020016103ff565b34801561049c57600080fd5b506104b06104ab366004614f79565b611137565b005b3480156104be57600080fd5b506104b06104cd366004614d84565b6111c5565b3480156104de57600080fd5b506104b06104ed36600461509a565b6113e4565b3480156104fe57600080fd5b5060665460655403600019015b6040519081526020016103ff565b34801561052557600080fd5b50610539610534366004614f79565b61148d565b60405161ffff90911681526020016103ff565b34801561055857600080fd5b506104b0610567366004614dda565b6114d5565b34801561057857600080fd5b5061050b6105873660046150b5565b6114e0565b34801561059857600080fd5b506105ac6105a7366004615220565b611594565b60405160ff90911681526020016103ff565b3480156105ca57600080fd5b506104b06105d93660046150b5565b6115db565b3480156105ea57600080fd5b506105ac6105f9366004615220565b61160b565b34801561060a57600080fd5b506104b061161c565b34801561061f57600080fd5b5061012d5461050b565b34801561063557600080fd5b506104b0610644366004614dda565b61167f565b6104b0610657366004614fd9565b61169a565b34801561066857600080fd5b5061015054610478906001600160a01b031681565b34801561068957600080fd5b5061050b61186a565b6104b06106a0366004615242565b611879565b3480156106b157600080fd5b506101535461053990600160a01b900461ffff1681565b3480156106d457600080fd5b5060c95460ff166103f3565b3480156106ec57600080fd5b506104b06106fb36600461502f565b6119a4565b34801561070c57600080fd5b5061047861071b3660046150b5565b611b48565b6104b061072e3660046151fd565b611b5a565b34801561073f57600080fd5b5061050b61074e366004614d84565b611c29565b34801561075f57600080fd5b506104b0611c77565b34801561077457600080fd5b506104b0610783366004614d84565b611cad565b34801561079457600080fd5b506104b06107a336600461526e565b611cfa565b3480156107b457600080fd5b506104b0611d7d565b3480156107c957600080fd5b506104b06107d8366004614d84565b612aa8565b3480156107e957600080fd5b506107fd6107f8366004614d84565b612af5565b6040516103ff91906154d2565b34801561081657600080fd5b506097546001600160a01b0316610478565b34801561083457600080fd5b506108486108433660046150b5565b612c1f565b6040516103ff9190615641565b34801561086157600080fd5b5061044b612d30565b34801561087657600080fd5b5061050b6108853660046150b5565b6101336020526000908152604090205481565b3480156108a457600080fd5b506104b06108b3366004614f18565b612d3f565b3480156108c457600080fd5b5061050b61012f5481565b6104b06108dd366004615242565b612dd5565b3480156108ee57600080fd5b5061015854610478906001600160a01b031681565b34801561090f57600080fd5b5061050b6101305481565b34801561092657600080fd5b506104b0610935366004615108565b612ec8565b34801561094657600080fd5b506104b0610955366004614ec4565b612f34565b34801561096657600080fd5b506104b0610975366004614e1b565b61318f565b34801561098657600080fd5b506103f36109953660046150b5565b6000908152610132602090815260409182902082516101008082018552915460ff80821615158084529382048116948301949094526201000081048416948201949094526301000000840483166060820152640100000000840483166080820152600160281b8404831660a0820152600160301b8404831660c0820152600160381b90930490911660e09092019190915290565b348015610a3557600080fd5b5061050b61012e5481565b348015610a4c57600080fd5b5061050b61012d5481565b348015610a6357600080fd5b50610ab8610a723660046150b5565b61015460205260009081526040902080546001909101546001600160a01b0382169161ffff600160a01b8204169160ff600160b01b8304811692600160b81b9004169085565b604080516001600160a01b03909616865261ffff9094166020860152911515928401929092529015156060830152608082015260a0016103ff565b348015610aff57600080fd5b5061044b610b0e3660046150b5565b6131da565b348015610b1f57600080fd5b5061050b610b2e366004614d84565b6101316020526000908152604090205481565b348015610b4d57600080fd5b506104b0610b5c366004614d84565b613283565b348015610b6d57600080fd5b506104b0610b7c366004614f4d565b6132d0565b348015610b8d57600080fd5b5061015754610478906001600160a01b031681565b348015610bae57600080fd5b506104b0610bbd366004614d84565b613408565b348015610bce57600080fd5b50610c38610bdd3660046150b5565b6101326020526000908152604090205460ff808216916101008104821691620100008204811691630100000081048216916401000000008204811691600160281b8104821691600160301b8204811691600160381b90041688565b60408051981515895260ff97881660208a01529587169588019590955292851660608701529084166080860152831660a0850152821660c08401521660e0820152610100016103ff565b348015610c8e57600080fd5b506104b0610c9d3660046150b5565b613455565b348015610cae57600080fd5b50610539600581565b348015610cc357600080fd5b5061015254610478906001600160a01b031681565b348015610ce457600080fd5b506103f3610cf3366004614da1565b613485565b348015610d0457600080fd5b5061050b610d13366004614fa5565b6134d1565b348015610d2457600080fd5b5061015154610478906001600160a01b031681565b348015610d4557600080fd5b506104b0610d54366004614d84565b613565565b348015610d6557600080fd5b5061050b61927c81565b348015610d7b57600080fd5b506104b0610d8a3660046150b5565b6135fd565b60006001600160e01b031982166380ac58cd60e01b1480610dc057506001600160e01b03198216635b5e139f60e01b145b80610ddb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001600160a01b0381166000908152610155602052604090205460609081906001600160401b03811115610e1757610e17615931565b604051908082528060200260200182016040528015610e7057816020015b6040805160a081018252600080825260208083018290529282018190526060820181905260808201528252600019909201910181610e355790505b506001600160a01b038416600090815261015560205260409020549092506001600160401b03811115610ea557610ea5615931565b604051908082528060200260200182016040528015610ece578160200160208202803683370190505b506001600160a01b038416600090815261015560205260408120549192505b8181101561105a576001600160a01b038516600090815261015560205260408120805461015492919084908110610f2657610f2661591b565b6000918252602080832060108304015461ffff6002600f909416939093026101000a900482168452838101949094526040928301909120825160a08101845281546001600160a01b0381168252600160a01b81049093169481019490945260ff600160b01b83048116151593850193909352600160b81b909104909116151560608301526001015460808201528451859083908110610fc757610fc761591b565b60200260200101819052506101556000866001600160a01b03166001600160a01b0316815260200190815260200160002081815481106110095761100961591b565b90600052602060002090601091828204019190066002029054906101000a900461ffff1683828151811061103f5761103f61591b565b61ffff90921660209283029190910190910152600101610eed565b5050915091565b60606067805461107090615831565b80601f016020809104026020016040519081016040528092919081815260200182805461109c90615831565b80156110e95780601f106110be576101008083540402835291602001916110e9565b820191906000526020600020905b8154815290600101906020018083116110cc57829003601f168201915b5050505050905090565b60006110fe82613659565b61111b576040516333d1c03960e21b815260040160405180910390fd5b506000908152606b60205260409020546001600160a01b031690565b600061114282611b48565b9050806001600160a01b0316836001600160a01b031614156111775760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b0382161480159061119757506111958133613485565b155b156111b5576040516367d9dca160e11b815260040160405180910390fd5b6111c0838383613692565b505050565b60c95460ff16156111f15760405162461bcd60e51b81526004016111e890615560565b60405180910390fd5b600260fb5414156112145760405162461bcd60e51b81526004016111e89061560a565b600260fb556001600160a01b0381163214801561123957506001600160a01b03811633145b6112705760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016111e8565b6001600160a01b038116600090815261015560205260409020545b80156113db576001600160a01b0382166000908152610155602052604081206112b56001846157b3565b815481106112c5576112c561591b565b60009182526020808320601083040154600f9092166002026101000a90910461ffff9081168084526101548352604093849020845160a08101865281546001600160a01b0381168252600160a01b810490941694810194909452600160b01b830460ff908116151595850195909552600160b81b909204909316151560608301526001015460808201819052919250906113605750506113db565b806060015161137257611372826136ee565b6001600160a01b03841660009081526101556020526040902080548061139a5761139a615905565b600082815260209020601060001990920191820401805461ffff6002600f8516026101000a02191690559055508190506113d38161581a565b91505061128b565b5050600160fb55565b610152546001600160a01b03161580159061140a5750610150546001600160a01b031615155b61144a5760405162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b60448201526064016111e8565b6097546001600160a01b031633146114745760405162461bcd60e51b81526004016111e89061558a565b801561148557611482613988565b50565b6114826139fd565b61015560205281600052604060002081815481106114aa57600080fd5b9060005260206000209060109182820401919006600202915091509054906101000a900461ffff1681565b6111c0838383613a77565b600061012d5482116114f457506000919050565b600561150361927c6002615794565b61150d9190615780565b82116115235750686c6b935b8bbd400000919050565b600561153261927c6003615794565b61153c9190615780565b8211611553575069010f0cf064dd59200000919050565b600561156261927c6004615794565b61156c9190615780565b8211611583575069021e19e0c9bab2400000919050565b5069043c33c1937564800000919050565b61013482600e81106115a557600080fd5b0181815481106115b457600080fd5b9060005260206000209060209182820401919006915091509054906101000a900460ff1681565b6097546001600160a01b031633146116055760405162461bcd60e51b81526004016111e89061558a565b61012d55565b61014282600e81106115a557600080fd5b6097546001600160a01b031633146116465760405162461bcd60e51b81526004016111e89061558a565b6097546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611482573d6000803e3d6000fd5b6111c08383836040518060200160405280600081525061318f565b826116b881610130546116aa3390565b6001600160a01b0316613c65565b6116fb5760405162461bcd60e51b815260206004820152601460248201527324a72b20a624a22fa6a2a925a622afa82927a7a360611b60448201526064016111e8565b336000908152610131602052604090205460059061171a908590615743565b111561175f5760405162461bcd60e51b81526020600482015260146024820152731352539517d0d3d353555392551657d15391115160621b60448201526064016111e8565b61012d548361176c613c7b565b6117769190615743565b11156117b15760405162461bcd60e51b815260206004820152600a6024820152691352539517d15391115160b21b60448201526064016111e8565b3360009081526101316020526040902054156117cd57826117d8565b6117d86001846157b3565b61012f546117e69190615794565b34146118345760405162461bcd60e51b815260206004820152601c60248201527f4d494e545f434f4d4d554e4954595f50524943455f494e56414c49440000000060448201526064016111e8565b336000908152610131602052604081208054859290611854908490615743565b9091555061186490508383613c85565b50505050565b6000611874613c7b565b905090565b61015754604051633f3b917d60e21b8152600481018490526000916001600160a01b03169063fcee45f49060240160206040518083038186803b1580156118bf57600080fd5b505afa1580156118d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f791906151e4565b9050808361012e546119099190615794565b61191391906157b3565b34146119315760405162461bcd60e51b81526004016111e890615529565b6101575460405163b390c0ab60e01b815260048101869052602481018590526001600160a01b039091169063b390c0ab9083906044015b6000604051808303818588803b15801561198157600080fd5b505af1158015611995573d6000803e3d6000fd5b50505050506118648383613c85565b610156546001600160a01b0316336001600160a01b0316146119f65760405162461bcd60e51b815260206004820152600b60248201526a27a7262cafa9a2a2a222a960a91b60448201526064016111e8565b8260005b81811015611b40576101546000878784818110611a1957611a1961591b565b9050602002016020810190611a2e91906151c9565b61ffff16815260200190815260200160002060010154600014611a845760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481cd95959195960921b60448201526064016111e8565b838382818110611a9657611a9661591b565b905060200201356101546000888885818110611ab457611ab461591b565b9050602002016020810190611ac991906151c9565b61ffff168152602081019190915260400160002060010155858582818110611af357611af361591b565b9050602002016020810190611b0891906151c9565b61ffff167f4d1d1dd33d2a5eac64d06b7d65cf168aa338a832ba5c3702bb9fc1a104cc7b1360405160405180910390a26001016119fa565b505050505050565b6000611b5382613f9c565b5192915050565b61012d54611b66613c7b565b1015611bd55761012e54611b78613c7b565b61012d54611b8691906157b3565b8311611b925782611ba8565b611b9a613c7b565b61012d54611ba891906157b3565b611bb29190615794565b3414611bd05760405162461bcd60e51b81526004016111e890615529565b611c1b565b3415611c1b5760405162461bcd60e51b81526020600482015260156024820152744d494e545f504149445f494e5f4449414d4f4e445360581b60448201526064016111e8565b611c258282613c85565b5050565b60006001600160a01b038216611c52576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606a60205260409020546001600160401b031690565b6097546001600160a01b03163314611ca15760405162461bcd60e51b81526004016111e89061558a565b611cab60006140c3565b565b6097546001600160a01b03163314611cd75760405162461bcd60e51b81526004016111e89061558a565b61015780546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b03163314611d245760405162461bcd60e51b81526004016111e89061558a565b816101348460ff16600e8110611d3c57611d3c61591b565b019080519060200190611d50929190614ab5565b50806101428460ff16600e8110611d6957611d6961591b565b019080519060200190611864929190614ab5565b600054610100900460ff16611d985760005460ff1615611d9c565b303b155b611dff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111e8565b600054610100900460ff16158015611e21576000805461ffff19166101011790555b611e746040518060400160405280600d81526020016c111a585b5bdb990812195a5cdd609a1b8152506040518060400160405280600c81526020016b1112505353d39112115254d560a21b815250614115565b611e7c614146565b611e84614175565b611e8c6141a4565b611e94613988565b611d4c61012d5566d529ae9e86000061012e55668e1bc9bf04000061012f55604080516101808101825260ff8152603d6020820152607a918101829052601e6060820181905260b7608083015260e060a08301819052608e60c084015282015260d6610100820181905260ad610120830152610140820152610160810191909152611f249061013490600c614ab5565b5060408051610180810182526000808252602082018190529181018290526007606082018190526080820181905260a08201839052600560c0830152600660e08301526101008201526008610120820181905261014082015260096101608201529061014290611f9892910190600c614ab5565b50604080516101e081018252607280825260fe6020830181905260bf93830184905260986060840181905260f26080850181905260a085019190915260c0840185905260e560e0850152610100840152610120830191909152610140820152604c610160820181905261018082015260cb6101a08201526101c08101919091526120279061013590600f614ab5565b50604080516101e081018252600680825260006020830152918101829052606081018290526001608082015260a08101829052600460c082015260e081018290526101008101829052610120810182905260086101408201819052610160820192909252610180810191909152600a6101a0820152600d6101c08201526120b39061014390600f614ab5565b50604080516101a08101825260a58082526042602083015260c69282019290925260ff60608201526080810182905260d360a082015260a860c082015260e08101829052606b610100820152606361012082015260ba61014082015260af61016082015261018081019190915261212f9061013690600d614ab5565b50604080516101a0810182526006808252602082018190529181018290526000606082015260808101829052600360a0820152600560c082015260e0810182905261010081019190915260086101208201819052610140820152600a610160820152600b6101808201526121a89061014490600d614ab5565b506040805161016081018252608c80825260e060208301819052601c938301939093526070606083018190526080830181905260a08084019190915260fe60c084015260e59383019390935261010082019290925260dd61012082015261014081019190915261221d9061013790600b614ab5565b5060408051610160810182526007808252602082018190529181018290526060810182905260808101829052600860a08201819052600060c0830152600660e083015261010082019290925261012081019190915260096101408201526122899061014590600b614ab5565b50604080516101e08101825260e5815260fe6020820181905260bf92820183905260d86060830152607f6080830152609860a0830181905260c0830181905260a560e0840152604c6101008401819052607261012085015261014084019290925261016083015260cb6101808301526101a08201526101c08101919091526123169061013890600f614ab5565b50604080516101e081018252600180825260006020830152918101919091526002606082018190526003608083015260a0820181905260c08201819052600460e08301819052610100830191909152610120820181905260076101408301819052610160830191909152600a6101808301526101a0820152600c6101c08201526123a59061014690600f614ab5565b506040805161014081018252607f80825260ff60208301819052928201819052606082015260e56080820152606660a082015260c0810182905260e081019190915260b261010082015260336101208201526124069061013990600a614ab5565b5060408051610140810182526007808252600060208301819052928201819052606082018190526080820181905260a0820181905260c0820183905260e0820192909252610100810191909152600861012082015261246a9061014790600a614ab5565b50604080516020810190915260ff81526124899061013a906001614ab5565b506040805160208101909152600081526124a890610148906001614ab5565b506040805161016081018252608c815260fe6020820152601c91810182905260e0606082018190526038608083015260b560a083015260f460c083015260549082015260db61010082015261012081019190915260c16101408201526125139061013b90600b614ab5565b5060408051610160810182526001808252600060208301529181018290526060810182905260056080820181905260a082019290925260c0810182905260e08101919091526006610100820152600a610120820152600861014082015261257f9061014990600b614ab5565b50604080516101a0810182526063815260a5602082015260ff9181019190915260b2606082015260216080820181905260e860a08301819052606660c084015260e083019190915260c6610100830181905261012083019190915260d161014083015261016082015260846101808201526125ff9061013c90600d614ab5565b50604080516101a081018252600680825260208201819052600092820192909252600260608201526080810182905260a08101829052600360c082015260e08101829052610100810182905261012081018290526101408101829052610160810191909152600a61018082015261267b9061014a90600d614ab5565b50604080516101808101825260fe8152601e6020820181905260e092820183905260996060830181905260cb608084015260a083019190915260c0820181905260d6928201839052605b61010083018190526101208301526101408201929092526101608101919091526126f49061013d90600c614ab5565b506040805161018081018252600080825260208201819052918101829052606081018290526002608082015260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915260046101608201526127659061014b90600c614ab5565b50604080516101808101825260fe8152607a60208201819052603d928201839052601e6060830152608082019290925260a0810191909152608e60c0820152605b60e0820181905261010082015260b761012082015260f461014082018190526101608201526127da9061013e90600c614ab5565b5060408051610180810182526000808252602082018190529181018290526060810182905260086080820181905260a0820181905260c0820192909252600960e08201819052600661010083015261012082019290925261014081018290526101608101919091526128519061014c90600c614ab5565b50604080516101c08101825260fe8152606b602082018190529181018290526023606082018190526098608083015260c660a083015260c082015260e08101829052607561010082015260846101208201526101408101829052610160810182905261018081018290526101a08101919091526128d39061013f90600e614ab5565b50604080516101c0810182526000808252600460208301819052600593830184905260608301849052608083019190915260a082015260c0810182905260e08101829052610100810191909152600861012082018190526101408201819052610160820152600961018082018190526101a08201526129579061014d90600e614ab5565b506040805161016081018252608c80825260fe6020830152605492820183905260608201839052608082019290925260cb60a082015260c0810182905260c460e082018190526101008201526101208101829052610140808201929092526129c19190600b614ab5565b5060408051610160810182526001808252600060208301526005928201839052606082018390526080820183905260a082015260c0810182905260e0810182905261010081018290526101208101829052610140810191909152612a2a9061014e90600b614ab5565b5060408051608081018252601481526099602082015260ff9181019190915260cc6060820152612a5f90610141906004614ab5565b50604080516080810182526003808252602082015260009181019190915260026060820152612a939061014f906004614ab5565b508015611482576000805461ff001916905550565b6097546001600160a01b03163314612ad25760405162461bcd60e51b81526004016111e89061558a565b61015880546001600160a01b0319166001600160a01b0392909216919091179055565b60606000612b0283611c29565b6001600160401b03811115612b1957612b19615931565b604051908082528060200260200182016040528015612b42578160200160208202803683370190505b50606554909150600080805b83811015612c1457600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161580159282019290925290612bb55750612c0c565b80516001600160a01b031615612bca57805192505b876001600160a01b0316836001600160a01b03161415612c0a5781868580600101965081518110612bfd57612bfd61591b565b6020026020010181815250505b505b600101612b4e565b509295945050505050565b612c27614b5b565b612c3082613659565b612ca25760405162461bcd60e51b815260206004820152603860248201527f4552433732314d657461646174613a20746f6b656e207472616974732071756560448201527f727920666f72206e6f6e6578697374656e7420746f6b656e000000000000000060648201526084016111e8565b506000908152610132602090815260409182902082516101008082018552915460ff808216151583529281048316938201939093526201000083048216938101939093526301000000820481166060840152640100000000820481166080840152600160281b8204811660a0840152600160301b8204811660c0840152600160381b9091041660e082015290565b60606068805461107090615831565b6001600160a01b038216331415612d695760405163b06307db60e01b815260040160405180910390fd5b336000818152606c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61015854604051633f3b917d60e21b8152600481018490526000916001600160a01b03169063fcee45f49060240160206040518083038186803b158015612e1b57600080fd5b505afa158015612e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e5391906151e4565b9050808361012e54612e659190615794565b612e6f91906157b3565b3414612e8d5760405162461bcd60e51b81526004016111e890615529565b6101585460405163b390c0ab60e01b815260048101869052602481018590526001600160a01b039091169063b390c0ab908390604401611968565b6097546001600160a01b03163314612ef25760405162461bcd60e51b81526004016111e89061558a565b61015280546001600160a01b039485166001600160a01b0319918216179091556101508054938516938216939093179092556101518054919093169116179055565b60c95460ff1615612f575760405162461bcd60e51b81526004016111e890615560565b600260fb541415612f7a5760405162461bcd60e51b81526004016111e89061560a565b600260fb556001600160a01b0383163214612fc25760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016111e8565b610153546001600160a01b0316336001600160a01b03161461301f5760405162461bcd60e51b815260206004820152601660248201527513db9b1e481d1a1c9bdd59da08131b185b585c1bdbdb60521b60448201526064016111e8565b8060005b8181101561311c57610153546001600160a01b031661306b85858481811061304d5761304d61591b565b905060200201602081019061306291906151c9565b61ffff16611b48565b6001600160a01b0316146130cb5760405162461bcd60e51b815260206004820152602160248201527f4c6c616d61706f6f6c20646f6573206e6f74206f776e207468697320746f6b656044820152603760f91b60648201526084016111e8565b6101535461015054613114916001600160a01b0390811691168686858181106130f6576130f661591b565b905060200201602081019061310b91906151c9565b61ffff166114d5565b600101613023565b506101505460405163b739100560e01b81526001600160a01b039091169063b739100590613152908790879087906004016153c3565b600060405180830381600087803b15801561316c57600080fd5b505af1158015613180573d6000803e3d6000fd5b5050600160fb55505050505050565b61319a848484613a77565b6001600160a01b0383163b151580156131bc57506131ba848484846141d3565b155b15611864576040516368d2bf6b60e11b815260040160405180910390fd5b60606131e582613659565b61320257604051630a14c4b560e41b815260040160405180910390fd5b6101525460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd9060240160006040518083038186803b15801561324757600080fd5b505afa15801561325b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ddb9190810190615153565b6097546001600160a01b031633146132ad5760405162461bcd60e51b81526004016111e89061558a565b61015380546001600160a01b0319166001600160a01b0392909216919091179055565b60c95460ff16156132f35760405162461bcd60e51b81526004016111e890615560565b600260fb5414156133165760405162461bcd60e51b81526004016111e89061560a565b600260fb556097546001600160a01b031633148061333c5750336001600160a01b038316145b6133885760405162461bcd60e51b815260206004820152601760248201527f4f6e6c79206f776e6572206f7220726563697069656e7400000000000000000060448201526064016111e8565b6001600160a01b038216600090815261015560205260408120805461ffff84169081106133b7576133b761591b565b60009182526020808320601083040154600f9092166002026101000a90910461ffff168083526101549091526040909120805460ff60b01b1916905590506133fe816136ee565b5050600160fb5550565b6097546001600160a01b031633146134325760405162461bcd60e51b81526004016111e89061558a565b61015680546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b0316331461347f5760405162461bcd60e51b81526004016111e89061558a565b61013055565b610150546000906001600160a01b03838116911614806134ca57506001600160a01b038084166000908152606c602090815260408083209386168352929052205460ff165b9392505050565b6000816134e381610130546116aa3390565b6135265760405162461bcd60e51b815260206004820152601460248201527324a72b20a624a22fa6a2a925a622afa82927a7a360611b60448201526064016111e8565b61012d54613532613c7b565b10613540576000915061355f565b336000908152610131602052604090205461355c9060056157b3565b91505b50919050565b6097546001600160a01b0316331461358f5760405162461bcd60e51b81526004016111e89061558a565b6001600160a01b0381166135f45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016111e8565b611482816140c3565b6097546001600160a01b031633146136275760405162461bcd60e51b81526004016111e89061558a565b61012e819055613638600482615780565b613643906003615794565b61012f5550565b6001600160a01b03163b151590565b60008160011115801561366d575060655482105b8015610ddb575050600090815260696020526040902054600160e01b900460ff161590565b6000828152606b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61ffff81166000908152610154602052604090208054600160b81b900460ff161561374e5760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995d99585b195960821b60448201526064016111e8565b805460ff60b81b1916600160b81b17815560018101546137a15760405162461bcd60e51b815260206004820152600e60248201526d139bdd081e595d081cd95959195960921b60448201526064016111e8565b60006137ab613c7b565b8254909150600090600160a01b900461ffff166001600160401b038111156137d5576137d5615931565b6040519080825280602002602001820160405280156137fe578160200160208202803683370190505b50805190915060005b818161ffff16101561386c578361381d81615866565b9450506138398461ffff168261ffff168760010154901b6142cb565b5083838261ffff16815181106138515761385161591b565b61ffff90921660209283029190910190910152600101613807565b5083546138c390600160b01b900460ff166138915784546001600160a01b031661389f565b610150546001600160a01b03165b855460408051602081019091526000808252600160a01b90920461ffff1691614481565b8354600160b01b900460ff161561393d5761015054845460405163b739100560e01b81526001600160a01b039283169263b73910059261390a92911690869060040161541d565b600060405180830381600087803b15801561392457600080fd5b505af1158015613938573d6000803e3d6000fd5b505050505b8160405161394b919061534c565b6040519081900381209061ffff8716907f888148f582ec9f6c0420ed60149bfbe1bee757f6a27c86b2712b0ece721170a490600090a35050505050565b60c95460ff16156139ab5760405162461bcd60e51b81526004016111e890615560565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586139e03390565b6040516001600160a01b03909116815260200160405180910390a1565b60c95460ff16613a465760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016111e8565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336139e0565b6000613a8282613f9c565b9050836001600160a01b031681600001516001600160a01b031614613ab95760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480613ad75750613ad78533613485565b80613af2575033613ae7846110f3565b6001600160a01b0316145b905080613b1257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416613b3957604051633a954ecd60e21b815260040160405180910390fd5b613b4560008487613692565b6001600160a01b038581166000908152606a60209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606990945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116613c19576065548214613c1957805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b600082613c728584614651565b14949350505050565b6065546000190190565b60c95460ff1615613ca85760405162461bcd60e51b81526004016111e890615560565b600260fb541415613ccb5760405162461bcd60e51b81526004016111e89061560a565b600260fb556000613cda613c7b565b9050323314613d165760405162461bcd60e51b81526020600482015260086024820152674f4e4c595f454f4160c01b60448201526064016111e8565b61927c613d238483615743565b1115613d5e5760405162461bcd60e51b815260206004820152600a6024820152691352539517d15391115160b21b60448201526064016111e8565b600083118015613d6f5750600f8311155b613db15760405162461bcd60e51b81526020600482015260136024820152721352539517d05353d5539517d2539590531251606a1b60448201526064016111e8565b610153805461ffff600160a01b91829004811660009081526101546020908152604080832080546001600160a01b0319163390811790915586548690048516845281842080548b8716880261ffff60a01b1990911617905586548690048516845281842080548a1515600160b01b0260ff60b01b19909116179055835261015582528220945485546001818101885596845291832060108304018054600f9093166002026101000a808602199093169590910490931602929092179055905b848111613e9857613e846105878285615743565b613e8e9083615743565b9150600101613e70565b508015613f1357610151546001600160a01b0316639dc29fac336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b158015613efa57600080fd5b505af1158015613f0e573d6000803e3d6000fd5b505050505b6101538054600160a01b900461ffff16906014613f2f83615866565b91906101000a81548161ffff021916908361ffff16021790555061ffff167f88d301be3ae154fc458cd7ed709e7b3c94f0196a361fec6773124d76889875b48585604051613f899291909182521515602082015260400190565b60405180910390a25050600160fb555050565b60408051606081018252600080825260208201819052918101919091528180600111158015613fcc575060655481105b156140aa57600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906140a85780516001600160a01b03161561403f579392505050565b5060001901600081815260696020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff16151592810192909252156140a3579392505050565b61403f565b505b604051636f96cda160e11b815260040160405180910390fd5b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661413c5760405162461bcd60e51b81526004016111e8906155bf565b611c2582826146c5565b600054610100900460ff1661416d5760405162461bcd60e51b81526004016111e8906155bf565b611cab61471d565b600054610100900460ff1661419c5760405162461bcd60e51b81526004016111e8906155bf565b611cab614750565b600054610100900460ff166141cb5760405162461bcd60e51b81526004016111e8906155bf565b611cab614780565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290614208903390899088908890600401615386565b602060405180830381600087803b15801561422257600080fd5b505af1925050508015614252575060408051601f3d908101601f1916820190925261424f918101906150eb565b60015b6142ad573d808015614280576040519150601f19603f3d011682016040523d82523d6000602084013e614285565b606091505b5080516142a5576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6142d3614b5b565b6142dd83836147ae565b905061013360006142ed836148d7565b8152602001908152602001600020546000141561446f576000838152610132602090815260408083208451815493860151928601516060870151608088015160a089015160c08a015160e08b015161ffff1990991695151561ff0019169590951761010060ff988916021763ffff00001916620100009488169490940263ff0000001916939093176301000000928716929092029190911765ffff0000000019166401000000009186169190910265ff0000000000191617600160281b918516919091021767ffff0000000000001916600160301b9184169190910267ff00000000000000191617600160381b92909316919091029190911790558390610133906143f7846148d7565b815260208101919091526040016000205580511561443f5760405183907fe343f2a07cb5f9f1bace14bb63e08f9c6edcb69bbb40566b91ec822558eebe0390600090a2610ddb565b60405183907fef1da42f89c42f48befa143007e6f5efd84a2d1cc3dc97c5edd2d3373220f66d90600090a2610ddb565b6134ca8361447c84614978565b6142cb565b6065546001600160a01b0385166144aa57604051622e076360e81b815260040160405180910390fd5b836144c85760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0385166000818152606a6020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452606990925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561457957506001600160a01b0387163b15155b15614602575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46145ca60008884806001019550886141d3565b6145e7576040516368d2bf6b60e11b815260040160405180910390fd5b8082141561457f5782606554146145fd57600080fd5b614648565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415614603575b50606555613c5e565b600081815b84518110156146bd5760008582815181106146735761467361591b565b6020026020010151905080831161469957600083815260208290526040902092506146aa565b600081815260208490526040902092505b50806146b581615888565b915050614656565b509392505050565b600054610100900460ff166146ec5760405162461bcd60e51b81526004016111e8906155bf565b81516146ff906067906020850190614b9f565b508051614713906068906020840190614b9f565b5060016065555050565b600054610100900460ff166147445760405162461bcd60e51b81526004016111e8906155bf565b60c9805460ff19169055565b600054610100900460ff166147775760405162461bcd60e51b81526004016111e8906155bf565b611cab336140c3565b600054610100900460ff166147a75760405162461bcd60e51b81526004016111e8906155bf565b600160fb55565b6147b6614b5b565b6147c5600a61ffff84166158a3565b15158082526000906147d85760076147db565b60005b60109390931c9290506147fc61ffff84166147f783600061575b565b6149d7565b60ff16602083015260109290921c9161481e61ffff84166147f783600161575b565b60ff16604083015260109290921c9161484061ffff84166147f783600261575b565b60ff16606083015260109290921c9161486261ffff84166147f783600361575b565b60ff16608083015260109290921c9161488461ffff84166147f783600461575b565b60ff1660a083015260109290921c916148a661ffff84166147f783600561575b565b60ff1660c083015260109290921c916148c861ffff84166147f783600661575b565b60ff1660e08301525092915050565b80516020808301516040808501516060860151608087015160a088015160c089015160e08a0151955198151560f890811b988a01989098526001600160f81b031996881b871660218a015293871b8616602289015291861b85166023880152851b84166024870152841b83166025860152831b8216602685015290911b166027820152600090602801604051602081830303815290604052610ddb906157ca565b6000326149866001436157b3565b60405160609290921b6bffffffffffffffffffffffff191660208301524060348201524260548201526074810183905260940160408051601f19818403018152919052805160209091012092915050565b6000806101348360ff16600e81106149f1576149f161591b565b01546149fd90856158b7565b90506101348360ff16600e8110614a1657614a1661591b565b018160ff1681548110614a2b57614a2b61591b565b60009182526020918290209181049091015460ff601f9092166101000a90048116600886901c90911611614a60579050610ddb565b6101428360ff16600e8110614a7757614a7761591b565b018160ff1681548110614a8c57614a8c61591b565b90600052602060002090602091828204019190069054906101000a900460ff1691505092915050565b82805482825590600052602060002090601f01602090048101928215614b4b5791602002820160005b83821115614b1c57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302614ade565b8015614b495782816101000a81549060ff0219169055600101602081600001049283019260010302614b1c565b505b50614b57929150614c13565b5090565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915290565b828054614bab90615831565b90600052602060002090601f016020900481019282614bcd5760008555614b4b565b82601f10614be657805160ff1916838001178555614b4b565b82800160010185558215614b4b579182015b82811115614b4b578251825591602001919060010190614bf8565b5b80821115614b575760008155600101614c14565b600082601f830112614c3957600080fd5b81356020614c4e614c49836156f9565b6156c9565b80838252828201915082860187848660051b8901011115614c6e57600080fd5b60005b85811015614c8d57813584529284019290840190600101614c71565b5090979650505050505050565b60008083601f840112614cac57600080fd5b5081356001600160401b03811115614cc357600080fd5b6020830191508360208260051b8501011115614cde57600080fd5b9250929050565b600082601f830112614cf657600080fd5b81356020614d06614c49836156f9565b80838252828201915082860187848660051b8901011115614d2657600080fd5b60005b85811015614c8d57614d3a82614d73565b84529284019290840190600101614d29565b80358015158114614d5c57600080fd5b919050565b803561ffff81168114614d5c57600080fd5b803560ff81168114614d5c57600080fd5b600060208284031215614d9657600080fd5b81356134ca81615947565b60008060408385031215614db457600080fd5b8235614dbf81615947565b91506020830135614dcf81615947565b809150509250929050565b600080600060608486031215614def57600080fd5b8335614dfa81615947565b92506020840135614e0a81615947565b929592945050506040919091013590565b60008060008060808587031215614e3157600080fd5b8435614e3c81615947565b93506020850135614e4c81615947565b92506040850135915060608501356001600160401b03811115614e6e57600080fd5b8501601f81018713614e7f57600080fd5b8035614e8d614c498261571c565b818152886020838501011115614ea257600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080600060408486031215614ed957600080fd5b8335614ee481615947565b925060208401356001600160401b03811115614eff57600080fd5b614f0b86828701614c9a565b9497909650939450505050565b60008060408385031215614f2b57600080fd5b8235614f3681615947565b9150614f4460208401614d4c565b90509250929050565b60008060408385031215614f6057600080fd5b8235614f6b81615947565b9150614f4460208401614d61565b60008060408385031215614f8c57600080fd5b8235614f9781615947565b946020939093013593505050565b600060208284031215614fb757600080fd5b81356001600160401b03811115614fcd57600080fd5b6142c384828501614c28565b600080600060608486031215614fee57600080fd5b83356001600160401b0381111561500457600080fd5b61501086828701614c28565b9350506020840135915061502660408501614d4c565b90509250925092565b6000806000806040858703121561504557600080fd5b84356001600160401b038082111561505c57600080fd5b61506888838901614c9a565b9096509450602087013591508082111561508157600080fd5b5061508e87828801614c9a565b95989497509550505050565b6000602082840312156150ac57600080fd5b6134ca82614d4c565b6000602082840312156150c757600080fd5b5035919050565b6000602082840312156150e057600080fd5b81356134ca8161595c565b6000602082840312156150fd57600080fd5b81516134ca8161595c565b60008060006060848603121561511d57600080fd5b833561512881615947565b9250602084013561513881615947565b9150604084013561514881615947565b809150509250925092565b60006020828403121561516557600080fd5b81516001600160401b0381111561517b57600080fd5b8201601f8101841361518c57600080fd5b805161519a614c498261571c565b8181528560208385010111156151af57600080fd5b6151c08260208301602086016157ee565b95945050505050565b6000602082840312156151db57600080fd5b6134ca82614d61565b6000602082840312156151f657600080fd5b5051919050565b6000806040838503121561521057600080fd5b82359150614f4460208401614d4c565b6000806040838503121561523357600080fd5b50508035926020909101359150565b60008060006060848603121561525757600080fd5b833592506020840135915061502660408501614d4c565b60008060006060848603121561528357600080fd5b61528c84614d73565b925060208401356001600160401b03808211156152a857600080fd5b6152b487838801614ce5565b935060408601359150808211156152ca57600080fd5b506152d786828701614ce5565b9150509250925092565b600081518084526020808501945080840160005b8381101561531557815161ffff16875295820195908201906001016152f5565b509495945050505050565b600081518084526153388160208601602086016157ee565b601f01601f19169290920160200192915050565b815160009082906020808601845b8381101561537a57815161ffff168552938201939082019060010161535a565b50929695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906153b990830184615320565b9695505050505050565b6001600160a01b038416815260406020808301829052908201839052600090849060608401835b868110156154115761ffff6153fe85614d61565b16825292820192908201906001016153ea565b50979650505050505050565b6001600160a01b03831681526040602082018190526000906142c3908301846152e1565b6040808252835182820181905260009190606090818501906020808901865b838110156154b357815180516001600160a01b031686528381015161ffff168487015287810151151588870152868101511515878701526080908101519086015260a09094019390820190600101615460565b505086830390870152506154c781876152e1565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561550a578351835292840192918401916001016154ee565b50909695505050505050565b6020815260006134ca6020830184615320565b60208082526017908201527f4d494e545f504149445f50524943455f494e56414c4944000000000000000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006101008201905082511515825260ff602084015116602083015260ff604084015116604083015260ff606084015116606083015260ff608084015116608083015260a083015161569860a084018260ff169052565b5060c08301516156ad60c084018260ff169052565b5060e08301516156c260e084018260ff169052565b5092915050565b604051601f8201601f191681016001600160401b03811182821017156156f1576156f1615931565b604052919050565b60006001600160401b0382111561571257615712615931565b5060051b60200190565b60006001600160401b0382111561573557615735615931565b50601f01601f191660200190565b60008219821115615756576157566158d9565b500190565b600060ff821660ff84168060ff03821115615778576157786158d9565b019392505050565b60008261578f5761578f6158ef565b500490565b60008160001904831182151516156157ae576157ae6158d9565b500290565b6000828210156157c5576157c56158d9565b500390565b8051602080830151919081101561355f5760001960209190910360031b1b16919050565b60005b838110156158095781810151838201526020016157f1565b838111156118645750506000910152565b600081615829576158296158d9565b506000190190565b600181811c9082168061584557607f821691505b6020821081141561355f57634e487b7160e01b600052602260045260246000fd5b600061ffff8083168181141561587e5761587e6158d9565b6001019392505050565b600060001982141561589c5761589c6158d9565b5060010190565b6000826158b2576158b26158ef565b500690565b600060ff8316806158ca576158ca6158ef565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461148257600080fd5b6001600160e01b03198116811461148257600080fdfea26469706673582212201f9b1359dc6249e2b8203c8949e5092891e145ee2d137c071391430d5630ea4564736f6c63430008070033

Deployed Bytecode

0x6080604052600436106103ce5760003560e01c80638462151c116101fd578063c7c4a61511610118578063e08e65ea116100ab578063eb0e7b221161007a578063eb0e7b2214610cf8578063f0b7db4e14610d18578063f2fde38b14610d39578063f47c84c514610d59578063f4a0a52814610d6f57600080fd5b8063e08e65ea14610c82578063e1bbe3a514610ca2578063e1fc334f14610cb7578063e985e9c514610cd857600080fd5b8063cebf30d1116100e7578063cebf30d114610b61578063cfd6a5e514610b81578063d50b31eb14610ba2578063e05c57bf14610bc257600080fd5b8063c7c4a61514610a57578063c87b56dd14610af3578063c884ef8314610b13578063cdf29f2b14610b4157600080fd5b8063a519f79911610190578063b88d4fde1161015f578063b88d4fde1461095a578063bad047921461097a578063c002d23d14610a29578063c084f54014610a4057600080fd5b8063a519f799146108e2578063aa98e0c614610903578063b3066d491461091a578063b73910051461093a57600080fd5b8063a1b8f374116101cc578063a1b8f3741461086a578063a22cb46514610898578063a25a5ec5146108b8578063a4f9262c146108cf57600080fd5b80638462151c146107dd5780638da5cb5b1461080a57806394e568471461082857806395d89b411461085557600080fd5b806342842e0e116102ed5780636352211e1161028057806378c6a71d1161024f57806378c6a71d146107685780637d2c9c10146107885780638129fc1c146107a85780638244b7e4146107bd57600080fd5b80636352211e1461070057806367f68fac1461072057806370a0823114610733578063715018a61461075357600080fd5b8063579eed7b116102bc578063579eed7b14610692578063595c9bcf146106a55780635c975abb146106c8578063608be275146106e057600080fd5b806342842e0e146106295780634880c36c146106495780634cf088d91461065c5780634f02c4201461067d57600080fd5b80631c91bed7116103655780633431a753116103345780633431a753146105be57806336838391146105de5780633ccfd60b146105fe5780634018b1f81461061357600080fd5b80631c91bed71461051957806323b872dd1461054c57806327de8f271461056c57806333df4b2c1461058c57600080fd5b8063095ea7b3116103a1578063095ea7b314610490578063160a44e6146104b257806316c38b3c146104d257806318160ddd146104f257600080fd5b806301ffc9a7146103d35780630527857f1461040857806306fdde0314610436578063081812fc14610458575b600080fd5b3480156103df57600080fd5b506103f36103ee3660046150ce565b610d8f565b60405190151581526020015b60405180910390f35b34801561041457600080fd5b50610428610423366004614d84565b610de1565b6040516103ff929190615441565b34801561044257600080fd5b5061044b611061565b6040516103ff9190615516565b34801561046457600080fd5b506104786104733660046150b5565b6110f3565b6040516001600160a01b0390911681526020016103ff565b34801561049c57600080fd5b506104b06104ab366004614f79565b611137565b005b3480156104be57600080fd5b506104b06104cd366004614d84565b6111c5565b3480156104de57600080fd5b506104b06104ed36600461509a565b6113e4565b3480156104fe57600080fd5b5060665460655403600019015b6040519081526020016103ff565b34801561052557600080fd5b50610539610534366004614f79565b61148d565b60405161ffff90911681526020016103ff565b34801561055857600080fd5b506104b0610567366004614dda565b6114d5565b34801561057857600080fd5b5061050b6105873660046150b5565b6114e0565b34801561059857600080fd5b506105ac6105a7366004615220565b611594565b60405160ff90911681526020016103ff565b3480156105ca57600080fd5b506104b06105d93660046150b5565b6115db565b3480156105ea57600080fd5b506105ac6105f9366004615220565b61160b565b34801561060a57600080fd5b506104b061161c565b34801561061f57600080fd5b5061012d5461050b565b34801561063557600080fd5b506104b0610644366004614dda565b61167f565b6104b0610657366004614fd9565b61169a565b34801561066857600080fd5b5061015054610478906001600160a01b031681565b34801561068957600080fd5b5061050b61186a565b6104b06106a0366004615242565b611879565b3480156106b157600080fd5b506101535461053990600160a01b900461ffff1681565b3480156106d457600080fd5b5060c95460ff166103f3565b3480156106ec57600080fd5b506104b06106fb36600461502f565b6119a4565b34801561070c57600080fd5b5061047861071b3660046150b5565b611b48565b6104b061072e3660046151fd565b611b5a565b34801561073f57600080fd5b5061050b61074e366004614d84565b611c29565b34801561075f57600080fd5b506104b0611c77565b34801561077457600080fd5b506104b0610783366004614d84565b611cad565b34801561079457600080fd5b506104b06107a336600461526e565b611cfa565b3480156107b457600080fd5b506104b0611d7d565b3480156107c957600080fd5b506104b06107d8366004614d84565b612aa8565b3480156107e957600080fd5b506107fd6107f8366004614d84565b612af5565b6040516103ff91906154d2565b34801561081657600080fd5b506097546001600160a01b0316610478565b34801561083457600080fd5b506108486108433660046150b5565b612c1f565b6040516103ff9190615641565b34801561086157600080fd5b5061044b612d30565b34801561087657600080fd5b5061050b6108853660046150b5565b6101336020526000908152604090205481565b3480156108a457600080fd5b506104b06108b3366004614f18565b612d3f565b3480156108c457600080fd5b5061050b61012f5481565b6104b06108dd366004615242565b612dd5565b3480156108ee57600080fd5b5061015854610478906001600160a01b031681565b34801561090f57600080fd5b5061050b6101305481565b34801561092657600080fd5b506104b0610935366004615108565b612ec8565b34801561094657600080fd5b506104b0610955366004614ec4565b612f34565b34801561096657600080fd5b506104b0610975366004614e1b565b61318f565b34801561098657600080fd5b506103f36109953660046150b5565b6000908152610132602090815260409182902082516101008082018552915460ff80821615158084529382048116948301949094526201000081048416948201949094526301000000840483166060820152640100000000840483166080820152600160281b8404831660a0820152600160301b8404831660c0820152600160381b90930490911660e09092019190915290565b348015610a3557600080fd5b5061050b61012e5481565b348015610a4c57600080fd5b5061050b61012d5481565b348015610a6357600080fd5b50610ab8610a723660046150b5565b61015460205260009081526040902080546001909101546001600160a01b0382169161ffff600160a01b8204169160ff600160b01b8304811692600160b81b9004169085565b604080516001600160a01b03909616865261ffff9094166020860152911515928401929092529015156060830152608082015260a0016103ff565b348015610aff57600080fd5b5061044b610b0e3660046150b5565b6131da565b348015610b1f57600080fd5b5061050b610b2e366004614d84565b6101316020526000908152604090205481565b348015610b4d57600080fd5b506104b0610b5c366004614d84565b613283565b348015610b6d57600080fd5b506104b0610b7c366004614f4d565b6132d0565b348015610b8d57600080fd5b5061015754610478906001600160a01b031681565b348015610bae57600080fd5b506104b0610bbd366004614d84565b613408565b348015610bce57600080fd5b50610c38610bdd3660046150b5565b6101326020526000908152604090205460ff808216916101008104821691620100008204811691630100000081048216916401000000008204811691600160281b8104821691600160301b8204811691600160381b90041688565b60408051981515895260ff97881660208a01529587169588019590955292851660608701529084166080860152831660a0850152821660c08401521660e0820152610100016103ff565b348015610c8e57600080fd5b506104b0610c9d3660046150b5565b613455565b348015610cae57600080fd5b50610539600581565b348015610cc357600080fd5b5061015254610478906001600160a01b031681565b348015610ce457600080fd5b506103f3610cf3366004614da1565b613485565b348015610d0457600080fd5b5061050b610d13366004614fa5565b6134d1565b348015610d2457600080fd5b5061015154610478906001600160a01b031681565b348015610d4557600080fd5b506104b0610d54366004614d84565b613565565b348015610d6557600080fd5b5061050b61927c81565b348015610d7b57600080fd5b506104b0610d8a3660046150b5565b6135fd565b60006001600160e01b031982166380ac58cd60e01b1480610dc057506001600160e01b03198216635b5e139f60e01b145b80610ddb57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001600160a01b0381166000908152610155602052604090205460609081906001600160401b03811115610e1757610e17615931565b604051908082528060200260200182016040528015610e7057816020015b6040805160a081018252600080825260208083018290529282018190526060820181905260808201528252600019909201910181610e355790505b506001600160a01b038416600090815261015560205260409020549092506001600160401b03811115610ea557610ea5615931565b604051908082528060200260200182016040528015610ece578160200160208202803683370190505b506001600160a01b038416600090815261015560205260408120549192505b8181101561105a576001600160a01b038516600090815261015560205260408120805461015492919084908110610f2657610f2661591b565b6000918252602080832060108304015461ffff6002600f909416939093026101000a900482168452838101949094526040928301909120825160a08101845281546001600160a01b0381168252600160a01b81049093169481019490945260ff600160b01b83048116151593850193909352600160b81b909104909116151560608301526001015460808201528451859083908110610fc757610fc761591b565b60200260200101819052506101556000866001600160a01b03166001600160a01b0316815260200190815260200160002081815481106110095761100961591b565b90600052602060002090601091828204019190066002029054906101000a900461ffff1683828151811061103f5761103f61591b565b61ffff90921660209283029190910190910152600101610eed565b5050915091565b60606067805461107090615831565b80601f016020809104026020016040519081016040528092919081815260200182805461109c90615831565b80156110e95780601f106110be576101008083540402835291602001916110e9565b820191906000526020600020905b8154815290600101906020018083116110cc57829003601f168201915b5050505050905090565b60006110fe82613659565b61111b576040516333d1c03960e21b815260040160405180910390fd5b506000908152606b60205260409020546001600160a01b031690565b600061114282611b48565b9050806001600160a01b0316836001600160a01b031614156111775760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b0382161480159061119757506111958133613485565b155b156111b5576040516367d9dca160e11b815260040160405180910390fd5b6111c0838383613692565b505050565b60c95460ff16156111f15760405162461bcd60e51b81526004016111e890615560565b60405180910390fd5b600260fb5414156112145760405162461bcd60e51b81526004016111e89061560a565b600260fb556001600160a01b0381163214801561123957506001600160a01b03811633145b6112705760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016111e8565b6001600160a01b038116600090815261015560205260409020545b80156113db576001600160a01b0382166000908152610155602052604081206112b56001846157b3565b815481106112c5576112c561591b565b60009182526020808320601083040154600f9092166002026101000a90910461ffff9081168084526101548352604093849020845160a08101865281546001600160a01b0381168252600160a01b810490941694810194909452600160b01b830460ff908116151595850195909552600160b81b909204909316151560608301526001015460808201819052919250906113605750506113db565b806060015161137257611372826136ee565b6001600160a01b03841660009081526101556020526040902080548061139a5761139a615905565b600082815260209020601060001990920191820401805461ffff6002600f8516026101000a02191690559055508190506113d38161581a565b91505061128b565b5050600160fb55565b610152546001600160a01b03161580159061140a5750610150546001600160a01b031615155b61144a5760405162461bcd60e51b815260206004820152601160248201527010dbdb9d1c9858dd1cc81b9bdd081cd95d607a1b60448201526064016111e8565b6097546001600160a01b031633146114745760405162461bcd60e51b81526004016111e89061558a565b801561148557611482613988565b50565b6114826139fd565b61015560205281600052604060002081815481106114aa57600080fd5b9060005260206000209060109182820401919006600202915091509054906101000a900461ffff1681565b6111c0838383613a77565b600061012d5482116114f457506000919050565b600561150361927c6002615794565b61150d9190615780565b82116115235750686c6b935b8bbd400000919050565b600561153261927c6003615794565b61153c9190615780565b8211611553575069010f0cf064dd59200000919050565b600561156261927c6004615794565b61156c9190615780565b8211611583575069021e19e0c9bab2400000919050565b5069043c33c1937564800000919050565b61013482600e81106115a557600080fd5b0181815481106115b457600080fd5b9060005260206000209060209182820401919006915091509054906101000a900460ff1681565b6097546001600160a01b031633146116055760405162461bcd60e51b81526004016111e89061558a565b61012d55565b61014282600e81106115a557600080fd5b6097546001600160a01b031633146116465760405162461bcd60e51b81526004016111e89061558a565b6097546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611482573d6000803e3d6000fd5b6111c08383836040518060200160405280600081525061318f565b826116b881610130546116aa3390565b6001600160a01b0316613c65565b6116fb5760405162461bcd60e51b815260206004820152601460248201527324a72b20a624a22fa6a2a925a622afa82927a7a360611b60448201526064016111e8565b336000908152610131602052604090205460059061171a908590615743565b111561175f5760405162461bcd60e51b81526020600482015260146024820152731352539517d0d3d353555392551657d15391115160621b60448201526064016111e8565b61012d548361176c613c7b565b6117769190615743565b11156117b15760405162461bcd60e51b815260206004820152600a6024820152691352539517d15391115160b21b60448201526064016111e8565b3360009081526101316020526040902054156117cd57826117d8565b6117d86001846157b3565b61012f546117e69190615794565b34146118345760405162461bcd60e51b815260206004820152601c60248201527f4d494e545f434f4d4d554e4954595f50524943455f494e56414c49440000000060448201526064016111e8565b336000908152610131602052604081208054859290611854908490615743565b9091555061186490508383613c85565b50505050565b6000611874613c7b565b905090565b61015754604051633f3b917d60e21b8152600481018490526000916001600160a01b03169063fcee45f49060240160206040518083038186803b1580156118bf57600080fd5b505afa1580156118d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f791906151e4565b9050808361012e546119099190615794565b61191391906157b3565b34146119315760405162461bcd60e51b81526004016111e890615529565b6101575460405163b390c0ab60e01b815260048101869052602481018590526001600160a01b039091169063b390c0ab9083906044015b6000604051808303818588803b15801561198157600080fd5b505af1158015611995573d6000803e3d6000fd5b50505050506118648383613c85565b610156546001600160a01b0316336001600160a01b0316146119f65760405162461bcd60e51b815260206004820152600b60248201526a27a7262cafa9a2a2a222a960a91b60448201526064016111e8565b8260005b81811015611b40576101546000878784818110611a1957611a1961591b565b9050602002016020810190611a2e91906151c9565b61ffff16815260200190815260200160002060010154600014611a845760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481cd95959195960921b60448201526064016111e8565b838382818110611a9657611a9661591b565b905060200201356101546000888885818110611ab457611ab461591b565b9050602002016020810190611ac991906151c9565b61ffff168152602081019190915260400160002060010155858582818110611af357611af361591b565b9050602002016020810190611b0891906151c9565b61ffff167f4d1d1dd33d2a5eac64d06b7d65cf168aa338a832ba5c3702bb9fc1a104cc7b1360405160405180910390a26001016119fa565b505050505050565b6000611b5382613f9c565b5192915050565b61012d54611b66613c7b565b1015611bd55761012e54611b78613c7b565b61012d54611b8691906157b3565b8311611b925782611ba8565b611b9a613c7b565b61012d54611ba891906157b3565b611bb29190615794565b3414611bd05760405162461bcd60e51b81526004016111e890615529565b611c1b565b3415611c1b5760405162461bcd60e51b81526020600482015260156024820152744d494e545f504149445f494e5f4449414d4f4e445360581b60448201526064016111e8565b611c258282613c85565b5050565b60006001600160a01b038216611c52576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152606a60205260409020546001600160401b031690565b6097546001600160a01b03163314611ca15760405162461bcd60e51b81526004016111e89061558a565b611cab60006140c3565b565b6097546001600160a01b03163314611cd75760405162461bcd60e51b81526004016111e89061558a565b61015780546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b03163314611d245760405162461bcd60e51b81526004016111e89061558a565b816101348460ff16600e8110611d3c57611d3c61591b565b019080519060200190611d50929190614ab5565b50806101428460ff16600e8110611d6957611d6961591b565b019080519060200190611864929190614ab5565b600054610100900460ff16611d985760005460ff1615611d9c565b303b155b611dff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016111e8565b600054610100900460ff16158015611e21576000805461ffff19166101011790555b611e746040518060400160405280600d81526020016c111a585b5bdb990812195a5cdd609a1b8152506040518060400160405280600c81526020016b1112505353d39112115254d560a21b815250614115565b611e7c614146565b611e84614175565b611e8c6141a4565b611e94613988565b611d4c61012d5566d529ae9e86000061012e55668e1bc9bf04000061012f55604080516101808101825260ff8152603d6020820152607a918101829052601e6060820181905260b7608083015260e060a08301819052608e60c084015282015260d6610100820181905260ad610120830152610140820152610160810191909152611f249061013490600c614ab5565b5060408051610180810182526000808252602082018190529181018290526007606082018190526080820181905260a08201839052600560c0830152600660e08301526101008201526008610120820181905261014082015260096101608201529061014290611f9892910190600c614ab5565b50604080516101e081018252607280825260fe6020830181905260bf93830184905260986060840181905260f26080850181905260a085019190915260c0840185905260e560e0850152610100840152610120830191909152610140820152604c610160820181905261018082015260cb6101a08201526101c08101919091526120279061013590600f614ab5565b50604080516101e081018252600680825260006020830152918101829052606081018290526001608082015260a08101829052600460c082015260e081018290526101008101829052610120810182905260086101408201819052610160820192909252610180810191909152600a6101a0820152600d6101c08201526120b39061014390600f614ab5565b50604080516101a08101825260a58082526042602083015260c69282019290925260ff60608201526080810182905260d360a082015260a860c082015260e08101829052606b610100820152606361012082015260ba61014082015260af61016082015261018081019190915261212f9061013690600d614ab5565b50604080516101a0810182526006808252602082018190529181018290526000606082015260808101829052600360a0820152600560c082015260e0810182905261010081019190915260086101208201819052610140820152600a610160820152600b6101808201526121a89061014490600d614ab5565b506040805161016081018252608c80825260e060208301819052601c938301939093526070606083018190526080830181905260a08084019190915260fe60c084015260e59383019390935261010082019290925260dd61012082015261014081019190915261221d9061013790600b614ab5565b5060408051610160810182526007808252602082018190529181018290526060810182905260808101829052600860a08201819052600060c0830152600660e083015261010082019290925261012081019190915260096101408201526122899061014590600b614ab5565b50604080516101e08101825260e5815260fe6020820181905260bf92820183905260d86060830152607f6080830152609860a0830181905260c0830181905260a560e0840152604c6101008401819052607261012085015261014084019290925261016083015260cb6101808301526101a08201526101c08101919091526123169061013890600f614ab5565b50604080516101e081018252600180825260006020830152918101919091526002606082018190526003608083015260a0820181905260c08201819052600460e08301819052610100830191909152610120820181905260076101408301819052610160830191909152600a6101808301526101a0820152600c6101c08201526123a59061014690600f614ab5565b506040805161014081018252607f80825260ff60208301819052928201819052606082015260e56080820152606660a082015260c0810182905260e081019190915260b261010082015260336101208201526124069061013990600a614ab5565b5060408051610140810182526007808252600060208301819052928201819052606082018190526080820181905260a0820181905260c0820183905260e0820192909252610100810191909152600861012082015261246a9061014790600a614ab5565b50604080516020810190915260ff81526124899061013a906001614ab5565b506040805160208101909152600081526124a890610148906001614ab5565b506040805161016081018252608c815260fe6020820152601c91810182905260e0606082018190526038608083015260b560a083015260f460c083015260549082015260db61010082015261012081019190915260c16101408201526125139061013b90600b614ab5565b5060408051610160810182526001808252600060208301529181018290526060810182905260056080820181905260a082019290925260c0810182905260e08101919091526006610100820152600a610120820152600861014082015261257f9061014990600b614ab5565b50604080516101a0810182526063815260a5602082015260ff9181019190915260b2606082015260216080820181905260e860a08301819052606660c084015260e083019190915260c6610100830181905261012083019190915260d161014083015261016082015260846101808201526125ff9061013c90600d614ab5565b50604080516101a081018252600680825260208201819052600092820192909252600260608201526080810182905260a08101829052600360c082015260e08101829052610100810182905261012081018290526101408101829052610160810191909152600a61018082015261267b9061014a90600d614ab5565b50604080516101808101825260fe8152601e6020820181905260e092820183905260996060830181905260cb608084015260a083019190915260c0820181905260d6928201839052605b61010083018190526101208301526101408201929092526101608101919091526126f49061013d90600c614ab5565b506040805161018081018252600080825260208201819052918101829052606081018290526002608082015260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915260046101608201526127659061014b90600c614ab5565b50604080516101808101825260fe8152607a60208201819052603d928201839052601e6060830152608082019290925260a0810191909152608e60c0820152605b60e0820181905261010082015260b761012082015260f461014082018190526101608201526127da9061013e90600c614ab5565b5060408051610180810182526000808252602082018190529181018290526060810182905260086080820181905260a0820181905260c0820192909252600960e08201819052600661010083015261012082019290925261014081018290526101608101919091526128519061014c90600c614ab5565b50604080516101c08101825260fe8152606b602082018190529181018290526023606082018190526098608083015260c660a083015260c082015260e08101829052607561010082015260846101208201526101408101829052610160810182905261018081018290526101a08101919091526128d39061013f90600e614ab5565b50604080516101c0810182526000808252600460208301819052600593830184905260608301849052608083019190915260a082015260c0810182905260e08101829052610100810191909152600861012082018190526101408201819052610160820152600961018082018190526101a08201526129579061014d90600e614ab5565b506040805161016081018252608c80825260fe6020830152605492820183905260608201839052608082019290925260cb60a082015260c0810182905260c460e082018190526101008201526101208101829052610140808201929092526129c19190600b614ab5565b5060408051610160810182526001808252600060208301526005928201839052606082018390526080820183905260a082015260c0810182905260e0810182905261010081018290526101208101829052610140810191909152612a2a9061014e90600b614ab5565b5060408051608081018252601481526099602082015260ff9181019190915260cc6060820152612a5f90610141906004614ab5565b50604080516080810182526003808252602082015260009181019190915260026060820152612a939061014f906004614ab5565b508015611482576000805461ff001916905550565b6097546001600160a01b03163314612ad25760405162461bcd60e51b81526004016111e89061558a565b61015880546001600160a01b0319166001600160a01b0392909216919091179055565b60606000612b0283611c29565b6001600160401b03811115612b1957612b19615931565b604051908082528060200260200182016040528015612b42578160200160208202803683370190505b50606554909150600080805b83811015612c1457600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161580159282019290925290612bb55750612c0c565b80516001600160a01b031615612bca57805192505b876001600160a01b0316836001600160a01b03161415612c0a5781868580600101965081518110612bfd57612bfd61591b565b6020026020010181815250505b505b600101612b4e565b509295945050505050565b612c27614b5b565b612c3082613659565b612ca25760405162461bcd60e51b815260206004820152603860248201527f4552433732314d657461646174613a20746f6b656e207472616974732071756560448201527f727920666f72206e6f6e6578697374656e7420746f6b656e000000000000000060648201526084016111e8565b506000908152610132602090815260409182902082516101008082018552915460ff808216151583529281048316938201939093526201000083048216938101939093526301000000820481166060840152640100000000820481166080840152600160281b8204811660a0840152600160301b8204811660c0840152600160381b9091041660e082015290565b60606068805461107090615831565b6001600160a01b038216331415612d695760405163b06307db60e01b815260040160405180910390fd5b336000818152606c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61015854604051633f3b917d60e21b8152600481018490526000916001600160a01b03169063fcee45f49060240160206040518083038186803b158015612e1b57600080fd5b505afa158015612e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e5391906151e4565b9050808361012e54612e659190615794565b612e6f91906157b3565b3414612e8d5760405162461bcd60e51b81526004016111e890615529565b6101585460405163b390c0ab60e01b815260048101869052602481018590526001600160a01b039091169063b390c0ab908390604401611968565b6097546001600160a01b03163314612ef25760405162461bcd60e51b81526004016111e89061558a565b61015280546001600160a01b039485166001600160a01b0319918216179091556101508054938516938216939093179092556101518054919093169116179055565b60c95460ff1615612f575760405162461bcd60e51b81526004016111e890615560565b600260fb541415612f7a5760405162461bcd60e51b81526004016111e89061560a565b600260fb556001600160a01b0383163214612fc25760405162461bcd60e51b81526020600482015260086024820152674f6e6c7920454f4160c01b60448201526064016111e8565b610153546001600160a01b0316336001600160a01b03161461301f5760405162461bcd60e51b815260206004820152601660248201527513db9b1e481d1a1c9bdd59da08131b185b585c1bdbdb60521b60448201526064016111e8565b8060005b8181101561311c57610153546001600160a01b031661306b85858481811061304d5761304d61591b565b905060200201602081019061306291906151c9565b61ffff16611b48565b6001600160a01b0316146130cb5760405162461bcd60e51b815260206004820152602160248201527f4c6c616d61706f6f6c20646f6573206e6f74206f776e207468697320746f6b656044820152603760f91b60648201526084016111e8565b6101535461015054613114916001600160a01b0390811691168686858181106130f6576130f661591b565b905060200201602081019061310b91906151c9565b61ffff166114d5565b600101613023565b506101505460405163b739100560e01b81526001600160a01b039091169063b739100590613152908790879087906004016153c3565b600060405180830381600087803b15801561316c57600080fd5b505af1158015613180573d6000803e3d6000fd5b5050600160fb55505050505050565b61319a848484613a77565b6001600160a01b0383163b151580156131bc57506131ba848484846141d3565b155b15611864576040516368d2bf6b60e11b815260040160405180910390fd5b60606131e582613659565b61320257604051630a14c4b560e41b815260040160405180910390fd5b6101525460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd9060240160006040518083038186803b15801561324757600080fd5b505afa15801561325b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ddb9190810190615153565b6097546001600160a01b031633146132ad5760405162461bcd60e51b81526004016111e89061558a565b61015380546001600160a01b0319166001600160a01b0392909216919091179055565b60c95460ff16156132f35760405162461bcd60e51b81526004016111e890615560565b600260fb5414156133165760405162461bcd60e51b81526004016111e89061560a565b600260fb556097546001600160a01b031633148061333c5750336001600160a01b038316145b6133885760405162461bcd60e51b815260206004820152601760248201527f4f6e6c79206f776e6572206f7220726563697069656e7400000000000000000060448201526064016111e8565b6001600160a01b038216600090815261015560205260408120805461ffff84169081106133b7576133b761591b565b60009182526020808320601083040154600f9092166002026101000a90910461ffff168083526101549091526040909120805460ff60b01b1916905590506133fe816136ee565b5050600160fb5550565b6097546001600160a01b031633146134325760405162461bcd60e51b81526004016111e89061558a565b61015680546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b0316331461347f5760405162461bcd60e51b81526004016111e89061558a565b61013055565b610150546000906001600160a01b03838116911614806134ca57506001600160a01b038084166000908152606c602090815260408083209386168352929052205460ff165b9392505050565b6000816134e381610130546116aa3390565b6135265760405162461bcd60e51b815260206004820152601460248201527324a72b20a624a22fa6a2a925a622afa82927a7a360611b60448201526064016111e8565b61012d54613532613c7b565b10613540576000915061355f565b336000908152610131602052604090205461355c9060056157b3565b91505b50919050565b6097546001600160a01b0316331461358f5760405162461bcd60e51b81526004016111e89061558a565b6001600160a01b0381166135f45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016111e8565b611482816140c3565b6097546001600160a01b031633146136275760405162461bcd60e51b81526004016111e89061558a565b61012e819055613638600482615780565b613643906003615794565b61012f5550565b6001600160a01b03163b151590565b60008160011115801561366d575060655482105b8015610ddb575050600090815260696020526040902054600160e01b900460ff161590565b6000828152606b602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b61ffff81166000908152610154602052604090208054600160b81b900460ff161561374e5760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e481c995d99585b195960821b60448201526064016111e8565b805460ff60b81b1916600160b81b17815560018101546137a15760405162461bcd60e51b815260206004820152600e60248201526d139bdd081e595d081cd95959195960921b60448201526064016111e8565b60006137ab613c7b565b8254909150600090600160a01b900461ffff166001600160401b038111156137d5576137d5615931565b6040519080825280602002602001820160405280156137fe578160200160208202803683370190505b50805190915060005b818161ffff16101561386c578361381d81615866565b9450506138398461ffff168261ffff168760010154901b6142cb565b5083838261ffff16815181106138515761385161591b565b61ffff90921660209283029190910190910152600101613807565b5083546138c390600160b01b900460ff166138915784546001600160a01b031661389f565b610150546001600160a01b03165b855460408051602081019091526000808252600160a01b90920461ffff1691614481565b8354600160b01b900460ff161561393d5761015054845460405163b739100560e01b81526001600160a01b039283169263b73910059261390a92911690869060040161541d565b600060405180830381600087803b15801561392457600080fd5b505af1158015613938573d6000803e3d6000fd5b505050505b8160405161394b919061534c565b6040519081900381209061ffff8716907f888148f582ec9f6c0420ed60149bfbe1bee757f6a27c86b2712b0ece721170a490600090a35050505050565b60c95460ff16156139ab5760405162461bcd60e51b81526004016111e890615560565b60c9805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586139e03390565b6040516001600160a01b03909116815260200160405180910390a1565b60c95460ff16613a465760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016111e8565b60c9805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa336139e0565b6000613a8282613f9c565b9050836001600160a01b031681600001516001600160a01b031614613ab95760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b0386161480613ad75750613ad78533613485565b80613af2575033613ae7846110f3565b6001600160a01b0316145b905080613b1257604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038416613b3957604051633a954ecd60e21b815260040160405180910390fd5b613b4560008487613692565b6001600160a01b038581166000908152606a60209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652606990945282852080546001600160e01b031916909417600160a01b42909216919091021783558701808452922080549193909116613c19576065548214613c1957805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b600082613c728584614651565b14949350505050565b6065546000190190565b60c95460ff1615613ca85760405162461bcd60e51b81526004016111e890615560565b600260fb541415613ccb5760405162461bcd60e51b81526004016111e89061560a565b600260fb556000613cda613c7b565b9050323314613d165760405162461bcd60e51b81526020600482015260086024820152674f4e4c595f454f4160c01b60448201526064016111e8565b61927c613d238483615743565b1115613d5e5760405162461bcd60e51b815260206004820152600a6024820152691352539517d15391115160b21b60448201526064016111e8565b600083118015613d6f5750600f8311155b613db15760405162461bcd60e51b81526020600482015260136024820152721352539517d05353d5539517d2539590531251606a1b60448201526064016111e8565b610153805461ffff600160a01b91829004811660009081526101546020908152604080832080546001600160a01b0319163390811790915586548690048516845281842080548b8716880261ffff60a01b1990911617905586548690048516845281842080548a1515600160b01b0260ff60b01b19909116179055835261015582528220945485546001818101885596845291832060108304018054600f9093166002026101000a808602199093169590910490931602929092179055905b848111613e9857613e846105878285615743565b613e8e9083615743565b9150600101613e70565b508015613f1357610151546001600160a01b0316639dc29fac336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b158015613efa57600080fd5b505af1158015613f0e573d6000803e3d6000fd5b505050505b6101538054600160a01b900461ffff16906014613f2f83615866565b91906101000a81548161ffff021916908361ffff16021790555061ffff167f88d301be3ae154fc458cd7ed709e7b3c94f0196a361fec6773124d76889875b48585604051613f899291909182521515602082015260400190565b60405180910390a25050600160fb555050565b60408051606081018252600080825260208201819052918101919091528180600111158015613fcc575060655481105b156140aa57600081815260696020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906140a85780516001600160a01b03161561403f579392505050565b5060001901600081815260696020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff16151592810192909252156140a3579392505050565b61403f565b505b604051636f96cda160e11b815260040160405180910390fd5b609780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661413c5760405162461bcd60e51b81526004016111e8906155bf565b611c2582826146c5565b600054610100900460ff1661416d5760405162461bcd60e51b81526004016111e8906155bf565b611cab61471d565b600054610100900460ff1661419c5760405162461bcd60e51b81526004016111e8906155bf565b611cab614750565b600054610100900460ff166141cb5760405162461bcd60e51b81526004016111e8906155bf565b611cab614780565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290614208903390899088908890600401615386565b602060405180830381600087803b15801561422257600080fd5b505af1925050508015614252575060408051601f3d908101601f1916820190925261424f918101906150eb565b60015b6142ad573d808015614280576040519150601f19603f3d011682016040523d82523d6000602084013e614285565b606091505b5080516142a5576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6142d3614b5b565b6142dd83836147ae565b905061013360006142ed836148d7565b8152602001908152602001600020546000141561446f576000838152610132602090815260408083208451815493860151928601516060870151608088015160a089015160c08a015160e08b015161ffff1990991695151561ff0019169590951761010060ff988916021763ffff00001916620100009488169490940263ff0000001916939093176301000000928716929092029190911765ffff0000000019166401000000009186169190910265ff0000000000191617600160281b918516919091021767ffff0000000000001916600160301b9184169190910267ff00000000000000191617600160381b92909316919091029190911790558390610133906143f7846148d7565b815260208101919091526040016000205580511561443f5760405183907fe343f2a07cb5f9f1bace14bb63e08f9c6edcb69bbb40566b91ec822558eebe0390600090a2610ddb565b60405183907fef1da42f89c42f48befa143007e6f5efd84a2d1cc3dc97c5edd2d3373220f66d90600090a2610ddb565b6134ca8361447c84614978565b6142cb565b6065546001600160a01b0385166144aa57604051622e076360e81b815260040160405180910390fd5b836144c85760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0385166000818152606a6020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452606990925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801561457957506001600160a01b0387163b15155b15614602575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46145ca60008884806001019550886141d3565b6145e7576040516368d2bf6b60e11b815260040160405180910390fd5b8082141561457f5782606554146145fd57600080fd5b614648565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415614603575b50606555613c5e565b600081815b84518110156146bd5760008582815181106146735761467361591b565b6020026020010151905080831161469957600083815260208290526040902092506146aa565b600081815260208490526040902092505b50806146b581615888565b915050614656565b509392505050565b600054610100900460ff166146ec5760405162461bcd60e51b81526004016111e8906155bf565b81516146ff906067906020850190614b9f565b508051614713906068906020840190614b9f565b5060016065555050565b600054610100900460ff166147445760405162461bcd60e51b81526004016111e8906155bf565b60c9805460ff19169055565b600054610100900460ff166147775760405162461bcd60e51b81526004016111e8906155bf565b611cab336140c3565b600054610100900460ff166147a75760405162461bcd60e51b81526004016111e8906155bf565b600160fb55565b6147b6614b5b565b6147c5600a61ffff84166158a3565b15158082526000906147d85760076147db565b60005b60109390931c9290506147fc61ffff84166147f783600061575b565b6149d7565b60ff16602083015260109290921c9161481e61ffff84166147f783600161575b565b60ff16604083015260109290921c9161484061ffff84166147f783600261575b565b60ff16606083015260109290921c9161486261ffff84166147f783600361575b565b60ff16608083015260109290921c9161488461ffff84166147f783600461575b565b60ff1660a083015260109290921c916148a661ffff84166147f783600561575b565b60ff1660c083015260109290921c916148c861ffff84166147f783600661575b565b60ff1660e08301525092915050565b80516020808301516040808501516060860151608087015160a088015160c089015160e08a0151955198151560f890811b988a01989098526001600160f81b031996881b871660218a015293871b8616602289015291861b85166023880152851b84166024870152841b83166025860152831b8216602685015290911b166027820152600090602801604051602081830303815290604052610ddb906157ca565b6000326149866001436157b3565b60405160609290921b6bffffffffffffffffffffffff191660208301524060348201524260548201526074810183905260940160408051601f19818403018152919052805160209091012092915050565b6000806101348360ff16600e81106149f1576149f161591b565b01546149fd90856158b7565b90506101348360ff16600e8110614a1657614a1661591b565b018160ff1681548110614a2b57614a2b61591b565b60009182526020918290209181049091015460ff601f9092166101000a90048116600886901c90911611614a60579050610ddb565b6101428360ff16600e8110614a7757614a7761591b565b018160ff1681548110614a8c57614a8c61591b565b90600052602060002090602091828204019190069054906101000a900460ff1691505092915050565b82805482825590600052602060002090601f01602090048101928215614b4b5791602002820160005b83821115614b1c57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302614ade565b8015614b495782816101000a81549060ff0219169055600101602081600001049283019260010302614b1c565b505b50614b57929150614c13565b5090565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915290565b828054614bab90615831565b90600052602060002090601f016020900481019282614bcd5760008555614b4b565b82601f10614be657805160ff1916838001178555614b4b565b82800160010185558215614b4b579182015b82811115614b4b578251825591602001919060010190614bf8565b5b80821115614b575760008155600101614c14565b600082601f830112614c3957600080fd5b81356020614c4e614c49836156f9565b6156c9565b80838252828201915082860187848660051b8901011115614c6e57600080fd5b60005b85811015614c8d57813584529284019290840190600101614c71565b5090979650505050505050565b60008083601f840112614cac57600080fd5b5081356001600160401b03811115614cc357600080fd5b6020830191508360208260051b8501011115614cde57600080fd5b9250929050565b600082601f830112614cf657600080fd5b81356020614d06614c49836156f9565b80838252828201915082860187848660051b8901011115614d2657600080fd5b60005b85811015614c8d57614d3a82614d73565b84529284019290840190600101614d29565b80358015158114614d5c57600080fd5b919050565b803561ffff81168114614d5c57600080fd5b803560ff81168114614d5c57600080fd5b600060208284031215614d9657600080fd5b81356134ca81615947565b60008060408385031215614db457600080fd5b8235614dbf81615947565b91506020830135614dcf81615947565b809150509250929050565b600080600060608486031215614def57600080fd5b8335614dfa81615947565b92506020840135614e0a81615947565b929592945050506040919091013590565b60008060008060808587031215614e3157600080fd5b8435614e3c81615947565b93506020850135614e4c81615947565b92506040850135915060608501356001600160401b03811115614e6e57600080fd5b8501601f81018713614e7f57600080fd5b8035614e8d614c498261571c565b818152886020838501011115614ea257600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080600060408486031215614ed957600080fd5b8335614ee481615947565b925060208401356001600160401b03811115614eff57600080fd5b614f0b86828701614c9a565b9497909650939450505050565b60008060408385031215614f2b57600080fd5b8235614f3681615947565b9150614f4460208401614d4c565b90509250929050565b60008060408385031215614f6057600080fd5b8235614f6b81615947565b9150614f4460208401614d61565b60008060408385031215614f8c57600080fd5b8235614f9781615947565b946020939093013593505050565b600060208284031215614fb757600080fd5b81356001600160401b03811115614fcd57600080fd5b6142c384828501614c28565b600080600060608486031215614fee57600080fd5b83356001600160401b0381111561500457600080fd5b61501086828701614c28565b9350506020840135915061502660408501614d4c565b90509250925092565b6000806000806040858703121561504557600080fd5b84356001600160401b038082111561505c57600080fd5b61506888838901614c9a565b9096509450602087013591508082111561508157600080fd5b5061508e87828801614c9a565b95989497509550505050565b6000602082840312156150ac57600080fd5b6134ca82614d4c565b6000602082840312156150c757600080fd5b5035919050565b6000602082840312156150e057600080fd5b81356134ca8161595c565b6000602082840312156150fd57600080fd5b81516134ca8161595c565b60008060006060848603121561511d57600080fd5b833561512881615947565b9250602084013561513881615947565b9150604084013561514881615947565b809150509250925092565b60006020828403121561516557600080fd5b81516001600160401b0381111561517b57600080fd5b8201601f8101841361518c57600080fd5b805161519a614c498261571c565b8181528560208385010111156151af57600080fd5b6151c08260208301602086016157ee565b95945050505050565b6000602082840312156151db57600080fd5b6134ca82614d61565b6000602082840312156151f657600080fd5b5051919050565b6000806040838503121561521057600080fd5b82359150614f4460208401614d4c565b6000806040838503121561523357600080fd5b50508035926020909101359150565b60008060006060848603121561525757600080fd5b833592506020840135915061502660408501614d4c565b60008060006060848603121561528357600080fd5b61528c84614d73565b925060208401356001600160401b03808211156152a857600080fd5b6152b487838801614ce5565b935060408601359150808211156152ca57600080fd5b506152d786828701614ce5565b9150509250925092565b600081518084526020808501945080840160005b8381101561531557815161ffff16875295820195908201906001016152f5565b509495945050505050565b600081518084526153388160208601602086016157ee565b601f01601f19169290920160200192915050565b815160009082906020808601845b8381101561537a57815161ffff168552938201939082019060010161535a565b50929695505050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906153b990830184615320565b9695505050505050565b6001600160a01b038416815260406020808301829052908201839052600090849060608401835b868110156154115761ffff6153fe85614d61565b16825292820192908201906001016153ea565b50979650505050505050565b6001600160a01b03831681526040602082018190526000906142c3908301846152e1565b6040808252835182820181905260009190606090818501906020808901865b838110156154b357815180516001600160a01b031686528381015161ffff168487015287810151151588870152868101511515878701526080908101519086015260a09094019390820190600101615460565b505086830390870152506154c781876152e1565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561550a578351835292840192918401916001016154ee565b50909695505050505050565b6020815260006134ca6020830184615320565b60208082526017908201527f4d494e545f504149445f50524943455f494e56414c4944000000000000000000604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006101008201905082511515825260ff602084015116602083015260ff604084015116604083015260ff606084015116606083015260ff608084015116608083015260a083015161569860a084018260ff169052565b5060c08301516156ad60c084018260ff169052565b5060e08301516156c260e084018260ff169052565b5092915050565b604051601f8201601f191681016001600160401b03811182821017156156f1576156f1615931565b604052919050565b60006001600160401b0382111561571257615712615931565b5060051b60200190565b60006001600160401b0382111561573557615735615931565b50601f01601f191660200190565b60008219821115615756576157566158d9565b500190565b600060ff821660ff84168060ff03821115615778576157786158d9565b019392505050565b60008261578f5761578f6158ef565b500490565b60008160001904831182151516156157ae576157ae6158d9565b500290565b6000828210156157c5576157c56158d9565b500390565b8051602080830151919081101561355f5760001960209190910360031b1b16919050565b60005b838110156158095781810151838201526020016157f1565b838111156118645750506000910152565b600081615829576158296158d9565b506000190190565b600181811c9082168061584557607f821691505b6020821081141561355f57634e487b7160e01b600052602260045260246000fd5b600061ffff8083168181141561587e5761587e6158d9565b6001019392505050565b600060001982141561589c5761589c6158d9565b5060010190565b6000826158b2576158b26158ef565b500690565b600060ff8316806158ca576158ca6158ef565b8060ff84160691505092915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461148257600080fd5b6001600160e01b03198116811461148257600080fdfea26469706673582212201f9b1359dc6249e2b8203c8949e5092891e145ee2d137c071391430d5630ea4564736f6c63430008070033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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