ETH Price: $3,388.50 (+0.93%)

Contract

0xcc4e86fd78a13B09f9f77feAFB08d24a145feB8b
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TexturePunx

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 25 : TexturePunxV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

/// Interfaces =====================================================================================
import {IERC20Upgradeable} from "openzeppelin/token/ERC20/IERC20Upgradeable.sol";
import {IERC165Upgradeable} from "openzeppelin/interfaces/IERC165Upgradeable.sol";
import {IERC2981Upgradeable} from "openzeppelin/interfaces/IERC2981Upgradeable.sol";

/// Libraries ======================================================================================
import {MerkleProofUpgradeable} from "openzeppelin/utils/cryptography/MerkleProofUpgradeable.sol";
import {SafeERC20Upgradeable} from "openzeppelin/token/ERC20/utils/SafeERC20Upgradeable.sol";
import {StringsUpgradeable} from "openzeppelin/utils/StringsUpgradeable.sol";

import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol";

/// Types ==========================================================================================
import {Initializable} from "openzeppelin/proxy/utils/Initializable.sol";

import {OwnableUpgradeable} from "openzeppelin/access/OwnableUpgradeable.sol";
import {ERC721EnumerableUpgradeable} from "openzeppelin/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "openzeppelin/security/ReentrancyGuardUpgradeable.sol";

/// Storage ==========================================================================================
import {
    TexturePunxCoreStorage,
    TexturePunxPaymentStorage,
    TexturePunxTraitStorage,
    TexturePunxMintingStorage
} from "src/TexturePunxStorage.sol";

/// Errors ===========================================================================================
import {TexturePunxErrors} from "src/TexturePunxErrors.sol";

contract TexturePunx is 
    OwnableUpgradeable, 
    ERC721EnumerableUpgradeable, 
    IERC2981Upgradeable, 
    ReentrancyGuardUpgradeable {
    /// Dependencies ===================================================================================

    using SafeERC20Upgradeable for IERC20Upgradeable;
    using FixedPointMathLib for uint256;
    using StringsUpgradeable for uint256;

    /// Constants ======================================================================================

    uint64 public constant MAX_SUPPLY = 10_000;

    uint64 public constant PUNX_BASE_PRICE = 0.10 ether;
    uint64 public constant PUNX_PREMIUM_PRICE = 0.05 ether;
    uint64 public constant PUNX_LIMITED_PRICE = 0.10 ether;
    uint64 public constant PUNX_LIMITED_COUNT = 500;

    string private constant svgStart = '<svg xmlns="http://www.w3.org/2000/svg" width="700" height="700" viewBox="0 -0.5 24 24" shape-rendering="crispEdges">';
    string private constant svgEnd = '</svg>';
    
    /// MODIFIERS ======================================================================================

    modifier tokenExists(uint256 tokenId_) {
        if (!_exists(tokenId_))
            revert TexturePunxErrors.TokenDoesNotExist();
        _;
    }

    modifier validMint(bytes32 dna_) {
        _;
        if (totalSupply() >= MAX_SUPPLY - TexturePunxMintingStorage.layout().reservedSupply)
            revert TexturePunxErrors.QuantityExceedsMaxSupply();
        _validateAndRegisterSerialization(dna_);
    }

    modifier validWhitelistMint(uint64 mintRound_, bytes32 dna_, bytes32[] calldata merkleProof_) {
        TexturePunxMintingStorage.WhitelistRound memory round_ = TexturePunxMintingStorage.layout().round[mintRound_];
        bytes32 leaf = keccak256(abi.encodePacked(msg.sender));

        if (!MerkleProofUpgradeable.verify(merkleProof_, round_.merkelRoot, leaf))
            revert TexturePunxErrors.NotOnWhitelist();
        if (TexturePunxMintingStorage.layout().mintRound[mintRound_][msg.sender] >= round_.mintAllowance)
            revert TexturePunxErrors.AlreadyMinted();
        if (msg.value < whitelistPrice(mintRound_, dna_))
            revert TexturePunxErrors.NotEnoughETH();

        // Log Mint
        TexturePunxMintingStorage.layout().mintRound[mintRound_][msg.sender] += 1;

        _;
    }

    /// Initializer ====================================================================================

    function __initialize_texturePunx_v1(
        address controller_, 
        address payable mintForwarder_, 
        address payable royaltyForwarder_
    ) external initializer {

        // Initialize all dependencies
        __Ownable_init();
        __ReentrancyGuard_init();

        // Initialize the base nft contract
        __ERC721_init("Texture Punx", "PUNX");

        // Initialze the nft enumerability 
        __ERC721Enumerable_init();


        // Initialize storage dependencies
        TexturePunxCoreStorage.init();
        TexturePunxMintingStorage.init();

        // Set payment information
        TexturePunxPaymentStorage.layout().mintForwarder = mintForwarder_;
        TexturePunxPaymentStorage.layout().royaltyForwarder = royaltyForwarder_;

        // Transfer ownership to controller
        transferOwnership(controller_);
    }

    receive() payable external {}

    /// Public Accessor Functions ======================================================================

    function DESCRIPTION() external view returns (string memory) {
        return TexturePunxCoreStorage.layout().DESCRIPTION;
    }

    function isPublicSaleActive() external view returns (bool) {
        return TexturePunxMintingStorage.layout().isPublicSaleActive;
    }
    
    function round(uint64 index_) external view returns (TexturePunxMintingStorage.WhitelistRound memory) {
        if (index_ >= TexturePunxMintingStorage.layout().nextRound) revert TexturePunxErrors.IndexOutOfBounds();
        return TexturePunxMintingStorage.layout().round[index_];
    }
    
    function currentRound() external view returns (uint64) {
        return TexturePunxMintingStorage.layout().nextRound - 1;
    }
    
    function mintRound(uint64 _round, address _address) external view returns (uint64) {
        return TexturePunxMintingStorage.layout().mintRound[_round][_address];
    }

    /// Mint Functions =================================================================================

    function publicMint(bytes32 dna_)
    external payable
    validMint(dna_)
    nonReentrant
    {
        if (!TexturePunxMintingStorage.layout().isPublicSaleActive)
            revert TexturePunxErrors.PublicSaleNotActive();
        if (msg.value < _calculatePrice(dna_))
            revert TexturePunxErrors.NotEnoughETH();

        // Mint NFT
        _safeMint(msg.sender, totalSupply());
    }

    function whitelistMint(uint64 mintRound_, bytes32 dna_, bytes32[] calldata merkleProof_) 
    external payable
    validMint(dna_) 
    validWhitelistMint(mintRound_, dna_, merkleProof_)
    nonReentrant
    {
        if (mintRound_ == 0) revert TexturePunxErrors.InvalidMintRound();
        
        // Mint NFT
        _safeMint(msg.sender, totalSupply());
    }

    function ethCoreDevMint(bytes32 dna_, bytes32[] calldata merkleProof_) 
    external payable
    validMint(dna_) 
    validWhitelistMint(0, dna_, merkleProof_)
    nonReentrant
    {
        if (TexturePunxMintingStorage.layout().reservedSupply == 0)
            revert TexturePunxErrors.QuantityExceedsReservedSupply();

        // Decrement reserved suppy count
        TexturePunxMintingStorage.layout().reservedSupply -= 1;

        // Mint NFT
        _safeMint(msg.sender, totalSupply());
    }

    function mintPromotional(address receiver_, bytes32 dna_)
    external onlyOwner
    validMint(dna_) 
    {
        // Mint NFT
        _safeMint(receiver_, totalSupply());
    }

    function mintReserved(address receiver_, bytes32 dna_)
    external onlyOwner
    validMint(dna_) 
    {
        if (TexturePunxMintingStorage.layout().reservedSupply == 0)
            revert TexturePunxErrors.QuantityExceedsReservedSupply();

        // Decrement reserved suppy count
        TexturePunxMintingStorage.layout().reservedSupply -= 1;

        // Mint NFT
        _safeMint(receiver_, totalSupply());
    }

    function isTraitAvailable(uint8 categoryIndex_, uint8 traitIndex_) external view returns (bool) {
        TexturePunxTraitStorage.TraitDescription storage ts = TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_];
        return (ts.rarity == TexturePunxTraitStorage.TraitRarity.LIMITED) ? ts.uses <= PUNX_LIMITED_COUNT : true;
    }

    function isUniqueSerialization(bytes32 dna_) external view returns (bool) {
        // Make sure non trait indexes are zero
        for (uint8 categoryIndex_ = TexturePunxTraitStorage.layout().categoryCount; categoryIndex_ < 32; categoryIndex_ += 1) {
            if (dna_[categoryIndex_] != 0x0)
                revert TexturePunxErrors.InvalidSerialization_SpecifiedValueForInvalidParams();
        }

        // Make sure it is unique
        if (TexturePunxCoreStorage.layout().registeredPunx[dna_]) 
            revert TexturePunxErrors.InvalidSerialization_NotUnique();
        
        // Check each trait
        for (uint8 categoryIndex_ = 0; categoryIndex_ < TexturePunxTraitStorage.layout().categoryCount; categoryIndex_ += 1) {
            uint8 traitIndex_ = uint8(dna_[categoryIndex_]);
            if (traitIndex_ >= TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) 
                revert TexturePunxErrors.InvalidSerialization_UndefinedTrait(categoryIndex_);

            TexturePunxTraitStorage.TraitDescription storage ts = TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_];
            if (ts.rarity == TexturePunxTraitStorage.TraitRarity.LIMITED) {
                if (ts.uses > PUNX_LIMITED_COUNT)
                    revert TexturePunxErrors.InvalidSerialization_TraitExceedsMaxUses(categoryIndex_, traitIndex_);
            } 
        }
        return true;
    }

    function mintPrice(bytes32 dna_) external view returns (uint256 price_) {
        return _calculatePrice(dna_);
    }

    function whitelistRound() external view returns (uint64 roundNumber_) {
        return TexturePunxMintingStorage.layout().nextRound - 1;
    }

    function whitelistPrice(uint64 mintRound_, bytes32 dna_) public view returns (uint256 price_) {
        TexturePunxMintingStorage.WhitelistRoundPricing _price = TexturePunxMintingStorage.layout().round[mintRound_].price;
        if (_price == TexturePunxMintingStorage.WhitelistRoundPricing.FREE) {
            return 0;
        } 
        
        if (_price == TexturePunxMintingStorage.WhitelistRoundPricing.VIP) {
            price_ = _calculatePrice(dna_);
            price_ -= PUNX_BASE_PRICE;
            return price_;
        } 
        
        return _calculatePrice(dna_);
    }

    function _validateAndRegisterSerialization(bytes32 dna_) internal {
        // Make sure non trait indexes are zero
        for (uint8 categoryIndex_ = TexturePunxTraitStorage.layout().categoryCount; categoryIndex_ < 32; categoryIndex_ += 1) {
            if (dna_[categoryIndex_] != 0x0)
                revert TexturePunxErrors.InvalidSerialization_SpecifiedValueForInvalidParams();
        }

        // Make sure it is unique
        if (TexturePunxCoreStorage.layout().registeredPunx[dna_]) 
            revert TexturePunxErrors.InvalidSerialization_NotUnique();
        
        // Check each trait
        for (uint8 categoryIndex_ = 0; categoryIndex_ < TexturePunxTraitStorage.layout().categoryCount; categoryIndex_ += 1) {
            uint8 traitIndex_ = uint8(dna_[categoryIndex_]);
            if (traitIndex_ >= TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) 
                revert TexturePunxErrors.InvalidSerialization_UndefinedTrait(categoryIndex_);

            TexturePunxTraitStorage.TraitDescription storage ts = TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_];
            if (ts.rarity == TexturePunxTraitStorage.TraitRarity.LIMITED) {
                if (ts.uses > PUNX_LIMITED_COUNT)
                    revert TexturePunxErrors.InvalidSerialization_TraitExceedsMaxUses(categoryIndex_, traitIndex_);
                ts.uses += 1;
            } 
        }

        // Log punx
        TexturePunxCoreStorage.layout().serializedPunx[totalSupply() - 1] = dna_;
        TexturePunxCoreStorage.layout().registeredPunx[dna_] = true;
    }

    function _calculatePrice(bytes32 dna_) internal view returns (uint256 price_) {
        // Initialize price to base
        price_ = PUNX_BASE_PRICE;

        // Three free premium 
        uint8 _premiumCount = 4;

        // Add the price for each
        for (uint8 categoryIndex_ = 0; categoryIndex_ < TexturePunxTraitStorage.layout().categoryCount; categoryIndex_ += 1) {
            uint8 traitIndex_ = uint8(dna_[categoryIndex_]);
            if (traitIndex_ >= TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) continue;

            TexturePunxTraitStorage.TraitRarity rarity_ = TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_].rarity;
            price_ += (rarity_ == TexturePunxTraitStorage.TraitRarity.BASIC) 
                ? 0 
                : (rarity_ == TexturePunxTraitStorage.TraitRarity.PREMIUM) 
                    ? (
                        ((_premiumCount > 0 ? (_premiumCount -= 1) : 0) > 0) 
                            ? 0 
                            : PUNX_PREMIUM_PRICE
                    )
                    : PUNX_LIMITED_PRICE;
        }
        return price_;
    }

    /* ========== FUNCTION ========== */

    function setIsPublicSaleActive(bool isPublicSaleActive_) external onlyOwner {
        TexturePunxMintingStorage.layout().isPublicSaleActive = isPublicSaleActive_;
    }

    function setReservedSupply(uint64 reservedSupply_) external onlyOwner {
        TexturePunxMintingStorage.layout().reservedSupply = reservedSupply_;
    }

    function incrementWhitelistRound(
        bytes32 newRoot_, 
        uint64 mintAllowance_, 
        TexturePunxMintingStorage.WhitelistRoundPricing mintPrice_
    ) external onlyOwner {
        uint64 index = (TexturePunxMintingStorage.layout().nextRound += 1) - 1;

        TexturePunxMintingStorage.layout().round[index].merkelRoot = newRoot_;

        TexturePunxMintingStorage.layout().round[index].mintAllowance = mintAllowance_;
        TexturePunxMintingStorage.layout().round[index].price = mintPrice_;

        TexturePunxMintingStorage.layout().round[index].mintRound = index;
    }

    function mintsAvailable(uint64 mintRound_) view external returns (uint64) {
        if (mintRound_ >= TexturePunxMintingStorage.layout().nextRound) revert TexturePunxErrors.IndexOutOfBounds();
        return TexturePunxMintingStorage.layout().round[mintRound_].mintAllowance - TexturePunxMintingStorage.layout().mintRound[mintRound_][msg.sender];
    }

    /// Trait initialization functions =================================================================

    function setDescription(string memory description_) external onlyOwner {
        TexturePunxCoreStorage.layout().DESCRIPTION = description_;
    }

    function setCategory(uint8 categoryIndex_, string memory name_, bool required_) external onlyOwner {
        if (categoryIndex_ >  TexturePunxTraitStorage.layout().categoryCount) revert TexturePunxErrors.InvalidCategoryIndex();
        if (categoryIndex_ == TexturePunxTraitStorage.layout().categoryCount) {
            TexturePunxTraitStorage.layout().categoryCount += 1;
            TexturePunxTraitStorage.layout().traitCount.push(0);
        }
        TexturePunxTraitStorage.layout().categories[categoryIndex_] = TexturePunxTraitStorage.TraitCategory(
            {
                name: name_,
                required: required_
            }
        );
    }

    function setTraitDescription(uint8 categoryIndex_, uint8 traitIndex_, string memory name_, TexturePunxTraitStorage.TraitRarity rarity_) external onlyOwner {
        if (categoryIndex_ >= TexturePunxTraitStorage.layout().categoryCount) revert TexturePunxErrors.InvalidCategoryIndex();

        if (traitIndex_ >  TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) revert TexturePunxErrors.InvalidTraitIndex();
        if (traitIndex_ == TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) TexturePunxTraitStorage.layout().traitCount[categoryIndex_] += 1;
        TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_] = TexturePunxTraitStorage.TraitDescription(
            {
                name: name_,
                rarity: rarity_,
                uses: 0
            }
        );
    }

    function setTraitSVG(uint8 categoryIndex_, uint8 traitIndex_, bytes calldata svg_) external onlyOwner {
        if (categoryIndex_ >= TexturePunxTraitStorage.layout().categoryCount) revert TexturePunxErrors.InvalidCategoryIndex();
        if (traitIndex_ >= TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) revert TexturePunxErrors.InvalidTraitIndex();        

        TexturePunxTraitStorage.layout().svgs[
            _hashTraitName(
                TexturePunxTraitStorage.layout().categories[categoryIndex_].name, 
                TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_].name
            )
        ] = svg_;
    }

    function setBackgroundSVG(bytes calldata svg_) external onlyOwner {
        TexturePunxTraitStorage.layout().background = svg_;
    }

    /// Internal render functions ======================================================================

    function _build(uint256 tokenId_) internal view returns (string memory properties, string memory svg) {
        // Grab the trait / dna for the punx
        bytes32 dna_ = TexturePunxCoreStorage.layout().serializedPunx[tokenId_];

        return (
            _properties(dna_), 
            _render(dna_)
        );
    }
    
    function _render(bytes32 dna_) public view returns (string memory svg) {
        bytes memory resp = abi.encodePacked(svgStart);
        resp = bytes.concat(resp, TexturePunxTraitStorage.layout().background);

        for (uint8 categoryIndex_ = 0; categoryIndex_ < TexturePunxTraitStorage.layout().categoryCount; categoryIndex_ += 1) {
            if (dna_[categoryIndex_] == 0x00 && !TexturePunxTraitStorage.layout().categories[categoryIndex_].required) continue;
            resp = bytes.concat(
                resp, 
                abi.encodePacked(
                    getTraitSVG(categoryIndex_, uint8(dna_[categoryIndex_]))
                )
            );       
        }

        return string(
            bytes.concat(
                resp, 
                abi.encodePacked(svgEnd)
            )
        );
    }
    
    function _properties(bytes32 dna_) internal view returns (string memory properties) {
        bytes memory resp;

        for (uint8 categoryIndex_ = 0; categoryIndex_ < TexturePunxTraitStorage.layout().categoryCount; categoryIndex_ += 1) {
            if (uint8(dna_[categoryIndex_]) == 0 && !TexturePunxTraitStorage.layout().categories[categoryIndex_].required) continue;
            resp = bytes.concat(
                resp, 
                abi.encodePacked(
                    _packProperty(
                        TexturePunxTraitStorage.layout().categories[categoryIndex_].name, 
                        TexturePunxTraitStorage.layout().traits[categoryIndex_][uint8(dna_[categoryIndex_])].name, 
                        categoryIndex_ == 0 // TexturePunxTraitStorage.layout().categoryCount - 1
                    )
                )
            );       
        }

        return string(resp);
    }
            
    function _packProperty(string memory name_, string memory trait_, bool first_) public pure returns (string memory svg) {
        string memory comma_ = ","; 
        if (first_) {
            comma_ = ""; 
        }
        return string(
            abi.encodePacked(
                comma_,
                '{"trait_type":"',
                name_,
                '","value":"',
                trait_,
                '"}'
            )
        );
    }

    /// Trait accessor functions =======================================================================

    function getDNA(uint256 tokenId_) external view returns (bytes32) {
        return TexturePunxCoreStorage.layout().serializedPunx[tokenId_];
    }

    function getCategory(uint8 categoryIndex_) external view returns (TexturePunxTraitStorage.TraitCategory memory) {
        if (categoryIndex_ >=  TexturePunxTraitStorage.layout().categoryCount) revert TexturePunxErrors.IndexOutOfBounds();
        return TexturePunxTraitStorage.layout().categories[categoryIndex_];
    }

    function getTraitDescription(uint8 categoryIndex_, uint8 traitIndex_) external view returns (TexturePunxTraitStorage.TraitDescription memory) {
        if (categoryIndex_ >=  TexturePunxTraitStorage.layout().categoryCount) revert TexturePunxErrors.IndexOutOfBounds();
        if (traitIndex_ >=  TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) revert TexturePunxErrors.IndexOutOfBounds();
        return TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_];
    }

    function getTraitSVG(uint8 categoryIndex_, uint8 traitIndex_) public view returns (bytes memory) {
        if (categoryIndex_ >=  TexturePunxTraitStorage.layout().categoryCount) revert TexturePunxErrors.IndexOutOfBounds();
        if (traitIndex_ >=  TexturePunxTraitStorage.layout().traitCount[categoryIndex_]) revert TexturePunxErrors.IndexOutOfBounds();
        
        return TexturePunxTraitStorage.layout().svgs[
            _hashTraitName(
                TexturePunxTraitStorage.layout().categories[categoryIndex_].name, 
                TexturePunxTraitStorage.layout().traits[categoryIndex_][traitIndex_].name
            )
        ];
    }

    function getTraitByName(string memory categoryName_, string memory traitName_) internal view returns (bytes memory) {
        return TexturePunxTraitStorage.layout().svgs[_hashTraitName(categoryName_, traitName_)];
    }

    function _hashTraitName(string memory categoryName_, string memory traitName_) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("texture.punx.", categoryName_, ".", traitName_));
    }

    function getSerialization(uint256 tokenId_) external view returns (bytes32) {
        if (tokenId_ >= totalSupply()) 
            revert TexturePunxErrors.TokenDoesNotExist();
        return TexturePunxCoreStorage.layout().serializedPunx[tokenId_];
    }

    /// Function overrides =============================================================================

    /// @dev See {IERC721Metadata-tokenURI}.
    function tokenURI(uint256 tokenId_) public view virtual override tokenExists(tokenId_) returns (string memory) {
        (string memory properties, string memory svg) = _build(tokenId_);

        return string(
            abi.encodePacked(
                "data:application/json;base64,",
                base64(
                    abi.encodePacked(
                        '{"name":"#', 
                        tokenId_.toString(),
                        '","description":"', 
                        TexturePunxCoreStorage.layout().DESCRIPTION, 
                        '","traits":[', 
                        properties, 
                        '],"image":"data:image/svg+xml;base64,',
                        base64(abi.encodePacked(svg)),
                        '"}'
                    )
                )
            )
        );
    }

    function withdraw() public {
        (bool success_,) = TexturePunxPaymentStorage.layout().mintForwarder.call{value : address(this).balance}("");
        if (!success_) revert TexturePunxErrors.WithdrawTransferFailed();
    }

    function withdrawTokens(IERC20Upgradeable token) public {
        token.safeTransfer(
            TexturePunxPaymentStorage.layout().mintForwarder, 
            token.balanceOf(address(this))
        );
    }

    /// @dev See {IERC165-introspection}.
    function supportsInterface(bytes4 interfaceId_)
    public view virtual override(ERC721EnumerableUpgradeable, IERC165Upgradeable)
    returns (bool)
    {
        return
            interfaceId_ == type(IERC2981Upgradeable).interfaceId ||
            super.supportsInterface(interfaceId_);
    }

    /// @dev See {IERC165-royaltyInfo}.
    function royaltyInfo(uint256 tokenId_, uint256 salePrice_)
    external view override
    tokenExists(tokenId_)
    returns (address receiver, uint256 royaltyAmount)
    {
        return (TexturePunxPaymentStorage.layout().royaltyForwarder, salePrice_.mulDivDown(50, 1000));
    }

    /// Base64 encoding ================================================================================

    string internal constant TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

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

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

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

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

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

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

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

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

            // run over the input, 3 bytes at a time
            for {} lt(dataPtr, endPtr) {}
            {
                dataPtr := add(dataPtr, 3)

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

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

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

        return result;
    }
}

