ETH Price: $3,471.69 (-1.00%)
Gas: 3 Gwei

Token

Web3 Spring Couplet 2023 (COUPLET2023)
 

Overview

Max Total Supply

233 COUPLET2023

Holders

134

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 COUPLET2023
0x75171982cfce00c6a8b25cd723e8496679375700
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xe0a5004e...dE2A80823
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
ManeBase

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 20 runs

Other Settings:
default evmVersion
File 1 of 15 : manebase.sol
// contracts/nftclub.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
import "../operator-filter-registry/src/DefaultOperatorFilterer.sol";


// Share configure
struct TShare {
    address owner;
    uint256 ratioPPM;
}

abstract contract ERC721AM is ERC721A {
    mapping(address => uint256[]) public tokenIDByHolder;

    // Override the _transfer function to record holders
    function _transfer(address from, address to, uint256 tokenId) internal override {
        super._transfer(from, to, tokenId);
        updateHolderInfo(from, to, tokenId);
    }

    function updateHolderInfo(address from, address to, uint256 tokenId) internal {
        tokenIDByHolder[to].push(tokenId);
        for (uint256 i = 0; i < tokenIDByHolder[from].length; i++) {
            if (tokenIDByHolder[from][i] == tokenId) {
                tokenIDByHolder[from][i] = tokenIDByHolder[from][tokenIDByHolder[from].length - 1];
                tokenIDByHolder[from].pop();
                break;
            }
        }
    }
}


contract ManeBase is ERC721AM, Ownable, DefaultOperatorFilterer {
    // Mint price in sale period
    uint256 public _salePrice;
    
    address public factory;
    
    uint256 public platformBalance;
    uint256 public ownerBalance;
    uint256 public collectorBalance;

    uint256 private _reserveQuantity;

    // Max number allow to mint
    uint256 public _maxSupply;
  
    // Presale and Publicsale start time
    uint256 public presaleStartTime;
    uint256 public presaleEndTime;
    uint256 public saleStartTime;
    uint256 public saleEndTime;

    // Presale Mintable Number
    uint256 public presaleMaxSupply = 0;
    uint256 public presaleMintedCount = 0;

    // Mint count per address
    mapping(address => uint256) public presaleMintCountByAddress;
    uint256 public presaleMaxMintCountPerAddress;

    mapping(address => uint256) public saleMintCountByAddress;
    uint256 public saleMaxMintCountPerAddress;

    // Platform fee ratio in PPM
    uint256 public platformFeePPM = 0;

    // Super admin is able to set isForceRefundable flag to true in 7 days since the first token was minted in the public sale period or all tokens were minted in the presale period.
    // When isForceRefundable is set to true, token holders can get a full refund in 7 days.
    // Neither Creators nor platform is also not allowed to withdraw in 7 days when isForceRefundable is set to true.
    uint256 public isForceRefundable = 0;
    uint256 public forceRefundDeadline = 2**32;

    // Is the contract paused
    uint256 public paused = 0;


    //event TokenMinted(address minter, uint256 tokenId , uint256 mintPrice, uint256 platformFee);
    
    //event ContractDeployed(address sender, address contract_address, uint256 reserveQuantity, uint256 clubId);


    // Mint Information
    // mapping(tokenID => TMintInfO)
    struct TMintInfo {
        uint256 isPreMint;
        uint256 isRefunded;
        //address minter;
        uint256 price;
    }
    mapping(uint256 => TMintInfo) public _mintInfo;

    // Refund Times and Ratios
    struct TRefundTime {
        uint256 endTime;        /// Refund is available before this time (and isRefundable == true). In unix timestamp.
        uint256 ratioPPM;       /// How much ratio can be refund
    }

    
    // Share list
    TShare[] public _shareList;

    // Refund Time List    
    TRefundTime[] public _refundTimeList;

    /**
    u256[0] =>  reserveQuantity
        [1] =>  maxSupply
        [2] =>  presaleMaxSupply
        [3] =>  clubID              (obsoleted)
        [4] =>  presaleStartTime
        [5] =>  presaleEndTime
        [6] =>  saleStartTime
        [7] =>  saleEndTime
        [8] =>  presalePrice        (obsoleted)
        [9] =>  salePrice
        /// How many tokens a wallet can mint
        [10] => presalePerWalletCount
        [11] => salePerWalletCount
        [12] => signature nonce
    */ 
    constructor(string memory name_, string memory symbol_, uint256[] memory u256s,
                address[] memory shareAddresses_, uint256[] memory shareRatios_, uint256[] memory refundTimes_, uint256[] memory refundRatios_
            ) ERC721A(name_, symbol_) {   
        require(u256s[0] + u256s[2] <= u256s[1], "MB:maxSupply");


        // 1. Deplay and log the create event
        factory = msg.sender;

        _reserveQuantity = u256s[0];
        presaleMaxSupply = u256s[2];
        setPresaleTimes(u256s[4], u256s[5]);
        setSaleTimes(u256s[6], u256s[7]);
        setMintPrice(u256s[9]);
        _maxSupply = u256s[1];

        transferOwnership(tx.origin);

        //emit ContractDeployed(tx.origin, address(this), u256s[0], u256s[3]);

        /// 2. Reserve tokens for creator
        initReserve(u256s[0]);

        /// 3. Setting share list

        // To reduce contract size, share list is no longer available
        shareAddresses_;
        shareRatios_;
        // uint256 totalShareRatios = 0;
        // for (uint256 i = 0; i < shareAddresses_.length; i++) {
        //     TShare memory t;
        //     t.owner = shareAddresses_[i];
        //     t.ratioPPM = shareRatios_[i];

        //     totalShareRatios += t.ratioPPM;

        //     _shareList.push(t);
        // }
        // require(totalShareRatios <= 1 * 1000 * 1000, "MB:shareRatios of");

        /// 4. Setting refund times
        require(refundTimes_.length == refundRatios_.length, "MB:len mismatch");
        uint256 oldEndTime = 0;
        uint256 oldRatio = 1e9;
        for( uint256 i = 0; i < refundTimes_.length; i++) {
            TRefundTime memory t;
            t.endTime = refundTimes_[i];
            t.ratioPPM = refundRatios_[i];

            require(t.endTime > oldEndTime, "MB:refundTimes inval");
            require(t.ratioPPM < oldRatio, "MB:refundRatio inval");

            oldEndTime = t.endTime;
            oldRatio = t.ratioPPM;

            _refundTimeList.push(t);
        }
        

        /// 5. Setting mint limit for wallets
        presaleMaxMintCountPerAddress = u256s[10];
        saleMaxMintCountPerAddress = u256s[11];
        unchecked{
            if (presaleMaxMintCountPerAddress == 0) {
                presaleMaxMintCountPerAddress -= 1;
            }
            if (saleMaxMintCountPerAddress == 0) {
                saleMaxMintCountPerAddress -= 1;
            }
        }

        /// 6. Setting platform PPM
        platformFeePPM = ManeFactory(factory).platformFeePPM();
    }

    function initReserve(uint256 reserveQuantity) private {
        if (reserveQuantity > 0) {
            uint256 currentIndex = _currentIndex;
            _mint(tx.origin, reserveQuantity, "", false);
            for (uint256 i = currentIndex; i < currentIndex + reserveQuantity; i++) {
                //emit TokenMinted(tx.origin, i, 0, 0);
                tokenIDByHolder[tx.origin].push(i);
            }
        }
    }


    function getAll() public view returns (uint256[] memory) {
        uint256[] memory u = new uint256[](12);
       
        u[0] = _reserveQuantity;
        u[1] = _maxSupply;
        u[2] = presaleMaxSupply;
        // u[3] = clubId;   // (obsoleted)
        u[4] = presaleStartTime;
        u[5] = presaleEndTime;
        u[6] = saleStartTime;
        u[7] = saleEndTime;
        // u[8] = 0;       // (obsoleted)
        u[9] = _salePrice;
        // u[10] = presaleMaxMintCountPerAddress;       // Shrink contract size
        // u[11] = saleMaxMintCountPerAddress;          // Shrink contract size

        return (u);
    }
    
    // Minted token will be sent to minter
    // sign_deadline, r, s, v is only require at presale perioid. These parameters are server-side signature data.
    function mint(address minter, uint256 mint_price, uint256 count, uint256 sign_deadline, bytes32 r, bytes32 s, uint8 v) payable whenNotPaused public {
        uint256 isPresale = 0;
        uint256 isSale = 0;

        // 0. Check is mintable
        if (block.timestamp < presaleStartTime) {
            // Period: Sale not started
            revert("MB:Not started");
        } else if (block.timestamp >= presaleStartTime && block.timestamp < presaleEndTime) {
            // Period: Pre-sale period
            require(msg.value >= mint_price * count, "MB:presale val");
            isPresale = 1;
        } else if (block.timestamp >= saleStartTime && block.timestamp <= saleEndTime) {
            // Period: Public sale perild
            require(mint_price == _salePrice, "MB:mint_price");
            require(msg.value >= _salePrice * count, "MB:sale val");
            isSale = 1;
        } else {
            revert("MB:Inval period");
        }

        /// Mint `count` number of tokens
        for (uint256 i = 0; i < count; i++) {
            require(totalMinted() < _maxSupply, "MB:No more");

            if (isPresale == 1) {
                requireMintSign(minter, mint_price, count, sign_deadline, r, s, v);

                presaleMintedCount++;
                require(presaleMintedCount <= presaleMaxSupply, "MB:Exceed");
                
                presaleMintCountByAddress[msg.sender]++;
                require(presaleMintCountByAddress[msg.sender] <= presaleMaxMintCountPerAddress, "MB:addr(A)");
            } else if (isSale == 1) {
                //requireMintSign(minter, mint_price, sign_deadline, r, s, v);

                saleMintCountByAddress[msg.sender]++;
                require(saleMintCountByAddress[msg.sender] <= saleMaxMintCountPerAddress, "MB:addr(B)");
                
            } else {
                revert("MB:NotSalePeriod");
            }


            // 1. Mint it
            uint256 currentIndex = _currentIndex;

            _mint(minter, 1, "", false);
            tokenIDByHolder[minter].push(currentIndex);


            // 2. Send mint value to creator and platform and collectors
            uint256 platformGot = mint_price * platformFeePPM / 1e6;
            uint256 collectorGot = (mint_price - platformGot) * getCollectorTotalRatioPPM() / 1e6;
            uint256 ownerGot = mint_price - platformGot - collectorGot;
            
            platformBalance += platformGot;
            collectorBalance += collectorGot;
            ownerBalance += ownerGot;

            // 4. Log events and other data
            _mintInfo[currentIndex] = TMintInfo({
                isPreMint: isPresale,
                isRefunded: 0,
                //minter: minter,
                price: mint_price
            });

            //emit TokenMinted(minter, currentIndex, mint_price, platformGot);
        }


        // Init 7-days refund time
        if (isSale == 1 || _currentIndex == _maxSupply - 1) {
            if (forceRefundDeadline == 2**32) {
                forceRefundDeadline = block.timestamp + 86400 * 7;
            }
        }
        
        //  Mint finished successfully
    }


    /// User request to refund
    function refund(uint256 tokenID) public {
        require(msg.sender == ownerOf(tokenID), "MB:owner");
        
        /// 1. Get refund ratio
        // If forceRefundable is true, holder can refund all. Otherwise holder can only refund before refund time
        uint256 refundRatioPPM = 0;
        if (isForceRefundable == 1) {
            refundRatioPPM = 1e6;
        } else {
            for (uint256 i = 0; i < _refundTimeList.length; i++) {
                if (block.timestamp < _refundTimeList[i].endTime) {
                    refundRatioPPM = _refundTimeList[i].ratioPPM;
                    break;
                }
            }
        }
        require(refundRatioPPM > 0, "MB:refundNotAvail");

        /// 2. Get mint info and check if this token is refundable
        TMintInfo storage mintInfo = _mintInfo[tokenID];
        
        require(mintInfo.isRefunded == 0, "MB:refunded");

        /// 3. Caculate the refundable value
        uint256 refundValue = mintInfo.price * refundRatioPPM / 1e6; 

        /// 4. Do refund
        uint256 platformReturn = refundValue * platformFeePPM / 1e6;
        uint256 collectorReturn = (refundValue - platformReturn) * getCollectorTotalRatioPPM() / 1e6;
        uint256 ownerReturn = refundValue - platformReturn - collectorReturn;

        platformBalance -= platformReturn;
        collectorBalance -= collectorReturn;
        ownerBalance -= ownerReturn;        

        transferFrom(msg.sender, this.owner(), tokenID);
        
        mintInfo.isRefunded = 1;

        payable(msg.sender).transfer(refundValue);
    }


    // Send shares to share holders and owner
    function collect() public onlyOwner {
        /// 1. Check if collect is open
        requireCollectable();        

        /// 2. Find the collector and transfer

        // To reduce solidity size, collector share is no longer available
        // uint256 b = collectorBalance;
        // uint256 totalRatioPPM = getCollectorTotalRatioPPM();
        // for (uint256 i = 0; i < _shareList.length; i++) {
        //     uint256 collectValue = b * _shareList[i].ratioPPM / totalRatioPPM;
        //     collectorBalance -= collectValue;
        //     payable(_shareList[i].owner).transfer(collectValue);
        // }

        /// 3. send balance to owner
        uint256 oBalance = ownerBalance;
        ownerBalance = 0;
        payable(owner()).transfer(oBalance);
    }


    // Platform (ManeStudio) collect it's shares
    function platformCollect(address to) public onlyFactoryOwner {
        requireCollectable();

        uint256 b = platformBalance;
        platformBalance = 0;
        payable(to).transfer(b);
    }

    function requireCollectable() view internal {
        for (uint256 i = 0; i < _refundTimeList.length; i++) {
            require(block.timestamp > _refundTimeList[i].endTime, "MB:refundDeadline");
        }

        /// Not allow collect in 7 days. See forceRefundDeadline for more detail
        require(block.timestamp > forceRefundDeadline, "MB:7dLimit");
        require(isForceRefundable == 0, "MB:forceRefund");
    }
    
    /// If signagure is not valid, throw exception and stop
    function requireMintSign(address minter, uint256 price, uint256 count, uint256 deadline, bytes32 r, bytes32 s, uint8 v)  internal view {
        bytes memory prefix = "\x19Ethereum Signed Message:\n32";
        bytes32 userHash = encodeMint(minter, price, count, deadline);
        bytes32 prefixHash = keccak256(abi.encodePacked(prefix, userHash));

        address hash_address = ecrecover(prefixHash, v, r, s);

        require(hash_address == ManeFactory(factory).signerAddress(), "MB:sign");
    }


    function encodeMint( address minter, uint256 price, uint256 count, uint256 deadline) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(minter, price, count, deadline));
    }

    function totalMinted() public view returns (uint256) {
        return _totalMinted();
    }

    function _baseURI() override internal view returns (string memory) {
        string memory factoryBaseURI = ManeFactory(factory).factoryBaseURI();
        return string(abi.encodePacked(factoryBaseURI, toString(abi.encodePacked(this)), "/"));
    }
    
    // Set the mint price for sale period
    function setMintPrice(uint256 sale_price) public onlyOwner {
        _salePrice = sale_price;
    }

    function setPresaleMaxSupply(uint256 max_) public onlyOwner {
        presaleMaxSupply = max_;
    }
    

    function adminSetRefund(uint256 is_refundable_) public onlyFactoryOwner {
        require(block.timestamp < forceRefundDeadline, "MF:time");
        isForceRefundable = is_refundable_;
    }


    function setPresaleMaxMintCountPerAddress(uint256 max_) public onlyOwner {
        presaleMaxMintCountPerAddress = max_;
    }
    function setSaleMaxMintCountPerAddress(uint256 max_) public onlyOwner {
        saleMaxMintCountPerAddress = max_;
    }

    function getCollectorTotalRatioPPM() internal view returns (uint256) {
        uint256 ratioPPM = 0;
        for (uint256 i =0; i < _shareList.length; i++) {
            ratioPPM += _shareList[i].ratioPPM;
        }

        require(ratioPPM <= 1e6, "MB:ratio");

        return ratioPPM;
    }

    function setPresaleTimes(uint256 startTime_, uint256 endTime_) public onlyOwner {
        presaleStartTime = startTime_;
        if (endTime_ == 0) {
            unchecked {
                presaleEndTime = endTime_ - 1;
            }
        } else {
            presaleEndTime = endTime_;
        }
    }

    function setSaleTimes(uint256 startTime_, uint256 endTime_) public onlyOwner {
        saleStartTime = startTime_;
        if (endTime_ == 0) {
            unchecked {
                saleEndTime = endTime_ - 1;
            }
        } else {
            saleEndTime = endTime_;
        }
    }


    // Get the token id list of the given address. If the address holds no token, empty array is return
    function getTokenIDsByHolder(address holder, uint256 offset, uint256 limit) public view returns (uint256[] memory) {
        uint256 size = tokenIDByHolder[holder].length - offset;
        if (size > limit) {
            size = limit;
        }
        uint256[] memory ret = new uint256[](size);

        for (uint256 i = 0; i < limit; i++) {
            if (i + offset >= tokenIDByHolder[holder].length) {
                break;
            } 
            ret[i] = (tokenIDByHolder[holder][i + offset]);
        }

        return ret;
    }


    function getShareListLength() public view returns (uint256) {
        return _shareList.length;
    }

    function getRefundTimeListLength() public view returns (uint256) {
        return _refundTimeList.length;
    }

    function setPaused(uint256 is_pause) public onlyOwner {
        paused = is_pause;
    }

    function destroy() public onlyOwner {
        require(_currentIndex == _reserveQuantity, "MB:notAllow");
        selfdestruct(payable(this.owner()));
    }

    modifier onlyFactoryOwner() {
        ManeFactory(factory).requireOriginIsOwner();
        _;
    }

    modifier whenNotPaused() {
        require(paused == 0, "MB:paused");
        _;
    }

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

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

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

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

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


    function setOpenseaEnforcement(uint256 isEnforcement) public onlyOwner {
        openseaEnforcement = isEnforcement;
    }
}


