ETH Price: $3,904.53 (+1.18%)

Token

Monsuta (Monsuta)
 

Overview

Max Total Supply

8,888 Monsuta

Holders

2,572

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
dielala.eth
Balance
1 Monsuta
0xd9a52Cab8c50c8eD7F15D7477C80C0131A4AA3dB
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

Monsutā is an ancient story that exists within a dream. A legend of monsters and beasts known as the yōkai, from the deepest darkest corners of the universe. Of all the yōkai, it was the Monsutā who were the most dreaded and by far the most powerful.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Monsuta

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion, MIT license
File 1 of 28 : Monsuta.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

import {DefaultOperatorFilterer} from "operator-filter-registry/src/DefaultOperatorFilterer.sol";

import {ERC721A, IERC721A, ERC721AQueryable} from "./ERC721AQueryable.sol";
import {IOmen} from "./interfaces/IOmen.sol";
import {IMonsutaRegistry} from "./interfaces/IMonsutaRegistry.sol";
import {NameUtils} from "./utils/NameUtils.sol";
import {Base64} from "./utils/Base64.sol";

/**
 * @title Monsuta contract
 * @dev Extends ERC721 Non-Fungible Token Standard basic implementation
 */
contract Monsuta is
    ERC721AQueryable,
    Ownable,
    ReentrancyGuard,
    DefaultOperatorFilterer
{
    using Strings for uint256;
    using SafeERC20 for IERC20;

    enum MonsutaState {
        DEFAULT,
        EVOLVED,
        SOUL
    }

    struct Trade {
        uint256 tradeId;
        uint256 openingTokenId;
        uint256 closingTokenId;
        uint256 expiryDate;
        address tradeOpener;
        address tradeCloser;
        bool active;
    }

    // Public variables
    uint256 public constant SALE_START_TIMESTAMP = 1676037600;

    // Time after which monsutas are randomized and allotted
    uint256 public constant REVEAL_TIMESTAMP = SALE_START_TIMESTAMP + 3 * 86400; // 3days

    uint256 public constant MINT_PRICE = 0.059 ether;
    uint256 public constant MAX_NFT_SUPPLY = 8888;

    uint256 public currentPhase; // current phase index 0: stopped 1: phase1, 2: phase2
    mapping(uint256 => bytes32) private _merkleRootsForPhase;
    mapping(uint256 => uint256) public wlPriceForPhase;
    mapping(address => mapping(uint256 => uint256)) public mintedForPhase;

    // Omen Rewards
    uint256 public constant INITIAL_ALLOTMENT = 500 * 1e18;
    uint256 public constant EVOLVED_MULTIPLIER = 3;

    uint256 public nameChangePrice = 500 * 1e18;
    uint256 public sacrificePrice = 250 * 1e18;
    uint256 public resurrectPrice = 750 * 1e18;

    uint256 public startingIndexBlock;
    uint256 public startingIndex;
    uint256 public devMinted;

    // Name
    mapping(uint256 => string) private tokenName;
    mapping(string => bool) private nameReserved;
    bool public nameChangeEnabled = false;

    // $Omen token address
    address private omenAddress;

    // MonsutaRegistry contract address
    IMonsutaRegistry public registry;

    // Omen Rewards
    uint256 public constant emissionStart = SALE_START_TIMESTAMP;
    uint256 public constant emissionEnd = 1753876800; // July 30th 2025 12:00 GMT;
    uint256 public constant emissionPerDay = 25 * 1e18;

    mapping(uint256 => uint256) private _lastClaim;

    // Trade
    Trade[] public trades;

    // Metadata Variables
    mapping(uint256 => MonsutaState) public tokenState;

    string public defaultImageIPFSURIPrefix = "";
    string public evolvedImageIPFSURIPrefix = "";
    string public soulImageIPFSURIPrefix = "";
    string public placeholderImageIPFSURI =
        "ipfs://QmezsA5i9ACnkpkbod5zkBBqJChRucFGigwEPWiqQScfF2";

    // Events
    event NameChange(uint256 indexed tokenId, string newName);
    event Sacrificed(
        uint256 indexed toEvolveId,
        uint256 indexed toSoulId,
        address caller
    );
    event Resurrect(
        uint256 indexed evolvedTokenId,
        uint256 indexed soulTokenId,
        address caller
    );

    event TradeOpened(
        uint256 indexed tradeId,
        address indexed tradeOpener,
        uint256 openingTokenId,
        uint256 closingTokenId,
        uint256 expiryDate
    );
    event TradeCancelled(uint256 indexed tradeId, address indexed tradeCloser);
    event TradeExecuted(
        uint256 indexed tradeId,
        address indexed tradeOpener,
        address indexed tradeCloser
    );

    // Modifiers
    modifier onlyTokenOwner(uint256 tokenId) {
        require(ownerOf(tokenId) == msg.sender, "!owner of token id");
        _;
    }

    modifier onlyAfterReveal() {
        require(startingIndex > 0, "only after reveal");
        _;
    }

    /**
     * @dev Initializes the contract
     */
    constructor(bytes32[3] memory _merkleRoots, uint256[3] memory _prices)
        ERC721A("Monsuta", "Monsuta")
    {
        uint64 numPhases = uint64(_merkleRoots.length);
        for (uint256 i = 0; i < numPhases; ) {
            _merkleRootsForPhase[i + 1] = _merkleRoots[i];
            wlPriceForPhase[i + 1] = _prices[i];

            unchecked {
                ++i;
            }
        }
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721A)
        returns (bool)
    {
        return ERC721A.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns name of the NFT at tokenId.
     */
    function tokenNameByIndex(uint256 tokenId)
        public
        view
        returns (string memory)
    {
        return tokenName[tokenId];
    }

    /**
     * @dev Returns if the name has been reserved.
     */
    function isNameReserved(string memory nameString)
        public
        view
        returns (bool)
    {
        return nameReserved[NameUtils.toLower(nameString)];
    }

    /**
     * @dev Mints Monsuta!
     */
    function mint(uint256 numberOfNfts, bytes32[] calldata merkleProof)
        external
        payable
        nonReentrant
    {
        require(totalSupply() < MAX_NFT_SUPPLY, "Sale has already ended");
        require(currentPhase > 0, "Sale is paused");
        require(block.timestamp > SALE_START_TIMESTAMP, "not started");
        require(numberOfNfts > 0 && numberOfNfts < 6, "invalid numberOfNfts");
        require(
            totalSupply() + numberOfNfts <= MAX_NFT_SUPPLY,
            "Exceeds max supply"
        );

        (uint256 whitelistMint, uint256 price) = checkWhiteListMint(
            msg.sender,
            merkleProof
        );
        if (whitelistMint > 0) {
            mintedForPhase[msg.sender][currentPhase] += whitelistMint;
        }

        require(
            MINT_PRICE * (numberOfNfts - whitelistMint) + price == msg.value,
            "Ether value sent is not correct"
        );

        _safeMint(msg.sender, numberOfNfts, "");

        // Source of randomness.
        // Theoretical miner withhold manipulation possible but should be sufficient in a pragmatic sense
        if (
            startingIndexBlock == 0 &&
            (totalSupply() == MAX_NFT_SUPPLY ||
                block.timestamp >= REVEAL_TIMESTAMP)
        ) {
            startingIndexBlock = block.number;
        }
    }

    function checkWhiteListMint(address account, bytes32[] calldata proof)
        public
        view
        returns (uint256, uint256)
    {
        bytes32 merkleRoot = _merkleRootsForPhase[currentPhase];
        if (merkleRoot != bytes32(0) && proof.length > 0) {
            if (mintedForPhase[account][currentPhase] < 1) {
                if (
                    MerkleProof.verify(
                        proof,
                        merkleRoot,
                        keccak256(abi.encodePacked(account))
                    )
                ) {
                    return (1, wlPriceForPhase[currentPhase]);
                }
            }
        }

        return (0, 0);
    }

    function _startTokenId() internal view virtual override returns (uint256) {
        return 0;
    }

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

        string memory namePostfix = '"';
        if (bytes(tokenName[tokenId]).length != 0) {
            namePostfix = string(abi.encodePacked(tokenName[tokenId], '"'));
        } else {
            namePostfix = string(
                abi.encodePacked("Monsuta #", tokenId.toString(), '"')
            );
        }

        if (startingIndex == 0) {
            return
                string(
                    abi.encodePacked(
                        "data:application/json;base64,",
                        Base64.encode(
                            abi.encodePacked(
                                '{"name": "',
                                namePostfix,
                                ', "description": "The Monsuta Collection", "image": "',
                                placeholderImageIPFSURI,
                                '" }'
                            )
                        )
                    )
                );
        }

        uint256 tokenIdToMetadataIndex = (tokenId + startingIndex) %
            MAX_NFT_SUPPLY;

        // Block scoping to avoid stack too deep error
        bytes memory uriPartsOfMetadata;
        {
            uriPartsOfMetadata = abi.encodePacked(
                ', "image": "',
                string(
                    abi.encodePacked(
                        baseURI(tokenId),
                        tokenIdToMetadataIndex.toString(),
                        ".png"
                    )
                )
            );
        }

        return
            string(
                abi.encodePacked(
                    "data:application/json;base64,",
                    Base64.encode(
                        abi.encodePacked(
                            '{"name": "',
                            namePostfix,
                            ', "description": "The Monsuta Collection", ',
                            registry.getEncodedTraitsOfMonsutaId(
                                tokenId,
                                uint256(tokenState[tokenId])
                            ),
                            uriPartsOfMetadata,
                            '" }'
                        )
                    )
                )
            );
    }

    function baseURI(uint256 tokenId) public view returns (string memory) {
        MonsutaState _state = tokenState[tokenId];
        if (_state == MonsutaState.DEFAULT) {
            return defaultImageIPFSURIPrefix;
        } else if (_state == MonsutaState.EVOLVED) {
            return evolvedImageIPFSURIPrefix;
        } else {
            return soulImageIPFSURIPrefix;
        }
    }

    /**
     * @dev Finalize starting index
     */
    function finalizeStartingIndex() external {
        require(startingIndex == 0, "Starting index is already set");
        require(startingIndexBlock > 0, "Starting index block must be set");

        // Just a sanity case in the worst case if this function is called late (EVM only stores last 256 block hashes)
        if (block.number - startingIndexBlock > 255) {
            startingIndex =
                uint256(blockhash(block.number - 1)) %
                MAX_NFT_SUPPLY;
        } else {
            startingIndex =
                uint256(blockhash(startingIndexBlock)) %
                MAX_NFT_SUPPLY;
        }
        // Prevent default sequence
        if (startingIndex == 0) {
            startingIndex = 1;
        }
    }

    /**
     * @dev Changes the name for Monsuta tokenId
     */
    function changeName(uint256 tokenId, string memory newName)
        external
        onlyTokenOwner(tokenId)
    {
        require(nameChangeEnabled, "disabled!");
        require(NameUtils.validateName(newName) == true, "not valid new name");
        require(
            sha256(bytes(newName)) != sha256(bytes(tokenName[tokenId])),
            "same as the current one"
        );
        require(isNameReserved(newName) == false, "already reserved");

        // If already named, dereserve old name
        if (bytes(tokenName[tokenId]).length > 0) {
            toggleReserveName(tokenName[tokenId], false);
        }
        toggleReserveName(newName, true);
        tokenName[tokenId] = newName;

        _transferOmenAndBurn(msg.sender, nameChangePrice);

        emit NameChange(tokenId, newName);
    }

    /**
     * @dev Reserves the name if isReserve is set to true, de-reserves if set to false
     */
    function toggleReserveName(string memory str, bool isReserve) internal {
        nameReserved[NameUtils.toLower(str)] = isReserve;
    }

    /**
     * @dev sacrifice. 1 nft from default to evolved, 1 nft from default to soul
     */
    function sacrifice(uint256 toEvolveId, uint256 toSoulId)
        external
        onlyTokenOwner(toEvolveId)
        onlyTokenOwner(toSoulId)
        onlyAfterReveal
    {
        require(
            tokenState[toEvolveId] == MonsutaState.DEFAULT,
            "!evolving item default"
        );
        require(
            tokenState[toSoulId] == MonsutaState.DEFAULT,
            "!soul item default"
        );

        tokenState[toEvolveId] = MonsutaState.EVOLVED;
        tokenState[toSoulId] = MonsutaState.SOUL;

        _transferOmenAndBurn(msg.sender, sacrificePrice);

        updateReward(toEvolveId);
        updateReward(toSoulId);

        emit Sacrificed(toEvolveId, toSoulId, msg.sender);
    }

    /**
     * @dev requires: evolved Monsuta NFT, soul Monsuta NFT and $FAVOR
     * For the evolved Monsuta NFT: retract() is activated
     * For the soul Monsuta NFT: descent() is activated
     * $FAVOR is burned
     */
    function resurrect(uint256 evolvedTokenId, uint256 soulTokenId)
        external
        onlyTokenOwner(evolvedTokenId)
        onlyTokenOwner(soulTokenId)
    {
        require(tokenState[soulTokenId] == MonsutaState.SOUL, "!soul");
        require(tokenState[evolvedTokenId] == MonsutaState.EVOLVED, "!evolved");

        tokenState[evolvedTokenId] = MonsutaState.DEFAULT;
        tokenState[soulTokenId] = MonsutaState.DEFAULT;

        updateReward(soulTokenId);
        updateReward(evolvedTokenId);

        _transferOmenAndBurn(msg.sender, resurrectPrice);

        emit Resurrect(evolvedTokenId, soulTokenId, msg.sender);
    }

    function _transferOmenAndBurn(address from, uint256 amount) internal {
        SafeERC20.safeTransferFrom(
            IERC20(omenAddress),
            from,
            address(this),
            amount
        );
        IOmen(omenAddress).burn(amount);
    }

    function setApprovalForAll(address operator, bool approved)
        public
        override(ERC721A, IERC721A)
        onlyAllowedOperatorApproval(operator)
    {
        super.setApprovalForAll(operator, approved);
    }

    function approve(address operator, uint256 tokenId)
        public
        override(ERC721A, IERC721A)
        onlyAllowedOperatorApproval(operator)
    {
        super.approve(operator, tokenId);
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override(ERC721A, IERC721A) onlyAllowedOperator(from) {
        super.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override(ERC721A, IERC721A) onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public override(ERC721A, IERC721A) onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId, data);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual override(ERC721A) {
        super._beforeTokenTransfers(from, to, startTokenId, quantity);

        for (uint256 i; i < quantity; ) {
            uint256 tokenId = startTokenId + i;

            if (from != address(0)) {
                updateReward(tokenId);
                require(tokenState[tokenId] != MonsutaState.SOUL, "soul token");
            }

            unchecked {
                ++i;
            }
        }
    }

    /**
     * @dev When accumulated FAVORs have last been claimed for a Monsuta tokenId
     */
    function getLastClaim(uint256 tokenId) public view returns (uint256) {
        require(_exists(tokenId), "!exist");

        uint256 lastClaimed = uint256(_lastClaim[tokenId]) != 0
            ? uint256(_lastClaim[tokenId])
            : emissionStart;
        return lastClaimed;
    }

    /**
     * @dev Accumulated FAVOR tokens for a Monsuta token id
     */
    function getAccumulated(uint256 tokenId) public view returns (uint256) {
        if (block.timestamp <= emissionStart) return 0;

        uint256 lastClaimed = getLastClaim(tokenId);

        // Sanity check if last claim was on or after emission end
        if (lastClaimed >= emissionEnd) return 0;

        uint256 accumulationPeriod = block.timestamp < emissionEnd
            ? block.timestamp
            : emissionEnd; // Getting the min value of both

        uint256 totalAccumulated = ((accumulationPeriod - lastClaimed) *
            emissionPerDay *
            multiplierFromState(tokenId)) / 86400;

        // If claim hasn't been done before for the index, add initial allotment
        if (lastClaimed == emissionStart) {
            totalAccumulated += INITIAL_ALLOTMENT;
        }

        return totalAccumulated;
    }

    /**
     * @dev Accumulated all FAVOR tokens for all Monsuta balance
     */
    function getAccumulatedAll(address account) public view returns (uint256) {
        if (block.timestamp <= emissionStart) return 0;

        uint256 monsutaBalance = balanceOf(account);
        if (monsutaBalance == 0) return 0;

        uint256 totalAccumulated = 0;

        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            TokenOwnership memory ownership;
            for (
                uint256 i = _startTokenId();
                tokenIdsIdx != monsutaBalance;
                ++i
            ) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == account) {
                    tokenIdsIdx++;
                    uint256 claimQty = getAccumulated(i);
                    if (claimQty > 0) {
                        totalAccumulated = totalAccumulated + claimQty;
                    }
                }
            }
        }

        return totalAccumulated;
    }

    /**
     * @dev Claim mints Omens for all my Monsuta nft balances
     */
    function claimAll() external returns (uint256) {
        uint256 monsutaBalance = balanceOf(msg.sender);
        require(monsutaBalance > 0, "zero balance");

        require(
            block.timestamp > emissionStart,
            "Emission has not started yet"
        );

        uint256 totalClaimQty = 0;

        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            TokenOwnership memory ownership;
            for (
                uint256 i = _startTokenId();
                tokenIdsIdx != monsutaBalance;
                ++i
            ) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == msg.sender) {
                    tokenIdsIdx++;
                    uint256 claimQty = getAccumulated(i);
                    if (claimQty > 0) {
                        totalClaimQty += claimQty;
                        _lastClaim[i] = block.timestamp;
                    }
                }
            }
        }

        require(totalClaimQty > 0, "No accumulated Omen");
        IOmen(omenAddress).mint(msg.sender, totalClaimQty);
        return totalClaimQty;
    }

    /**
     * @dev Hook for state change of monsuta nft
     * can be called by only Monsuta Token Contract
     */

    function updateReward(uint256 tokenId) internal {
        uint256 claimQty = getAccumulated(tokenId);
        if (claimQty > 0) {
            _lastClaim[tokenId] = block.timestamp;

            IOmen(omenAddress).mint(ownerOf(tokenId), claimQty);
        }
    }

    function multiplierFromState(uint256 tokenId)
        public
        view
        returns (uint256)
    {
        MonsutaState state = tokenState[tokenId];
        if (state == MonsutaState.DEFAULT) {
            return 1;
        } else if (state == MonsutaState.EVOLVED) {
            return EVOLVED_MULTIPLIER;
        } else {
            return 0;
        }
    }

    function getTradeCount() public view returns (uint256) {
        return trades.length;
    }

    function isTradeExecutable(uint256 tradeId) public view returns (bool) {
        Trade memory trade = trades[tradeId];
        if (trade.expiryDate < block.timestamp) {
            return false;
        }
        if (!trade.active) {
            return false;
        }

        return true;
    }

    /**
     * @dev Open new trade
     */
    function openNewTrade(
        uint256 openingTokenId,
        uint256 closingTokenId,
        uint256 expiryDate
    ) external onlyTokenOwner(openingTokenId) {
        require(expiryDate > block.timestamp, "expiryDate <= block.timestamp");
        require(tokenState[openingTokenId] != MonsutaState.SOUL, "soul item");
        uint256 tradeId = trades.length;
        trades.push(
            Trade(
                tradeId,
                openingTokenId,
                closingTokenId,
                expiryDate,
                msg.sender,
                address(0),
                true
            )
        );

        emit TradeOpened(
            tradeId,
            msg.sender,
            openingTokenId,
            closingTokenId,
            expiryDate
        );
    }

    /**
     * @dev Cancel trade
     */
    function cancelTrade(uint256 tradeId) external {
        Trade memory trade = trades[tradeId];
        require(trade.tradeOpener == msg.sender, "!opener");
        require(
            trade.tradeCloser == address(0),
            "tradeCloser can't already be non-zero address"
        );
        require(
            trade.expiryDate > block.timestamp,
            "trade.expiryDate <= block.timestamp"
        );
        trades[tradeId] = Trade(
            trade.tradeId,
            trade.openingTokenId,
            trade.closingTokenId,
            trade.expiryDate,
            trade.tradeOpener,
            msg.sender,
            false
        );

        emit TradeCancelled(tradeId, msg.sender);
    }

    /**
     * @dev Execute Trade
     */
    function executeTrade(uint256 tradeId) external {
        Trade memory trade = trades[tradeId];
        require(trade.active, "!active trade");
        require(trade.expiryDate > block.timestamp, "expired");
        require(
            tokenState[trade.closingTokenId] != MonsutaState.SOUL,
            "soul item"
        );
        require(
            ownerOf(trade.closingTokenId) == msg.sender,
            "!owner of closing token"
        );

        _transfer(trade.tradeOpener, msg.sender, trade.openingTokenId);
        _transfer(msg.sender, trade.tradeOpener, trade.closingTokenId);

        trades[tradeId] = Trade(
            trade.tradeId,
            trade.openingTokenId,
            trade.closingTokenId,
            trade.expiryDate,
            trade.tradeOpener,
            msg.sender,
            false
        );

        emit TradeExecuted(trade.tradeId, trade.tradeOpener, msg.sender);
    }

    /// Admin Funcs

    /**
     * @dev Set Omen Contract address (Callable by owner)
     */
    function setOmen(address _omen) external onlyOwner {
        require(_omen != address(0), "!zero address");

        omenAddress = _omen;
    }

    /**
     * @dev Set MonsutaRegistry Contract address (Callable by owner)
     */
    function setRegistry(address _registry) external onlyOwner {
        require(_registry != address(0), "!zero address");

        registry = IMonsutaRegistry(_registry);
    }

    /**
     * @dev Set current Phase (Callable by owner)
     */
    function setCurrentPhase(uint256 newPhase) external onlyOwner {
        require(currentPhase != newPhase, "already");

        currentPhase = newPhase;
    }

    function changePhaseSettng(
        uint256 phase,
        bytes32 _merkleRoot,
        uint256 price
    ) external onlyOwner {
        _merkleRootsForPhase[phase] = _merkleRoot;
        wlPriceForPhase[phase] = price;
    }

    /**
     * @dev Metadata will be frozen once ownership of the contract is renounced
     */
    function changeURIs(
        string memory defaultImageURI,
        string memory evolvedImageURI,
        string memory soulImageURI,
        string memory placeholderURI
    ) external onlyOwner {
        defaultImageIPFSURIPrefix = defaultImageURI;
        evolvedImageIPFSURIPrefix = evolvedImageURI;
        soulImageIPFSURIPrefix = soulImageURI;
        placeholderImageIPFSURI = placeholderURI;
    }

    /**
     * @dev Set Name change price (Callable by owner)
     */
    function setNameChangePrice(uint256 _price) external onlyOwner {
        nameChangePrice = _price;
    }

    function toggleNameChangeEnabled() external onlyOwner {
        nameChangeEnabled = !nameChangeEnabled;
    }

    /**
     * @dev Set Sacrifice price (Callable by owner)
     */
    function setSacrificePrice(uint256 _price) external onlyOwner {
        sacrificePrice = _price;
    }

    /**
     * @dev Set Resurrection price (Callable by owner)
     */
    function setResurrectPrice(uint256 _price) external onlyOwner {
        resurrectPrice = _price;
    }

    function devMint() external onlyOwner {
        require(devMinted < 1, "minted all");

        devMinted = 1;
        _safeMint(msg.sender, 1, "");
    }

    /**
     * @dev Withdraw ether from this contract (Callable by owner)
     */
    function withdraw() external onlyOwner {
        uint256 balance = address(this).balance;

        uint256 dev = (balance * 15) / 100;
        Address.sendValue(
            payable(0xfed505c80b72cDca5f72292D4bF1D6194cF23669),
            dev
        );
        Address.sendValue(payable(msg.sender), balance - dev);
    }
}