File 2 of 25 : IERC20Upgradeable.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 IERC20Upgradeable {
    /**
     * @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 3 of 25 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

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

File 4 of 25 : IERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981Upgradeable is IERC165Upgradeable {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 5 of 25 : MerkleProofUpgradeable.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 tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * 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.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProofUpgradeable {
    /**
     * @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 simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _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}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _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 sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _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}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _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 6 of 25 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../extensions/draft-IERC20PermitUpgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20PermitUpgradeable 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(IERC20Upgradeable 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 25 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _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) {
        unchecked {
            uint256 length = MathUpgradeable.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.log256(value) + 1);
        }
    }

    /**
     * @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] = _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 8 of 25 : FixedPointMathLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
    /*//////////////////////////////////////////////////////////////
                    SIMPLIFIED FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.

    function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
    }

    function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
    }

    function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
    }

    function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
        return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
    }

    /*//////////////////////////////////////////////////////////////
                    LOW LEVEL FIXED POINT OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function mulDivDown(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // Divide z by the denominator.
            z := div(z, denominator)
        }
    }

    function mulDivUp(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 z) {
        assembly {
            // Store x * y in z for now.
            z := mul(x, y)

            // Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
            if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
                revert(0, 0)
            }

            // First, divide z - 1 by the denominator and add 1.
            // We allow z - 1 to underflow if z is 0, because we multiply the
            // end result by 0 if z is zero, ensuring we return 0 if z is zero.
            z := mul(iszero(iszero(z)), add(div(sub(z, 1), denominator), 1))
        }
    }

    function rpow(
        uint256 x,
        uint256 n,
        uint256 scalar
    ) internal pure returns (uint256 z) {
        assembly {
            switch x
            case 0 {
                switch n
                case 0 {
                    // 0 ** 0 = 1
                    z := scalar
                }
                default {
                    // 0 ** n = 0
                    z := 0
                }
            }
            default {
                switch mod(n, 2)
                case 0 {
                    // If n is even, store scalar in z for now.
                    z := scalar
                }
                default {
                    // If n is odd, store x in z for now.
                    z := x
                }

                // Shifting right by 1 is like dividing by 2.
                let half := shr(1, scalar)

                for {
                    // Shift n right by 1 before looping to halve it.
                    n := shr(1, n)
                } n {
                    // Shift n right by 1 each iteration to halve it.
                    n := shr(1, n)
                } {
                    // Revert immediately if x ** 2 would overflow.
                    // Equivalent to iszero(eq(div(xx, x), x)) here.
                    if shr(128, x) {
                        revert(0, 0)
                    }

                    // Store x squared.
                    let xx := mul(x, x)

                    // Round to the nearest number.
                    let xxRound := add(xx, half)

                    // Revert if xx + half overflowed.
                    if lt(xxRound, xx) {
                        revert(0, 0)
                    }

                    // Set x to scaled xxRound.
                    x := div(xxRound, scalar)

                    // If n is even:
                    if mod(n, 2) {
                        // Compute z * x.
                        let zx := mul(z, x)

                        // If z * x overflowed:
                        if iszero(eq(div(zx, x), z)) {
                            // Revert if x is non-zero.
                            if iszero(iszero(x)) {
                                revert(0, 0)
                            }
                        }

                        // Round to the nearest number.
                        let zxRound := add(zx, half)

                        // Revert if zx + half overflowed.
                        if lt(zxRound, zx) {
                            revert(0, 0)
                        }

                        // Return properly scaled zxRound.
                        z := div(zxRound, scalar)
                    }
                }
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                        GENERAL NUMBER UTILITIES
    //////////////////////////////////////////////////////////////*/

    function sqrt(uint256 x) internal pure returns (uint256 z) {
        assembly {
            // Start off with z at 1.
            z := 1

            // Used below to help find a nearby power of 2.
            let y := x

            // Find the lowest power of 2 that is at least sqrt(x).
            if iszero(lt(y, 0x100000000000000000000000000000000)) {
                y := shr(128, y) // Like dividing by 2 ** 128.
                z := shl(64, z) // Like multiplying by 2 ** 64.
            }
            if iszero(lt(y, 0x10000000000000000)) {
                y := shr(64, y) // Like dividing by 2 ** 64.
                z := shl(32, z) // Like multiplying by 2 ** 32.
            }
            if iszero(lt(y, 0x100000000)) {
                y := shr(32, y) // Like dividing by 2 ** 32.
                z := shl(16, z) // Like multiplying by 2 ** 16.
            }
            if iszero(lt(y, 0x10000)) {
                y := shr(16, y) // Like dividing by 2 ** 16.
                z := shl(8, z) // Like multiplying by 2 ** 8.
            }
            if iszero(lt(y, 0x100)) {
                y := shr(8, y) // Like dividing by 2 ** 8.
                z := shl(4, z) // Like multiplying by 2 ** 4.
            }
            if iszero(lt(y, 0x10)) {
                y := shr(4, y) // Like dividing by 2 ** 4.
                z := shl(2, z) // Like multiplying by 2 ** 2.
            }
            if iszero(lt(y, 0x8)) {
                // Equivalent to 2 ** z.
                z := shl(1, z)
            }

            // Shifting right by 1 is like dividing by 2.
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))
            z := shr(1, add(z, div(x, z)))

            // Compute a rounded down version of z.
            let zRoundDown := div(x, z)

            // If zRoundDown is smaller, use it.
            if lt(zRoundDown, z) {
                z := zRoundDown
            }
        }
    }
}

File 9 of 25 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

File 11 of 25 : ERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
    function __ERC721Enumerable_init() internal onlyInitializing {
    }

    function __ERC721Enumerable_init_unchained() internal onlyInitializing {
    }
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

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

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

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

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

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

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

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

    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);

        if (batchSize > 1) {
            // Will only trigger during construction. Batch transferring (minting) is not available afterwards.
            revert("ERC721Enumerable: consecutive transfers not supported");
        }

        uint256 tokenId = firstTokenId;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    uint256 private _status;

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

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }

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

File 13 of 25 : TexturePunxStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

library TexturePunxCoreStorage {
    struct Layout {
        /// DNA Sequences For Minted Punx ==================================================================

        mapping (uint256 => bytes32) serializedPunx;
        mapping (bytes32 => bool)    registeredPunx;
        
        string DESCRIPTION;
    }

    bytes32 constant SLO = keccak256("texturePunx.storage.v1.core");

    function init() internal { 
        layout().DESCRIPTION = "Texture Punx - metadata & img fully on chain, forever.";
    }

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = SLO;
        assembly {
            l.slot := slot
        }
    }
}

library TexturePunxPaymentStorage {
    struct Layout {
        /// Forwarding contracts for handing royalties and mint share ======================================

        address payable mintForwarder;
        address payable royaltyForwarder;
    }

    bytes32 constant SLO = keccak256("texturePunx.storage.v1.payments");

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = SLO;
        assembly {
            l.slot := slot
        }
    }
}

library TexturePunxTraitStorage {
    enum TraitRarity {
        BASIC,
        PREMIUM,
        LIMITED
    }

    struct TraitCategory {
        string name;
        bool   required;
    }

    struct TraitDescription {
        string name;
        TraitRarity rarity;
        uint64 uses;
    }

    struct Layout {
        /// Trait Variables ================================================================================

        mapping (uint8 => TraitCategory) categories;
        uint8 categoryCount;

        mapping (uint8 => mapping (uint8 => TraitDescription)) traits;
        uint8[] traitCount;

        mapping (bytes32 => bytes) svgs;

        bytes background;
    }

    bytes32 constant SLO = keccak256("texturePunx.storage.v1.traits");

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = SLO;
        assembly {
            l.slot := slot
        }
    }
}

