ETH Price: $3,110.44 (+1.40%)
Gas: 15 Gwei

Token

The Unfettered Founder's Pass NFT (UFP)
 

Overview

Max Total Supply

1,207 UFP

Holders

455

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
lbnlbn.eth
Balance
1 UFP
0x052435a7135ee596d23ae6404a5ab24c963302d8
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
UnfetteredFounderPass

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 35 : UnfetteredBaseToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "../../ext-contracts/@openzeppelin/contracts/access/Ownable.sol";
import "../../ext-contracts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "../../ext-contracts/operator-filter-registry/DefaultOperatorFilterer.sol";
import "../v1/money/RoyaltyReceiver.sol";
import "../v1/token/LimitedNFT.sol";
import "../v1/access/PausableTopic.sol";

abstract contract UnfetteredBaseToken is
    ERC721URIStorage,
    PausableTopic,
    RoyaltyReceiver,
    LimitedNFT,
    DefaultOperatorFilterer,
    Ownable
{
    string public _baseUri;
    string public _defaultMetadataURI;

    constructor(
        address accountOwner,
        string memory name,
        string memory symbol,
        string memory defaultMetadataURI,
        uint96 numerator,
        IERC20[] memory paymentTokens,
        uint256 maxSupply,
        uint256 maxMintCountForPerAddress
    )
        ERC721(name, symbol)
        RoyaltyReceiver(accountOwner, numerator, paymentTokens)
        LimitedNFT(maxSupply, maxMintCountForPerAddress)
    {
        _defaultMetadataURI = defaultMetadataURI;
    }

    function setPaused(uint8 topic, bool paused) public onlyOwner {
        _pausableTopics[topic] = paused;
    }

    function setAccountOwner(address accountOwner) public onlyOwner {
        _setAccountOwner(accountOwner);
    }

    function addRemovePaymentToken(
        IERC20 paymentToken,
        bool remove
    ) public onlyOwner {
        _addRemovePaymentToken(paymentToken, remove);
    }

    function withdraw() external onlyAccountOwner {
        _withdraw();
    }

    function _mint(
        address to,
        uint256 tokenId
    ) internal virtual override(ERC721, LimitedNFT) whenNotPaused(MintPauseTopicID) {
        LimitedNFT._mint(to, tokenId);
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _baseUri;
    }

    function setBaseURI(string calldata uri) external onlyOwner {
        _baseUri = uri;
    }

    function tokenURI(
        uint256 tokenId
    )
        public
        view
        virtual
        override(ERC721, ERC721URIStorage)
        returns (string memory)
    {
        string memory uri = ERC721URIStorage.tokenURI(tokenId);
        if (bytes(uri).length > 0)
            return uri;
        
        return _defaultMetadataURI;
    }

    function setTokenURI(
        uint256 tokenId,
        string memory _tokenURI
    ) public onlyOwner {
        ERC721URIStorage._setTokenURI(tokenId, _tokenURI);
    }

    function setMaxMintCountForPerAddress(
        uint256 max
    ) public virtual onlyOwner {
        _maxMintCountForPerAddress = max;
    }

    function setOperatorFiltering(bool enabled) public onlyOwner {
        _operatorFiltering = enabled;
    }

    function registerOperatorFilter(
        address registry,
        address subscriptionOrRegistrantToCopy,
        bool subscribe
    ) public onlyOwner {
        _registerOperatorFilter(
            registry,
            subscriptionOrRegistrantToCopy,
            subscribe
        );
    }

    function unregisterOperatorFilter(address registry) public onlyOwner {
        _unregisterOperatorFilter(registry);
    }

    function setApprovalForAll(
        address operator,
        bool approved
    ) public override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) {
        ERC721.setApprovalForAll(operator, approved);
    }

    function approve(
        address operator,
        uint256 tokenId
    ) public override(ERC721, IERC721) onlyAllowedOperatorApproval(operator) {
        ERC721.approve(operator, tokenId);
    }

    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
        ERC721.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
        ERC721.safeTransferFrom(from, to, tokenId);
    }

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

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal override(ERC721, ERC721Enumerable) {
        // if operation is not mint and paused for transfer operations
        if (from != address(0) && isPaused(TransferPauseTopicID))
            revert TopicPaused();

        ERC721Enumerable._beforeTokenTransfer(
            from,
            to,
            firstTokenId,
            batchSize
        );
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view override(ERC721, ERC721Enumerable, ERC2981) returns (bool) {
        return
            ERC721Enumerable.supportsInterface(interfaceId) ||
            ERC2981.supportsInterface(interfaceId);
    }

    function _burn(
        uint256 tokenId
    ) internal virtual override(ERC721, ERC721URIStorage) {
        ERC721URIStorage._burn(tokenId);
    }
}

uint8 constant MintPauseTopicID = 1;
uint8 constant TransferPauseTopicID = 2;

File 2 of 35 : UnfetteredFounderPass.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "./UnfetteredBaseToken.sol";
import "../v1/access/MerkleVerifier.sol";
import "../v1/util/TimeRangeLib.sol";
import "../v1/util/Errors.sol";
import "../v1/token/PhasedSales.sol";

/*
*   Developed by Versiyonbir Teknoloji
*   [email protected]
*/
contract UnfetteredFounderPass is UnfetteredBaseToken, PhasedSales {
    address public treasuryWallet;

    constructor(
        address accountOwner,
        string memory name,
        string memory symbol,
        string memory baseURI,
        uint96 numerator,
        IERC20 salesToken,
        IERC20[] memory paymentTokens,
        uint256 maxSupply,
        uint256 maxMintCountForPerAddress
    )
        UnfetteredBaseToken(
            accountOwner,
            name,
            symbol,
            baseURI,
            numerator,
            paymentTokens,
            maxSupply,
            maxMintCountForPerAddress
        )
        PhasedSales(salesToken)
    {
        if (address(salesToken) != address(0)) {
            // add salesToken (if does not exist)
            _addRemovePaymentToken(salesToken, false);
        }
    }

    function setTreasuryWallet(address addr) public onlyOwner {
        treasuryWallet = addr;
    }

    function setMaxSupply(uint256 maxSupply) public onlyOwner {
        _maxSupply = maxSupply;
    }

    function setSalesPhases(
        SalesPhase[] memory salesPhases
    ) external onlyOwner {
        _setSalesPhases(salesPhases);
    }

    function updateSalesPhase(
        uint8 phaseIndex,
        SalesPhase memory salesPhase
    ) public onlyOwner {
        _updateSalesPhase(phaseIndex, salesPhase);
    }

    function mintToTreasury(uint256 amount) public onlyOwner {
        for (uint i = 0; i < amount; i++) _mint(treasuryWallet, totalSupply());
    }

    function mint(
        uint8 phaseIndex, // starts from zero
        uint256 amount,
        uint256 requestedAmount,
        bytes32[] calldata merkleProof
    ) public payable whenNotPaused(SalePauseTopicID) {
        _buy(phaseIndex, amount, requestedAmount, merkleProof);

        for (uint i = 0; i < requestedAmount; i++)
            _mint(msg.sender, totalSupply());
    }

    function mint(
        uint8 phaseIndex, // starts from zero
        uint256 amount,
        uint256 requestedAmount
    ) public payable whenNotPaused(SalePauseTopicID) {
        _buy(phaseIndex, amount, requestedAmount);

        for (uint i = 0; i < requestedAmount; i++)
            _mint(msg.sender, totalSupply());
    }
}

uint8 constant SalePauseTopicID = 101;

File 3 of 35 : MerkleVerifier.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "../../../ext-contracts/@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

abstract contract MerkleVerifier {
    error MerkleVerificationEror();

    function verifyMerkle(
        bytes32 leaf,
        bytes32[] calldata merkleProof,
        bytes32 merkleRootHash
    ) internal pure {
        if (!MerkleProof.verifyCalldata(merkleProof, merkleRootHash, leaf))
            revert MerkleVerificationEror();
    }

    function isMerkleValid(
        bytes32 leaf,
        bytes32[] calldata merkleProof,
        bytes32 merkleRootHash
    ) internal pure returns(bool) {
        return MerkleProof.verifyCalldata(merkleProof, merkleRootHash, leaf);
    }
}

File 4 of 35 : PausableTopic.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

abstract contract PausableTopic {
    mapping(uint8 => bool) public _pausableTopics;

    error TopicPaused();
    error TopicNotPaused();

    modifier whenPaused(uint8 topic) {
        if (!_pausableTopics[topic]) revert TopicNotPaused();
        _;
    }

    modifier whenNotPaused(uint8 topic) {
        if (_pausableTopics[topic]) revert TopicPaused();
        _;
    }

    function isPaused(uint8 topic) public view returns(bool) {
        return _pausableTopics[topic];
    }
}

File 5 of 35 : CashCollector.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "../../../ext-contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../util/Errors.sol";

abstract contract CashCollector {
    IERC20[] _paymentTokens;
    bool internal _locked;
    address public _accountOwner;

    constructor(address accountOwner, IERC20[] memory paymentTokens) {
        _setAccountOwner(accountOwner);
        for (uint i = 0; i < paymentTokens.length; i++)
            _addRemovePaymentToken(paymentTokens[i], false);
    }

    receive() external payable {
        emit Receive(msg.sender, msg.value);
    }

    function _setAccountOwner(address accountOwner) internal {
        if (accountOwner == address(0)) revert ZeroAddress();

        _accountOwner = accountOwner;
    }

    function _addRemovePaymentToken(IERC20 paymentToken, bool remove) internal {
        if (address(paymentToken) == address(0)) revert ZeroAddress();

        uint256 ind;
        for (uint i = 0; i < _paymentTokens.length; i++) {
            if (address(_paymentTokens[i]) == address(paymentToken)) {
                ind = i + 1;
                break;
            }
        }

        if (!remove && ind == 0) _paymentTokens.push(paymentToken);
        else if (remove && ind > 0) {
            if (ind < _paymentTokens.length)
                _paymentTokens[ind - 1] = _paymentTokens[
                    _paymentTokens.length - 1
                ];
            _paymentTokens.pop();
        }
    }

    function getPaymentTokens() public view returns (IERC20[] memory) {
        return _paymentTokens;
    }

    function _withdraw() internal virtual noReentrant onlyAccountOwner {
        if (_accountOwner == address(0)) revert ZeroAddress();

        uint256 balance = address(this).balance;
        if (balance > 0) {
            payable(_accountOwner).call{value: balance}("");
        }

        uint256[] memory tokenBalances = new uint256[](_paymentTokens.length);
        for (uint256 i = 0; i < _paymentTokens.length; i++) {
            IERC20 paymentToken = _paymentTokens[i];
            balance = paymentToken.balanceOf(address(this));
            if (balance > 0) {
                paymentToken.transfer(_accountOwner, balance);
            }

            tokenBalances[i] = balance;
        }

        emit Withdrawn(_accountOwner, balance, _paymentTokens, tokenBalances);
    }

    event Withdrawn(
        address receiver,
        uint256 balance,
        IERC20[] paymentTokens,
        uint256[] tokenBalances
    );
    event Receive(address sender, uint256 amount);

    error NoReEntrancy();

    modifier onlyAccountOwner() {
        if (msg.sender != _accountOwner) revert Unauthorized();

        _;
    }
    modifier noReentrant() {
        if (_locked) revert NoReEntrancy();
        _locked = true;
        _;
        _locked = false;
    }
}

File 6 of 35 : RoyaltyReceiver.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "../../../ext-contracts/@openzeppelin/contracts/token/common/ERC2981.sol";
import "./CashCollector.sol";

abstract contract RoyaltyReceiver is CashCollector, ERC2981 {
    constructor(
        address accountOwner,
        uint96 numerator,
        IERC20[] memory paymentTokens
    ) CashCollector(accountOwner, paymentTokens) {
        _setDefaultRoyalty(address(this), numerator);
    }

    function feeDenominator() public pure returns (uint96) {
        return _feeDenominator();
    }
}

File 7 of 35 : LimitedNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "../../../ext-contracts/@openzeppelin/contracts/utils/Counters.sol";
import "../../../ext-contracts/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";

import "../util/Errors.sol";

abstract contract LimitedNFT is ERC721Enumerable {
    mapping(address => uint256) _mintCounter; // address => mint count
    uint256 public _maxMintCountForPerAddress;
    uint256 public _maxSupply;

    error MaxMintCountExceed();

    constructor(uint256 maxSupply, uint256 maxMintCountForPerAddress) {
        _maxSupply = maxSupply;
        _maxMintCountForPerAddress = maxMintCountForPerAddress;
    }

    // function _mintTo(address to) internal virtual {
    //     _mint(to, totalSupply());
    // }

    function _mint(address to, uint256 tokenId) internal virtual override {
        if (
            _maxMintCountForPerAddress > 0 &&
            _mintCounter[to] == _maxMintCountForPerAddress
        ) revert MaxMintCountExceed();

        if (_maxSupply > 0 && totalSupply() == _maxSupply)
            revert MaxSupplyReached();

        ERC721._mint(to, tokenId);
        _mintCounter[to]++;
    }

    function getMintCount(address tokenOwner) public view returns (uint256) {
        return _mintCounter[tokenOwner];
    }
}

File 8 of 35 : PhasedSales.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "../../../ext-contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../access/MerkleVerifier.sol";
import "../util/TimeRangeLib.sol";
import "../util/Errors.sol";

