ETH Price: $3,478.70 (+1.62%)
Gas: 13 Gwei

Token

The Sanctuary (TSNFT)
 

Overview

Max Total Supply

2,842 TSNFT

Holders

442

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
0x2d07cd174a5041bac0735cc55e49124fe86c4bf7
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:
TheSanctuary

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 18 : TheSanctuary.sol
// SPDX-License-Identifier: MIT

pragma solidity ^ 0.8.18;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC1155/ERC1155.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Strings.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol";
import "./DefaultOperatorFilterer.sol";

/*
████████╗██╗  ██╗███████╗                                                    
╚══██╔══╝██║  ██║██╔════╝                                                    
   ██║   ███████║█████╗                                                      
   ██║   ██╔══██║██╔══╝                                                      
   ██║   ██║  ██║███████╗                                                    
   ╚═╝   ╚═╝  ╚═╝╚══════╝                                                    
                                                                             
███████╗ █████╗ ███╗   ██╗ ██████╗████████╗██╗   ██╗ █████╗ ██████╗ ██╗   ██╗
██╔════╝██╔══██╗████╗  ██║██╔════╝╚══██╔══╝██║   ██║██╔══██╗██╔══██╗╚██╗ ██╔╝
███████╗███████║██╔██╗ ██║██║        ██║   ██║   ██║███████║██████╔╝ ╚████╔╝ 
╚════██║██╔══██║██║╚██╗██║██║        ██║   ██║   ██║██╔══██║██╔══██╗  ╚██╔╝  
███████║██║  ██║██║ ╚████║╚██████╗   ██║   ╚██████╔╝██║  ██║██║  ██║   ██║   
╚══════╝╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝   ╚═╝    ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   
*/
/// @author developer's website 🐸 https://www.halfsupershop.com/ 🐸
contract TheSanctuary is ERC1155, Ownable, DefaultOperatorFilterer {
    string public name = "The Sanctuary";
    string public symbol = "TSNFT";
    string private hiddenURI;
    uint256 public collectionEndID = 5555;
    uint256 private cost = 0.03 ether;
    uint256 public maxMintAmount = 20;
    uint256 public maxBatchMintAmount = 20;
    mapping(uint256 => uint256) public batchLimit;
    mapping(address => mapping(uint256 => uint256)) public walletMinted;

    bool public paused = true;
    mapping(uint256 => bool) public pausedBatch;

    mapping(uint256 => uint) private batchMintDateStart;

    uint256 public randomCounter = 1;
    mapping(uint => string) private tokenToURI;
    mapping(uint256 => uint256) private currentSupply;
    mapping(uint256 => uint256) public maxSupply;
    mapping(uint256 => uint256) public maxSupplyForBatch;
    mapping(uint256 => bool) private createdToken;
    mapping(uint256 => bool) private mintInOrder;

    mapping(uint256 => bool) public rollInUse;
    mapping(uint256 => string) public roll;
    mapping(uint256 => uint256) public rollLimitMin; //excluded
    mapping(uint256 => uint256) public rollLimitMax; //included

    mapping(uint256 => uint256[]) public requirementTokens;
    mapping(uint256 => uint256[]) public requirementTokenAmounts;
    mapping(uint256 => uint256[]) public batchRequirementTokens;
    mapping(uint256 => uint256[]) public batchRequirementTokenAmounts;

    uint256[] public collectionBatchEndID;
    uint256[] public tokenNextToMintInBatch;
    string[] public ipfsCIDBatch;
    string[] public uriBatch;
    uint256[] public batchCost;
    mapping(uint256 => uint256) public batchTriggerPoint;
    mapping(uint256 => uint256) public batchCostNext;
    mapping(uint256 => bool) public revealedBatch;
    
    struct Tier {
        uint256 tLimit;
        uint256 tCost;
        bytes32 tRoot;
    }
    Tier[] public tiers;
    string public tierURI;
    mapping(address => mapping(uint256 => uint256)) public tierMinted;

    address payable public payments;
    address public projectLeader;
    address[] public admins;

    mapping(uint256 => bool) public bindOnMintBatch; //BOM or BOMB are the tokens that cannot be moved after being minted
    mapping(uint256 => bool) public flagged; //flagged tokens cannot be moved
    mapping(address => bool) public restricted; //restricted addresses cannot move tokens

    /* 
    address(0) = 0x0000000000000000000000000000000000000000

    ERROR KEY:
    !D = Not The Date
    BLE = Batch Limit Exceeded
    WLE = Wallet Limit Exceeded
    PWLE = Presale Wallet Limit Exceeded
    !WL = Not Whitelisted
    LE = Limit Exceeded
    $? = Insufficient Funds
    !Batch = Not A Batch
    !B = ID Not Found in Batch
    OOS = Out Of Stock
    !MINT = Cannot Mint
    !A = Amount Cannot Be 0
    MMA = Max Mint Amount Exceeded
    !ID = ID Does Not Exist Yet
    IDs> = IDs Cannot Exceed Max Mint Amount
    IDs != Amounts = IDs List Does Not Match Amounts List
    EID > PB? = End ID Parameter Must Be Greater Than Previous Batch End ID
    MIN <= MAX? = Min Must Be Less Than Or Equal To Max
    NOoPL = Not Owner Or Project Leader
    FID = Flagged ID
    */

    constructor() ERC1155(""){
        collectionBatchEndID.push(collectionEndID);
        ipfsCIDBatch.push("");
        uriBatch.push("");
        maxSupply[1] = 1;
        createdToken[1] = true;
        currentSupply[1] = 1;
        tokenNextToMintInBatch.push(2);
        _mint(msg.sender, 1, 1, "");

        mintInOrder[0] = true;
        batchCost.push(cost);
        batchCostNext[0] = cost;
    }

    /**
    @dev Admin can set the PAUSE state for all or just a batch.
    @param _pauseAll Whether to pause all batches.
    @param _fromBatch The ID of the batch to pause.
    @param _state Whether to set the batch or all batches as paused or unpaused.
    true = closed to Admin Only
    false = open for Presale or Public
    */
    function pause(bool _pauseAll, uint _fromBatch, bool _state) public onlyAdmins {
        if(_pauseAll){
            paused = _state;
        }
        else{
            pausedBatch[_fromBatch] = _state;
        }
    }

    /**
    @dev Admin can set the state of an OPTION for a batch.
    @param _option The OPTION to set the state of:
    1 = Set the REVEALED state.
    2 = Set the USING ROLLS state allowing Mints to pick a roll randomly within a set range.
    3 = Set the MINT IN ORDER state.     
    4 = Set the BIND on mint state. Note: Bound tokens cannot be moved once minted.
    //5 = Set the PRESALE state.
    @param _state The new state of the option:
    true = revealed, on
    false = hidden, off
    @param _fromBatch The batch ID to update the state for.
    */
    function setStateOf(uint _option, bool _state, uint _fromBatch) public onlyAdmins {
        if(_option == 1){
            revealedBatch[_fromBatch] = _state;
            return;
        }
        if(_option == 2){
            rollInUse[_fromBatch] = _state;
            return;
        }
        if(_option == 3){
            mintInOrder[_fromBatch] = _state;
            return;
        }
        if(_option == 4){
            bindOnMintBatch[_fromBatch] = _state;
            return;
        }
        // if(_option == 5){
        //     presaleBatch[_fromBatch] = _state;
        //     return;
        // }
    }

    /**
    @dev Allows an admin to set a start date for minting tokens for a specific batch.
    Tokens can only be minted after this date has passed.
    @param _batch The ID of the batch to set the mint date for.
    @param _unixDate The Unix timestamp for the start date of minting.
    @notice The Unix timestamp must be in the future, otherwise the function will revert.
    */
    function setMintDate(uint256 _batch, uint _unixDate) public onlyAdmins {
        require(_unixDate > block.timestamp, "Date Already Past");
        batchMintDateStart[_batch] = _unixDate;
    }

    /**
    @dev Sets the ID of the next token to be minted in a batch by an Admin.
    @param _id uint ID of the next token to be minted.
    @param _fromBatch uint Batch number of the batch in which the token will be minted.
    Requirements:
    Only accessible by admins.
    */
    function setTokenNextToMintInBatch(uint _id, uint _fromBatch) external onlyAdmins {
        tokenNextToMintInBatch[_fromBatch] = _id;
    }

    /**
    @dev Admin can set the new public or presale cost for a specific batch in WEI. The cost is denominated in wei,
    where 1 ETH = 10^18 WEI. To convert ETH to WEI and vice versa, use a tool such as https://etherscan.io/unitconverter.
    @param _newCost uint256 indicating the new cost for the batch in WEI.
    @param _fromBatch uint indicating the ID of the batch to which the new cost applies.
    Note:
    This also sets the batchCostNext to the new cost so if a setCostNextOnTrigger was set it will need to be reset again.
    Requirements:
    Only accessible by admins.
    */
    function setCost(uint256 _newCost, uint _fromBatch) public onlyAdmins {
        batchCost[_fromBatch] = _newCost;
        batchCostNext[_fromBatch] = _newCost;
    }

    /**
    @dev Sets the cost for the next mint after a specific token is minted in a batch.
    Only accessible by admins.
    */
    function setCostNextOnTrigger(uint256 _nextCost, uint _triggerPointID, uint _fromBatch) public onlyAdmins {
        batchTriggerPoint[_fromBatch] = _triggerPointID;
        batchCostNext[_fromBatch] = _nextCost;
    }

    /**
    @dev Returns the cost for minting a token from the specified batch ID.
    If the caller is not an Admin, the function will return the presale cost if the batch is a presale batch,
    otherwise it will return the regular batch cost. If the caller is an Admin, the function will return 0.
    */
    function _cost(uint _batchID, bool _onTierList, uint8 _tID) public view returns(uint256){
        if (!checkIfAdmin()) {
            if(_onTierList){
                return tiers[_tID].tCost;
            }
            
            return batchCost[_batchID];
        }
        return 0;
    }

    function checkOut(uint _amount, uint _batchID, bytes32[] calldata proof) private {
        if (!checkIfAdmin()) {
            if (batchMintDateStart[_batchID] > 0) {
                require(block.timestamp >= batchMintDateStart[_batchID], "!D");
            }

            if(batchLimit[_batchID] != 0){
                require(walletMinted[msg.sender][_batchID] + _amount <= batchLimit[_batchID], "BLE");
                walletMinted[msg.sender][_batchID] += _amount;
            }

            (bool _onTierList, uint8 _tID) = isValidTier(proof, keccak256(abi.encodePacked(msg.sender)));
            if(_onTierList){
                if(tiers[_tID].tLimit == 0){
                    //use selected tier ID
                }
                else{
                    if(tierMinted[msg.sender][_tID] + _amount <= tiers[_tID].tLimit){
                        tierMinted[msg.sender][_tID] += _amount;
                    }
                    else{
                        //move to next tier if next one is available
                        if(_tID < tiers.length - 1){
                            _tID++;
                        }
                    }
                }
            }
            
            require(msg.value >= (_amount * _cost(_batchID, _onTierList, _tID)), "$?");
        }
    }

    function checkOutScan(uint _id, uint _fromBatch) private{
        if (!exists(_id)) {
            createdToken[_id] = true;
            if(mintInOrder[_fromBatch]){
                currentSupply[_id] = 1;
            }
        }

        if(rollInUse[_fromBatch]){
            roll[_id] = randomRoll(_fromBatch);
        }

        if(batchCost[_fromBatch] != batchCostNext[_fromBatch] && tokenNextToMintInBatch[_fromBatch] >= batchTriggerPoint[_fromBatch]){
            batchCost[_fromBatch] = batchCostNext[_fromBatch];
        }
        randomCounter++;
    }

    /**
    @dev Checks if a token with the given ID belongs to the specified batch.
    @param _id The ID of the token to check.
    @param _fromBatch The batch to check for token membership.
    @return bool indicating whether the token belongs to the specified batch.
    */
    function checkInBatch(uint _id, uint _fromBatch) public view returns(bool){
        require(_fromBatch < collectionBatchEndID.length, "!Batch");
        if(_fromBatch != 0 && _id <= collectionBatchEndID[_fromBatch] && _id > collectionBatchEndID[_fromBatch - 1]){
            return true;
        }
        if(_fromBatch <= 0 && _id <= collectionBatchEndID[_fromBatch]){
            return true;
        }
        return false;
    }

    /**
    @dev Allows Admins, Whitelisters, and Public to mint NFTs in order from a collection batch.
    Admins can call this function even while the contract is paused.
    @param _to The address to mint the NFTs to.
    @param _numberOfTokensToMint The number of tokens to mint from the batch in order.
    @param _fromBatch The batch to mint the NFTs from.
    @param proof An array of Merkle tree proofs to validate the mint.
    */
    function _mintInOrder(address _to, uint _numberOfTokensToMint, uint _fromBatch, bytes32[] calldata proof) public payable {
        require(mintInOrder[_fromBatch], "mintInOrder");
        require(!exists(collectionBatchEndID[_fromBatch]), "OOS");
        require(_fromBatch >= 0, "!Batch");
        require(_numberOfTokensToMint + tokenNextToMintInBatch[_fromBatch] - 1 <= collectionBatchEndID[_fromBatch], "Please Lower Amount");
        if(!checkIfAdmin()){
            require(!paused, "Paused");
            require(!pausedBatch[_fromBatch], "Paused Batch");

            checkOut(_numberOfTokensToMint, _fromBatch, proof);
        }
        
        _mintBatchTo(_to, _numberOfTokensToMint, _fromBatch);
    }

    function _mintBatchTo(address _to, uint _numberOfTokensToMint, uint _fromBatch)private {
        uint256[] memory _ids = new uint256[](_numberOfTokensToMint);
        uint256[] memory _amounts = new uint256[](_numberOfTokensToMint);
        for (uint256 i = 0; i < _numberOfTokensToMint; i++) {
            uint256 _id = tokenNextToMintInBatch[_fromBatch];
            require(canMintChecker(_id, 1, _fromBatch), "!MINT");
            
            checkOutScan(_id, _fromBatch);

            _ids[i] = tokenNextToMintInBatch[_fromBatch];
            _amounts[i] = 1;
            tokenNextToMintInBatch[_fromBatch]++;
        }
        
        _mintBatch(_to, _ids, _amounts, "");
    }

    /**
    @dev Allows Owner, Whitelisters, and Public to mint a single NFT with the given _id, _amount, and _fromBatch parameters for the specified _to address.
    @param _to The address to mint the NFT to.
    @param _id The ID of the NFT to mint.
    @param _amount The amount of NFTs to mint.
    @param _fromBatch The batch end ID that the NFT belongs to.
    @param proof The Merkle proof verifying the ownership of the tokens being minted.
    Requirements:
    - mintInOrder[_fromBatch] must be false.
    - _id must be within the batch specified by _fromBatch.
    - The total number of NFTs being minted across all batches cannot exceed maxBatchMintAmount.
    - If the caller is not an admin, the contract must not be paused and the batch being minted from must not be paused.
    - The caller must have a valid Merkle proof for the tokens being minted.
    - The amount of tokens being minted must satisfy the canMintChecker function.
    - The ID being minted must not have reached its max supply.
    */
    function mint(address _to, uint _id, uint _amount, uint _fromBatch, bytes32[] calldata proof) public payable {
        require(!mintInOrder[_fromBatch], "Requires !mintInOrder");
        require(checkInBatch(_id, _fromBatch), "!B");
        require(canMintChecker(_id, _amount, _fromBatch), "!MINT");
        if(!checkIfAdmin()){
            require(!paused, "Paused");
            require(!pausedBatch[_fromBatch], "Paused Batch");

            checkOut(_amount, _fromBatch, proof);
        }

        checkOutScan(_id, _fromBatch);
        currentSupply[_id] += _amount;
        
        _mint(_to, _id, _amount, "");
    }

    function canMintChecker(uint _id, uint _amount, uint _fromBatch) private view returns(bool){
        require(_amount > 0, "!A");
        require(_amount <= maxMintAmount, "MMA");
        require(_id <= collectionEndID, "!ID");

        // checks if the id exceeded it's max supply
        if (maxSupply[_id] != 0 && currentSupply[_id] + _amount > maxSupply[_id]) {
            // CANNOT MINT 
            return false;
        }

        // checks if the id exceeded it's max supply limit that each id in the batch is assigned
        if(maxSupplyForBatch[_fromBatch] != 0 && currentSupply[_id] + _amount > maxSupplyForBatch[_fromBatch]){
            // CANNOT MINT 
            return false;
        }
        
        // checks if the id needs requirement token(s)
        if(requirementTokens[_id].length > 0) {
            for (uint256 i = 0; i < requirementTokens[_id].length; i++) {
                uint256 _userTokenBalance = balanceOf(msg.sender, requirementTokens[_id][i]);
                if(_userTokenBalance < requirementTokenAmounts[_id][i]){
                    //CANNOT MINT: DOES NOT HAVE REQUIREMENT TOKEN(S) AMOUNTS
                    return false;
                }
            }
        }

        // checks if the batch (other than the original) that the id resides in needs requirement token(s)
        if(batchRequirementTokens[_fromBatch].length > 0){
            for (uint256 j = 0; j < batchRequirementTokens[_fromBatch].length; j++) {
                uint256 _userBatchTokenBalance = balanceOf(msg.sender, batchRequirementTokens[_fromBatch][j]);
                if(_userBatchTokenBalance < batchRequirementTokenAmounts[_fromBatch][j]){
                    //CANNOT MINT: DOES NOT HAVE REQUIREMENT TOKEN(S) AMOUNTS
                    return false;
                }
            }
        }

        // CAN MINT
        return true;
    }

    /**
    @dev Allows Owner, Whitelisters, and Public to mint multiple NFTs at once, given a list of token IDs, their corresponding amounts,
    and the batch from which they are being minted. Checks if the caller has the required permissions and if the maximum allowed mint
    amount and maximum allowed batch mint amount are not exceeded. Also verifies that the specified token IDs are in the given batch,
    and that the caller has passed a valid proof of a transaction to checkOut.
    */
    function mintBatch(address _to, uint[] memory _ids, uint[] memory _amounts, uint _fromBatch, bytes32[] calldata proof) public payable {
        require(!mintInOrder[_fromBatch], "Requires !mintInOrder");
        require(_ids.length <= maxMintAmount, "IDs>");
        require(_ids.length == _amounts.length, "IDs != Amounts");
        require(canMintBatchChecker(_ids, _amounts, _fromBatch), "!MINT");

        uint256 _totalBatchAmount;
        for (uint256 i = 0; i < _amounts.length; i++) {
            require(checkInBatch(_ids[i], _fromBatch), "!B");
            _totalBatchAmount += _amounts[i];
        }
        require(_totalBatchAmount <= maxBatchMintAmount, "LE");

        if(!checkIfAdmin()){
            require(!paused, "Paused");
            require(!pausedBatch[_fromBatch], "Paused Batch");
            checkOut(_totalBatchAmount, _fromBatch, proof);
        }

        for (uint256 k = 0; k < _ids.length; k++) {
            uint256 _id = _ids[k];
            checkOutScan(_id, _fromBatch);
            currentSupply[_ids[k]] += _amounts[k];
        }

        _mintBatch(_to, _ids, _amounts, "");
    }

    function canMintBatchChecker(uint[] memory _ids, uint[] memory _amounts, uint _fromBatch)private view returns(bool){
        for (uint256 i = 0; i < _ids.length; i++) {
            uint256 _id = _ids[i];
            uint256 _amount = _amounts[i];
            if(!canMintChecker(_id, _amount, _fromBatch)){
                // CANNOT MINT
                return false;
            }
        }

        return true;
    }

    /**
    @dev Allows User to DESTROY multiple tokens they own.
    */
    function burnBatch(uint[] memory _ids, uint[] memory _amounts) external {
        for (uint256 i = 0; i < _ids.length; ++i) {
            uint256 _id = _ids[i];
            currentSupply[_id] -= _amounts[i];
        }
        _burnBatch(msg.sender, _ids, _amounts);
    }

    /**
    @dev Allows the contract admin to set the requirement tokens and their corresponding amounts for a specific token ID or batch end ID.
    If `_isBatch` is true, the requirement tokens and amounts will be set for the entire batch. Otherwise, they will be set for a specific token ID.
    @param _id The ID of the token or batch end for which the requirement tokens and amounts will be set.
    @param _isBatch A boolean indicating whether the ID corresponds to a batch end or a specific token.
    @param _requiredIDS An array of token IDs that are required to be owned in order to own the specified token or batch.
    @param _amounts An array of amounts indicating how many of each token ID in `_requiredIDS` are required to be owned in order to own the specified token or batch.
    */
    function setRequirementTokens(uint _id, bool _isBatch, uint[] memory _requiredIDS, uint[] memory _amounts) external onlyAdmins {
        if(_isBatch){
            require(_id >= 0 && _id <= collectionBatchEndID[collectionBatchEndID.length - 1], "!B");
            // is confirmed a Batch, _id = batchID
            batchRequirementTokens[_id] = _requiredIDS;
            batchRequirementTokenAmounts[_id] = _amounts;
        }
        else{
            requirementTokens[_id] = _requiredIDS;
            requirementTokenAmounts[_id] = _amounts;
        }
    }

    /**
    @dev Sets the URI for a token or batch of tokens.
    @param _hidden Flag to determine if the URI should be set as the hidden URI.
    @param _tier Flag to determine if the URI should be set as the tier URI.
    @param _isBatch Flag to determine if a batch of tokens is being modified.
    @param _id ID of the token or batch of tokens being modified.
    @param _uri The new URI to be set.
    @param _isIpfsCID Flag to determine if the new URI is an IPFS CID.
    */
    function setURI(bool _hidden, bool _tier, bool _isBatch, uint _id, string calldata _uri, bool _isIpfsCID) external onlyAdmins {
        if (_hidden) {
            hiddenURI = _uri;
            return;
        }

        if (_tier) {
            tierURI = _uri;
            return;
        }

        if (!_isBatch) {
            if (_isIpfsCID) {
                string memory _uriIPFS = string(abi.encodePacked(
                    "ipfs://",
                    _uri,
                    "/",
                    Strings.toString(_id),
                    ".json"
                ));

                tokenToURI[_id] = _uriIPFS;
                emit URI(_uriIPFS, _id);
            }
            else {
                tokenToURI[_id] = _uri;
                emit URI(_uri, _id);
            }
        }
        else{
            if (_isIpfsCID) {
                //modify IPFS CID
                ipfsCIDBatch[_id] = _uri;
            }
            else{
                //modify URI
                uriBatch[_id] = _uri;
            }
        }
    }

    /**
    @dev Allows the contract Admin to create a new batch of tokens with a specified end ID, URI or CID, and cost in WEI.
    @param _endBatchID The ending token ID of the new batch. Must be greater than the previous batch end ID.
    @param _newCost The cost of each token in the new batch in WEI.
    @param _uri The base URI or CID for the new batch of tokens.
    @param _isIpfsCID Set to true if the URI is a CID only.
    @param _isMintInOrder Set to true if the new batch should be minted in order.
    Example URI structure if _endBatchID = 55 and _isIpfsCID = false and _uri = BASEURI.EXTENSION
    will output: BASEURI.EXTENSION/55.json for IDs 55 and below until it hits another batch end ID.
    Requirements:
    - The _endBatchID parameter must be greater than the previous batch end ID.
    */
    function createBatchAndSetURI(uint _endBatchID, uint256 _newCost, string memory _uri, bool _isIpfsCID, bool _isMintInOrder) external onlyAdmins {
        require(_endBatchID > collectionBatchEndID[collectionBatchEndID.length-1], "EID > PB?");
        
        tokenNextToMintInBatch.push(collectionBatchEndID[collectionBatchEndID.length-1] + 1); //set mint start ID for batch
                    
        collectionBatchEndID.push(_endBatchID);

        if (_isIpfsCID) {
            //set IPFS CID
            ipfsCIDBatch.push(_uri);
            uriBatch.push("");
        }
        else{
            //set URI
            uriBatch.push(_uri);
            ipfsCIDBatch.push("");
        }

        batchCost.push(_newCost);
        batchCostNext[collectionBatchEndID.length-1] = _newCost;
        if(_isMintInOrder){
            setStateOf(3, true, collectionBatchEndID.length-1);
        }
    }

    /**
    @dev Returns the URI for a given token ID. If the token is a collection,
    the URI may be batched. If the token batch has roll enabled, it will have
    a random roll id. If the token is not found, the URI defaults to a hidden URI.
    @param _id uint256 ID of the token to query the URI of
    @return string representing the URI for the given token ID
    */
    function uri(uint256 _id) override public view returns(string memory){
        bool _batched = true;
        uint256 _batchID;
        string memory _CIDorURI;

        if(createdToken[_id]){
            if (_id <= collectionEndID) {
                if(keccak256(abi.encodePacked((tokenToURI[_id]))) != keccak256(abi.encodePacked(("")))){
                    return tokenToURI[_id];
                }

                for (uint256 i = 0; i < collectionBatchEndID.length; ++i) {
                    if(_id <= collectionBatchEndID[i]){
                        if(keccak256(abi.encodePacked((ipfsCIDBatch[i]))) != keccak256(abi.encodePacked(("")))){
                            _CIDorURI = string(abi.encodePacked(
                                "ipfs://",
                                ipfsCIDBatch[i],
                                "/"
                            ));
                            _batchID = i;
                            break;
                        }
                        if(keccak256(abi.encodePacked((uriBatch[i]))) != keccak256(abi.encodePacked(("")))){
                            _CIDorURI = string(abi.encodePacked(
                                uriBatch[i],
                                "/"
                            ));
                            _batchID = i;
                            break;
                        }
                        continue;
                    }
                    else{
                        //_id was not found in a batch
                        continue;
                    }
                }

                if(_id > collectionBatchEndID[collectionBatchEndID.length - 1]){
                    _batched = false;
                }

                if(_batched && revealedBatch[_batchID]){
                    if(keccak256(abi.encodePacked((roll[_id]))) == keccak256(abi.encodePacked(("")))){
                        //no roll
                        return (
                        string(abi.encodePacked(
                            _CIDorURI,
                            Strings.toString(_id),
                            ".json"
                        )));
                    }
                    else{
                        //has roll
                        return (
                        string(abi.encodePacked(
                            _CIDorURI,
                            roll[_id],
                            ".json"
                        )));
                    }
                }
            }
        }
        //not found default to hidden
        return hiddenURI;
    }

    /**
    @dev Returns a random number between rollLimitMin and rollLimitMax for a given batch _fromBatch.
    @param _fromBatch The ID of the batch to get the roll limit for.
    @return A string representing the randomly selected roll within the specified range.
    */
    function randomRoll(uint _fromBatch) internal view returns (string memory){
        uint random = uint(keccak256(abi.encodePacked(
            block.timestamp,
            block.prevrandao,
            msg.sender,
            randomCounter,
            roll[randomCounter - 1])
            )) % rollLimitMax[_fromBatch];
        //return random;
        if(random < rollLimitMin[_fromBatch]){
            return Strings.toString(rollLimitMax[_fromBatch] - (random + 1));
        }
        else{
            return Strings.toString(random + 1);
        }
    }

    /**
    @dev Returns a randomly selected roll within the range specified for a given batch _fromBatch.
    @param _fromBatch The ID of the batch to get the roll limit for.
    @return _roll string representing the randomly selected roll within the specified range.
    */
    // function randomPick(uint _fromBatch) public view returns (string memory _roll){
    //     return randomRoll(_fromBatch);
    // }

    /**
    @dev Sets the minimum and maximum values for the roll limit for a given batch _fromBatch.
    @param _min The minimum value of the roll limit (excluded).
    @param _max The maximum value of the roll limit (included).
    @param _fromBatch The ID of the batch to set the roll limit for.
    */
    function rollLimitSet(uint _min, uint _max, uint _fromBatch) external onlyAdmins {
        require(_min <= _max, "MIN <= MAX?");
        rollLimitMin[_fromBatch] = _min;
        rollLimitMax[_fromBatch] = _max;
    }

    /**
    @dev Returns the total number of tokens with a given ID that have been minted.
    @param _id The ID of the token.
    @return total number of tokens with the given ID.
    */
    function totalSupply(uint256 _id) public view returns(uint256) {
        return currentSupply[_id];
    }

    /**
    @dev Returns true if a token with the given ID exists, otherwise returns false.
    @param _id The ID of the token.
    @return bool indicating whether the token with the given ID exists.
    */
    function exists(uint256 _id) public view returns(bool) {
        return createdToken[_id];
    }

    /**
    @dev Returns the maximum supply of a token with the given ID.
    @param _id The ID of the token.
    @param _isBatch A boolean indicating whether the ID is a batch ID or not.
    @return maximum supply of the token with the given ID. If it is 0, the supply is limitless.
    */
    function checkMaxSupply(uint256 _id, bool _isBatch) public view returns(uint256) {        
        if(_isBatch){
            return maxSupplyForBatch[_id];
        }
        else{
            return maxSupply[_id];
        }
    }

    /**
    @dev Allows the admin to set the maximum supply of tokens.
    @param _ids An array of token IDs to set the maximum supply for.
    @param _supplies An array of maximum supplies for the tokens in the corresponding position in _ids.
    @param _isBatchAllSameSupply A boolean indicating whether all tokens in _ids should have the same maximum supply or not.
    Note: If the maximum supply is set to 0, the supply is limitless.
    */
    function setMaxSupplies(uint[] memory _ids, uint[] memory _supplies, bool _isBatchAllSameSupply) external onlyAdmins {
        if(_isBatchAllSameSupply){
            maxSupplyForBatch[_ids[0]] = _supplies[0];          
        }
        else{
            for (uint256 i = 0; i < _ids.length; i++) {
                uint256 _id = _ids[i];
                maxSupply[_id] = _supplies[i];
            }
        }
    }

    /**
    @dev Allows admin to update the collectionEndID which is used to determine the end of the initial collection of NFTs.
    @param _newcollectionEndID The new collectionEndID to set.
    */
    function updatecollectionEndID(uint _newcollectionEndID) external onlyAdmins {
        collectionEndID = _newcollectionEndID;
    }

    /**
    @dev Allows admin to set the maximum amount of NFTs a user can mint in a single session.
    @param _newmaxMintAmount The new maximum amount of NFTs a user can mint in a single session.
    */
    function setMaxMintAmount(uint256 _newmaxMintAmount) public onlyAdmins {
        maxMintAmount = _newmaxMintAmount;
    }

    /**
    @dev Allows admin to set the mint limit for a batch.
    @param _limit The new limit to set.
    @param _fromBatch The index of the batch to set the limit for.
    */
    function setMintLimit(uint256 _limit, uint256 _fromBatch) public onlyAdmins {
        batchLimit[_fromBatch] = _limit;
    }

    /**
    @dev Allows admin to set the payout address for the contract.
    @param _address The new payout address to set.
    Note: address can be a wallet or a payment splitter contract
    */
    function setPayoutAddress(address _address) external onlyOwner{
        payments = payable(_address);
    }

    /**
    @dev Admin can withdraw the contract's balance to the specified payout address.
    The `payments` address must be set before calling this function.
    The function will revert if `payments` address is not set or the transaction fails.
    */
    function withdraw() public onlyAdmins {
        require(payments != address(0), "Payout address not set");

        uint256 balance = address(this).balance;
        require(balance > 0, "No funds to withdraw");

        // Splitter
        (bool success, ) = payable(payments).call{ value: balance }("");
        require(success, "Withdrawal failed");
    }

    /**
    @dev Auto send funds to the payout address.
    Triggers only if funds were sent directly to this address.
    */
    receive() external payable {
        require(payments != address(0), "Payment address not set");
        uint256 payout = msg.value;
        payments.transfer(payout);
    }

    /**
    @dev Throws if called by any account other than the owner or admin.
    */
    modifier onlyAdmins() {
        _checkAdmins();
        _;
    }

    /**
    @dev Internal function to check if the sender is an admin.
    */
    function _checkAdmins() internal view virtual {
        require(checkIfAdmin(), "!A");
    }

    /**
    @dev Checks if the sender is an admin.
    @return bool indicating whether the sender is an admin or not.
    */
    function checkIfAdmin() public view returns(bool) {
        if (msg.sender == owner() || msg.sender == projectLeader){
            return true;
        }
        if(admins.length > 0){
            for (uint256 i = 0; i < admins.length; i++) {
                if(msg.sender == admins[i]){
                    return true;
                }
            }
        }
        // Not an Admin
        return false;
    }

    /**
    @dev Owner and Project Leader can set the addresses as approved Admins.
    Example: ["0xADDRESS1", "0xADDRESS2", "0xADDRESS3"]
    */
    function setAdmins(address[] calldata _users) public onlyAdmins {
        require(msg.sender == owner() || msg.sender == projectLeader, "NOoPL");
        delete admins;
        admins = _users;
    }

    /**
    @dev Owner or Project Leader can set the address as new Project Leader.
    */
    function setProjectLeader(address _user) external {
        require(msg.sender == owner() || msg.sender == projectLeader, "NOoPL");
        projectLeader = _user;
    }

    /**
    * @dev Validates what tier a user is on for the Tierlist.
    */
    function isValidTier(bytes32[] calldata proof, bytes32 leaf) public view returns (bool, uint8) {
        if(tiers.length != 0){
            for (uint8 i = 0; i < tiers.length; i++) {
                if(MerkleProof.verify(proof, tiers[i].tRoot, leaf)){
                    return (true, i);
                }
            }
        }
        
        return (false, 0);
    }

    /**
    @dev Sets a new tier with the provided parameters or updates an existing tier.
    @param _create If true, creates a new tier with the provided parameters. If false, updates an existing tier.
    @param _tID The ID of the tier to be updated. Only applicable if _create is false.
    @param _tLimit The mint limit of the new tier or updated tier.
    @param _tCost The cost of the new tier or updated tier.
    @param _tRoot The Merkle root of the new tier or updated tier.
    Requirements:
    - Only admin addresses can call this function.
    - If _create is false, the ID provided must correspond to an existing tier.
    */
    function setTier(bool _create, uint8 _tID, uint256 _tLimit, uint256 _tCost, bytes32 _tRoot) external onlyAdmins {
        // Define a new Tier struct with the provided cost and Merkle root.
        Tier memory newTier = Tier(
            _tLimit,
            _tCost,
            _tRoot
        );
        
        if(_create){
            // If _create is true, add the new tier to the end of the tiers array.
            tiers.push(newTier);
        }
        else{
            // If _create is false, update the existing tier at the specified ID.
            require(tiers.length > 0 && _tID < tiers.length, "Invalid Tier ID");
            tiers[_tID] = newTier;
        }
    }

    /**
    * @dev Owner or Project Leader can set the restricted state of an address.
    * Note: Restricted addresses are banned from moving tokens.
    */
    function restrictAddress(address _user, bool _state) external {
        require(msg.sender == owner() || msg.sender == projectLeader, "NOoPL");
        restricted[_user] = _state;
    }

    /**
    * @dev Owner or Project Leader can set the flag state of a token ID.
    * Note: Flagged tokens are locked and untransferable.
    */
    function flagID(uint256 _id, bool _state) external {
        require(msg.sender == owner() || msg.sender == projectLeader, "NOoPL");
        flagged[_id] = _state;
    }

    /**
    * @dev Hook that is called before any token transfer. This includes minting
    * and burning, as well as batched variants.
    */
    function _beforeTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override{
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data); // Call parent hook
        require(restricted[operator] == false && restricted[from] == false && restricted[to] == false, "Operator, From, or To Address is RESTRICTED"); //checks if the any address in use is restricted

        for (uint256 i = 0; i < ids.length; i++) {
            if(flagged[ids[i]]){
                revert("FID"); //reverts if a token has been flagged
            }
        }
    }

    /**
    * @dev Check if an ID is in a bind on mint batch.
    */
    function bindOnMint(uint _id) public view returns(bool){
        uint256 _batchID;
        for (uint256 i = 0; i < collectionBatchEndID.length; i++) {
            if(i != 0 && _id <= collectionBatchEndID[i] && _id > collectionBatchEndID[i - 1]){
                _batchID = i;
                break;
            }
            if(i <= 0 && _id <= collectionBatchEndID[i]){
                _batchID = i;
                break;
            }
        }
        return bindOnMintBatch[_batchID];
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     */
    function _afterTokenTransfer(address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data) internal virtual override{
        super._afterTokenTransfer(operator, from, to, ids, amounts, data); // Call parent hook

        for (uint256 i = 0; i < ids.length; i++) {
            if(bindOnMint(ids[i])){
                flagged[ids[i]] = true;
            }
        }
    }

    //OPENSEA ROYALTY REQUIREMENT CODE SNIPPET ************_START
    function safeTransferFrom(address from, address to, uint256 tokenId, uint256 amount, bytes memory data)
        public
        override
        onlyAllowedOperator()
    {
        super.safeTransferFrom(from, to, tokenId, amount, data);
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override onlyAllowedOperator() {
        super.safeBatchTransferFrom(from, to, ids, amounts, data);
    }
    //OPENSEA ROYALTY REQUIREMENT CODE SNIPPET ************_END
}

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

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

contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

File 3 of 18 : 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 rebuilds 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 from 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) {
            unchecked {
                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 rebuilds 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 from 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) {
            unchecked {
                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 4 of 18 : 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";
import "./math/SignedMath.sol";

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = 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 `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @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;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

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

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

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

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: address zero is not a valid owner");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] memory accounts,
        uint256[] memory ids
    ) public view virtual override returns (uint256[] memory) {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner or approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner or approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(address from, uint256 id, uint256 amount) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `ids` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non-ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non-ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

File 7 of 18 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 8 of 18 : 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) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 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 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 9 of 18 : 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 10 of 18 : 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 11 of 18 : 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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev 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 12 of 18 : IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

File 13 of 18 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 14 of 18 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

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

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

contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry constant operatorFilterRegistry =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

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

    modifier onlyAllowedOperator() virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(operatorFilterRegistry).code.length > 0) {
            if (!operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)) {
                revert OperatorNotAllowed(msg.sender);
            }
        }
        _;
    }
}

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

pragma solidity ^0.8.0;

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

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

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external returns (bool);
    function register(address registrant) 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 18 of 18 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"uint256","name":"_batchID","type":"uint256"},{"internalType":"bool","name":"_onTierList","type":"bool"},{"internalType":"uint8","name":"_tID","type":"uint8"}],"name":"_cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_numberOfTokensToMint","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"_mintInOrder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"admins","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"batchCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"batchCostNext","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"batchLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"batchRequirementTokenAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"batchRequirementTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"batchTriggerPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"bindOnMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bindOnMintBatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkIfAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"}],"name":"checkInBatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bool","name":"_isBatch","type":"bool"}],"name":"checkMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"collectionBatchEndID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectionEndID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endBatchID","type":"uint256"},{"internalType":"uint256","name":"_newCost","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"bool","name":"_isIpfsCID","type":"bool"},{"internalType":"bool","name":"_isMintInOrder","type":"bool"}],"name":"createBatchAndSetURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bool","name":"_state","type":"bool"}],"name":"flagID","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"flagged","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ipfsCIDBatch","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"bytes32","name":"leaf","type":"bytes32"}],"name":"isValidTier","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBatchMintAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxSupplyForBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"mintBatch","outputs":[],"stateMutability":"payable","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":"bool","name":"_pauseAll","type":"bool"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"},{"internalType":"bool","name":"_state","type":"bool"}],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pausedBatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payments","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectLeader","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"requirementTokenAmounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"requirementTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"_state","type":"bool"}],"name":"restrictAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"restricted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"revealedBatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"roll","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rollInUse","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rollLimitMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rollLimitMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_min","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"}],"name":"rollLimitSet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","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":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_users","type":"address[]"}],"name":"setAdmins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCost","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"}],"name":"setCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nextCost","type":"uint256"},{"internalType":"uint256","name":"_triggerPointID","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"}],"name":"setCostNextOnTrigger","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newmaxMintAmount","type":"uint256"}],"name":"setMaxMintAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_supplies","type":"uint256[]"},{"internalType":"bool","name":"_isBatchAllSameSupply","type":"bool"}],"name":"setMaxSupplies","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_batch","type":"uint256"},{"internalType":"uint256","name":"_unixDate","type":"uint256"}],"name":"setMintDate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_limit","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"}],"name":"setMintLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"setPayoutAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"setProjectLeader","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"bool","name":"_isBatch","type":"bool"},{"internalType":"uint256[]","name":"_requiredIDS","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"setRequirementTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_option","type":"uint256"},{"internalType":"bool","name":"_state","type":"bool"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"}],"name":"setStateOf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_create","type":"bool"},{"internalType":"uint8","name":"_tID","type":"uint8"},{"internalType":"uint256","name":"_tLimit","type":"uint256"},{"internalType":"uint256","name":"_tCost","type":"uint256"},{"internalType":"bytes32","name":"_tRoot","type":"bytes32"}],"name":"setTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_fromBatch","type":"uint256"}],"name":"setTokenNextToMintInBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_hidden","type":"bool"},{"internalType":"bool","name":"_tier","type":"bool"},{"internalType":"bool","name":"_isBatch","type":"bool"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"bool","name":"_isIpfsCID","type":"bool"}],"name":"setURI","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":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tierMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tierURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tiers","outputs":[{"internalType":"uint256","name":"tLimit","type":"uint256"},{"internalType":"uint256","name":"tCost","type":"uint256"},{"internalType":"bytes32","name":"tRoot","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenNextToMintInBatch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newcollectionEndID","type":"uint256"}],"name":"updatecollectionEndID","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uriBatch","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"walletMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c0604052600d60809081526c5468652053616e63747561727960981b60a0526004906200002e908262000beb565b50604080518082019091526005808252641514d3919560da1b60208301529062000059908262000beb565b506115b3600755666a94d74f43000060085560146009819055600a55600d805460ff191660019081179091556010553480156200009557600080fd5b50733cc6cdda760b79bafa08df41ecfa224f810dceb6600160405180602001604052806000815250620000ce816200045060201b60201c565b50620000da3362000462565b6daaeb6d7670e522a718067333cd4e3b156200021f5780156200016d57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200014e57600080fd5b505af115801562000163573d6000803e3d6000fd5b505050506200021f565b6001600160a01b03821615620001be5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000133565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200020557600080fd5b505af11580156200021a573d6000803e3d6000fd5b505050505b5050600754601f805460018181019092557fa03837a25210ee280c2113ff4b77ca23440b19d4866cca721c801278fd08d8070191909155602180549182018155600090815260408051602081019091529081527f3a6357012c1a3ae0a17d304c9920310382d968ebcc4b1771f41c6b304205b57090910190620002a3908262000beb565b5060228054600181018255600091825260408051602081019091529182527f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e5100190620002f0908262000beb565b5060017f4155c2f711f2cdd34f8262ab8fb9b7020a700fe7b6948222152f7670d1fdf34d8190557f27739e4bb5e6f8b5e4b57a047dca8767cc9b982a011081e086cbb0dfa9de818d805460ff191682179055601260209081527f71a67924699a20698523213e55fe499d539379d7769cd5567e2c45d583f815a382905580548083018255600082815260027fc97bfaf2f8ee708c303a06d134f5ecd8389ae0432af62dc132a24118292866bb909201919091556040805192830190528152620003bd9133918190620004b4565b7f0263c2b778d062355049effc2dece97bc6547ff8a88a3258daa512061c2153dd805460ff191660019081179091556008546023805492830190557fd57b2b5166478fd4318d2acc6cc2c704584312bdd8781b32d5d06abda57f42309091018190556000805260256020527fa54b3e90672405a607381bd4d34034a12c5aad31607067a7ad26573f504ad6e25562000ee3565b60026200045e828262000beb565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0384166200051a5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b3360006200052885620005f8565b905060006200053785620005f8565b90506200054a8360008985858962000646565b6000868152602081815260408083206001600160a01b038b168452909152812080548792906200057c90849062000ccd565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4620005de83600089858589620007ba565b620005ef8360008989898962000873565b50505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811062000635576200063562000ce9565b602090810291909101015292915050565b6200066186868686868662000a3f60201b620019341760201c565b6001600160a01b0386166000908152602f602052604090205460ff16158015620006a457506001600160a01b0385166000908152602f602052604090205460ff16155b8015620006ca57506001600160a01b0384166000908152602f602052604090205460ff16155b6200072c5760405162461bcd60e51b815260206004820152602b60248201527f4f70657261746f722c2046726f6d2c206f7220546f204164647265737320697360448201526a08149154d5149250d5115160aa1b606482015260840162000511565b60005b8351811015620005ef57602e600085838151811062000752576200075262000ce9565b60209081029190910181015182528101919091526040016000205460ff1615620007a55760405162461bcd60e51b815260206004820152600360248201526211925160ea1b604482015260640162000511565b80620007b18162000cff565b9150506200072f565b620007d586868686868662000a3f60201b620019341760201c565b60005b8351811015620005ef576200080f848281518110620007fb57620007fb62000ce9565b602002602001015162000a4760201b60201c565b156200085e576001602e600086848151811062000830576200083062000ce9565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806200086a8162000cff565b915050620007d8565b62000892846001600160a01b031662000b3b60201b620030e61760201c565b1562000a3f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190620008ce908990899088908890889060040162000d63565b6020604051808303816000875af19250505080156200090c575060408051601f3d908101601f19168201909252620009099181019062000daa565b60015b620009cc576200091b62000ddd565b806308c379a0036200095b57506200093262000e29565b806200093f57506200095d565b8060405162461bcd60e51b815260040162000511919062000eb8565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840162000511565b6001600160e01b0319811663f23a6e6160e01b14620005ef5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840162000511565b505050505050565b60008060005b601f5481101562000b2257801580159062000a885750601f818154811062000a795762000a7962000ce9565b90600052602060002001548411155b801562000ac05750601f62000a9f60018362000ecd565b8154811062000ab25762000ab262000ce9565b906000526020600020015484115b1562000acf5780915062000b22565b8015801562000afe5750601f818154811062000aef5762000aef62000ce9565b90600052602060002001548411155b1562000b0d5780915062000b22565b8062000b198162000cff565b91505062000a4d565b506000908152602d602052604090205460ff1692915050565b6001600160a01b03163b151590565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168062000b7557607f821691505b60208210810362000b9657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000be657600081815260208120601f850160051c8101602086101562000bc55750805b601f850160051c820191505b8181101562000a3f5782815560010162000bd1565b505050565b81516001600160401b0381111562000c075762000c0762000b4a565b62000c1f8162000c18845462000b60565b8462000b9c565b602080601f83116001811462000c57576000841562000c3e5750858301515b600019600386901b1c1916600185901b17855562000a3f565b600085815260208120601f198616915b8281101562000c885788860151825594840194600190910190840162000c67565b508582101562000ca75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b8082018082111562000ce35762000ce362000cb7565b92915050565b634e487b7160e01b600052603260045260246000fd5b60006001820162000d145762000d1462000cb7565b5060010190565b6000815180845260005b8181101562000d435760208185018101518683018201520162000d25565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009062000d9f9083018462000d1b565b979650505050505050565b60006020828403121562000dbd57600080fd5b81516001600160e01b03198116811462000dd657600080fd5b9392505050565b600060033d111562000df75760046000803e5060005160e01c5b90565b601f8201601f191681016001600160401b038111828210171562000e225762000e2262000b4a565b6040525050565b600060443d101562000e385790565b6040516003193d81016004833e81513d6001600160401b03808311602484018310171562000e6857505050505090565b828501915081518181111562000e815750505050505090565b843d870101602082850101111562000e9c5750505050505090565b62000ead6020828601018762000dfa565b509095945050505050565b60208152600062000dd6602083018462000d1b565b8181038181111562000ce35762000ce362000cb7565b615f438062000ef36000396000f3fe6080604052600436106104815760003560e01c80637d929b4f11610255578063accc1d5e11610144578063d5cce904116100c1578063e985e9c511610085578063e985e9c514610f7a578063ed00e65314610fc3578063f242432a14610fd8578063f2fde38b14610ff8578063fc2f0fd814611018578063fda100e11461103857600080fd5b8063d5cce90414610ebd578063d6199f8d14610edd578063d8d9d6bc14610efd578063dc8519c114610f2d578063e5211d8b14610f5a57600080fd5b8063bff67e9b11610108578063bff67e9b14610e0a578063c3394bc614610e2a578063c791d96814610e4a578063c848d6c714610e7a578063cc328f1714610e9057600080fd5b8063accc1d5e14610d67578063b4387f7f14610d87578063b7bc15a214610d9a578063bb1e052814610db0578063bd85b03914610ddd57600080fd5b806395d89b41116101d2578063a4c2f65111610196578063a4c2f65114610cb7578063a5492f4414610cd7578063a684c47114610cf7578063a6d23e1014610d17578063abc7c86614610d3757600080fd5b806395d89b4114610c05578063a037cd5014610c1a578063a22cb46514610c47578063a2b7258514610c67578063a370c66814610c8757600080fd5b8063881773db11610219578063881773db14610b745780638c0163b714610b945780638da5cb5b14610ba75780638da754ea14610bc557806394357c2514610be557600080fd5b80637d929b4f14610ac75780637ffd97c114610ae757806383ca4b6f14610b075780638413c6c914610b27578063869f759414610b4757600080fd5b80633d7cc76e11610371578063644e54ab116102ee578063715018a6116102b2578063715018a614610a19578063743efaf014610a2e5780637696e08814610a4e57806376b1493514610a6e5780637ce8fab014610aa757600080fd5b8063644e54ab1461098357806368fd7eee146109995780636aec6a37146109b95780636c30a22f146109d95780636fad40d5146109f957600080fd5b80634f558e79116103355780634f558e79146108e657806352addee514610916578063531a0155146109365780635c975abb146109495780635fff9ad61461096357600080fd5b80633d7cc76e146108115780633e4a4e7714610831578063446f06171461085157806346873863146108815780634e1273f4146108b957600080fd5b80631aacb575116103ff578063239c70ae116103c3578063239c70ae146107795780632eb2c2d61461078f5780632ed6cd46146107af57806333ea51a8146107dc5780633ccfd60b146107fc57600080fd5b80631aacb575146106d45780631acff681146107045780631b5c9b4d146107195780631f7b4f3014610739578063220b6a0b1461075957600080fd5b80630e89341c116104465780630e89341c1461060457806314905abc1461062457806314bfd6d01461065c578063165da72a1461069457806318f19113146106b457600080fd5b8062fdd58e1461052457806301ffc9a714610557578063039af9eb1461058757806306fdde03146105c2578063088a4ed0146105e457600080fd5b3661051f57602a546001600160a01b03166104e35760405162461bcd60e51b815260206004820152601760248201527f5061796d656e742061646472657373206e6f742073657400000000000000000060448201526064015b60405180910390fd5b602a5460405134916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561051d573d6000803e3d6000fd5b005b600080fd5b34801561053057600080fd5b5061054461053f366004614b2a565b611065565b6040519081526020015b60405180910390f35b34801561056357600080fd5b50610577610572366004614b6a565b6110f9565b604051901515815260200161054e565b34801561059357600080fd5b506105a76105a2366004614b87565b611149565b6040805193845260208401929092529082015260600161054e565b3480156105ce57600080fd5b506105d761117c565b60405161054e9190614bf0565b3480156105f057600080fd5b5061051d6105ff366004614b87565b61120a565b34801561061057600080fd5b506105d761061f366004614b87565b611217565b34801561063057600080fd5b5061054461063f366004614b2a565b600c60209081526000928352604080842090915290825290205481565b34801561066857600080fd5b5061067c610677366004614b87565b61159a565b6040516001600160a01b03909116815260200161054e565b3480156106a057600080fd5b506105776106af366004614b87565b6115c4565b3480156106c057600080fd5b5061051d6106cf366004614cf2565b6116a2565b3480156106e057600080fd5b506105776106ef366004614b87565b60176020526000908152604090205460ff1681565b34801561071057600080fd5b506105d7611786565b34801561072557600080fd5b50610544610734366004614d71565b611793565b34801561074557600080fd5b506105d7610754366004614b87565b6117c5565b34801561076557600080fd5b5061051d610774366004614db2565b6117de565b34801561078557600080fd5b5061054460095481565b34801561079b57600080fd5b5061051d6107aa366004614e7e565b61193c565b3480156107bb57600080fd5b506105446107ca366004614b87565b60146020526000908152604090205481565b3480156107e857600080fd5b5061051d6107f7366004614f27565b6119f2565b34801561080857600080fd5b5061051d611a1c565b34801561081d57600080fd5b5061051d61082c366004614f42565b611b55565b34801561083d57600080fd5b5061051d61084c366004615006565b611cdc565b34801561085d57600080fd5b5061057761086c366004614b87565b602d6020526000908152604090205460ff1681565b34801561088d57600080fd5b5061054461089c366004614b2a565b602960209081526000928352604080842090915290825290205481565b3480156108c557600080fd5b506108d96108d436600461507d565b611daa565b60405161054e9190615182565b3480156108f257600080fd5b50610577610901366004614b87565b60009081526015602052604090205460ff1690565b34801561092257600080fd5b50610544610931366004614b87565b611ed3565b61051d6109443660046151e0565b611ef4565b34801561095557600080fd5b50600d546105779060ff1681565b34801561096f57600080fd5b5061054461097e366004615250565b61204c565b34801561098f57600080fd5b50610544600a5481565b3480156109a557600080fd5b506105776109b436600461528e565b6120bf565b3480156109c557600080fd5b5061051d6109d436600461528e565b6121a8565b3480156109e557600080fd5b5061051d6109f43660046152b0565b612205565b348015610a0557600080fd5b5061051d610a1436600461528e565b61222a565b348015610a2557600080fd5b5061051d612243565b348015610a3a57600080fd5b5061051d610a4936600461528e565b612257565b348015610a5a57600080fd5b5061051d610a6936600461528e565b612283565b348015610a7a57600080fd5b50610a8e610a893660046152dc565b6122be565b60408051921515835260ff90911660208301520161054e565b348015610ab357600080fd5b50610544610ac2366004614b87565b612375565b348015610ad357600080fd5b50610544610ae236600461528e565b612385565b348015610af357600080fd5b50610544610b0236600461528e565b6123b6565b348015610b1357600080fd5b5061051d610b22366004615327565b6123d2565b348015610b3357600080fd5b5061051d610b423660046152b0565b61245c565b348015610b5357600080fd5b50610544610b62366004614b87565b60136020526000908152604090205481565b348015610b8057600080fd5b5061051d610b8f366004615373565b6124c2565b61051d610ba23660046153ab565b61256a565b348015610bb357600080fd5b506003546001600160a01b031661067c565b348015610bd157600080fd5b5061051d610be0366004615412565b61272b565b348015610bf157600080fd5b50610544610c0036600461528e565b6129b3565b348015610c1157600080fd5b506105d76129cf565b348015610c2657600080fd5b50610544610c35366004614b87565b600b6020526000908152604090205481565b348015610c5357600080fd5b5061051d610c6236600461549d565b6129dc565b348015610c7357600080fd5b50610544610c82366004614b87565b6129e7565b348015610c9357600080fd5b50610577610ca2366004614b87565b602e6020526000908152604090205460ff1681565b348015610cc357600080fd5b5061051d610cd2366004614f27565b6129f7565b348015610ce357600080fd5b5061051d610cf236600461549d565b612a58565b348015610d0357600080fd5b50602b5461067c906001600160a01b031681565b348015610d2357600080fd5b50602a5461067c906001600160a01b031681565b348015610d4357600080fd5b50610577610d52366004614b87565b600e6020526000908152604090205460ff1681565b348015610d7357600080fd5b5061051d610d823660046154c9565b612ac2565b61051d610d9536600461550a565b612b21565b348015610da657600080fd5b5061054460075481565b348015610dbc57600080fd5b50610544610dcb366004614b87565b60256020526000908152604090205481565b348015610de957600080fd5b50610544610df8366004614b87565b60009081526012602052604090205490565b348015610e1657600080fd5b506105d7610e25366004614b87565b612e03565b348015610e3657600080fd5b5061051d610e45366004614b87565b612e2e565b348015610e5657600080fd5b50610577610e65366004614b87565b60266020526000908152604090205460ff1681565b348015610e8657600080fd5b5061054460105481565b348015610e9c57600080fd5b50610544610eab366004614b87565b601a6020526000908152604090205481565b348015610ec957600080fd5b50610544610ed836600461528e565b612e3b565b348015610ee957600080fd5b506105d7610ef8366004614b87565b612e57565b348015610f0957600080fd5b50610577610f18366004614f27565b602f6020526000908152604090205460ff1681565b348015610f3957600080fd5b50610544610f48366004614b87565b60246020526000908152604090205481565b348015610f6657600080fd5b5061051d610f75366004614d71565b612e67565b348015610f8657600080fd5b50610577610f953660046155a0565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b348015610fcf57600080fd5b50610577612ec6565b348015610fe457600080fd5b5061051d610ff33660046155d3565b612f73565b34801561100457600080fd5b5061051d611013366004614f27565b613029565b34801561102457600080fd5b5061051d611033366004615637565b6130a2565b34801561104457600080fd5b50610544611053366004614b87565b60196020526000908152604090205481565b60006001600160a01b0383166110d05760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084016104da565b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061112a57506001600160e01b031982166303a24d0760e21b145b806110f357506301ffc9a760e01b6001600160e01b03198316146110f3565b6027818154811061115957600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600480546111899061566e565b80601f01602080910402602001604051908101604052809291908181526020018280546111b59061566e565b80156112025780601f106111d757610100808354040283529160200191611202565b820191906000526020600020905b8154815290600101906020018083116111e557829003601f168201915b505050505081565b6112126130f5565b600955565b600081815260156020526040812054606091600191839060ff161561158d57600754851161158d57604080516000808252602080830180855283519020898352601190915290839020909261126c9201615715565b604051602081830303815290604052805190602001201461132857600085815260116020526040902080546112a09061566e565b80601f01602080910402602001604051908101604052809291908181526020018280546112cc9061566e565b80156113195780601f106112ee57610100808354040283529160200191611319565b820191906000526020600020905b8154815290600101906020018083116112fc57829003601f168201915b50505050509350505050919050565b60005b601f5481101561149457601f818154811061134857611348615721565b906000526020600020015486116114845760408051600081526020810191829052519020602180548390811061138057611380615721565b9060005260206000200160405160200161139a9190615715565b60405160208183030381529060405280519060200120146113fb57602181815481106113c8576113c8615721565b906000526020600020016040516020016113e29190615737565b6040516020818303038152906040529150809250611494565b60408051600081526020810191829052519020602280548390811061142257611422615721565b9060005260206000200160405160200161143c9190615715565b6040516020818303038152906040528051906020012014611484576022818154811061146a5761146a615721565b906000526020600020016040516020016113e29190615764565b61148d81615786565b905061132b565b50601f80546114a59060019061579f565b815481106114b5576114b5615721565b90600052602060002001548511156114cc57600092505b8280156114e7575060008281526026602052604090205460ff165b1561158d5760408051600080825260208083018085528351902089835260189091529083902090926115199201615715565b6040516020818303038152906040528051906020012003611568578061153e8661312e565b60405160200161154f9291906157b2565b6040516020818303038152906040529350505050919050565b806018600087815260200190815260200160002060405160200161154f9291906157f1565b600680546112a09061566e565b602c81815481106115aa57600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060005b601f548110156116895780158015906116005750601f81815481106115f1576115f1615721565b90600052602060002001548411155b80156116325750601f61161460018361579f565b8154811061162457611624615721565b906000526020600020015484115b1561163f57809150611689565b8015801561166a5750601f818154811061165b5761165b615721565b90600052602060002001548411155b1561167757809150611689565b8061168181615786565b9150506115ca565b506000908152602d602052604090205460ff1692915050565b6116aa6130f5565b821561173f57601f80546116c09060019061579f565b815481106116d0576116d0615721565b90600052602060002001548411156116fa5760405162461bcd60e51b81526004016104da90615826565b6000848152601d60209081526040909120835161171992850190614a3d565b506000848152601e60209081526040909120825161173992840190614a3d565b50611780565b6000848152601b60209081526040909120835161175e92850190614a3d565b506000848152601c60209081526040909120825161177e92840190614a3d565b505b50505050565b602880546111899061566e565b600081156117b057506000828152601460205260409020546110f3565b506000828152601360205260409020546110f3565b601860205260009081526040902080546111899061566e565b6117e66130f5565b6040805160608101825284815260208101849052908101829052851561189a576027805460018101825560009190915281517f98a476f1687bc3d60a2da2adbcba2c46958e61fa2fb4042cd7bc5816a710195b60039092029182015560208201517f98a476f1687bc3d60a2da2adbcba2c46958e61fa2fb4042cd7bc5816a710195c82015560408201517f98a476f1687bc3d60a2da2adbcba2c46958e61fa2fb4042cd7bc5816a710195d90910155611934565b602754158015906118af575060275460ff8616105b6118ed5760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a5908151a595c881251608a1b60448201526064016104da565b8060278660ff168154811061190457611904615721565b90600052602060002090600302016000820151816000015560208201518160010155604082015181600201559050505b505050505050565b6daaeb6d7670e522a718067333cd4e3b156119e557604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c6171134906044016020604051808303816000875af11580156119a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c69190615842565b6119e557604051633b79c77360e21b81523360048201526024016104da565b61177e85858585856131c0565b6119fa613205565b602a80546001600160a01b0319166001600160a01b0392909216919091179055565b611a246130f5565b602a546001600160a01b0316611a755760405162461bcd60e51b815260206004820152601660248201527514185e5bdd5d081859191c995cdcc81b9bdd081cd95d60521b60448201526064016104da565b4780611aba5760405162461bcd60e51b81526020600482015260146024820152734e6f2066756e647320746f20776974686472617760601b60448201526064016104da565b602a546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611b07576040519150601f19603f3d011682016040523d82523d6000602084013e611b0c565b606091505b5050905080611b515760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016104da565b5050565b611b5d6130f5565b8615611b76576006611b708385836158a5565b50611cd3565b8515611b89576028611b708385836158a5565b84611c73578015611c1a5760008383611ba18761312e565b604051602001611bb393929190615964565b60408051601f198184030181529181526000878152601160205220909150611bdb82826159b9565b50847f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b82604051611c0c9190614bf0565b60405180910390a250611cd3565b6000848152601160205260409020611c338385836158a5565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611c66929190615a78565b60405180910390a2611cd3565b8015611ca557828260218681548110611c8e57611c8e615721565b906000526020600020019182611b709291906158a5565b828260228681548110611cba57611cba615721565b906000526020600020019182611cd19291906158a5565b505b50505050505050565b611ce46130f5565b8015611d3b5781600081518110611cfd57611cfd615721565b60200260200101516014600085600081518110611d1c57611d1c615721565b6020026020010151815260200190815260200160002081905550505050565b60005b8351811015611780576000848281518110611d5b57611d5b615721565b60200260200101519050838281518110611d7757611d77615721565b6020908102919091018101516000928352601390915260409091205580611d9d81615786565b915050611d3e565b505050565b60608151835114611e0f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016104da565b600083516001600160401b03811115611e2a57611e2a614c1c565b604051908082528060200260200182016040528015611e53578160200160208202803683370190505b50905060005b8451811015611ecb57611e9e858281518110611e7757611e77615721565b6020026020010151858381518110611e9157611e91615721565b6020026020010151611065565b828281518110611eb057611eb0615721565b6020908102919091010152611ec481615786565b9050611e59565b509392505050565b601f8181548110611ee357600080fd5b600091825260209091200154905081565b60008381526016602052604090205460ff1615611f4b5760405162461bcd60e51b81526020600482015260156024820152742932b8bab4b932b99010b6b4b73a24b727b93232b960591b60448201526064016104da565b611f5585846120bf565b611f715760405162461bcd60e51b81526004016104da90615826565b611f7c85858561325f565b611f985760405162461bcd60e51b81526004016104da90615aa7565b611fa0612ec6565b61200257600d5460ff1615611fc75760405162461bcd60e51b81526004016104da90615ac6565b6000838152600e602052604090205460ff1615611ff65760405162461bcd60e51b81526004016104da90615ae6565b6120028484848461350e565b61200c858461378f565b6000858152601260205260408120805486929061202a908490615b0c565b92505081905550611934868686604051806020016040528060008152506138dc565b6000612056612ec6565b6120b457821561208f5760278260ff168154811061207657612076615721565b90600052602060002090600302016001015490506120b8565b602384815481106120a2576120a2615721565b906000526020600020015490506120b8565b5060005b9392505050565b601f5460009082106120fc5760405162461bcd60e51b815260206004820152600660248201526504284c2e8c6d60d31b60448201526064016104da565b81158015906121285750601f828154811061211957612119615721565b90600052602060002001548311155b801561215a5750601f61213c60018461579f565b8154811061214c5761214c615721565b906000526020600020015483115b15612167575060016110f3565b811580156121925750601f828154811061218357612183615721565b90600052602060002001548311155b1561219f575060016110f3565b50600092915050565b6121b06130f5565b4281116121f35760405162461bcd60e51b815260206004820152601160248201527011185d1948105b1c9958591e4814185cdd607a1b60448201526064016104da565b6000918252600f602052604090912055565b61220d6130f5565b600090815260246020908152604080832093909355602590522055565b6122326130f5565b6000908152600b6020526040902055565b61224b613205565b61225560006139cb565b565b61225f6130f5565b816020828154811061227357612273615721565b6000918252602090912001555050565b61228b6130f5565b816023828154811061229f5761229f615721565b6000918252602080832090910192909255918252602590526040902055565b6027546000908190156123665760005b60275460ff8216101561236457612342868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506027805490925060ff86169150811061232a5761232a615721565b90600052602060002090600302016002015486613a1d565b156123525760019250905061236d565b8061235c81615b1f565b9150506122ce565b505b5060009050805b935093915050565b60208181548110611ee357600080fd5b601d60205281600052604060002081815481106123a157600080fd5b90600052602060002001600091509150505481565b601e60205281600052604060002081815481106123a157600080fd5b60005b82518110156124505760008382815181106123f2576123f2615721565b6020026020010151905082828151811061240e5761240e615721565b6020026020010151601260008381526020019081526020016000206000828254612438919061579f565b909155506124499150829050615786565b90506123d5565b50611b51338383613a33565b6124646130f5565b818311156124a25760405162461bcd60e51b815260206004820152600b60248201526a4d494e203c3d204d41583f60a81b60448201526064016104da565b600090815260196020908152604080832094909455601a90529190912055565b6124ca6130f5565b826001036124f2576000908152602660205260409020805460ff191691151591909117905550565b8260020361251a576000908152601760205260409020805460ff191691151591909117905550565b82600303612542576000908152601660205260409020805460ff191691151591909117905550565b82600403611da5576000908152602d60205260409020805460ff191691151591909117905550565b60008381526016602052604090205460ff166125b65760405162461bcd60e51b815260206004820152600b60248201526a36b4b73a24b727b93232b960a91b60448201526064016104da565b6125ec601f84815481106125cc576125cc615721565b906000526020600020015460009081526015602052604090205460ff1690565b1561261f5760405162461bcd60e51b81526020600482015260036024820152624f4f5360e81b60448201526064016104da565b601f838154811061263257612632615721565b906000526020600020015460016020858154811061265257612652615721565b9060005260206000200154866126689190615b0c565b612672919061579f565b11156126b65760405162461bcd60e51b8152602060048201526013602482015272141b19585cd948131bddd95c88105b5bdd5b9d606a1b60448201526064016104da565b6126be612ec6565b61272057600d5460ff16156126e55760405162461bcd60e51b81526004016104da90615ac6565b6000838152600e602052604090205460ff16156127145760405162461bcd60e51b81526004016104da90615ae6565b6127208484848461350e565b61177e858585613c51565b6127336130f5565b601f80546127439060019061579f565b8154811061275357612753615721565b906000526020600020015485116127985760405162461bcd60e51b8152602060048201526009602482015268454944203e2050423f60b81b60448201526064016104da565b601f8054602091906127ac9060019061579f565b815481106127bc576127bc615721565b906000526020600020015460016127d39190615b0c565b81546001818101845560009384526020842090910191909155601f805491820181559091527fa03837a25210ee280c2113ff4b77ca23440b19d4866cca721c801278fd08d8070185905581156128b057602180546001810182556000919091527f3a6357012c1a3ae0a17d304c9920310382d968ebcc4b1771f41c6b304205b5700161285f84826159b9565b5060228054600181018255600091825260408051602081019091529182527f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e51001906128aa90826159b9565b50612939565b602280546001810182556000919091527f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e510016128ec84826159b9565b5060218054600181018255600091825260408051602081019091529182527f3a6357012c1a3ae0a17d304c9920310382d968ebcc4b1771f41c6b304205b570019061293790826159b9565b505b602380546001818101835560009283527fd57b2b5166478fd4318d2acc6cc2c704584312bdd8781b32d5d06abda57f4230909101869055601f5486926025929091612984919061579f565b8152602081019190915260400160002055801561177e5761177e6003600180601f80549050610b8f919061579f565b601b60205281600052604060002081815481106123a157600080fd5b600580546111899061566e565b611b51338383613df6565b60238181548110611ee357600080fd5b6003546001600160a01b0316331480612a1a5750602b546001600160a01b031633145b612a365760405162461bcd60e51b81526004016104da90615b3e565b602b80546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b0316331480612a7b5750602b546001600160a01b031633145b612a975760405162461bcd60e51b81526004016104da90615b3e565b6001600160a01b03919091166000908152602f60205260409020805460ff1916911515919091179055565b612aca6130f5565b6003546001600160a01b0316331480612aed5750602b546001600160a01b031633145b612b095760405162461bcd60e51b81526004016104da90615b3e565b612b15602c6000614a88565b611da5602c8383614aa6565b60008381526016602052604090205460ff1615612b785760405162461bcd60e51b81526020600482015260156024820152742932b8bab4b932b99010b6b4b73a24b727b93232b960591b60448201526064016104da565b60095485511115612bb45760405162461bcd60e51b81526004016104da9060208082526004908201526324a2399f60e11b604082015260600190565b8351855114612bf65760405162461bcd60e51b815260206004820152600e60248201526d49447320213d20416d6f756e747360901b60448201526064016104da565b612c01858585613ed6565b612c1d5760405162461bcd60e51b81526004016104da90615aa7565b6000805b8551811015612ca257612c4d878281518110612c3f57612c3f615721565b6020026020010151866120bf565b612c695760405162461bcd60e51b81526004016104da90615826565b858181518110612c7b57612c7b615721565b602002602001015182612c8e9190615b0c565b915080612c9a81615786565b915050612c21565b50600a54811115612cda5760405162461bcd60e51b81526020600482015260026024820152614c4560f01b60448201526064016104da565b612ce2612ec6565b612d4457600d5460ff1615612d095760405162461bcd60e51b81526004016104da90615ac6565b6000848152600e602052604090205460ff1615612d385760405162461bcd60e51b81526004016104da90615ae6565b612d448185858561350e565b60005b8651811015612de7576000878281518110612d6457612d64615721565b60200260200101519050612d78818761378f565b868281518110612d8a57612d8a615721565b6020026020010151601260008a8581518110612da857612da8615721565b602002602001015181526020019081526020016000206000828254612dcd9190615b0c565b90915550829150612ddf905081615786565b915050612d47565b50611cd387878760405180602001604052806000815250613f4f565b60228181548110612e1357600080fd5b9060005260206000200160009150905080546111899061566e565b612e366130f5565b600755565b601c60205281600052604060002081815481106123a157600080fd5b60218181548110612e1357600080fd5b6003546001600160a01b0316331480612e8a5750602b546001600160a01b031633145b612ea65760405162461bcd60e51b81526004016104da90615b3e565b6000918252602e6020526040909120805460ff1916911515919091179055565b6000612eda6003546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480612f035750602b546001600160a01b031633145b15612f0e5750600190565b602c5415612f6d5760005b602c54811015612f6b57602c8181548110612f3657612f36615721565b6000918252602090912001546001600160a01b03163303612f5957600191505090565b80612f6381615786565b915050612f19565b505b50600090565b6daaeb6d7670e522a718067333cd4e3b1561301c57604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c6171134906044016020604051808303816000875af1158015612fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ffd9190615842565b61301c57604051633b79c77360e21b81523360048201526024016104da565b61177e85858585856140b8565b613031613205565b6001600160a01b0381166130965760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104da565b61309f816139cb565b50565b6130aa6130f5565b82156130c557600d805482151560ff19909116179055505050565b6000828152600e60205260409020805482151560ff19909116179055505050565b6001600160a01b03163b151590565b6130fd612ec6565b6122555760405162461bcd60e51b8152602060048201526002602482015261214160f01b60448201526064016104da565b6060600061313b836140fd565b60010190506000816001600160401b0381111561315a5761315a614c1c565b6040519080825280601f01601f191660200182016040528015613184576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461318e57509392505050565b6001600160a01b0385163314806131dc57506131dc8533610f95565b6131f85760405162461bcd60e51b81526004016104da90615b5d565b61177e85858585856141d5565b6003546001600160a01b031633146122555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104da565b60008083116132955760405162461bcd60e51b8152602060048201526002602482015261214160f01b60448201526064016104da565b6009548311156132cd5760405162461bcd60e51b81526020600482015260036024820152624d4d4160e81b60448201526064016104da565b6007548411156133055760405162461bcd60e51b815260206004820152600360248201526208525160ea1b60448201526064016104da565b600084815260136020526040902054158015906133455750600084815260136020908152604080832054601290925290912054613343908590615b0c565b115b15613352575060006120b8565b600082815260146020526040902054158015906133955750600082815260146020908152604080832054878452601290925290912054613393908590615b0c565b115b156133a2575060006120b8565b6000848152601b60205260409020541561345b5760005b6000858152601b6020526040902054811015613459576000858152601b602052604081208054613405913391859081106133f5576133f5615721565b9060005260206000200154611065565b6000878152601c602052604090208054919250908390811061342957613429615721565b9060005260206000200154811015613446576000925050506120b8565b508061345181615786565b9150506133b9565b505b6000828152601d6020526040902054156135045760005b6000838152601d6020526040902054811015613502576000838152601d6020526040812080546134ae913391859081106133f5576133f5615721565b6000858152601e60205260409020805491925090839081106134d2576134d2615721565b90600052602060002001548110156134ef576000925050506120b8565b50806134fa81615786565b915050613472565b505b5060019392505050565b613516612ec6565b611780576000838152600f602052604090205415613571576000838152600f60205260409020544210156135715760405162461bcd60e51b8152602060048201526002602482015261085160f21b60448201526064016104da565b6000838152600b60205260409020541561361a576000838152600b6020908152604080832054338452600c8352818420878552909252909120546135b6908690615b0c565b11156135ea5760405162461bcd60e51b8152602060048201526003602482015262424c4560e81b60448201526064016104da565b336000908152600c6020908152604080832086845290915281208054869290613614908490615b0c565b90915550505b6040516bffffffffffffffffffffffff193360601b16602082015260009081906136609085908590603401604051602081830303815290604052805190602001206122be565b9150915081156137465760278160ff168154811061368057613680615721565b6000918252602090912060039091020154156137465760278160ff16815481106136ac576136ac615721565b6000918252602080832060039092029091015433835260298252604080842060ff861685529092529120546136e2908890615b0c565b1161371f5733600090815260296020908152604080832060ff8516845290915281208054889290613714908490615b0c565b909155506137469050565b60275461372e9060019061579f565b8160ff161015613746578061374281615b1f565b9150505b61375185838361204c565b61375b9087615bab565b3410156119345760405162461bcd60e51b8152602060048201526002602482015261243f60f01b60448201526064016104da565b60008281526015602052604090205460ff166137e7576000828152601560209081526040808320805460ff19166001179055838352601690915290205460ff16156137e7576000828152601260205260409020600190555b60008181526017602052604090205460ff16156138225761380781614385565b60008381526018602052604090209061382090826159b9565b505b600081815260256020526040902054602380548390811061384557613845615721565b90600052602060002001541415801561388e575060246000828152602001908152602001600020546020828154811061388057613880615721565b906000526020600020015410155b156138c35760008181526025602052604090205460238054839081106138b6576138b6615721565b6000918252602090912001555b601080549060006138d383615786565b91905055505050565b6001600160a01b0384166139025760405162461bcd60e51b81526004016104da90615bc2565b33600061390e8561444e565b9050600061391b8561444e565b905061392c83600089858589614499565b6000868152602081815260408083206001600160a01b038b1684529091528120805487929061395c908490615b0c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46139bc836000898585896145e5565b611cd383600089898989614670565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082613a2a85846147cb565b14949350505050565b6001600160a01b038316613a955760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016104da565b8051825114613ab65760405162461bcd60e51b81526004016104da90615c03565b6000339050613ad981856000868660405180602001604052806000815250614499565b60005b8351811015613bda576000848281518110613af957613af9615721565b602002602001015190506000848381518110613b1757613b17615721565b602090810291909101810151600084815280835260408082206001600160a01b038c168352909352919091205490915081811015613ba35760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016104da565b6000928352602083815260408085206001600160a01b038b1686529091529092209103905580613bd281615786565b915050613adc565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613c2b929190615c4b565b60405180910390a4611780818560008686604051806020016040528060008152506145e5565b6000826001600160401b03811115613c6b57613c6b614c1c565b604051908082528060200260200182016040528015613c94578160200160208202803683370190505b5090506000836001600160401b03811115613cb157613cb1614c1c565b604051908082528060200260200182016040528015613cda578160200160208202803683370190505b50905060005b84811015613dda57600060208581548110613cfd57613cfd615721565b90600052602060002001549050613d168160018761325f565b613d325760405162461bcd60e51b81526004016104da90615aa7565b613d3c818661378f565b60208581548110613d4f57613d4f615721565b9060005260206000200154848381518110613d6c57613d6c615721565b6020026020010181815250506001838381518110613d8c57613d8c615721565b60200260200101818152505060208581548110613dab57613dab615721565b60009182526020822001805491613dc183615786565b9190505550508080613dd290615786565b915050613ce0565b5061177e85838360405180602001604052806000815250613f4f565b816001600160a01b0316836001600160a01b031603613e695760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016104da565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000805b8451811015613502576000858281518110613ef757613ef7615721565b602002602001015190506000858381518110613f1557613f15615721565b60200260200101519050613f2a82828761325f565b613f3a57600093505050506120b8565b50508080613f4790615786565b915050613eda565b6001600160a01b038416613f755760405162461bcd60e51b81526004016104da90615bc2565b8151835114613f965760405162461bcd60e51b81526004016104da90615c03565b33613fa681600087878787614499565b60005b845181101561404157838181518110613fc457613fc4615721565b6020026020010151600080878481518110613fe157613fe1615721565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546140299190615b0c565b9091555081905061403981615786565b915050613fa9565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051614092929190615c4b565b60405180910390a46140a9816000878787876145e5565b61177e81600087878787614810565b6001600160a01b0385163314806140d457506140d48533610f95565b6140f05760405162461bcd60e51b81526004016104da90615b5d565b61177e85858585856148cb565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061413c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614168576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061418657662386f26fc10000830492506010015b6305f5e100831061419e576305f5e100830492506008015b61271083106141b257612710830492506004015b606483106141c4576064830492506002015b600a83106110f35760010192915050565b81518351146141f65760405162461bcd60e51b81526004016104da90615c03565b6001600160a01b03841661421c5760405162461bcd60e51b81526004016104da90615c79565b3361422b818787878787614499565b60005b845181101561431157600085828151811061424b5761424b615721565b60200260200101519050600085838151811061426957614269615721565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156142b95760405162461bcd60e51b81526004016104da90615cbe565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906142f6908490615b0c565b925050819055505050508061430a90615786565b905061422e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051614361929190615c4b565b60405180910390a46143778187878787876145e5565b611934818787878787614810565b6000818152601a602052604081205460105460609291904290449033906018866143b060018461579f565b81526020019081526020016000206040516020016143d2959493929190615d08565b6040516020818303038152906040528051906020012060001c6143f59190615d49565b60008481526019602052604090205490915081101561443a576120b861441c826001615b0c565b6000858152601a6020526040902054614435919061579f565b61312e565b6120b8614435826001615b0c565b50919050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061448857614488615721565b602090810291909101015292915050565b6001600160a01b0386166000908152602f602052604090205460ff161580156144db57506001600160a01b0385166000908152602f602052604090205460ff16155b801561450057506001600160a01b0384166000908152602f602052604090205460ff16155b6145605760405162461bcd60e51b815260206004820152602b60248201527f4f70657261746f722c2046726f6d2c206f7220546f204164647265737320697360448201526a08149154d5149250d5115160aa1b60648201526084016104da565b60005b8351811015611cd357602e600085838151811061458257614582615721565b60209081029190910181015182528101919091526040016000205460ff16156145d35760405162461bcd60e51b815260206004820152600360248201526211925160ea1b60448201526064016104da565b806145dd81615786565b915050614563565b60005b8351811015611cd35761461384828151811061460657614606615721565b60200260200101516115c4565b1561465e576001602e600086848151811061463057614630615721565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061466881615786565b9150506145e8565b6001600160a01b0384163b156119345760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906146b49089908990889088908890600401615d6b565b6020604051808303816000875af19250505080156146ef575060408051601f3d908101601f191682019092526146ec91810190615da5565b60015b61479b576146fb615dc2565b806308c379a003614734575061470f615dde565b8061471a5750614736565b8060405162461bcd60e51b81526004016104da9190614bf0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016104da565b6001600160e01b0319811663f23a6e6160e01b14611cd35760405162461bcd60e51b81526004016104da90615e67565b600081815b8451811015611ecb576147fc828683815181106147ef576147ef615721565b6020026020010151614a11565b91508061480881615786565b9150506147d0565b6001600160a01b0384163b156119345760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906148549089908990889088908890600401615eaf565b6020604051808303816000875af192505050801561488f575060408051601f3d908101601f1916820190925261488c91810190615da5565b60015b61489b576146fb615dc2565b6001600160e01b0319811663bc197c8160e01b14611cd35760405162461bcd60e51b81526004016104da90615e67565b6001600160a01b0384166148f15760405162461bcd60e51b81526004016104da90615c79565b3360006148fd8561444e565b9050600061490a8561444e565b905061491a838989858589614499565b6000868152602081815260408083206001600160a01b038c1684529091529020548581101561495b5760405162461bcd60e51b81526004016104da90615cbe565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290614998908490615b0c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46149f8848a8a86868a6145e5565b614a06848a8a8a8a8a614670565b505050505050505050565b6000818310614a2d5760008281526020849052604090206120b8565b5060009182526020526040902090565b828054828255906000526020600020908101928215614a78579160200282015b82811115614a78578251825591602001919060010190614a5d565b50614a84929150614af9565b5090565b508054600082559060005260206000209081019061309f9190614af9565b828054828255906000526020600020908101928215614a78579160200282015b82811115614a785781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614ac6565b5b80821115614a845760008155600101614afa565b80356001600160a01b0381168114614b2557600080fd5b919050565b60008060408385031215614b3d57600080fd5b614b4683614b0e565b946020939093013593505050565b6001600160e01b03198116811461309f57600080fd5b600060208284031215614b7c57600080fd5b81356120b881614b54565b600060208284031215614b9957600080fd5b5035919050565b60005b83811015614bbb578181015183820152602001614ba3565b50506000910152565b60008151808452614bdc816020860160208601614ba0565b601f01601f19169290920160200192915050565b6020815260006120b86020830184614bc4565b801515811461309f57600080fd5b8035614b2581614c03565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614c5757614c57614c1c565b6040525050565b60006001600160401b03821115614c7757614c77614c1c565b5060051b60200190565b600082601f830112614c9257600080fd5b81356020614c9f82614c5e565b604051614cac8282614c32565b83815260059390931b8501820192828101915086841115614ccc57600080fd5b8286015b84811015614ce75780358352918301918301614cd0565b509695505050505050565b60008060008060808587031215614d0857600080fd5b843593506020850135614d1a81614c03565b925060408501356001600160401b0380821115614d3657600080fd5b614d4288838901614c81565b93506060870135915080821115614d5857600080fd5b50614d6587828801614c81565b91505092959194509250565b60008060408385031215614d8457600080fd5b823591506020830135614d9681614c03565b809150509250929050565b803560ff81168114614b2557600080fd5b600080600080600060a08688031215614dca57600080fd5b8535614dd581614c03565b9450614de360208701614da1565b94979496505050506040830135926060810135926080909101359150565b60006001600160401b03831115614e1a57614e1a614c1c565b604051614e31601f8501601f191660200182614c32565b809150838152848484011115614e4657600080fd5b83836020830137600060208583010152509392505050565b600082601f830112614e6f57600080fd5b6120b883833560208501614e01565b600080600080600060a08688031215614e9657600080fd5b614e9f86614b0e565b9450614ead60208701614b0e565b935060408601356001600160401b0380821115614ec957600080fd5b614ed589838a01614c81565b94506060880135915080821115614eeb57600080fd5b614ef789838a01614c81565b93506080880135915080821115614f0d57600080fd5b50614f1a88828901614e5e565b9150509295509295909350565b600060208284031215614f3957600080fd5b6120b882614b0e565b600080600080600080600060c0888a031215614f5d57600080fd5b8735614f6881614c03565b96506020880135614f7881614c03565b95506040880135614f8881614c03565b94506060880135935060808801356001600160401b0380821115614fab57600080fd5b818a0191508a601f830112614fbf57600080fd5b813581811115614fce57600080fd5b8b6020828501011115614fe057600080fd5b602083019550809450505050614ff860a08901614c11565b905092959891949750929550565b60008060006060848603121561501b57600080fd5b83356001600160401b038082111561503257600080fd5b61503e87838801614c81565b9450602086013591508082111561505457600080fd5b5061506186828701614c81565b925050604084013561507281614c03565b809150509250925092565b6000806040838503121561509057600080fd5b82356001600160401b03808211156150a757600080fd5b818501915085601f8301126150bb57600080fd5b813560206150c882614c5e565b6040516150d58282614c32565b83815260059390931b85018201928281019150898411156150f557600080fd5b948201945b8386101561511a5761510b86614b0e565b825294820194908201906150fa565b9650508601359250508082111561513057600080fd5b5061513d85828601614c81565b9150509250929050565b600081518084526020808501945080840160005b838110156151775781518752958201959082019060010161515b565b509495945050505050565b6020815260006120b86020830184615147565b60008083601f8401126151a757600080fd5b5081356001600160401b038111156151be57600080fd5b6020830191508360208260051b85010111156151d957600080fd5b9250929050565b60008060008060008060a087890312156151f957600080fd5b61520287614b0e565b955060208701359450604087013593506060870135925060808701356001600160401b0381111561523257600080fd5b61523e89828a01615195565b979a9699509497509295939492505050565b60008060006060848603121561526557600080fd5b83359250602084013561527781614c03565b915061528560408501614da1565b90509250925092565b600080604083850312156152a157600080fd5b50508035926020909101359150565b6000806000606084860312156152c557600080fd5b505081359360208301359350604090920135919050565b6000806000604084860312156152f157600080fd5b83356001600160401b0381111561530757600080fd5b61531386828701615195565b909790965060209590950135949350505050565b6000806040838503121561533a57600080fd5b82356001600160401b038082111561535157600080fd5b61535d86838701614c81565b9350602085013591508082111561513057600080fd5b60008060006060848603121561538857600080fd5b83359250602084013561539a81614c03565b929592945050506040919091013590565b6000806000806000608086880312156153c357600080fd5b6153cc86614b0e565b9450602086013593506040860135925060608601356001600160401b038111156153f557600080fd5b61540188828901615195565b969995985093965092949392505050565b600080600080600060a0868803121561542a57600080fd5b853594506020860135935060408601356001600160401b0381111561544e57600080fd5b8601601f8101881361545f57600080fd5b61546e88823560208401614e01565b935050606086013561547f81614c03565b9150608086013561548f81614c03565b809150509295509295909350565b600080604083850312156154b057600080fd5b6154b983614b0e565b91506020830135614d9681614c03565b600080602083850312156154dc57600080fd5b82356001600160401b038111156154f257600080fd5b6154fe85828601615195565b90969095509350505050565b60008060008060008060a0878903121561552357600080fd5b61552c87614b0e565b955060208701356001600160401b038082111561554857600080fd5b6155548a838b01614c81565b9650604089013591508082111561556a57600080fd5b6155768a838b01614c81565b955060608901359450608089013591508082111561559357600080fd5b5061523e89828a01615195565b600080604083850312156155b357600080fd5b6155bc83614b0e565b91506155ca60208401614b0e565b90509250929050565b600080600080600060a086880312156155eb57600080fd5b6155f486614b0e565b945061560260208701614b0e565b9350604086013592506060860135915060808601356001600160401b0381111561562b57600080fd5b614f1a88828901614e5e565b60008060006060848603121561564c57600080fd5b833561565781614c03565b925060208401359150604084013561507281614c03565b600181811c9082168061568257607f821691505b60208210810361444857634e487b7160e01b600052602260045260246000fd5b600081546156af8161566e565b600182811680156156c757600181146156dc5761570b565b60ff198416875282151583028701945061570b565b8560005260208060002060005b858110156157025781548a8201529084019082016156e9565b50505082870194505b5050505092915050565b60006120b882846156a2565b634e487b7160e01b600052603260045260246000fd5b66697066733a2f2f60c81b8152600061575360078301846156a2565b602f60f81b81526001019392505050565b600061575382846156a2565b634e487b7160e01b600052601160045260246000fd5b60006001820161579857615798615770565b5060010190565b818103818111156110f3576110f3615770565b600083516157c4818460208801614ba0565b8351908301906157d8818360208801614ba0565b64173539b7b760d91b9101908152600501949350505050565b60008351615803818460208801614ba0565b61580f818401856156a2565b64173539b7b760d91b815260050195945050505050565b60208082526002908201526110a160f11b604082015260600190565b60006020828403121561585457600080fd5b81516120b881614c03565b601f821115611da557600081815260208120601f850160051c810160208610156158865750805b601f850160051c820191505b8181101561193457828155600101615892565b6001600160401b038311156158bc576158bc614c1c565b6158d0836158ca835461566e565b8361585f565b6000601f84116001811461590457600085156158ec5750838201355b600019600387901b1c1916600186901b17835561177e565b600083815260209020601f19861690835b828110156159355786850135825560209485019460019092019101615915565b50868210156159525760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b66697066733a2f2f60c81b8152828460078301376000838201602f60f81b6007820152835161599a816008840160208801614ba0565b64173539b7b760d91b60089290910191820152600d0195945050505050565b81516001600160401b038111156159d2576159d2614c1c565b6159e6816159e0845461566e565b8461585f565b602080601f831160018114615a1b5760008415615a035750858301515b600019600386901b1c1916600185901b178555611934565b600085815260208120601f198616915b82811015615a4a57888601518255948401946001909101908401615a2b565b5085821015615a685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602080825260059082015264085352539560da1b604082015260600190565b60208082526006908201526514185d5cd95960d21b604082015260600190565b6020808252600c908201526b0a0c2eae6cac84084c2e8c6d60a31b604082015260600190565b808201808211156110f3576110f3615770565b600060ff821660ff8103615b3557615b35615770565b60010192915050565b6020808252600590820152641393dbd41360da1b604082015260600190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b80820281158282048414176110f3576110f3615770565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b604081526000615c5e6040830185615147565b8281036020840152615c708185615147565b95945050505050565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b8581528460208201526bffffffffffffffffffffffff198460601b1660408201528260548201526000615d3e60748301846156a2565b979650505050505050565b600082615d6657634e487b7160e01b600052601260045260246000fd5b500690565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615d3e90830184614bc4565b600060208284031215615db757600080fd5b81516120b881614b54565b600060033d1115615ddb5760046000803e5060005160e01c5b90565b600060443d1015615dec5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615e1b57505050505090565b8285019150815181811115615e335750505050505090565b843d8701016020828501011115615e4d5750505050505090565b615e5c60208286010187614c32565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a060408201819052600090615edb90830186615147565b8281036060840152615eed8186615147565b90508281036080840152615f018185614bc4565b9897505050505050505056fea2646970667358221220aa098b51b5818d3c079d3ec2f8f982870b4cae665e6f5ab13e23827131e1003564736f6c63430008120033

Deployed Bytecode

0x6080604052600436106104815760003560e01c80637d929b4f11610255578063accc1d5e11610144578063d5cce904116100c1578063e985e9c511610085578063e985e9c514610f7a578063ed00e65314610fc3578063f242432a14610fd8578063f2fde38b14610ff8578063fc2f0fd814611018578063fda100e11461103857600080fd5b8063d5cce90414610ebd578063d6199f8d14610edd578063d8d9d6bc14610efd578063dc8519c114610f2d578063e5211d8b14610f5a57600080fd5b8063bff67e9b11610108578063bff67e9b14610e0a578063c3394bc614610e2a578063c791d96814610e4a578063c848d6c714610e7a578063cc328f1714610e9057600080fd5b8063accc1d5e14610d67578063b4387f7f14610d87578063b7bc15a214610d9a578063bb1e052814610db0578063bd85b03914610ddd57600080fd5b806395d89b41116101d2578063a4c2f65111610196578063a4c2f65114610cb7578063a5492f4414610cd7578063a684c47114610cf7578063a6d23e1014610d17578063abc7c86614610d3757600080fd5b806395d89b4114610c05578063a037cd5014610c1a578063a22cb46514610c47578063a2b7258514610c67578063a370c66814610c8757600080fd5b8063881773db11610219578063881773db14610b745780638c0163b714610b945780638da5cb5b14610ba75780638da754ea14610bc557806394357c2514610be557600080fd5b80637d929b4f14610ac75780637ffd97c114610ae757806383ca4b6f14610b075780638413c6c914610b27578063869f759414610b4757600080fd5b80633d7cc76e11610371578063644e54ab116102ee578063715018a6116102b2578063715018a614610a19578063743efaf014610a2e5780637696e08814610a4e57806376b1493514610a6e5780637ce8fab014610aa757600080fd5b8063644e54ab1461098357806368fd7eee146109995780636aec6a37146109b95780636c30a22f146109d95780636fad40d5146109f957600080fd5b80634f558e79116103355780634f558e79146108e657806352addee514610916578063531a0155146109365780635c975abb146109495780635fff9ad61461096357600080fd5b80633d7cc76e146108115780633e4a4e7714610831578063446f06171461085157806346873863146108815780634e1273f4146108b957600080fd5b80631aacb575116103ff578063239c70ae116103c3578063239c70ae146107795780632eb2c2d61461078f5780632ed6cd46146107af57806333ea51a8146107dc5780633ccfd60b146107fc57600080fd5b80631aacb575146106d45780631acff681146107045780631b5c9b4d146107195780631f7b4f3014610739578063220b6a0b1461075957600080fd5b80630e89341c116104465780630e89341c1461060457806314905abc1461062457806314bfd6d01461065c578063165da72a1461069457806318f19113146106b457600080fd5b8062fdd58e1461052457806301ffc9a714610557578063039af9eb1461058757806306fdde03146105c2578063088a4ed0146105e457600080fd5b3661051f57602a546001600160a01b03166104e35760405162461bcd60e51b815260206004820152601760248201527f5061796d656e742061646472657373206e6f742073657400000000000000000060448201526064015b60405180910390fd5b602a5460405134916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561051d573d6000803e3d6000fd5b005b600080fd5b34801561053057600080fd5b5061054461053f366004614b2a565b611065565b6040519081526020015b60405180910390f35b34801561056357600080fd5b50610577610572366004614b6a565b6110f9565b604051901515815260200161054e565b34801561059357600080fd5b506105a76105a2366004614b87565b611149565b6040805193845260208401929092529082015260600161054e565b3480156105ce57600080fd5b506105d761117c565b60405161054e9190614bf0565b3480156105f057600080fd5b5061051d6105ff366004614b87565b61120a565b34801561061057600080fd5b506105d761061f366004614b87565b611217565b34801561063057600080fd5b5061054461063f366004614b2a565b600c60209081526000928352604080842090915290825290205481565b34801561066857600080fd5b5061067c610677366004614b87565b61159a565b6040516001600160a01b03909116815260200161054e565b3480156106a057600080fd5b506105776106af366004614b87565b6115c4565b3480156106c057600080fd5b5061051d6106cf366004614cf2565b6116a2565b3480156106e057600080fd5b506105776106ef366004614b87565b60176020526000908152604090205460ff1681565b34801561071057600080fd5b506105d7611786565b34801561072557600080fd5b50610544610734366004614d71565b611793565b34801561074557600080fd5b506105d7610754366004614b87565b6117c5565b34801561076557600080fd5b5061051d610774366004614db2565b6117de565b34801561078557600080fd5b5061054460095481565b34801561079b57600080fd5b5061051d6107aa366004614e7e565b61193c565b3480156107bb57600080fd5b506105446107ca366004614b87565b60146020526000908152604090205481565b3480156107e857600080fd5b5061051d6107f7366004614f27565b6119f2565b34801561080857600080fd5b5061051d611a1c565b34801561081d57600080fd5b5061051d61082c366004614f42565b611b55565b34801561083d57600080fd5b5061051d61084c366004615006565b611cdc565b34801561085d57600080fd5b5061057761086c366004614b87565b602d6020526000908152604090205460ff1681565b34801561088d57600080fd5b5061054461089c366004614b2a565b602960209081526000928352604080842090915290825290205481565b3480156108c557600080fd5b506108d96108d436600461507d565b611daa565b60405161054e9190615182565b3480156108f257600080fd5b50610577610901366004614b87565b60009081526015602052604090205460ff1690565b34801561092257600080fd5b50610544610931366004614b87565b611ed3565b61051d6109443660046151e0565b611ef4565b34801561095557600080fd5b50600d546105779060ff1681565b34801561096f57600080fd5b5061054461097e366004615250565b61204c565b34801561098f57600080fd5b50610544600a5481565b3480156109a557600080fd5b506105776109b436600461528e565b6120bf565b3480156109c557600080fd5b5061051d6109d436600461528e565b6121a8565b3480156109e557600080fd5b5061051d6109f43660046152b0565b612205565b348015610a0557600080fd5b5061051d610a1436600461528e565b61222a565b348015610a2557600080fd5b5061051d612243565b348015610a3a57600080fd5b5061051d610a4936600461528e565b612257565b348015610a5a57600080fd5b5061051d610a6936600461528e565b612283565b348015610a7a57600080fd5b50610a8e610a893660046152dc565b6122be565b60408051921515835260ff90911660208301520161054e565b348015610ab357600080fd5b50610544610ac2366004614b87565b612375565b348015610ad357600080fd5b50610544610ae236600461528e565b612385565b348015610af357600080fd5b50610544610b0236600461528e565b6123b6565b348015610b1357600080fd5b5061051d610b22366004615327565b6123d2565b348015610b3357600080fd5b5061051d610b423660046152b0565b61245c565b348015610b5357600080fd5b50610544610b62366004614b87565b60136020526000908152604090205481565b348015610b8057600080fd5b5061051d610b8f366004615373565b6124c2565b61051d610ba23660046153ab565b61256a565b348015610bb357600080fd5b506003546001600160a01b031661067c565b348015610bd157600080fd5b5061051d610be0366004615412565b61272b565b348015610bf157600080fd5b50610544610c0036600461528e565b6129b3565b348015610c1157600080fd5b506105d76129cf565b348015610c2657600080fd5b50610544610c35366004614b87565b600b6020526000908152604090205481565b348015610c5357600080fd5b5061051d610c6236600461549d565b6129dc565b348015610c7357600080fd5b50610544610c82366004614b87565b6129e7565b348015610c9357600080fd5b50610577610ca2366004614b87565b602e6020526000908152604090205460ff1681565b348015610cc357600080fd5b5061051d610cd2366004614f27565b6129f7565b348015610ce357600080fd5b5061051d610cf236600461549d565b612a58565b348015610d0357600080fd5b50602b5461067c906001600160a01b031681565b348015610d2357600080fd5b50602a5461067c906001600160a01b031681565b348015610d4357600080fd5b50610577610d52366004614b87565b600e6020526000908152604090205460ff1681565b348015610d7357600080fd5b5061051d610d823660046154c9565b612ac2565b61051d610d9536600461550a565b612b21565b348015610da657600080fd5b5061054460075481565b348015610dbc57600080fd5b50610544610dcb366004614b87565b60256020526000908152604090205481565b348015610de957600080fd5b50610544610df8366004614b87565b60009081526012602052604090205490565b348015610e1657600080fd5b506105d7610e25366004614b87565b612e03565b348015610e3657600080fd5b5061051d610e45366004614b87565b612e2e565b348015610e5657600080fd5b50610577610e65366004614b87565b60266020526000908152604090205460ff1681565b348015610e8657600080fd5b5061054460105481565b348015610e9c57600080fd5b50610544610eab366004614b87565b601a6020526000908152604090205481565b348015610ec957600080fd5b50610544610ed836600461528e565b612e3b565b348015610ee957600080fd5b506105d7610ef8366004614b87565b612e57565b348015610f0957600080fd5b50610577610f18366004614f27565b602f6020526000908152604090205460ff1681565b348015610f3957600080fd5b50610544610f48366004614b87565b60246020526000908152604090205481565b348015610f6657600080fd5b5061051d610f75366004614d71565b612e67565b348015610f8657600080fd5b50610577610f953660046155a0565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b348015610fcf57600080fd5b50610577612ec6565b348015610fe457600080fd5b5061051d610ff33660046155d3565b612f73565b34801561100457600080fd5b5061051d611013366004614f27565b613029565b34801561102457600080fd5b5061051d611033366004615637565b6130a2565b34801561104457600080fd5b50610544611053366004614b87565b60196020526000908152604090205481565b60006001600160a01b0383166110d05760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084016104da565b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061112a57506001600160e01b031982166303a24d0760e21b145b806110f357506301ffc9a760e01b6001600160e01b03198316146110f3565b6027818154811061115957600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600480546111899061566e565b80601f01602080910402602001604051908101604052809291908181526020018280546111b59061566e565b80156112025780601f106111d757610100808354040283529160200191611202565b820191906000526020600020905b8154815290600101906020018083116111e557829003601f168201915b505050505081565b6112126130f5565b600955565b600081815260156020526040812054606091600191839060ff161561158d57600754851161158d57604080516000808252602080830180855283519020898352601190915290839020909261126c9201615715565b604051602081830303815290604052805190602001201461132857600085815260116020526040902080546112a09061566e565b80601f01602080910402602001604051908101604052809291908181526020018280546112cc9061566e565b80156113195780601f106112ee57610100808354040283529160200191611319565b820191906000526020600020905b8154815290600101906020018083116112fc57829003601f168201915b50505050509350505050919050565b60005b601f5481101561149457601f818154811061134857611348615721565b906000526020600020015486116114845760408051600081526020810191829052519020602180548390811061138057611380615721565b9060005260206000200160405160200161139a9190615715565b60405160208183030381529060405280519060200120146113fb57602181815481106113c8576113c8615721565b906000526020600020016040516020016113e29190615737565b6040516020818303038152906040529150809250611494565b60408051600081526020810191829052519020602280548390811061142257611422615721565b9060005260206000200160405160200161143c9190615715565b6040516020818303038152906040528051906020012014611484576022818154811061146a5761146a615721565b906000526020600020016040516020016113e29190615764565b61148d81615786565b905061132b565b50601f80546114a59060019061579f565b815481106114b5576114b5615721565b90600052602060002001548511156114cc57600092505b8280156114e7575060008281526026602052604090205460ff165b1561158d5760408051600080825260208083018085528351902089835260189091529083902090926115199201615715565b6040516020818303038152906040528051906020012003611568578061153e8661312e565b60405160200161154f9291906157b2565b6040516020818303038152906040529350505050919050565b806018600087815260200190815260200160002060405160200161154f9291906157f1565b600680546112a09061566e565b602c81815481106115aa57600080fd5b6000918252602090912001546001600160a01b0316905081565b60008060005b601f548110156116895780158015906116005750601f81815481106115f1576115f1615721565b90600052602060002001548411155b80156116325750601f61161460018361579f565b8154811061162457611624615721565b906000526020600020015484115b1561163f57809150611689565b8015801561166a5750601f818154811061165b5761165b615721565b90600052602060002001548411155b1561167757809150611689565b8061168181615786565b9150506115ca565b506000908152602d602052604090205460ff1692915050565b6116aa6130f5565b821561173f57601f80546116c09060019061579f565b815481106116d0576116d0615721565b90600052602060002001548411156116fa5760405162461bcd60e51b81526004016104da90615826565b6000848152601d60209081526040909120835161171992850190614a3d565b506000848152601e60209081526040909120825161173992840190614a3d565b50611780565b6000848152601b60209081526040909120835161175e92850190614a3d565b506000848152601c60209081526040909120825161177e92840190614a3d565b505b50505050565b602880546111899061566e565b600081156117b057506000828152601460205260409020546110f3565b506000828152601360205260409020546110f3565b601860205260009081526040902080546111899061566e565b6117e66130f5565b6040805160608101825284815260208101849052908101829052851561189a576027805460018101825560009190915281517f98a476f1687bc3d60a2da2adbcba2c46958e61fa2fb4042cd7bc5816a710195b60039092029182015560208201517f98a476f1687bc3d60a2da2adbcba2c46958e61fa2fb4042cd7bc5816a710195c82015560408201517f98a476f1687bc3d60a2da2adbcba2c46958e61fa2fb4042cd7bc5816a710195d90910155611934565b602754158015906118af575060275460ff8616105b6118ed5760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a5908151a595c881251608a1b60448201526064016104da565b8060278660ff168154811061190457611904615721565b90600052602060002090600302016000820151816000015560208201518160010155604082015181600201559050505b505050505050565b6daaeb6d7670e522a718067333cd4e3b156119e557604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c6171134906044016020604051808303816000875af11580156119a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119c69190615842565b6119e557604051633b79c77360e21b81523360048201526024016104da565b61177e85858585856131c0565b6119fa613205565b602a80546001600160a01b0319166001600160a01b0392909216919091179055565b611a246130f5565b602a546001600160a01b0316611a755760405162461bcd60e51b815260206004820152601660248201527514185e5bdd5d081859191c995cdcc81b9bdd081cd95d60521b60448201526064016104da565b4780611aba5760405162461bcd60e51b81526020600482015260146024820152734e6f2066756e647320746f20776974686472617760601b60448201526064016104da565b602a546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611b07576040519150601f19603f3d011682016040523d82523d6000602084013e611b0c565b606091505b5050905080611b515760405162461bcd60e51b815260206004820152601160248201527015da5d1a191c985dd85b0819985a5b1959607a1b60448201526064016104da565b5050565b611b5d6130f5565b8615611b76576006611b708385836158a5565b50611cd3565b8515611b89576028611b708385836158a5565b84611c73578015611c1a5760008383611ba18761312e565b604051602001611bb393929190615964565b60408051601f198184030181529181526000878152601160205220909150611bdb82826159b9565b50847f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b82604051611c0c9190614bf0565b60405180910390a250611cd3565b6000848152601160205260409020611c338385836158a5565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611c66929190615a78565b60405180910390a2611cd3565b8015611ca557828260218681548110611c8e57611c8e615721565b906000526020600020019182611b709291906158a5565b828260228681548110611cba57611cba615721565b906000526020600020019182611cd19291906158a5565b505b50505050505050565b611ce46130f5565b8015611d3b5781600081518110611cfd57611cfd615721565b60200260200101516014600085600081518110611d1c57611d1c615721565b6020026020010151815260200190815260200160002081905550505050565b60005b8351811015611780576000848281518110611d5b57611d5b615721565b60200260200101519050838281518110611d7757611d77615721565b6020908102919091018101516000928352601390915260409091205580611d9d81615786565b915050611d3e565b505050565b60608151835114611e0f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016104da565b600083516001600160401b03811115611e2a57611e2a614c1c565b604051908082528060200260200182016040528015611e53578160200160208202803683370190505b50905060005b8451811015611ecb57611e9e858281518110611e7757611e77615721565b6020026020010151858381518110611e9157611e91615721565b6020026020010151611065565b828281518110611eb057611eb0615721565b6020908102919091010152611ec481615786565b9050611e59565b509392505050565b601f8181548110611ee357600080fd5b600091825260209091200154905081565b60008381526016602052604090205460ff1615611f4b5760405162461bcd60e51b81526020600482015260156024820152742932b8bab4b932b99010b6b4b73a24b727b93232b960591b60448201526064016104da565b611f5585846120bf565b611f715760405162461bcd60e51b81526004016104da90615826565b611f7c85858561325f565b611f985760405162461bcd60e51b81526004016104da90615aa7565b611fa0612ec6565b61200257600d5460ff1615611fc75760405162461bcd60e51b81526004016104da90615ac6565b6000838152600e602052604090205460ff1615611ff65760405162461bcd60e51b81526004016104da90615ae6565b6120028484848461350e565b61200c858461378f565b6000858152601260205260408120805486929061202a908490615b0c565b92505081905550611934868686604051806020016040528060008152506138dc565b6000612056612ec6565b6120b457821561208f5760278260ff168154811061207657612076615721565b90600052602060002090600302016001015490506120b8565b602384815481106120a2576120a2615721565b906000526020600020015490506120b8565b5060005b9392505050565b601f5460009082106120fc5760405162461bcd60e51b815260206004820152600660248201526504284c2e8c6d60d31b60448201526064016104da565b81158015906121285750601f828154811061211957612119615721565b90600052602060002001548311155b801561215a5750601f61213c60018461579f565b8154811061214c5761214c615721565b906000526020600020015483115b15612167575060016110f3565b811580156121925750601f828154811061218357612183615721565b90600052602060002001548311155b1561219f575060016110f3565b50600092915050565b6121b06130f5565b4281116121f35760405162461bcd60e51b815260206004820152601160248201527011185d1948105b1c9958591e4814185cdd607a1b60448201526064016104da565b6000918252600f602052604090912055565b61220d6130f5565b600090815260246020908152604080832093909355602590522055565b6122326130f5565b6000908152600b6020526040902055565b61224b613205565b61225560006139cb565b565b61225f6130f5565b816020828154811061227357612273615721565b6000918252602090912001555050565b61228b6130f5565b816023828154811061229f5761229f615721565b6000918252602080832090910192909255918252602590526040902055565b6027546000908190156123665760005b60275460ff8216101561236457612342868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506027805490925060ff86169150811061232a5761232a615721565b90600052602060002090600302016002015486613a1d565b156123525760019250905061236d565b8061235c81615b1f565b9150506122ce565b505b5060009050805b935093915050565b60208181548110611ee357600080fd5b601d60205281600052604060002081815481106123a157600080fd5b90600052602060002001600091509150505481565b601e60205281600052604060002081815481106123a157600080fd5b60005b82518110156124505760008382815181106123f2576123f2615721565b6020026020010151905082828151811061240e5761240e615721565b6020026020010151601260008381526020019081526020016000206000828254612438919061579f565b909155506124499150829050615786565b90506123d5565b50611b51338383613a33565b6124646130f5565b818311156124a25760405162461bcd60e51b815260206004820152600b60248201526a4d494e203c3d204d41583f60a81b60448201526064016104da565b600090815260196020908152604080832094909455601a90529190912055565b6124ca6130f5565b826001036124f2576000908152602660205260409020805460ff191691151591909117905550565b8260020361251a576000908152601760205260409020805460ff191691151591909117905550565b82600303612542576000908152601660205260409020805460ff191691151591909117905550565b82600403611da5576000908152602d60205260409020805460ff191691151591909117905550565b60008381526016602052604090205460ff166125b65760405162461bcd60e51b815260206004820152600b60248201526a36b4b73a24b727b93232b960a91b60448201526064016104da565b6125ec601f84815481106125cc576125cc615721565b906000526020600020015460009081526015602052604090205460ff1690565b1561261f5760405162461bcd60e51b81526020600482015260036024820152624f4f5360e81b60448201526064016104da565b601f838154811061263257612632615721565b906000526020600020015460016020858154811061265257612652615721565b9060005260206000200154866126689190615b0c565b612672919061579f565b11156126b65760405162461bcd60e51b8152602060048201526013602482015272141b19585cd948131bddd95c88105b5bdd5b9d606a1b60448201526064016104da565b6126be612ec6565b61272057600d5460ff16156126e55760405162461bcd60e51b81526004016104da90615ac6565b6000838152600e602052604090205460ff16156127145760405162461bcd60e51b81526004016104da90615ae6565b6127208484848461350e565b61177e858585613c51565b6127336130f5565b601f80546127439060019061579f565b8154811061275357612753615721565b906000526020600020015485116127985760405162461bcd60e51b8152602060048201526009602482015268454944203e2050423f60b81b60448201526064016104da565b601f8054602091906127ac9060019061579f565b815481106127bc576127bc615721565b906000526020600020015460016127d39190615b0c565b81546001818101845560009384526020842090910191909155601f805491820181559091527fa03837a25210ee280c2113ff4b77ca23440b19d4866cca721c801278fd08d8070185905581156128b057602180546001810182556000919091527f3a6357012c1a3ae0a17d304c9920310382d968ebcc4b1771f41c6b304205b5700161285f84826159b9565b5060228054600181018255600091825260408051602081019091529182527f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e51001906128aa90826159b9565b50612939565b602280546001810182556000919091527f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e510016128ec84826159b9565b5060218054600181018255600091825260408051602081019091529182527f3a6357012c1a3ae0a17d304c9920310382d968ebcc4b1771f41c6b304205b570019061293790826159b9565b505b602380546001818101835560009283527fd57b2b5166478fd4318d2acc6cc2c704584312bdd8781b32d5d06abda57f4230909101869055601f5486926025929091612984919061579f565b8152602081019190915260400160002055801561177e5761177e6003600180601f80549050610b8f919061579f565b601b60205281600052604060002081815481106123a157600080fd5b600580546111899061566e565b611b51338383613df6565b60238181548110611ee357600080fd5b6003546001600160a01b0316331480612a1a5750602b546001600160a01b031633145b612a365760405162461bcd60e51b81526004016104da90615b3e565b602b80546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b0316331480612a7b5750602b546001600160a01b031633145b612a975760405162461bcd60e51b81526004016104da90615b3e565b6001600160a01b03919091166000908152602f60205260409020805460ff1916911515919091179055565b612aca6130f5565b6003546001600160a01b0316331480612aed5750602b546001600160a01b031633145b612b095760405162461bcd60e51b81526004016104da90615b3e565b612b15602c6000614a88565b611da5602c8383614aa6565b60008381526016602052604090205460ff1615612b785760405162461bcd60e51b81526020600482015260156024820152742932b8bab4b932b99010b6b4b73a24b727b93232b960591b60448201526064016104da565b60095485511115612bb45760405162461bcd60e51b81526004016104da9060208082526004908201526324a2399f60e11b604082015260600190565b8351855114612bf65760405162461bcd60e51b815260206004820152600e60248201526d49447320213d20416d6f756e747360901b60448201526064016104da565b612c01858585613ed6565b612c1d5760405162461bcd60e51b81526004016104da90615aa7565b6000805b8551811015612ca257612c4d878281518110612c3f57612c3f615721565b6020026020010151866120bf565b612c695760405162461bcd60e51b81526004016104da90615826565b858181518110612c7b57612c7b615721565b602002602001015182612c8e9190615b0c565b915080612c9a81615786565b915050612c21565b50600a54811115612cda5760405162461bcd60e51b81526020600482015260026024820152614c4560f01b60448201526064016104da565b612ce2612ec6565b612d4457600d5460ff1615612d095760405162461bcd60e51b81526004016104da90615ac6565b6000848152600e602052604090205460ff1615612d385760405162461bcd60e51b81526004016104da90615ae6565b612d448185858561350e565b60005b8651811015612de7576000878281518110612d6457612d64615721565b60200260200101519050612d78818761378f565b868281518110612d8a57612d8a615721565b6020026020010151601260008a8581518110612da857612da8615721565b602002602001015181526020019081526020016000206000828254612dcd9190615b0c565b90915550829150612ddf905081615786565b915050612d47565b50611cd387878760405180602001604052806000815250613f4f565b60228181548110612e1357600080fd5b9060005260206000200160009150905080546111899061566e565b612e366130f5565b600755565b601c60205281600052604060002081815481106123a157600080fd5b60218181548110612e1357600080fd5b6003546001600160a01b0316331480612e8a5750602b546001600160a01b031633145b612ea65760405162461bcd60e51b81526004016104da90615b3e565b6000918252602e6020526040909120805460ff1916911515919091179055565b6000612eda6003546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480612f035750602b546001600160a01b031633145b15612f0e5750600190565b602c5415612f6d5760005b602c54811015612f6b57602c8181548110612f3657612f36615721565b6000918252602090912001546001600160a01b03163303612f5957600191505090565b80612f6381615786565b915050612f19565b505b50600090565b6daaeb6d7670e522a718067333cd4e3b1561301c57604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c6171134906044016020604051808303816000875af1158015612fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ffd9190615842565b61301c57604051633b79c77360e21b81523360048201526024016104da565b61177e85858585856140b8565b613031613205565b6001600160a01b0381166130965760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104da565b61309f816139cb565b50565b6130aa6130f5565b82156130c557600d805482151560ff19909116179055505050565b6000828152600e60205260409020805482151560ff19909116179055505050565b6001600160a01b03163b151590565b6130fd612ec6565b6122555760405162461bcd60e51b8152602060048201526002602482015261214160f01b60448201526064016104da565b6060600061313b836140fd565b60010190506000816001600160401b0381111561315a5761315a614c1c565b6040519080825280601f01601f191660200182016040528015613184576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461318e57509392505050565b6001600160a01b0385163314806131dc57506131dc8533610f95565b6131f85760405162461bcd60e51b81526004016104da90615b5d565b61177e85858585856141d5565b6003546001600160a01b031633146122555760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104da565b60008083116132955760405162461bcd60e51b8152602060048201526002602482015261214160f01b60448201526064016104da565b6009548311156132cd5760405162461bcd60e51b81526020600482015260036024820152624d4d4160e81b60448201526064016104da565b6007548411156133055760405162461bcd60e51b815260206004820152600360248201526208525160ea1b60448201526064016104da565b600084815260136020526040902054158015906133455750600084815260136020908152604080832054601290925290912054613343908590615b0c565b115b15613352575060006120b8565b600082815260146020526040902054158015906133955750600082815260146020908152604080832054878452601290925290912054613393908590615b0c565b115b156133a2575060006120b8565b6000848152601b60205260409020541561345b5760005b6000858152601b6020526040902054811015613459576000858152601b602052604081208054613405913391859081106133f5576133f5615721565b9060005260206000200154611065565b6000878152601c602052604090208054919250908390811061342957613429615721565b9060005260206000200154811015613446576000925050506120b8565b508061345181615786565b9150506133b9565b505b6000828152601d6020526040902054156135045760005b6000838152601d6020526040902054811015613502576000838152601d6020526040812080546134ae913391859081106133f5576133f5615721565b6000858152601e60205260409020805491925090839081106134d2576134d2615721565b90600052602060002001548110156134ef576000925050506120b8565b50806134fa81615786565b915050613472565b505b5060019392505050565b613516612ec6565b611780576000838152600f602052604090205415613571576000838152600f60205260409020544210156135715760405162461bcd60e51b8152602060048201526002602482015261085160f21b60448201526064016104da565b6000838152600b60205260409020541561361a576000838152600b6020908152604080832054338452600c8352818420878552909252909120546135b6908690615b0c565b11156135ea5760405162461bcd60e51b8152602060048201526003602482015262424c4560e81b60448201526064016104da565b336000908152600c6020908152604080832086845290915281208054869290613614908490615b0c565b90915550505b6040516bffffffffffffffffffffffff193360601b16602082015260009081906136609085908590603401604051602081830303815290604052805190602001206122be565b9150915081156137465760278160ff168154811061368057613680615721565b6000918252602090912060039091020154156137465760278160ff16815481106136ac576136ac615721565b6000918252602080832060039092029091015433835260298252604080842060ff861685529092529120546136e2908890615b0c565b1161371f5733600090815260296020908152604080832060ff8516845290915281208054889290613714908490615b0c565b909155506137469050565b60275461372e9060019061579f565b8160ff161015613746578061374281615b1f565b9150505b61375185838361204c565b61375b9087615bab565b3410156119345760405162461bcd60e51b8152602060048201526002602482015261243f60f01b60448201526064016104da565b60008281526015602052604090205460ff166137e7576000828152601560209081526040808320805460ff19166001179055838352601690915290205460ff16156137e7576000828152601260205260409020600190555b60008181526017602052604090205460ff16156138225761380781614385565b60008381526018602052604090209061382090826159b9565b505b600081815260256020526040902054602380548390811061384557613845615721565b90600052602060002001541415801561388e575060246000828152602001908152602001600020546020828154811061388057613880615721565b906000526020600020015410155b156138c35760008181526025602052604090205460238054839081106138b6576138b6615721565b6000918252602090912001555b601080549060006138d383615786565b91905055505050565b6001600160a01b0384166139025760405162461bcd60e51b81526004016104da90615bc2565b33600061390e8561444e565b9050600061391b8561444e565b905061392c83600089858589614499565b6000868152602081815260408083206001600160a01b038b1684529091528120805487929061395c908490615b0c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46139bc836000898585896145e5565b611cd383600089898989614670565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600082613a2a85846147cb565b14949350505050565b6001600160a01b038316613a955760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016104da565b8051825114613ab65760405162461bcd60e51b81526004016104da90615c03565b6000339050613ad981856000868660405180602001604052806000815250614499565b60005b8351811015613bda576000848281518110613af957613af9615721565b602002602001015190506000848381518110613b1757613b17615721565b602090810291909101810151600084815280835260408082206001600160a01b038c168352909352919091205490915081811015613ba35760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016104da565b6000928352602083815260408085206001600160a01b038b1686529091529092209103905580613bd281615786565b915050613adc565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613c2b929190615c4b565b60405180910390a4611780818560008686604051806020016040528060008152506145e5565b6000826001600160401b03811115613c6b57613c6b614c1c565b604051908082528060200260200182016040528015613c94578160200160208202803683370190505b5090506000836001600160401b03811115613cb157613cb1614c1c565b604051908082528060200260200182016040528015613cda578160200160208202803683370190505b50905060005b84811015613dda57600060208581548110613cfd57613cfd615721565b90600052602060002001549050613d168160018761325f565b613d325760405162461bcd60e51b81526004016104da90615aa7565b613d3c818661378f565b60208581548110613d4f57613d4f615721565b9060005260206000200154848381518110613d6c57613d6c615721565b6020026020010181815250506001838381518110613d8c57613d8c615721565b60200260200101818152505060208581548110613dab57613dab615721565b60009182526020822001805491613dc183615786565b9190505550508080613dd290615786565b915050613ce0565b5061177e85838360405180602001604052806000815250613f4f565b816001600160a01b0316836001600160a01b031603613e695760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016104da565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000805b8451811015613502576000858281518110613ef757613ef7615721565b602002602001015190506000858381518110613f1557613f15615721565b60200260200101519050613f2a82828761325f565b613f3a57600093505050506120b8565b50508080613f4790615786565b915050613eda565b6001600160a01b038416613f755760405162461bcd60e51b81526004016104da90615bc2565b8151835114613f965760405162461bcd60e51b81526004016104da90615c03565b33613fa681600087878787614499565b60005b845181101561404157838181518110613fc457613fc4615721565b6020026020010151600080878481518110613fe157613fe1615721565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546140299190615b0c565b9091555081905061403981615786565b915050613fa9565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051614092929190615c4b565b60405180910390a46140a9816000878787876145e5565b61177e81600087878787614810565b6001600160a01b0385163314806140d457506140d48533610f95565b6140f05760405162461bcd60e51b81526004016104da90615b5d565b61177e85858585856148cb565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061413c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614168576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061418657662386f26fc10000830492506010015b6305f5e100831061419e576305f5e100830492506008015b61271083106141b257612710830492506004015b606483106141c4576064830492506002015b600a83106110f35760010192915050565b81518351146141f65760405162461bcd60e51b81526004016104da90615c03565b6001600160a01b03841661421c5760405162461bcd60e51b81526004016104da90615c79565b3361422b818787878787614499565b60005b845181101561431157600085828151811061424b5761424b615721565b60200260200101519050600085838151811061426957614269615721565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156142b95760405162461bcd60e51b81526004016104da90615cbe565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906142f6908490615b0c565b925050819055505050508061430a90615786565b905061422e565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051614361929190615c4b565b60405180910390a46143778187878787876145e5565b611934818787878787614810565b6000818152601a602052604081205460105460609291904290449033906018866143b060018461579f565b81526020019081526020016000206040516020016143d2959493929190615d08565b6040516020818303038152906040528051906020012060001c6143f59190615d49565b60008481526019602052604090205490915081101561443a576120b861441c826001615b0c565b6000858152601a6020526040902054614435919061579f565b61312e565b6120b8614435826001615b0c565b50919050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061448857614488615721565b602090810291909101015292915050565b6001600160a01b0386166000908152602f602052604090205460ff161580156144db57506001600160a01b0385166000908152602f602052604090205460ff16155b801561450057506001600160a01b0384166000908152602f602052604090205460ff16155b6145605760405162461bcd60e51b815260206004820152602b60248201527f4f70657261746f722c2046726f6d2c206f7220546f204164647265737320697360448201526a08149154d5149250d5115160aa1b60648201526084016104da565b60005b8351811015611cd357602e600085838151811061458257614582615721565b60209081029190910181015182528101919091526040016000205460ff16156145d35760405162461bcd60e51b815260206004820152600360248201526211925160ea1b60448201526064016104da565b806145dd81615786565b915050614563565b60005b8351811015611cd35761461384828151811061460657614606615721565b60200260200101516115c4565b1561465e576001602e600086848151811061463057614630615721565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061466881615786565b9150506145e8565b6001600160a01b0384163b156119345760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906146b49089908990889088908890600401615d6b565b6020604051808303816000875af19250505080156146ef575060408051601f3d908101601f191682019092526146ec91810190615da5565b60015b61479b576146fb615dc2565b806308c379a003614734575061470f615dde565b8061471a5750614736565b8060405162461bcd60e51b81526004016104da9190614bf0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016104da565b6001600160e01b0319811663f23a6e6160e01b14611cd35760405162461bcd60e51b81526004016104da90615e67565b600081815b8451811015611ecb576147fc828683815181106147ef576147ef615721565b6020026020010151614a11565b91508061480881615786565b9150506147d0565b6001600160a01b0384163b156119345760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906148549089908990889088908890600401615eaf565b6020604051808303816000875af192505050801561488f575060408051601f3d908101601f1916820190925261488c91810190615da5565b60015b61489b576146fb615dc2565b6001600160e01b0319811663bc197c8160e01b14611cd35760405162461bcd60e51b81526004016104da90615e67565b6001600160a01b0384166148f15760405162461bcd60e51b81526004016104da90615c79565b3360006148fd8561444e565b9050600061490a8561444e565b905061491a838989858589614499565b6000868152602081815260408083206001600160a01b038c1684529091529020548581101561495b5760405162461bcd60e51b81526004016104da90615cbe565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290614998908490615b0c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46149f8848a8a86868a6145e5565b614a06848a8a8a8a8a614670565b505050505050505050565b6000818310614a2d5760008281526020849052604090206120b8565b5060009182526020526040902090565b828054828255906000526020600020908101928215614a78579160200282015b82811115614a78578251825591602001919060010190614a5d565b50614a84929150614af9565b5090565b508054600082559060005260206000209081019061309f9190614af9565b828054828255906000526020600020908101928215614a78579160200282015b82811115614a785781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190614ac6565b5b80821115614a845760008155600101614afa565b80356001600160a01b0381168114614b2557600080fd5b919050565b60008060408385031215614b3d57600080fd5b614b4683614b0e565b946020939093013593505050565b6001600160e01b03198116811461309f57600080fd5b600060208284031215614b7c57600080fd5b81356120b881614b54565b600060208284031215614b9957600080fd5b5035919050565b60005b83811015614bbb578181015183820152602001614ba3565b50506000910152565b60008151808452614bdc816020860160208601614ba0565b601f01601f19169290920160200192915050565b6020815260006120b86020830184614bc4565b801515811461309f57600080fd5b8035614b2581614c03565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715614c5757614c57614c1c565b6040525050565b60006001600160401b03821115614c7757614c77614c1c565b5060051b60200190565b600082601f830112614c9257600080fd5b81356020614c9f82614c5e565b604051614cac8282614c32565b83815260059390931b8501820192828101915086841115614ccc57600080fd5b8286015b84811015614ce75780358352918301918301614cd0565b509695505050505050565b60008060008060808587031215614d0857600080fd5b843593506020850135614d1a81614c03565b925060408501356001600160401b0380821115614d3657600080fd5b614d4288838901614c81565b93506060870135915080821115614d5857600080fd5b50614d6587828801614c81565b91505092959194509250565b60008060408385031215614d8457600080fd5b823591506020830135614d9681614c03565b809150509250929050565b803560ff81168114614b2557600080fd5b600080600080600060a08688031215614dca57600080fd5b8535614dd581614c03565b9450614de360208701614da1565b94979496505050506040830135926060810135926080909101359150565b60006001600160401b03831115614e1a57614e1a614c1c565b604051614e31601f8501601f191660200182614c32565b809150838152848484011115614e4657600080fd5b83836020830137600060208583010152509392505050565b600082601f830112614e6f57600080fd5b6120b883833560208501614e01565b600080600080600060a08688031215614e9657600080fd5b614e9f86614b0e565b9450614ead60208701614b0e565b935060408601356001600160401b0380821115614ec957600080fd5b614ed589838a01614c81565b94506060880135915080821115614eeb57600080fd5b614ef789838a01614c81565b93506080880135915080821115614f0d57600080fd5b50614f1a88828901614e5e565b9150509295509295909350565b600060208284031215614f3957600080fd5b6120b882614b0e565b600080600080600080600060c0888a031215614f5d57600080fd5b8735614f6881614c03565b96506020880135614f7881614c03565b95506040880135614f8881614c03565b94506060880135935060808801356001600160401b0380821115614fab57600080fd5b818a0191508a601f830112614fbf57600080fd5b813581811115614fce57600080fd5b8b6020828501011115614fe057600080fd5b602083019550809450505050614ff860a08901614c11565b905092959891949750929550565b60008060006060848603121561501b57600080fd5b83356001600160401b038082111561503257600080fd5b61503e87838801614c81565b9450602086013591508082111561505457600080fd5b5061506186828701614c81565b925050604084013561507281614c03565b809150509250925092565b6000806040838503121561509057600080fd5b82356001600160401b03808211156150a757600080fd5b818501915085601f8301126150bb57600080fd5b813560206150c882614c5e565b6040516150d58282614c32565b83815260059390931b85018201928281019150898411156150f557600080fd5b948201945b8386101561511a5761510b86614b0e565b825294820194908201906150fa565b9650508601359250508082111561513057600080fd5b5061513d85828601614c81565b9150509250929050565b600081518084526020808501945080840160005b838110156151775781518752958201959082019060010161515b565b509495945050505050565b6020815260006120b86020830184615147565b60008083601f8401126151a757600080fd5b5081356001600160401b038111156151be57600080fd5b6020830191508360208260051b85010111156151d957600080fd5b9250929050565b60008060008060008060a087890312156151f957600080fd5b61520287614b0e565b955060208701359450604087013593506060870135925060808701356001600160401b0381111561523257600080fd5b61523e89828a01615195565b979a9699509497509295939492505050565b60008060006060848603121561526557600080fd5b83359250602084013561527781614c03565b915061528560408501614da1565b90509250925092565b600080604083850312156152a157600080fd5b50508035926020909101359150565b6000806000606084860312156152c557600080fd5b505081359360208301359350604090920135919050565b6000806000604084860312156152f157600080fd5b83356001600160401b0381111561530757600080fd5b61531386828701615195565b909790965060209590950135949350505050565b6000806040838503121561533a57600080fd5b82356001600160401b038082111561535157600080fd5b61535d86838701614c81565b9350602085013591508082111561513057600080fd5b60008060006060848603121561538857600080fd5b83359250602084013561539a81614c03565b929592945050506040919091013590565b6000806000806000608086880312156153c357600080fd5b6153cc86614b0e565b9450602086013593506040860135925060608601356001600160401b038111156153f557600080fd5b61540188828901615195565b969995985093965092949392505050565b600080600080600060a0868803121561542a57600080fd5b853594506020860135935060408601356001600160401b0381111561544e57600080fd5b8601601f8101881361545f57600080fd5b61546e88823560208401614e01565b935050606086013561547f81614c03565b9150608086013561548f81614c03565b809150509295509295909350565b600080604083850312156154b057600080fd5b6154b983614b0e565b91506020830135614d9681614c03565b600080602083850312156154dc57600080fd5b82356001600160401b038111156154f257600080fd5b6154fe85828601615195565b90969095509350505050565b60008060008060008060a0878903121561552357600080fd5b61552c87614b0e565b955060208701356001600160401b038082111561554857600080fd5b6155548a838b01614c81565b9650604089013591508082111561556a57600080fd5b6155768a838b01614c81565b955060608901359450608089013591508082111561559357600080fd5b5061523e89828a01615195565b600080604083850312156155b357600080fd5b6155bc83614b0e565b91506155ca60208401614b0e565b90509250929050565b600080600080600060a086880312156155eb57600080fd5b6155f486614b0e565b945061560260208701614b0e565b9350604086013592506060860135915060808601356001600160401b0381111561562b57600080fd5b614f1a88828901614e5e565b60008060006060848603121561564c57600080fd5b833561565781614c03565b925060208401359150604084013561507281614c03565b600181811c9082168061568257607f821691505b60208210810361444857634e487b7160e01b600052602260045260246000fd5b600081546156af8161566e565b600182811680156156c757600181146156dc5761570b565b60ff198416875282151583028701945061570b565b8560005260208060002060005b858110156157025781548a8201529084019082016156e9565b50505082870194505b5050505092915050565b60006120b882846156a2565b634e487b7160e01b600052603260045260246000fd5b66697066733a2f2f60c81b8152600061575360078301846156a2565b602f60f81b81526001019392505050565b600061575382846156a2565b634e487b7160e01b600052601160045260246000fd5b60006001820161579857615798615770565b5060010190565b818103818111156110f3576110f3615770565b600083516157c4818460208801614ba0565b8351908301906157d8818360208801614ba0565b64173539b7b760d91b9101908152600501949350505050565b60008351615803818460208801614ba0565b61580f818401856156a2565b64173539b7b760d91b815260050195945050505050565b60208082526002908201526110a160f11b604082015260600190565b60006020828403121561585457600080fd5b81516120b881614c03565b601f821115611da557600081815260208120601f850160051c810160208610156158865750805b601f850160051c820191505b8181101561193457828155600101615892565b6001600160401b038311156158bc576158bc614c1c565b6158d0836158ca835461566e565b8361585f565b6000601f84116001811461590457600085156158ec5750838201355b600019600387901b1c1916600186901b17835561177e565b600083815260209020601f19861690835b828110156159355786850135825560209485019460019092019101615915565b50868210156159525760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b66697066733a2f2f60c81b8152828460078301376000838201602f60f81b6007820152835161599a816008840160208801614ba0565b64173539b7b760d91b60089290910191820152600d0195945050505050565b81516001600160401b038111156159d2576159d2614c1c565b6159e6816159e0845461566e565b8461585f565b602080601f831160018114615a1b5760008415615a035750858301515b600019600386901b1c1916600185901b178555611934565b600085815260208120601f198616915b82811015615a4a57888601518255948401946001909101908401615a2b565b5085821015615a685787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b602080825260059082015264085352539560da1b604082015260600190565b60208082526006908201526514185d5cd95960d21b604082015260600190565b6020808252600c908201526b0a0c2eae6cac84084c2e8c6d60a31b604082015260600190565b808201808211156110f3576110f3615770565b600060ff821660ff8103615b3557615b35615770565b60010192915050565b6020808252600590820152641393dbd41360da1b604082015260600190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b80820281158282048414176110f3576110f3615770565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b604081526000615c5e6040830185615147565b8281036020840152615c708185615147565b95945050505050565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b8581528460208201526bffffffffffffffffffffffff198460601b1660408201528260548201526000615d3e60748301846156a2565b979650505050505050565b600082615d6657634e487b7160e01b600052601260045260246000fd5b500690565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090615d3e90830184614bc4565b600060208284031215615db757600080fd5b81516120b881614b54565b600060033d1115615ddb5760046000803e5060005160e01c5b90565b600060443d1015615dec5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715615e1b57505050505090565b8285019150815181811115615e335750505050505090565b843d8701016020828501011115615e4d5750505050505090565b615e5c60208286010187614c32565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a060408201819052600090615edb90830186615147565b8281036060840152615eed8186615147565b90508281036080840152615f018185614bc4565b9897505050505050505056fea2646970667358221220aa098b51b5818d3c079d3ec2f8f982870b4cae665e6f5ab13e23827131e1003564736f6c63430008120033

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.