contract SignAndOwnable is Ownable { 
    address public signerAddress;

    constructor() Ownable() {
        signerAddress = tx.origin;
    }

    // Check if the signature is valid. Returns true if signagure is valid, otherwise returns false.
    function verifySignature(bytes32 h, uint8 v, bytes32 r, bytes32 s) view internal returns (bool) {
        return (ecrecover(h, v, r, s) == signerAddress);
    }

    // Set the derived address of the public key of the signer private key
    function setSignaturePublic(address newAddress) public onlyOwner {
        signerAddress = newAddress;
    }
}


contract ManeFactory is SignAndOwnable {
    uint256 public platformFeePPM = 100 * 1e3;

    string public factoryBaseURI = "https://meta.manestudio.xyz/nft/";

    mapping(uint256 => uint256) private _usedNonces;

    // Mapping club_id => token_contract_address
    mapping(uint256 => address) public clubMap;

    constructor() SignAndOwnable() {
    }

    function deploy(string memory name_, string memory symbol_,  uint256[] memory u256s, address[] memory shareAddresses_, uint256[] memory shareRatios_, uint256[] memory refundEndTimes_, uint256[] memory refundRatios_, uint8 v, bytes32 r, bytes32 s) public returns (address) {
        /// 1. Check signagure
        bytes memory ethereum_prefix = "\x19Ethereum Signed Message:\n32";
        bytes32 user_hash =keccak256(abi.encodePacked(ethereum_prefix, keccak256(abi.encodePacked(u256s[3], u256s[12]))));

        require(_usedNonces[u256s[12]] == 0, "MF:DupNonce");
        _usedNonces[u256s[12]] = 1;

        require(verifySignature(user_hash, v, r, s) == true, "MF:invalidSign");
        
        /// 2. Deploy contract
        ManeBase c = new ManeBase(name_, symbol_, u256s, shareAddresses_, shareRatios_, refundEndTimes_, refundRatios_);
        //contracts.push(address(c));
        clubMap[u256s[3]] = address(c);


        return address(c);
    }

    function setPlatformFeePPM(uint256 newFeePPM) public onlyOwner {
        platformFeePPM = newFeePPM;
    }

    /// Set the factoryBaseURI, must include trailing slashes
    function setFactoryBaseURI(string memory newBaseURI) public onlyOwner {
        factoryBaseURI = newBaseURI;
    }


    function requireOriginIsOwner() view public {
        require(tx.origin == owner(), "MF: NotOwner");
    }
}

function toString(bytes memory data) pure returns(string memory) {
    bytes memory alphabet = "0123456789abcdef";

    bytes memory str = new bytes(2 + data.length * 2);
    str[0] = "0";
    str[1] = "x";
    for (uint i = 0; i < data.length; i++) {
        str[2+i*2] = alphabet[uint(uint8(data[i] >> 4))];
        str[3+i*2] = alphabet[uint(uint8(data[i] & 0x0f))];
    }
    return string(str);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 3 of 15 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

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

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

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

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

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId, owner);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfers(from, to, tokenId, 1);

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

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

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

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

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

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

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

        address from = prevOwnership.addr;

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

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 */
abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

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

File 5 of 15 : 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 6 of 15 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

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

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

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