File 2 of 28 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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);
    }
}

File 3 of 28 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and 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;
    }
}

File 4 of 28 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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);
}

File 5 of 28 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 6 of 28 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 7 of 28 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

        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 overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

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

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

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

        _afterTokenTransfer(address(0), to, tokenId);
    }

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

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

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

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

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

        _afterTokenTransfer(owner, address(0), tokenId);
    }

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

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

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

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 8 of 28 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * 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;

    /**
     * @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 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @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);
}

File 9 of 28 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (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 IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 11 of 28 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 13 of 28 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @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);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 14 of 28 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree 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.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
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 Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle 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++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
     * consuming from one or the other at each step according to the instructions given by
     * `proofFlags`.
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 15 of 28 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 16 of 28 : IERC165.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 IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 17 of 28 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {OperatorFilterer} from "./OperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol";
/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 * @dev    Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract DefaultOperatorFilterer is OperatorFilterer {
    /// @dev The constructor that is called when the contract is being deployed.
    constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {}
}

File 18 of 28 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(address registrant, address subscription) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(address registrant, address operator, bool filtered) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(address registrant, address registrantToSubscribe) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(address registrant) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(address registrant, address registrantToCopy) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(address registrant, address operator) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(address addr) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

File 19 of 28 : OperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 *         Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract OperatorFilterer {
    /// @dev Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (subscribe) {
                OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    OPERATOR_FILTER_REGISTRY.register(address(this));
                }
            }
        }
    }

    /**
     * @dev A helper function to check if an operator is allowed.
     */
    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    /**
     * @dev A helper function to check if an operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @dev A helper function to check if an operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting contracts
            // may specify their own OperatorFilterRegistry implementations, which may behave differently
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

File 20 of 28 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

File 21 of 28 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity 0.8.17;

import "./interfaces/IERC721A.sol";

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _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 {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

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

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

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

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

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

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

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner)
        public
        view
        virtual
        override
        returns (uint256)
    {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return
            (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) &
            _BITMASK_ADDRESS_DATA_ENTRY;
    }

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

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

    /**
     * Sets the auxiliary 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 virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed =
            (packed & _BITMASK_AUX_COMPLEMENT) |
            (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        returns (bool)
    {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    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, _toString(tokenId)))
                : "";
    }

    /**
     * @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, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId)
        internal
        view
        virtual
        returns (TokenOwnership memory)
    {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index)
        internal
        view
        virtual
        returns (TokenOwnership memory)
    {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId)
        private
        view
        returns (uint256)
    {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed)
        private
        pure
        returns (TokenOwnership memory ownership)
    {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags)
        private
        view
        returns (uint256 result)
    {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(
                owner,
                or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)
            )
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity)
        private
        pure
        returns (uint256 result)
    {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @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) public virtual override {
        address owner = ownerOf(tokenId);

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

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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)
        public
        virtual
        override
    {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @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. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public virtual override {
        (, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (
            !_isSenderApprovedOrOwner(
                approvedAddress,
                from,
                _msgSenderERC721A()
            )
        )
            if (!isApprovedForAll(from, _msgSenderERC721A()))
                revert TransferCallerNotOwnerNorApproved();

        _transfer(from, to, tokenId);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @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 memory _data
    ) public virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from)
            revert TransferFromIncorrectOwner();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        delete _tokenApprovals[tokenId];

        // 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 {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED |
                    _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

    /**
     * @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 Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try
            ERC721A__IERC721Receiver(to).onERC721Received(
                _msgSenderERC721A(),
                from,
                tokenId,
                _data
            )
        returns (bytes4 retval) {
            return
                retval ==
                ERC721A__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @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 for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

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

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] +=
                quantity *
                ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) |
                    _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

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

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT)
            revert MintERC2309QuantityExceedsLimit();

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

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] +=
                quantity *
                ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) |
                    _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(
                startTokenId,
                startTokenId + quantity - 1,
                address(0),
                to
            );

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, 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.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (
                        !_checkContractOnERC721Received(
                            address(0),
                            to,
                            index++,
                            _data
                        )
                    ) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev 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 {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

        (
            uint256 approvedAddressSlot,
            address approvedAddress
        ) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (
                !_isSenderApprovedOrOwner(
                    approvedAddress,
                    from,
                    _msgSenderERC721A()
                )
            )
                if (!isApprovedForAll(from, _msgSenderERC721A()))
                    revert TransferCallerNotOwnerNorApproved();
        }

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

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // 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 {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) |
                    _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

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

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed =
            (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) |
            (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * 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 _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value)
        internal
        pure
        virtual
        returns (string memory str)
    {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}

File 22 of 28 : ERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity 0.8.17;

import "./interfaces/IERC721AQueryable.sol";
import "./ERC721A.sol";

/**
 * @title ERC721AQueryable.
 *
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (TokenOwnership memory)
    {
        TokenOwnership memory ownership;
        if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
            return ownership;
        }
        ownership = _ownershipAt(tokenId);
        if (ownership.burned) {
            return ownership;
        }
        return _ownershipOf(tokenId);
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] calldata tokenIds)
        external
        view
        virtual
        override
        returns (TokenOwnership[] memory)
    {
        unchecked {
            uint256 tokenIdsLength = tokenIds.length;
            TokenOwnership[] memory ownerships = new TokenOwnership[](
                tokenIdsLength
            );
            for (uint256 i; i != tokenIdsLength; ++i) {
                ownerships[i] = explicitOwnershipOf(tokenIds[i]);
            }
            return ownerships;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            uint256 tokenIdsIdx;
            uint256 stopLimit = _nextTokenId();
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, stopLimit)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }
            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }
            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }
            // We need to call `explicitOwnershipOf(start)`,
            // because the slot at `start` may not be initialized.
            TokenOwnership memory ownership = explicitOwnershipOf(start);
            address currOwnershipAddr;
            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
            if (!ownership.burned) {
                currOwnershipAddr = ownership.addr;
            }
            for (
                uint256 i = start;
                i != stop && tokenIdsIdx != tokenIdsMaxLength;
                ++i
            ) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner)
        external
        view
        virtual
        override
        returns (uint256[] memory)
    {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (
                uint256 i = _startTokenId();
                tokenIdsIdx != tokenIdsLength;
                ++i
            ) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 23 of 28 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity 0.8.17;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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,
        bytes calldata data
    ) external;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` 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 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 the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId)
        external
        view
        returns (address operator);

    /**
     * @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);

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @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);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(
        uint256 indexed fromTokenId,
        uint256 toTokenId,
        address indexed from,
        address indexed to
    );
}

File 24 of 28 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.2
// Creator: Chiru Labs

pragma solidity 0.8.17;

import "./IERC721A.sol";

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721AQueryable is IERC721A {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId)
        external
        view
        returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds)
        external
        view
        returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner)
        external
        view
        returns (uint256[] memory);
}

File 25 of 28 : IMonsutaRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

interface IMonsutaRegistry {
    function getTraitsOfMonsutaId(uint256 monsutaId)
        external
        view
        returns (
            string memory character,
            string memory monsuta,
            string memory eyeColor,
            string memory skinColor,
            string memory item
        );

    function getEncodedTraitsOfMonsutaId(uint256 monsutaId, uint256 state)
        external
        view
        returns (bytes memory traits);
}

File 26 of 28 : IOmen.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity 0.8.17;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IOmen {
    /**
     * @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
    );

    /**
     * @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 Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) external;

    function mint(address account, uint256 amount) external;
}

File 27 of 28 : Base64.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

/// @title Base64
/// @author Brecht Devos - <[email protected]>
/// @notice Provides functions for encoding/decoding base64
library Base64 {
    string internal constant TABLE_ENCODE =
        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    bytes internal constant TABLE_DECODE =
        hex"0000000000000000000000000000000000000000000000000000000000000000"
        hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000"
        hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000"
        hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000";

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

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

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

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

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

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

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

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

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

            } lt(dataPtr, endPtr) {

            } {
                // read 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

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

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

        return result;
    }

    function decode(string memory _data) internal pure returns (bytes memory) {
        bytes memory data = bytes(_data);

        if (data.length == 0) return new bytes(0);
        require(data.length % 4 == 0, "invalid base64 decoder input");

        // load the table into memory
        bytes memory table = TABLE_DECODE;

        // every 4 characters represent 3 bytes
        uint256 decodedLen = (data.length / 4) * 3;

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

        assembly {
            // padding with '='
            let lastBytes := mload(add(data, mload(data)))
            if eq(and(lastBytes, 0xFF), 0x3d) {
                decodedLen := sub(decodedLen, 1)
                if eq(and(lastBytes, 0xFFFF), 0x3d3d) {
                    decodedLen := sub(decodedLen, 1)
                }
            }

            // set the actual output length
            mstore(result, decodedLen)

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

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

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

            // run over the input, 4 characters at a time
            for {

            } lt(dataPtr, endPtr) {

            } {
                // read 4 characters
                dataPtr := add(dataPtr, 4)
                let input := mload(dataPtr)

                // write 3 bytes
                let output := add(
                    add(
                        shl(
                            18,
                            and(
                                mload(add(tablePtr, and(shr(24, input), 0xFF))),
                                0xFF
                            )
                        ),
                        shl(
                            12,
                            and(
                                mload(add(tablePtr, and(shr(16, input), 0xFF))),
                                0xFF
                            )
                        )
                    ),
                    add(
                        shl(
                            6,
                            and(
                                mload(add(tablePtr, and(shr(8, input), 0xFF))),
                                0xFF
                            )
                        ),
                        and(mload(add(tablePtr, and(input, 0xFF))), 0xFF)
                    )
                )
                mstore(resultPtr, shl(232, output))
                resultPtr := add(resultPtr, 3)
            }
        }

        return result;
    }
}

File 28 of 28 : NameUtils.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.17;

/**
 * @dev Collection of utils functions related to on-chain naming
 */