abstract contract PhasedSales is MerkleVerifier {
    SalesPhase[] public _salesPhases;
    mapping(uint8 => mapping(address => uint256)) public _usages;
    // mapping(bytes32 => mapping(address => uint256)) public _usages;
    IERC20 public _salesToken;

    constructor(IERC20 salesToken) {
        _salesToken = salesToken;
    }

    function _setSalesPhases(SalesPhase[] memory salesPhases) internal {
        while (_salesPhases.length > salesPhases.length) _salesPhases.pop();

        if (_salesPhases.length >= salesPhases.length) {
            for (uint i = 0; i < salesPhases.length; i++)
                _salesPhases[i] = salesPhases[i];
        }

        uint256 ind = _salesPhases.length;
        for (uint i = ind; i < salesPhases.length; i++)
            _salesPhases.push(salesPhases[i]);
    }

    function getSalesPhases() public view returns (SalesPhase[] memory) {
        return _salesPhases;
    }

    function _updateSalesPhase(
        uint8 phaseIndex,
        SalesPhase memory salesPhase
    ) internal {
        if (_salesPhases.length <= phaseIndex) revert InvalidValue();

        _salesPhases[phaseIndex] = salesPhase;
    }

    /* 
      don't forget the withdraw function implementation 
      in the contract that derives from this contract
    */
    function _buy(
        uint8 phaseIndex, // starts from zero
        uint256 amount,
        uint256 requestedAmount
    ) internal {
        if (phaseIndex + 1 > _salesPhases.length) revert InvalidValue();

        SalesPhase memory salesPhase = _salesPhases[phaseIndex];
        // if merkle hash is set. this _buy method cannot be called.
        // must be call buy method with merkle params for merkle verification
        if (salesPhase.merkleRootHash != bytes32(0x0)) revert InvalidCall();

        uint256 price = salesPhase.price;

        // check period
        TimeRangeLib.check(salesPhase.timeRange);

        if (
            salesPhase.amountLimiting &&
            _usages[phaseIndex][msg.sender] >= amount
        ) revert MaxAmountReached();

        _receivePayment(
            amount,
            requestedAmount,
            salesPhase.amountLimiting,
            price,
            phaseIndex
        );
    }

    function _buy(
        uint8 phaseIndex, // starts from zero
        uint256 amount,
        uint256 requestedAmount,
        bytes32[] calldata merkleProof
    ) internal {
        if (phaseIndex + 1 > _salesPhases.length) revert InvalidValue();

        SalesPhase memory salesPhase = _salesPhases[phaseIndex];
        uint256 price = salesPhase.price;

        if (price == 0 && salesPhase.merkleRootHash == bytes32(0x0))
            revert InvalidValue();

        // check period
        TimeRangeLib.check(salesPhase.timeRange);

        if (
            salesPhase.amountLimiting &&
            _usages[phaseIndex][msg.sender] >= amount
        ) revert MaxAmountReached();

        bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount));

        bool valid = isMerkleValid(
            leaf,
            merkleProof,
            salesPhase.merkleRootHash
        );
        if (!valid && phaseIndex > 0) {
            // check old phases
            for (uint8 i = phaseIndex; i > 0; i--) {
                salesPhase = _salesPhases[i - 1];

                // is there a price for current phase in the old phase
                // if not, continue with previous phase
                uint256[] memory prices = salesPhase.phasePrices;
                if (phaseIndex + 1 > prices.length) continue;

                price = prices[phaseIndex]; // current phase price for old phase
                bool amountOK = !salesPhase.amountLimiting;
                if (salesPhase.amountLimiting) {
                    uint256 usedAmount = _usages[i - 1][msg.sender];
                    uint256 remainingAmount = amount - usedAmount;
                    if (requestedAmount <= remainingAmount) amountOK = true;
                }

                // if the merkleRootHash is not already used in the old phase
                if (amountOK) {
                    valid = isMerkleValid(
                        leaf,
                        merkleProof,
                        salesPhase.merkleRootHash
                    );
                    if (valid) break;
                }
            }
        }

        if (!valid) revert MerkleVerificationEror();

        _receivePayment(
            amount,
            requestedAmount,
            salesPhase.amountLimiting,
            price,
            phaseIndex
        );
    }

    function _receivePayment(
        uint256 amount,
        uint256 requestedAmount,
        bool amountLimiting,
        uint256 price,
        uint8 phaseIndex
    ) private {
        if (amountLimiting) {
            uint256 usedAmount = _usages[phaseIndex][msg.sender];
            uint256 remainingAmount = amount - usedAmount;
            if (requestedAmount > remainingAmount) revert InvalidAmount();
        }

        _usages[phaseIndex][msg.sender] += requestedAmount;

        uint256 totalAmount = requestedAmount * price;
        if (totalAmount == 0) return;

        if (address(_salesToken) != address(0)) {
            bool transferOK = _salesToken.transferFrom(
                msg.sender,
                address(this),
                totalAmount
            );

            if (!transferOK) revert TransferFailed("");
        } else if (msg.value < totalAmount) {
            revert InsufficientAmount();
        }
    }
}

struct SalesPhase {
    bytes32 merkleRootHash;
    uint256 price;
    uint256[] phasePrices; //if can be bought at different phases
    StartEndTime timeRange;
    bool amountLimiting;
}

File 9 of 35 : ArrayFind.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "./Types.sol";

library ArrayFind {
    function find(
        uint256[] memory arr,
        uint value
    ) internal pure returns (uint256) {
        uint256 ind = IndexNotFound;
        for (uint256 i = 0; i < arr.length; i++) {
            if (arr[i] == value) {
                ind = i;
                break;
            }
        }

        return ind;
    }

    function find(
        bytes32[] memory arr,
        bytes32 value
    ) internal pure returns (uint256) {
        uint256 ind = IndexNotFound;
        for (uint i = 0; i < arr.length; i++) {
            if (arr[i] == value) {
                ind = i;
                break;
            }
        }

        return ind;
    }

    function find(
        address[] memory arr,
        address value
    ) internal pure returns (uint256) {
        uint256 ind = IndexNotFound;
        for (uint i = 0; i < arr.length; i++) {
            if (arr[i] == value) {
                ind = i;
                break;
            }
        }

        return ind;
    }

    function exist(
        address[] memory arr,
        address value
    ) internal pure returns (bool) {
        return find(arr, value) != IndexNotFound;
    }

    function checkForDublicates(
        address[] memory arr
    ) internal pure returns (bool) {
        for (uint i = 0; i < arr.length; i++) {
            address _val = arr[i];

            for (uint j = i + 1; j < arr.length; j++) {
                if (arr[j] == _val) return true;
            }
        }

        return false;
    }
}

File 10 of 35 : Errors.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

import "./StringHelper.sol";

error Failed(bytes reason);
error TransferFailed(bytes reason);
error ZeroAddress();
error AlreadyExist();
error ZeroValue();
error ZeroBalance();
error EmptyValue();
error InsufficientAmount();
error GreaterThanZero();
error Ownership();
error NotFound();
error InvalidTokenType();
error MustBeLaterThanNow();
error MustBeLaterThan(uint64 time);
error NotStarted();
error Ended();
error Incomplete();
error NotRefundable();
error NoRefundFound();
error MustBeHigherThanPreviousOne();
error MustBeLowerThanPreviousOne();
error LengthMismatch();
error MaxSupplyReached();
error MaxAmountReached();
error InvalidDate();
error InvalidAmount();
error InvalidValue();
error InvalidCall();
error Unauthorized();
error NotImplemented();
error Required();

library ErrorHelper {
    using StringHelper for string;

    function checkAddress(address addr) internal pure {
        if (addr == address(0)) revert ZeroAddress();
    }

    function checkZero(uint256 _value) internal pure {
        if (_value == 0) revert ZeroValue();
    }

    function checkEmpty(string memory _s) internal pure {
        if (_s.isEmpty()) revert EmptyValue();
    }
}

File 11 of 35 : StringHelper.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

library StringHelper {
    function toHash(string memory _s) internal pure returns (bytes32) {
        return keccak256(abi.encode(_s));
    }

    function isEmpty(string memory _s) internal pure returns (bool) {
        return length(_s) == 0;
    }

    function length(string memory _s) internal pure returns (uint256) {
        return bytes(_s).length;
    }
}

File 12 of 35 : TimeRangeLib.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "./Errors.sol";

struct StartEndTime {
    uint64 start;
    uint64 end;
}

library TimeRangeLib {
    function isStarted(StartEndTime memory time)
        internal
        view
        returns (bool)
    {
        return time.start <= block.timestamp;
    }

    function isEnded(StartEndTime memory time)
        internal
        view
        returns (bool)
    {
        return time.end <= block.timestamp;
    }

    function isItIn(StartEndTime memory time)
        internal
        view
        returns (bool)
    {
        return isStarted(time) && !isEnded(time);
    }

    function checkStarted(StartEndTime memory time)
        internal
        view
    {
        if (!isStarted(time)) revert NotStarted();
    }

    function checkEnded(StartEndTime memory time)
        internal
        view
    {
        if (isEnded(time)) revert Ended();
    }

    function check(StartEndTime memory time)
        internal
        view
    {
        checkStarted(time);
        checkEnded(time);
    }
}

File 13 of 35 : Types.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;

uint256 constant IndexNotFound = 2 ^ (256 - 1);

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