library TexturePunxMintingStorage {
    enum WhitelistRoundPricing {
        FREE,
        VIP,
        PAID
    }

    struct WhitelistRound {
        bytes32 merkelRoot;
        uint64  mintRound;
        uint64  mintAllowance;

        WhitelistRoundPricing price;
    }

    struct Layout {
        /// Minting & Whitelist Variables ==================================================================

        bool isPublicSaleActive;

        uint64 reservedSupply;

        mapping (uint64 => WhitelistRound) round;
        uint64 nextRound;

        mapping (uint64 => mapping (address => uint64)) mintRound;
    }

    bytes32 constant SLO = keccak256("texturePunx.storage.v1.minting");

    function init() internal { 
        layout().isPublicSaleActive = false;
        layout().reservedSupply = 120;
    }

    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = SLO;
        assembly {
            l.slot := slot
        }
    }
}

File 14 of 25 : TexturePunxErrors.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

contract TexturePunxErrors {
    error PublicSaleNotActive();
    error QuantityExceedsMaxSupply();
    error QuantityExceedsReservedSupply();
    error NotEnoughETH();
    error AlreadyMinted();
    error TokenDoesNotExist();

    error InvalidDNASequence();

    error InvalidSerialization_SpecifiedValueForInvalidParams();
    error InvalidSerialization_NotUnique();
    error InvalidSerialization_UndefinedTrait(uint8 categoryId);
    error InvalidSerialization_MissingRequiredTrait(uint8 categoryId);
    error InvalidSerialization_TraitExceedsMaxUses(uint8 categoryId, uint8 traitId);


    error NotPermissionedMinter();
    error NotOnWhitelist();

    error InvalidMintRound();
    error InvalidCategoryIndex();
    error InvalidTraitIndex();
    error IndexOutOfBounds();

    error WithdrawTransferFailed();
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 16 of 25 : draft-IERC20PermitUpgradeable.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 IERC20PermitUpgradeable {
    /**
     * @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 17 of 25 : AddressUpgradeable.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 AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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 18 of 25 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

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

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
    using AddressUpgradeable for address;
    using StringsUpgradeable 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.
     */
    function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
        __ERC721_init_unchained(name_, symbol_);
    }

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view 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 = _ownerOf(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 = ERC721Upgradeable.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner or 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 or 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 or 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 the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @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 _ownerOf(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 = ERC721Upgradeable.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, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721Upgradeable.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721Upgradeable.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

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

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

    /**
     * @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(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

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

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721Upgradeable.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 IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721ReceiverUpgradeable.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. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256, /* firstTokenId */
        uint256 batchSize
    ) internal virtual {
        if (batchSize > 1) {
            if (from != address(0)) {
                _balances[from] -= batchSize;
            }
            if (to != address(0)) {
                _balances[to] += batchSize;
            }
        }
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}

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

File 21 of 25 : IERC721EnumerableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * 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 23 of 25 : IERC721ReceiverUpgradeable.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 IERC721ReceiverUpgradeable {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.0;

import "../IERC721Upgradeable.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

Settings
{
  "remappings": [
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin-not-upgradeable/=lib/openzeppelin-contracts/contracts/",
    "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "script/=script/",
    "solmate/=lib/solmate/src/",
    "src/=src/",
    "test/=test/",
    "src/=src/",
    "test/=test/",
    "script/=script/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"AlreadyMinted","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[],"name":"InvalidCategoryIndex","type":"error"},{"inputs":[],"name":"InvalidMintRound","type":"error"},{"inputs":[],"name":"InvalidSerialization_NotUnique","type":"error"},{"inputs":[],"name":"InvalidSerialization_SpecifiedValueForInvalidParams","type":"error"},{"inputs":[{"internalType":"uint8","name":"categoryId","type":"uint8"},{"internalType":"uint8","name":"traitId","type":"uint8"}],"name":"InvalidSerialization_TraitExceedsMaxUses","type":"error"},{"inputs":[{"internalType":"uint8","name":"categoryId","type":"uint8"}],"name":"InvalidSerialization_UndefinedTrait","type":"error"},{"inputs":[],"name":"InvalidTraitIndex","type":"error"},{"inputs":[],"name":"NotEnoughETH","type":"error"},{"inputs":[],"name":"NotOnWhitelist","type":"error"},{"inputs":[],"name":"PublicSaleNotActive","type":"error"},{"inputs":[],"name":"QuantityExceedsMaxSupply","type":"error"},{"inputs":[],"name":"QuantityExceedsReservedSupply","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"WithdrawTransferFailed","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":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DESCRIPTION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUNX_BASE_PRICE","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUNX_LIMITED_COUNT","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUNX_LIMITED_PRICE","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUNX_PREMIUM_PRICE","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"controller_","type":"address"},{"internalType":"address payable","name":"mintForwarder_","type":"address"},{"internalType":"address payable","name":"royaltyForwarder_","type":"address"}],"name":"__initialize_texturePunx_v1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"trait_","type":"string"},{"internalType":"bool","name":"first_","type":"bool"}],"name":"_packProperty","outputs":[{"internalType":"string","name":"svg","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dna_","type":"bytes32"}],"name":"_render","outputs":[{"internalType":"string","name":"svg","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentRound","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dna_","type":"bytes32"},{"internalType":"bytes32[]","name":"merkleProof_","type":"bytes32[]"}],"name":"ethCoreDevMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"categoryIndex_","type":"uint8"}],"name":"getCategory","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"bool","name":"required","type":"bool"}],"internalType":"struct TexturePunxTraitStorage.TraitCategory","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"getDNA","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"getSerialization","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"categoryIndex_","type":"uint8"},{"internalType":"uint8","name":"traitIndex_","type":"uint8"}],"name":"getTraitDescription","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"enum TexturePunxTraitStorage.TraitRarity","name":"rarity","type":"uint8"},{"internalType":"uint64","name":"uses","type":"uint64"}],"internalType":"struct TexturePunxTraitStorage.TraitDescription","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"categoryIndex_","type":"uint8"},{"internalType":"uint8","name":"traitIndex_","type":"uint8"}],"name":"getTraitSVG","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newRoot_","type":"bytes32"},{"internalType":"uint64","name":"mintAllowance_","type":"uint64"},{"internalType":"enum TexturePunxMintingStorage.WhitelistRoundPricing","name":"mintPrice_","type":"uint8"}],"name":"incrementWhitelistRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPublicSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"categoryIndex_","type":"uint8"},{"internalType":"uint8","name":"traitIndex_","type":"uint8"}],"name":"isTraitAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dna_","type":"bytes32"}],"name":"isUniqueSerialization","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dna_","type":"bytes32"}],"name":"mintPrice","outputs":[{"internalType":"uint256","name":"price_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"dna_","type":"bytes32"}],"name":"mintPromotional","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver_","type":"address"},{"internalType":"bytes32","name":"dna_","type":"bytes32"}],"name":"mintReserved","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_round","type":"uint64"},{"internalType":"address","name":"_address","type":"address"}],"name":"mintRound","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"mintRound_","type":"uint64"}],"name":"mintsAvailable","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"dna_","type":"bytes32"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"index_","type":"uint64"}],"name":"round","outputs":[{"components":[{"internalType":"bytes32","name":"merkelRoot","type":"bytes32"},{"internalType":"uint64","name":"mintRound","type":"uint64"},{"internalType":"uint64","name":"mintAllowance","type":"uint64"},{"internalType":"enum TexturePunxMintingStorage.WhitelistRoundPricing","name":"price","type":"uint8"}],"internalType":"struct TexturePunxMintingStorage.WhitelistRound","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"salePrice_","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","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":"bytes","name":"svg_","type":"bytes"}],"name":"setBackgroundSVG","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"categoryIndex_","type":"uint8"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"bool","name":"required_","type":"bool"}],"name":"setCategory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"description_","type":"string"}],"name":"setDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isPublicSaleActive_","type":"bool"}],"name":"setIsPublicSaleActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"reservedSupply_","type":"uint64"}],"name":"setReservedSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"categoryIndex_","type":"uint8"},{"internalType":"uint8","name":"traitIndex_","type":"uint8"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"enum TexturePunxTraitStorage.TraitRarity","name":"rarity_","type":"uint8"}],"name":"setTraitDescription","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"categoryIndex_","type":"uint8"},{"internalType":"uint8","name":"traitIndex_","type":"uint8"},{"internalType":"bytes","name":"svg_","type":"bytes"}],"name":"setTraitSVG","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId_","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"mintRound_","type":"uint64"},{"internalType":"bytes32","name":"dna_","type":"bytes32"},{"internalType":"bytes32[]","name":"merkleProof_","type":"bytes32[]"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"mintRound_","type":"uint64"},{"internalType":"bytes32","name":"dna_","type":"bytes32"}],"name":"whitelistPrice","outputs":[{"internalType":"uint256","name":"price_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistRound","outputs":[{"internalType":"uint64","name":"roundNumber_","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Upgradeable","name":"token","type":"address"}],"name":"withdrawTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50615d0280620000216000396000f3fe6080604052600436106103905760003560e01c8063887b98b9116101dc578063bcdfb0b911610102578063e48fa0ea116100a0578063f2fde38b1161006f578063f2fde38b14610a75578063fe147ed614610a95578063fe28bebd14610ab5578063ffeb1db514610acb57600080fd5b8063e48fa0ea146109d7578063e985e9c5146109f7578063ec087b4114610a40578063f1ae885614610a6057600080fd5b8063cd202ba5116100dc578063cd202ba514610957578063cdad63fc14610984578063ceb58fcb146109a4578063e2dd5905146109b757600080fd5b8063bcdfb0b9146108fc578063bf4732e31461091c578063c87b56dd1461093757600080fd5b80639814de4d1161017a578063a3a46b6f11610149578063a3a46b6f1461089c578063a402129914610798578063b88d4fde146108bc578063bb3eea86146108dc57600080fd5b80639814de4d1461081c5780639a1e6cc11461083c5780639bd1b9c11461085c578063a22cb4651461087c57600080fd5b806390c3f38f116101b657806390c3f38f146107cb57806392b53cd2146107eb57806395d89b411461080757806398030985146107eb57600080fd5b8063887b98b91461076b5780638a19c8bc146107985780638da5cb5b146107ad57600080fd5b80632f745c59116102c157806350ecf68e1161025f578063666347c61161022e578063666347c6146106f657806370a0823114610716578063715018a61461073657806374eedda81461074b57600080fd5b806350ecf68e146106835780635bb209a5146106a35780636352211e146106c357806365bb40e1146106e357600080fd5b80633ccfd60b1161029b5780633ccfd60b1461060e57806342842e0e1461062357806349df728c146106435780634f6ccce71461066357600080fd5b80632f745c59146105c5578063304a9d0d146105e557806332cb6b0c146105f857600080fd5b806318160ddd1161032e5780632578e727116103085780632578e7271461052657806328904ab11461054657806328cad13d146105665780632a55205a1461058657600080fd5b806318160ddd146104d25780631e84c413146104f157806323b872dd1461050657600080fd5b806306fdde031161036a57806306fdde0314610420578063081812fc14610442578063095ea7b31461047a578063147d4c1e1461049a57600080fd5b806301ffc9a71461039c578063027dd1ad146103d15780630537ff22146103fe57600080fd5b3661039757005b600080fd5b3480156103a857600080fd5b506103bc6103b7366004614b29565b610aeb565b60405190151581526020015b60405180910390f35b3480156103dd57600080fd5b506103f16103ec366004614b5c565b610b16565b6040516103c89190614c1b565b34801561040a57600080fd5b5061041e610419366004614c80565b610ce5565b005b34801561042c57600080fd5b50610435610d61565b6040516103c89190614cac565b34801561044e57600080fd5b5061046261045d366004614cbf565b610df3565b6040516001600160a01b0390911681526020016103c8565b34801561048657600080fd5b5061041e610495366004614c80565b610e1a565b3480156104a657600080fd5b506104ba6104b5366004614cef565b610f2f565b6040516001600160401b0390911681526020016103c8565b3480156104de57600080fd5b5060cb545b6040519081526020016103c8565b3480156104fd57600080fd5b506103bc610f75565b34801561051257600080fd5b5061041e610521366004614d26565b610f88565b34801561053257600080fd5b5061041e610541366004614d67565b610fb9565b34801561055257600080fd5b5061041e610561366004614dca565b610ff3565b34801561057257600080fd5b5061041e610581366004614e19565b611014565b34801561059257600080fd5b506105a66105a1366004614e36565b611037565b604080516001600160a01b0390931683526020830191909152016103c8565b3480156105d157600080fd5b506104e36105e0366004614c80565b6110b5565b61041e6105f3366004614e9c565b61114b565b34801561060457600080fd5b506104ba61271081565b34801561061a57600080fd5b5061041e611414565b34801561062f57600080fd5b5061041e61063e366004614d26565b6114aa565b34801561064f57600080fd5b5061041e61065e366004614ef5565b6114c5565b34801561066f57600080fd5b506104e361067e366004614cbf565b611567565b34801561068f57600080fd5b5061041e61069e366004614fbd565b6115fa565b3480156106af57600080fd5b506104e36106be366004614cbf565b611720565b3480156106cf57600080fd5b506104626106de366004614cbf565b611743565b61041e6106f136600461501e565b6117a3565b34801561070257600080fd5b50610435610711366004615069565b611ac5565b34801561072257600080fd5b506104e3610731366004614ef5565b611b25565b34801561074257600080fd5b5061041e611bab565b34801561075757600080fd5b50610435610766366004614cbf565b611bbf565b34801561077757600080fd5b5061078b6107863660046150c4565b611d73565b6040516103c891906150df565b3480156107a457600080fd5b506104ba611e87565b3480156107b957600080fd5b506033546001600160a01b0316610462565b3480156107d757600080fd5b5061041e6107e6366004615113565b611eaf565b3480156107f757600080fd5b506104ba67016345785d8a000081565b34801561081357600080fd5b50610435611ee6565b34801561082857600080fd5b506103bc610837366004614b5c565b611ef5565b34801561084857600080fd5b5061041e610857366004615154565b611f6b565b34801561086857600080fd5b506104e36108773660046151c4565b612187565b34801561088857600080fd5b5061041e6108973660046151e0565b612225565b3480156108a857600080fd5b5061041e6108b736600461520e565b612230565b3480156108c857600080fd5b5061041e6108d7366004615262565b612459565b3480156108e857600080fd5b506103bc6108f7366004614cbf565b61248b565b34801561090857600080fd5b50610435610917366004614b5c565b61269f565b34801561092857600080fd5b506104ba66b1a2bc2ec5000081565b34801561094357600080fd5b50610435610952366004614cbf565b6128c1565b34801561096357600080fd5b50610977610972366004614d67565b612996565b6040516103c891906152e1565b34801561099057600080fd5b506104e361099f366004614cbf565b612a83565b61041e6109b2366004614cbf565b612ac1565b3480156109c357600080fd5b506104e36109d2366004614cbf565b612b8f565b3480156109e357600080fd5b506104ba6109f2366004614d67565b612b9a565b348015610a0357600080fd5b506103bc610a1236600461532b565b6001600160a01b039182166000908152609c6020908152604080832093909416825291909152205460ff1690565b348015610a4c57600080fd5b5061041e610a5b366004615349565b612c42565b348015610a6c57600080fd5b50610435612e36565b348015610a8157600080fd5b5061041e610a90366004614ef5565b612e55565b348015610aa157600080fd5b5061041e610ab0366004614c80565b612ecb565b348015610ac157600080fd5b506104ba6101f481565b348015610ad757600080fd5b5061041e610ae6366004615389565b612f64565b60006001600160e01b0319821663152a902d60e11b1480610b105750610b10826130c0565b92915050565b6040805160608082018352815260006020820181905291810191909152610b3b6130e5565b6001015460ff90811690841610610b6557604051634e23d03560e01b815260040160405180910390fd5b610b6d6130e5565b6003018360ff1681548110610b8457610b846153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168260ff1610610bc957604051634e23d03560e01b815260040160405180910390fd5b610bd16130e5565b60ff808516600090815260029290920160209081526040808420928616845291905290819020815160608101909252805482908290610c0f906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3b906153d4565b8015610c885780601f10610c5d57610100808354040283529160200191610c88565b820191906000526020600020905b815481529060010190602001808311610c6b57829003601f168201915b5050509183525050600182015460209091019060ff166002811115610caf57610caf614be7565b6002811115610cc057610cc0614be7565b81526001919091015461010090046001600160401b0316602090910152905092915050565b610ced613109565b80610d0083610cfb60cb5490565b613163565b610d0861317d565b54610d239061010090046001600160401b031661271061541e565b6001600160401b0316610d3560cb5490565b10610d5357604051636539edef60e11b815260040160405180910390fd5b610d5c816131a1565b505050565b606060978054610d70906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054610d9c906153d4565b8015610de95780601f10610dbe57610100808354040283529160200191610de9565b820191906000526020600020905b815481529060010190602001808311610dcc57829003601f168201915b5050505050905090565b6000610dfe82613467565b506000908152609b60205260409020546001600160a01b031690565b6000610e2582611743565b9050806001600160a01b0316836001600160a01b031603610e975760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610eb35750610eb38133610a12565b610f255760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610e8e565b610d5c83836134c6565b6000610f3961317d565b6001600160401b038085166000908152600392909201602090815260408084206001600160a01b03871685529091529091205416905092915050565b6000610f7f61317d565b5460ff16919050565b610f923382613534565b610fae5760405162461bcd60e51b8152600401610e8e90615446565b610d5c8383836135b2565b610fc1613109565b80610fca61317d565b80546001600160401b03929092166101000268ffffffffffffffff001990921691909117905550565b610ffb613109565b81816110056130e5565b60050191610d5c9190836154e1565b61101c613109565b8061102561317d565b805460ff191691151591909117905550565b600082815260996020526040812054819084906001600160a01b03166110705760405163677510db60e11b815260040160405180910390fd5b7ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a585546001600160a01b03166110a98560326103e8613723565b92509250509250929050565b60006110c083611b25565b82106111225760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e8e565b506001600160a01b0391909116600090815260c960209081526040808320938352929052205490565b8284848484600061115a61317d565b6001600160401b038681166000908152600192830160209081526040918290208251608081018452815481529481015480851692860192909252600160401b8204909316918401919091526060830190600160801b900460ff1660028111156111c5576111c5614be7565b60028111156111d6576111d6614be7565b9052506040516bffffffffffffffffffffffff193360601b1660208201529091506000906034016040516020818303038152906040528051906020012090506112558484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505085519150849050613742565b6112725760405163522fc3bd60e01b815260040160405180910390fd5b81604001516001600160401b031661128861317d565b6001600160401b038089166000908152600392909201602090815260408084203385529091529091205416106112d157604051631bbdf5c560e31b815260040160405180910390fd5b6112db8686612187565b3410156112fb57604051632c1d501360e11b815260040160405180910390fd5b600161130561317d565b6001600160401b038089166000908152600392909201602090815260408084203385529091528220805490929161133e918591166155a0565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555061136a613758565b8a6001600160401b03166000036113945760405163e78656d960e01b815260040160405180910390fd5b6113a133610cfb60cb5490565b6113ab600160fb55565b5050505050506113b961317d565b546113d49061010090046001600160401b031661271061541e565b6001600160401b03166113e660cb5490565b1061140457604051636539edef60e11b815260040160405180910390fd5b61140d816131a1565b5050505050565b7ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a584546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611480576040519150601f19603f3d011682016040523d82523d6000602084013e611485565b606091505b50509050806114a7576040516369a4751b60e01b815260040160405180910390fd5b50565b610d5c83838360405180602001604052806000815250612459565b6114a77ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a584546040516370a0823160e01b81523060048201526001600160a01b03918216918416906370a0823190602401602060405180830381865afa158015611532573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155691906155cb565b6001600160a01b03841691906137b8565b600061157260cb5490565b82106115d55760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e8e565b60cb82815481106115e8576115e86153be565b90600052602060002001549050919050565b611602613109565b61160a6130e5565b6001015460ff908116908416111561163557604051630c5bf2ff60e41b815260040160405180910390fd5b61163d6130e5565b6001015460ff908116908416036116bf5760016116586130e5565b600101805460009061166e90849060ff166155e4565b92506101000a81548160ff021916908360ff16021790555061168e6130e5565b600301805460018101825560009182526020918290209181049091018054601f9092166101000a60ff021990911690555b60405180604001604052808381526020018215158152506116de6130e5565b60ff8516600090815260209190915260409020815181906116ff9082615609565b50602091909101516001909101805460ff1916911515919091179055505050565b6000600080516020615cad8339815191525b600092835260205250604090205490565b6000818152609960205260408120546001600160a01b031680610b105760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e8e565b82600084848460006117b361317d565b6001600160401b038681166000908152600192830160209081526040918290208251608081018452815481529481015480851692860192909252600160401b8204909316918401919091526060830190600160801b900460ff16600281111561181e5761181e614be7565b600281111561182f5761182f614be7565b9052506040516bffffffffffffffffffffffff193360601b1660208201529091506000906034016040516020818303038152906040528051906020012090506118ae8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505085519150849050613742565b6118cb5760405163522fc3bd60e01b815260040160405180910390fd5b81604001516001600160401b03166118e161317d565b6001600160401b0380891660009081526003929092016020908152604080842033855290915290912054161061192a57604051631bbdf5c560e31b815260040160405180910390fd5b6119348686612187565b34101561195457604051632c1d501360e11b815260040160405180910390fd5b600161195e61317d565b6001600160401b0380891660009081526003929092016020908152604080842033855290915282208054909291611997918591166155a0565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506119c3613758565b6119cb61317d565b5461010090046001600160401b03166000036119fa57604051631e62d8bb60e11b815260040160405180910390fd5b6001611a0461317d565b8054600190611a2290849061010090046001600160401b031661541e565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550611a5333610cfb60cb5490565b611a5d600160fb55565b505050505050611a6b61317d565b54611a869061010090046001600160401b031661271061541e565b6001600160401b0316611a9860cb5490565b10611ab657604051636539edef60e11b815260040160405180910390fd5b611abf816131a1565b50505050565b6040805180820190915260018152600b60fa1b60208201526060908215611af757506040805160208101909152600081525b808585604051602001611b0c939291906156c8565b6040516020818303038152906040529150509392505050565b60006001600160a01b038216611b8f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610e8e565b506001600160a01b03166000908152609a602052604090205490565b611bb3613109565b611bbd600061380a565b565b606060006040518060a0016040528060758152602001615bc260759139604051602001611bec919061574e565b604051602081830303815290604052905080611c066130e5565b600501604051602001611c1a9291906157dd565b604051602081830303815290604052905060005b611c366130e5565b6001015460ff9081169082161015611d0d57838160ff1660208110611c5d57611c5d6153be565b1a60f81b6001600160f81b031916158015611c975750611c7b6130e5565b60ff808316600090815260209290925260409091206001015416155b611cfb5781611cbb82868460ff1660208110611cb557611cb56153be565b1a61269f565b604051602001611ccb919061574e565b60408051601f1981840301815290829052611ce99291602001615804565b60405160208183030381529060405291505b611d066001826155e4565b9050611c2e565b5080604051806040016040528060068152602001651e17b9bb339f60d11b815250604051602001611d3e919061574e565b60408051601f1981840301815290829052611d5c9291602001615804565b604051602081830303815290604052915050919050565b604080518082019091526060815260006020820152611d906130e5565b6001015460ff90811690831610611dba57604051634e23d03560e01b815260040160405180910390fd5b611dc26130e5565b60ff831660009081526020919091526040908190208151808301909252805482908290611dee906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1a906153d4565b8015611e675780601f10611e3c57610100808354040283529160200191611e67565b820191906000526020600020905b815481529060010190602001808311611e4a57829003601f168201915b50505091835250506001919091015460ff16151560209091015292915050565b60006001611e9361317d565b60020154611eaa91906001600160401b031661541e565b905090565b611eb7613109565b7f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cc611ee28282615609565b5050565b606060988054610d70906153d4565b600080611f006130e5565b60ff80861660009081526002928301602090815260408083209388168352929052209150600182015460ff166002811115611f3d57611f3d614be7565b14611f49576001611f63565b60018101546101f46101009091046001600160401b031611155b949350505050565b611f73613109565b611f7b6130e5565b6001015460ff90811690851610611fa557604051630c5bf2ff60e41b815260040160405180910390fd5b611fad6130e5565b6003018460ff1681548110611fc457611fc46153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168360ff16111561200a57604051630319abe960e41b815260040160405180910390fd5b6120126130e5565b6003018460ff1681548110612029576120296153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168360ff16036120bc57600161205f6130e5565b6003018560ff1681548110612076576120766153be565b90600052602060002090602091828204019190068282829054906101000a900460ff166120a391906155e4565b92506101000a81548160ff021916908360ff1602179055505b60405180606001604052808381526020018260028111156120df576120df614be7565b815260006020909101526120f16130e5565b60ff80871660009081526002929092016020908152604080842092881684529190529020815181906121239082615609565b50602082015160018083018054909160ff199091169083600281111561214b5761214b614be7565b021790555060409190910151600190910180546001600160401b039092166101000268ffffffffffffffff001990921691909117905550505050565b60008061219261317d565b6001600160401b038516600090815260019182016020526040812090910154600160801b900460ff1691508160028111156121cf576121cf614be7565b036121de576000915050610b10565b60018160028111156121f2576121f2614be7565b0361221c576122008361385c565b915061221467016345785d8a00008361582a565b915050610b10565b611f638361385c565b611ee23383836139d4565b612238613109565b6122406130e5565b6001015460ff9081169085161061226a57604051630c5bf2ff60e41b815260040160405180910390fd5b6122726130e5565b6003018460ff1681548110612289576122896153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168360ff16106122ce57604051630319abe960e41b815260040160405180910390fd5b81816122d86130e5565b600401600061243e6122e86130e5565b60ff8a166000908152602091909152604090208054612306906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054612332906153d4565b801561237f5780601f106123545761010080835404028352916020019161237f565b820191906000526020600020905b81548152906001019060200180831161236257829003601f168201915b505050505061238c6130e5565b60ff808c16600090815260029290920160209081526040808420928d168452919052902080546123bb906153d4565b80601f01602080910402602001604051908101604052809291908181526020018280546123e7906153d4565b80156124345780601f1061240957610100808354040283529160200191612434565b820191906000526020600020905b81548152906001019060200180831161241757829003601f168201915b5050505050613aa2565b8152602001908152602001600020918261140d9291906154e1565b6124633383613534565b61247f5760405162461bcd60e51b8152600401610e8e90615446565b611abf84848484613ad5565b6000806124966130e5565b6001015460ff1690505b60208160ff1610156124ff57828160ff16602081106124c1576124c16153be565b1a60f81b6001600160f81b031916156124ed57604051635157b98560e01b815260040160405180910390fd5b6124f86001826155e4565b90506124a0565b5060008281527f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cb602052604090205460ff161561254f57604051631876662760e21b815260040160405180910390fd5b60005b61255a6130e5565b6001015460ff9081169082161015612696576000838260ff1660208110612583576125836153be565b1a905061258e6130e5565b6003018260ff16815481106125a5576125a56153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168160ff16106125ef57604051631a03a70560e11b815260ff83166004820152602401610e8e565b60006125f96130e5565b60ff80851660009081526002928301602090815260408083209387168352929052209150600182015460ff16600281111561263657612636614be7565b036126815760018101546101f46101009091046001600160401b031611156126815760405160016253d41560e01b0319815260ff808516600483015283166024820152604401610e8e565b5061268f90506001826155e4565b9050612552565b50600192915050565b60606126a96130e5565b6001015460ff908116908416106126d357604051634e23d03560e01b815260040160405180910390fd5b6126db6130e5565b6003018360ff16815481106126f2576126f26153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168260ff161061273757604051634e23d03560e01b815260040160405180910390fd5b61273f6130e5565b600401600061282261274f6130e5565b60ff8716600090815260209190915260409020805461276d906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054612799906153d4565b80156127e65780601f106127bb576101008083540402835291602001916127e6565b820191906000526020600020905b8154815290600101906020018083116127c957829003601f168201915b50505050506127f36130e5565b60ff808916600090815260029290920160209081526040808420928a168452919052902080546123bb906153d4565b8152602001908152602001600020805461283b906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054612867906153d4565b80156128b45780601f10612889576101008083540402835291602001916128b4565b820191906000526020600020905b81548152906001019060200180831161289757829003601f168201915b5050505050905092915050565b6060816128e5816000908152609960205260409020546001600160a01b0316151590565b6129025760405163677510db60e11b815260040160405180910390fd5b60008061290e85613b08565b9150915061296c61291e86613b45565b600080516020615cad8339815191526002018461295985604051602001612945919061574e565b604051602081830303815290604052613bd7565b6040516020016129459493929190615841565b60405160200161297c9190615923565b604051602081830303815290604052935050505b50919050565b6129be6040805160808101825260008082526020820181905291810182905290606082015290565b6129c661317d565b600201546001600160401b03908116908316106129f657604051634e23d03560e01b815260040160405180910390fd5b6129fe61317d565b6001600160401b038381166000908152600192830160209081526040918290208251608081018452815481529481015480851692860192909252600160401b8204909316918401919091526060830190600160801b900460ff166002811115612a6957612a69614be7565b6002811115612a7a57612a7a614be7565b90525092915050565b6000612a8e60cb5490565b8210612aad5760405163677510db60e11b815260040160405180910390fd5b600080516020615cad833981519152611732565b80612aca613758565b612ad261317d565b5460ff16612af3576040516331f423c160e21b815260040160405180910390fd5b612afc8261385c565b341015612b1c57604051632c1d501360e11b815260040160405180910390fd5b612b2933610cfb60cb5490565b612b33600160fb55565b612b3b61317d565b54612b569061010090046001600160401b031661271061541e565b6001600160401b0316612b6860cb5490565b10612b8657604051636539edef60e11b815260040160405180910390fd5b611ee2816131a1565b6000610b108261385c565b6000612ba461317d565b600201546001600160401b0390811690831610612bd457604051634e23d03560e01b815260040160405180910390fd5b612bdc61317d565b6001600160401b038084166000908152600392909201602090815260408084203385529091529091205416612c0f61317d565b6001600160401b03808516600090815260019283016020526040902090910154610b109291600160401b9091041661541e565b600054610100900460ff1615808015612c625750600054600160ff909116105b80612c7c5750303b158015612c7c575060005460ff166001145b612cdf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e8e565b6000805460ff191660011790558015612d02576000805461ff0019166101001790555b612d0a613d3d565b612d12613d6c565b612d5c6040518060400160405280600c81526020016b0a8caf0e8eae4ca40a0eadcf60a31b815250604051806040016040528060048152602001630a0aa9cb60e31b815250613d9b565b612d64613dcc565b612d6c613df3565b612d74613e38565b7ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a58480546001600160a01b038086166001600160a01b0319928316179092557ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a585805492851692909116919091179055612deb84612e55565b8015611abf576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b6060600080516020615cad8339815191526002018054610d70906153d4565b612e5d613109565b6001600160a01b038116612ec25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e8e565b6114a78161380a565b612ed3613109565b80612edc61317d565b5461010090046001600160401b0316600003612f0b57604051631e62d8bb60e11b815260040160405180910390fd5b6001612f1561317d565b8054600190612f3390849061010090046001600160401b031661541e565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610d0083610cfb60cb5490565b612f6c613109565b6000600180612f7961317d565b6002018054600090612f959084906001600160401b03166155a0565b92506101000a8154816001600160401b0302191690836001600160401b031602179055612fc2919061541e565b905083612fcd61317d565b6001600160401b0383166000908152600191909101602052604090205582612ff361317d565b6001600160401b03838116600090815260019283016020526040902090910180546fffffffffffffffff00000000000000001916600160401b93909216929092021790558161304061317d565b6001600160401b038316600090815260019182016020526040902001805460ff60801b1916600160801b83600281111561307c5761307c614be7565b02179055508061308a61317d565b6001600160401b03928316600090815260019182016020526040902001805467ffffffffffffffff191691909216179055505050565b60006001600160e01b0319821663780e9d6360e01b1480610b105750610b1082613e83565b7f15fc23de0b6efc38c8929f0d557d14ae184f02f0547d245f38ee37dde056fe0290565b6033546001600160a01b03163314611bbd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e8e565b611ee2828260405180602001604052806000815250613ed3565b7facd42e36bf6964f75f9576d807ec5ef0e84058006bac55d6da4fa5824bba210690565b60006131ab6130e5565b6001015460ff1690505b60208160ff16101561321457818160ff16602081106131d6576131d66153be565b1a60f81b6001600160f81b0319161561320257604051635157b98560e01b815260040160405180910390fd5b61320d6001826155e4565b90506131b5565b5060008181527f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cb602052604090205460ff161561326457604051631876662760e21b815260040160405180910390fd5b60005b61326f6130e5565b6001015460ff90811690821610156133f2576000828260ff1660208110613298576132986153be565b1a90506132a36130e5565b6003018260ff16815481106132ba576132ba6153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168160ff161061330457604051631a03a70560e11b815260ff83166004820152602401610e8e565b600061330e6130e5565b60ff80851660009081526002928301602090815260408083209387168352929052209150600182015460ff16600281111561334b5761334b614be7565b036133dd5760018101546101f46101009091046001600160401b031611156133965760405160016253d41560e01b0319815260ff808516600483015283166024820152604401610e8e565b6001818101805482906133b890829061010090046001600160401b03166155a0565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b506133eb90506001826155e4565b9050613267565b5080600080516020615cad8339815191526000600161341060cb5490565b61341a919061582a565b815260208082019290925260409081016000908120939093559282527f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cb905220805460ff19166001179055565b6000818152609960205260409020546001600160a01b03166114a75760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e8e565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b03841690811790915581906134fb82611743565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061354083611743565b9050806001600160a01b0316846001600160a01b0316148061358757506001600160a01b038082166000908152609c602090815260408083209388168352929052205460ff165b80611f635750836001600160a01b03166135a084610df3565b6001600160a01b031614949350505050565b826001600160a01b03166135c582611743565b6001600160a01b0316146135eb5760405162461bcd60e51b8152600401610e8e90615968565b6001600160a01b03821661364d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e8e565b61365a8383836001613f06565b826001600160a01b031661366d82611743565b6001600160a01b0316146136935760405162461bcd60e51b8152600401610e8e90615968565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b82820281151584158583048514171661373b57600080fd5b0492915050565b60008261374f858461403f565b14949350505050565b600260fb54036137aa5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e8e565b600260fb55565b600160fb55565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d5c90849061408c565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b67016345785d8a0000600460005b6138726130e5565b6001015460ff90811690821610156139cd576000848260ff166020811061389b5761389b6153be565b1a90506138a66130e5565b6003018260ff16815481106138bd576138bd6153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168160ff16106138ef57506139bb565b60006138f96130e5565b60ff808516600090815260029290920160209081526040808420868416855290915282206001015416915081600281111561393657613936614be7565b146139a057600181600281111561394f5761394f614be7565b146139625767016345785d8a00006139a3565b6000808560ff1611613975576000613984565b6139806001866159ad565b9450845b60ff16116139995766b1a2bc2ec500006139a3565b60006139a3565b60005b6139b6906001600160401b0316866159d0565b945050505b6139c66001826155e4565b905061386a565b5050919050565b816001600160a01b0316836001600160a01b031603613a355760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e8e565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008282604051602001613ab79291906159e8565b60405160208183030381529060405280519060200120905092915050565b613ae08484846135b2565b613aec8484848461415e565b611abf5760405162461bcd60e51b8152600401610e8e90615a3d565b6000818152600080516020615cad83398151915260205260409020546060908190613b328161425f565b613b3b82611bbf565b9250925050915091565b60606000613b528361449e565b60010190506000816001600160401b03811115613b7157613b71614f12565b6040519080825280601f01601f191660200182016040528015613b9b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613ba557509392505050565b60608151600003613bf657505060408051602081019091526000815290565b6000604051806060016040528060408152602001615c376040913990506000600384516002613c2591906159d0565b613c2f9190615a8f565b613c3a906004615ab1565b90506000613c498260206159d0565b6001600160401b03811115613c6057613c60614f12565b6040519080825280601f01601f191660200182016040528015613c8a576020820181803683370190505b509050818152600183018586518101602084015b81831015613cf85760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401613c9e565b600389510660018114613d125760028114613d2357613d2f565b613d3d60f01b600119830152613d2f565b603d60f81b6000198301525b509398975050505050505050565b600054610100900460ff16613d645760405162461bcd60e51b8152600401610e8e90615ad0565b611bbd614576565b600054610100900460ff16613d935760405162461bcd60e51b8152600401610e8e90615ad0565b611bbd6145a6565b600054610100900460ff16613dc25760405162461bcd60e51b8152600401610e8e90615ad0565b611ee282826145cd565b600054610100900460ff16611bbd5760405162461bcd60e51b8152600401610e8e90615ad0565b604051806060016040528060368152602001615c77603691397f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cc906114a79082615609565b6000613e4261317d565b805460ff19169115159190911790556078613e5b61317d565b80546001600160401b03929092166101000268ffffffffffffffff0019909216919091179055565b60006001600160e01b031982166380ac58cd60e01b1480613eb457506001600160e01b03198216635b5e139f60e01b145b80610b1057506301ffc9a760e01b6001600160e01b0319831614610b10565b613edd838361460d565b613eea600084848461415e565b610d5c5760405162461bcd60e51b8152600401610e8e90615a3d565b613f12848484846147a6565b6001811115613f815760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610e8e565b816001600160a01b038516613fdd57613fd88160cb8054600083815260cc60205260408120829055600182018355919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0155565b614000565b836001600160a01b0316856001600160a01b03161461400057614000858261482e565b6001600160a01b03841661401c57614017816148cb565b61140d565b846001600160a01b0316846001600160a01b03161461140d5761140d848261497a565b600081815b84518110156140845761407082868381518110614063576140636153be565b60200260200101516149be565b91508061407c81615b1b565b915050614044565b509392505050565b60006140e1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166149f09092919063ffffffff16565b805190915015610d5c57808060200190518101906140ff9190615b34565b610d5c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610e8e565b60006001600160a01b0384163b1561425457604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906141a2903390899088908890600401615b51565b6020604051808303816000875af19250505080156141dd575060408051601f3d908101601f191682019092526141da91810190615b8e565b60015b61423a573d80801561420b576040519150601f19603f3d011682016040523d82523d6000602084013e614210565b606091505b5080516000036142325760405162461bcd60e51b8152600401610e8e90615a3d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f63565b506001949350505050565b60608060005b61426d6130e5565b6001015460ff908116908216101561449757838160ff1660208110614294576142946153be565b1a1580156142c157506142a56130e5565b60ff808316600090815260209290925260409091206001015416155b61448557816144456142d16130e5565b60ff841660009081526020919091526040902080546142ef906153d4565b80601f016020809104026020016040519081016040528092919081815260200182805461431b906153d4565b80156143685780601f1061433d57610100808354040283529160200191614368565b820191906000526020600020905b81548152906001019060200180831161434b57829003601f168201915b50505050506143756130e5565b60ff8516600081815260029290920160209081526040832092918a91811061439f5761439f6153be565b1a8152602081019190915260400160002080546143bb906153d4565b80601f01602080910402602001604051908101604052809291908181526020018280546143e7906153d4565b80156144345780601f1061440957610100808354040283529160200191614434565b820191906000526020600020905b81548152906001019060200180831161441757829003601f168201915b50505050508460ff16600014611ac5565b604051602001614455919061574e565b60408051601f19818403018152908290526144739291602001615804565b60405160208183030381529060405291505b6144906001826155e4565b9050614265565b5092915050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106144dd5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614509576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061452757662386f26fc10000830492506010015b6305f5e100831061453f576305f5e100830492506008015b612710831061455357612710830492506004015b60648310614565576064830492506002015b600a8310610b105760010192915050565b600054610100900460ff1661459d5760405162461bcd60e51b8152600401610e8e90615ad0565b611bbd3361380a565b600054610100900460ff166137b15760405162461bcd60e51b8152600401610e8e90615ad0565b600054610100900460ff166145f45760405162461bcd60e51b8152600401610e8e90615ad0565b60976146008382615609565b506098610d5c8282615609565b6001600160a01b0382166146635760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e8e565b6000818152609960205260409020546001600160a01b0316156146c85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e8e565b6146d6600083836001613f06565b6000818152609960205260409020546001600160a01b03161561473b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e8e565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001811115611abf576001600160a01b038416156147ec576001600160a01b0384166000908152609a6020526040812080548392906147e690849061582a565b90915550505b6001600160a01b03831615611abf576001600160a01b0383166000908152609a6020526040812080548392906148239084906159d0565b909155505050505050565b6000600161483b84611b25565b614845919061582a565b600083815260ca6020526040902054909150808214614898576001600160a01b038416600090815260c960209081526040808320858452825280832054848452818420819055835260ca90915290208190555b50600091825260ca602090815260408084208490556001600160a01b03909416835260c981528383209183525290812055565b60cb546000906148dd9060019061582a565b600083815260cc602052604081205460cb8054939450909284908110614905576149056153be565b906000526020600020015490508060cb8381548110614926576149266153be565b600091825260208083209091019290925582815260cc909152604080822084905585825281205560cb80548061495e5761495e615bab565b6001900381819060005260206000200160009055905550505050565b600061498583611b25565b6001600160a01b03909316600090815260c960209081526040808320868452825280832085905593825260ca9052919091209190915550565b60008183106149da5760008281526020849052604090206149e9565b60008381526020839052604090205b9392505050565b6060611f63848460008585600080866001600160a01b03168587604051614a17919061574e565b60006040518083038185875af1925050503d8060008114614a54576040519150601f19603f3d011682016040523d82523d6000602084013e614a59565b606091505b5091509150614a6a87838387614a75565b979650505050505050565b60608315614ae4578251600003614add576001600160a01b0385163b614add5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e8e565b5081611f63565b611f638383815115614af95781518083602001fd5b8060405162461bcd60e51b8152600401610e8e9190614cac565b6001600160e01b0319811681146114a757600080fd5b600060208284031215614b3b57600080fd5b81356149e981614b13565b803560ff81168114614b5757600080fd5b919050565b60008060408385031215614b6f57600080fd5b614b7883614b46565b9150614b8660208401614b46565b90509250929050565b60005b83811015614baa578181015183820152602001614b92565b83811115611abf5750506000910152565b60008151808452614bd3816020860160208601614b8f565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b600381106114a757634e487b7160e01b600052602160045260246000fd5b602081526000825160606020840152614c376080840182614bbb565b90506020840151614c4781614bfd565b806040850152506001600160401b0360408501511660608401528091505092915050565b6001600160a01b03811681146114a757600080fd5b60008060408385031215614c9357600080fd5b8235614c9e81614c6b565b946020939093013593505050565b6020815260006149e96020830184614bbb565b600060208284031215614cd157600080fd5b5035919050565b80356001600160401b0381168114614b5757600080fd5b60008060408385031215614d0257600080fd5b614d0b83614cd8565b91506020830135614d1b81614c6b565b809150509250929050565b600080600060608486031215614d3b57600080fd5b8335614d4681614c6b565b92506020840135614d5681614c6b565b929592945050506040919091013590565b600060208284031215614d7957600080fd5b6149e982614cd8565b60008083601f840112614d9457600080fd5b5081356001600160401b03811115614dab57600080fd5b602083019150836020828501011115614dc357600080fd5b9250929050565b60008060208385031215614ddd57600080fd5b82356001600160401b03811115614df357600080fd5b614dff85828601614d82565b90969095509350505050565b80151581146114a757600080fd5b600060208284031215614e2b57600080fd5b81356149e981614e0b565b60008060408385031215614e4957600080fd5b50508035926020909101359150565b60008083601f840112614e6a57600080fd5b5081356001600160401b03811115614e8157600080fd5b6020830191508360208260051b8501011115614dc357600080fd5b60008060008060608587031215614eb257600080fd5b614ebb85614cd8565b93506020850135925060408501356001600160401b03811115614edd57600080fd5b614ee987828801614e58565b95989497509550505050565b600060208284031215614f0757600080fd5b81356149e981614c6b565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115614f4257614f42614f12565b604051601f8501601f19908116603f01168101908282118183101715614f6a57614f6a614f12565b81604052809350858152868686011115614f8357600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614fae57600080fd5b6149e983833560208501614f28565b600080600060608486031215614fd257600080fd5b614fdb84614b46565b925060208401356001600160401b03811115614ff657600080fd5b61500286828701614f9d565b925050604084013561501381614e0b565b809150509250925092565b60008060006040848603121561503357600080fd5b8335925060208401356001600160401b0381111561505057600080fd5b61505c86828701614e58565b9497909650939450505050565b60008060006060848603121561507e57600080fd5b83356001600160401b038082111561509557600080fd5b6150a187838801614f9d565b945060208601359150808211156150b757600080fd5b5061500286828701614f9d565b6000602082840312156150d657600080fd5b6149e982614b46565b6020815260008251604060208401526150fb6060840182614bbb565b90506020840151151560408401528091505092915050565b60006020828403121561512557600080fd5b81356001600160401b0381111561513b57600080fd5b611f6384828501614f9d565b600381106114a757600080fd5b6000806000806080858703121561516a57600080fd5b61517385614b46565b935061518160208601614b46565b925060408501356001600160401b0381111561519c57600080fd5b6151a887828801614f9d565b92505060608501356151b981615147565b939692955090935050565b600080604083850312156151d757600080fd5b614c9e83614cd8565b600080604083850312156151f357600080fd5b82356151fe81614c6b565b91506020830135614d1b81614e0b565b6000806000806060858703121561522457600080fd5b61522d85614b46565b935061523b60208601614b46565b925060408501356001600160401b0381111561525657600080fd5b614ee987828801614d82565b6000806000806080858703121561527857600080fd5b843561528381614c6b565b9350602085013561529381614c6b565b92506040850135915060608501356001600160401b038111156152b557600080fd5b8501601f810187136152c657600080fd5b6152d587823560208401614f28565b91505092959194509250565b60006080820190508251825260208301516001600160401b0380821660208501528060408601511660408501525050606083015161531e81614bfd565b8060608401525092915050565b6000806040838503121561533e57600080fd5b8235614d0b81614c6b565b60008060006060848603121561535e57600080fd5b833561536981614c6b565b9250602084013561537981614c6b565b9150604084013561501381614c6b565b60008060006060848603121561539e57600080fd5b833592506153ae60208501614cd8565b9150604084013561501381615147565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806153e857607f821691505b60208210810361299057634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160401b038381169083168181101561543e5761543e615408565b039392505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f821115610d5c57600081815260208120601f850160051c810160208610156154ba5750805b601f850160051c820191505b818110156154d9578281556001016154c6565b505050505050565b6001600160401b038311156154f8576154f8614f12565b61550c8361550683546153d4565b83615493565b6000601f84116001811461554057600085156155285750838201355b600019600387901b1c1916600186901b17835561140d565b600083815260209020601f19861690835b828110156155715786850135825560209485019460019092019101615551565b508682101561558e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006001600160401b038083168185168083038211156155c2576155c2615408565b01949350505050565b6000602082840312156155dd57600080fd5b5051919050565b600060ff821660ff84168060ff0382111561560157615601615408565b019392505050565b81516001600160401b0381111561562257615622614f12565b6156368161563084546153d4565b84615493565b602080601f83116001811461566b57600084156156535750858301515b600019600386901b1c1916600185901b1785556154d9565b600085815260208120601f198616915b8281101561569a5788860151825594840194600190910190840161567b565b50858210156156b85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600084516156da818460208901614b8f565b6e3d913a3930b4ba2fba3cb832911d1160891b908301908152845161570681600f840160208901614b8f565b6a1116113b30b63ab2911d1160a91b600f9290910191820152835161573281601a840160208801614b8f565b61227d60f01b601a9290910191820152601c0195945050505050565b60008251615760818460208701614b8f565b9190910192915050565b60008154615777816153d4565b6001828116801561578f57600181146157a4576157d3565b60ff19841687528215158302870194506157d3565b8560005260208060002060005b858110156157ca5781548a8201529084019082016157b1565b50505082870194505b5050505092915050565b600083516157ef818460208801614b8f565b6157fb8184018561576a565b95945050505050565b60008351615816818460208801614b8f565b8351908301906155c2818360208801614b8f565b60008282101561583c5761583c615408565b500390565b697b226e616d65223a222360b01b8152845160009061586781600a850160208a01614b8f565b701116113232b9b1b934b83a34b7b7111d1160791b600a91840191820152615892601b82018761576a565b6b222c22747261697473223a5b60a01b815285519091506158ba81600c840160208901614b8f565b7f5d2c22696d616765223a22646174613a696d6167652f7376672b786d6c3b6261600c9290910191820152641cd94d8d0b60da1b602c8201528351615906816031840160208801614b8f565b61227d60f01b603192909101918201526033019695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161595b81601d850160208701614b8f565b91909101601d0192915050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b600060ff821660ff8416808210156159c7576159c7615408565b90039392505050565b600082198211156159e3576159e3615408565b500190565b6c3a32bc3a3ab93297383ab73c1760991b815260008351615a1081600d850160208801614b8f565b601760f91b600d918401918201528351615a3181600e840160208801614b8f565b01600e01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082615aac57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615615acb57615acb615408565b500290565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060018201615b2d57615b2d615408565b5060010190565b600060208284031215615b4657600080fd5b81516149e981614e0b565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615b8490830184614bbb565b9695505050505050565b600060208284031215615ba057600080fd5b81516149e981614b13565b634e487b7160e01b600052603160045260246000fdfe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222077696474683d2237303022206865696768743d22373030222076696577426f783d2230202d302e35203234203234222073686170652d72656e646572696e673d2263726973704564676573223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f546578747572652050756e78202d206d65746164617461202620696d672066756c6c79206f6e20636861696e2c20666f72657665722e9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3caa2646970667358221220ff5847870c5c9862e26c06fb3dd2a8198878731e1256a3cf212f05f400ef551064736f6c634300080f0033

Deployed Bytecode

0x6080604052600436106103905760003560e01c8063887b98b9116101dc578063bcdfb0b911610102578063e48fa0ea116100a0578063f2fde38b1161006f578063f2fde38b14610a75578063fe147ed614610a95578063fe28bebd14610ab5578063ffeb1db514610acb57600080fd5b8063e48fa0ea146109d7578063e985e9c5146109f7578063ec087b4114610a40578063f1ae885614610a6057600080fd5b8063cd202ba5116100dc578063cd202ba514610957578063cdad63fc14610984578063ceb58fcb146109a4578063e2dd5905146109b757600080fd5b8063bcdfb0b9146108fc578063bf4732e31461091c578063c87b56dd1461093757600080fd5b80639814de4d1161017a578063a3a46b6f11610149578063a3a46b6f1461089c578063a402129914610798578063b88d4fde146108bc578063bb3eea86146108dc57600080fd5b80639814de4d1461081c5780639a1e6cc11461083c5780639bd1b9c11461085c578063a22cb4651461087c57600080fd5b806390c3f38f116101b657806390c3f38f146107cb57806392b53cd2146107eb57806395d89b411461080757806398030985146107eb57600080fd5b8063887b98b91461076b5780638a19c8bc146107985780638da5cb5b146107ad57600080fd5b80632f745c59116102c157806350ecf68e1161025f578063666347c61161022e578063666347c6146106f657806370a0823114610716578063715018a61461073657806374eedda81461074b57600080fd5b806350ecf68e146106835780635bb209a5146106a35780636352211e146106c357806365bb40e1146106e357600080fd5b80633ccfd60b1161029b5780633ccfd60b1461060e57806342842e0e1461062357806349df728c146106435780634f6ccce71461066357600080fd5b80632f745c59146105c5578063304a9d0d146105e557806332cb6b0c146105f857600080fd5b806318160ddd1161032e5780632578e727116103085780632578e7271461052657806328904ab11461054657806328cad13d146105665780632a55205a1461058657600080fd5b806318160ddd146104d25780631e84c413146104f157806323b872dd1461050657600080fd5b806306fdde031161036a57806306fdde0314610420578063081812fc14610442578063095ea7b31461047a578063147d4c1e1461049a57600080fd5b806301ffc9a71461039c578063027dd1ad146103d15780630537ff22146103fe57600080fd5b3661039757005b600080fd5b3480156103a857600080fd5b506103bc6103b7366004614b29565b610aeb565b60405190151581526020015b60405180910390f35b3480156103dd57600080fd5b506103f16103ec366004614b5c565b610b16565b6040516103c89190614c1b565b34801561040a57600080fd5b5061041e610419366004614c80565b610ce5565b005b34801561042c57600080fd5b50610435610d61565b6040516103c89190614cac565b34801561044e57600080fd5b5061046261045d366004614cbf565b610df3565b6040516001600160a01b0390911681526020016103c8565b34801561048657600080fd5b5061041e610495366004614c80565b610e1a565b3480156104a657600080fd5b506104ba6104b5366004614cef565b610f2f565b6040516001600160401b0390911681526020016103c8565b3480156104de57600080fd5b5060cb545b6040519081526020016103c8565b3480156104fd57600080fd5b506103bc610f75565b34801561051257600080fd5b5061041e610521366004614d26565b610f88565b34801561053257600080fd5b5061041e610541366004614d67565b610fb9565b34801561055257600080fd5b5061041e610561366004614dca565b610ff3565b34801561057257600080fd5b5061041e610581366004614e19565b611014565b34801561059257600080fd5b506105a66105a1366004614e36565b611037565b604080516001600160a01b0390931683526020830191909152016103c8565b3480156105d157600080fd5b506104e36105e0366004614c80565b6110b5565b61041e6105f3366004614e9c565b61114b565b34801561060457600080fd5b506104ba61271081565b34801561061a57600080fd5b5061041e611414565b34801561062f57600080fd5b5061041e61063e366004614d26565b6114aa565b34801561064f57600080fd5b5061041e61065e366004614ef5565b6114c5565b34801561066f57600080fd5b506104e361067e366004614cbf565b611567565b34801561068f57600080fd5b5061041e61069e366004614fbd565b6115fa565b3480156106af57600080fd5b506104e36106be366004614cbf565b611720565b3480156106cf57600080fd5b506104626106de366004614cbf565b611743565b61041e6106f136600461501e565b6117a3565b34801561070257600080fd5b50610435610711366004615069565b611ac5565b34801561072257600080fd5b506104e3610731366004614ef5565b611b25565b34801561074257600080fd5b5061041e611bab565b34801561075757600080fd5b50610435610766366004614cbf565b611bbf565b34801561077757600080fd5b5061078b6107863660046150c4565b611d73565b6040516103c891906150df565b3480156107a457600080fd5b506104ba611e87565b3480156107b957600080fd5b506033546001600160a01b0316610462565b3480156107d757600080fd5b5061041e6107e6366004615113565b611eaf565b3480156107f757600080fd5b506104ba67016345785d8a000081565b34801561081357600080fd5b50610435611ee6565b34801561082857600080fd5b506103bc610837366004614b5c565b611ef5565b34801561084857600080fd5b5061041e610857366004615154565b611f6b565b34801561086857600080fd5b506104e36108773660046151c4565b612187565b34801561088857600080fd5b5061041e6108973660046151e0565b612225565b3480156108a857600080fd5b5061041e6108b736600461520e565b612230565b3480156108c857600080fd5b5061041e6108d7366004615262565b612459565b3480156108e857600080fd5b506103bc6108f7366004614cbf565b61248b565b34801561090857600080fd5b50610435610917366004614b5c565b61269f565b34801561092857600080fd5b506104ba66b1a2bc2ec5000081565b34801561094357600080fd5b50610435610952366004614cbf565b6128c1565b34801561096357600080fd5b50610977610972366004614d67565b612996565b6040516103c891906152e1565b34801561099057600080fd5b506104e361099f366004614cbf565b612a83565b61041e6109b2366004614cbf565b612ac1565b3480156109c357600080fd5b506104e36109d2366004614cbf565b612b8f565b3480156109e357600080fd5b506104ba6109f2366004614d67565b612b9a565b348015610a0357600080fd5b506103bc610a1236600461532b565b6001600160a01b039182166000908152609c6020908152604080832093909416825291909152205460ff1690565b348015610a4c57600080fd5b5061041e610a5b366004615349565b612c42565b348015610a6c57600080fd5b50610435612e36565b348015610a8157600080fd5b5061041e610a90366004614ef5565b612e55565b348015610aa157600080fd5b5061041e610ab0366004614c80565b612ecb565b348015610ac157600080fd5b506104ba6101f481565b348015610ad757600080fd5b5061041e610ae6366004615389565b612f64565b60006001600160e01b0319821663152a902d60e11b1480610b105750610b10826130c0565b92915050565b6040805160608082018352815260006020820181905291810191909152610b3b6130e5565b6001015460ff90811690841610610b6557604051634e23d03560e01b815260040160405180910390fd5b610b6d6130e5565b6003018360ff1681548110610b8457610b846153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168260ff1610610bc957604051634e23d03560e01b815260040160405180910390fd5b610bd16130e5565b60ff808516600090815260029290920160209081526040808420928616845291905290819020815160608101909252805482908290610c0f906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3b906153d4565b8015610c885780601f10610c5d57610100808354040283529160200191610c88565b820191906000526020600020905b815481529060010190602001808311610c6b57829003601f168201915b5050509183525050600182015460209091019060ff166002811115610caf57610caf614be7565b6002811115610cc057610cc0614be7565b81526001919091015461010090046001600160401b0316602090910152905092915050565b610ced613109565b80610d0083610cfb60cb5490565b613163565b610d0861317d565b54610d239061010090046001600160401b031661271061541e565b6001600160401b0316610d3560cb5490565b10610d5357604051636539edef60e11b815260040160405180910390fd5b610d5c816131a1565b505050565b606060978054610d70906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054610d9c906153d4565b8015610de95780601f10610dbe57610100808354040283529160200191610de9565b820191906000526020600020905b815481529060010190602001808311610dcc57829003601f168201915b5050505050905090565b6000610dfe82613467565b506000908152609b60205260409020546001600160a01b031690565b6000610e2582611743565b9050806001600160a01b0316836001600160a01b031603610e975760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610eb35750610eb38133610a12565b610f255760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610e8e565b610d5c83836134c6565b6000610f3961317d565b6001600160401b038085166000908152600392909201602090815260408084206001600160a01b03871685529091529091205416905092915050565b6000610f7f61317d565b5460ff16919050565b610f923382613534565b610fae5760405162461bcd60e51b8152600401610e8e90615446565b610d5c8383836135b2565b610fc1613109565b80610fca61317d565b80546001600160401b03929092166101000268ffffffffffffffff001990921691909117905550565b610ffb613109565b81816110056130e5565b60050191610d5c9190836154e1565b61101c613109565b8061102561317d565b805460ff191691151591909117905550565b600082815260996020526040812054819084906001600160a01b03166110705760405163677510db60e11b815260040160405180910390fd5b7ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a585546001600160a01b03166110a98560326103e8613723565b92509250509250929050565b60006110c083611b25565b82106111225760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610e8e565b506001600160a01b0391909116600090815260c960209081526040808320938352929052205490565b8284848484600061115a61317d565b6001600160401b038681166000908152600192830160209081526040918290208251608081018452815481529481015480851692860192909252600160401b8204909316918401919091526060830190600160801b900460ff1660028111156111c5576111c5614be7565b60028111156111d6576111d6614be7565b9052506040516bffffffffffffffffffffffff193360601b1660208201529091506000906034016040516020818303038152906040528051906020012090506112558484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505085519150849050613742565b6112725760405163522fc3bd60e01b815260040160405180910390fd5b81604001516001600160401b031661128861317d565b6001600160401b038089166000908152600392909201602090815260408084203385529091529091205416106112d157604051631bbdf5c560e31b815260040160405180910390fd5b6112db8686612187565b3410156112fb57604051632c1d501360e11b815260040160405180910390fd5b600161130561317d565b6001600160401b038089166000908152600392909201602090815260408084203385529091528220805490929161133e918591166155a0565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555061136a613758565b8a6001600160401b03166000036113945760405163e78656d960e01b815260040160405180910390fd5b6113a133610cfb60cb5490565b6113ab600160fb55565b5050505050506113b961317d565b546113d49061010090046001600160401b031661271061541e565b6001600160401b03166113e660cb5490565b1061140457604051636539edef60e11b815260040160405180910390fd5b61140d816131a1565b5050505050565b7ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a584546040516000916001600160a01b03169047908381818185875af1925050503d8060008114611480576040519150601f19603f3d011682016040523d82523d6000602084013e611485565b606091505b50509050806114a7576040516369a4751b60e01b815260040160405180910390fd5b50565b610d5c83838360405180602001604052806000815250612459565b6114a77ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a584546040516370a0823160e01b81523060048201526001600160a01b03918216918416906370a0823190602401602060405180830381865afa158015611532573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155691906155cb565b6001600160a01b03841691906137b8565b600061157260cb5490565b82106115d55760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e8e565b60cb82815481106115e8576115e86153be565b90600052602060002001549050919050565b611602613109565b61160a6130e5565b6001015460ff908116908416111561163557604051630c5bf2ff60e41b815260040160405180910390fd5b61163d6130e5565b6001015460ff908116908416036116bf5760016116586130e5565b600101805460009061166e90849060ff166155e4565b92506101000a81548160ff021916908360ff16021790555061168e6130e5565b600301805460018101825560009182526020918290209181049091018054601f9092166101000a60ff021990911690555b60405180604001604052808381526020018215158152506116de6130e5565b60ff8516600090815260209190915260409020815181906116ff9082615609565b50602091909101516001909101805460ff1916911515919091179055505050565b6000600080516020615cad8339815191525b600092835260205250604090205490565b6000818152609960205260408120546001600160a01b031680610b105760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e8e565b82600084848460006117b361317d565b6001600160401b038681166000908152600192830160209081526040918290208251608081018452815481529481015480851692860192909252600160401b8204909316918401919091526060830190600160801b900460ff16600281111561181e5761181e614be7565b600281111561182f5761182f614be7565b9052506040516bffffffffffffffffffffffff193360601b1660208201529091506000906034016040516020818303038152906040528051906020012090506118ae8484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505085519150849050613742565b6118cb5760405163522fc3bd60e01b815260040160405180910390fd5b81604001516001600160401b03166118e161317d565b6001600160401b0380891660009081526003929092016020908152604080842033855290915290912054161061192a57604051631bbdf5c560e31b815260040160405180910390fd5b6119348686612187565b34101561195457604051632c1d501360e11b815260040160405180910390fd5b600161195e61317d565b6001600160401b0380891660009081526003929092016020908152604080842033855290915282208054909291611997918591166155a0565b92506101000a8154816001600160401b0302191690836001600160401b031602179055506119c3613758565b6119cb61317d565b5461010090046001600160401b03166000036119fa57604051631e62d8bb60e11b815260040160405180910390fd5b6001611a0461317d565b8054600190611a2290849061010090046001600160401b031661541e565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550611a5333610cfb60cb5490565b611a5d600160fb55565b505050505050611a6b61317d565b54611a869061010090046001600160401b031661271061541e565b6001600160401b0316611a9860cb5490565b10611ab657604051636539edef60e11b815260040160405180910390fd5b611abf816131a1565b50505050565b6040805180820190915260018152600b60fa1b60208201526060908215611af757506040805160208101909152600081525b808585604051602001611b0c939291906156c8565b6040516020818303038152906040529150509392505050565b60006001600160a01b038216611b8f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610e8e565b506001600160a01b03166000908152609a602052604090205490565b611bb3613109565b611bbd600061380a565b565b606060006040518060a0016040528060758152602001615bc260759139604051602001611bec919061574e565b604051602081830303815290604052905080611c066130e5565b600501604051602001611c1a9291906157dd565b604051602081830303815290604052905060005b611c366130e5565b6001015460ff9081169082161015611d0d57838160ff1660208110611c5d57611c5d6153be565b1a60f81b6001600160f81b031916158015611c975750611c7b6130e5565b60ff808316600090815260209290925260409091206001015416155b611cfb5781611cbb82868460ff1660208110611cb557611cb56153be565b1a61269f565b604051602001611ccb919061574e565b60408051601f1981840301815290829052611ce99291602001615804565b60405160208183030381529060405291505b611d066001826155e4565b9050611c2e565b5080604051806040016040528060068152602001651e17b9bb339f60d11b815250604051602001611d3e919061574e565b60408051601f1981840301815290829052611d5c9291602001615804565b604051602081830303815290604052915050919050565b604080518082019091526060815260006020820152611d906130e5565b6001015460ff90811690831610611dba57604051634e23d03560e01b815260040160405180910390fd5b611dc26130e5565b60ff831660009081526020919091526040908190208151808301909252805482908290611dee906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1a906153d4565b8015611e675780601f10611e3c57610100808354040283529160200191611e67565b820191906000526020600020905b815481529060010190602001808311611e4a57829003601f168201915b50505091835250506001919091015460ff16151560209091015292915050565b60006001611e9361317d565b60020154611eaa91906001600160401b031661541e565b905090565b611eb7613109565b7f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cc611ee28282615609565b5050565b606060988054610d70906153d4565b600080611f006130e5565b60ff80861660009081526002928301602090815260408083209388168352929052209150600182015460ff166002811115611f3d57611f3d614be7565b14611f49576001611f63565b60018101546101f46101009091046001600160401b031611155b949350505050565b611f73613109565b611f7b6130e5565b6001015460ff90811690851610611fa557604051630c5bf2ff60e41b815260040160405180910390fd5b611fad6130e5565b6003018460ff1681548110611fc457611fc46153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168360ff16111561200a57604051630319abe960e41b815260040160405180910390fd5b6120126130e5565b6003018460ff1681548110612029576120296153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168360ff16036120bc57600161205f6130e5565b6003018560ff1681548110612076576120766153be565b90600052602060002090602091828204019190068282829054906101000a900460ff166120a391906155e4565b92506101000a81548160ff021916908360ff1602179055505b60405180606001604052808381526020018260028111156120df576120df614be7565b815260006020909101526120f16130e5565b60ff80871660009081526002929092016020908152604080842092881684529190529020815181906121239082615609565b50602082015160018083018054909160ff199091169083600281111561214b5761214b614be7565b021790555060409190910151600190910180546001600160401b039092166101000268ffffffffffffffff001990921691909117905550505050565b60008061219261317d565b6001600160401b038516600090815260019182016020526040812090910154600160801b900460ff1691508160028111156121cf576121cf614be7565b036121de576000915050610b10565b60018160028111156121f2576121f2614be7565b0361221c576122008361385c565b915061221467016345785d8a00008361582a565b915050610b10565b611f638361385c565b611ee23383836139d4565b612238613109565b6122406130e5565b6001015460ff9081169085161061226a57604051630c5bf2ff60e41b815260040160405180910390fd5b6122726130e5565b6003018460ff1681548110612289576122896153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168360ff16106122ce57604051630319abe960e41b815260040160405180910390fd5b81816122d86130e5565b600401600061243e6122e86130e5565b60ff8a166000908152602091909152604090208054612306906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054612332906153d4565b801561237f5780601f106123545761010080835404028352916020019161237f565b820191906000526020600020905b81548152906001019060200180831161236257829003601f168201915b505050505061238c6130e5565b60ff808c16600090815260029290920160209081526040808420928d168452919052902080546123bb906153d4565b80601f01602080910402602001604051908101604052809291908181526020018280546123e7906153d4565b80156124345780601f1061240957610100808354040283529160200191612434565b820191906000526020600020905b81548152906001019060200180831161241757829003601f168201915b5050505050613aa2565b8152602001908152602001600020918261140d9291906154e1565b6124633383613534565b61247f5760405162461bcd60e51b8152600401610e8e90615446565b611abf84848484613ad5565b6000806124966130e5565b6001015460ff1690505b60208160ff1610156124ff57828160ff16602081106124c1576124c16153be565b1a60f81b6001600160f81b031916156124ed57604051635157b98560e01b815260040160405180910390fd5b6124f86001826155e4565b90506124a0565b5060008281527f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cb602052604090205460ff161561254f57604051631876662760e21b815260040160405180910390fd5b60005b61255a6130e5565b6001015460ff9081169082161015612696576000838260ff1660208110612583576125836153be565b1a905061258e6130e5565b6003018260ff16815481106125a5576125a56153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168160ff16106125ef57604051631a03a70560e11b815260ff83166004820152602401610e8e565b60006125f96130e5565b60ff80851660009081526002928301602090815260408083209387168352929052209150600182015460ff16600281111561263657612636614be7565b036126815760018101546101f46101009091046001600160401b031611156126815760405160016253d41560e01b0319815260ff808516600483015283166024820152604401610e8e565b5061268f90506001826155e4565b9050612552565b50600192915050565b60606126a96130e5565b6001015460ff908116908416106126d357604051634e23d03560e01b815260040160405180910390fd5b6126db6130e5565b6003018360ff16815481106126f2576126f26153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168260ff161061273757604051634e23d03560e01b815260040160405180910390fd5b61273f6130e5565b600401600061282261274f6130e5565b60ff8716600090815260209190915260409020805461276d906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054612799906153d4565b80156127e65780601f106127bb576101008083540402835291602001916127e6565b820191906000526020600020905b8154815290600101906020018083116127c957829003601f168201915b50505050506127f36130e5565b60ff808916600090815260029290920160209081526040808420928a168452919052902080546123bb906153d4565b8152602001908152602001600020805461283b906153d4565b80601f0160208091040260200160405190810160405280929190818152602001828054612867906153d4565b80156128b45780601f10612889576101008083540402835291602001916128b4565b820191906000526020600020905b81548152906001019060200180831161289757829003601f168201915b5050505050905092915050565b6060816128e5816000908152609960205260409020546001600160a01b0316151590565b6129025760405163677510db60e11b815260040160405180910390fd5b60008061290e85613b08565b9150915061296c61291e86613b45565b600080516020615cad8339815191526002018461295985604051602001612945919061574e565b604051602081830303815290604052613bd7565b6040516020016129459493929190615841565b60405160200161297c9190615923565b604051602081830303815290604052935050505b50919050565b6129be6040805160808101825260008082526020820181905291810182905290606082015290565b6129c661317d565b600201546001600160401b03908116908316106129f657604051634e23d03560e01b815260040160405180910390fd5b6129fe61317d565b6001600160401b038381166000908152600192830160209081526040918290208251608081018452815481529481015480851692860192909252600160401b8204909316918401919091526060830190600160801b900460ff166002811115612a6957612a69614be7565b6002811115612a7a57612a7a614be7565b90525092915050565b6000612a8e60cb5490565b8210612aad5760405163677510db60e11b815260040160405180910390fd5b600080516020615cad833981519152611732565b80612aca613758565b612ad261317d565b5460ff16612af3576040516331f423c160e21b815260040160405180910390fd5b612afc8261385c565b341015612b1c57604051632c1d501360e11b815260040160405180910390fd5b612b2933610cfb60cb5490565b612b33600160fb55565b612b3b61317d565b54612b569061010090046001600160401b031661271061541e565b6001600160401b0316612b6860cb5490565b10612b8657604051636539edef60e11b815260040160405180910390fd5b611ee2816131a1565b6000610b108261385c565b6000612ba461317d565b600201546001600160401b0390811690831610612bd457604051634e23d03560e01b815260040160405180910390fd5b612bdc61317d565b6001600160401b038084166000908152600392909201602090815260408084203385529091529091205416612c0f61317d565b6001600160401b03808516600090815260019283016020526040902090910154610b109291600160401b9091041661541e565b600054610100900460ff1615808015612c625750600054600160ff909116105b80612c7c5750303b158015612c7c575060005460ff166001145b612cdf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e8e565b6000805460ff191660011790558015612d02576000805461ff0019166101001790555b612d0a613d3d565b612d12613d6c565b612d5c6040518060400160405280600c81526020016b0a8caf0e8eae4ca40a0eadcf60a31b815250604051806040016040528060048152602001630a0aa9cb60e31b815250613d9b565b612d64613dcc565b612d6c613df3565b612d74613e38565b7ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a58480546001600160a01b038086166001600160a01b0319928316179092557ff0a45601f8e54a0ff25b0eaa0af0c2d9aaf2f1869dcd4f5ec05a30963004a585805492851692909116919091179055612deb84612e55565b8015611abf576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b6060600080516020615cad8339815191526002018054610d70906153d4565b612e5d613109565b6001600160a01b038116612ec25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610e8e565b6114a78161380a565b612ed3613109565b80612edc61317d565b5461010090046001600160401b0316600003612f0b57604051631e62d8bb60e11b815260040160405180910390fd5b6001612f1561317d565b8054600190612f3390849061010090046001600160401b031661541e565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610d0083610cfb60cb5490565b612f6c613109565b6000600180612f7961317d565b6002018054600090612f959084906001600160401b03166155a0565b92506101000a8154816001600160401b0302191690836001600160401b031602179055612fc2919061541e565b905083612fcd61317d565b6001600160401b0383166000908152600191909101602052604090205582612ff361317d565b6001600160401b03838116600090815260019283016020526040902090910180546fffffffffffffffff00000000000000001916600160401b93909216929092021790558161304061317d565b6001600160401b038316600090815260019182016020526040902001805460ff60801b1916600160801b83600281111561307c5761307c614be7565b02179055508061308a61317d565b6001600160401b03928316600090815260019182016020526040902001805467ffffffffffffffff191691909216179055505050565b60006001600160e01b0319821663780e9d6360e01b1480610b105750610b1082613e83565b7f15fc23de0b6efc38c8929f0d557d14ae184f02f0547d245f38ee37dde056fe0290565b6033546001600160a01b03163314611bbd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610e8e565b611ee2828260405180602001604052806000815250613ed3565b7facd42e36bf6964f75f9576d807ec5ef0e84058006bac55d6da4fa5824bba210690565b60006131ab6130e5565b6001015460ff1690505b60208160ff16101561321457818160ff16602081106131d6576131d66153be565b1a60f81b6001600160f81b0319161561320257604051635157b98560e01b815260040160405180910390fd5b61320d6001826155e4565b90506131b5565b5060008181527f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cb602052604090205460ff161561326457604051631876662760e21b815260040160405180910390fd5b60005b61326f6130e5565b6001015460ff90811690821610156133f2576000828260ff1660208110613298576132986153be565b1a90506132a36130e5565b6003018260ff16815481106132ba576132ba6153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168160ff161061330457604051631a03a70560e11b815260ff83166004820152602401610e8e565b600061330e6130e5565b60ff80851660009081526002928301602090815260408083209387168352929052209150600182015460ff16600281111561334b5761334b614be7565b036133dd5760018101546101f46101009091046001600160401b031611156133965760405160016253d41560e01b0319815260ff808516600483015283166024820152604401610e8e565b6001818101805482906133b890829061010090046001600160401b03166155a0565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505b506133eb90506001826155e4565b9050613267565b5080600080516020615cad8339815191526000600161341060cb5490565b61341a919061582a565b815260208082019290925260409081016000908120939093559282527f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cb905220805460ff19166001179055565b6000818152609960205260409020546001600160a01b03166114a75760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e8e565b6000818152609b6020526040902080546001600160a01b0319166001600160a01b03841690811790915581906134fb82611743565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061354083611743565b9050806001600160a01b0316846001600160a01b0316148061358757506001600160a01b038082166000908152609c602090815260408083209388168352929052205460ff165b80611f635750836001600160a01b03166135a084610df3565b6001600160a01b031614949350505050565b826001600160a01b03166135c582611743565b6001600160a01b0316146135eb5760405162461bcd60e51b8152600401610e8e90615968565b6001600160a01b03821661364d5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e8e565b61365a8383836001613f06565b826001600160a01b031661366d82611743565b6001600160a01b0316146136935760405162461bcd60e51b8152600401610e8e90615968565b6000818152609b6020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652609a8552838620805460001901905590871680865283862080546001019055868652609990945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b82820281151584158583048514171661373b57600080fd5b0492915050565b60008261374f858461403f565b14949350505050565b600260fb54036137aa5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610e8e565b600260fb55565b600160fb55565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d5c90849061408c565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b67016345785d8a0000600460005b6138726130e5565b6001015460ff90811690821610156139cd576000848260ff166020811061389b5761389b6153be565b1a90506138a66130e5565b6003018260ff16815481106138bd576138bd6153be565b90600052602060002090602091828204019190069054906101000a900460ff1660ff168160ff16106138ef57506139bb565b60006138f96130e5565b60ff808516600090815260029290920160209081526040808420868416855290915282206001015416915081600281111561393657613936614be7565b146139a057600181600281111561394f5761394f614be7565b146139625767016345785d8a00006139a3565b6000808560ff1611613975576000613984565b6139806001866159ad565b9450845b60ff16116139995766b1a2bc2ec500006139a3565b60006139a3565b60005b6139b6906001600160401b0316866159d0565b945050505b6139c66001826155e4565b905061386a565b5050919050565b816001600160a01b0316836001600160a01b031603613a355760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e8e565b6001600160a01b038381166000818152609c6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008282604051602001613ab79291906159e8565b60405160208183030381529060405280519060200120905092915050565b613ae08484846135b2565b613aec8484848461415e565b611abf5760405162461bcd60e51b8152600401610e8e90615a3d565b6000818152600080516020615cad83398151915260205260409020546060908190613b328161425f565b613b3b82611bbf565b9250925050915091565b60606000613b528361449e565b60010190506000816001600160401b03811115613b7157613b71614f12565b6040519080825280601f01601f191660200182016040528015613b9b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613ba557509392505050565b60608151600003613bf657505060408051602081019091526000815290565b6000604051806060016040528060408152602001615c376040913990506000600384516002613c2591906159d0565b613c2f9190615a8f565b613c3a906004615ab1565b90506000613c498260206159d0565b6001600160401b03811115613c6057613c60614f12565b6040519080825280601f01601f191660200182016040528015613c8a576020820181803683370190505b509050818152600183018586518101602084015b81831015613cf85760039283018051603f601282901c811687015160f890811b8552600c83901c8216880151811b6001860152600683901c8216880151811b60028601529116860151901b93820193909352600401613c9e565b600389510660018114613d125760028114613d2357613d2f565b613d3d60f01b600119830152613d2f565b603d60f81b6000198301525b509398975050505050505050565b600054610100900460ff16613d645760405162461bcd60e51b8152600401610e8e90615ad0565b611bbd614576565b600054610100900460ff16613d935760405162461bcd60e51b8152600401610e8e90615ad0565b611bbd6145a6565b600054610100900460ff16613dc25760405162461bcd60e51b8152600401610e8e90615ad0565b611ee282826145cd565b600054610100900460ff16611bbd5760405162461bcd60e51b8152600401610e8e90615ad0565b604051806060016040528060368152602001615c77603691397f9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3cc906114a79082615609565b6000613e4261317d565b805460ff19169115159190911790556078613e5b61317d565b80546001600160401b03929092166101000268ffffffffffffffff0019909216919091179055565b60006001600160e01b031982166380ac58cd60e01b1480613eb457506001600160e01b03198216635b5e139f60e01b145b80610b1057506301ffc9a760e01b6001600160e01b0319831614610b10565b613edd838361460d565b613eea600084848461415e565b610d5c5760405162461bcd60e51b8152600401610e8e90615a3d565b613f12848484846147a6565b6001811115613f815760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610e8e565b816001600160a01b038516613fdd57613fd88160cb8054600083815260cc60205260408120829055600182018355919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0155565b614000565b836001600160a01b0316856001600160a01b03161461400057614000858261482e565b6001600160a01b03841661401c57614017816148cb565b61140d565b846001600160a01b0316846001600160a01b03161461140d5761140d848261497a565b600081815b84518110156140845761407082868381518110614063576140636153be565b60200260200101516149be565b91508061407c81615b1b565b915050614044565b509392505050565b60006140e1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166149f09092919063ffffffff16565b805190915015610d5c57808060200190518101906140ff9190615b34565b610d5c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610e8e565b60006001600160a01b0384163b1561425457604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906141a2903390899088908890600401615b51565b6020604051808303816000875af19250505080156141dd575060408051601f3d908101601f191682019092526141da91810190615b8e565b60015b61423a573d80801561420b576040519150601f19603f3d011682016040523d82523d6000602084013e614210565b606091505b5080516000036142325760405162461bcd60e51b8152600401610e8e90615a3d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f63565b506001949350505050565b60608060005b61426d6130e5565b6001015460ff908116908216101561449757838160ff1660208110614294576142946153be565b1a1580156142c157506142a56130e5565b60ff808316600090815260209290925260409091206001015416155b61448557816144456142d16130e5565b60ff841660009081526020919091526040902080546142ef906153d4565b80601f016020809104026020016040519081016040528092919081815260200182805461431b906153d4565b80156143685780601f1061433d57610100808354040283529160200191614368565b820191906000526020600020905b81548152906001019060200180831161434b57829003601f168201915b50505050506143756130e5565b60ff8516600081815260029290920160209081526040832092918a91811061439f5761439f6153be565b1a8152602081019190915260400160002080546143bb906153d4565b80601f01602080910402602001604051908101604052809291908181526020018280546143e7906153d4565b80156144345780601f1061440957610100808354040283529160200191614434565b820191906000526020600020905b81548152906001019060200180831161441757829003601f168201915b50505050508460ff16600014611ac5565b604051602001614455919061574e565b60408051601f19818403018152908290526144739291602001615804565b60405160208183030381529060405291505b6144906001826155e4565b9050614265565b5092915050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106144dd5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614509576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061452757662386f26fc10000830492506010015b6305f5e100831061453f576305f5e100830492506008015b612710831061455357612710830492506004015b60648310614565576064830492506002015b600a8310610b105760010192915050565b600054610100900460ff1661459d5760405162461bcd60e51b8152600401610e8e90615ad0565b611bbd3361380a565b600054610100900460ff166137b15760405162461bcd60e51b8152600401610e8e90615ad0565b600054610100900460ff166145f45760405162461bcd60e51b8152600401610e8e90615ad0565b60976146008382615609565b506098610d5c8282615609565b6001600160a01b0382166146635760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e8e565b6000818152609960205260409020546001600160a01b0316156146c85760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e8e565b6146d6600083836001613f06565b6000818152609960205260409020546001600160a01b03161561473b5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e8e565b6001600160a01b0382166000818152609a6020908152604080832080546001019055848352609990915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001811115611abf576001600160a01b038416156147ec576001600160a01b0384166000908152609a6020526040812080548392906147e690849061582a565b90915550505b6001600160a01b03831615611abf576001600160a01b0383166000908152609a6020526040812080548392906148239084906159d0565b909155505050505050565b6000600161483b84611b25565b614845919061582a565b600083815260ca6020526040902054909150808214614898576001600160a01b038416600090815260c960209081526040808320858452825280832054848452818420819055835260ca90915290208190555b50600091825260ca602090815260408084208490556001600160a01b03909416835260c981528383209183525290812055565b60cb546000906148dd9060019061582a565b600083815260cc602052604081205460cb8054939450909284908110614905576149056153be565b906000526020600020015490508060cb8381548110614926576149266153be565b600091825260208083209091019290925582815260cc909152604080822084905585825281205560cb80548061495e5761495e615bab565b6001900381819060005260206000200160009055905550505050565b600061498583611b25565b6001600160a01b03909316600090815260c960209081526040808320868452825280832085905593825260ca9052919091209190915550565b60008183106149da5760008281526020849052604090206149e9565b60008381526020839052604090205b9392505050565b6060611f63848460008585600080866001600160a01b03168587604051614a17919061574e565b60006040518083038185875af1925050503d8060008114614a54576040519150601f19603f3d011682016040523d82523d6000602084013e614a59565b606091505b5091509150614a6a87838387614a75565b979650505050505050565b60608315614ae4578251600003614add576001600160a01b0385163b614add5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610e8e565b5081611f63565b611f638383815115614af95781518083602001fd5b8060405162461bcd60e51b8152600401610e8e9190614cac565b6001600160e01b0319811681146114a757600080fd5b600060208284031215614b3b57600080fd5b81356149e981614b13565b803560ff81168114614b5757600080fd5b919050565b60008060408385031215614b6f57600080fd5b614b7883614b46565b9150614b8660208401614b46565b90509250929050565b60005b83811015614baa578181015183820152602001614b92565b83811115611abf5750506000910152565b60008151808452614bd3816020860160208601614b8f565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b600381106114a757634e487b7160e01b600052602160045260246000fd5b602081526000825160606020840152614c376080840182614bbb565b90506020840151614c4781614bfd565b806040850152506001600160401b0360408501511660608401528091505092915050565b6001600160a01b03811681146114a757600080fd5b60008060408385031215614c9357600080fd5b8235614c9e81614c6b565b946020939093013593505050565b6020815260006149e96020830184614bbb565b600060208284031215614cd157600080fd5b5035919050565b80356001600160401b0381168114614b5757600080fd5b60008060408385031215614d0257600080fd5b614d0b83614cd8565b91506020830135614d1b81614c6b565b809150509250929050565b600080600060608486031215614d3b57600080fd5b8335614d4681614c6b565b92506020840135614d5681614c6b565b929592945050506040919091013590565b600060208284031215614d7957600080fd5b6149e982614cd8565b60008083601f840112614d9457600080fd5b5081356001600160401b03811115614dab57600080fd5b602083019150836020828501011115614dc357600080fd5b9250929050565b60008060208385031215614ddd57600080fd5b82356001600160401b03811115614df357600080fd5b614dff85828601614d82565b90969095509350505050565b80151581146114a757600080fd5b600060208284031215614e2b57600080fd5b81356149e981614e0b565b60008060408385031215614e4957600080fd5b50508035926020909101359150565b60008083601f840112614e6a57600080fd5b5081356001600160401b03811115614e8157600080fd5b6020830191508360208260051b8501011115614dc357600080fd5b60008060008060608587031215614eb257600080fd5b614ebb85614cd8565b93506020850135925060408501356001600160401b03811115614edd57600080fd5b614ee987828801614e58565b95989497509550505050565b600060208284031215614f0757600080fd5b81356149e981614c6b565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115614f4257614f42614f12565b604051601f8501601f19908116603f01168101908282118183101715614f6a57614f6a614f12565b81604052809350858152868686011115614f8357600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112614fae57600080fd5b6149e983833560208501614f28565b600080600060608486031215614fd257600080fd5b614fdb84614b46565b925060208401356001600160401b03811115614ff657600080fd5b61500286828701614f9d565b925050604084013561501381614e0b565b809150509250925092565b60008060006040848603121561503357600080fd5b8335925060208401356001600160401b0381111561505057600080fd5b61505c86828701614e58565b9497909650939450505050565b60008060006060848603121561507e57600080fd5b83356001600160401b038082111561509557600080fd5b6150a187838801614f9d565b945060208601359150808211156150b757600080fd5b5061500286828701614f9d565b6000602082840312156150d657600080fd5b6149e982614b46565b6020815260008251604060208401526150fb6060840182614bbb565b90506020840151151560408401528091505092915050565b60006020828403121561512557600080fd5b81356001600160401b0381111561513b57600080fd5b611f6384828501614f9d565b600381106114a757600080fd5b6000806000806080858703121561516a57600080fd5b61517385614b46565b935061518160208601614b46565b925060408501356001600160401b0381111561519c57600080fd5b6151a887828801614f9d565b92505060608501356151b981615147565b939692955090935050565b600080604083850312156151d757600080fd5b614c9e83614cd8565b600080604083850312156151f357600080fd5b82356151fe81614c6b565b91506020830135614d1b81614e0b565b6000806000806060858703121561522457600080fd5b61522d85614b46565b935061523b60208601614b46565b925060408501356001600160401b0381111561525657600080fd5b614ee987828801614d82565b6000806000806080858703121561527857600080fd5b843561528381614c6b565b9350602085013561529381614c6b565b92506040850135915060608501356001600160401b038111156152b557600080fd5b8501601f810187136152c657600080fd5b6152d587823560208401614f28565b91505092959194509250565b60006080820190508251825260208301516001600160401b0380821660208501528060408601511660408501525050606083015161531e81614bfd565b8060608401525092915050565b6000806040838503121561533e57600080fd5b8235614d0b81614c6b565b60008060006060848603121561535e57600080fd5b833561536981614c6b565b9250602084013561537981614c6b565b9150604084013561501381614c6b565b60008060006060848603121561539e57600080fd5b833592506153ae60208501614cd8565b9150604084013561501381615147565b634e487b7160e01b600052603260045260246000fd5b600181811c908216806153e857607f821691505b60208210810361299057634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160401b038381169083168181101561543e5761543e615408565b039392505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b601f821115610d5c57600081815260208120601f850160051c810160208610156154ba5750805b601f850160051c820191505b818110156154d9578281556001016154c6565b505050505050565b6001600160401b038311156154f8576154f8614f12565b61550c8361550683546153d4565b83615493565b6000601f84116001811461554057600085156155285750838201355b600019600387901b1c1916600186901b17835561140d565b600083815260209020601f19861690835b828110156155715786850135825560209485019460019092019101615551565b508682101561558e5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60006001600160401b038083168185168083038211156155c2576155c2615408565b01949350505050565b6000602082840312156155dd57600080fd5b5051919050565b600060ff821660ff84168060ff0382111561560157615601615408565b019392505050565b81516001600160401b0381111561562257615622614f12565b6156368161563084546153d4565b84615493565b602080601f83116001811461566b57600084156156535750858301515b600019600386901b1c1916600185901b1785556154d9565b600085815260208120601f198616915b8281101561569a5788860151825594840194600190910190840161567b565b50858210156156b85787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600084516156da818460208901614b8f565b6e3d913a3930b4ba2fba3cb832911d1160891b908301908152845161570681600f840160208901614b8f565b6a1116113b30b63ab2911d1160a91b600f9290910191820152835161573281601a840160208801614b8f565b61227d60f01b601a9290910191820152601c0195945050505050565b60008251615760818460208701614b8f565b9190910192915050565b60008154615777816153d4565b6001828116801561578f57600181146157a4576157d3565b60ff19841687528215158302870194506157d3565b8560005260208060002060005b858110156157ca5781548a8201529084019082016157b1565b50505082870194505b5050505092915050565b600083516157ef818460208801614b8f565b6157fb8184018561576a565b95945050505050565b60008351615816818460208801614b8f565b8351908301906155c2818360208801614b8f565b60008282101561583c5761583c615408565b500390565b697b226e616d65223a222360b01b8152845160009061586781600a850160208a01614b8f565b701116113232b9b1b934b83a34b7b7111d1160791b600a91840191820152615892601b82018761576a565b6b222c22747261697473223a5b60a01b815285519091506158ba81600c840160208901614b8f565b7f5d2c22696d616765223a22646174613a696d6167652f7376672b786d6c3b6261600c9290910191820152641cd94d8d0b60da1b602c8201528351615906816031840160208801614b8f565b61227d60f01b603192909101918201526033019695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161595b81601d850160208701614b8f565b91909101601d0192915050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b600060ff821660ff8416808210156159c7576159c7615408565b90039392505050565b600082198211156159e3576159e3615408565b500190565b6c3a32bc3a3ab93297383ab73c1760991b815260008351615a1081600d850160208801614b8f565b601760f91b600d918401918201528351615a3181600e840160208801614b8f565b01600e01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600082615aac57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615615acb57615acb615408565b500290565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060018201615b2d57615b2d615408565b5060010190565b600060208284031215615b4657600080fd5b81516149e981614e0b565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615b8490830184614bbb565b9695505050505050565b600060208284031215615ba057600080fd5b81516149e981614b13565b634e487b7160e01b600052603160045260246000fdfe3c73766720786d6c6e733d22687474703a2f2f7777772e77332e6f72672f323030302f737667222077696474683d2237303022206865696768743d22373030222076696577426f783d2230202d302e35203234203234222073686170652d72656e646572696e673d2263726973704564676573223e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f546578747572652050756e78202d206d65746164617461202620696d672066756c6c79206f6e20636861696e2c20666f72657665722e9c7480dd80e262ca2a6181819547f8f0676c4261f9311c052a6657ca998da3caa2646970667358221220ff5847870c5c9862e26c06fb3dd2a8198878731e1256a3cf212f05f400ef551064736f6c634300080f0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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