library NameUtils {
    /**
     * @dev Check if the name string is valid (Alphanumeric and spaces without leading or trailing space)
     */
    function validateName(string memory str) internal pure returns (bool) {
        bytes memory b = bytes(str);
        if (b.length < 1) return false;
        if (b.length > 25) return false; // Cannot be longer than 25 characters
        if (b[0] == 0x20) return false; // Leading space
        if (b[b.length - 1] == 0x20) return false; // Trailing space

        bytes1 lastChar = b[0];

        for (uint256 i; i < b.length; i++) {
            bytes1 char = b[i];

            if (char == 0x20 && lastChar == 0x20) return false; // Cannot contain continous spaces

            if (
                !(char >= 0x30 && char <= 0x39) && //9-0
                !(char >= 0x41 && char <= 0x5A) && //A-Z
                !(char >= 0x61 && char <= 0x7A) && //a-z
                !(char == 0x20) //space
            ) return false;

            lastChar = char;
        }

        return true;
    }

    /**
     * @dev Converts the string to lowercase
     */
    function toLower(string memory str) internal pure returns (string memory) {
        bytes memory bStr = bytes(str);
        bytes memory bLower = new bytes(bStr.length);
        for (uint256 i = 0; i < bStr.length; i++) {
            // Uppercase character
            if ((uint8(bStr[i]) >= 65) && (uint8(bStr[i]) <= 90)) {
                bLower[i] = bytes1(uint8(bStr[i]) + 32);
            } else {
                bLower[i] = bStr[i];
            }
        }
        return string(bLower);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes32[3]","name":"_merkleRoots","type":"bytes32[3]"},{"internalType":"uint256[3]","name":"_prices","type":"uint256[3]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","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":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"newName","type":"string"}],"name":"NameChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"evolvedTokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"soulTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Resurrect","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"toEvolveId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"toSoulId","type":"uint256"},{"indexed":false,"internalType":"address","name":"caller","type":"address"}],"name":"Sacrificed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tradeId","type":"uint256"},{"indexed":true,"internalType":"address","name":"tradeCloser","type":"address"}],"name":"TradeCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tradeId","type":"uint256"},{"indexed":true,"internalType":"address","name":"tradeOpener","type":"address"},{"indexed":true,"internalType":"address","name":"tradeCloser","type":"address"}],"name":"TradeExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tradeId","type":"uint256"},{"indexed":true,"internalType":"address","name":"tradeOpener","type":"address"},{"indexed":false,"internalType":"uint256","name":"openingTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"closingTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiryDate","type":"uint256"}],"name":"TradeOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"EVOLVED_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INITIAL_ALLOTMENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_NFT_SUPPLY","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":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REVEAL_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SALE_START_TIMESTAMP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tradeId","type":"uint256"}],"name":"cancelTrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"newName","type":"string"}],"name":"changeName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"phase","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"changePhaseSettng","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"defaultImageURI","type":"string"},{"internalType":"string","name":"evolvedImageURI","type":"string"},{"internalType":"string","name":"soulImageURI","type":"string"},{"internalType":"string","name":"placeholderURI","type":"string"}],"name":"changeURIs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"checkWhiteListMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAll","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultImageIPFSURIPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emissionEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emissionPerDay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"emissionStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"evolvedImageIPFSURIPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tradeId","type":"uint256"}],"name":"executeTrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalizeStartingIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getAccumulated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccumulatedAll","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getLastClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTradeCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"nameString","type":"string"}],"name":"isNameReserved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tradeId","type":"uint256"}],"name":"isTradeExecutable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfNfts","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintedForPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"multiplierFromState","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":"nameChangeEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nameChangePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"openingTokenId","type":"uint256"},{"internalType":"uint256","name":"closingTokenId","type":"uint256"},{"internalType":"uint256","name":"expiryDate","type":"uint256"}],"name":"openNewTrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"placeholderImageIPFSURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IMonsutaRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"evolvedTokenId","type":"uint256"},{"internalType":"uint256","name":"soulTokenId","type":"uint256"}],"name":"resurrect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resurrectPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"toEvolveId","type":"uint256"},{"internalType":"uint256","name":"toSoulId","type":"uint256"}],"name":"sacrifice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sacrificePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"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":"uint256","name":"newPhase","type":"uint256"}],"name":"setCurrentPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setNameChangePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_omen","type":"address"}],"name":"setOmen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setResurrectPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setSacrificePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"soulImageIPFSURIPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startingIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startingIndexBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"toggleNameChangeEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenNameByIndex","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenState","outputs":[{"internalType":"enum Monsuta.MonsutaState","name":"","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":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"trades","outputs":[{"internalType":"uint256","name":"tradeId","type":"uint256"},{"internalType":"uint256","name":"openingTokenId","type":"uint256"},{"internalType":"uint256","name":"closingTokenId","type":"uint256"},{"internalType":"uint256","name":"expiryDate","type":"uint256"},{"internalType":"address","name":"tradeOpener","type":"address"},{"internalType":"address","name":"tradeCloser","type":"address"},{"internalType":"bool","name":"active","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"wlPriceForPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

681b1ae4d6e2ef500000600e55680d8d726b7177a80000600f556828a857425466f800006010556016805460ff1916905560a060405260006080908152601b906200004b908262000453565b50604080516020810190915260008152601c906200006a908262000453565b50604080516020810190915260008152601d9062000089908262000453565b5060405180606001604052806035815260200162005c6d60359139601e90620000b3908262000453565b50348015620000c157600080fd5b5060405162005ca238038062005ca2833981016040819052620000e4916200054a565b733cc6cdda760b79bafa08df41ecfa224f810dceb66001604051806040016040528060078152602001664d6f6e7375746160c81b815250604051806040016040528060078152602001664d6f6e7375746160c81b81525081600290816200014c919062000453565b5060036200015b828262000453565b505060008055506200016d336200035c565b60016009556daaeb6d7670e522a718067333cd4e3b15620002b75780156200020557604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015620001e657600080fd5b505af1158015620001fb573d6000803e3d6000fd5b50505050620002b7565b6001600160a01b03821615620002565760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401620001cb565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200029d57600080fd5b505af1158015620002b2573d6000803e3d6000fd5b505050505b506003905060005b816001600160401b03168110156200035257838160038110620002e657620002e662000607565b6020020151600b6000620002fc8460016200061d565b815260208101919091526040016000205582816003811062000322576200032262000607565b6020020151600c6000620003388460016200061d565b8152602081019190915260400160002055600101620002bf565b5050505062000645565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620003d957607f821691505b602082108103620003fa57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200044e57600081815260208120601f850160051c81016020861015620004295750805b601f850160051c820191505b818110156200044a5782815560010162000435565b5050505b505050565b81516001600160401b038111156200046f576200046f620003ae565b6200048781620004808454620003c4565b8462000400565b602080601f831160018114620004bf5760008415620004a65750858301515b600019600386901b1c1916600185901b1785556200044a565b600085815260208120601f198616915b82811015620004f057888601518255948401946001909101908401620004cf565b50858210156200050f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604051606081016001600160401b0381118282101715620005445762000544620003ae565b60405290565b60008060c083850312156200055e57600080fd5b83601f8401126200056e57600080fd5b620005786200051f565b8060608501868111156200058b57600080fd5b855b81811015620005a75780518452602093840193016200058d565b5081945086607f870112620005bb57600080fd5b620005c56200051f565b925082915060c0860187811115620005dc57600080fd5b5b80821015620005fa578151845260209384019390910190620005dd565b5093969095509350505050565b634e487b7160e01b600052603260045260246000fd5b808201808211156200063f57634e487b7160e01b600052601160045260246000fd5b92915050565b61561880620006556000396000f3fe60806040526004361061043d5760003560e01c80637d3e1ee41161022f578063b88d4fde11610139578063d1d838d3116100b6578063e36d64981161007a578063e36d649814610d2d578063e985e9c514610d43578063ee068c7d14610d8c578063f2fde38b14610dac578063f75acb6014610dcc57600080fd5b8063d1d838d314610c95578063d5b20f2d14610cc2578063d6fc765d14610ce2578063d70540ad14610d02578063e1dba5cc14610d1757600080fd5b8063c483b015116100fd578063c483b01514610bff578063c87b56dd14610c15578063cb774d4714610c35578063cdde120914610c4b578063d1058e5914610c8057600080fd5b8063b88d4fde14610b64578063ba41b0c614610b84578063c002d23d14610b97578063c23dc68f14610bb2578063c39cbef114610bdf57600080fd5b806399a2557a116101c7578063aa1eaea11161018b578063aa1eaea114610adb578063adf2131b14610afb578063b5077f4414610b11578063b551b82f14610b27578063b868870e14610b4457600080fd5b806399a2557a14610a515780639faaf6af14610a71578063a22cb46514610a86578063a3031b7714610aa6578063a91ee0dc14610abb57600080fd5b80637d3e1ee41461093c5780638368909c1461095c5780638462151c1461097457806384a1b902146109a15780638da5cb5b146109c157806391716d05146109df578063946807fd1461077157806395d89b41146109ff5780639745cc3d14610a1457600080fd5b80633a55355b1161034b5780636352211e116102c857806374df39c91161028c57806374df39c9146108b2578063793a9374146108c75780637b103999146108e75780637b25e04c146109075780637c69e2071461092757600080fd5b80636352211e1461082857806369202233146108485780636d5224181461085d57806370a082311461087d578063715018a61461089d57600080fd5b8063513da9481161030f578063513da948146107715780635334f13b146107895780635b703558146107a95780635bbb2177146107c35780635ecedfc9146107f057600080fd5b80633a55355b146106e45780633ccfd60b1461070457806341f434341461071957806342842e0e1461073b57806345ca77381461075b57600080fd5b806315bc0c8b116103d957806323b872dd1161039d57806323b872dd146106475780632895bf7d1461066757806329ca18fc146106875780632ccde4f6146106a7578063367df165146106c757600080fd5b806315bc0c8b1461058157806318160ddd146105a157806318e20a38146105ba5780631e238db4146105cf5780631e6c598e146105e457600080fd5b806301ffc9a71461044257806302d2838b14610477578063055ad42e1461049957806306fdde03146104bd578063081812fc146104df578063095ea7b31461050c57806309ec6cc71461052c57806312ef80ed1461054c57806315b56d1014610561575b600080fd5b34801561044e57600080fd5b5061046261045d366004614859565b610de1565b60405190151581526020015b60405180910390f35b34801561048357600080fd5b50610497610492366004614876565b610df2565b005b3480156104a557600080fd5b506104af600a5481565b60405190815260200161046e565b3480156104c957600080fd5b506104d2611103565b60405161046e91906148df565b3480156104eb57600080fd5b506104ff6104fa366004614876565b611195565b60405161046e91906148f2565b34801561051857600080fd5b50610497610527366004614922565b6111d9565b34801561053857600080fd5b50610497610547366004614876565b6111f2565b34801561055857600080fd5b506104af600381565b34801561056d57600080fd5b5061046261057c366004614a17565b6114b0565b34801561058d57600080fd5b5061049761059c366004614876565b6114e3565b3480156105ad57600080fd5b50600154600054036104af565b3480156105c657600080fd5b506104af6114f0565b3480156105db57600080fd5b506104d2611504565b3480156105f057600080fd5b506106046105ff366004614876565b611592565b6040805197885260208801969096529486019390935260608501919091526001600160a01b0390811660808501521660a0830152151560c082015260e00161046e565b34801561065357600080fd5b50610497610662366004614a4b565b6115f1565b34801561067357600080fd5b506104af610682366004614a87565b61161c565b34801561069357600080fd5b506104626106a2366004614876565b6116db565b3480156106b357600080fd5b506104d26106c2366004614876565b611796565b3480156106d357600080fd5b506104af681b1ae4d6e2ef50000081565b3480156106f057600080fd5b506104af6106ff366004614876565b611891565b34801561071057600080fd5b5061049761194e565b34801561072557600080fd5b506104ff6daaeb6d7670e522a718067333cd4e81565b34801561074757600080fd5b50610497610756366004614a4b565b6119a7565b34801561076757600080fd5b506104af600e5481565b34801561077d57600080fd5b506104af6363e64de081565b34801561079557600080fd5b506104976107a4366004614876565b6119cc565b3480156107b557600080fd5b506016546104629060ff1681565b3480156107cf57600080fd5b506107e36107de366004614aed565b6119d9565b60405161046e9190614b6a565b3480156107fc57600080fd5b506104af61080b366004614922565b600d60209081526000928352604080842090915290825290205481565b34801561083457600080fd5b506104ff610843366004614876565b611a8b565b34801561085457600080fd5b506104d2611a96565b34801561086957600080fd5b506104d2610878366004614876565b611aa3565b34801561088957600080fd5b506104af610898366004614a87565b611b45565b3480156108a957600080fd5b50610497611b93565b3480156108be57600080fd5b50610497611ba7565b3480156108d357600080fd5b506104976108e2366004614a87565b611ca6565b3480156108f357600080fd5b506017546104ff906001600160a01b031681565b34801561091357600080fd5b50610497610922366004614bac565b611cfc565b34801561093357600080fd5b50610497611efd565b34801561094857600080fd5b50610497610957366004614876565b611f67565b34801561096857600080fd5b506104af63688a094081565b34801561098057600080fd5b5061099461098f366004614a87565b611faf565b60405161046e9190614bce565b3480156109ad57600080fd5b506104976109bc366004614876565b612095565b3480156109cd57600080fd5b506008546001600160a01b03166104ff565b3480156109eb57600080fd5b506104af6109fa366004614876565b6120a2565b348015610a0b57600080fd5b506104d2612118565b348015610a2057600080fd5b50610a44610a2f366004614876565b601a6020526000908152604090205460ff1681565b60405161046e9190614c1c565b348015610a5d57600080fd5b50610994610a6c366004614c44565b612127565b348015610a7d57600080fd5b506104d261229e565b348015610a9257600080fd5b50610497610aa1366004614c85565b6122ab565b348015610ab257600080fd5b506019546104af565b348015610ac757600080fd5b50610497610ad6366004614a87565b6122bf565b348015610ae757600080fd5b50610497610af6366004614bac565b61230f565b348015610b0757600080fd5b506104af60135481565b348015610b1d57600080fd5b506104af6122b881565b348015610b3357600080fd5b506104af68015af1d78b58c4000081565b348015610b5057600080fd5b50610497610b5f366004614cbc565b61249d565b348015610b7057600080fd5b50610497610b7f366004614ce8565b6124c3565b610497610b92366004614d63565b6124f0565b348015610ba357600080fd5b506104af66d19c2ff9bf800081565b348015610bbe57600080fd5b50610bd2610bcd366004614876565b6127f8565b60405161046e9190614dae565b348015610beb57600080fd5b50610497610bfa366004614dbc565b61283b565b348015610c0b57600080fd5b506104af600f5481565b348015610c2157600080fd5b506104d2610c30366004614876565b612b68565b348015610c4157600080fd5b506104af60125481565b348015610c5757600080fd5b50610c6b610c66366004614e02565b612e0d565b6040805192835260208301919091520161046e565b348015610c8c57600080fd5b506104af612f08565b348015610ca157600080fd5b506104af610cb0366004614876565b600c6020526000908152604090205481565b348015610cce57600080fd5b506104af610cdd366004614876565b6130e9565b348015610cee57600080fd5b50610497610cfd366004614e3b565b613147565b348015610d0e57600080fd5b506104d2613182565b348015610d2357600080fd5b506104af60105481565b348015610d3957600080fd5b506104af60115481565b348015610d4f57600080fd5b50610462610d5e366004614edb565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610d9857600080fd5b50610497610da7366004614cbc565b61318f565b348015610db857600080fd5b50610497610dc7366004614a87565b613410565b348015610dd857600080fd5b50610497613489565b6000610dec826134a5565b92915050565b600060198281548110610e0757610e07614f0e565b60009182526020918290206040805160e081018252600693909302909101805483526001810154938301939093526002830154908201526003820154606082015260048201546001600160a01b03908116608083015260059092015491821660a0820152600160a01b90910460ff16151560c08201819052909150610ec35760405162461bcd60e51b815260206004820152600d60248201526c2161637469766520747261646560981b60448201526064015b60405180910390fd5b42816060015111610f005760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610eba565b60026040808301516000908152601a602052205460ff166002811115610f2857610f28614c06565b03610f455760405162461bcd60e51b8152600401610eba90614f24565b336001600160a01b0316610f5c8260400151611a8b565b6001600160a01b031614610fac5760405162461bcd60e51b815260206004820152601760248201527610b7bbb732b91037b31031b637b9b4b733903a37b5b2b760491b6044820152606401610eba565b610fbf81608001513383602001516134f3565b610fd233826080015183604001516134f3565b6040518060e001604052808260000151815260200182602001518152602001826040015181526020018260600151815260200182608001516001600160a01b03168152602001336001600160a01b03168152602001600015158152506019838154811061104157611041614f0e565b60009182526020808320845160069093020191825583015160018201556040808401516002830155606084015160038301556080808501516004840180546001600160a01b039283166001600160a01b031990911617905560a08601516005909401805460c0909701511515600160a01b026001600160a81b031990971694821694909417959095179092559084015184519151339491909116927f4d16bcd970ae0d8ad8871781ba650086db49df05d8ead538c980797d0d9235f991a45050565b60606002805461111290614f47565b80601f016020809104026020016040519081016040528092919081815260200182805461113e90614f47565b801561118b5780601f106111605761010080835404028352916020019161118b565b820191906000526020600020905b81548152906001019060200180831161116e57829003601f168201915b5050505050905090565b60006111a08261363b565b6111bd576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b816111e381613662565b6111ed8383613712565b505050565b60006019828154811061120757611207614f0e565b60009182526020918290206040805160e0810182526006909302909101805483526001810154938301939093526002830154908201526003820154606082015260048201546001600160a01b039081166080830181905260059093015490811660a083015260ff600160a01b90910416151560c0820152915033146112b85760405162461bcd60e51b815260206004820152600760248201526610b7b832b732b960c91b6044820152606401610eba565b60a08101516001600160a01b0316156113295760405162461bcd60e51b815260206004820152602d60248201527f7472616465436c6f7365722063616e277420616c7265616479206265206e6f6e60448201526c2d7a65726f206164647265737360981b6064820152608401610eba565b428160600151116113885760405162461bcd60e51b815260206004820152602360248201527f74726164652e65787069727944617465203c3d20626c6f636b2e74696d6573746044820152620616d760ec1b6064820152608401610eba565b6040518060e001604052808260000151815260200182602001518152602001826040015181526020018260600151815260200182608001516001600160a01b03168152602001336001600160a01b0316815260200160001515815250601983815481106113f7576113f7614f0e565b600091825260208083208451600690930201918255830151600182015560408084015160028301556060840151600383015560808401516004830180546001600160a01b039283166001600160a01b031990911617905560a08501516005909301805460c0909601511515600160a01b026001600160a81b031990961693909116929092179390931790559051339184917f68bbfaa8a985659b13e3f23ffac8fc9039d6ca60199cd9327817cb0cc03eb8769190a35050565b600060156114bd836137b2565b6040516114ca9190614f7b565b9081526040519081900360200190205460ff1692915050565b6114eb613914565b600f55565b6115016363e64de06203f480614fad565b81565b601b805461151190614f47565b80601f016020809104026020016040519081016040528092919081815260200182805461153d90614f47565b801561158a5780601f1061155f5761010080835404028352916020019161158a565b820191906000526020600020905b81548152906001019060200180831161156d57829003601f168201915b505050505081565b601981815481106115a257600080fd5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154939550919390926001600160a01b0391821691811690600160a01b900460ff1687565b826001600160a01b038116331461160b5761160b33613662565b61161684848461396e565b50505050565b60006363e64de0421161163157506000919050565b600061163c83611b45565b90508060000361164f5750600092915050565b6000808061165b61481c565b60005b8584146116cf5761166e816139c5565b915081604001516116c75781516001600160a01b03161561168e57815192505b876001600160a01b0316836001600160a01b0316036116c75760019093019260006116b882611891565b905080156116c557948501945b505b60010161165e565b50929695505050505050565b600080601983815481106116f1576116f1614f0e565b60009182526020918290206040805160e0810182526006939093029091018054835260018101549383019390935260028301549082015260038201546060820181905260048301546001600160a01b03908116608084015260059093015492831660a0830152600160a01b90920460ff16151560c0820152915042111561177b5750600092915050565b8060c0015161178d5750600092915050565b50600192915050565b6000818152601a602052604081205460609160ff909116908160028111156117c0576117c0614c06565b0361185857601b80546117d290614f47565b80601f01602080910402602001604051908101604052809291908181526020018280546117fe90614f47565b801561184b5780601f106118205761010080835404028352916020019161184b565b820191906000526020600020905b81548152906001019060200180831161182e57829003601f168201915b5050505050915050919050565b600181600281111561186c5761186c614c06565b0361187e57601c80546117d290614f47565b601d80546117d290614f47565b50919050565b60006363e64de042116118a657506000919050565b60006118b1836120a2565b905063688a094081106118c75750600092915050565b600063688a094042106118de5763688a09406118e0565b425b90506000620151806118f1866130e9565b68015af1d78b58c400006119058686614fc0565b61190f9190614fd3565b6119199190614fd3565b6119239190615000565b90506363e64de0830361194657611943681b1ae4d6e2ef50000082614fad565b90505b949350505050565b611956613914565b476000606461196683600f614fd3565b6119709190615000565b905061199073fed505c80b72cdca5f72292d4bf1d6194cf23669826139e5565b6119a33361199e8385614fc0565b6139e5565b5050565b826001600160a01b03811633146119c1576119c133613662565b611616848484613afe565b6119d4613914565b601055565b6060816000816001600160401b038111156119f6576119f661494c565b604051908082528060200260200182016040528015611a2f57816020015b611a1c61481c565b815260200190600190039081611a145790505b50905060005b828114611a8257611a5d868683818110611a5157611a51614f0e565b905060200201356127f8565b828281518110611a6f57611a6f614f0e565b6020908102919091010152600101611a35565b50949350505050565b6000610dec82613b19565b601d805461151190614f47565b6000818152601460205260409020805460609190611ac090614f47565b80601f0160208091040260200160405190810160405280929190818152602001828054611aec90614f47565b8015611b395780601f10611b0e57610100808354040283529160200191611b39565b820191906000526020600020905b815481529060010190602001808311611b1c57829003601f168201915b50505050509050919050565b60006001600160a01b038216611b6e576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b611b9b613914565b611ba56000613b80565b565b60125415611bf75760405162461bcd60e51b815260206004820152601d60248201527f5374617274696e6720696e64657820697320616c7265616479207365740000006044820152606401610eba565b600060115411611c495760405162461bcd60e51b815260206004820181905260248201527f5374617274696e6720696e64657820626c6f636b206d757374206265207365746044820152606401610eba565b60ff60115443611c599190614fc0565b1115611c80576122b8611c6d600143614fc0565b611c78919040615014565b601255611c95565b601154611c91906122b89040615014565b6012555b601254600003611ba5576001601255565b611cae613914565b6001600160a01b038116611cd45760405162461bcd60e51b8152600401610eba90615028565b601680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b8133611d0782611a8b565b6001600160a01b031614611d2d5760405162461bcd60e51b8152600401610eba9061504f565b8133611d3882611a8b565b6001600160a01b031614611d5e5760405162461bcd60e51b8152600401610eba9061504f565b600060125411611da45760405162461bcd60e51b81526020600482015260116024820152701bdb9b1e4818599d195c881c995d99585b607a1b6044820152606401610eba565b6000848152601a602052604081205460ff166002811115611dc757611dc7614c06565b14611e0d5760405162461bcd60e51b815260206004820152601660248201527508595d9bdb1d9a5b99c81a5d195b48191959985d5b1d60521b6044820152606401610eba565b6000838152601a602052604081205460ff166002811115611e3057611e30614c06565b14611e725760405162461bcd60e51b8152602060048201526012602482015271085cdbdd5b081a5d195b48191959985d5b1d60721b6044820152606401610eba565b6000848152601a6020526040808220805460ff19908116600117909155858352912080549091166002179055600f54611eac903390613bd2565b611eb584613c56565b611ebe83613c56565b82847f8db0a45188fb388358a12efee9165c0721142258d470a99c8efa5383a7859b3c33604051611eef91906148f2565b60405180910390a350505050565b611f05613914565b600160135410611f445760405162461bcd60e51b815260206004820152600a6024820152691b5a5b9d195908185b1b60b21b6044820152606401610eba565b6001601381905550611ba533600160405180602001604052806000815250613ccc565b611f6f613914565b80600a5403611faa5760405162461bcd60e51b8152602060048201526007602482015266616c726561647960c81b6044820152606401610eba565b600a55565b60606000806000611fbf85611b45565b90506000816001600160401b03811115611fdb57611fdb61494c565b604051908082528060200260200182016040528015612004578160200160208202803683370190505b50905061200f61481c565b60005b83861461208957612022816139c5565b915081604001516120815781516001600160a01b03161561204257815194505b876001600160a01b0316856001600160a01b031603612081578083878060010198508151811061207457612074614f0e565b6020026020010181815250505b600101612012565b50909695505050505050565b61209d613914565b600e55565b60006120ad8261363b565b6120e25760405162461bcd60e51b815260206004820152600660248201526508595e1a5cdd60d21b6044820152606401610eba565b6000828152601860205260408120548103612101576363e64de0612111565b6000838152601860205260409020545b9392505050565b60606003805461111290614f47565b606081831061214957604051631960ccad60e11b815260040160405180910390fd5b60008061215560005490565b905080841115612163578093505b600061216e87611b45565b90508486101561218d5785850381811015612187578091505b50612191565b5060005b6000816001600160401b038111156121ab576121ab61494c565b6040519080825280602002602001820160405280156121d4578160200160208202803683370190505b509050816000036121ea57935061211192505050565b60006121f5886127f8565b905060008160400151612206575080515b885b8881141580156122185750848714155b1561228d57612226816139c5565b925082604001516122855782516001600160a01b03161561224657825191505b8a6001600160a01b0316826001600160a01b031603612285578084888060010199508151811061227857612278614f0e565b6020026020010181815250505b600101612208565b505050928352509095945050505050565b601e805461151190614f47565b816122b581613662565b6111ed8383613d32565b6122c7613914565b6001600160a01b0381166122ed5760405162461bcd60e51b8152600401610eba90615028565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b813361231a82611a8b565b6001600160a01b0316146123405760405162461bcd60e51b8152600401610eba9061504f565b813361234b82611a8b565b6001600160a01b0316146123715760405162461bcd60e51b8152600401610eba9061504f565b60026000848152601a602052604090205460ff16600281111561239657612396614c06565b146123cb5760405162461bcd60e51b8152602060048201526005602482015264085cdbdd5b60da1b6044820152606401610eba565b60016000858152601a602052604090205460ff1660028111156123f0576123f0614c06565b146124285760405162461bcd60e51b815260206004820152600860248201526708595d9bdb1d995960c21b6044820152606401610eba565b6000848152601a6020526040808220805460ff1990811690915585835291208054909116905561245783613c56565b61246084613c56565b61246c33601054613bd2565b82847f53b276ee76ababff76e2737881ee01288f2c37ede62c845e01d5b014f8c7c27d33604051611eef91906148f2565b6124a5613914565b6000928352600b6020908152604080852093909355600c9052912055565b836001600160a01b03811633146124dd576124dd33613662565b6124e985858585613d9e565b5050505050565b6002600954036125425760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eba565b60026009556122b86125576001546000540390565b1061259d5760405162461bcd60e51b815260206004820152601660248201527514d85b19481a185cc8185b1c9958591e48195b99195960521b6044820152606401610eba565b6000600a54116125e05760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a5cc81c185d5cd95960921b6044820152606401610eba565b6363e64de042116126215760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081cdd185c9d195960aa1b6044820152606401610eba565b6000831180156126315750600683105b6126745760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964206e756d6265724f664e66747360601b6044820152606401610eba565b6122b8836126856001546000540390565b61268f9190614fad565b11156126d25760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b6044820152606401610eba565b6000806126e0338585612e0d565b9092509050811561271d57336000908152600d60209081526040808320600a54845290915281208054849290612717908490614fad565b90915550505b34816127298488614fc0565b61273a9066d19c2ff9bf8000614fd3565b6127449190614fad565b146127915760405162461bcd60e51b815260206004820152601f60248201527f45746865722076616c75652073656e74206973206e6f7420636f7272656374006044820152606401610eba565b6127ab338660405180602001604052806000815250613ccc565b6011541580156127e257506122b86127c66001546000540390565b14806127e257506127de6363e64de06203f480614fad565b4210155b156127ec57436011555b50506001600955505050565b61280061481c565b61280861481c565b60005483106128175792915050565b612820836139c5565b90508060400151156128325792915050565b61211183613de2565b813361284682611a8b565b6001600160a01b03161461286c5760405162461bcd60e51b8152600401610eba9061504f565b60165460ff166128aa5760405162461bcd60e51b815260206004820152600960248201526864697361626c65642160b81b6044820152606401610eba565b6128b382613dfb565b15156001146128f95760405162461bcd60e51b81526020600482015260126024820152716e6f742076616c6964206e6577206e616d6560701b6044820152606401610eba565b600083815260146020526040908190209051600291612917916150ee565b602060405180830381855afa158015612934573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061295791906150fa565b6002836040516129679190614f7b565b602060405180830381855afa158015612984573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906129a791906150fa565b036129ee5760405162461bcd60e51b815260206004820152601760248201527673616d65206173207468652063757272656e74206f6e6560481b6044820152606401610eba565b6129f7826114b0565b15612a375760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481c995cd95c9d995960821b6044820152606401610eba565b60008381526014602052604081208054612a5090614f47565b90501115612afb5760008381526014602052604090208054612afb9190612a7690614f47565b80601f0160208091040260200160405190810160405280929190818152602001828054612aa290614f47565b8015612aef5780601f10612ac457610100808354040283529160200191612aef565b820191906000526020600020905b815481529060010190602001808311612ad257829003601f168201915b50505050506000614006565b612b06826001614006565b6000838152601460205260409020612b1e8382615159565b50612b2b33600e54613bd2565b827f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b83604051612b5b91906148df565b60405180910390a2505050565b6060612b738261363b565b612bbf5760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610eba565b60408051808201825260018152601160f91b60208083019190915260008581526014909152919091208054612bf390614f47565b159050612c2f576000838152601460209081526040918290209151612c19929101615218565b6040516020818303038152906040529050612c5a565b612c3883614043565b604051602001612c489190615235565b60405160208183030381529060405290505b601254600003612cb657612c8f81601e604051602001612c7b929190615271565b604051602081830303815290604052614143565b604051602001612c9f9190615301565b604051602081830303815290604052915050919050565b60006122b860125485612cc99190614fad565b612cd39190615014565b90506060612ce085611796565b612ce983614043565b604051602001612cfa929190615346565b60408051601f1981840301815290829052612d1791602001615384565b60408051601f198184030181529181526017546000888152601a6020529190912054919250612de49185916001600160a01b03169063a3161dba90899060ff166002811115612d6857612d68614c06565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612da9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612dd191908101906153b9565b83604051602001612c7b9392919061542f565b604051602001612df49190615301565b6040516020818303038152906040529350505050919050565b600a546000908152600b602052604081205481908015801590612e2f57508315155b15612ef7576001600160a01b0386166000908152600d60209081526040808320600a54845290915290205460011115612ef757612ed5858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516bffffffffffffffffffffffff1960608c901b1660208201528592506034019050604051602081830303815290604052805190602001206142a7565b15612ef7575050600a546000908152600c602052604090205460019150612f00565b60008092509250505b935093915050565b600080612f1433611b45565b905060008111612f555760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2062616c616e636560a01b6044820152606401610eba565b6363e64de04211612fa85760405162461bcd60e51b815260206004820152601c60248201527f456d697373696f6e20686173206e6f74207374617274656420796574000000006044820152606401610eba565b60008080612fb461481c565b60005b85841461303057612fc7816139c5565b915081604001516130285781516001600160a01b031615612fe757815192505b336001600160a01b0384160361302857600190930192600061300882611891565b90508015613026576000828152601860205260409020429055948501945b505b600101612fb7565b505050506000811161307a5760405162461bcd60e51b815260206004820152601360248201527227379030b1b1bab6bab630ba32b21027b6b2b760691b6044820152606401610eba565b6016546040516340c10f1960e01b8152336004820152602481018390526101009091046001600160a01b0316906340c10f1990604401600060405180830381600087803b1580156130ca57600080fd5b505af11580156130de573d6000803e3d6000fd5b509295945050505050565b6000818152601a602052604081205460ff168181600281111561310e5761310e614c06565b0361311c5750600192915050565b600181600281111561313057613130614c06565b0361313e5750600392915050565b50600092915050565b61314f613914565b601b61315b8582615159565b50601c6131688482615159565b50601d6131758382615159565b50601e6124e98282615159565b601c805461151190614f47565b823361319a82611a8b565b6001600160a01b0316146131c05760405162461bcd60e51b8152600401610eba9061504f565b42821161320f5760405162461bcd60e51b815260206004820152601d60248201527f65787069727944617465203c3d20626c6f636b2e74696d657374616d700000006044820152606401610eba565b60026000858152601a602052604090205460ff16600281111561323457613234614c06565b036132515760405162461bcd60e51b8152600401610eba90614f24565b601980546040805160e081018252828152602080820189815282840189815260608085018a81523360808701818152600060a08901818152600160c08b01818152908d018e559c909152975160068b027f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969581019190915595517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969687015593517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969786015590517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969885015591517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9699840180546001600160a01b039283166001600160a01b031990911617905594517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969a909301805498511515600160a01b026001600160a81b0319909916939095169290921796909617909255825189815290810188905291820186905291929183917fac37cec9b9d12e2f430079b73359fc83d205d90a5b307ac7fc059ac552465273910160405180910390a35050505050565b613418613914565b6001600160a01b03811661347d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610eba565b61348681613b80565b50565b613491613914565b6016805460ff19811660ff90911615179055565b60006301ffc9a760e01b6001600160e01b0319831614806134d657506380ac58cd60e01b6001600160e01b03198316145b80610dec5750506001600160e01b031916635b5e139f60e01b1490565b60006134fe82613b19565b9050836001600160a01b0316816001600160a01b0316146135315760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03831661355857604051633a954ecd60e21b815260040160405180910390fd5b61356584848460016142bd565b600082815260066020908152604080832080546001600160a01b03191690556001600160a01b03878116845260058352818420805460001901905586168084528184208054600101905585845260049092528220600160e11b4260a01b9092178217905582169003613607576001820160008181526004602052604081205490036136055760005481146136055760008181526004602052604090208290555b505b81836001600160a01b0316856001600160a01b03166000805160206155c383398151915260405160405180910390a4611616565b6000805482108015610dec575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b1561348657604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156136cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136f391906154d9565b6134865780604051633b79c77360e21b8152600401610eba91906148f2565b600061371d82611a8b565b9050336001600160a01b03821614613756576137398133610d5e565b613756576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60606000829050600081516001600160401b038111156137d4576137d461494c565b6040519080825280601f01601f1916602001820160405280156137fe576020820181803683370190505b50905060005b825181101561390c57604183828151811061382157613821614f0e565b016020015160f81c108015906138515750605a83828151811061384657613846614f0e565b016020015160f81c11155b156138b35782818151811061386857613868614f0e565b602001015160f81c60f81b60f81c602061388291906154f6565b60f81b82828151811061389757613897614f0e565b60200101906001600160f81b031916908160001a9053506138fa565b8281815181106138c5576138c5614f0e565b602001015160f81c60f81b8282815181106138e2576138e2614f0e565b60200101906001600160f81b031916908160001a9053505b806139048161550f565b915050613804565b509392505050565b6008546001600160a01b03163314611ba55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eba565b600081815260066020526040902054338082146001600160a01b038616909114176139ba5761399d8433610d5e565b6139ba57604051632ce44b5f60e11b815260040160405180910390fd5b6116168484846134f3565b6139cd61481c565b600082815260046020526040902054610dec90614356565b80471015613a355760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610eba565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613a82576040519150601f19603f3d011682016040523d82523d6000602084013e613a87565b606091505b50509050806111ed5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610eba565b6111ed838383604051806020016040528060008152506124c3565b600081600054811015613b675760008181526004602052604081205490600160e01b82169003613b65575b80600003612111575060001901600081815260046020526040902054613b44565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601654613bef9061010090046001600160a01b0316833084614399565b601654604051630852cd8d60e31b8152600481018390526101009091046001600160a01b0316906342966c68906024015b600060405180830381600087803b158015613c3a57600080fd5b505af1158015613c4e573d6000803e3d6000fd5b505050505050565b6000613c6182611891565b905080156119a357600082815260186020526040902042905560165461010090046001600160a01b03166340c10f19613c9984611a8b565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401613c20565b613cd683836143f3565b6001600160a01b0383163b156111ed576000548281035b613d0060008683806001019450866144da565b613d1d576040516368d2bf6b60e11b815260040160405180910390fd5b818110613ced5781600054146124e957600080fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b613da98484846115f1565b6001600160a01b0383163b1561161657613dc5848484846144da565b611616576040516368d2bf6b60e11b815260040160405180910390fd5b613dea61481c565b610dec613df683613b19565b614356565b600080829050600181511015613e145750600092915050565b601981511115613e275750600092915050565b80600081518110613e3a57613e3a614f0e565b01602001516001600160f81b031916600160fd1b03613e5c5750600092915050565b8060018251613e6b9190614fc0565b81518110613e7b57613e7b614f0e565b01602001516001600160f81b031916600160fd1b03613e9d5750600092915050565b600081600081518110613eb257613eb2614f0e565b01602001516001600160f81b031916905060005b8251811015613ffb576000838281518110613ee357613ee3614f0e565b01602001516001600160f81b0319169050600160fd1b81148015613f145750600160fd1b6001600160f81b03198416145b15613f255750600095945050505050565b600360fc1b6001600160f81b0319821610801590613f515750603960f81b6001600160f81b0319821611155b158015613f875750604160f81b6001600160f81b0319821610801590613f855750602d60f91b6001600160f81b0319821611155b155b8015613fbc5750606160f81b6001600160f81b0319821610801590613fba5750603d60f91b6001600160f81b0319821611155b155b8015613fd65750600160fd1b6001600160f81b0319821614155b15613fe75750600095945050505050565b915080613ff38161550f565b915050613ec6565b506001949350505050565b806015614012846137b2565b60405161401f9190614f7b565b908152604051908190036020019020805491151560ff199092169190911790555050565b60608160000361406a5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115614094578061407e8161550f565b915061408d9050600a83615000565b915061406e565b6000816001600160401b038111156140ae576140ae61494c565b6040519080825280601f01601f1916602001820160405280156140d8576020820181803683370190505b5090505b8415611946576140ed600183614fc0565b91506140fa600a86615014565b614105906030614fad565b60f81b81838151811061411a5761411a614f0e565b60200101906001600160f81b031916908160001a90535061413c600a86615000565b94506140dc565b6060815160000361416257505060408051602081019091526000815290565b600060405180606001604052806040815260200161558360409139905060006003845160026141919190614fad565b61419b9190615000565b6141a6906004614fd3565b905060006141b5826020614fad565b6001600160401b038111156141cc576141cc61494c565b6040519080825280601f01601f1916602001820160405280156141f6576020820181803683370190505b509050818152600183018586518101602084015b81831015614262576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f811685015182535060010161420a565b60038951066001811461427c576002811461428d57614299565b613d3d60f01b600119830152614299565b603d60f81b6000198301525b509398975050505050505050565b6000826142b485846145c5565b14949350505050565b60005b818110156124e95760006142d48285614fad565b90506001600160a01b0386161561434d576142ee81613c56565b60026000828152601a602052604090205460ff16600281111561431357614313614c06565b0361434d5760405162461bcd60e51b815260206004820152600a60248201526939b7bab6103a37b5b2b760b11b6044820152606401610eba565b506001016142c0565b61435e61481c565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261161690859061460a565b60008054908290036144185760405163b562e8dd60e01b815260040160405180910390fd5b61442560008483856142bd565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083906000805160206155c38339815191528180a4600183015b8181146144b057808360006000805160206155c3833981519152600080a460010161448a565b50816000036144d157604051622e076360e81b815260040160405180910390fd5b60005550505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061450f903390899088908890600401615528565b6020604051808303816000875af192505050801561454a575060408051601f3d908101601f1916820190925261454791810190615565565b60015b6145a8573d808015614578576040519150601f19603f3d011682016040523d82523d6000602084013e61457d565b606091505b5080516000036145a0576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b600081815b845181101561390c576145f6828683815181106145e9576145e9614f0e565b60200260200101516146dc565b9150806146028161550f565b9150506145ca565b600061465f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166147089092919063ffffffff16565b8051909150156111ed578080602001905181019061467d91906154d9565b6111ed5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610eba565b60008183106146f8576000828152602084905260409020612111565b5060009182526020526040902090565b60606119468484600085856001600160a01b0385163b61476a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610eba565b600080866001600160a01b031685876040516147869190614f7b565b60006040518083038185875af1925050503d80600081146147c3576040519150601f19603f3d011682016040523d82523d6000602084013e6147c8565b606091505b50915091506147d88282866147e3565b979650505050505050565b606083156147f2575081612111565b8251156148025782518084602001fd5b8160405162461bcd60e51b8152600401610eba91906148df565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6001600160e01b03198116811461348657600080fd5b60006020828403121561486b57600080fd5b813561211181614843565b60006020828403121561488857600080fd5b5035919050565b60005b838110156148aa578181015183820152602001614892565b50506000910152565b600081518084526148cb81602086016020860161488f565b601f01601f19169290920160200192915050565b60208152600061211160208301846148b3565b6001600160a01b0391909116815260200190565b80356001600160a01b038116811461491d57600080fd5b919050565b6000806040838503121561493557600080fd5b61493e83614906565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561498a5761498a61494c565b604052919050565b60006001600160401b038211156149ab576149ab61494c565b50601f01601f191660200190565b60006149cc6149c784614992565b614962565b90508281528383830111156149e057600080fd5b828260208301376000602084830101529392505050565b600082601f830112614a0857600080fd5b612111838335602085016149b9565b600060208284031215614a2957600080fd5b81356001600160401b03811115614a3f57600080fd5b611946848285016149f7565b600080600060608486031215614a6057600080fd5b614a6984614906565b9250614a7760208501614906565b9150604084013590509250925092565b600060208284031215614a9957600080fd5b61211182614906565b60008083601f840112614ab457600080fd5b5081356001600160401b03811115614acb57600080fd5b6020830191508360208260051b8501011115614ae657600080fd5b9250929050565b60008060208385031215614b0057600080fd5b82356001600160401b03811115614b1657600080fd5b614b2285828601614aa2565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b8181101561208957614b99838551614b2e565b9284019260809290920191600101614b86565b60008060408385031215614bbf57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b8181101561208957835183529284019291840191600101614bea565b634e487b7160e01b600052602160045260246000fd5b6020810160038310614c3e57634e487b7160e01b600052602160045260246000fd5b91905290565b600080600060608486031215614c5957600080fd5b614c6284614906565b95602085013595506040909401359392505050565b801515811461348657600080fd5b60008060408385031215614c9857600080fd5b614ca183614906565b91506020830135614cb181614c77565b809150509250929050565b600080600060608486031215614cd157600080fd5b505081359360208301359350604090920135919050565b60008060008060808587031215614cfe57600080fd5b614d0785614906565b9350614d1560208601614906565b92506040850135915060608501356001600160401b03811115614d3757600080fd5b8501601f81018713614d4857600080fd5b614d57878235602084016149b9565b91505092959194509250565b600080600060408486031215614d7857600080fd5b8335925060208401356001600160401b03811115614d9557600080fd5b614da186828701614aa2565b9497909650939450505050565b60808101610dec8284614b2e565b60008060408385031215614dcf57600080fd5b8235915060208301356001600160401b03811115614dec57600080fd5b614df8858286016149f7565b9150509250929050565b600080600060408486031215614e1757600080fd5b614e2084614906565b925060208401356001600160401b03811115614d9557600080fd5b60008060008060808587031215614e5157600080fd5b84356001600160401b0380821115614e6857600080fd5b614e74888389016149f7565b95506020870135915080821115614e8a57600080fd5b614e96888389016149f7565b94506040870135915080821115614eac57600080fd5b614eb8888389016149f7565b93506060870135915080821115614ece57600080fd5b50614d57878288016149f7565b60008060408385031215614eee57600080fd5b614ef783614906565b9150614f0560208401614906565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b602080825260099082015268736f756c206974656d60b81b604082015260600190565b600181811c90821680614f5b57607f821691505b60208210810361188b57634e487b7160e01b600052602260045260246000fd5b60008251614f8d81846020870161488f565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610dec57610dec614f97565b81810381811115610dec57610dec614f97565b8082028115828204841417610dec57610dec614f97565b634e487b7160e01b600052601260045260246000fd5b60008261500f5761500f614fea565b500490565b60008261502357615023614fea565b500690565b6020808252600d908201526c217a65726f206164647265737360981b604082015260600190565b602080825260129082015271085bdddb995c881bd9881d1bdad95b881a5960721b604082015260600190565b6000815461508881614f47565b600182811680156150a057600181146150b5576150e4565b60ff19841687528215158302870194506150e4565b8560005260208060002060005b858110156150db5781548a8201529084019082016150c2565b50505082870194505b5050505092915050565b6000612111828461507b565b60006020828403121561510c57600080fd5b5051919050565b601f8211156111ed57600081815260208120601f850160051c8101602086101561513a5750805b601f850160051c820191505b81811015613c4e57828155600101615146565b81516001600160401b038111156151725761517261494c565b615186816151808454614f47565b84615113565b602080601f8311600181146151bb57600084156151a35750858301515b600019600386901b1c1916600185901b178555613c4e565b600085815260208120601f198616915b828110156151ea578886015182559484019460019091019084016151cb565b50858210156152085787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000615224828461507b565b601160f91b81526001019392505050565b684d6f6e73757461202360b81b81526000825161525981600985016020870161488f565b601160f91b6009939091019283015250600a01919050565b693d913730b6b2911d101160b11b8152825160009061529781600a85016020880161488f565b7f2c20226465736372697074696f6e223a2022546865204d6f6e7375746120436f600a9184019182015274363632b1ba34b7b71116101134b6b0b3b2911d101160591b602a8201526152ec603f82018561507b565b6222207d60e81b815260030195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161533981601d85016020870161488f565b91909101601d0192915050565b6000835161535881846020880161488f565b83519083019061536c81836020880161488f565b632e706e6760e01b9101908152600401949350505050565b6b16101134b6b0b3b2911d101160a11b815281516000906153ac81600c85016020870161488f565b91909101600c0192915050565b6000602082840312156153cb57600080fd5b81516001600160401b038111156153e157600080fd5b8201601f810184136153f257600080fd5b80516154006149c782614992565b81815285602083850101111561541557600080fd5b61542682602083016020860161488f565b95945050505050565b693d913730b6b2911d101160b11b8152835160009061545581600a85016020890161488f565b7f2c20226465736372697074696f6e223a2022546865204d6f6e7375746120436f600a918401918201526a0363632b1ba34b7b71116160ad1b602a82015284516154a681603584016020890161488f565b84519101906154bc81603584016020880161488f565b6222207d60e81b6035929091019182015260380195945050505050565b6000602082840312156154eb57600080fd5b815161211181614c77565b60ff8181168382160190811115610dec57610dec614f97565b60006001820161552157615521614f97565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061555b908301846148b3565b9695505050505050565b60006020828403121561557757600080fd5b81516121118161484356fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220fe7ea87f162df139189d91161bbeef259192b8205bb7b3bc5d39234d73fdb87464736f6c63430008110033697066733a2f2f516d657a734135693941436e6b706b626f64357a6b4242714a436852756346476967774550576971515363664632aa2c71928d9eeeff76ca7bb1aea6ce7b294906b37e87e385d483167af3a7bf8c58e78f1a0aebdf7930c1ad063b25e6878567d6dd6be342b0e42a38946b2a848942037eae773bf8b13f2ea0ec2da46c20e49e25c8c809f963c3ee8f9ce895c70c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000000000000000000000000000000008e1bc9bf040000

Deployed Bytecode

0x60806040526004361061043d5760003560e01c80637d3e1ee41161022f578063b88d4fde11610139578063d1d838d3116100b6578063e36d64981161007a578063e36d649814610d2d578063e985e9c514610d43578063ee068c7d14610d8c578063f2fde38b14610dac578063f75acb6014610dcc57600080fd5b8063d1d838d314610c95578063d5b20f2d14610cc2578063d6fc765d14610ce2578063d70540ad14610d02578063e1dba5cc14610d1757600080fd5b8063c483b015116100fd578063c483b01514610bff578063c87b56dd14610c15578063cb774d4714610c35578063cdde120914610c4b578063d1058e5914610c8057600080fd5b8063b88d4fde14610b64578063ba41b0c614610b84578063c002d23d14610b97578063c23dc68f14610bb2578063c39cbef114610bdf57600080fd5b806399a2557a116101c7578063aa1eaea11161018b578063aa1eaea114610adb578063adf2131b14610afb578063b5077f4414610b11578063b551b82f14610b27578063b868870e14610b4457600080fd5b806399a2557a14610a515780639faaf6af14610a71578063a22cb46514610a86578063a3031b7714610aa6578063a91ee0dc14610abb57600080fd5b80637d3e1ee41461093c5780638368909c1461095c5780638462151c1461097457806384a1b902146109a15780638da5cb5b146109c157806391716d05146109df578063946807fd1461077157806395d89b41146109ff5780639745cc3d14610a1457600080fd5b80633a55355b1161034b5780636352211e116102c857806374df39c91161028c57806374df39c9146108b2578063793a9374146108c75780637b103999146108e75780637b25e04c146109075780637c69e2071461092757600080fd5b80636352211e1461082857806369202233146108485780636d5224181461085d57806370a082311461087d578063715018a61461089d57600080fd5b8063513da9481161030f578063513da948146107715780635334f13b146107895780635b703558146107a95780635bbb2177146107c35780635ecedfc9146107f057600080fd5b80633a55355b146106e45780633ccfd60b1461070457806341f434341461071957806342842e0e1461073b57806345ca77381461075b57600080fd5b806315bc0c8b116103d957806323b872dd1161039d57806323b872dd146106475780632895bf7d1461066757806329ca18fc146106875780632ccde4f6146106a7578063367df165146106c757600080fd5b806315bc0c8b1461058157806318160ddd146105a157806318e20a38146105ba5780631e238db4146105cf5780631e6c598e146105e457600080fd5b806301ffc9a71461044257806302d2838b14610477578063055ad42e1461049957806306fdde03146104bd578063081812fc146104df578063095ea7b31461050c57806309ec6cc71461052c57806312ef80ed1461054c57806315b56d1014610561575b600080fd5b34801561044e57600080fd5b5061046261045d366004614859565b610de1565b60405190151581526020015b60405180910390f35b34801561048357600080fd5b50610497610492366004614876565b610df2565b005b3480156104a557600080fd5b506104af600a5481565b60405190815260200161046e565b3480156104c957600080fd5b506104d2611103565b60405161046e91906148df565b3480156104eb57600080fd5b506104ff6104fa366004614876565b611195565b60405161046e91906148f2565b34801561051857600080fd5b50610497610527366004614922565b6111d9565b34801561053857600080fd5b50610497610547366004614876565b6111f2565b34801561055857600080fd5b506104af600381565b34801561056d57600080fd5b5061046261057c366004614a17565b6114b0565b34801561058d57600080fd5b5061049761059c366004614876565b6114e3565b3480156105ad57600080fd5b50600154600054036104af565b3480156105c657600080fd5b506104af6114f0565b3480156105db57600080fd5b506104d2611504565b3480156105f057600080fd5b506106046105ff366004614876565b611592565b6040805197885260208801969096529486019390935260608501919091526001600160a01b0390811660808501521660a0830152151560c082015260e00161046e565b34801561065357600080fd5b50610497610662366004614a4b565b6115f1565b34801561067357600080fd5b506104af610682366004614a87565b61161c565b34801561069357600080fd5b506104626106a2366004614876565b6116db565b3480156106b357600080fd5b506104d26106c2366004614876565b611796565b3480156106d357600080fd5b506104af681b1ae4d6e2ef50000081565b3480156106f057600080fd5b506104af6106ff366004614876565b611891565b34801561071057600080fd5b5061049761194e565b34801561072557600080fd5b506104ff6daaeb6d7670e522a718067333cd4e81565b34801561074757600080fd5b50610497610756366004614a4b565b6119a7565b34801561076757600080fd5b506104af600e5481565b34801561077d57600080fd5b506104af6363e64de081565b34801561079557600080fd5b506104976107a4366004614876565b6119cc565b3480156107b557600080fd5b506016546104629060ff1681565b3480156107cf57600080fd5b506107e36107de366004614aed565b6119d9565b60405161046e9190614b6a565b3480156107fc57600080fd5b506104af61080b366004614922565b600d60209081526000928352604080842090915290825290205481565b34801561083457600080fd5b506104ff610843366004614876565b611a8b565b34801561085457600080fd5b506104d2611a96565b34801561086957600080fd5b506104d2610878366004614876565b611aa3565b34801561088957600080fd5b506104af610898366004614a87565b611b45565b3480156108a957600080fd5b50610497611b93565b3480156108be57600080fd5b50610497611ba7565b3480156108d357600080fd5b506104976108e2366004614a87565b611ca6565b3480156108f357600080fd5b506017546104ff906001600160a01b031681565b34801561091357600080fd5b50610497610922366004614bac565b611cfc565b34801561093357600080fd5b50610497611efd565b34801561094857600080fd5b50610497610957366004614876565b611f67565b34801561096857600080fd5b506104af63688a094081565b34801561098057600080fd5b5061099461098f366004614a87565b611faf565b60405161046e9190614bce565b3480156109ad57600080fd5b506104976109bc366004614876565b612095565b3480156109cd57600080fd5b506008546001600160a01b03166104ff565b3480156109eb57600080fd5b506104af6109fa366004614876565b6120a2565b348015610a0b57600080fd5b506104d2612118565b348015610a2057600080fd5b50610a44610a2f366004614876565b601a6020526000908152604090205460ff1681565b60405161046e9190614c1c565b348015610a5d57600080fd5b50610994610a6c366004614c44565b612127565b348015610a7d57600080fd5b506104d261229e565b348015610a9257600080fd5b50610497610aa1366004614c85565b6122ab565b348015610ab257600080fd5b506019546104af565b348015610ac757600080fd5b50610497610ad6366004614a87565b6122bf565b348015610ae757600080fd5b50610497610af6366004614bac565b61230f565b348015610b0757600080fd5b506104af60135481565b348015610b1d57600080fd5b506104af6122b881565b348015610b3357600080fd5b506104af68015af1d78b58c4000081565b348015610b5057600080fd5b50610497610b5f366004614cbc565b61249d565b348015610b7057600080fd5b50610497610b7f366004614ce8565b6124c3565b610497610b92366004614d63565b6124f0565b348015610ba357600080fd5b506104af66d19c2ff9bf800081565b348015610bbe57600080fd5b50610bd2610bcd366004614876565b6127f8565b60405161046e9190614dae565b348015610beb57600080fd5b50610497610bfa366004614dbc565b61283b565b348015610c0b57600080fd5b506104af600f5481565b348015610c2157600080fd5b506104d2610c30366004614876565b612b68565b348015610c4157600080fd5b506104af60125481565b348015610c5757600080fd5b50610c6b610c66366004614e02565b612e0d565b6040805192835260208301919091520161046e565b348015610c8c57600080fd5b506104af612f08565b348015610ca157600080fd5b506104af610cb0366004614876565b600c6020526000908152604090205481565b348015610cce57600080fd5b506104af610cdd366004614876565b6130e9565b348015610cee57600080fd5b50610497610cfd366004614e3b565b613147565b348015610d0e57600080fd5b506104d2613182565b348015610d2357600080fd5b506104af60105481565b348015610d3957600080fd5b506104af60115481565b348015610d4f57600080fd5b50610462610d5e366004614edb565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610d9857600080fd5b50610497610da7366004614cbc565b61318f565b348015610db857600080fd5b50610497610dc7366004614a87565b613410565b348015610dd857600080fd5b50610497613489565b6000610dec826134a5565b92915050565b600060198281548110610e0757610e07614f0e565b60009182526020918290206040805160e081018252600693909302909101805483526001810154938301939093526002830154908201526003820154606082015260048201546001600160a01b03908116608083015260059092015491821660a0820152600160a01b90910460ff16151560c08201819052909150610ec35760405162461bcd60e51b815260206004820152600d60248201526c2161637469766520747261646560981b60448201526064015b60405180910390fd5b42816060015111610f005760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610eba565b60026040808301516000908152601a602052205460ff166002811115610f2857610f28614c06565b03610f455760405162461bcd60e51b8152600401610eba90614f24565b336001600160a01b0316610f5c8260400151611a8b565b6001600160a01b031614610fac5760405162461bcd60e51b815260206004820152601760248201527610b7bbb732b91037b31031b637b9b4b733903a37b5b2b760491b6044820152606401610eba565b610fbf81608001513383602001516134f3565b610fd233826080015183604001516134f3565b6040518060e001604052808260000151815260200182602001518152602001826040015181526020018260600151815260200182608001516001600160a01b03168152602001336001600160a01b03168152602001600015158152506019838154811061104157611041614f0e565b60009182526020808320845160069093020191825583015160018201556040808401516002830155606084015160038301556080808501516004840180546001600160a01b039283166001600160a01b031990911617905560a08601516005909401805460c0909701511515600160a01b026001600160a81b031990971694821694909417959095179092559084015184519151339491909116927f4d16bcd970ae0d8ad8871781ba650086db49df05d8ead538c980797d0d9235f991a45050565b60606002805461111290614f47565b80601f016020809104026020016040519081016040528092919081815260200182805461113e90614f47565b801561118b5780601f106111605761010080835404028352916020019161118b565b820191906000526020600020905b81548152906001019060200180831161116e57829003601f168201915b5050505050905090565b60006111a08261363b565b6111bd576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b816111e381613662565b6111ed8383613712565b505050565b60006019828154811061120757611207614f0e565b60009182526020918290206040805160e0810182526006909302909101805483526001810154938301939093526002830154908201526003820154606082015260048201546001600160a01b039081166080830181905260059093015490811660a083015260ff600160a01b90910416151560c0820152915033146112b85760405162461bcd60e51b815260206004820152600760248201526610b7b832b732b960c91b6044820152606401610eba565b60a08101516001600160a01b0316156113295760405162461bcd60e51b815260206004820152602d60248201527f7472616465436c6f7365722063616e277420616c7265616479206265206e6f6e60448201526c2d7a65726f206164647265737360981b6064820152608401610eba565b428160600151116113885760405162461bcd60e51b815260206004820152602360248201527f74726164652e65787069727944617465203c3d20626c6f636b2e74696d6573746044820152620616d760ec1b6064820152608401610eba565b6040518060e001604052808260000151815260200182602001518152602001826040015181526020018260600151815260200182608001516001600160a01b03168152602001336001600160a01b0316815260200160001515815250601983815481106113f7576113f7614f0e565b600091825260208083208451600690930201918255830151600182015560408084015160028301556060840151600383015560808401516004830180546001600160a01b039283166001600160a01b031990911617905560a08501516005909301805460c0909601511515600160a01b026001600160a81b031990961693909116929092179390931790559051339184917f68bbfaa8a985659b13e3f23ffac8fc9039d6ca60199cd9327817cb0cc03eb8769190a35050565b600060156114bd836137b2565b6040516114ca9190614f7b565b9081526040519081900360200190205460ff1692915050565b6114eb613914565b600f55565b6115016363e64de06203f480614fad565b81565b601b805461151190614f47565b80601f016020809104026020016040519081016040528092919081815260200182805461153d90614f47565b801561158a5780601f1061155f5761010080835404028352916020019161158a565b820191906000526020600020905b81548152906001019060200180831161156d57829003601f168201915b505050505081565b601981815481106115a257600080fd5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154939550919390926001600160a01b0391821691811690600160a01b900460ff1687565b826001600160a01b038116331461160b5761160b33613662565b61161684848461396e565b50505050565b60006363e64de0421161163157506000919050565b600061163c83611b45565b90508060000361164f5750600092915050565b6000808061165b61481c565b60005b8584146116cf5761166e816139c5565b915081604001516116c75781516001600160a01b03161561168e57815192505b876001600160a01b0316836001600160a01b0316036116c75760019093019260006116b882611891565b905080156116c557948501945b505b60010161165e565b50929695505050505050565b600080601983815481106116f1576116f1614f0e565b60009182526020918290206040805160e0810182526006939093029091018054835260018101549383019390935260028301549082015260038201546060820181905260048301546001600160a01b03908116608084015260059093015492831660a0830152600160a01b90920460ff16151560c0820152915042111561177b5750600092915050565b8060c0015161178d5750600092915050565b50600192915050565b6000818152601a602052604081205460609160ff909116908160028111156117c0576117c0614c06565b0361185857601b80546117d290614f47565b80601f01602080910402602001604051908101604052809291908181526020018280546117fe90614f47565b801561184b5780601f106118205761010080835404028352916020019161184b565b820191906000526020600020905b81548152906001019060200180831161182e57829003601f168201915b5050505050915050919050565b600181600281111561186c5761186c614c06565b0361187e57601c80546117d290614f47565b601d80546117d290614f47565b50919050565b60006363e64de042116118a657506000919050565b60006118b1836120a2565b905063688a094081106118c75750600092915050565b600063688a094042106118de5763688a09406118e0565b425b90506000620151806118f1866130e9565b68015af1d78b58c400006119058686614fc0565b61190f9190614fd3565b6119199190614fd3565b6119239190615000565b90506363e64de0830361194657611943681b1ae4d6e2ef50000082614fad565b90505b949350505050565b611956613914565b476000606461196683600f614fd3565b6119709190615000565b905061199073fed505c80b72cdca5f72292d4bf1d6194cf23669826139e5565b6119a33361199e8385614fc0565b6139e5565b5050565b826001600160a01b03811633146119c1576119c133613662565b611616848484613afe565b6119d4613914565b601055565b6060816000816001600160401b038111156119f6576119f661494c565b604051908082528060200260200182016040528015611a2f57816020015b611a1c61481c565b815260200190600190039081611a145790505b50905060005b828114611a8257611a5d868683818110611a5157611a51614f0e565b905060200201356127f8565b828281518110611a6f57611a6f614f0e565b6020908102919091010152600101611a35565b50949350505050565b6000610dec82613b19565b601d805461151190614f47565b6000818152601460205260409020805460609190611ac090614f47565b80601f0160208091040260200160405190810160405280929190818152602001828054611aec90614f47565b8015611b395780601f10611b0e57610100808354040283529160200191611b39565b820191906000526020600020905b815481529060010190602001808311611b1c57829003601f168201915b50505050509050919050565b60006001600160a01b038216611b6e576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b611b9b613914565b611ba56000613b80565b565b60125415611bf75760405162461bcd60e51b815260206004820152601d60248201527f5374617274696e6720696e64657820697320616c7265616479207365740000006044820152606401610eba565b600060115411611c495760405162461bcd60e51b815260206004820181905260248201527f5374617274696e6720696e64657820626c6f636b206d757374206265207365746044820152606401610eba565b60ff60115443611c599190614fc0565b1115611c80576122b8611c6d600143614fc0565b611c78919040615014565b601255611c95565b601154611c91906122b89040615014565b6012555b601254600003611ba5576001601255565b611cae613914565b6001600160a01b038116611cd45760405162461bcd60e51b8152600401610eba90615028565b601680546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b8133611d0782611a8b565b6001600160a01b031614611d2d5760405162461bcd60e51b8152600401610eba9061504f565b8133611d3882611a8b565b6001600160a01b031614611d5e5760405162461bcd60e51b8152600401610eba9061504f565b600060125411611da45760405162461bcd60e51b81526020600482015260116024820152701bdb9b1e4818599d195c881c995d99585b607a1b6044820152606401610eba565b6000848152601a602052604081205460ff166002811115611dc757611dc7614c06565b14611e0d5760405162461bcd60e51b815260206004820152601660248201527508595d9bdb1d9a5b99c81a5d195b48191959985d5b1d60521b6044820152606401610eba565b6000838152601a602052604081205460ff166002811115611e3057611e30614c06565b14611e725760405162461bcd60e51b8152602060048201526012602482015271085cdbdd5b081a5d195b48191959985d5b1d60721b6044820152606401610eba565b6000848152601a6020526040808220805460ff19908116600117909155858352912080549091166002179055600f54611eac903390613bd2565b611eb584613c56565b611ebe83613c56565b82847f8db0a45188fb388358a12efee9165c0721142258d470a99c8efa5383a7859b3c33604051611eef91906148f2565b60405180910390a350505050565b611f05613914565b600160135410611f445760405162461bcd60e51b815260206004820152600a6024820152691b5a5b9d195908185b1b60b21b6044820152606401610eba565b6001601381905550611ba533600160405180602001604052806000815250613ccc565b611f6f613914565b80600a5403611faa5760405162461bcd60e51b8152602060048201526007602482015266616c726561647960c81b6044820152606401610eba565b600a55565b60606000806000611fbf85611b45565b90506000816001600160401b03811115611fdb57611fdb61494c565b604051908082528060200260200182016040528015612004578160200160208202803683370190505b50905061200f61481c565b60005b83861461208957612022816139c5565b915081604001516120815781516001600160a01b03161561204257815194505b876001600160a01b0316856001600160a01b031603612081578083878060010198508151811061207457612074614f0e565b6020026020010181815250505b600101612012565b50909695505050505050565b61209d613914565b600e55565b60006120ad8261363b565b6120e25760405162461bcd60e51b815260206004820152600660248201526508595e1a5cdd60d21b6044820152606401610eba565b6000828152601860205260408120548103612101576363e64de0612111565b6000838152601860205260409020545b9392505050565b60606003805461111290614f47565b606081831061214957604051631960ccad60e11b815260040160405180910390fd5b60008061215560005490565b905080841115612163578093505b600061216e87611b45565b90508486101561218d5785850381811015612187578091505b50612191565b5060005b6000816001600160401b038111156121ab576121ab61494c565b6040519080825280602002602001820160405280156121d4578160200160208202803683370190505b509050816000036121ea57935061211192505050565b60006121f5886127f8565b905060008160400151612206575080515b885b8881141580156122185750848714155b1561228d57612226816139c5565b925082604001516122855782516001600160a01b03161561224657825191505b8a6001600160a01b0316826001600160a01b031603612285578084888060010199508151811061227857612278614f0e565b6020026020010181815250505b600101612208565b505050928352509095945050505050565b601e805461151190614f47565b816122b581613662565b6111ed8383613d32565b6122c7613914565b6001600160a01b0381166122ed5760405162461bcd60e51b8152600401610eba90615028565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b813361231a82611a8b565b6001600160a01b0316146123405760405162461bcd60e51b8152600401610eba9061504f565b813361234b82611a8b565b6001600160a01b0316146123715760405162461bcd60e51b8152600401610eba9061504f565b60026000848152601a602052604090205460ff16600281111561239657612396614c06565b146123cb5760405162461bcd60e51b8152602060048201526005602482015264085cdbdd5b60da1b6044820152606401610eba565b60016000858152601a602052604090205460ff1660028111156123f0576123f0614c06565b146124285760405162461bcd60e51b815260206004820152600860248201526708595d9bdb1d995960c21b6044820152606401610eba565b6000848152601a6020526040808220805460ff1990811690915585835291208054909116905561245783613c56565b61246084613c56565b61246c33601054613bd2565b82847f53b276ee76ababff76e2737881ee01288f2c37ede62c845e01d5b014f8c7c27d33604051611eef91906148f2565b6124a5613914565b6000928352600b6020908152604080852093909355600c9052912055565b836001600160a01b03811633146124dd576124dd33613662565b6124e985858585613d9e565b5050505050565b6002600954036125425760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eba565b60026009556122b86125576001546000540390565b1061259d5760405162461bcd60e51b815260206004820152601660248201527514d85b19481a185cc8185b1c9958591e48195b99195960521b6044820152606401610eba565b6000600a54116125e05760405162461bcd60e51b815260206004820152600e60248201526d14d85b19481a5cc81c185d5cd95960921b6044820152606401610eba565b6363e64de042116126215760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081cdd185c9d195960aa1b6044820152606401610eba565b6000831180156126315750600683105b6126745760405162461bcd60e51b8152602060048201526014602482015273696e76616c6964206e756d6265724f664e66747360601b6044820152606401610eba565b6122b8836126856001546000540390565b61268f9190614fad565b11156126d25760405162461bcd60e51b815260206004820152601260248201527145786365656473206d617820737570706c7960701b6044820152606401610eba565b6000806126e0338585612e0d565b9092509050811561271d57336000908152600d60209081526040808320600a54845290915281208054849290612717908490614fad565b90915550505b34816127298488614fc0565b61273a9066d19c2ff9bf8000614fd3565b6127449190614fad565b146127915760405162461bcd60e51b815260206004820152601f60248201527f45746865722076616c75652073656e74206973206e6f7420636f7272656374006044820152606401610eba565b6127ab338660405180602001604052806000815250613ccc565b6011541580156127e257506122b86127c66001546000540390565b14806127e257506127de6363e64de06203f480614fad565b4210155b156127ec57436011555b50506001600955505050565b61280061481c565b61280861481c565b60005483106128175792915050565b612820836139c5565b90508060400151156128325792915050565b61211183613de2565b813361284682611a8b565b6001600160a01b03161461286c5760405162461bcd60e51b8152600401610eba9061504f565b60165460ff166128aa5760405162461bcd60e51b815260206004820152600960248201526864697361626c65642160b81b6044820152606401610eba565b6128b382613dfb565b15156001146128f95760405162461bcd60e51b81526020600482015260126024820152716e6f742076616c6964206e6577206e616d6560701b6044820152606401610eba565b600083815260146020526040908190209051600291612917916150ee565b602060405180830381855afa158015612934573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061295791906150fa565b6002836040516129679190614f7b565b602060405180830381855afa158015612984573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906129a791906150fa565b036129ee5760405162461bcd60e51b815260206004820152601760248201527673616d65206173207468652063757272656e74206f6e6560481b6044820152606401610eba565b6129f7826114b0565b15612a375760405162461bcd60e51b815260206004820152601060248201526f185b1c9958591e481c995cd95c9d995960821b6044820152606401610eba565b60008381526014602052604081208054612a5090614f47565b90501115612afb5760008381526014602052604090208054612afb9190612a7690614f47565b80601f0160208091040260200160405190810160405280929190818152602001828054612aa290614f47565b8015612aef5780601f10612ac457610100808354040283529160200191612aef565b820191906000526020600020905b815481529060010190602001808311612ad257829003601f168201915b50505050506000614006565b612b06826001614006565b6000838152601460205260409020612b1e8382615159565b50612b2b33600e54613bd2565b827f7e632a301794d8d4a81ea7e20f37d1947158d36e66403af04ba85dd194b66f1b83604051612b5b91906148df565b60405180910390a2505050565b6060612b738261363b565b612bbf5760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610eba565b60408051808201825260018152601160f91b60208083019190915260008581526014909152919091208054612bf390614f47565b159050612c2f576000838152601460209081526040918290209151612c19929101615218565b6040516020818303038152906040529050612c5a565b612c3883614043565b604051602001612c489190615235565b60405160208183030381529060405290505b601254600003612cb657612c8f81601e604051602001612c7b929190615271565b604051602081830303815290604052614143565b604051602001612c9f9190615301565b604051602081830303815290604052915050919050565b60006122b860125485612cc99190614fad565b612cd39190615014565b90506060612ce085611796565b612ce983614043565b604051602001612cfa929190615346565b60408051601f1981840301815290829052612d1791602001615384565b60408051601f198184030181529181526017546000888152601a6020529190912054919250612de49185916001600160a01b03169063a3161dba90899060ff166002811115612d6857612d68614c06565b6040516001600160e01b031960e085901b16815260048101929092526024820152604401600060405180830381865afa158015612da9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612dd191908101906153b9565b83604051602001612c7b9392919061542f565b604051602001612df49190615301565b6040516020818303038152906040529350505050919050565b600a546000908152600b602052604081205481908015801590612e2f57508315155b15612ef7576001600160a01b0386166000908152600d60209081526040808320600a54845290915290205460011115612ef757612ed5858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506040516bffffffffffffffffffffffff1960608c901b1660208201528592506034019050604051602081830303815290604052805190602001206142a7565b15612ef7575050600a546000908152600c602052604090205460019150612f00565b60008092509250505b935093915050565b600080612f1433611b45565b905060008111612f555760405162461bcd60e51b815260206004820152600c60248201526b7a65726f2062616c616e636560a01b6044820152606401610eba565b6363e64de04211612fa85760405162461bcd60e51b815260206004820152601c60248201527f456d697373696f6e20686173206e6f74207374617274656420796574000000006044820152606401610eba565b60008080612fb461481c565b60005b85841461303057612fc7816139c5565b915081604001516130285781516001600160a01b031615612fe757815192505b336001600160a01b0384160361302857600190930192600061300882611891565b90508015613026576000828152601860205260409020429055948501945b505b600101612fb7565b505050506000811161307a5760405162461bcd60e51b815260206004820152601360248201527227379030b1b1bab6bab630ba32b21027b6b2b760691b6044820152606401610eba565b6016546040516340c10f1960e01b8152336004820152602481018390526101009091046001600160a01b0316906340c10f1990604401600060405180830381600087803b1580156130ca57600080fd5b505af11580156130de573d6000803e3d6000fd5b509295945050505050565b6000818152601a602052604081205460ff168181600281111561310e5761310e614c06565b0361311c5750600192915050565b600181600281111561313057613130614c06565b0361313e5750600392915050565b50600092915050565b61314f613914565b601b61315b8582615159565b50601c6131688482615159565b50601d6131758382615159565b50601e6124e98282615159565b601c805461151190614f47565b823361319a82611a8b565b6001600160a01b0316146131c05760405162461bcd60e51b8152600401610eba9061504f565b42821161320f5760405162461bcd60e51b815260206004820152601d60248201527f65787069727944617465203c3d20626c6f636b2e74696d657374616d700000006044820152606401610eba565b60026000858152601a602052604090205460ff16600281111561323457613234614c06565b036132515760405162461bcd60e51b8152600401610eba90614f24565b601980546040805160e081018252828152602080820189815282840189815260608085018a81523360808701818152600060a08901818152600160c08b01818152908d018e559c909152975160068b027f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969581019190915595517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969687015593517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969786015590517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969885015591517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c9699840180546001600160a01b039283166001600160a01b031990911617905594517f944998273e477b495144fb8794c914197f3ccb46be2900f4698fd0ef743c969a909301805498511515600160a01b026001600160a81b0319909916939095169290921796909617909255825189815290810188905291820186905291929183917fac37cec9b9d12e2f430079b73359fc83d205d90a5b307ac7fc059ac552465273910160405180910390a35050505050565b613418613914565b6001600160a01b03811661347d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610eba565b61348681613b80565b50565b613491613914565b6016805460ff19811660ff90911615179055565b60006301ffc9a760e01b6001600160e01b0319831614806134d657506380ac58cd60e01b6001600160e01b03198316145b80610dec5750506001600160e01b031916635b5e139f60e01b1490565b60006134fe82613b19565b9050836001600160a01b0316816001600160a01b0316146135315760405162a1148160e81b815260040160405180910390fd5b6001600160a01b03831661355857604051633a954ecd60e21b815260040160405180910390fd5b61356584848460016142bd565b600082815260066020908152604080832080546001600160a01b03191690556001600160a01b03878116845260058352818420805460001901905586168084528184208054600101905585845260049092528220600160e11b4260a01b9092178217905582169003613607576001820160008181526004602052604081205490036136055760005481146136055760008181526004602052604090208290555b505b81836001600160a01b0316856001600160a01b03166000805160206155c383398151915260405160405180910390a4611616565b6000805482108015610dec575050600090815260046020526040902054600160e01b161590565b6daaeb6d7670e522a718067333cd4e3b1561348657604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156136cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136f391906154d9565b6134865780604051633b79c77360e21b8152600401610eba91906148f2565b600061371d82611a8b565b9050336001600160a01b03821614613756576137398133610d5e565b613756576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60606000829050600081516001600160401b038111156137d4576137d461494c565b6040519080825280601f01601f1916602001820160405280156137fe576020820181803683370190505b50905060005b825181101561390c57604183828151811061382157613821614f0e565b016020015160f81c108015906138515750605a83828151811061384657613846614f0e565b016020015160f81c11155b156138b35782818151811061386857613868614f0e565b602001015160f81c60f81b60f81c602061388291906154f6565b60f81b82828151811061389757613897614f0e565b60200101906001600160f81b031916908160001a9053506138fa565b8281815181106138c5576138c5614f0e565b602001015160f81c60f81b8282815181106138e2576138e2614f0e565b60200101906001600160f81b031916908160001a9053505b806139048161550f565b915050613804565b509392505050565b6008546001600160a01b03163314611ba55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eba565b600081815260066020526040902054338082146001600160a01b038616909114176139ba5761399d8433610d5e565b6139ba57604051632ce44b5f60e11b815260040160405180910390fd5b6116168484846134f3565b6139cd61481c565b600082815260046020526040902054610dec90614356565b80471015613a355760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610eba565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613a82576040519150601f19603f3d011682016040523d82523d6000602084013e613a87565b606091505b50509050806111ed5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610eba565b6111ed838383604051806020016040528060008152506124c3565b600081600054811015613b675760008181526004602052604081205490600160e01b82169003613b65575b80600003612111575060001901600081815260046020526040902054613b44565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601654613bef9061010090046001600160a01b0316833084614399565b601654604051630852cd8d60e31b8152600481018390526101009091046001600160a01b0316906342966c68906024015b600060405180830381600087803b158015613c3a57600080fd5b505af1158015613c4e573d6000803e3d6000fd5b505050505050565b6000613c6182611891565b905080156119a357600082815260186020526040902042905560165461010090046001600160a01b03166340c10f19613c9984611a8b565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401613c20565b613cd683836143f3565b6001600160a01b0383163b156111ed576000548281035b613d0060008683806001019450866144da565b613d1d576040516368d2bf6b60e11b815260040160405180910390fd5b818110613ced5781600054146124e957600080fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b613da98484846115f1565b6001600160a01b0383163b1561161657613dc5848484846144da565b611616576040516368d2bf6b60e11b815260040160405180910390fd5b613dea61481c565b610dec613df683613b19565b614356565b600080829050600181511015613e145750600092915050565b601981511115613e275750600092915050565b80600081518110613e3a57613e3a614f0e565b01602001516001600160f81b031916600160fd1b03613e5c5750600092915050565b8060018251613e6b9190614fc0565b81518110613e7b57613e7b614f0e565b01602001516001600160f81b031916600160fd1b03613e9d5750600092915050565b600081600081518110613eb257613eb2614f0e565b01602001516001600160f81b031916905060005b8251811015613ffb576000838281518110613ee357613ee3614f0e565b01602001516001600160f81b0319169050600160fd1b81148015613f145750600160fd1b6001600160f81b03198416145b15613f255750600095945050505050565b600360fc1b6001600160f81b0319821610801590613f515750603960f81b6001600160f81b0319821611155b158015613f875750604160f81b6001600160f81b0319821610801590613f855750602d60f91b6001600160f81b0319821611155b155b8015613fbc5750606160f81b6001600160f81b0319821610801590613fba5750603d60f91b6001600160f81b0319821611155b155b8015613fd65750600160fd1b6001600160f81b0319821614155b15613fe75750600095945050505050565b915080613ff38161550f565b915050613ec6565b506001949350505050565b806015614012846137b2565b60405161401f9190614f7b565b908152604051908190036020019020805491151560ff199092169190911790555050565b60608160000361406a5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115614094578061407e8161550f565b915061408d9050600a83615000565b915061406e565b6000816001600160401b038111156140ae576140ae61494c565b6040519080825280601f01601f1916602001820160405280156140d8576020820181803683370190505b5090505b8415611946576140ed600183614fc0565b91506140fa600a86615014565b614105906030614fad565b60f81b81838151811061411a5761411a614f0e565b60200101906001600160f81b031916908160001a90535061413c600a86615000565b94506140dc565b6060815160000361416257505060408051602081019091526000815290565b600060405180606001604052806040815260200161558360409139905060006003845160026141919190614fad565b61419b9190615000565b6141a6906004614fd3565b905060006141b5826020614fad565b6001600160401b038111156141cc576141cc61494c565b6040519080825280601f01601f1916602001820160405280156141f6576020820181803683370190505b509050818152600183018586518101602084015b81831015614262576003830192508251603f8160121c168501518253600182019150603f81600c1c168501518253600182019150603f8160061c168501518253600182019150603f811685015182535060010161420a565b60038951066001811461427c576002811461428d57614299565b613d3d60f01b600119830152614299565b603d60f81b6000198301525b509398975050505050505050565b6000826142b485846145c5565b14949350505050565b60005b818110156124e95760006142d48285614fad565b90506001600160a01b0386161561434d576142ee81613c56565b60026000828152601a602052604090205460ff16600281111561431357614313614c06565b0361434d5760405162461bcd60e51b815260206004820152600a60248201526939b7bab6103a37b5b2b760b11b6044820152606401610eba565b506001016142c0565b61435e61481c565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261161690859061460a565b60008054908290036144185760405163b562e8dd60e01b815260040160405180910390fd5b61442560008483856142bd565b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083906000805160206155c38339815191528180a4600183015b8181146144b057808360006000805160206155c3833981519152600080a460010161448a565b50816000036144d157604051622e076360e81b815260040160405180910390fd5b60005550505050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061450f903390899088908890600401615528565b6020604051808303816000875af192505050801561454a575060408051601f3d908101601f1916820190925261454791810190615565565b60015b6145a8573d808015614578576040519150601f19603f3d011682016040523d82523d6000602084013e61457d565b606091505b5080516000036145a0576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b600081815b845181101561390c576145f6828683815181106145e9576145e9614f0e565b60200260200101516146dc565b9150806146028161550f565b9150506145ca565b600061465f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166147089092919063ffffffff16565b8051909150156111ed578080602001905181019061467d91906154d9565b6111ed5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610eba565b60008183106146f8576000828152602084905260409020612111565b5060009182526020526040902090565b60606119468484600085856001600160a01b0385163b61476a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610eba565b600080866001600160a01b031685876040516147869190614f7b565b60006040518083038185875af1925050503d80600081146147c3576040519150601f19603f3d011682016040523d82523d6000602084013e6147c8565b606091505b50915091506147d88282866147e3565b979650505050505050565b606083156147f2575081612111565b8251156148025782518084602001fd5b8160405162461bcd60e51b8152600401610eba91906148df565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6001600160e01b03198116811461348657600080fd5b60006020828403121561486b57600080fd5b813561211181614843565b60006020828403121561488857600080fd5b5035919050565b60005b838110156148aa578181015183820152602001614892565b50506000910152565b600081518084526148cb81602086016020860161488f565b601f01601f19169290920160200192915050565b60208152600061211160208301846148b3565b6001600160a01b0391909116815260200190565b80356001600160a01b038116811461491d57600080fd5b919050565b6000806040838503121561493557600080fd5b61493e83614906565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561498a5761498a61494c565b604052919050565b60006001600160401b038211156149ab576149ab61494c565b50601f01601f191660200190565b60006149cc6149c784614992565b614962565b90508281528383830111156149e057600080fd5b828260208301376000602084830101529392505050565b600082601f830112614a0857600080fd5b612111838335602085016149b9565b600060208284031215614a2957600080fd5b81356001600160401b03811115614a3f57600080fd5b611946848285016149f7565b600080600060608486031215614a6057600080fd5b614a6984614906565b9250614a7760208501614906565b9150604084013590509250925092565b600060208284031215614a9957600080fd5b61211182614906565b60008083601f840112614ab457600080fd5b5081356001600160401b03811115614acb57600080fd5b6020830191508360208260051b8501011115614ae657600080fd5b9250929050565b60008060208385031215614b0057600080fd5b82356001600160401b03811115614b1657600080fd5b614b2285828601614aa2565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b8181101561208957614b99838551614b2e565b9284019260809290920191600101614b86565b60008060408385031215614bbf57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b8181101561208957835183529284019291840191600101614bea565b634e487b7160e01b600052602160045260246000fd5b6020810160038310614c3e57634e487b7160e01b600052602160045260246000fd5b91905290565b600080600060608486031215614c5957600080fd5b614c6284614906565b95602085013595506040909401359392505050565b801515811461348657600080fd5b60008060408385031215614c9857600080fd5b614ca183614906565b91506020830135614cb181614c77565b809150509250929050565b600080600060608486031215614cd157600080fd5b505081359360208301359350604090920135919050565b60008060008060808587031215614cfe57600080fd5b614d0785614906565b9350614d1560208601614906565b92506040850135915060608501356001600160401b03811115614d3757600080fd5b8501601f81018713614d4857600080fd5b614d57878235602084016149b9565b91505092959194509250565b600080600060408486031215614d7857600080fd5b8335925060208401356001600160401b03811115614d9557600080fd5b614da186828701614aa2565b9497909650939450505050565b60808101610dec8284614b2e565b60008060408385031215614dcf57600080fd5b8235915060208301356001600160401b03811115614dec57600080fd5b614df8858286016149f7565b9150509250929050565b600080600060408486031215614e1757600080fd5b614e2084614906565b925060208401356001600160401b03811115614d9557600080fd5b60008060008060808587031215614e5157600080fd5b84356001600160401b0380821115614e6857600080fd5b614e74888389016149f7565b95506020870135915080821115614e8a57600080fd5b614e96888389016149f7565b94506040870135915080821115614eac57600080fd5b614eb8888389016149f7565b93506060870135915080821115614ece57600080fd5b50614d57878288016149f7565b60008060408385031215614eee57600080fd5b614ef783614906565b9150614f0560208401614906565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b602080825260099082015268736f756c206974656d60b81b604082015260600190565b600181811c90821680614f5b57607f821691505b60208210810361188b57634e487b7160e01b600052602260045260246000fd5b60008251614f8d81846020870161488f565b9190910192915050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610dec57610dec614f97565b81810381811115610dec57610dec614f97565b8082028115828204841417610dec57610dec614f97565b634e487b7160e01b600052601260045260246000fd5b60008261500f5761500f614fea565b500490565b60008261502357615023614fea565b500690565b6020808252600d908201526c217a65726f206164647265737360981b604082015260600190565b602080825260129082015271085bdddb995c881bd9881d1bdad95b881a5960721b604082015260600190565b6000815461508881614f47565b600182811680156150a057600181146150b5576150e4565b60ff19841687528215158302870194506150e4565b8560005260208060002060005b858110156150db5781548a8201529084019082016150c2565b50505082870194505b5050505092915050565b6000612111828461507b565b60006020828403121561510c57600080fd5b5051919050565b601f8211156111ed57600081815260208120601f850160051c8101602086101561513a5750805b601f850160051c820191505b81811015613c4e57828155600101615146565b81516001600160401b038111156151725761517261494c565b615186816151808454614f47565b84615113565b602080601f8311600181146151bb57600084156151a35750858301515b600019600386901b1c1916600185901b178555613c4e565b600085815260208120601f198616915b828110156151ea578886015182559484019460019091019084016151cb565b50858210156152085787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000615224828461507b565b601160f91b81526001019392505050565b684d6f6e73757461202360b81b81526000825161525981600985016020870161488f565b601160f91b6009939091019283015250600a01919050565b693d913730b6b2911d101160b11b8152825160009061529781600a85016020880161488f565b7f2c20226465736372697074696f6e223a2022546865204d6f6e7375746120436f600a9184019182015274363632b1ba34b7b71116101134b6b0b3b2911d101160591b602a8201526152ec603f82018561507b565b6222207d60e81b815260030195945050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161533981601d85016020870161488f565b91909101601d0192915050565b6000835161535881846020880161488f565b83519083019061536c81836020880161488f565b632e706e6760e01b9101908152600401949350505050565b6b16101134b6b0b3b2911d101160a11b815281516000906153ac81600c85016020870161488f565b91909101600c0192915050565b6000602082840312156153cb57600080fd5b81516001600160401b038111156153e157600080fd5b8201601f810184136153f257600080fd5b80516154006149c782614992565b81815285602083850101111561541557600080fd5b61542682602083016020860161488f565b95945050505050565b693d913730b6b2911d101160b11b8152835160009061545581600a85016020890161488f565b7f2c20226465736372697074696f6e223a2022546865204d6f6e7375746120436f600a918401918201526a0363632b1ba34b7b71116160ad1b602a82015284516154a681603584016020890161488f565b84519101906154bc81603584016020880161488f565b6222207d60e81b6035929091019182015260380195945050505050565b6000602082840312156154eb57600080fd5b815161211181614c77565b60ff8181168382160190811115610dec57610dec614f97565b60006001820161552157615521614f97565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061555b908301846148b3565b9695505050505050565b60006020828403121561557757600080fd5b81516121118161484356fe4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220fe7ea87f162df139189d91161bbeef259192b8205bb7b3bc5d39234d73fdb87464736f6c63430008110033

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

aa2c71928d9eeeff76ca7bb1aea6ce7b294906b37e87e385d483167af3a7bf8c58e78f1a0aebdf7930c1ad063b25e6878567d6dd6be342b0e42a38946b2a848942037eae773bf8b13f2ea0ec2da46c20e49e25c8c809f963c3ee8f9ce895c70c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008e1bc9bf040000000000000000000000000000000000000000000000000000008e1bc9bf040000

-----Decoded View---------------
Arg [0] : _merkleRoots (bytes32[3]): System.Byte[],System.Byte[],System.Byte[]
Arg [1] : _prices (uint256[3]): 0,40000000000000000,40000000000000000

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : aa2c71928d9eeeff76ca7bb1aea6ce7b294906b37e87e385d483167af3a7bf8c
Arg [1] : 58e78f1a0aebdf7930c1ad063b25e6878567d6dd6be342b0e42a38946b2a8489
Arg [2] : 42037eae773bf8b13f2ea0ec2da46c20e49e25c8c809f963c3ee8f9ce895c70c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 000000000000000000000000000000000000000000000000008e1bc9bf040000
Arg [5] : 000000000000000000000000000000000000000000000000008e1bc9bf040000


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

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