pragma solidity ^0.8.0;

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

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

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

    error OwnableCallerIsNotTheOwner();
    error OwnableNewOwnerIsTheZeroAddress();

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if(owner() != _msgSender()) revert OwnableCallerIsNotTheOwner();
    }

    /**
     * @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 {
        if(newOwner == address(0)) revert OwnableNewOwnerIsTheZeroAddress();
        _transferOwnership(newOwner);
    }

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

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

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.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 IERC2981 is IERC165 {
    /**
     * @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 16 of 35 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

    error ERC2981InvalidParameters();

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator());
        require(receiver != address(0));

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator());
        if(receiver == address(0)) revert ERC2981InvalidParameters();

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 18 of 35 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

    error ERC721AddressZeroIsNotAValidOwner();
    error ERC721InvalidTokenID();
    error ERC721ApprovalToCurrentOwner();
    error ERC721ApproveCallerIsNotTokenOwnerOrApprovedForAll();
    error ERC721CallerIsNotTokenOwnerOrApproved();
    error ERC721TransferToNonERC721ReceiverImplementer();
    error ERC721MintToTheZeroAddress();
    error ERC721TokenAlreadyMinted();
    error ERC721TransferFromIncorrectOwner();
    error ERC721TransferToTheZeroAddress();
    error ERC721ApproveToCaller();

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        if(owner == address(0)) revert ERC721InvalidTokenID();
        return owner;
    }

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

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

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

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

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

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

        if(!(_msgSender() == owner || isApprovedForAll(owner, _msgSender())))
            revert ERC721ApproveCallerIsNotTokenOwnerOrApprovedForAll();

        _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
        if(!_isApprovedOrOwner(_msgSender(), tokenId)) revert ERC721CallerIsNotTokenOwnerOrApproved();

        _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 {
        if(!_isApprovedOrOwner(_msgSender(), tokenId)) revert ERC721CallerIsNotTokenOwnerOrApproved();
        _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);
        if(!_checkOnERC721Received(from, to, tokenId, data)) revert ERC721TransferToNonERC721ReceiverImplementer();
    }

    /**
     * @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 = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

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

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

    /**
     * @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 {
        if(to == address(0)) revert ERC721MintToTheZeroAddress();
        if(_exists(tokenId)) revert ERC721TokenAlreadyMinted();

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

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        if(_exists(tokenId)) revert ERC721TokenAlreadyMinted();

        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 = ERC721.ownerOf(tokenId);

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

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.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 {
        if(ERC721.ownerOf(tokenId) != from) revert ERC721TransferFromIncorrectOwner();
        if(to == address(0)) revert ERC721TransferToTheZeroAddress();

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        if(ERC721.ownerOf(tokenId) != from) revert ERC721TransferFromIncorrectOwner();

        // 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(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        if(owner == operator) revert ERC721ApproveToCaller();
        _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 {
        if(!_exists(tokenId)) revert ERC721InvalidTokenID();
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert ERC721TransferToNonERC721ReceiverImplementer();
                } 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 {}
}

File 19 of 35 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

    error ERC721EnumerableOwnerIndexOutOfBounds();
    error ERC721EnumerableGlobalIndexOutOfBounds();
    error ERC721EnumerableConsecutiveTransfersNotSupported();

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        if(!(index < ERC721.balanceOf(owner))) revert ERC721EnumerableOwnerIndexOutOfBounds();
        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) {
        if(!(index < ERC721Enumerable.totalSupply())) revert ERC721EnumerableGlobalIndexOutOfBounds();
        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 ERC721EnumerableConsecutiveTransfersNotSupported();
        }

        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 = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../ERC721.sol";

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorage is ERC721 {
    using Strings for uint256;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

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

        string memory _tokenURI = _tokenURIs[tokenId];
        string memory base = _baseURI();

        // If there is no base URI, return the token URI.
        if (bytes(base).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(base, _tokenURI));
        }

        return super.tokenURI(tokenId);
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {
        if(!_exists(tokenId)) revert ERC721URIStorageURISetOfNonexistentToken();
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev See {ERC721-_burn}. This override additionally checks to see if a
     * token-specific URI was set for the token, and if so, it deletes the token URI from
     * the storage mapping.
     */
    function _burn(uint256 tokenId) internal virtual override {
        super._burn(tokenId);

        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }
    }
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

    /**
     * @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 35 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 23 of 35 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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 24 of 35 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 25 of 35 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return 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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(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 26 of 35 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 27 of 35 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 28 of 35 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

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

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

    /**
     * @dev Returns true if the `leaves` can be 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 29 of 35 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

File 31 of 35 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    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 * 8) < value ? 1 : 0);
        }
    }
}

File 32 of 35 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

    error StringsHexLengthInsufficient();

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.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, Math.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;
        }
        if(value != 0) revert StringsHexLengthInsufficient();
        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 33 of 35 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {OperatorFilterer} from "./OperatorFilterer.sol";

contract DefaultOperatorFilterer is OperatorFilterer {
    // constructor(
    //     address registry,
    //     address subscription
    // ) OperatorFilterer(registry, subscription, true) {}
}

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

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function unregister(address addr) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

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

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import "../../contracts/v1/util/ArrayFind.sol";
import "../../contracts/v1/util/Types.sol";

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

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

    using ArrayFind for address;
    OperatorRegistry[] public _operatorRegistries;
    bool _operatorFiltering = true;

    /// @dev The constructor that is called when the contract is being deployed.
    // constructor(
    //     address registry,
    //     address subscriptionOrRegistrantToCopy,
    //     bool subscribe
    // ) {
    //     _registerOperatorFilter(registry, subscriptionOrRegistrantToCopy, subscribe);
    // }

    function _registerOperatorFilter(
        address registry,
        address subscriptionOrRegistrantToCopy,
        bool subscribe
    ) internal virtual {
        if (registry.code.length == 0) return;

        IOperatorFilterRegistry filterRegistry = IOperatorFilterRegistry(
            registry
        );

        if (subscribe) {
            filterRegistry.registerAndSubscribe(
                address(this),
                subscriptionOrRegistrantToCopy
            );
        } else {
            if (subscriptionOrRegistrantToCopy != address(0)) {
                filterRegistry.registerAndCopyEntries(
                    address(this),
                    subscriptionOrRegistrantToCopy
                );
            } else {
                filterRegistry.register(address(this));
            }
        }

        _operatorRegistries.push(
            OperatorRegistry(
                registry,
                subscribe ? subscriptionOrRegistrantToCopy : address(0)
            )
        );
    }

    function _unregisterOperatorFilter(address registry) internal virtual {
        IOperatorFilterRegistry(registry).unregister(address(this));

        uint256 ind;
        uint256 len = _operatorRegistries.length;
        for (uint i = 0; i < len; i++) {
            if (_operatorRegistries[i].registry == registry) {
                ind = i + 1;
                break;
            }
        }

        if (ind == 0) return;
        if (ind < len)
            _operatorRegistries[ind - 1] = _operatorRegistries[len - 1];

        _operatorRegistries.pop();
    }

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

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

    /**
     * @dev A helper function to check if an operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        if (!_operatorFiltering) return;

        bool ok = false;
        for (uint i = 0; i < _operatorRegistries.length; i++) {
            address registry = _operatorRegistries[i].registry;
            ok = IOperatorFilterRegistry(registry).isOperatorAllowed(
                address(this),
                operator
            );

            // only one operator allowance is enough
            if (ok) break;
        }

        // if there is no operator allowance
        if (!ok) {
            revert OperatorNotAllowed(operator);
        }
    }
}

struct OperatorRegistry {
    address registry;
    address subscription;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"accountOwner","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"uint96","name":"numerator","type":"uint96"},{"internalType":"contract IERC20","name":"salesToken","type":"address"},{"internalType":"contract IERC20[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"uint256","name":"maxMintCountForPerAddress","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC2981InvalidParameters","type":"error"},{"inputs":[],"name":"ERC721AddressZeroIsNotAValidOwner","type":"error"},{"inputs":[],"name":"ERC721ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ERC721ApproveCallerIsNotTokenOwnerOrApprovedForAll","type":"error"},{"inputs":[],"name":"ERC721ApproveToCaller","type":"error"},{"inputs":[],"name":"ERC721CallerIsNotTokenOwnerOrApproved","type":"error"},{"inputs":[],"name":"ERC721EnumerableConsecutiveTransfersNotSupported","type":"error"},{"inputs":[],"name":"ERC721EnumerableGlobalIndexOutOfBounds","type":"error"},{"inputs":[],"name":"ERC721EnumerableOwnerIndexOutOfBounds","type":"error"},{"inputs":[],"name":"ERC721InvalidTokenID","type":"error"},{"inputs":[],"name":"ERC721MintToTheZeroAddress","type":"error"},{"inputs":[],"name":"ERC721TokenAlreadyMinted","type":"error"},{"inputs":[],"name":"ERC721TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"ERC721TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"ERC721TransferToTheZeroAddress","type":"error"},{"inputs":[],"name":"ERC721URIStorageURISetOfNonexistentToken","type":"error"},{"inputs":[],"name":"Ended","type":"error"},{"inputs":[],"name":"InsufficientAmount","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCall","type":"error"},{"inputs":[],"name":"InvalidValue","type":"error"},{"inputs":[],"name":"MaxAmountReached","type":"error"},{"inputs":[],"name":"MaxMintCountExceed","type":"error"},{"inputs":[],"name":"MaxSupplyReached","type":"error"},{"inputs":[],"name":"MerkleVerificationEror","type":"error"},{"inputs":[],"name":"NoReEntrancy","type":"error"},{"inputs":[],"name":"NotStarted","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnableCallerIsNotTheOwner","type":"error"},{"inputs":[],"name":"OwnableNewOwnerIsTheZeroAddress","type":"error"},{"inputs":[],"name":"TopicNotPaused","type":"error"},{"inputs":[],"name":"TopicPaused","type":"error"},{"inputs":[{"internalType":"bytes","name":"reason","type":"bytes"}],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Receive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"},{"indexed":false,"internalType":"contract IERC20[]","name":"paymentTokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"tokenBalances","type":"uint256[]"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"_accountOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_baseUri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_defaultMetadataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxMintCountForPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_operatorRegistries","outputs":[{"internalType":"address","name":"registry","type":"address"},{"internalType":"address","name":"subscription","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"_pausableTopics","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_salesPhases","outputs":[{"internalType":"bytes32","name":"merkleRootHash","type":"bytes32"},{"internalType":"uint256","name":"price","type":"uint256"},{"components":[{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"end","type":"uint64"}],"internalType":"struct StartEndTime","name":"timeRange","type":"tuple"},{"internalType":"bool","name":"amountLimiting","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_salesToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"address","name":"","type":"address"}],"name":"_usages","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"paymentToken","type":"address"},{"internalType":"bool","name":"remove","type":"bool"}],"name":"addRemovePaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeDenominator","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenOwner","type":"address"}],"name":"getMintCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPaymentTokens","outputs":[{"internalType":"contract IERC20[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSalesPhases","outputs":[{"components":[{"internalType":"bytes32","name":"merkleRootHash","type":"bytes32"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256[]","name":"phasePrices","type":"uint256[]"},{"components":[{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"end","type":"uint64"}],"internalType":"struct StartEndTime","name":"timeRange","type":"tuple"},{"internalType":"bool","name":"amountLimiting","type":"bool"}],"internalType":"struct SalesPhase[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"topic","type":"uint8"}],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"phaseIndex","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"phaseIndex","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintToTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"},{"internalType":"address","name":"subscriptionOrRegistrantToCopy","type":"address"},{"internalType":"bool","name":"subscribe","type":"bool"}],"name":"registerOperatorFilter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"accountOwner","type":"address"}],"name":"setAccountOwner","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":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"max","type":"uint256"}],"name":"setMaxMintCountForPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setOperatorFiltering","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"topic","type":"uint8"},{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"merkleRootHash","type":"bytes32"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256[]","name":"phasePrices","type":"uint256[]"},{"components":[{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"end","type":"uint64"}],"internalType":"struct StartEndTime","name":"timeRange","type":"tuple"},{"internalType":"bool","name":"amountLimiting","type":"bool"}],"internalType":"struct SalesPhase[]","name":"salesPhases","type":"tuple[]"}],"name":"setSalesPhases","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setTreasuryWallet","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":[],"name":"treasuryWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"registry","type":"address"}],"name":"unregisterOperatorFilter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"phaseIndex","type":"uint8"},{"components":[{"internalType":"bytes32","name":"merkleRootHash","type":"bytes32"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256[]","name":"phasePrices","type":"uint256[]"},{"components":[{"internalType":"uint64","name":"start","type":"uint64"},{"internalType":"uint64","name":"end","type":"uint64"}],"internalType":"struct StartEndTime","name":"timeRange","type":"tuple"},{"internalType":"bool","name":"amountLimiting","type":"bool"}],"internalType":"struct SalesPhase","name":"salesPhase","type":"tuple"}],"name":"updateSalesPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526014805460ff191660011790553480156200001e57600080fd5b5060405162004f6338038062004f638339810160408190526200004191620005f4565b83898989898988888881818986868b8b84836200005e8262000157565b60005b8151811015620000af576200009a828281518110620000845762000084620006fa565b60200260200101516000620001a760201b60201c565b80620000a68162000726565b91505062000061565b5060029150620000c290508382620007d0565b506003620000d18282620007d0565b505050620000e630836200038860201b60201c565b505050601291909155601155620000fd33620003ee565b60166200010b8682620007d0565b5050601980546001600160a01b0319166001600160a01b03998a1617905550505050928716159250620001489150505762000148846000620001a7565b505050505050505050620008e4565b6001600160a01b0381166200017f5760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6001600160a01b038216620001cf5760405163d92e233d60e01b815260040160405180910390fd5b6000805b6000548110156200024357836001600160a01b031660008281548110620001fe57620001fe620006fa565b6000918252602090912001546001600160a01b0316036200022e57620002268160016200089c565b915062000243565b806200023a8162000726565b915050620001d3565b508115801562000251575080155b15620002a457600080546001810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319166001600160a01b038516179055505050565b818015620002b25750600081115b1562000383576000548110156200034c5760008054620002d590600190620008b8565b81548110620002e857620002e8620006fa565b60009182526020822001546001600160a01b0316906200030a600184620008b8565b815481106200031d576200031d620006fa565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b6000805480620003605762000360620008ce565b600082815260209020810160001990810180546001600160a01b03191690550190555b505050565b6127106001600160601b0382161115620003a157600080fd5b6001600160a01b038216620003b557600080fd5b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600a55565b601480546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811681146200045e57600080fd5b50565b80516200046e8162000448565b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620004b457620004b462000473565b604052919050565b600082601f830112620004ce57600080fd5b81516001600160401b03811115620004ea57620004ea62000473565b602062000500601f8301601f1916820162000489565b82815285828487010111156200051557600080fd5b60005b838110156200053557858101830151828201840152820162000518565b506000928101909101919091529392505050565b80516001600160601b03811681146200046e57600080fd5b600082601f8301126200057357600080fd5b815160206001600160401b0382111562000591576200059162000473565b8160051b620005a282820162000489565b9283528481018201928281019087851115620005bd57600080fd5b83870192505b84831015620005e9578251620005d98162000448565b82529183019190830190620005c3565b979650505050505050565b60008060008060008060008060006101208a8c0312156200061457600080fd5b6200061f8a62000461565b60208b01519099506001600160401b03808211156200063d57600080fd5b6200064b8d838e01620004bc565b995060408c01519150808211156200066257600080fd5b620006708d838e01620004bc565b985060608c01519150808211156200068757600080fd5b620006958d838e01620004bc565b9750620006a560808d0162000549565b9650620006b560a08d0162000461565b955060c08c0151915080821115620006cc57600080fd5b50620006db8c828d0162000561565b93505060e08a015191506101008a015190509295985092959850929598565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016200073b576200073b62000710565b5060010190565b600181811c908216806200075757607f821691505b6020821081036200077857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200038357600081815260208120601f850160051c81016020861015620007a75750805b601f850160051c820191505b81811015620007c857828155600101620007b3565b505050505050565b81516001600160401b03811115620007ec57620007ec62000473565b6200080481620007fd845462000742565b846200077e565b602080601f8311600181146200083c5760008415620008235750858301515b600019600386901b1c1916600185901b178555620007c8565b600085815260208120601f198616915b828110156200086d578886015182559484019460019091019084016200084c565b50858210156200088c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620008b257620008b262000710565b92915050565b81810381811115620008b257620008b262000710565b634e487b7160e01b600052603160045260246000fd5b61466f80620008f46000396000f3fe60806040526004361061031e5760003560e01c806370a08231116101ab578063b88d4fde116100f7578063e985e9c511610095578063f2fde38b1161006f578063f2fde38b14610a54578063f328718714610a74578063f49e641b14610a94578063f63a859114610ab457600080fd5b8063e985e9c5146109d3578063eae498fe14610a1c578063edaed5e414610a2f57600080fd5b8063c87b56dd116100d1578063c87b56dd14610931578063ca5e553e14610951578063cd2bb70d14610973578063d2525605146109b357600080fd5b8063b88d4fde146108be578063bc61e733146108de578063c5b82c1a1461091157600080fd5b8063932c75eb11610164578063a2801f571161013e578063a2801f5714610810578063a65948a314610846578063a8602fea14610866578063aff6ebc61461088657600080fd5b8063932c75eb146107bb57806395d89b41146107db578063a22cb465146107f057600080fd5b806370a08231146106bf578063715018a6146106df5780637f9db1f7146106f45780638da5cb5b1461070757806390e105f41461072a57806392defcb91461078b57600080fd5b80632b3211941161026a5780634f6ccce711610223578063649d6833116101fd578063649d68331461064857806365c46d161461065d5780636dc59d801461067f5780636f8b44b01461069f57600080fd5b80634f6ccce7146105e857806355f804b3146106085780636352211e1461062857600080fd5b80632b3211941461053e5780632f745c591461055e5780633ccfd60b1461057e5780633e63eb2a1461059357806342842e0e146105a85780634626402b146105c857600080fd5b8063162094c4116102d75780631d6cb257116102b15780631d6cb257146104a957806322f4596f146104c957806323b872dd146104df5780632a55205a146104ff57600080fd5b8063162094c414610457578063180b0d7e1461047757806318160ddd1461049457600080fd5b806301ffc9a71461036257806306fdde0314610397578063081812fc146103b9578063095ea7b3146103f1578063124429551461041357806314863b4b1461043757600080fd5b3661035d57604080513381523460208201527fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def3910160405180910390a1005b600080fd5b34801561036e57600080fd5b5061038261037d3660046138d2565b610ad4565b60405190151581526020015b60405180910390f35b3480156103a357600080fd5b506103ac610af4565b60405161038e919061393f565b3480156103c557600080fd5b506103d96103d4366004613952565b610b86565b6040516001600160a01b03909116815260200161038e565b3480156103fd57600080fd5b5061041161040c366004613980565b610bad565b005b34801561041f57600080fd5b5061042960115481565b60405190815260200161038e565b34801561044357600080fd5b506104116104523660046139ca565b610bc6565b34801561046357600080fd5b50610411610472366004613ac8565b610bdc565b34801561048357600080fd5b50604051612710815260200161038e565b3480156104a057600080fd5b50600e54610429565b3480156104b557600080fd5b506104116104c4366004613b22565b610bee565b3480156104d557600080fd5b5061042960125481565b3480156104eb57600080fd5b506104116104fa366004613b6d565b610c01565b34801561050b57600080fd5b5061051f61051a366004613bae565b610c2c565b604080516001600160a01b03909316835260208301919091520161038e565b34801561054a57600080fd5b50610411610559366004613bd0565b610cd8565b34801561056a57600080fd5b50610429610579366004613980565b610cec565b34801561058a57600080fd5b50610411610d3f565b34801561059f57600080fd5b506103ac610d78565b3480156105b457600080fd5b506104116105c3366004613b6d565b610e06565b3480156105d457600080fd5b50601a546103d9906001600160a01b031681565b3480156105f457600080fd5b50610429610603366004613952565b610e2b565b34801561061457600080fd5b50610411610623366004613bed565b610e7a565b34801561063457600080fd5b506103d9610643366004613952565b610e8f565b34801561065457600080fd5b506103ac610ec5565b34801561066957600080fd5b50610672610ed2565b60405161038e9190613c99565b34801561068b57600080fd5b5061041161069a366004613d65565b610fdf565b3480156106ab57600080fd5b506104116106ba366004613952565b61100c565b3480156106cb57600080fd5b506104296106da366004613bd0565b611019565b3480156106eb57600080fd5b5061041161105e565b610411610702366004613d81565b611070565b34801561071357600080fd5b5060145461010090046001600160a01b03166103d9565b34801561073657600080fd5b5061074a610745366004613952565b611100565b60405161038e949392919093845260208085019390935281516001600160401b03908116604086015291909201511660608301521515608082015260a00190565b34801561079757600080fd5b506103826107a6366004613db4565b60096020526000908152604090205460ff1681565b3480156107c757600080fd5b506104116107d6366004613dcf565b611166565b3480156107e757600080fd5b506103ac611181565b3480156107fc57600080fd5b5061041161080b3660046139ca565b611190565b34801561081c57600080fd5b5061042961082b366004613bd0565b6001600160a01b031660009081526010602052604090205490565b34801561085257600080fd5b50610411610861366004613952565b6111a4565b34801561087257600080fd5b50610411610881366004613bd0565b6111e2565b34801561089257600080fd5b506104296108a1366004613dec565b601860209081526000928352604080842090915290825290205481565b3480156108ca57600080fd5b506104116108d9366004613e18565b61120c565b3480156108ea57600080fd5b506103826108f9366004613db4565b60ff9081166000908152600960205260409020541690565b34801561091d57600080fd5b5061041161092c366004614006565b611232565b34801561093d57600080fd5b506103ac61094c366004613952565b611244565b34801561095d57600080fd5b506109666112f4565b60405161038e9190614049565b34801561097f57600080fd5b5061099361098e366004613952565b611355565b604080516001600160a01b0393841681529290911660208301520161038e565b3480156109bf57600080fd5b506104116109ce366004613952565b61138e565b3480156109df57600080fd5b506103826109ee366004614096565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b610411610a2a3660046140b4565b61139b565b348015610a3b57600080fd5b506001546103d99061010090046001600160a01b031681565b348015610a6057600080fd5b50610411610a6f366004613bd0565b61142a565b348015610a8057600080fd5b506019546103d9906001600160a01b031681565b348015610aa057600080fd5b50610411610aaf36600461414a565b611462565b348015610ac057600080fd5b50610411610acf366004613bd0565b611473565b6000610adf82611484565b80610aee5750610aee826114a5565b92915050565b606060028054610b03906141fa565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2f906141fa565b8015610b7c5780601f10610b5157610100808354040283529160200191610b7c565b820191906000526020600020905b815481529060010190602001808311610b5f57829003601f168201915b5050505050905090565b6000610b91826114ca565b506000908152600660205260409020546001600160a01b031690565b81610bb7816114ff565b610bc18383611604565b505050565b610bce611686565b610bd882826116b7565b5050565b610be4611686565b610bd8828261187b565b610bf6611686565b610bc18383836118c8565b826001600160a01b0381163314610c1b57610c1b336114ff565b610c26848484611a6e565b50505050565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610ca1575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610cc0906001600160601b03168761424a565b610cca9190614261565b915196919550909350505050565b610ce0611686565b610ce981611aa0565b50565b6000610cf783611019565b8210610d16576040516355e7adfd60e11b815260040160405180910390fd5b506001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b60015461010090046001600160a01b03163314610d6e576040516282b42960e81b815260040160405180910390fd5b610d76611aef565b565b60158054610d85906141fa565b80601f0160208091040260200160405190810160405280929190818152602001828054610db1906141fa565b8015610dfe5780601f10610dd357610100808354040283529160200191610dfe565b820191906000526020600020905b815481529060010190602001808311610de157829003601f168201915b505050505081565b826001600160a01b0381163314610e2057610e20336114ff565b610c26848484611dd3565b6000610e36600e5490565b8210610e555760405163842adba960e01b815260040160405180910390fd5b600e8281548110610e6857610e68614283565b90600052602060002001549050919050565b610e82611686565b6015610bc18284836142df565b6000818152600460205260408120546001600160a01b031680610aee57604051633f0f7f7360e01b815260040160405180910390fd5b60168054610d85906141fa565b60606017805480602002602001604051908101604052809291908181526020016000905b82821015610fd657838290600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201805480602002602001604051908101604052809291908181526020018280548015610f7c57602002820191906000526020600020905b815481526020019060010190808311610f68575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b909104166020828101919091528084019190915260049093015460ff1615159101529082526001929092019101610ef6565b50505050905090565b610fe7611686565b60ff919091166000908152600960205260409020805460ff1916911515919091179055565b611014611686565b601255565b60006001600160a01b03821661104257604051630b505c1d60e11b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205490565b611066611686565b610d766000611dee565b6065600081905260096020527fc8f777898976f233a76ced87b7df382590c7f23fef0a3657bf3a39a3984e7ce55460ff16156110bf576040516373fb720560e11b815260040160405180910390fd5b6110ca848484611e48565b60005b828110156110f9576110e7336110e2600e5490565b611fe5565b806110f18161439e565b9150506110cd565b5050505050565b6017818154811061111057600080fd5b6000918252602091829020600590910201805460018201546040805180820190915260038401546001600160401b038082168352600160401b909104169481019490945260049092015490935090919060ff1684565b61116e611686565b6014805460ff1916911515919091179055565b606060038054610b03906141fa565b8161119a816114ff565b610bc1838361203e565b6111ac611686565b60005b81811015610bd857601a546111d0906001600160a01b03166110e2600e5490565b806111da8161439e565b9150506111af565b6111ea611686565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b836001600160a01b038116331461122657611226336114ff565b6110f985858585612049565b61123a611686565b610bd8828261207c565b6060600061125183612153565b8051909150156112615792915050565b6016805461126e906141fa565b80601f016020809104026020016040519081016040528092919081815260200182805461129a906141fa565b80156112e75780601f106112bc576101008083540402835291602001916112e7565b820191906000526020600020905b8154815290600101906020018083116112ca57829003601f168201915b5050505050915050919050565b60606000805480602002602001604051908101604052809291908181526020018280548015610b7c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161132e575050505050905090565b6013818154811061136557600080fd5b6000918252602090912060029091020180546001909101546001600160a01b0391821692501682565b611396611686565b601155565b6065600081905260096020527fc8f777898976f233a76ced87b7df382590c7f23fef0a3657bf3a39a3984e7ce55460ff16156113ea576040516373fb720560e11b815260040160405180910390fd5b6113f78686868686612256565b60005b848110156114215761140f336110e2600e5490565b806114198161439e565b9150506113fa565b50505050505050565b611432611686565b6001600160a01b03811661145957604051633bdfc18f60e21b815260040160405180910390fd5b610ce981611dee565b61146a611686565b610ce98161265b565b61147b611686565b610ce981612894565b60006001600160e01b0319821663780e9d6360e01b1480610aee5750610aee825b60006001600160e01b0319821663152a902d60e11b1480610aee5750610aee82612a4f565b6000818152600460205260409020546001600160a01b0316610ce957604051633f0f7f7360e01b815260040160405180910390fd5b60145460ff1661150c5750565b6000805b6013548110156115d55760006013828154811061152f5761152f614283565b6000918252602090912060029091020154604051633185c44d60e21b81523060048201526001600160a01b0386811660248301529091169150819063c617113490604401602060405180830381865afa158015611590573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b491906143b7565b925082156115c257506115d5565b50806115cd8161439e565b915050611510565b5080610bd857604051633b79c77360e21b81526001600160a01b03831660048201526024015b60405180910390fd5b600061160f82610e8f565b9050806001600160a01b0316836001600160a01b03160361164357604051630591db6d60e01b815260040160405180910390fd5b336001600160a01b038216148061165f575061165f81336109ee565b61167c57604051635e7ea2e160e11b815260040160405180910390fd5b610bc18383612a9f565b6014546001600160a01b03610100909104163314610d76576040516399dbe9ff60e01b815260040160405180910390fd5b6001600160a01b0382166116de5760405163d92e233d60e01b815260040160405180910390fd5b6000805b60005481101561174757836001600160a01b03166000828154811061170957611709614283565b6000918252602090912001546001600160a01b0316036117355761172e8160016143d4565b9150611747565b8061173f8161439e565b9150506116e2565b5081158015611754575080155b156117a857600080546001810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0385166001600160a01b0319909116179055505050565b8180156117b55750600081115b15610bc15760005481101561184357600080546117d4906001906143e7565b815481106117e4576117e4614283565b60009182526020822001546001600160a01b0316906118046001846143e7565b8154811061181457611814614283565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b6000805480611854576118546143fa565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6000828152600460205260409020546001600160a01b03166118b057604051637c89afb360e01b815260040160405180910390fd5b6000828152600860205260409020610bc18282614410565b826001600160a01b03163b6000036118df57505050565b82811561194d57604051633e9f1edf60e11b81523060048201526001600160a01b038481166024830152821690637d3e3dbe906044015b600060405180830381600087803b15801561193057600080fd5b505af1158015611944573d6000803e3d6000fd5b505050506119ea565b6001600160a01b038316156119905760405163a0af290360e01b81523060048201526001600160a01b03848116602483015282169063a0af290390604401611916565b604051632210724360e11b81523060048201526001600160a01b03821690634420e48690602401600060405180830381600087803b1580156119d157600080fd5b505af11580156119e5573d6000803e3d6000fd5b505050505b60136040518060400160405280866001600160a01b0316815260200184611a12576000611a14565b855b6001600160a01b039081169091528254600180820185556000948552602094859020845160029093020180546001600160a01b03199081169385169390931781559390940151929093018054909316911617905550505050565b611a783382612b0d565b611a9557604051637f2a4cbb60e01b815260040160405180910390fd5b610bc1838383612b8b565b6001600160a01b038116611ac75760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60015460ff1615611b13576040516313e28b0f60e21b815260040160405180910390fd5b6001805460ff191681179081905561010090046001600160a01b03163314611b4d576040516282b42960e81b815260040160405180910390fd5b60015461010090046001600160a01b0316611b7b5760405163d92e233d60e01b815260040160405180910390fd5b478015611bdc576001546040516101009091046001600160a01b0316908290600081818185875af1925050503d8060008114611bd3576040519150601f19603f3d011682016040523d82523d6000602084013e611bd8565b606091505b5050505b600080546001600160401b03811115611bf757611bf7613a03565b604051908082528060200260200182016040528015611c20578160200160208202803683370190505b50905060005b600054811015611d73576000808281548110611c4457611c44614283565b6000918252602090912001546040516370a0823160e01b81523060048201526001600160a01b03909116915081906370a0823190602401602060405180830381865afa158015611c98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cbc91906144cf565b93508315611d425760015460405163a9059cbb60e01b81526101009091046001600160a01b0390811660048301526024820186905282169063a9059cbb906044016020604051808303816000875af1158015611d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4091906143b7565b505b83838381518110611d5557611d55614283565b60209081029190910101525080611d6b8161439e565b915050611c26565b507f3e4e319c3be0696253cf2e6260a96ddf9a8fa8cfc0e7186500bbcfcef899194d60018054906101000a90046001600160a01b031683600084604051611dbd94939291906144e8565b60405180910390a150506001805460ff19169055565b610bc18383836040518060200160405280600081525061120c565b601480546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601754611e56846001614561565b60ff161115611e7857604051632a9ffab760e21b815260040160405180910390fd5b600060178460ff1681548110611e9057611e90614283565b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201805480602002602001604051908101604052809291908181526020018280548015611f0c57602002820191906000526020600020905b815481526020019060010190808311611ef8575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b9091041660208281019190915283015260049092015460ff161515910152805190915015611f755760405163574b16a760e11b815260040160405180910390fd5b60208101516060820151611f8890612cc3565b81608001518015611fb6575060ff851660009081526018602090815260408083203384529091529020548411155b15611fd45760405163393ff8f760e21b815260040160405180910390fd5b6110f9848484608001518489612cd5565b6001600081905260096020527f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a365460ff1615612034576040516373fb720560e11b815260040160405180910390fd5b610bc18383612e5f565b610bd8338383612f12565b6120533383612b0d565b61207057604051637f2a4cbb60e01b815260040160405180910390fd5b610c2684848484612fb1565b60175460ff8316106120a157604051632a9ffab760e21b815260040160405180910390fd5b8060178360ff16815481106120b8576120b8614283565b9060005260206000209060050201600082015181600001556020820151816001015560408201518160020190805190602001906120f6929190613842565b50606082015180516003830180546020909301516001600160401b03908116600160401b026001600160801b03199094169216919091179190911790556080909101516004909101805491151560ff199092169190911790555050565b606061215e826114ca565b60008281526008602052604081208054612177906141fa565b80601f01602080910402602001604051908101604052809291908181526020018280546121a3906141fa565b80156121f05780601f106121c5576101008083540402835291602001916121f0565b820191906000526020600020905b8154815290600101906020018083116121d357829003601f168201915b505050505090506000612201612fe4565b90508051600003612213575092915050565b81511561224557808260405160200161222d92919061457a565b60405160208183030381529060405292505050919050565b61224e84612ff3565b949350505050565b601754612264866001614561565b60ff16111561228657604051632a9ffab760e21b815260040160405180910390fd5b600060178660ff168154811061229e5761229e614283565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820180548060200260200160405190810160405280929190818152602001828054801561231a57602002820191906000526020600020905b815481526020019060010190808311612306575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b909104166020828101919091528084019190915260049093015460ff1615159101528101519091508015801561237757508151155b1561239557604051632a9ffab760e21b815260040160405180910390fd5b6123a28260600151612cc3565b816080015180156123d0575060ff871660009081526018602090815260408083203384529091529020548611155b156123ee5760405163393ff8f760e21b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b166020820152603481018790526000906054016040516020818303038152906040528051906020012090506000612440828787876000015161305a565b905080158015612453575060008960ff16115b1561262157885b60ff81161561261f5760176124706001836145a9565b60ff168154811061248357612483614283565b90600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282018054806020026020016040519081016040528092919081815260200182805480156124ff57602002820191906000526020600020905b8154815260200190600101908083116124eb575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b9091041660208281019190915283015260049092015460ff1615159082015281015180519196509061255a8c6001614561565b60ff161115612569575061260d565b808b60ff168151811061257e5761257e614283565b6020908102919091010151608087015190955015806125e55760006018816125a76001876145a9565b60ff1681526020808201929092526040908101600090812033825290925281205491506125d4828e6143e7565b9050808c116125e257600192505b50505b801561260a576125fb858a8a8a6000015161305a565b9350831561260a57505061261f565b50505b80612617816145c2565b91505061245a565b505b8061263f57604051630efc77e960e31b815260040160405180910390fd5b61265088888660800151868d612cd5565b505050505050505050565b805160175411156126c9576017805480612677576126776143fa565b60008281526020812060056000199093019283020181815560018101829055906126a4600283018261388d565b506003810180546001600160801b0319169055600401805460ff19169055905561265b565b8051601754106127b75760005b81518110156127b5578181815181106126f1576126f1614283565b60200260200101516017828154811061270c5761270c614283565b90600052602060002090600502016000820151816000015560208201518160010155604082015181600201908051906020019061274a929190613842565b50606082015180516003830180546020909301516001600160401b03908116600160401b026001600160801b03199094169216919091179190911790556080909101516004909101805491151560ff19909216919091179055806127ad8161439e565b9150506126d6565b505b601754805b8251811015610bc15760178382815181106127d9576127d9614283565b602090810291909101810151825460018181018555600094855293839020825160059092020190815581830151938101939093556040810151805191939261282992600285019290910190613842565b50606082015180516003830180546020909301516001600160401b03908116600160401b026001600160801b03199094169216919091179190911790556080909101516004909101805491151560ff199092169190911790558061288c8161439e565b9150506127bc565b604051631761612360e11b81523060048201526001600160a01b03821690632ec2c24690602401600060405180830381600087803b1580156128d557600080fd5b505af11580156128e9573d6000803e3d6000fd5b5050601354600092509050815b8181101561295e57836001600160a01b03166013828154811061291b5761291b614283565b60009182526020909120600290910201546001600160a01b03160361294c576129458160016143d4565b925061295e565b806129568161439e565b9150506128f6565b508160000361296c57505050565b80821015612a055760136129816001836143e7565b8154811061299157612991614283565b906000526020600020906002020160136001846129ae91906143e7565b815481106129be576129be614283565b60009182526020909120825460029092020180546001600160a01b039283166001600160a01b03199182161782556001938401549390910180549390921692169190911790555b6013805480612a1657612a166143fa565b60008281526020902060026000199092019182020180546001600160a01b03199081168255600191909101805490911690559055505050565b60006001600160e01b031982166380ac58cd60e01b1480612a8057506001600160e01b03198216635b5e139f60e01b145b80610aee57506301ffc9a760e01b6001600160e01b0319831614610aee565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ad482610e8f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080612b1983610e8f565b9050806001600160a01b0316846001600160a01b03161480612b6057506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b8061224e5750836001600160a01b0316612b7984610b86565b6001600160a01b031614949350505050565b826001600160a01b0316612b9e82610e8f565b6001600160a01b031614612bc55760405163e146af6f60e01b815260040160405180910390fd5b6001600160a01b038216612bec576040516338f646ff60e21b815260040160405180910390fd5b612bf98383836001613071565b826001600160a01b0316612c0c82610e8f565b6001600160a01b031614612c335760405163e146af6f60e01b815260040160405180910390fd5b600081815260066020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260058552838620805460001901905590871680865283862080546001019055868652600490945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612ccc816130de565b610ce98161310b565b8215612d2a5760ff8116600090815260186020908152604080832033845290915281205490612d0482886143e7565b905080861115612d275760405163162908e360e11b815260040160405180910390fd5b50505b60ff8116600090815260186020908152604080832033845290915281208054869290612d579084906143d4565b9091555060009050612d69838661424a565b905080600003612d7957506110f9565b6019546001600160a01b031615612e36576019546040516323b872dd60e01b8152336004820152306024820152604481018390526000916001600160a01b0316906323b872dd906064016020604051808303816000875af1158015612de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e0691906143b7565b905080612e3057604051639a367e1760e01b815260206004820152600060248201526044016115fb565b50612e57565b80341015612e5757604051632ca2f52b60e11b815260040160405180910390fd5b505050505050565b6000601154118015612e8a57506011546001600160a01b038316600090815260106020526040902054145b15612ea857604051633f93492f60e11b815260040160405180910390fd5b6000601254118015612ebd5750601254600e54145b15612edb5760405163d05cb60960e01b815260040160405180910390fd5b612ee5828261313a565b6001600160a01b0382166000908152601060205260408120805491612f098361439e565b91905055505050565b816001600160a01b0316836001600160a01b031603612f4457604051630b7b99b960e21b815260040160405180910390fd5b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fbc848484612b8b565b612fc884848484613246565b610c2657604051626b5e2960e61b815260040160405180910390fd5b606060158054610b03906141fa565b6060612ffe826114ca565b6000613008612fe4565b905060008151116130285760405180602001604052806000815250613053565b8061303284613344565b60405160200161304392919061457a565b6040516020818303038152906040525b9392505050565b6000613068848484886133d6565b95945050505050565b6001600160a01b038416158015906130b45750600260005260096020527f6cde3cea4b3a3fb2488b2808bae7556f4a405e50f65e1794383bc026131b13c35460ff165b156130d2576040516373fb720560e11b815260040160405180910390fd5b610c26848484846133ee565b8051426001600160401b039091161115610ce957604051636f312cbd60e01b815260040160405180910390fd5b6020810151426001600160401b0390911611610ce95760405163477383f360e01b815260040160405180910390fd5b6001600160a01b038216613161576040516325bd6bd360e01b815260040160405180910390fd5b6000818152600460205260409020546001600160a01b0316156131975760405163c5a8d37160e01b815260040160405180910390fd5b6131a5600083836001613071565b6000818152600460205260409020546001600160a01b0316156131db5760405163c5a8d37160e01b815260040160405180910390fd5b6001600160a01b038216600081815260056020908152604080832080546001019055848352600490915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561333c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061328a9033908990889088906004016145df565b6020604051808303816000875af19250505080156132c5575060408051601f3d908101601f191682019092526132c29181019061461c565b60015b613322573d8080156132f3576040519150601f19603f3d011682016040523d82523d6000602084013e6132f8565b606091505b50805160000361331a57604051626b5e2960e61b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061224e565b50600161224e565b60606000613351836134da565b60010190506000816001600160401b0381111561337057613370613a03565b6040519080825280601f01601f19166020018201604052801561339a576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846133a457509392505050565b6000826133e48686856135b2565b1495945050505050565b6133fa848484846135fe565b600181111561341c57604051632a2bc6d760e01b815260040160405180910390fd5b816001600160a01b0385166134785761347381600e80546000838152600f60205260408120829055600182018355919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0155565b61349b565b836001600160a01b0316856001600160a01b03161461349b5761349b8582613686565b6001600160a01b0384166134b7576134b281613723565b6110f9565b846001600160a01b0316846001600160a01b0316146110f9576110f984826137d2565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106135195772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613545576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061356357662386f26fc10000830492506010015b6305f5e100831061357b576305f5e100830492506008015b612710831061358f57612710830492506004015b606483106135a1576064830492506002015b600a8310610aee5760010192915050565b600081815b848110156135f5576135e1828787848181106135d5576135d5614283565b90506020020135613816565b9150806135ed8161439e565b9150506135b7565b50949350505050565b6001811115610c26576001600160a01b03841615613644576001600160a01b0384166000908152600560205260408120805483929061363e9084906143e7565b90915550505b6001600160a01b03831615610c26576001600160a01b0383166000908152600560205260408120805483929061367b9084906143d4565b909155505050505050565b6000600161369384611019565b61369d91906143e7565b6000838152600d60205260409020549091508082146136f0576001600160a01b0384166000908152600c602090815260408083208584528252808320548484528184208190558352600d90915290208190555b506000918252600d602090815260408084208490556001600160a01b039094168352600c81528383209183525290812055565b600e54600090613735906001906143e7565b6000838152600f6020526040812054600e805493945090928490811061375d5761375d614283565b9060005260206000200154905080600e838154811061377e5761377e614283565b6000918252602080832090910192909255828152600f9091526040808220849055858252812055600e8054806137b6576137b66143fa565b6001900381819060005260206000200160009055905550505050565b60006137dd83611019565b6001600160a01b039093166000908152600c602090815260408083208684528252808320859055938252600d9052919091209190915550565b6000818310613832576000828152602084905260409020613053565b5060009182526020526040902090565b82805482825590600052602060002090810192821561387d579160200282015b8281111561387d578251825591602001919060010190613862565b506138899291506138a7565b5090565b5080546000825590600052602060002090810190610ce991905b5b8082111561388957600081556001016138a8565b6001600160e01b031981168114610ce957600080fd5b6000602082840312156138e457600080fd5b8135613053816138bc565b60005b8381101561390a5781810151838201526020016138f2565b50506000910152565b6000815180845261392b8160208601602086016138ef565b601f01601f19169290920160200192915050565b6020815260006130536020830184613913565b60006020828403121561396457600080fd5b5035919050565b6001600160a01b0381168114610ce957600080fd5b6000806040838503121561399357600080fd5b823561399e8161396b565b946020939093013593505050565b8015158114610ce957600080fd5b80356139c5816139ac565b919050565b600080604083850312156139dd57600080fd5b82356139e88161396b565b915060208301356139f8816139ac565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715613a3b57613a3b613a03565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613a6957613a69613a03565b604052919050565b60006001600160401b03831115613a8a57613a8a613a03565b613a9d601f8401601f1916602001613a41565b9050828152838383011115613ab157600080fd5b828260208301376000602084830101529392505050565b60008060408385031215613adb57600080fd5b8235915060208301356001600160401b03811115613af857600080fd5b8301601f81018513613b0957600080fd5b613b1885823560208401613a71565b9150509250929050565b600080600060608486031215613b3757600080fd5b8335613b428161396b565b92506020840135613b528161396b565b91506040840135613b62816139ac565b809150509250925092565b600080600060608486031215613b8257600080fd5b8335613b8d8161396b565b92506020840135613b9d8161396b565b929592945050506040919091013590565b60008060408385031215613bc157600080fd5b50508035926020909101359150565b600060208284031215613be257600080fd5b81356130538161396b565b60008060208385031215613c0057600080fd5b82356001600160401b0380821115613c1757600080fd5b818501915085601f830112613c2b57600080fd5b813581811115613c3a57600080fd5b866020828501011115613c4c57600080fd5b60209290920196919550909350505050565b600081518084526020808501945080840160005b83811015613c8e57815187529582019590820190600101613c72565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015613d4657603f19898403018552815160c0815185528882015189860152878201518189870152613cf682870182613c5e565b915050606080830151613d218288018280516001600160401b03908116835260209182015116910152565b505060809190910151151560a094909401939093529386019390860190600101613cc0565b509098975050505050505050565b803560ff811681146139c557600080fd5b60008060408385031215613d7857600080fd5b6139e883613d54565b600080600060608486031215613d9657600080fd5b613d9f84613d54565b95602085013595506040909401359392505050565b600060208284031215613dc657600080fd5b61305382613d54565b600060208284031215613de157600080fd5b8135613053816139ac565b60008060408385031215613dff57600080fd5b613e0883613d54565b915060208301356139f88161396b565b60008060008060808587031215613e2e57600080fd5b8435613e398161396b565b93506020850135613e498161396b565b92506040850135915060608501356001600160401b03811115613e6b57600080fd5b8501601f81018713613e7c57600080fd5b613e8b87823560208401613a71565b91505092959194509250565b60006001600160401b03821115613eb057613eb0613a03565b5060051b60200190565b80356001600160401b03811681146139c557600080fd5b600060408284031215613ee357600080fd5b604051604081018181106001600160401b0382111715613f0557613f05613a03565b604052905080613f1483613eba565b8152613f2260208401613eba565b60208201525092915050565b600060c08284031215613f4057600080fd5b613f48613a19565b9050813581526020808301358183015260408301356001600160401b03811115613f7157600080fd5b8301601f81018513613f8257600080fd5b8035613f95613f9082613e97565b613a41565b81815260059190911b82018301908381019087831115613fb457600080fd5b928401925b82841015613fd257833582529284019290840190613fb9565b8060408701525050505050613fea8360608401613ed1565b6060820152613ffb60a083016139ba565b608082015292915050565b6000806040838503121561401957600080fd5b61402283613d54565b915060208301356001600160401b0381111561403d57600080fd5b613b1885828601613f2e565b6020808252825182820181905260009190848201906040850190845b8181101561408a5783516001600160a01b031683529284019291840191600101614065565b50909695505050505050565b600080604083850312156140a957600080fd5b8235613e088161396b565b6000806000806000608086880312156140cc57600080fd5b6140d586613d54565b9450602086013593506040860135925060608601356001600160401b03808211156140ff57600080fd5b818801915088601f83011261411357600080fd5b81358181111561412257600080fd5b8960208260051b850101111561413757600080fd5b9699959850939650602001949392505050565b6000602080838503121561415d57600080fd5b82356001600160401b038082111561417457600080fd5b818501915085601f83011261418857600080fd5b8135614196613f9082613e97565b81815260059190911b830184019084810190888311156141b557600080fd5b8585015b838110156141ed578035858111156141d15760008081fd5b6141df8b89838a0101613f2e565b8452509186019186016141b9565b5098975050505050505050565b600181811c9082168061420e57607f821691505b60208210810361422e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610aee57610aee614234565b60008261427e57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b601f821115610bc157600081815260208120601f850160051c810160208610156142c05750805b601f850160051c820191505b81811015612e57578281556001016142cc565b6001600160401b038311156142f6576142f6613a03565b61430a8361430483546141fa565b83614299565b6000601f84116001811461433e57600085156143265750838201355b600019600387901b1c1916600186901b1783556110f9565b600083815260209020601f19861690835b8281101561436f578685013582556020948501946001909201910161434f565b508682101561438c5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000600182016143b0576143b0614234565b5060010190565b6000602082840312156143c957600080fd5b8151613053816139ac565b80820180821115610aee57610aee614234565b81810381811115610aee57610aee614234565b634e487b7160e01b600052603160045260246000fd5b81516001600160401b0381111561442957614429613a03565b61443d8161443784546141fa565b84614299565b602080601f831160018114614472576000841561445a5750858301515b600019600386901b1c1916600185901b178555612e57565b600085815260208120601f198616915b828110156144a157888601518255948401946001909101908401614482565b50858210156144bf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156144e157600080fd5b5051919050565b60006080820160018060a01b038088168452602087818601526080604086015282875480855260a0870191508860005282600020945060005b8181101561453f578554851683526001958601959284019201614521565b505085810360608701526145538188613c5e565b9a9950505050505050505050565b60ff8181168382160190811115610aee57610aee614234565b6000835161458c8184602088016138ef565b8351908301906145a08183602088016138ef565b01949350505050565b60ff8281168282160390811115610aee57610aee614234565b600060ff8216806145d5576145d5614234565b6000190192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061461290830184613913565b9695505050505050565b60006020828403121561462e57600080fd5b8151613053816138bc56fea26469706673582212208ddb0315c992aa645249484be1cb6151f87e27b5ac08590cfaffbb2f22f60bca64736f6c634300081300330000000000000000000000001cdee8f95f1f5eca3c232c399c5ca0834d8a315b0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000008ae0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002154686520556e666574746572656420466f756e64657227732050617373204e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000355465000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b726569663267366a707169626768696f32646b656e716b6a3736776871716733363669347875757a6f73673433367961766d617067717900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

Deployed Bytecode

0x60806040526004361061031e5760003560e01c806370a08231116101ab578063b88d4fde116100f7578063e985e9c511610095578063f2fde38b1161006f578063f2fde38b14610a54578063f328718714610a74578063f49e641b14610a94578063f63a859114610ab457600080fd5b8063e985e9c5146109d3578063eae498fe14610a1c578063edaed5e414610a2f57600080fd5b8063c87b56dd116100d1578063c87b56dd14610931578063ca5e553e14610951578063cd2bb70d14610973578063d2525605146109b357600080fd5b8063b88d4fde146108be578063bc61e733146108de578063c5b82c1a1461091157600080fd5b8063932c75eb11610164578063a2801f571161013e578063a2801f5714610810578063a65948a314610846578063a8602fea14610866578063aff6ebc61461088657600080fd5b8063932c75eb146107bb57806395d89b41146107db578063a22cb465146107f057600080fd5b806370a08231146106bf578063715018a6146106df5780637f9db1f7146106f45780638da5cb5b1461070757806390e105f41461072a57806392defcb91461078b57600080fd5b80632b3211941161026a5780634f6ccce711610223578063649d6833116101fd578063649d68331461064857806365c46d161461065d5780636dc59d801461067f5780636f8b44b01461069f57600080fd5b80634f6ccce7146105e857806355f804b3146106085780636352211e1461062857600080fd5b80632b3211941461053e5780632f745c591461055e5780633ccfd60b1461057e5780633e63eb2a1461059357806342842e0e146105a85780634626402b146105c857600080fd5b8063162094c4116102d75780631d6cb257116102b15780631d6cb257146104a957806322f4596f146104c957806323b872dd146104df5780632a55205a146104ff57600080fd5b8063162094c414610457578063180b0d7e1461047757806318160ddd1461049457600080fd5b806301ffc9a71461036257806306fdde0314610397578063081812fc146103b9578063095ea7b3146103f1578063124429551461041357806314863b4b1461043757600080fd5b3661035d57604080513381523460208201527fd6717f327e0cb88b4a97a7f67a453e9258252c34937ccbdd86de7cb840e7def3910160405180910390a1005b600080fd5b34801561036e57600080fd5b5061038261037d3660046138d2565b610ad4565b60405190151581526020015b60405180910390f35b3480156103a357600080fd5b506103ac610af4565b60405161038e919061393f565b3480156103c557600080fd5b506103d96103d4366004613952565b610b86565b6040516001600160a01b03909116815260200161038e565b3480156103fd57600080fd5b5061041161040c366004613980565b610bad565b005b34801561041f57600080fd5b5061042960115481565b60405190815260200161038e565b34801561044357600080fd5b506104116104523660046139ca565b610bc6565b34801561046357600080fd5b50610411610472366004613ac8565b610bdc565b34801561048357600080fd5b50604051612710815260200161038e565b3480156104a057600080fd5b50600e54610429565b3480156104b557600080fd5b506104116104c4366004613b22565b610bee565b3480156104d557600080fd5b5061042960125481565b3480156104eb57600080fd5b506104116104fa366004613b6d565b610c01565b34801561050b57600080fd5b5061051f61051a366004613bae565b610c2c565b604080516001600160a01b03909316835260208301919091520161038e565b34801561054a57600080fd5b50610411610559366004613bd0565b610cd8565b34801561056a57600080fd5b50610429610579366004613980565b610cec565b34801561058a57600080fd5b50610411610d3f565b34801561059f57600080fd5b506103ac610d78565b3480156105b457600080fd5b506104116105c3366004613b6d565b610e06565b3480156105d457600080fd5b50601a546103d9906001600160a01b031681565b3480156105f457600080fd5b50610429610603366004613952565b610e2b565b34801561061457600080fd5b50610411610623366004613bed565b610e7a565b34801561063457600080fd5b506103d9610643366004613952565b610e8f565b34801561065457600080fd5b506103ac610ec5565b34801561066957600080fd5b50610672610ed2565b60405161038e9190613c99565b34801561068b57600080fd5b5061041161069a366004613d65565b610fdf565b3480156106ab57600080fd5b506104116106ba366004613952565b61100c565b3480156106cb57600080fd5b506104296106da366004613bd0565b611019565b3480156106eb57600080fd5b5061041161105e565b610411610702366004613d81565b611070565b34801561071357600080fd5b5060145461010090046001600160a01b03166103d9565b34801561073657600080fd5b5061074a610745366004613952565b611100565b60405161038e949392919093845260208085019390935281516001600160401b03908116604086015291909201511660608301521515608082015260a00190565b34801561079757600080fd5b506103826107a6366004613db4565b60096020526000908152604090205460ff1681565b3480156107c757600080fd5b506104116107d6366004613dcf565b611166565b3480156107e757600080fd5b506103ac611181565b3480156107fc57600080fd5b5061041161080b3660046139ca565b611190565b34801561081c57600080fd5b5061042961082b366004613bd0565b6001600160a01b031660009081526010602052604090205490565b34801561085257600080fd5b50610411610861366004613952565b6111a4565b34801561087257600080fd5b50610411610881366004613bd0565b6111e2565b34801561089257600080fd5b506104296108a1366004613dec565b601860209081526000928352604080842090915290825290205481565b3480156108ca57600080fd5b506104116108d9366004613e18565b61120c565b3480156108ea57600080fd5b506103826108f9366004613db4565b60ff9081166000908152600960205260409020541690565b34801561091d57600080fd5b5061041161092c366004614006565b611232565b34801561093d57600080fd5b506103ac61094c366004613952565b611244565b34801561095d57600080fd5b506109666112f4565b60405161038e9190614049565b34801561097f57600080fd5b5061099361098e366004613952565b611355565b604080516001600160a01b0393841681529290911660208301520161038e565b3480156109bf57600080fd5b506104116109ce366004613952565b61138e565b3480156109df57600080fd5b506103826109ee366004614096565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b610411610a2a3660046140b4565b61139b565b348015610a3b57600080fd5b506001546103d99061010090046001600160a01b031681565b348015610a6057600080fd5b50610411610a6f366004613bd0565b61142a565b348015610a8057600080fd5b506019546103d9906001600160a01b031681565b348015610aa057600080fd5b50610411610aaf36600461414a565b611462565b348015610ac057600080fd5b50610411610acf366004613bd0565b611473565b6000610adf82611484565b80610aee5750610aee826114a5565b92915050565b606060028054610b03906141fa565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2f906141fa565b8015610b7c5780601f10610b5157610100808354040283529160200191610b7c565b820191906000526020600020905b815481529060010190602001808311610b5f57829003601f168201915b5050505050905090565b6000610b91826114ca565b506000908152600660205260409020546001600160a01b031690565b81610bb7816114ff565b610bc18383611604565b505050565b610bce611686565b610bd882826116b7565b5050565b610be4611686565b610bd8828261187b565b610bf6611686565b610bc18383836118c8565b826001600160a01b0381163314610c1b57610c1b336114ff565b610c26848484611a6e565b50505050565b6000828152600b602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610ca1575060408051808201909152600a546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610cc0906001600160601b03168761424a565b610cca9190614261565b915196919550909350505050565b610ce0611686565b610ce981611aa0565b50565b6000610cf783611019565b8210610d16576040516355e7adfd60e11b815260040160405180910390fd5b506001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b60015461010090046001600160a01b03163314610d6e576040516282b42960e81b815260040160405180910390fd5b610d76611aef565b565b60158054610d85906141fa565b80601f0160208091040260200160405190810160405280929190818152602001828054610db1906141fa565b8015610dfe5780601f10610dd357610100808354040283529160200191610dfe565b820191906000526020600020905b815481529060010190602001808311610de157829003601f168201915b505050505081565b826001600160a01b0381163314610e2057610e20336114ff565b610c26848484611dd3565b6000610e36600e5490565b8210610e555760405163842adba960e01b815260040160405180910390fd5b600e8281548110610e6857610e68614283565b90600052602060002001549050919050565b610e82611686565b6015610bc18284836142df565b6000818152600460205260408120546001600160a01b031680610aee57604051633f0f7f7360e01b815260040160405180910390fd5b60168054610d85906141fa565b60606017805480602002602001604051908101604052809291908181526020016000905b82821015610fd657838290600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201805480602002602001604051908101604052809291908181526020018280548015610f7c57602002820191906000526020600020905b815481526020019060010190808311610f68575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b909104166020828101919091528084019190915260049093015460ff1615159101529082526001929092019101610ef6565b50505050905090565b610fe7611686565b60ff919091166000908152600960205260409020805460ff1916911515919091179055565b611014611686565b601255565b60006001600160a01b03821661104257604051630b505c1d60e11b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205490565b611066611686565b610d766000611dee565b6065600081905260096020527fc8f777898976f233a76ced87b7df382590c7f23fef0a3657bf3a39a3984e7ce55460ff16156110bf576040516373fb720560e11b815260040160405180910390fd5b6110ca848484611e48565b60005b828110156110f9576110e7336110e2600e5490565b611fe5565b806110f18161439e565b9150506110cd565b5050505050565b6017818154811061111057600080fd5b6000918252602091829020600590910201805460018201546040805180820190915260038401546001600160401b038082168352600160401b909104169481019490945260049092015490935090919060ff1684565b61116e611686565b6014805460ff1916911515919091179055565b606060038054610b03906141fa565b8161119a816114ff565b610bc1838361203e565b6111ac611686565b60005b81811015610bd857601a546111d0906001600160a01b03166110e2600e5490565b806111da8161439e565b9150506111af565b6111ea611686565b601a80546001600160a01b0319166001600160a01b0392909216919091179055565b836001600160a01b038116331461122657611226336114ff565b6110f985858585612049565b61123a611686565b610bd8828261207c565b6060600061125183612153565b8051909150156112615792915050565b6016805461126e906141fa565b80601f016020809104026020016040519081016040528092919081815260200182805461129a906141fa565b80156112e75780601f106112bc576101008083540402835291602001916112e7565b820191906000526020600020905b8154815290600101906020018083116112ca57829003601f168201915b5050505050915050919050565b60606000805480602002602001604051908101604052809291908181526020018280548015610b7c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161132e575050505050905090565b6013818154811061136557600080fd5b6000918252602090912060029091020180546001909101546001600160a01b0391821692501682565b611396611686565b601155565b6065600081905260096020527fc8f777898976f233a76ced87b7df382590c7f23fef0a3657bf3a39a3984e7ce55460ff16156113ea576040516373fb720560e11b815260040160405180910390fd5b6113f78686868686612256565b60005b848110156114215761140f336110e2600e5490565b806114198161439e565b9150506113fa565b50505050505050565b611432611686565b6001600160a01b03811661145957604051633bdfc18f60e21b815260040160405180910390fd5b610ce981611dee565b61146a611686565b610ce98161265b565b61147b611686565b610ce981612894565b60006001600160e01b0319821663780e9d6360e01b1480610aee5750610aee825b60006001600160e01b0319821663152a902d60e11b1480610aee5750610aee82612a4f565b6000818152600460205260409020546001600160a01b0316610ce957604051633f0f7f7360e01b815260040160405180910390fd5b60145460ff1661150c5750565b6000805b6013548110156115d55760006013828154811061152f5761152f614283565b6000918252602090912060029091020154604051633185c44d60e21b81523060048201526001600160a01b0386811660248301529091169150819063c617113490604401602060405180830381865afa158015611590573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b491906143b7565b925082156115c257506115d5565b50806115cd8161439e565b915050611510565b5080610bd857604051633b79c77360e21b81526001600160a01b03831660048201526024015b60405180910390fd5b600061160f82610e8f565b9050806001600160a01b0316836001600160a01b03160361164357604051630591db6d60e01b815260040160405180910390fd5b336001600160a01b038216148061165f575061165f81336109ee565b61167c57604051635e7ea2e160e11b815260040160405180910390fd5b610bc18383612a9f565b6014546001600160a01b03610100909104163314610d76576040516399dbe9ff60e01b815260040160405180910390fd5b6001600160a01b0382166116de5760405163d92e233d60e01b815260040160405180910390fd5b6000805b60005481101561174757836001600160a01b03166000828154811061170957611709614283565b6000918252602090912001546001600160a01b0316036117355761172e8160016143d4565b9150611747565b8061173f8161439e565b9150506116e2565b5081158015611754575080155b156117a857600080546001810182559080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0385166001600160a01b0319909116179055505050565b8180156117b55750600081115b15610bc15760005481101561184357600080546117d4906001906143e7565b815481106117e4576117e4614283565b60009182526020822001546001600160a01b0316906118046001846143e7565b8154811061181457611814614283565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b6000805480611854576118546143fa565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b6000828152600460205260409020546001600160a01b03166118b057604051637c89afb360e01b815260040160405180910390fd5b6000828152600860205260409020610bc18282614410565b826001600160a01b03163b6000036118df57505050565b82811561194d57604051633e9f1edf60e11b81523060048201526001600160a01b038481166024830152821690637d3e3dbe906044015b600060405180830381600087803b15801561193057600080fd5b505af1158015611944573d6000803e3d6000fd5b505050506119ea565b6001600160a01b038316156119905760405163a0af290360e01b81523060048201526001600160a01b03848116602483015282169063a0af290390604401611916565b604051632210724360e11b81523060048201526001600160a01b03821690634420e48690602401600060405180830381600087803b1580156119d157600080fd5b505af11580156119e5573d6000803e3d6000fd5b505050505b60136040518060400160405280866001600160a01b0316815260200184611a12576000611a14565b855b6001600160a01b039081169091528254600180820185556000948552602094859020845160029093020180546001600160a01b03199081169385169390931781559390940151929093018054909316911617905550505050565b611a783382612b0d565b611a9557604051637f2a4cbb60e01b815260040160405180910390fd5b610bc1838383612b8b565b6001600160a01b038116611ac75760405163d92e233d60e01b815260040160405180910390fd5b600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60015460ff1615611b13576040516313e28b0f60e21b815260040160405180910390fd5b6001805460ff191681179081905561010090046001600160a01b03163314611b4d576040516282b42960e81b815260040160405180910390fd5b60015461010090046001600160a01b0316611b7b5760405163d92e233d60e01b815260040160405180910390fd5b478015611bdc576001546040516101009091046001600160a01b0316908290600081818185875af1925050503d8060008114611bd3576040519150601f19603f3d011682016040523d82523d6000602084013e611bd8565b606091505b5050505b600080546001600160401b03811115611bf757611bf7613a03565b604051908082528060200260200182016040528015611c20578160200160208202803683370190505b50905060005b600054811015611d73576000808281548110611c4457611c44614283565b6000918252602090912001546040516370a0823160e01b81523060048201526001600160a01b03909116915081906370a0823190602401602060405180830381865afa158015611c98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cbc91906144cf565b93508315611d425760015460405163a9059cbb60e01b81526101009091046001600160a01b0390811660048301526024820186905282169063a9059cbb906044016020604051808303816000875af1158015611d1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4091906143b7565b505b83838381518110611d5557611d55614283565b60209081029190910101525080611d6b8161439e565b915050611c26565b507f3e4e319c3be0696253cf2e6260a96ddf9a8fa8cfc0e7186500bbcfcef899194d60018054906101000a90046001600160a01b031683600084604051611dbd94939291906144e8565b60405180910390a150506001805460ff19169055565b610bc18383836040518060200160405280600081525061120c565b601480546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601754611e56846001614561565b60ff161115611e7857604051632a9ffab760e21b815260040160405180910390fd5b600060178460ff1681548110611e9057611e90614283565b90600052602060002090600502016040518060a0016040529081600082015481526020016001820154815260200160028201805480602002602001604051908101604052809291908181526020018280548015611f0c57602002820191906000526020600020905b815481526020019060010190808311611ef8575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b9091041660208281019190915283015260049092015460ff161515910152805190915015611f755760405163574b16a760e11b815260040160405180910390fd5b60208101516060820151611f8890612cc3565b81608001518015611fb6575060ff851660009081526018602090815260408083203384529091529020548411155b15611fd45760405163393ff8f760e21b815260040160405180910390fd5b6110f9848484608001518489612cd5565b6001600081905260096020527f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a365460ff1615612034576040516373fb720560e11b815260040160405180910390fd5b610bc18383612e5f565b610bd8338383612f12565b6120533383612b0d565b61207057604051637f2a4cbb60e01b815260040160405180910390fd5b610c2684848484612fb1565b60175460ff8316106120a157604051632a9ffab760e21b815260040160405180910390fd5b8060178360ff16815481106120b8576120b8614283565b9060005260206000209060050201600082015181600001556020820151816001015560408201518160020190805190602001906120f6929190613842565b50606082015180516003830180546020909301516001600160401b03908116600160401b026001600160801b03199094169216919091179190911790556080909101516004909101805491151560ff199092169190911790555050565b606061215e826114ca565b60008281526008602052604081208054612177906141fa565b80601f01602080910402602001604051908101604052809291908181526020018280546121a3906141fa565b80156121f05780601f106121c5576101008083540402835291602001916121f0565b820191906000526020600020905b8154815290600101906020018083116121d357829003601f168201915b505050505090506000612201612fe4565b90508051600003612213575092915050565b81511561224557808260405160200161222d92919061457a565b60405160208183030381529060405292505050919050565b61224e84612ff3565b949350505050565b601754612264866001614561565b60ff16111561228657604051632a9ffab760e21b815260040160405180910390fd5b600060178660ff168154811061229e5761229e614283565b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820180548060200260200160405190810160405280929190818152602001828054801561231a57602002820191906000526020600020905b815481526020019060010190808311612306575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b909104166020828101919091528084019190915260049093015460ff1615159101528101519091508015801561237757508151155b1561239557604051632a9ffab760e21b815260040160405180910390fd5b6123a28260600151612cc3565b816080015180156123d0575060ff871660009081526018602090815260408083203384529091529020548611155b156123ee5760405163393ff8f760e21b815260040160405180910390fd5b6040516bffffffffffffffffffffffff193360601b166020820152603481018790526000906054016040516020818303038152906040528051906020012090506000612440828787876000015161305a565b905080158015612453575060008960ff16115b1561262157885b60ff81161561261f5760176124706001836145a9565b60ff168154811061248357612483614283565b90600052602060002090600502016040518060a00160405290816000820154815260200160018201548152602001600282018054806020026020016040519081016040528092919081815260200182805480156124ff57602002820191906000526020600020905b8154815260200190600101908083116124eb575b505050918352505060408051808201825260038401546001600160401b038082168352600160401b9091041660208281019190915283015260049092015460ff1615159082015281015180519196509061255a8c6001614561565b60ff161115612569575061260d565b808b60ff168151811061257e5761257e614283565b6020908102919091010151608087015190955015806125e55760006018816125a76001876145a9565b60ff1681526020808201929092526040908101600090812033825290925281205491506125d4828e6143e7565b9050808c116125e257600192505b50505b801561260a576125fb858a8a8a6000015161305a565b9350831561260a57505061261f565b50505b80612617816145c2565b91505061245a565b505b8061263f57604051630efc77e960e31b815260040160405180910390fd5b61265088888660800151868d612cd5565b505050505050505050565b805160175411156126c9576017805480612677576126776143fa565b60008281526020812060056000199093019283020181815560018101829055906126a4600283018261388d565b506003810180546001600160801b0319169055600401805460ff19169055905561265b565b8051601754106127b75760005b81518110156127b5578181815181106126f1576126f1614283565b60200260200101516017828154811061270c5761270c614283565b90600052602060002090600502016000820151816000015560208201518160010155604082015181600201908051906020019061274a929190613842565b50606082015180516003830180546020909301516001600160401b03908116600160401b026001600160801b03199094169216919091179190911790556080909101516004909101805491151560ff19909216919091179055806127ad8161439e565b9150506126d6565b505b601754805b8251811015610bc15760178382815181106127d9576127d9614283565b602090810291909101810151825460018181018555600094855293839020825160059092020190815581830151938101939093556040810151805191939261282992600285019290910190613842565b50606082015180516003830180546020909301516001600160401b03908116600160401b026001600160801b03199094169216919091179190911790556080909101516004909101805491151560ff199092169190911790558061288c8161439e565b9150506127bc565b604051631761612360e11b81523060048201526001600160a01b03821690632ec2c24690602401600060405180830381600087803b1580156128d557600080fd5b505af11580156128e9573d6000803e3d6000fd5b5050601354600092509050815b8181101561295e57836001600160a01b03166013828154811061291b5761291b614283565b60009182526020909120600290910201546001600160a01b03160361294c576129458160016143d4565b925061295e565b806129568161439e565b9150506128f6565b508160000361296c57505050565b80821015612a055760136129816001836143e7565b8154811061299157612991614283565b906000526020600020906002020160136001846129ae91906143e7565b815481106129be576129be614283565b60009182526020909120825460029092020180546001600160a01b039283166001600160a01b03199182161782556001938401549390910180549390921692169190911790555b6013805480612a1657612a166143fa565b60008281526020902060026000199092019182020180546001600160a01b03199081168255600191909101805490911690559055505050565b60006001600160e01b031982166380ac58cd60e01b1480612a8057506001600160e01b03198216635b5e139f60e01b145b80610aee57506301ffc9a760e01b6001600160e01b0319831614610aee565b600081815260066020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612ad482610e8f565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080612b1983610e8f565b9050806001600160a01b0316846001600160a01b03161480612b6057506001600160a01b0380821660009081526007602090815260408083209388168352929052205460ff165b8061224e5750836001600160a01b0316612b7984610b86565b6001600160a01b031614949350505050565b826001600160a01b0316612b9e82610e8f565b6001600160a01b031614612bc55760405163e146af6f60e01b815260040160405180910390fd5b6001600160a01b038216612bec576040516338f646ff60e21b815260040160405180910390fd5b612bf98383836001613071565b826001600160a01b0316612c0c82610e8f565b6001600160a01b031614612c335760405163e146af6f60e01b815260040160405180910390fd5b600081815260066020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260058552838620805460001901905590871680865283862080546001019055868652600490945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b612ccc816130de565b610ce98161310b565b8215612d2a5760ff8116600090815260186020908152604080832033845290915281205490612d0482886143e7565b905080861115612d275760405163162908e360e11b815260040160405180910390fd5b50505b60ff8116600090815260186020908152604080832033845290915281208054869290612d579084906143d4565b9091555060009050612d69838661424a565b905080600003612d7957506110f9565b6019546001600160a01b031615612e36576019546040516323b872dd60e01b8152336004820152306024820152604481018390526000916001600160a01b0316906323b872dd906064016020604051808303816000875af1158015612de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e0691906143b7565b905080612e3057604051639a367e1760e01b815260206004820152600060248201526044016115fb565b50612e57565b80341015612e5757604051632ca2f52b60e11b815260040160405180910390fd5b505050505050565b6000601154118015612e8a57506011546001600160a01b038316600090815260106020526040902054145b15612ea857604051633f93492f60e11b815260040160405180910390fd5b6000601254118015612ebd5750601254600e54145b15612edb5760405163d05cb60960e01b815260040160405180910390fd5b612ee5828261313a565b6001600160a01b0382166000908152601060205260408120805491612f098361439e565b91905055505050565b816001600160a01b0316836001600160a01b031603612f4457604051630b7b99b960e21b815260040160405180910390fd5b6001600160a01b03838116600081815260076020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612fbc848484612b8b565b612fc884848484613246565b610c2657604051626b5e2960e61b815260040160405180910390fd5b606060158054610b03906141fa565b6060612ffe826114ca565b6000613008612fe4565b905060008151116130285760405180602001604052806000815250613053565b8061303284613344565b60405160200161304392919061457a565b6040516020818303038152906040525b9392505050565b6000613068848484886133d6565b95945050505050565b6001600160a01b038416158015906130b45750600260005260096020527f6cde3cea4b3a3fb2488b2808bae7556f4a405e50f65e1794383bc026131b13c35460ff165b156130d2576040516373fb720560e11b815260040160405180910390fd5b610c26848484846133ee565b8051426001600160401b039091161115610ce957604051636f312cbd60e01b815260040160405180910390fd5b6020810151426001600160401b0390911611610ce95760405163477383f360e01b815260040160405180910390fd5b6001600160a01b038216613161576040516325bd6bd360e01b815260040160405180910390fd5b6000818152600460205260409020546001600160a01b0316156131975760405163c5a8d37160e01b815260040160405180910390fd5b6131a5600083836001613071565b6000818152600460205260409020546001600160a01b0316156131db5760405163c5a8d37160e01b815260040160405180910390fd5b6001600160a01b038216600081815260056020908152604080832080546001019055848352600490915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561333c57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061328a9033908990889088906004016145df565b6020604051808303816000875af19250505080156132c5575060408051601f3d908101601f191682019092526132c29181019061461c565b60015b613322573d8080156132f3576040519150601f19603f3d011682016040523d82523d6000602084013e6132f8565b606091505b50805160000361331a57604051626b5e2960e61b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061224e565b50600161224e565b60606000613351836134da565b60010190506000816001600160401b0381111561337057613370613a03565b6040519080825280601f01601f19166020018201604052801561339a576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846133a457509392505050565b6000826133e48686856135b2565b1495945050505050565b6133fa848484846135fe565b600181111561341c57604051632a2bc6d760e01b815260040160405180910390fd5b816001600160a01b0385166134785761347381600e80546000838152600f60205260408120829055600182018355919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0155565b61349b565b836001600160a01b0316856001600160a01b03161461349b5761349b8582613686565b6001600160a01b0384166134b7576134b281613723565b6110f9565b846001600160a01b0316846001600160a01b0316146110f9576110f984826137d2565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106135195772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613545576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061356357662386f26fc10000830492506010015b6305f5e100831061357b576305f5e100830492506008015b612710831061358f57612710830492506004015b606483106135a1576064830492506002015b600a8310610aee5760010192915050565b600081815b848110156135f5576135e1828787848181106135d5576135d5614283565b90506020020135613816565b9150806135ed8161439e565b9150506135b7565b50949350505050565b6001811115610c26576001600160a01b03841615613644576001600160a01b0384166000908152600560205260408120805483929061363e9084906143e7565b90915550505b6001600160a01b03831615610c26576001600160a01b0383166000908152600560205260408120805483929061367b9084906143d4565b909155505050505050565b6000600161369384611019565b61369d91906143e7565b6000838152600d60205260409020549091508082146136f0576001600160a01b0384166000908152600c602090815260408083208584528252808320548484528184208190558352600d90915290208190555b506000918252600d602090815260408084208490556001600160a01b039094168352600c81528383209183525290812055565b600e54600090613735906001906143e7565b6000838152600f6020526040812054600e805493945090928490811061375d5761375d614283565b9060005260206000200154905080600e838154811061377e5761377e614283565b6000918252602080832090910192909255828152600f9091526040808220849055858252812055600e8054806137b6576137b66143fa565b6001900381819060005260206000200160009055905550505050565b60006137dd83611019565b6001600160a01b039093166000908152600c602090815260408083208684528252808320859055938252600d9052919091209190915550565b6000818310613832576000828152602084905260409020613053565b5060009182526020526040902090565b82805482825590600052602060002090810192821561387d579160200282015b8281111561387d578251825591602001919060010190613862565b506138899291506138a7565b5090565b5080546000825590600052602060002090810190610ce991905b5b8082111561388957600081556001016138a8565b6001600160e01b031981168114610ce957600080fd5b6000602082840312156138e457600080fd5b8135613053816138bc565b60005b8381101561390a5781810151838201526020016138f2565b50506000910152565b6000815180845261392b8160208601602086016138ef565b601f01601f19169290920160200192915050565b6020815260006130536020830184613913565b60006020828403121561396457600080fd5b5035919050565b6001600160a01b0381168114610ce957600080fd5b6000806040838503121561399357600080fd5b823561399e8161396b565b946020939093013593505050565b8015158114610ce957600080fd5b80356139c5816139ac565b919050565b600080604083850312156139dd57600080fd5b82356139e88161396b565b915060208301356139f8816139ac565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715613a3b57613a3b613a03565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613a6957613a69613a03565b604052919050565b60006001600160401b03831115613a8a57613a8a613a03565b613a9d601f8401601f1916602001613a41565b9050828152838383011115613ab157600080fd5b828260208301376000602084830101529392505050565b60008060408385031215613adb57600080fd5b8235915060208301356001600160401b03811115613af857600080fd5b8301601f81018513613b0957600080fd5b613b1885823560208401613a71565b9150509250929050565b600080600060608486031215613b3757600080fd5b8335613b428161396b565b92506020840135613b528161396b565b91506040840135613b62816139ac565b809150509250925092565b600080600060608486031215613b8257600080fd5b8335613b8d8161396b565b92506020840135613b9d8161396b565b929592945050506040919091013590565b60008060408385031215613bc157600080fd5b50508035926020909101359150565b600060208284031215613be257600080fd5b81356130538161396b565b60008060208385031215613c0057600080fd5b82356001600160401b0380821115613c1757600080fd5b818501915085601f830112613c2b57600080fd5b813581811115613c3a57600080fd5b866020828501011115613c4c57600080fd5b60209290920196919550909350505050565b600081518084526020808501945080840160005b83811015613c8e57815187529582019590820190600101613c72565b509495945050505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015613d4657603f19898403018552815160c0815185528882015189860152878201518189870152613cf682870182613c5e565b915050606080830151613d218288018280516001600160401b03908116835260209182015116910152565b505060809190910151151560a094909401939093529386019390860190600101613cc0565b509098975050505050505050565b803560ff811681146139c557600080fd5b60008060408385031215613d7857600080fd5b6139e883613d54565b600080600060608486031215613d9657600080fd5b613d9f84613d54565b95602085013595506040909401359392505050565b600060208284031215613dc657600080fd5b61305382613d54565b600060208284031215613de157600080fd5b8135613053816139ac565b60008060408385031215613dff57600080fd5b613e0883613d54565b915060208301356139f88161396b565b60008060008060808587031215613e2e57600080fd5b8435613e398161396b565b93506020850135613e498161396b565b92506040850135915060608501356001600160401b03811115613e6b57600080fd5b8501601f81018713613e7c57600080fd5b613e8b87823560208401613a71565b91505092959194509250565b60006001600160401b03821115613eb057613eb0613a03565b5060051b60200190565b80356001600160401b03811681146139c557600080fd5b600060408284031215613ee357600080fd5b604051604081018181106001600160401b0382111715613f0557613f05613a03565b604052905080613f1483613eba565b8152613f2260208401613eba565b60208201525092915050565b600060c08284031215613f4057600080fd5b613f48613a19565b9050813581526020808301358183015260408301356001600160401b03811115613f7157600080fd5b8301601f81018513613f8257600080fd5b8035613f95613f9082613e97565b613a41565b81815260059190911b82018301908381019087831115613fb457600080fd5b928401925b82841015613fd257833582529284019290840190613fb9565b8060408701525050505050613fea8360608401613ed1565b6060820152613ffb60a083016139ba565b608082015292915050565b6000806040838503121561401957600080fd5b61402283613d54565b915060208301356001600160401b0381111561403d57600080fd5b613b1885828601613f2e565b6020808252825182820181905260009190848201906040850190845b8181101561408a5783516001600160a01b031683529284019291840191600101614065565b50909695505050505050565b600080604083850312156140a957600080fd5b8235613e088161396b565b6000806000806000608086880312156140cc57600080fd5b6140d586613d54565b9450602086013593506040860135925060608601356001600160401b03808211156140ff57600080fd5b818801915088601f83011261411357600080fd5b81358181111561412257600080fd5b8960208260051b850101111561413757600080fd5b9699959850939650602001949392505050565b6000602080838503121561415d57600080fd5b82356001600160401b038082111561417457600080fd5b818501915085601f83011261418857600080fd5b8135614196613f9082613e97565b81815260059190911b830184019084810190888311156141b557600080fd5b8585015b838110156141ed578035858111156141d15760008081fd5b6141df8b89838a0101613f2e565b8452509186019186016141b9565b5098975050505050505050565b600181811c9082168061420e57607f821691505b60208210810361422e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610aee57610aee614234565b60008261427e57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b601f821115610bc157600081815260208120601f850160051c810160208610156142c05750805b601f850160051c820191505b81811015612e57578281556001016142cc565b6001600160401b038311156142f6576142f6613a03565b61430a8361430483546141fa565b83614299565b6000601f84116001811461433e57600085156143265750838201355b600019600387901b1c1916600186901b1783556110f9565b600083815260209020601f19861690835b8281101561436f578685013582556020948501946001909201910161434f565b508682101561438c5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000600182016143b0576143b0614234565b5060010190565b6000602082840312156143c957600080fd5b8151613053816139ac565b80820180821115610aee57610aee614234565b81810381811115610aee57610aee614234565b634e487b7160e01b600052603160045260246000fd5b81516001600160401b0381111561442957614429613a03565b61443d8161443784546141fa565b84614299565b602080601f831160018114614472576000841561445a5750858301515b600019600386901b1c1916600185901b178555612e57565b600085815260208120601f198616915b828110156144a157888601518255948401946001909101908401614482565b50858210156144bf5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156144e157600080fd5b5051919050565b60006080820160018060a01b038088168452602087818601526080604086015282875480855260a0870191508860005282600020945060005b8181101561453f578554851683526001958601959284019201614521565b505085810360608701526145538188613c5e565b9a9950505050505050505050565b60ff8181168382160190811115610aee57610aee614234565b6000835161458c8184602088016138ef565b8351908301906145a08183602088016138ef565b01949350505050565b60ff8281168282160390811115610aee57610aee614234565b600060ff8216806145d5576145d5614234565b6000190192915050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061461290830184613913565b9695505050505050565b60006020828403121561462e57600080fd5b8151613053816138bc56fea26469706673582212208ddb0315c992aa645249484be1cb6151f87e27b5ac08590cfaffbb2f22f60bca64736f6c63430008130033

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

0000000000000000000000001cdee8f95f1f5eca3c232c399c5ca0834d8a315b0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000008ae0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002154686520556e666574746572656420466f756e64657227732050617373204e465400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000355465000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000042697066733a2f2f6261666b726569663267366a707169626768696f32646b656e716b6a3736776871716733363669347875757a6f73673433367961766d617067717900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

-----Decoded View---------------
Arg [0] : accountOwner (address): 0x1cdEe8F95f1F5ecA3C232C399c5CA0834d8a315B
Arg [1] : name (string): The Unfettered Founder's Pass NFT
Arg [2] : symbol (string): UFP
Arg [3] : baseURI (string): ipfs://bafkreif2g6jpqibghio2dkenqkj76whqqg366i4xuuzosg436yavmapgqy
Arg [4] : numerator (uint96): 500
Arg [5] : salesToken (address): 0x0000000000000000000000000000000000000000
Arg [6] : paymentTokens (address[]): 0x6B175474E89094C44Da98b954EedeAC495271d0F,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [7] : maxSupply (uint256): 2222
Arg [8] : maxMintCountForPerAddress (uint256): 0

-----Encoded View---------------
21 Constructor Arguments found :
Arg [0] : 0000000000000000000000001cdee8f95f1f5eca3c232c399c5ca0834d8a315b
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [4] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000240
Arg [7] : 00000000000000000000000000000000000000000000000000000000000008ae
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000021
Arg [10] : 54686520556e666574746572656420466f756e64657227732050617373204e46
Arg [11] : 5400000000000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [13] : 5546500000000000000000000000000000000000000000000000000000000000
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000042
Arg [15] : 697066733a2f2f6261666b726569663267366a707169626768696f32646b656e
Arg [16] : 716b6a3736776871716733363669347875757a6f73673433367961766d617067
Arg [17] : 7179000000000000000000000000000000000000000000000000000000000000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [19] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Arg [20] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48


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

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