File 11 of 15 : 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 12 of 15 : 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 13 of 15 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    uint256 public openseaEnforcement = 1;

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        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(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (subscribe) {
                OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    OPERATOR_FILTER_REGISTRY.register(address(this));
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    function _checkFilterOperator(address operator) internal view virtual {
        if (openseaEnforcement == 0) {
            return;
        }

        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function unregister(address addr) 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);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 20,
    "details": {
      "yul": true,
      "yulDetails": {
        "stackAllocation": true,
        "optimizerSteps": "dhfoDgvulfnTUtnIf"
      }
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint256[]","name":"u256s","type":"uint256[]"},{"internalType":"address[]","name":"shareAddresses_","type":"address[]"},{"internalType":"uint256[]","name":"shareRatios_","type":"uint256[]"},{"internalType":"uint256[]","name":"refundTimes_","type":"uint256[]"},{"internalType":"uint256[]","name":"refundRatios_","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_mintInfo","outputs":[{"internalType":"uint256","name":"isPreMint","type":"uint256"},{"internalType":"uint256","name":"isRefunded","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_refundTimeList","outputs":[{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"ratioPPM","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_salePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_shareList","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"ratioPPM","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"is_refundable_","type":"uint256"}],"name":"adminSetRefund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collectorBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"destroy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forceRefundDeadline","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAll","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRefundTimeListLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getShareListLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getTokenIDsByHolder","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isForceRefundable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"mint_price","type":"uint256"},{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"uint256","name":"sign_deadline","type":"uint256"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openseaEnforcement","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"platformCollect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"platformFeePPM","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleMaxMintCountPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"presaleMintCountByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleMintedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenID","type":"uint256"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleMaxMintCountPerAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"saleMintCountByAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"saleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"sale_price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"isEnforcement","type":"uint256"}],"name":"setOpenseaEnforcement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"is_pause","type":"uint256"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"max_","type":"uint256"}],"name":"setPresaleMaxMintCountPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"max_","type":"uint256"}],"name":"setPresaleMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTime_","type":"uint256"},{"internalType":"uint256","name":"endTime_","type":"uint256"}],"name":"setPresaleTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"max_","type":"uint256"}],"name":"setSaleMaxMintCountPerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTime_","type":"uint256"},{"internalType":"uint256","name":"endTime_","type":"uint256"}],"name":"setSaleTimes","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":"tokenIDByHolder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526001600a55600060165560006017556000601c556000601d55640100000000601e556000601f553480156200003857600080fd5b5060405162004d2338038062004d238339810160408190526200005b9162000e2e565b733cc6cdda760b79bafa08df41ecfa224f810dceb66001888881600290805190602001906200008c92919062000adc565b508051620000a290600390602084019062000adc565b50506000805550620000b43362000668565b6daaeb6d7670e522a718067333cd4e3b15620001ed5780156200014057604051633e9f1edf60e11b81526daaeb6d7670e522a718067333cd4e90637d3e3dbe9062000106903090869060040162000fbd565b600060405180830381600087803b1580156200012157600080fd5b505af115801562000136573d6000803e3d6000fd5b50505050620001ed565b6001600160a01b03821615620001855760405163a0af290360e01b81526daaeb6d7670e522a718067333cd4e9063a0af29039062000106903090869060040162000fbd565b604051632210724360e11b81526daaeb6d7670e522a718067333cd4e90634420e48690620001b890309060040162000fe3565b600060405180830381600087803b158015620001d357600080fd5b505af1158015620001e8573d6000803e3d6000fd5b505050505b50508460018151811062000205576200020562000ff3565b60200260200101518560028151811062000223576200022362000ff3565b60200260200101518660008151811062000241576200024162000ff3565b60200260200101516200025591906200101f565b11156200027f5760405162461bcd60e51b815260040162000276906200105d565b60405180910390fd5b600c80546001600160a01b0319163317905584518590600090620002a757620002a762000ff3565b602002602001015160108190555084600281518110620002cb57620002cb62000ff3565b60200260200101516016819055506200032585600481518110620002f357620002f362000ff3565b60200260200101518660058151811062000311576200031162000ff3565b6020026020010151620006ba60201b60201c565b62000371856006815181106200033f576200033f62000ff3565b6020026020010151866007815181106200035d576200035d62000ff3565b6020026020010151620006e360201b60201c565b6200039f856009815181106200038b576200038b62000ff3565b60200260200101516200070c60201b60201c565b84600181518110620003b557620003b562000ff3565b6020908102919091010151601155620003ce326200071b565b620003fc85600081518110620003e857620003e862000ff3565b60200260200101516200075c60201b60201c565b8051825114620004205760405162461bcd60e51b8152600401620002769062001094565b6000633b9aca00815b8451811015620005665760408051808201909152600080825260208201528582815181106200045c576200045c62000ff3565b602002602001015181600001818152505084828151811062000482576200048262000ff3565b602002602001015181602001818152505083816000015111620004b95760405162461bcd60e51b81526004016200027690620010d9565b82816020015110620004df5760405162461bcd60e51b815260040162000276906200111e565b80516020820180516022805460018101825560009190915293517f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e51060029095029485015590517f61035b26e3e9eee00e0d72fd1ee8ddca6894550dca6916ea2ac6baa90d11e5119093019290925593509150806200055d8162001130565b91505062000429565b5086600a815181106200057d576200057d62000ff3565b602002602001015160198190555086600b81518110620005a157620005a162000ff3565b6020026020010151601b81905550601954600003620005c557601980546000190190555b601b54600003620005db57601b80546000190190555b600c60009054906101000a90046001600160a01b03166001600160a01b0316638ac433ae6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200062f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200065591906200114c565b601c555062001310975050505050505050565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620006c4620007df565b60128290556000819003620006dd576000190160135550565b60135550565b620006ed620007df565b6014829055600081900362000706576000190160155550565b60155550565b62000716620007df565b600b55565b62000725620007df565b6001600160a01b0381166200074e5760405162461bcd60e51b8152600401620002769062001171565b620007598162000668565b50565b801562000759576000805490506200078d32836040518060200160405280600081525060006200080e60201b60201c565b805b6200079b83836200101f565b811015620007da573260009081526008602090815260408220805460018101825590835291200181905580620007d18162001130565b9150506200078f565b505050565b6009546001600160a01b031633146200080c5760405162461bcd60e51b81526004016200027690620011ed565b565b6000546001600160a01b0385166200083857604051622e076360e81b815260040160405180910390fd5b836000036200085a5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546001600160801b031981166001600160401b038083168c018116918217680100000000000000006001600160401b031990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b42909216919091021790558080850183801562000913575062000913876001600160a01b0316620009d860201b620019d51760201c565b1562000992575b60405182906001600160a01b0389169060009060008051602062004d03833981519152908290a460018201916200095790600090899088620009e7565b62000975576040516368d2bf6b60e11b815260040160405180910390fd5b8082036200091a5782600054146200098c57600080fd5b620009c7565b5b6040516001830192906001600160a01b0389169060009060008051602062004d03833981519152908290a480820362000993575b506000555050505050565b50505050565b6001600160a01b03163b151590565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029062000a1e9033908990889088906004016200123b565b6020604051808303816000875af192505050801562000a5c575060408051601f3d908101601f1916820190925262000a5991810190620012a5565b60015b62000abe573d80801562000a8d576040519150601f19603f3d011682016040523d82523d6000602084013e62000a92565b606091505b50805160000362000ab6576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b82805462000aea90620012e0565b90600052602060002090601f01602090048101928262000b0e576000855562000b59565b82601f1062000b2957805160ff191683800117855562000b59565b8280016001018555821562000b59579182015b8281111562000b5957825182559160200191906001019062000b3c565b5062000b6792915062000b6b565b5090565b5b8082111562000b67576000815560010162000b6c565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681016001600160401b038111828210171562000bc05762000bc062000b82565b6040525050565b600062000bd360405190565b905062000be1828262000b98565b919050565b60006001600160401b0382111562000c025762000c0262000b82565b601f19601f83011660200192915050565b60005b8381101562000c3057818101518382015260200162000c16565b83811115620009d25750506000910152565b600062000c5962000c538462000be6565b62000bc7565b90508281526020810184848401111562000c765762000c76600080fd5b62000c8384828562000c13565b509392505050565b600082601f83011262000ca15762000ca1600080fd5b815162000ad484826020860162000c42565b60006001600160401b0382111562000ccf5762000ccf62000b82565b5060209081020190565b805b81146200075957600080fd5b805162000cf48162000cd9565b92915050565b600062000d0b62000c538462000cb3565b8381529050602080820190840283018581111562000d2c5762000d2c600080fd5b835b8181101562000d525762000d43878262000ce7565b83526020928301920162000d2e565b5050509392505050565b600082601f83011262000d725762000d72600080fd5b815162000ad484826020860162000cfa565b60006001600160a01b03821662000cf4565b62000cdb8162000d84565b805162000cf48162000d96565b600062000dbf62000c538462000cb3565b8381529050602080820190840283018581111562000de05762000de0600080fd5b835b8181101562000d525762000df7878262000da1565b83526020928301920162000de2565b600082601f83011262000e1c5762000e1c600080fd5b815162000ad484826020860162000dae565b600080600080600080600060e0888a03121562000e4e5762000e4e600080fd5b87516001600160401b0381111562000e695762000e69600080fd5b62000e778a828b0162000c8b565b60208a015190985090506001600160401b0381111562000e9a5762000e9a600080fd5b62000ea88a828b0162000c8b565b60408a015190975090506001600160401b0381111562000ecb5762000ecb600080fd5b62000ed98a828b0162000d5c565b60608a015190965090506001600160401b0381111562000efc5762000efc600080fd5b62000f0a8a828b0162000e06565b60808a015190955090506001600160401b0381111562000f2d5762000f2d600080fd5b62000f3b8a828b0162000d5c565b60a08a015190945090506001600160401b0381111562000f5e5762000f5e600080fd5b62000f6c8a828b0162000d5c565b60c08a015190935090506001600160401b0381111562000f8f5762000f8f600080fd5b62000f9d8a828b0162000d5c565b91505092959891949750929550565b62000fb78162000d84565b82525050565b6040810162000fcd828562000fac565b62000fdc602083018462000fac565b9392505050565b6020810162000cf4828462000fac565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111562001035576200103562001009565b500190565b600c8152602081016b4d423a6d6178537570706c7960a01b815290505b60200190565b6020808252810162000cf4816200103a565b600f8152602081016e09a8474d8cadc40dad2e6dac2e8c6d608b1b8152905062001057565b6020808252810162000cf4816200106f565b60148152602081017f4d423a726566756e6454696d657320696e76616c0000000000000000000000008152905062001057565b6020808252810162000cf481620010a6565b60148152602081017f4d423a726566756e64526174696f20696e76616c0000000000000000000000008152905062001057565b6020808252810162000cf481620010eb565b60006001820162001145576200114562001009565b5060010190565b600060208284031215620011635762001163600080fd5b600062000ad4848462000ce7565b6020808252810162000cf481602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201526564647265737360d01b604082015260600190565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910190815262001057565b6020808252810162000cf481620011bc565b8062000fb7565b600062001211825190565b8084526020840193506200122a81856020860162000c13565b601f01601f19169290920192915050565b608081016200124b828762000fac565b6200125a602083018662000fac565b620012696040830185620011ff565b81810360608301526200127d818462001206565b9695505050505050565b6001600160e01b0319811662000cdb565b805162000cf48162001287565b600060208284031215620012bc57620012bc600080fd5b600062000ad4848462001298565b634e487b7160e01b600052602260045260246000fd5b600281046001821680620012f557607f821691505b6020821081036200130a576200130a620012ca565b50919050565b6139e380620013206000396000f3fe6080604052600436106102cd5760003560e01c80637d6849c8116101775780637d6849c8146106a157806383197ef0146106b75780638ac433ae146106cc5780638da5cb5b146106e2578063952bd074146106f757806395d89b4114610717578063979aea0f1461072c578063a22cb4651461074c578063a2309ff81461076c578063a7f3e70f14610781578063a82524b2146107a1578063b88d4fde146107b7578063bcce5826146107d7578063bcfdb30914610805578063bedcf00314610818578063c3e386b91461082e578063c45a01551461085c578063c7424f671461087c578063c87b56dd146108a9578063d038e28a146108c9578063d90f5f42146108de578063da5f524a146108fe578063e522538114610914578063e79f534314610929578063e985e9c514610949578063ec40217514610969578063ed338ff11461097f578063f134e14514610995578063f2fde38b146109aa578063f405741c146109ca578063f4a0a528146109f757600080fd5b806301ffc9a7146102d257806306fdde031461030857806307aae87a1461032a578063081812fc1461034c57806308fc299b14610379578063095ea7b31461039c5780630a403f04146103bc5780630afe6b91146103dc57806313e2e3dd146103f2578063151ba8001461040857806316eeb50b1461041e57806318160ddd146104345780631cbaee2d1461044d5780631ed5b0c41461046357806322f4596f146104ad57806323b872dd146104c3578063249b7c19146104e3578063278ecde1146104f957806341aba9e81461051957806341f434341461053957806342842e0e14610568578063498927eb1461058857806351789ea2146105a857806353ed5143146105c85780635c975abb146105ea5780635d0b89541461060057806362a5dbbc146106205780636352211e1461063657806364de051e1461065657806370a082311461066c578063715018a61461068c575b600080fd5b3480156102de57600080fd5b506102f26102ed366004612b61565b610a17565b6040516102ff9190612b8c565b60405180910390f35b34801561031457600080fd5b5061031d610a69565b6040516102ff9190612c04565b34801561033657600080fd5b5061034a610345366004612c26565b610afb565b005b34801561035857600080fd5b5061036c610367366004612c26565b610b08565b6040516102ff9190612c67565b34801561038557600080fd5b5061038f60165481565b6040516102ff9190612c7b565b3480156103a857600080fd5b5061034a6103b7366004612c9d565b610b4c565b3480156103c857600080fd5b5061034a6103d7366004612c26565b610b65565b3480156103e857600080fd5b5061038f601b5481565b3480156103fe57600080fd5b5061038f60175481565b34801561041457600080fd5b5061038f600f5481565b34801561042a57600080fd5b5061038f600a5481565b34801561044057600080fd5b506001546000540361038f565b34801561045957600080fd5b5061038f60145481565b34801561046f57600080fd5b5061049e61047e366004612c26565b602080526000908152604090208054600182015460029092015490919083565b6040516102ff93929190612cda565b3480156104b957600080fd5b5061038f60115481565b3480156104cf57600080fd5b5061034a6104de366004612d02565b610b72565b3480156104ef57600080fd5b5061038f60135481565b34801561050557600080fd5b5061034a610514366004612c26565b610b9d565b34801561052557600080fd5b5061034a610534366004612c26565b610e3a565b34801561054557600080fd5b5061055b6daaeb6d7670e522a718067333cd4e81565b6040516102ff9190612d8a565b34801561057457600080fd5b5061034a610583366004612d02565b610e47565b34801561059457600080fd5b5061038f6105a3366004612c9d565b610e6c565b3480156105b457600080fd5b5061034a6105c3366004612c26565b610e9d565b3480156105d457600080fd5b506105dd610eaa565b6040516102ff9190612df6565b3480156105f657600080fd5b5061038f601f5481565b34801561060c57600080fd5b5061034a61061b366004612c26565b610fe7565b34801561062c57600080fd5b5061038f600d5481565b34801561064257600080fd5b5061036c610651366004612c26565b610ff4565b34801561066257600080fd5b5061038f601e5481565b34801561067857600080fd5b5061038f610687366004612e07565b611006565b34801561069857600080fd5b5061034a611054565b3480156106ad57600080fd5b5061038f60195481565b3480156106c357600080fd5b5061034a611068565b3480156106d857600080fd5b5061038f601c5481565b3480156106ee57600080fd5b5061036c611100565b34801561070357600080fd5b5061034a610712366004612e28565b61110f565b34801561072357600080fd5b5061031d611139565b34801561073857600080fd5b5061034a610747366004612e07565b611148565b34801561075857600080fd5b5061034a610767366004612e5d565b6111f7565b34801561077857600080fd5b5060005461038f565b34801561078d57600080fd5b5061034a61079c366004612e28565b61120b565b3480156107ad57600080fd5b5061038f60125481565b3480156107c357600080fd5b5061034a6107d2366004612f7e565b611231565b3480156107e357600080fd5b506107f76107f2366004612c26565b61125e565b6040516102ff929190612ffc565b61034a61081336600461302b565b611296565b34801561082457600080fd5b5061038f600e5481565b34801561083a57600080fd5b5061084e610849366004612c26565b6116a4565b6040516102ff9291906130ca565b34801561086857600080fd5b50600c5461036c906001600160a01b031681565b34801561088857600080fd5b5061038f610897366004612e07565b60186020526000908152604090205481565b3480156108b557600080fd5b5061031d6108c4366004612c26565b6116d2565b3480156108d557600080fd5b5060215461038f565b3480156108ea57600080fd5b5061034a6108f9366004612c26565b611756565b34801561090a57600080fd5b5061038f601d5481565b34801561092057600080fd5b5061034a6117e2565b34801561093557600080fd5b506105dd6109443660046130d8565b61183b565b34801561095557600080fd5b506102f261096436600461310d565b611960565b34801561097557600080fd5b5061038f600b5481565b34801561098b57600080fd5b5061038f60155481565b3480156109a157600080fd5b5060225461038f565b3480156109b657600080fd5b5061034a6109c5366004612e07565b61198e565b3480156109d657600080fd5b5061038f6109e5366004612e07565b601a6020526000908152604090205481565b348015610a0357600080fd5b5061034a610a12366004612c26565b6119c8565b60006001600160e01b031982166380ac58cd60e01b1480610a4857506001600160e01b03198216635b5e139f60e01b145b80610a6357506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060028054610a7890613156565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa490613156565b8015610af15780601f10610ac657610100808354040283529160200191610af1565b820191906000526020600020905b815481529060010190602001808311610ad457829003601f168201915b5050505050905090565b610b036119e4565b601b55565b6000610b1382611a13565b610b30576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b81610b5681611a3e565b610b608383611af3565b505050565b610b6d6119e4565b601655565b826001600160a01b0381163314610b8c57610b8c33611a3e565b610b97848484611b7b565b50505050565b610ba681610ff4565b6001600160a01b0316336001600160a01b031614610bdf5760405162461bcd60e51b8152600401610bd69061319f565b60405180910390fd5b6000601d54600103610bf55750620f4240610c6e565b60005b602254811015610c6c5760228181548110610c1557610c156131af565b906000526020600020906002020160000154421015610c5a5760228181548110610c4157610c416131af565b9060005260206000209060020201600101549150610c6c565b80610c64816131db565b915050610bf8565b505b60008111610c8e5760405162461bcd60e51b8152600401610bd69061321a565b60008281526020805260409020600181015415610cbd5760405162461bcd60e51b8152600401610bd69061324a565b6000620f4240838360020154610cd3919061325a565b610cdd919061328f565b90506000620f4240601c5483610cf3919061325a565b610cfd919061328f565b90506000620f4240610d0d611b86565b610d1784866132a3565b610d21919061325a565b610d2b919061328f565b9050600081610d3a84866132a3565b610d4491906132a3565b905082600d6000828254610d5891906132a3565b9250508190555081600f6000828254610d7191906132a3565b9250508190555080600e6000828254610d8a91906132a3565b92505081905550610dfd33306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df791906132c5565b89610b72565b600185810155604051339085156108fc029086906000818181858888f19350505050158015610e30573d6000803e3d6000fd5b5050505050505050565b610e426119e4565b601955565b826001600160a01b0381163314610e6157610e6133611a3e565b610b97848484611c02565b60086020528160005260406000208181548110610e8857600080fd5b90600052602060002001600091509150505481565b610ea56119e4565b601f55565b60408051600c8082526101a0820190925260609160009190602082016101808036833701905050905060105481600081518110610ee957610ee96131af565b60200260200101818152505060115481600181518110610f0b57610f0b6131af565b60200260200101818152505060165481600281518110610f2d57610f2d6131af565b60200260200101818152505060125481600481518110610f4f57610f4f6131af565b60200260200101818152505060135481600581518110610f7157610f716131af565b60200260200101818152505060145481600681518110610f9357610f936131af565b60200260200101818152505060155481600781518110610fb557610fb56131af565b602002602001018181525050600b5481600981518110610fd757610fd76131af565b6020908102919091010152919050565b610fef6119e4565b600a55565b6000610fff82611c1d565b5192915050565b60006001600160a01b03821661102f576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b61105c6119e4565b6110666000611d37565b565b6110706119e4565b601054600054146110935760405162461bcd60e51b8152600401610bd690613306565b306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f591906132c5565b6001600160a01b0316ff5b6009546001600160a01b031690565b6111176119e4565b6012829055600081900361112f576000190160135550565b60138190555b5050565b606060038054610a7890613156565b600c60009054906101000a90046001600160a01b03166001600160a01b03166360755dc76040518163ffffffff1660e01b815260040160006040518083038186803b15801561119657600080fd5b505afa1580156111aa573d6000803e3d6000fd5b505050506111b6611d89565b600d805460009182905560405190916001600160a01b0384169183156108fc0291849190818181858888f19350505050158015610b60573d6000803e3d6000fd5b8161120181611a3e565b610b608383611e2d565b6112136119e4565b6014829055600081900361122b576000190160155550565b60155550565b836001600160a01b038116331461124b5761124b33611a3e565b61125785858585611ec5565b5050505050565b6021818154811061126e57600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b601f54156112b65760405162461bcd60e51b8152600401610bd690613334565b6000806012544210156112db5760405162461bcd60e51b8152600401610bd690613367565b60125442101580156112ee575060135442105b15611325576112fd878961325a565b34101561131c5760405162461bcd60e51b8152600401610bd69061339a565b600191506113ac565b601454421015801561133957506015544211155b1561139457600b54881461135f5760405162461bcd60e51b8152600401610bd6906133cc565b86600b5461136d919061325a565b34101561138c5760405162461bcd60e51b8152600401610bd6906133fc565b5060016113ac565b60405162461bcd60e51b8152600401610bd690613430565b60005b8781101561165757601154600054106113da5760405162461bcd60e51b8152600401610bd69061345f565b82600103611480576113f18a8a8a8a8a8a8a611f15565b60178054906000611401836131db565b9190505550601654601754111561142a5760405162461bcd60e51b8152600401610bd69061348d565b336000908152601860205260408120805491611445836131db565b909155505060195433600090815260186020526040902054111561147b5760405162461bcd60e51b8152600401610bd6906134bc565b6114f1565b816001036114d957336000908152601a602052604081208054916114a3836131db565b9091555050601b54336000908152601a6020526040902054111561147b5760405162461bcd60e51b8152600401610bd6906134eb565b60405162461bcd60e51b8152600401610bd690613520565b6000805490506115148b6001604051806020016040528060008152506000612082565b6001600160a01b038b1660009081526008602090815260408220805460018101825590835290822001829055601c54620f424090611552908d61325a565b61155c919061328f565b90506000620f424061156c611b86565b611576848f6132a3565b611580919061325a565b61158a919061328f565b9050600081611599848f6132a3565b6115a391906132a3565b905082600d60008282546115b79190613530565b9250508190555081600f60008282546115d09190613530565b9250508190555080600e60008282546115e99190613530565b925050819055506040518060600160405280888152602001600081526020018e8152506020600086815260200190815260200160002060008201518160000155602082015181600101556040820151816002015590505050505050808061164f906131db565b9150506113af565b5080600114806116765750600160115461167191906132a3565b600054145b1561169957601e54600160201b03611699576116954262093a80613530565b601e555b505050505050505050565b602281815481106116b457600080fd5b60009182526020909120600290910201805460019091015490915082565b60606116dd82611a13565b6116fa57604051630a14c4b560e41b815260040160405180910390fd5b6000611704612224565b90508051600003611724576040518060200160405280600081525061174f565b8061172e846122f4565b60405160200161173f92919061356a565b6040516020818303038152906040525b9392505050565b600c60009054906101000a90046001600160a01b03166001600160a01b03166360755dc76040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a457600080fd5b505afa1580156117b8573d6000803e3d6000fd5b50505050601e5442106117dd5760405162461bcd60e51b8152600401610bd69061359c565b601d55565b6117ea6119e4565b6117f2611d89565b600e80546000909155611803611100565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015611135573d6000803e3d6000fd5b6001600160a01b038316600090815260086020526040812054606091906118639085906132a3565b9050828111156118705750815b6000816001600160401b0381111561188a5761188a612e90565b6040519080825280602002602001820160405280156118b3578160200160208202803683370190505b50905060005b84811015611956576001600160a01b0387166000908152600860205260409020546118e48783613530565b1015611956576001600160a01b038716600090815260086020526040902061190c8783613530565b8154811061191c5761191c6131af565b9060005260206000200154828281518110611939576119396131af565b60209081029190910101528061194e816131db565b9150506118b9565b5095945050505050565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6119966119e4565b6001600160a01b0381166119bc5760405162461bcd60e51b8152600401610bd6906135ac565b6119c581611d37565b50565b6119d06119e4565b600b55565b6001600160a01b03163b151590565b336119ed611100565b6001600160a01b0316146110665760405162461bcd60e51b8152600401610bd690613626565b6000805482108015610a63575050600090815260046020526040902054600160e01b900460ff161590565b600a54600003611a4b5750565b6daaeb6d7670e522a718067333cd4e3b156119c557604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c617113490611a939030908590600401613636565b602060405180830381865afa158015611ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad4919061365c565b6119c55780604051633b79c77360e21b8152600401610bd69190612c67565b6000611afe82610ff4565b9050806001600160a01b0316836001600160a01b031603611b325760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590611b525750611b508133611960565b155b15611b70576040516367d9dca160e11b815260040160405180910390fd5b610b60838383612387565b610b608383836123e3565b600080805b602154811015611bd95760218181548110611ba857611ba86131af565b90600052602060002090600202016001015482611bc59190613530565b915080611bd1816131db565b915050611b8b565b50620f4240811115611bfd5760405162461bcd60e51b8152600401610bd69061369a565b919050565b610b6083838360405180602001604052806000815250611231565b604080516060810182526000808252602082018190529181019190915281600054811015611d1e57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290611d1c5780516001600160a01b031615611cb3579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215611d17579392505050565b611cb3565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b602254811015611deb5760228181548110611da957611da96131af565b9060005260206000209060020201600001544211611dd95760405162461bcd60e51b8152600401610bd6906136d0565b80611de3816131db565b915050611d8c565b50601e544211611e0d5760405162461bcd60e51b8152600401610bd6906136ff565b601d54156110665760405162461bcd60e51b8152600401610bd690613732565b336001600160a01b03831603611e565760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190611eb9908590612b8c565b60405180910390a35050565b611ed08484846123e3565b611ee2836001600160a01b03166119d5565b8015611ef75750611ef5848484846123f9565b155b15610b97576040516368d2bf6b60e11b815260040160405180910390fd5b60408051808201909152601c81527b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b60208201526000611f56898989896124e5565b905060008282604051602001611f6d929190613742565b604051602081830303815290604052805190602001209050600060018286898960405160008152602001604052604051611faa9493929190613761565b6020604051602081039080840390855afa158015611fcc573d6000803e3d6000fd5b505060408051601f19810151600c546305b7633d60e41b835292519094506001600160a01b039092169250635b7633d09160048083019260209291908290030181865afa158015612021573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061204591906132c5565b6001600160a01b0316816001600160a01b0316146120755760405162461bcd60e51b8152600401610bd6906137bb565b5050505050505050505050565b6000546001600160a01b0385166120ab57604051622e076360e81b815260040160405180910390fd5b836000036120cc5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546001600160801b031981166001600160401b038083168c018116918217600160401b6001600160401b031990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b4290921691909102179055808085018380156121725750612172876001600160a01b03166119d5565b156121e8575b60405182906001600160a01b0389169060009060008051602061398e833981519152908290a46121b160008884806001019550886123f9565b6121ce576040516368d2bf6b60e11b815260040160405180910390fd5b8082036121785782600054146121e357600080fd5b61221b565b5b6040516001830192906001600160a01b0389169060009060008051602061398e833981519152908290a48082036121e9575b50600055611257565b60606000600c60009054906101000a90046001600160a01b03166001600160a01b031663891678566040518163ffffffff1660e01b8152600401600060405180830381865afa15801561227b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122a39190810190613823565b9050806122ce306040516020016122ba9190613885565b60405160208183030381529060405261251e565b6040516020016122df929190613897565b60405160208183030381529060405291505090565b606060006123018361272e565b60010190506000816001600160401b0381111561232057612320612e90565b6040519080825280601f01601f19166020018201604052801561234a576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612354575b509392505050565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6123ee838383612804565b610b608383836129dc565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061242e9033908990889088906004016138bf565b6020604051808303816000875af1925050508015612469575060408051601f3d908101601f191682019092526124669181019061390e565b60015b6124c7573d808015612497576040519150601f19603f3d011682016040523d82523d6000602084013e61249c565b606091505b5080516000036124bf576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6000848484846040516020016124fe949392919061393b565b604051602081830303815290604052805190602001209050949350505050565b60408051808201909152601081526f181899199a1a9b1b9c1cb0b131b232b360811b602082015281516060919060009061255990600261325a565b612564906002613530565b6001600160401b0381111561257b5761257b612e90565b6040519080825280601f01601f1916602001820160405280156125a5576020820181803683370190505b509050600360fc1b816000815181106125c0576125c06131af565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106125ef576125ef6131af565b60200101906001600160f81b031916908160001a90535060005b845181101561237f57826004868381518110612627576126276131af565b016020015182516001600160f81b031990911690911c60f81c90811061264f5761264f6131af565b01602001516001600160f81b0319168261266a83600261325a565b612675906002613530565b81518110612685576126856131af565b60200101906001600160f81b031916908160001a905350828582815181106126af576126af6131af565b602091010151815160f89190911c600f169081106126cf576126cf6131af565b01602001516001600160f81b031916826126ea83600261325a565b6126f5906003613530565b81518110612705576127056131af565b60200101906001600160f81b031916908160001a90535080612726816131db565b915050612609565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061276d5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310612797576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106127b557662386f26fc10000830492506010015b6305f5e10083106127cd576305f5e100830492506008015b61271083106127e157612710830492506004015b606483106127f3576064830492506002015b600a8310610a635760010192915050565b600061280f82611c1d565b9050836001600160a01b031681600001516001600160a01b0316146128465760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061286457506128648533611960565b8061287f57503361287484610b08565b6001600160a01b0316145b90508061289f57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166128c657604051633a954ecd60e21b815260040160405180910390fd5b6128d260008487612387565b6001600160a01b03858116600090815260056020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166129a55760005482146129a557805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b031660008051602061398e83398151915260405160405180910390a4611257565b6001600160a01b038216600090815260086020908152604082208054600181018255908352908220018290555b6001600160a01b038416600090815260086020526040902054811015610b97576001600160a01b0384166000908152600860205260409020805483919083908110612a5657612a566131af565b906000526020600020015403612b2d576001600160a01b03841660009081526008602052604090208054612a8c906001906132a3565b81548110612a9c57612a9c6131af565b906000526020600020015460086000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110612add57612add6131af565b60009182526020808320909101929092556001600160a01b0386168152600890915260409020805480612b1257612b12613977565b60019003818190600052602060002001600090559055610b97565b80612b37816131db565b915050612a09565b6001600160e01b031981165b81146119c557600080fd5b8035610a6381612b3f565b600060208284031215612b7657612b76600080fd5b60006124dd8484612b56565b8015155b82525050565b60208101610a638284612b82565b60005b83811015612bb5578181015183820152602001612b9d565b83811115610b975750506000910152565b601f01601f191690565b6000612bda825190565b808452602084019350612bf1818560208601612b9a565b612bfa81612bc6565b9093019392505050565b6020808252810161174f8184612bd0565b80612b4b565b8035610a6381612c15565b600060208284031215612c3b57612c3b600080fd5b60006124dd8484612c1b565b6001600160a01b031690565b6000610a6382612c47565b612b8681612c53565b60208101610a638284612c5e565b80612b86565b60208101610a638284612c75565b612b4b81612c53565b8035610a6381612c89565b60008060408385031215612cb357612cb3600080fd5b6000612cbf8585612c92565b9250506020612cd085828601612c1b565b9150509250929050565b60608101612ce88286612c75565b612cf56020830185612c75565b6124dd6040830184612c75565b600080600060608486031215612d1a57612d1a600080fd5b6000612d268686612c92565b9350506020612d3786828701612c92565b9250506040612d4886828701612c1b565b9150509250925092565b6000610a63612d66612d6384612c47565b90565b612c47565b6000610a6382612d52565b6000610a6382612d6b565b612b8681612d76565b60208101610a638284612d81565b612da28282612c75565b5060200190565b60200190565b6000612db9825190565b808452602093840193830160005b82811015612dec578151612ddb8782612d98565b965050602082019150600101612dc7565b5093949350505050565b6020808252810161174f8184612daf565b600060208284031215612e1c57612e1c600080fd5b60006124dd8484612c92565b60008060408385031215612e3e57612e3e600080fd5b6000612cbf8585612c1b565b801515612b4b565b8035610a6381612e4a565b60008060408385031215612e7357612e73600080fd5b6000612e7f8585612c92565b9250506020612cd085828601612e52565b634e487b7160e01b600052604160045260246000fd5b612eaf82612bc6565b81018181106001600160401b0382111715612ecc57612ecc612e90565b6040525050565b6000612ede60405190565b9050611bfd8282612ea6565b60006001600160401b03821115612f0357612f03612e90565b612f0c82612bc6565b60200192915050565b82818337506000910152565b6000612f34612f2f84612eea565b612ed3565b905082815260208101848484011115612f4f57612f4f600080fd5b61237f848285612f15565b600082601f830112612f6e57612f6e600080fd5b81356124dd848260208601612f21565b60008060008060808587031215612f9757612f97600080fd5b6000612fa38787612c92565b9450506020612fb487828801612c92565b9350506040612fc587828801612c1b565b92505060608501356001600160401b03811115612fe457612fe4600080fd5b612ff087828801612f5a565b91505092959194509250565b6040810161300a8285612c5e565b61174f6020830184612c75565b60ff8116612b4b565b8035610a6381613017565b600080600080600080600060e0888a03121561304957613049600080fd5b60006130558a8a612c92565b97505060206130668a828b01612c1b565b96505060406130778a828b01612c1b565b95505060606130888a828b01612c1b565b94505060806130998a828b01612c1b565b93505060a06130aa8a828b01612c1b565b92505060c06130bb8a828b01613020565b91505092959891949750929550565b6040810161300a8285612c75565b6000806000606084860312156130f0576130f0600080fd5b60006130fc8686612c92565b9350506020612d3786828701612c1b565b6000806040838503121561312357613123600080fd5b600061312f8585612c92565b9250506020612cd085828601612c92565b634e487b7160e01b600052602260045260246000fd5b60028104600182168061316a57607f821691505b60208210810361317c5761317c613140565b50919050565b60088152602081016726a11d37bbb732b960c11b81529050612da9565b60208082528101610a6381613182565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016131ed576131ed6131c5565b5060010190565b60118152602081017013508e9c99599d5b99139bdd105d985a5b607a1b81529050612da9565b60208082528101610a63816131f4565b600b8152602081016a13508e9c99599d5b99195960aa1b81529050612da9565b60208082528101610a638161322a565b6000816000190483118215151615613274576132746131c5565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261329e5761329e613279565b500490565b6000828210156132b5576132b56131c5565b500390565b8051610a6381612c89565b6000602082840312156132da576132da600080fd5b60006124dd84846132ba565b600b8152602081016a4d423a6e6f74416c6c6f7760a81b81529050612da9565b60208082528101610a63816132e6565b60098152602081016813508e9c185d5cd95960ba1b81529050612da9565b60208082528101610a6381613316565b600e8152602081016d13508e939bdd081cdd185c9d195960921b81529050612da9565b60208082528101610a6381613344565b600e8152602081016d13508e9c1c995cd85b19481d985b60921b81529050612da9565b60208082528101610a6381613377565b600d8152602081016c4d423a6d696e745f707269636560981b81529050612da9565b60208082528101610a63816133aa565b600b8152602081016a13508e9cd85b19481d985b60aa1b81529050612da9565b60208082528101610a63816133dc565b600f8152602081016e13508e925b9d985b081c195c9a5bd9608a1b81529050612da9565b60208082528101610a638161340c565b600a815260208101694d423a4e6f206d6f726560b01b81529050612da9565b60208082528101610a6381613440565b60098152602081016813508e915e18d9595960ba1b81529050612da9565b60208082528101610a638161346f565b600a815260208101694d423a6164647228412960b01b81529050612da9565b60208082528101610a638161349d565b600a815260208101694d423a6164647228422960b01b81529050612da9565b60208082528101610a63816134cc565b60108152602081016f13508e939bdd14d85b1954195c9a5bd960821b81529050612da9565b60208082528101610a63816134fb565b60008219821115613543576135436131c5565b500190565b6000613552825190565b613560818560208601612b9a565b9290920192915050565b6135748184613548565b905061174f8183613548565b6007815260208101664d463a74696d6560c81b81529050612da9565b60208082528101610a6381613580565b60208082528101610a6381602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201526564647265737360d01b604082015260600190565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65729101908152612da9565b60208082528101610a63816135f6565b604081016136448285612c5e565b61174f6020830184612c5e565b8051610a6381612e4a565b60006020828403121561367157613671600080fd5b60006124dd8484613651565b6008815260208101674d423a726174696f60c01b81529050612da9565b60208082528101610a638161367d565b6011815260208101704d423a726566756e64446561646c696e6560781b81529050612da9565b60208082528101610a63816136aa565b600a8152602081016913508e8dd9131a5b5a5d60b21b81529050612da9565b60208082528101610a63816136e0565b600e8152602081016d13508e999bdc98d95499599d5b9960921b81529050612da9565b60208082528101610a638161370f565b61374c8184613548565b9050612f0c8183612c75565b60ff8116612b86565b6080810161376f8287612c75565b61377c6020830186613758565b6137896040830185612c75565b6137966060830184612c75565b95945050505050565b60078152602081016626a11d39b4b3b760c91b81529050612da9565b60208082528101610a638161379f565b60006137d9612f2f84612eea565b9050828152602081018484840111156137f4576137f4600080fd5b61237f848285612b9a565b600082601f83011261381357613813600080fd5b81516124dd8482602086016137cb565b60006020828403121561383857613838600080fd5b81516001600160401b0381111561385157613851600080fd5b6124dd848285016137ff565b6000610a638260601b90565b6000610a638261385d565b612b8661388082612d76565b613869565b61388f8183613874565b601401919050565b6138a18184613548565b90506138ad8183613548565b602f60f81b815290506001810161174f565b608081016138cd8287612c5e565b6138da6020830186612c5e565b6138e76040830185612c75565b81810360608301526138f98184612bd0565b9695505050505050565b8051610a6381612b3f565b60006020828403121561392357613923600080fd5b60006124dd8484613903565b612b8661388082612c53565b613945818661392f565b6014016139528185612c75565b60200161395f8184612c75565b60200161396c8183612c75565b602001949350505050565b634e487b7160e01b600052603160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220494c5b1021d0d1a35a4d10e69420155392f8f4a093f6b2de956ae533aab43fd064736f6c634300080e0033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000034000000000000000000000000000000000000000000000000000000000000003600000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000000870726f6a6563744100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035047410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000010e000000000000000000000000000000000000000000000000000000006397c08000000000000000000000000000000000000000000000000000000000639912000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002540be4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063981a340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102cd5760003560e01c80637d6849c8116101775780637d6849c8146106a157806383197ef0146106b75780638ac433ae146106cc5780638da5cb5b146106e2578063952bd074146106f757806395d89b4114610717578063979aea0f1461072c578063a22cb4651461074c578063a2309ff81461076c578063a7f3e70f14610781578063a82524b2146107a1578063b88d4fde146107b7578063bcce5826146107d7578063bcfdb30914610805578063bedcf00314610818578063c3e386b91461082e578063c45a01551461085c578063c7424f671461087c578063c87b56dd146108a9578063d038e28a146108c9578063d90f5f42146108de578063da5f524a146108fe578063e522538114610914578063e79f534314610929578063e985e9c514610949578063ec40217514610969578063ed338ff11461097f578063f134e14514610995578063f2fde38b146109aa578063f405741c146109ca578063f4a0a528146109f757600080fd5b806301ffc9a7146102d257806306fdde031461030857806307aae87a1461032a578063081812fc1461034c57806308fc299b14610379578063095ea7b31461039c5780630a403f04146103bc5780630afe6b91146103dc57806313e2e3dd146103f2578063151ba8001461040857806316eeb50b1461041e57806318160ddd146104345780631cbaee2d1461044d5780631ed5b0c41461046357806322f4596f146104ad57806323b872dd146104c3578063249b7c19146104e3578063278ecde1146104f957806341aba9e81461051957806341f434341461053957806342842e0e14610568578063498927eb1461058857806351789ea2146105a857806353ed5143146105c85780635c975abb146105ea5780635d0b89541461060057806362a5dbbc146106205780636352211e1461063657806364de051e1461065657806370a082311461066c578063715018a61461068c575b600080fd5b3480156102de57600080fd5b506102f26102ed366004612b61565b610a17565b6040516102ff9190612b8c565b60405180910390f35b34801561031457600080fd5b5061031d610a69565b6040516102ff9190612c04565b34801561033657600080fd5b5061034a610345366004612c26565b610afb565b005b34801561035857600080fd5b5061036c610367366004612c26565b610b08565b6040516102ff9190612c67565b34801561038557600080fd5b5061038f60165481565b6040516102ff9190612c7b565b3480156103a857600080fd5b5061034a6103b7366004612c9d565b610b4c565b3480156103c857600080fd5b5061034a6103d7366004612c26565b610b65565b3480156103e857600080fd5b5061038f601b5481565b3480156103fe57600080fd5b5061038f60175481565b34801561041457600080fd5b5061038f600f5481565b34801561042a57600080fd5b5061038f600a5481565b34801561044057600080fd5b506001546000540361038f565b34801561045957600080fd5b5061038f60145481565b34801561046f57600080fd5b5061049e61047e366004612c26565b602080526000908152604090208054600182015460029092015490919083565b6040516102ff93929190612cda565b3480156104b957600080fd5b5061038f60115481565b3480156104cf57600080fd5b5061034a6104de366004612d02565b610b72565b3480156104ef57600080fd5b5061038f60135481565b34801561050557600080fd5b5061034a610514366004612c26565b610b9d565b34801561052557600080fd5b5061034a610534366004612c26565b610e3a565b34801561054557600080fd5b5061055b6daaeb6d7670e522a718067333cd4e81565b6040516102ff9190612d8a565b34801561057457600080fd5b5061034a610583366004612d02565b610e47565b34801561059457600080fd5b5061038f6105a3366004612c9d565b610e6c565b3480156105b457600080fd5b5061034a6105c3366004612c26565b610e9d565b3480156105d457600080fd5b506105dd610eaa565b6040516102ff9190612df6565b3480156105f657600080fd5b5061038f601f5481565b34801561060c57600080fd5b5061034a61061b366004612c26565b610fe7565b34801561062c57600080fd5b5061038f600d5481565b34801561064257600080fd5b5061036c610651366004612c26565b610ff4565b34801561066257600080fd5b5061038f601e5481565b34801561067857600080fd5b5061038f610687366004612e07565b611006565b34801561069857600080fd5b5061034a611054565b3480156106ad57600080fd5b5061038f60195481565b3480156106c357600080fd5b5061034a611068565b3480156106d857600080fd5b5061038f601c5481565b3480156106ee57600080fd5b5061036c611100565b34801561070357600080fd5b5061034a610712366004612e28565b61110f565b34801561072357600080fd5b5061031d611139565b34801561073857600080fd5b5061034a610747366004612e07565b611148565b34801561075857600080fd5b5061034a610767366004612e5d565b6111f7565b34801561077857600080fd5b5060005461038f565b34801561078d57600080fd5b5061034a61079c366004612e28565b61120b565b3480156107ad57600080fd5b5061038f60125481565b3480156107c357600080fd5b5061034a6107d2366004612f7e565b611231565b3480156107e357600080fd5b506107f76107f2366004612c26565b61125e565b6040516102ff929190612ffc565b61034a61081336600461302b565b611296565b34801561082457600080fd5b5061038f600e5481565b34801561083a57600080fd5b5061084e610849366004612c26565b6116a4565b6040516102ff9291906130ca565b34801561086857600080fd5b50600c5461036c906001600160a01b031681565b34801561088857600080fd5b5061038f610897366004612e07565b60186020526000908152604090205481565b3480156108b557600080fd5b5061031d6108c4366004612c26565b6116d2565b3480156108d557600080fd5b5060215461038f565b3480156108ea57600080fd5b5061034a6108f9366004612c26565b611756565b34801561090a57600080fd5b5061038f601d5481565b34801561092057600080fd5b5061034a6117e2565b34801561093557600080fd5b506105dd6109443660046130d8565b61183b565b34801561095557600080fd5b506102f261096436600461310d565b611960565b34801561097557600080fd5b5061038f600b5481565b34801561098b57600080fd5b5061038f60155481565b3480156109a157600080fd5b5060225461038f565b3480156109b657600080fd5b5061034a6109c5366004612e07565b61198e565b3480156109d657600080fd5b5061038f6109e5366004612e07565b601a6020526000908152604090205481565b348015610a0357600080fd5b5061034a610a12366004612c26565b6119c8565b60006001600160e01b031982166380ac58cd60e01b1480610a4857506001600160e01b03198216635b5e139f60e01b145b80610a6357506301ffc9a760e01b6001600160e01b03198316145b92915050565b606060028054610a7890613156565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa490613156565b8015610af15780601f10610ac657610100808354040283529160200191610af1565b820191906000526020600020905b815481529060010190602001808311610ad457829003601f168201915b5050505050905090565b610b036119e4565b601b55565b6000610b1382611a13565b610b30576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b81610b5681611a3e565b610b608383611af3565b505050565b610b6d6119e4565b601655565b826001600160a01b0381163314610b8c57610b8c33611a3e565b610b97848484611b7b565b50505050565b610ba681610ff4565b6001600160a01b0316336001600160a01b031614610bdf5760405162461bcd60e51b8152600401610bd69061319f565b60405180910390fd5b6000601d54600103610bf55750620f4240610c6e565b60005b602254811015610c6c5760228181548110610c1557610c156131af565b906000526020600020906002020160000154421015610c5a5760228181548110610c4157610c416131af565b9060005260206000209060020201600101549150610c6c565b80610c64816131db565b915050610bf8565b505b60008111610c8e5760405162461bcd60e51b8152600401610bd69061321a565b60008281526020805260409020600181015415610cbd5760405162461bcd60e51b8152600401610bd69061324a565b6000620f4240838360020154610cd3919061325a565b610cdd919061328f565b90506000620f4240601c5483610cf3919061325a565b610cfd919061328f565b90506000620f4240610d0d611b86565b610d1784866132a3565b610d21919061325a565b610d2b919061328f565b9050600081610d3a84866132a3565b610d4491906132a3565b905082600d6000828254610d5891906132a3565b9250508190555081600f6000828254610d7191906132a3565b9250508190555080600e6000828254610d8a91906132a3565b92505081905550610dfd33306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df791906132c5565b89610b72565b600185810155604051339085156108fc029086906000818181858888f19350505050158015610e30573d6000803e3d6000fd5b5050505050505050565b610e426119e4565b601955565b826001600160a01b0381163314610e6157610e6133611a3e565b610b97848484611c02565b60086020528160005260406000208181548110610e8857600080fd5b90600052602060002001600091509150505481565b610ea56119e4565b601f55565b60408051600c8082526101a0820190925260609160009190602082016101808036833701905050905060105481600081518110610ee957610ee96131af565b60200260200101818152505060115481600181518110610f0b57610f0b6131af565b60200260200101818152505060165481600281518110610f2d57610f2d6131af565b60200260200101818152505060125481600481518110610f4f57610f4f6131af565b60200260200101818152505060135481600581518110610f7157610f716131af565b60200260200101818152505060145481600681518110610f9357610f936131af565b60200260200101818152505060155481600781518110610fb557610fb56131af565b602002602001018181525050600b5481600981518110610fd757610fd76131af565b6020908102919091010152919050565b610fef6119e4565b600a55565b6000610fff82611c1d565b5192915050565b60006001600160a01b03821661102f576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b61105c6119e4565b6110666000611d37565b565b6110706119e4565b601054600054146110935760405162461bcd60e51b8152600401610bd690613306565b306001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f591906132c5565b6001600160a01b0316ff5b6009546001600160a01b031690565b6111176119e4565b6012829055600081900361112f576000190160135550565b60138190555b5050565b606060038054610a7890613156565b600c60009054906101000a90046001600160a01b03166001600160a01b03166360755dc76040518163ffffffff1660e01b815260040160006040518083038186803b15801561119657600080fd5b505afa1580156111aa573d6000803e3d6000fd5b505050506111b6611d89565b600d805460009182905560405190916001600160a01b0384169183156108fc0291849190818181858888f19350505050158015610b60573d6000803e3d6000fd5b8161120181611a3e565b610b608383611e2d565b6112136119e4565b6014829055600081900361122b576000190160155550565b60155550565b836001600160a01b038116331461124b5761124b33611a3e565b61125785858585611ec5565b5050505050565b6021818154811061126e57600080fd5b6000918252602090912060029091020180546001909101546001600160a01b03909116915082565b601f54156112b65760405162461bcd60e51b8152600401610bd690613334565b6000806012544210156112db5760405162461bcd60e51b8152600401610bd690613367565b60125442101580156112ee575060135442105b15611325576112fd878961325a565b34101561131c5760405162461bcd60e51b8152600401610bd69061339a565b600191506113ac565b601454421015801561133957506015544211155b1561139457600b54881461135f5760405162461bcd60e51b8152600401610bd6906133cc565b86600b5461136d919061325a565b34101561138c5760405162461bcd60e51b8152600401610bd6906133fc565b5060016113ac565b60405162461bcd60e51b8152600401610bd690613430565b60005b8781101561165757601154600054106113da5760405162461bcd60e51b8152600401610bd69061345f565b82600103611480576113f18a8a8a8a8a8a8a611f15565b60178054906000611401836131db565b9190505550601654601754111561142a5760405162461bcd60e51b8152600401610bd69061348d565b336000908152601860205260408120805491611445836131db565b909155505060195433600090815260186020526040902054111561147b5760405162461bcd60e51b8152600401610bd6906134bc565b6114f1565b816001036114d957336000908152601a602052604081208054916114a3836131db565b9091555050601b54336000908152601a6020526040902054111561147b5760405162461bcd60e51b8152600401610bd6906134eb565b60405162461bcd60e51b8152600401610bd690613520565b6000805490506115148b6001604051806020016040528060008152506000612082565b6001600160a01b038b1660009081526008602090815260408220805460018101825590835290822001829055601c54620f424090611552908d61325a565b61155c919061328f565b90506000620f424061156c611b86565b611576848f6132a3565b611580919061325a565b61158a919061328f565b9050600081611599848f6132a3565b6115a391906132a3565b905082600d60008282546115b79190613530565b9250508190555081600f60008282546115d09190613530565b9250508190555080600e60008282546115e99190613530565b925050819055506040518060600160405280888152602001600081526020018e8152506020600086815260200190815260200160002060008201518160000155602082015181600101556040820151816002015590505050505050808061164f906131db565b9150506113af565b5080600114806116765750600160115461167191906132a3565b600054145b1561169957601e54600160201b03611699576116954262093a80613530565b601e555b505050505050505050565b602281815481106116b457600080fd5b60009182526020909120600290910201805460019091015490915082565b60606116dd82611a13565b6116fa57604051630a14c4b560e41b815260040160405180910390fd5b6000611704612224565b90508051600003611724576040518060200160405280600081525061174f565b8061172e846122f4565b60405160200161173f92919061356a565b6040516020818303038152906040525b9392505050565b600c60009054906101000a90046001600160a01b03166001600160a01b03166360755dc76040518163ffffffff1660e01b815260040160006040518083038186803b1580156117a457600080fd5b505afa1580156117b8573d6000803e3d6000fd5b50505050601e5442106117dd5760405162461bcd60e51b8152600401610bd69061359c565b601d55565b6117ea6119e4565b6117f2611d89565b600e80546000909155611803611100565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015611135573d6000803e3d6000fd5b6001600160a01b038316600090815260086020526040812054606091906118639085906132a3565b9050828111156118705750815b6000816001600160401b0381111561188a5761188a612e90565b6040519080825280602002602001820160405280156118b3578160200160208202803683370190505b50905060005b84811015611956576001600160a01b0387166000908152600860205260409020546118e48783613530565b1015611956576001600160a01b038716600090815260086020526040902061190c8783613530565b8154811061191c5761191c6131af565b9060005260206000200154828281518110611939576119396131af565b60209081029190910101528061194e816131db565b9150506118b9565b5095945050505050565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b6119966119e4565b6001600160a01b0381166119bc5760405162461bcd60e51b8152600401610bd6906135ac565b6119c581611d37565b50565b6119d06119e4565b600b55565b6001600160a01b03163b151590565b336119ed611100565b6001600160a01b0316146110665760405162461bcd60e51b8152600401610bd690613626565b6000805482108015610a63575050600090815260046020526040902054600160e01b900460ff161590565b600a54600003611a4b5750565b6daaeb6d7670e522a718067333cd4e3b156119c557604051633185c44d60e21b81526daaeb6d7670e522a718067333cd4e9063c617113490611a939030908590600401613636565b602060405180830381865afa158015611ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad4919061365c565b6119c55780604051633b79c77360e21b8152600401610bd69190612c67565b6000611afe82610ff4565b9050806001600160a01b0316836001600160a01b031603611b325760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590611b525750611b508133611960565b155b15611b70576040516367d9dca160e11b815260040160405180910390fd5b610b60838383612387565b610b608383836123e3565b600080805b602154811015611bd95760218181548110611ba857611ba86131af565b90600052602060002090600202016001015482611bc59190613530565b915080611bd1816131db565b915050611b8b565b50620f4240811115611bfd5760405162461bcd60e51b8152600401610bd69061369a565b919050565b610b6083838360405180602001604052806000815250611231565b604080516060810182526000808252602082018190529181019190915281600054811015611d1e57600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16151591810182905290611d1c5780516001600160a01b031615611cb3579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff1615159281019290925215611d17579392505050565b611cb3565b505b604051636f96cda160e11b815260040160405180910390fd5b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60005b602254811015611deb5760228181548110611da957611da96131af565b9060005260206000209060020201600001544211611dd95760405162461bcd60e51b8152600401610bd6906136d0565b80611de3816131db565b915050611d8c565b50601e544211611e0d5760405162461bcd60e51b8152600401610bd6906136ff565b601d54156110665760405162461bcd60e51b8152600401610bd690613732565b336001600160a01b03831603611e565760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3190611eb9908590612b8c565b60405180910390a35050565b611ed08484846123e3565b611ee2836001600160a01b03166119d5565b8015611ef75750611ef5848484846123f9565b155b15610b97576040516368d2bf6b60e11b815260040160405180910390fd5b60408051808201909152601c81527b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b60208201526000611f56898989896124e5565b905060008282604051602001611f6d929190613742565b604051602081830303815290604052805190602001209050600060018286898960405160008152602001604052604051611faa9493929190613761565b6020604051602081039080840390855afa158015611fcc573d6000803e3d6000fd5b505060408051601f19810151600c546305b7633d60e41b835292519094506001600160a01b039092169250635b7633d09160048083019260209291908290030181865afa158015612021573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061204591906132c5565b6001600160a01b0316816001600160a01b0316146120755760405162461bcd60e51b8152600401610bd6906137bb565b5050505050505050505050565b6000546001600160a01b0385166120ab57604051622e076360e81b815260040160405180910390fd5b836000036120cc5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546001600160801b031981166001600160401b038083168c018116918217600160401b6001600160401b031990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b4290921691909102179055808085018380156121725750612172876001600160a01b03166119d5565b156121e8575b60405182906001600160a01b0389169060009060008051602061398e833981519152908290a46121b160008884806001019550886123f9565b6121ce576040516368d2bf6b60e11b815260040160405180910390fd5b8082036121785782600054146121e357600080fd5b61221b565b5b6040516001830192906001600160a01b0389169060009060008051602061398e833981519152908290a48082036121e9575b50600055611257565b60606000600c60009054906101000a90046001600160a01b03166001600160a01b031663891678566040518163ffffffff1660e01b8152600401600060405180830381865afa15801561227b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122a39190810190613823565b9050806122ce306040516020016122ba9190613885565b60405160208183030381529060405261251e565b6040516020016122df929190613897565b60405160208183030381529060405291505090565b606060006123018361272e565b60010190506000816001600160401b0381111561232057612320612e90565b6040519080825280601f01601f19166020018201604052801561234a576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612354575b509392505050565b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6123ee838383612804565b610b608383836129dc565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061242e9033908990889088906004016138bf565b6020604051808303816000875af1925050508015612469575060408051601f3d908101601f191682019092526124669181019061390e565b60015b6124c7573d808015612497576040519150601f19603f3d011682016040523d82523d6000602084013e61249c565b606091505b5080516000036124bf576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6000848484846040516020016124fe949392919061393b565b604051602081830303815290604052805190602001209050949350505050565b60408051808201909152601081526f181899199a1a9b1b9c1cb0b131b232b360811b602082015281516060919060009061255990600261325a565b612564906002613530565b6001600160401b0381111561257b5761257b612e90565b6040519080825280601f01601f1916602001820160405280156125a5576020820181803683370190505b509050600360fc1b816000815181106125c0576125c06131af565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106125ef576125ef6131af565b60200101906001600160f81b031916908160001a90535060005b845181101561237f57826004868381518110612627576126276131af565b016020015182516001600160f81b031990911690911c60f81c90811061264f5761264f6131af565b01602001516001600160f81b0319168261266a83600261325a565b612675906002613530565b81518110612685576126856131af565b60200101906001600160f81b031916908160001a905350828582815181106126af576126af6131af565b602091010151815160f89190911c600f169081106126cf576126cf6131af565b01602001516001600160f81b031916826126ea83600261325a565b6126f5906003613530565b81518110612705576127056131af565b60200101906001600160f81b031916908160001a90535080612726816131db565b915050612609565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b831061276d5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310612797576904ee2d6d415b85acef8160201b830492506020015b662386f26fc1000083106127b557662386f26fc10000830492506010015b6305f5e10083106127cd576305f5e100830492506008015b61271083106127e157612710830492506004015b606483106127f3576064830492506002015b600a8310610a635760010192915050565b600061280f82611c1d565b9050836001600160a01b031681600001516001600160a01b0316146128465760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061286457506128648533611960565b8061287f57503361287484610b08565b6001600160a01b0316145b90508061289f57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166128c657604051633a954ecd60e21b815260040160405180910390fd5b6128d260008487612387565b6001600160a01b03858116600090815260056020908152604080832080546001600160401b03198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166129a55760005482146129a557805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b031660008051602061398e83398151915260405160405180910390a4611257565b6001600160a01b038216600090815260086020908152604082208054600181018255908352908220018290555b6001600160a01b038416600090815260086020526040902054811015610b97576001600160a01b0384166000908152600860205260409020805483919083908110612a5657612a566131af565b906000526020600020015403612b2d576001600160a01b03841660009081526008602052604090208054612a8c906001906132a3565b81548110612a9c57612a9c6131af565b906000526020600020015460086000866001600160a01b03166001600160a01b031681526020019081526020016000208281548110612add57612add6131af565b60009182526020808320909101929092556001600160a01b0386168152600890915260409020805480612b1257612b12613977565b60019003818190600052602060002001600090559055610b97565b80612b37816131db565b915050612a09565b6001600160e01b031981165b81146119c557600080fd5b8035610a6381612b3f565b600060208284031215612b7657612b76600080fd5b60006124dd8484612b56565b8015155b82525050565b60208101610a638284612b82565b60005b83811015612bb5578181015183820152602001612b9d565b83811115610b975750506000910152565b601f01601f191690565b6000612bda825190565b808452602084019350612bf1818560208601612b9a565b612bfa81612bc6565b9093019392505050565b6020808252810161174f8184612bd0565b80612b4b565b8035610a6381612c15565b600060208284031215612c3b57612c3b600080fd5b60006124dd8484612c1b565b6001600160a01b031690565b6000610a6382612c47565b612b8681612c53565b60208101610a638284612c5e565b80612b86565b60208101610a638284612c75565b612b4b81612c53565b8035610a6381612c89565b60008060408385031215612cb357612cb3600080fd5b6000612cbf8585612c92565b9250506020612cd085828601612c1b565b9150509250929050565b60608101612ce88286612c75565b612cf56020830185612c75565b6124dd6040830184612c75565b600080600060608486031215612d1a57612d1a600080fd5b6000612d268686612c92565b9350506020612d3786828701612c92565b9250506040612d4886828701612c1b565b9150509250925092565b6000610a63612d66612d6384612c47565b90565b612c47565b6000610a6382612d52565b6000610a6382612d6b565b612b8681612d76565b60208101610a638284612d81565b612da28282612c75565b5060200190565b60200190565b6000612db9825190565b808452602093840193830160005b82811015612dec578151612ddb8782612d98565b965050602082019150600101612dc7565b5093949350505050565b6020808252810161174f8184612daf565b600060208284031215612e1c57612e1c600080fd5b60006124dd8484612c92565b60008060408385031215612e3e57612e3e600080fd5b6000612cbf8585612c1b565b801515612b4b565b8035610a6381612e4a565b60008060408385031215612e7357612e73600080fd5b6000612e7f8585612c92565b9250506020612cd085828601612e52565b634e487b7160e01b600052604160045260246000fd5b612eaf82612bc6565b81018181106001600160401b0382111715612ecc57612ecc612e90565b6040525050565b6000612ede60405190565b9050611bfd8282612ea6565b60006001600160401b03821115612f0357612f03612e90565b612f0c82612bc6565b60200192915050565b82818337506000910152565b6000612f34612f2f84612eea565b612ed3565b905082815260208101848484011115612f4f57612f4f600080fd5b61237f848285612f15565b600082601f830112612f6e57612f6e600080fd5b81356124dd848260208601612f21565b60008060008060808587031215612f9757612f97600080fd5b6000612fa38787612c92565b9450506020612fb487828801612c92565b9350506040612fc587828801612c1b565b92505060608501356001600160401b03811115612fe457612fe4600080fd5b612ff087828801612f5a565b91505092959194509250565b6040810161300a8285612c5e565b61174f6020830184612c75565b60ff8116612b4b565b8035610a6381613017565b600080600080600080600060e0888a03121561304957613049600080fd5b60006130558a8a612c92565b97505060206130668a828b01612c1b565b96505060406130778a828b01612c1b565b95505060606130888a828b01612c1b565b94505060806130998a828b01612c1b565b93505060a06130aa8a828b01612c1b565b92505060c06130bb8a828b01613020565b91505092959891949750929550565b6040810161300a8285612c75565b6000806000606084860312156130f0576130f0600080fd5b60006130fc8686612c92565b9350506020612d3786828701612c1b565b6000806040838503121561312357613123600080fd5b600061312f8585612c92565b9250506020612cd085828601612c92565b634e487b7160e01b600052602260045260246000fd5b60028104600182168061316a57607f821691505b60208210810361317c5761317c613140565b50919050565b60088152602081016726a11d37bbb732b960c11b81529050612da9565b60208082528101610a6381613182565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016131ed576131ed6131c5565b5060010190565b60118152602081017013508e9c99599d5b99139bdd105d985a5b607a1b81529050612da9565b60208082528101610a63816131f4565b600b8152602081016a13508e9c99599d5b99195960aa1b81529050612da9565b60208082528101610a638161322a565b6000816000190483118215151615613274576132746131c5565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261329e5761329e613279565b500490565b6000828210156132b5576132b56131c5565b500390565b8051610a6381612c89565b6000602082840312156132da576132da600080fd5b60006124dd84846132ba565b600b8152602081016a4d423a6e6f74416c6c6f7760a81b81529050612da9565b60208082528101610a63816132e6565b60098152602081016813508e9c185d5cd95960ba1b81529050612da9565b60208082528101610a6381613316565b600e8152602081016d13508e939bdd081cdd185c9d195960921b81529050612da9565b60208082528101610a6381613344565b600e8152602081016d13508e9c1c995cd85b19481d985b60921b81529050612da9565b60208082528101610a6381613377565b600d8152602081016c4d423a6d696e745f707269636560981b81529050612da9565b60208082528101610a63816133aa565b600b8152602081016a13508e9cd85b19481d985b60aa1b81529050612da9565b60208082528101610a63816133dc565b600f8152602081016e13508e925b9d985b081c195c9a5bd9608a1b81529050612da9565b60208082528101610a638161340c565b600a815260208101694d423a4e6f206d6f726560b01b81529050612da9565b60208082528101610a6381613440565b60098152602081016813508e915e18d9595960ba1b81529050612da9565b60208082528101610a638161346f565b600a815260208101694d423a6164647228412960b01b81529050612da9565b60208082528101610a638161349d565b600a815260208101694d423a6164647228422960b01b81529050612da9565b60208082528101610a63816134cc565b60108152602081016f13508e939bdd14d85b1954195c9a5bd960821b81529050612da9565b60208082528101610a63816134fb565b60008219821115613543576135436131c5565b500190565b6000613552825190565b613560818560208601612b9a565b9290920192915050565b6135748184613548565b905061174f8183613548565b6007815260208101664d463a74696d6560c81b81529050612da9565b60208082528101610a6381613580565b60208082528101610a6381602681527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160208201526564647265737360d01b604082015260600190565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65729101908152612da9565b60208082528101610a63816135f6565b604081016136448285612c5e565b61174f6020830184612c5e565b8051610a6381612e4a565b60006020828403121561367157613671600080fd5b60006124dd8484613651565b6008815260208101674d423a726174696f60c01b81529050612da9565b60208082528101610a638161367d565b6011815260208101704d423a726566756e64446561646c696e6560781b81529050612da9565b60208082528101610a63816136aa565b600a8152602081016913508e8dd9131a5b5a5d60b21b81529050612da9565b60208082528101610a63816136e0565b600e8152602081016d13508e999bdc98d95499599d5b9960921b81529050612da9565b60208082528101610a638161370f565b61374c8184613548565b9050612f0c8183612c75565b60ff8116612b86565b6080810161376f8287612c75565b61377c6020830186613758565b6137896040830185612c75565b6137966060830184612c75565b95945050505050565b60078152602081016626a11d39b4b3b760c91b81529050612da9565b60208082528101610a638161379f565b60006137d9612f2f84612eea565b9050828152602081018484840111156137f4576137f4600080fd5b61237f848285612b9a565b600082601f83011261381357613813600080fd5b81516124dd8482602086016137cb565b60006020828403121561383857613838600080fd5b81516001600160401b0381111561385157613851600080fd5b6124dd848285016137ff565b6000610a638260601b90565b6000610a638261385d565b612b8661388082612d76565b613869565b61388f8183613874565b601401919050565b6138a18184613548565b90506138ad8183613548565b602f60f81b815290506001810161174f565b608081016138cd8287612c5e565b6138da6020830186612c5e565b6138e76040830185612c75565b81810360608301526138f98184612bd0565b9695505050505050565b8051610a6381612b3f565b60006020828403121561392357613923600080fd5b60006124dd8484613903565b612b8661388082612c53565b613945818661392f565b6014016139528185612c75565b60200161395f8184612c75565b60200161396c8183612c75565b602001949350505050565b634e487b7160e01b600052603160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220494c5b1021d0d1a35a4d10e69420155392f8f4a093f6b2de956ae533aab43fd064736f6c634300080e0033

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.