ETH Price: $2,758.97 (+4.53%)

Contract

0xaB362179c2533BD5Ac440D0D708483B697d08ff3
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040148617922022-05-28 18:09:16818 days ago1653761356IN
 Create: NTR
0 ETH0.0471660513.31631595

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NTR

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 17 : NTR.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.2;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract ContextMixin {
    function msgSender() internal view returns (address payable sender) {
        if (msg.sender == address(this)) {
            bytes memory array = msg.data;
            uint256 index = msg.data.length;
            assembly {
                // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
                sender := and(
                    mload(add(array, index)),
                    0xffffffffffffffffffffffffffffffffffffffff
                )
            }
        } else {
            sender = payable(msg.sender);
        }
        return sender;
    }

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

contract NTR is
    ERC1155Upgradeable,
    ERC2981Upgradeable,
    OwnableUpgradeable,
    ContextMixin
{
    address internal proxyRegistryAddress;
    string internal _contractURI;
    string internal _uriBase;

    uint8 private QUOTA_BIT;
    uint256 private QUOTA_LIMIT;

    enum MintMode {
        NOTOPEN,
        FREE,
        PAID
    }

    struct Token {
        // In the following, users mean those in the whitelist
        bool isInitialized; // Whether this type of token is created (false before creation)
        uint32 tokenSupply; // The upper limit of minted tokens
        uint32 numIssuedToken; // The number of currently minted tokens
        uint32 numPossibleHolder; // How many address may be holding this type of token
        uint256 mintFee; // How much the users need to pay for each token (in PAID Mode)
        mapping(uint256 => address) possibleHolder; // The addresses that have ever hold the tokens
    }
    mapping(uint256 => Token) private _token;

    struct Whitelist {
        MintMode mintMode; // Whether users can whitelistMint (if startMintTime is past) and whether they need to pay
        uint32 defaultFreeQuota; // The quota for tokens minted for free (in FREE mode)
        uint32 defaultPaidQuota; // The quota for tokens minted with mintFee (in PAID mode)
        uint256 startMintTime; // When the users can start whitelistMint
        bytes32 whitelistRoot; // The Merkle root of the whitelist
        mapping(address => uint32) compactQuota; // The remaining (free & paid) quota for users who have ever minted
    }

    Whitelist private _whitelist;

    function initialize(string memory uri_) public initializer {
        __ERC1155_init(uri_);
        __Ownable_init();

        proxyRegistryAddress = address(
            0x207Fa8Df3a17D96Ca7EA4f2893fcdCb78a304101
        );
        _contractURI = uri_;
        _uriBase = uri_;

        QUOTA_BIT = 15;
        QUOTA_LIMIT = 1 << QUOTA_BIT;

        _whitelist.mintMode = MintMode.NOTOPEN;
        _setDefaultRoyalty(_msgSender(),0); // default 0% royalty
    }

    function renounceOwnership() public virtual override onlyOwner {
        require(false, "renounceOwnership is disabled");
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override(ERC1155Upgradeable, ERC2981Upgradeable)
        returns (bool)
    {
        return
            interfaceId == type(IERC1155Upgradeable).interfaceId ||
            interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId ||
            interfaceId == type(IERC2981Upgradeable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    function _genQuotaUsedFreePaid(
        bool usedFree,
        bool usedPaid,
        uint32 freeQuota,
        uint32 paidQuota
    ) private view returns (uint32) {
        uint32 passFilter = ((uint32(1) << QUOTA_BIT) - 1);
        return
            ((usedFree ? uint32(1) : 0) << 31) |
            ((usedPaid ? uint32(1) : 0) << 30) |
            ((freeQuota & passFilter) << QUOTA_BIT) |
            (paidQuota & passFilter);
    }

    function _readQuotaUsedFreePaid(address account)
        private
        view
        returns (
            bool,
            bool,
            uint32,
            uint32
        )
    {
        uint32 passFilter = ((uint32(1) << QUOTA_BIT) - 1);
        uint32 compact = _whitelist.compactQuota[account];
        bool usedFree = ((compact >> 31) & 1) > 0;
        bool usedPaid = ((compact >> 30) & 1) > 0;
        uint32 freeQuota = uint32((compact >> QUOTA_BIT) & passFilter);
        uint32 paidQuota = uint32(compact & passFilter);
        if (usedFree == false) {
            freeQuota = _whitelist.defaultFreeQuota;
        }
        if (usedPaid == false) {
            paidQuota = _whitelist.defaultPaidQuota;
        }
        return (usedFree, usedPaid, freeQuota, paidQuota);
    }

    function readFreeQuota(address account)
        public
        view
        returns (uint32)
    {
        (, , uint32 res, ) = _readQuotaUsedFreePaid(account);
        return res;
    }

    function readPaidQuota(address account)
        public
        view
        returns (uint32)
    {
        (, , , uint32 res) = _readQuotaUsedFreePaid(account);
        return res;
    }

    function _setURI(string memory newuri) internal virtual override {
        _uriBase = newuri;
    }

    function setURI(string memory _newURI) external onlyOwner {
        _setURI(_newURI);
    }

    function uri(uint256 tokenId) public view override returns (string memory) {
        require(_token[tokenId].isInitialized == true, "Token Not Initialized");
        return
            string(
                abi.encodePacked(
                    _uriBase,
                    StringsUpgradeable.toString(tokenId),
                    ".json"
                )
            );
    }

    function createTokenType(
        uint256 tokenId,
        uint32 tokenSupply,
        uint256 mintFee
    ) external onlyOwner {
        require(_token[tokenId].isInitialized == false, "Used tokenId");
        Token storage currToken = _token[tokenId];
        currToken.isInitialized = true;
        currToken.numIssuedToken = 0;
        currToken.numPossibleHolder = 0;
        currToken.tokenSupply = tokenSupply;
        currToken.mintFee = mintFee;
    }

    function setWhitelistParam(
        bytes32 whitelistRoot,
        MintMode mintMode,
        uint256 startMintTime,
        uint32 defaultFreeQuota,
        uint32 defaultMintQuota
    ) external onlyOwner {
        require(defaultFreeQuota < QUOTA_LIMIT, "Exceed Quota Limit");
        require(defaultMintQuota < QUOTA_LIMIT, "Exceed Quota Limit");

        _whitelist.whitelistRoot = whitelistRoot;
        _whitelist.mintMode = mintMode;
        _whitelist.startMintTime = startMintTime;
        _whitelist.defaultFreeQuota = defaultFreeQuota;
        _whitelist.defaultPaidQuota = defaultMintQuota;
    }

    function batchUpdateMintQuota(
        address[] calldata accounts,
        uint32[] calldata freeQuotas,
        uint32[] calldata paidQuotas
    ) external onlyOwner {
        require(
            accounts.length == freeQuotas.length,
            "accounts and freeQuotas should have the same length"
        );
        require(
            paidQuotas.length == freeQuotas.length,
            "paidQuotas and freeQuotas should have the same length"
        );
        for (uint256 i = 0; i < accounts.length; i++) {
            address thisAccount = accounts[i];
            uint32 thisFree = freeQuotas[i];
            uint32 thisPaid = paidQuotas[i];
            require(thisFree < QUOTA_LIMIT, "Exceed Quota Limit");
            require(thisPaid < QUOTA_LIMIT, "Exceed Quota Limit");
            uint32 newCompact = _genQuotaUsedFreePaid(
                true,
                true,
                thisFree,
                thisPaid
            );
            if (_whitelist.compactQuota[thisAccount] != newCompact) {
                _whitelist.compactQuota[thisAccount] = newCompact;
            }
        }
    }

    function closeMint() external onlyOwner {
        _whitelist.mintMode = MintMode.NOTOPEN;
    }

    function _leaf(uint256 id, address addr) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(id, addr));
    }

    function _commonMint(
        uint256 tokenId,
        uint32 mintAmount,
        address to
    ) internal {
        require(
            SafeMathUpgradeable.add(
                mintAmount,
                _token[tokenId].numIssuedToken
            ) <= _token[tokenId].tokenSupply,
            "Minting amount exceeds tokenSupply"
        );

        _mint(to, tokenId, mintAmount, new bytes(0));
        _token[tokenId].numIssuedToken = SafeCastUpgradeable.toUint32(
            SafeMathUpgradeable.add(_token[tokenId].numIssuedToken, mintAmount)
        );
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        for (uint256 i = 0; i < ids.length; i++) {
            uint32 id = uint32(ids[i]);
            if (balanceOf(to, id) == 0) {
                _token[id].possibleHolder[_token[id].numPossibleHolder] = to;
                _token[id].numPossibleHolder += 1;
            }
        }

        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }

    function whitelistMint(
        bytes32[] memory whitelistProof,
        uint256 tokenId,
        uint32 userId,
        uint32 mintAmount
    ) external payable {
        require(
            _whitelist.mintMode == MintMode.FREE ||
                _whitelist.mintMode == MintMode.PAID,
            "This token is not allowed to mint now"
        );
        require(
            block.timestamp >= _whitelist.startMintTime,
            "Please wait until start minting time"
        );
        require(
            MerkleProofUpgradeable.verify(
                whitelistProof,
                _whitelist.whitelistRoot,
                _leaf(uint256(userId), _msgSender())
            ),
            "Invalid merkle proof"
        );
        require(mintAmount > 0, "You are expected to mint something");

        (
            bool usedFree,
            bool usedPaid,
            uint32 tmpFreeQuota,
            uint32 tmpPaidQuota
        ) = _readQuotaUsedFreePaid(_msgSender());

        if (_whitelist.mintMode == MintMode.FREE) {
            usedFree = usedFree || (mintAmount > 0);
            require(mintAmount <= tmpFreeQuota, "Exceeding Free Quota");
            _commonMint(tokenId, mintAmount, _msgSender());
            tmpFreeQuota -= mintAmount;
        }

        if (_whitelist.mintMode == MintMode.PAID) {
            usedPaid = usedPaid || (mintAmount > 0);
            require(mintAmount <= tmpPaidQuota, "Exceeding Paid Quota");
            require(
                msg.value >= uint256(mintAmount) * _token[tokenId].mintFee,
                "User needs to pay more to use the paid mint quota"
            );
            _commonMint(tokenId, mintAmount, _msgSender());
            tmpPaidQuota -= mintAmount;
        }

        uint32 newCompact = _genQuotaUsedFreePaid(
            usedFree,
            usedPaid,
            tmpFreeQuota,
            tmpPaidQuota
        );
        _whitelist.compactQuota[_msgSender()] = newCompact;
    }

    function ownerMint(
        uint256 tokenId,
        uint32 mintAmount,
        address to
    ) external onlyOwner {
        _commonMint(tokenId, mintAmount, to);
    }

    function listOwner(uint256 tokenId) public view returns (address[] memory) {
        uint32 maxLength = _token[tokenId].numPossibleHolder;
        uint32 cnt = 0;
        address[] memory storing = new address[](maxLength);
        for (uint32 i = 0; i < maxLength; i++) {
            address curAddr = _token[tokenId].possibleHolder[i];
            if (balanceOf(curAddr, tokenId) == 0) continue;
            storing[cnt++] = curAddr;
        }
        address[] memory res = new address[](cnt);
        for (uint32 i = 0; i < cnt; i++) {
            res[i] = storing[i];
        }
        return res;
    }

    function whitelistMintInfo(uint256[] memory tokenIds)
        public
        view
        returns (
            MintMode activeMintMode,
            uint256[] memory mintFees,
            uint32[] memory tokenIssuedCounts,
            uint32[] memory tokenSupplyCounts
        )
    {
        activeMintMode =
            block.timestamp >= _whitelist.startMintTime ? _whitelist.mintMode : MintMode.NOTOPEN;

        mintFees = new uint256[](tokenIds.length);
        tokenIssuedCounts = new uint32[](tokenIds.length);
        tokenSupplyCounts = new uint32[](tokenIds.length);

        for (uint32 i = 0; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            require(_token[tokenId].isInitialized, "Token Not Initialized");
            mintFees[i] = _token[tokenId].mintFee;
            tokenIssuedCounts[i] = _token[tokenId].numIssuedToken;
            tokenSupplyCounts[i] = _token[tokenId].tokenSupply;
        }
    }

    function withdraw(address _wallet) public payable onlyOwner {
        require(payable(_wallet).send(address(this).balance));
    }

    function isApprovedForAll(address _owner, address _operator)
        public
        view
        override
        returns (bool isOperator)
    {
        // if OpenSea's ERC1155 Proxy Address is detected, auto-return true
        if (_operator == proxyRegistryAddress) {
            return true;
        }
        // otherwise, use the default ERC1155.isApprovedForAll()
        return ERC1155Upgradeable.isApprovedForAll(_owner, _operator);
    }

    function contractURI() public view returns (string memory) {
        return _contractURI; // Contract-level metadata
    }

    function setContractURI(string memory _newURI) external onlyOwner {
        _contractURI = _newURI;
    }

    function _msgSender() internal view override returns (address) {
        return ContextMixin.msgSender();
    }

    function setDefaultRoyalty(address receiver, uint96 feeNumerator)
        public
        onlyOwner
    {
        _setDefaultRoyalty(receiver, feeNumerator);
    }

    function setTokenType(
        uint256 tokenId,
        uint32 tokenSupply,
        uint256 mintFee
    ) external onlyOwner {
        require(_token[tokenId].isInitialized == true, "Token Not Initialized");
        _token[tokenId].tokenSupply = tokenSupply;
        _token[tokenId].mintFee = mintFee;
    }

}

File 2 of 17 : ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
    using AddressUpgradeable for address;

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

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

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

    /**
     * @dev See {_setURI}.
     */
    function __ERC1155_init(string memory uri_) internal onlyInitializing {
        __ERC1155_init_unchained(uri_);
    }

    function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
        _setURI(uri_);
    }

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

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

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

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

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

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

        return batchBalances;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

        return array;
    }

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

File 3 of 17 : ERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981Upgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

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

    function __ERC2981_init_unchained() internal onlyInitializing {
    }
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

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

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

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

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

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

        return (royalty.receiver, royaltyAmount);
    }

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

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

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

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

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `tokenId` must be already minted.
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

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

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

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

File 4 of 17 : MerkleProofUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 */
library MerkleProofUpgradeable {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 5 of 17 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMathUpgradeable {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 6 of 17 : SafeCastUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 *
 * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
 * all math on `uint256` and `int256` and then downcasting.
 */
library SafeCastUpgradeable {
    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits");
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits");
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits");
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint64 from uint256, reverting on
     * overflow (when the input is greater than largest uint64).
     *
     * Counterpart to Solidity's `uint64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     */
    function toUint64(uint256 value) internal pure returns (uint64) {
        require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits");
        return uint64(value);
    }

    /**
     * @dev Returns the downcasted uint32 from uint256, reverting on
     * overflow (when the input is greater than largest uint32).
     *
     * Counterpart to Solidity's `uint32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     */
    function toUint32(uint256 value) internal pure returns (uint32) {
        require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits");
        return uint32(value);
    }

    /**
     * @dev Returns the downcasted uint16 from uint256, reverting on
     * overflow (when the input is greater than largest uint16).
     *
     * Counterpart to Solidity's `uint16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     */
    function toUint16(uint256 value) internal pure returns (uint16) {
        require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits");
        return uint16(value);
    }

    /**
     * @dev Returns the downcasted uint8 from uint256, reverting on
     * overflow (when the input is greater than largest uint8).
     *
     * Counterpart to Solidity's `uint8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     */
    function toUint8(uint256 value) internal pure returns (uint8) {
        require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits");
        return uint8(value);
    }

    /**
     * @dev Converts a signed int256 into an unsigned uint256.
     *
     * Requirements:
     *
     * - input must be greater than or equal to 0.
     */
    function toUint256(int256 value) internal pure returns (uint256) {
        require(value >= 0, "SafeCast: value must be positive");
        return uint256(value);
    }

    /**
     * @dev Returns the downcasted int128 from int256, reverting on
     * overflow (when the input is less than smallest int128 or
     * greater than largest int128).
     *
     * Counterpart to Solidity's `int128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     *
     * _Available since v3.1._
     */
    function toInt128(int256 value) internal pure returns (int128) {
        require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits");
        return int128(value);
    }

    /**
     * @dev Returns the downcasted int64 from int256, reverting on
     * overflow (when the input is less than smallest int64 or
     * greater than largest int64).
     *
     * Counterpart to Solidity's `int64` operator.
     *
     * Requirements:
     *
     * - input must fit into 64 bits
     *
     * _Available since v3.1._
     */
    function toInt64(int256 value) internal pure returns (int64) {
        require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits");
        return int64(value);
    }

    /**
     * @dev Returns the downcasted int32 from int256, reverting on
     * overflow (when the input is less than smallest int32 or
     * greater than largest int32).
     *
     * Counterpart to Solidity's `int32` operator.
     *
     * Requirements:
     *
     * - input must fit into 32 bits
     *
     * _Available since v3.1._
     */
    function toInt32(int256 value) internal pure returns (int32) {
        require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits");
        return int32(value);
    }

    /**
     * @dev Returns the downcasted int16 from int256, reverting on
     * overflow (when the input is less than smallest int16 or
     * greater than largest int16).
     *
     * Counterpart to Solidity's `int16` operator.
     *
     * Requirements:
     *
     * - input must fit into 16 bits
     *
     * _Available since v3.1._
     */
    function toInt16(int256 value) internal pure returns (int16) {
        require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits");
        return int16(value);
    }

    /**
     * @dev Returns the downcasted int8 from int256, reverting on
     * overflow (when the input is less than smallest int8 or
     * greater than largest int8).
     *
     * Counterpart to Solidity's `int8` operator.
     *
     * Requirements:
     *
     * - input must fit into 8 bits.
     *
     * _Available since v3.1._
     */
    function toInt8(int256 value) internal pure returns (int8) {
        require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits");
        return int8(value);
    }

    /**
     * @dev Converts an unsigned uint256 into a signed int256.
     *
     * Requirements:
     *
     * - input must be less than or equal to maxInt256.
     */
    function toInt256(uint256 value) internal pure returns (int256) {
        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
        require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256");
        return int256(value);
    }
}

File 7 of 17 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

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

File 8 of 17 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

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

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

File 9 of 17 : IERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

File 11 of 17 : IERC1155MetadataURIUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;

import "../IERC1155Upgradeable.sol";

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

File 12 of 17 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

File 15 of 17 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

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

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

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

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = _setInitializedVersion(1);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        bool isTopLevelCall = _setInitializedVersion(version);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(version);
        }
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        _setInitializedVersion(type(uint8).max);
    }

    function _setInitializedVersion(uint8 version) private returns (bool) {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
        // of initializers, because in other contexts the contract may have been reentered.
        if (_initializing) {
            require(
                version == 1 && !AddressUpgradeable.isContract(address(this)),
                "Initializable: contract is already initialized"
            );
            return false;
        } else {
            require(_initialized < version, "Initializable: contract is already initialized");
            _initialized = version;
            return true;
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint32[]","name":"freeQuotas","type":"uint32[]"},{"internalType":"uint32[]","name":"paidQuotas","type":"uint32[]"}],"name":"batchUpdateMintQuota","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"tokenSupply","type":"uint32"},{"internalType":"uint256","name":"mintFee","type":"uint256"}],"name":"createTokenType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"listOwner","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"mintAmount","type":"uint32"},{"internalType":"address","name":"to","type":"address"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"readFreeQuota","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"readPaidQuota","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"tokenSupply","type":"uint32"},{"internalType":"uint256","name":"mintFee","type":"uint256"}],"name":"setTokenType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"whitelistRoot","type":"bytes32"},{"internalType":"enum NTR.MintMode","name":"mintMode","type":"uint8"},{"internalType":"uint256","name":"startMintTime","type":"uint256"},{"internalType":"uint32","name":"defaultFreeQuota","type":"uint32"},{"internalType":"uint32","name":"defaultMintQuota","type":"uint32"}],"name":"setWhitelistParam","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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"whitelistProof","type":"bytes32[]"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"userId","type":"uint32"},{"internalType":"uint32","name":"mintAmount","type":"uint32"}],"name":"whitelistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"whitelistMintInfo","outputs":[{"internalType":"enum NTR.MintMode","name":"activeMintMode","type":"uint8"},{"internalType":"uint256[]","name":"mintFees","type":"uint256[]"},{"internalType":"uint32[]","name":"tokenIssuedCounts","type":"uint32[]"},{"internalType":"uint32[]","name":"tokenSupplyCounts","type":"uint32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]

608060405234801561001057600080fd5b50613f19806100206000396000f3fe6080604052600436106101c15760003560e01c80638da5cb5b116100f7578063e77c2b4711610095578063f02efdb611610064578063f02efdb614610548578063f242432a14610568578063f2fde38b14610588578063f62d1888146105a8576101c1565b8063e77c2b47146104c6578063e8a3d485146104f3578063e985e9c514610508578063ed5eb85214610528576101c1565b8063a72478b6116100d1578063a72478b614610443578063c2492d1b14610456578063d06ca99d14610486578063d2db26cb146104a6576101c1565b80638da5cb5b146103d6578063938e3d7b14610403578063a22cb46514610423576101c1565b80632eb2c2d61161016457806364f101f01161013e57806364f101f0146103575780636d6663431461036c578063715018a6146103a15780637bff17ba146103b6576101c1565b80632eb2c2d6146102f75780634e1273f41461031757806351cff8d914610344576101c1565b806304634d8d116101a057806304634d8d1461024b5780630e89341c1461026b578063239cbe9f146102985780632a55205a146102b8576101c1565b8062fdd58e146101c657806301ffc9a7146101f957806302fe530514610229575b600080fd5b3480156101d257600080fd5b506101e66101e13660046132d4565b6105c8565b6040519081526020015b60405180910390f35b34801561020557600080fd5b506102196102143660046135e1565b610664565b60405190151581526020016101f0565b34801561023557600080fd5b50610249610244366004613619565b6106c7565b005b34801561025757600080fd5b506102496102663660046132fd565b610712565b34801561027757600080fd5b5061028b61028636600461365e565b61075f565b6040516101f09190613a14565b3480156102a457600080fd5b506102496102b33660046136d2565b6107c9565b3480156102c457600080fd5b506102d86102d3366004613676565b61089b565b604080516001600160a01b0390931683526020830191909152016101f0565b34801561030357600080fd5b50610249610312366004613193565b610949565b34801561032357600080fd5b506103376103323660046133c8565b6109f2565b6040516101f09190613981565b610249610352366004613147565b610b53565b34801561036357600080fd5b50610249610bbf565b34801561037857600080fd5b5061038c610387366004613147565b610c0b565b60405163ffffffff90911681526020016101f0565b3480156103ad57600080fd5b50610249610c21565b3480156103c257600080fd5b506102496103d1366004613697565b610caa565b3480156103e257600080fd5b506103eb610cf9565b6040516001600160a01b0390911681526020016101f0565b34801561040f57600080fd5b5061024961041e366004613619565b610d09565b34801561042f57600080fd5b5061024961043e36600461329a565b610d5c565b610249610451366004613490565b610d6e565b34801561046257600080fd5b50610476610471366004613554565b6111b4565b6040516101f094939291906139b9565b34801561049257600080fd5b5061038c6104a1366004613147565b611465565b3480156104b257600080fd5b506102496104c13660046136d2565b61147b565b3480156104d257600080fd5b506104e66104e136600461365e565b611522565b6040516101f09190613934565b3480156104ff57600080fd5b5061028b611745565b34801561051457600080fd5b50610219610523366004613161565b6117d8565b34801561053457600080fd5b50610249610543366004613333565b61182b565b34801561055457600080fd5b50610249610563366004613586565b611ad0565b34801561057457600080fd5b50610249610583366004613238565b611bdb565b34801561059457600080fd5b506102496105a3366004613147565b611c74565b3480156105b457600080fd5b506102496105c3366004613619565b611d21565b60006001600160a01b0383166106395760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061069557506001600160e01b031982166303a24d0760e21b145b806106b057506001600160e01b0319821663152a902d60e11b145b806106bf57506106bf82611e2d565b90505b919050565b6106cf611e52565b6001600160a01b03166106e0610cf9565b6001600160a01b0316146107065760405162461bcd60e51b815260040161063090613ba7565b61070f81611e61565b50565b61071a611e52565b6001600160a01b031661072b610cf9565b6001600160a01b0316146107515760405162461bcd60e51b815260040161063090613ba7565b61075b8282611e75565b5050565b6000818152610132602052604090205460609060ff1615156001146107965760405162461bcd60e51b815260040161063090613a6f565b61012f6107a283611f89565b6040516020016107b39291906137d7565b6040516020818303038152906040529050919050565b6107d1611e52565b6001600160a01b03166107e2610cf9565b6001600160a01b0316146108085760405162461bcd60e51b815260040161063090613ba7565b6000838152610132602052604090205460ff16156108575760405162461bcd60e51b815260206004820152600c60248201526b155cd959081d1bdad95b925960a21b6044820152606401610630565b60009283526101326020526040909220805463ffffffff92909216610100026cffffffffffffffffffffffff001960ff199093166001908117939093161781550155565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109105750604080518082019091526097546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101516000906127109061092f906001600160601b031687613c9e565b6109399190613c8a565b91519350909150505b9250929050565b610951611e52565b6001600160a01b0316856001600160a01b03161480610977575061097785610523611e52565b6109de5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610630565b6109eb85858585856120ab565b5050505050565b60608151835114610a575760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610630565b600083516001600160401b03811115610a8057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610aa9578160200160208202803683370190505b50905060005b8451811015610b4b57610b10858281518110610adb57634e487b7160e01b600052603260045260246000fd5b6020026020010151858381518110610b0357634e487b7160e01b600052603260045260246000fd5b60200260200101516105c8565b828281518110610b3057634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610b4481613d90565b9050610aaf565b509392505050565b610b5b611e52565b6001600160a01b0316610b6c610cf9565b6001600160a01b031614610b925760405162461bcd60e51b815260040161063090613ba7565b6040516001600160a01b038216904780156108fc02916000818181858888f1935050505061070f57600080fd5b610bc7611e52565b6001600160a01b0316610bd8610cf9565b6001600160a01b031614610bfe5760405162461bcd60e51b815260040161063090613ba7565b610133805460ff19169055565b600080610c17836122c0565b5095945050505050565b610c29611e52565b6001600160a01b0316610c3a610cf9565b6001600160a01b031614610c605760405162461bcd60e51b815260040161063090613ba7565b60405162461bcd60e51b815260206004820152601d60248201527f72656e6f756e63654f776e6572736869702069732064697361626c65640000006044820152606401610630565b565b610cb2611e52565b6001600160a01b0316610cc3610cf9565b6001600160a01b031614610ce95760405162461bcd60e51b815260040161063090613ba7565b610cf4838383612371565b505050565b60c9546001600160a01b03165b90565b610d11611e52565b6001600160a01b0316610d22610cf9565b6001600160a01b031614610d485760405162461bcd60e51b815260040161063090613ba7565b805161075b9061012e906020840190612f5d565b61075b610d67611e52565b838361248e565b60016101335460ff166002811115610d9657634e487b7160e01b600052602160045260246000fd5b1480610dc7575060026101335460ff166002811115610dc557634e487b7160e01b600052602160045260246000fd5b145b610e215760405162461bcd60e51b815260206004820152602560248201527f5468697320746f6b656e206973206e6f7420616c6c6f77656420746f206d696e60448201526474206e6f7760d81b6064820152608401610630565b61013454421015610e805760405162461bcd60e51b8152602060048201526024808201527f506c65617365207761697420756e74696c207374617274206d696e74696e672060448201526374696d6560e01b6064820152608401610630565b610ea78461013360020154610ea28563ffffffff16610e9d611e52565b61256f565b6125bd565b610eea5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610630565b60008163ffffffff1611610f4b5760405162461bcd60e51b815260206004820152602260248201527f596f752061726520657870656374656420746f206d696e7420736f6d657468696044820152616e6760f01b6064820152608401610630565b600080600080610f61610f5c611e52565b6122c0565b9296509094509250905060016101335460ff166002811115610f9357634e487b7160e01b600052602160045260246000fd5b141561101f578380610fab575060008563ffffffff16115b93508163ffffffff168563ffffffff1611156110005760405162461bcd60e51b8152602060048201526014602482015273457863656564696e6720467265652051756f746160601b6044820152606401610630565b611012878661100d611e52565b612371565b61101c8583613cd4565b91505b60026101335460ff16600281111561104757634e487b7160e01b600052602160045260246000fd5b141561115a57828061105f575060008563ffffffff16115b92508063ffffffff168563ffffffff1611156110b45760405162461bcd60e51b8152602060048201526014602482015273457863656564696e6720506169642051756f746160601b6044820152606401610630565b600087815261013260205260409020600101546110d79063ffffffff8716613c9e565b3410156111405760405162461bcd60e51b815260206004820152603160248201527f55736572206e6565647320746f20706179206d6f726520746f20757365207468604482015270652070616964206d696e742071756f746160781b6064820152608401610630565b61114d878661100d611e52565b6111578582613cd4565b90505b6000611168858585856125d3565b9050806101366000611178611e52565b6001600160a01b031681526020810191909152604001600020805463ffffffff191663ffffffff92909216919091179055505050505050505050565b60006060806060610133600101544210156111d05760006111d8565b6101335460ff165b935084516001600160401b0381111561120157634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561122a578160200160208202803683370190505b50925084516001600160401b0381111561125457634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561127d578160200160208202803683370190505b50915084516001600160401b038111156112a757634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156112d0578160200160208202803683370190505b50905060005b85518163ffffffff16101561145d576000868263ffffffff168151811061130d57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600081815261013290925260409091205490915060ff1661134c5760405162461bcd60e51b815260040161063090613a6f565b600081815261013260205260409020600101548551869063ffffffff851690811061138757634e487b7160e01b600052603260045260246000fd5b602002602001018181525050610132600082815260200190815260200160002060000160059054906101000a900463ffffffff16848363ffffffff16815181106113e157634e487b7160e01b600052603260045260246000fd5b63ffffffff928316602091820292909201810191909152600083815261013290915260409020548451610100909104821691859190851690811061143557634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152508061145581613dab565b9150506112d6565b509193509193565b600080611471836122c0565b9695505050505050565b611483611e52565b6001600160a01b0316611494610cf9565b6001600160a01b0316146114ba5760405162461bcd60e51b815260040161063090613ba7565b6000838152610132602052604090205460ff1615156001146114ee5760405162461bcd60e51b815260040161063090613a6f565b60009283526101326020526040909220805463ffffffff9092166101000264ffffffff001990921691909117815560010155565b60008181526101326020526040812054606091600160481b90910463ffffffff169080826001600160401b0381111561156b57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611594578160200160208202803683370190505b50905060005b8363ffffffff168163ffffffff1610156116555760008681526101326020908152604080832063ffffffff851684526002019091529020546001600160a01b03166115e581886105c8565b6115ef5750611643565b8083856115fb81613dab565b965063ffffffff168151811061162157634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b031681525050505b8061164d81613dab565b91505061159a565b5060008263ffffffff166001600160401b0381111561168457634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156116ad578160200160208202803683370190505b50905060005b8363ffffffff168163ffffffff161015610c1757828163ffffffff16815181106116ed57634e487b7160e01b600052603260045260246000fd5b6020026020010151828263ffffffff168151811061171b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528061173d81613dab565b9150506116b3565b606061012e805461175590613d29565b80601f016020809104026020016040519081016040528092919081815260200182805461178190613d29565b80156117ce5780601f106117a3576101008083540402835291602001916117ce565b820191906000526020600020905b8154815290600101906020018083116117b157829003601f168201915b5050505050905090565b61012d546000906001600160a01b03838116911614156117fa5750600161065e565b6001600160a01b0380841660009081526066602090815260408083209386168352929052205460ff165b9392505050565b611833611e52565b6001600160a01b0316611844610cf9565b6001600160a01b03161461186a5760405162461bcd60e51b815260040161063090613ba7565b8483146118d55760405162461bcd60e51b815260206004820152603360248201527f6163636f756e747320616e64206672656551756f7461732073686f756c6420686044820152720c2ecca40e8d0ca40e6c2daca40d8cadccee8d606b1b6064820152608401610630565b8083146119425760405162461bcd60e51b815260206004820152603560248201527f7061696451756f74617320616e64206672656551756f7461732073686f756c64604482015274040d0c2ecca40e8d0ca40e6c2daca40d8cadccee8d605b1b6064820152608401610630565b60005b85811015611ac757600087878381811061196f57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906119849190613147565b905060008686848181106119a857634e487b7160e01b600052603260045260246000fd5b90506020020160208101906119bd9190613706565b905060008585858181106119e157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906119f69190613706565b9050610131548263ffffffff1610611a205760405162461bcd60e51b815260040161063090613a9e565b610131548163ffffffff1610611a485760405162461bcd60e51b815260040161063090613a9e565b6000611a5760018085856125d3565b6001600160a01b0385166000908152610136602052604090205490915063ffffffff808316911614611ab0576001600160a01b038416600090815261013660205260409020805463ffffffff191663ffffffff83161790555b505050508080611abf90613d90565b915050611945565b50505050505050565b611ad8611e52565b6001600160a01b0316611ae9610cf9565b6001600160a01b031614611b0f5760405162461bcd60e51b815260040161063090613ba7565b610131548263ffffffff1610611b375760405162461bcd60e51b815260040161063090613a9e565b610131548163ffffffff1610611b5f5760405162461bcd60e51b815260040161063090613a9e565b610135859055610133805485919060ff19166001836002811115611b9357634e487b7160e01b600052602160045260246000fd5b021790555061013492909255610133805463ffffffff938416600160281b0268ffffffff000000000019949093166101000264ffffffff001990911617929092161790555050565b611be3611e52565b6001600160a01b0316856001600160a01b03161480611c095750611c0985610523611e52565b611c675760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610630565b6109eb8585858585612647565b611c7c611e52565b6001600160a01b0316611c8d610cf9565b6001600160a01b031614611cb35760405162461bcd60e51b815260040161063090613ba7565b6001600160a01b038116611d185760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610630565b61070f8161278e565b6000611d2d60016127e0565b90508015611d45576000805461ff0019166101001790555b611d4e82612865565b611d56612895565b61012d80546001600160a01b03191673207fa8df3a17d96ca7ea4f2893fcdcb78a3041011790558151611d919061012e906020850190612f5d565b508151611da69061012f906020850190612f5d565b50610130805460ff19908116600f1791829055600160ff9092169190911b6101315561013380549091169055611de4611ddd611e52565b6000611e75565b801561075b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b60006001600160e01b0319821663152a902d60e11b14806106bf57506106bf826128c4565b6000611e5c612914565b905090565b805161075b9061012f906020840190612f5d565b6127106001600160601b0382161115611ee35760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610630565b6001600160a01b038216611f395760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610630565b604080518082019091526001600160a01b039283168082526001600160601b03929092166020909101819052609780546001600160a01b031916909217909216600160a01b909202919091179055565b606081611fae57506040805180820190915260018152600360fc1b60208201526106c2565b8160005b8115611fd85780611fc281613d90565b9150611fd19050600a83613c8a565b9150611fb2565b6000816001600160401b0381111561200057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561202a576020820181803683370190505b5090505b84156120a35761203f600183613cbd565b915061204c600a86613dcf565b612057906030613c4a565b60f81b81838151811061207a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061209c600a86613c8a565b945061202e565b949350505050565b815183511461210d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610630565b6001600160a01b0384166121335760405162461bcd60e51b815260040161063090613aca565b600061213d611e52565b905061214d818787878787612970565b60005b845181101561225257600085828151811061217b57634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106121a757634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156121f85760405162461bcd60e51b815260040161063090613b5d565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612237908490613c4a565b925050819055505050508061224b90613d90565b9050612150565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516122a2929190613994565b60405180910390a46122b8818787878787612a5b565b505050505050565b6101305460009081908190819081906122e19060019060ff1681901b613cd4565b6001600160a01b038716600090815261013660205260409020546101305491925063ffffffff808216926001601f84901c8116151593601e81901c90911615159260ff90921685901c86169190861616836123485761013354610100900463ffffffff1691505b82612360575061013354600160281b900463ffffffff165b929a91995097509095509350505050565b6000838152610132602052604090205463ffffffff61010082048116916123a39185811691600160281b900416612bc6565b11156123fc5760405162461bcd60e51b815260206004820152602260248201527f4d696e74696e6720616d6f756e74206578636565647320746f6b656e537570706044820152616c7960f01b6064820152608401610630565b604080516000815260208101909152612420908290859063ffffffff861690612bd2565b600083815261013260205260409020546124549061244f9063ffffffff600160281b9091048116908516612bc6565b612cf9565b60009384526101326020526040909320805463ffffffff94909416600160281b0268ffffffff000000000019909416939093179092555050565b816001600160a01b0316836001600160a01b031614156125025760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610630565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000828260405160200161259f92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60405160208183030381529060405280519060200120905092915050565b6000826125ca8584612d62565b14949350505050565b6101305460009081906125ee9060019060ff1681901b613cd4565b610130549091508382169063ffffffff8684161660ff9091161b601e87612616576000612619565b60015b63ffffffff16901b601f8961262f576000612632565b60015b63ffffffff16901b1717179695505050505050565b6001600160a01b03841661266d5760405162461bcd60e51b815260040161063090613aca565b6000612677611e52565b9050600061268485612ddc565b9050600061269185612ddc565b90506126a1838989858589612970565b60008681526065602090815260408083206001600160a01b038c168452909152902054858110156126e45760405162461bcd60e51b815260040161063090613b5d565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612723908490613c4a565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612783848a8a8a8a8a612e35565b505050505050505050565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008054610100900460ff1615612827578160ff1660011480156128035750303b155b61281f5760405162461bcd60e51b815260040161063090613b0f565b5060006106c2565b60005460ff80841691161061284e5760405162461bcd60e51b815260040161063090613b0f565b506000805460ff191660ff831617905560016106c2565b600054610100900460ff1661288c5760405162461bcd60e51b815260040161063090613bdc565b61070f81612eff565b600054610100900460ff166128bc5760405162461bcd60e51b815260040161063090613bdc565b610ca8612f26565b60006001600160e01b03198216636cdb3d1360e11b14806128f557506001600160e01b031982166303a24d0760e21b145b806106bf57506301ffc9a760e01b6001600160e01b03198316146106bf565b60003330141561296b57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150610d069050565b503390565b60005b8351811015612a5557600084828151811061299e57634e487b7160e01b600052603260045260246000fd5b602002602001015190506129b8868263ffffffff166105c8565b612a425763ffffffff8181166000818152610132602081815260408084208054600160481b908190048816865260028201845291852080546001600160a01b0319166001600160a01b038f1617905594909352528154600193600992612a2392869291900416613c62565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b5080612a4d81613d90565b915050612973565b506122b8565b6001600160a01b0384163b156122b85760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612a9f9089908990889088908890600401613891565b602060405180830381600087803b158015612ab957600080fd5b505af1925050508015612ae9575060408051601f3d908101601f19168201909252612ae6918101906135fd565b60015b612b9657612af5613e25565b806308c379a01415612b2f5750612b0a613e3c565b80612b155750612b31565b8060405162461bcd60e51b81526004016106309190613a14565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610630565b6001600160e01b0319811663bc197c8160e01b14611ac75760405162461bcd60e51b815260040161063090613a27565b60006118248284613c4a565b6001600160a01b038416612c325760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610630565b6000612c3c611e52565b90506000612c4985612ddc565b90506000612c5685612ddc565b9050612c6783600089858589612970565b60008681526065602090815260408083206001600160a01b038b16845290915281208054879290612c99908490613c4a565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611ac783600089898989612e35565b600063ffffffff821115612d5e5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610630565b5090565b600081815b8451811015610b4b576000858281518110612d9257634e487b7160e01b600052603260045260246000fd5b60200260200101519050808311612db85760008381526020829052604090209250612dc9565b600081815260208490526040902092505b5080612dd481613d90565b915050612d67565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612e2457634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b156122b85760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612e7990899089908890889088906004016138ef565b602060405180830381600087803b158015612e9357600080fd5b505af1925050508015612ec3575060408051601f3d908101601f19168201909252612ec0918101906135fd565b60015b612ecf57612af5613e25565b6001600160e01b0319811663f23a6e6160e01b14611ac75760405162461bcd60e51b815260040161063090613a27565b600054610100900460ff166107065760405162461bcd60e51b815260040161063090613bdc565b600054610100900460ff16612f4d5760405162461bcd60e51b815260040161063090613bdc565b610ca8612f58611e52565b61278e565b828054612f6990613d29565b90600052602060002090601f016020900481019282612f8b5760008555612fd1565b82601f10612fa457805160ff1916838001178555612fd1565b82800160010185558215612fd1579182015b82811115612fd1578251825591602001919060010190612fb6565b50612d5e9291505b80821115612d5e5760008155600101612fd9565b60006001600160401b0383111561300657613006613e0f565b60405161301d601f8501601f191660200182613d64565b80915083815284848401111561303257600080fd5b83836020830137600060208583010152509392505050565b80356001600160a01b03811681146106c257600080fd5b60008083601f840112613072578182fd5b5081356001600160401b03811115613088578182fd5b602083019150836020808302850101111561094257600080fd5b600082601f8301126130b2578081fd5b813560206130bf82613c27565b6040516130cc8282613d64565b8381528281019150858301838502870184018810156130e9578586fd5b855b85811015613107578135845292840192908401906001016130eb565b5090979650505050505050565b600082601f830112613124578081fd5b61182483833560208501612fed565b803563ffffffff811681146106c257600080fd5b600060208284031215613158578081fd5b6118248261304a565b60008060408385031215613173578081fd5b61317c8361304a565b915061318a6020840161304a565b90509250929050565b600080600080600060a086880312156131aa578081fd5b6131b38661304a565b94506131c16020870161304a565b935060408601356001600160401b03808211156131dc578283fd5b6131e889838a016130a2565b945060608801359150808211156131fd578283fd5b61320989838a016130a2565b9350608088013591508082111561321e578283fd5b5061322b88828901613114565b9150509295509295909350565b600080600080600060a0868803121561324f578081fd5b6132588661304a565b94506132666020870161304a565b9350604086013592506060860135915060808601356001600160401b0381111561328e578182fd5b61322b88828901613114565b600080604083850312156132ac578182fd5b6132b58361304a565b9150602083013580151581146132c9578182fd5b809150509250929050565b600080604083850312156132e6578182fd5b6132ef8361304a565b946020939093013593505050565b6000806040838503121561330f578182fd5b6133188361304a565b915060208301356001600160601b03811681146132c9578182fd5b6000806000806000806060878903121561334b578384fd5b86356001600160401b0380821115613361578586fd5b61336d8a838b01613061565b90985096506020890135915080821115613385578586fd5b6133918a838b01613061565b909650945060408901359150808211156133a9578283fd5b506133b689828a01613061565b979a9699509497509295939492505050565b600080604083850312156133da578182fd5b82356001600160401b03808211156133f0578384fd5b818501915085601f830112613403578384fd5b8135602061341082613c27565b60405161341d8282613d64565b8381528281019150858301838502870184018b101561343a578889fd5b8896505b848710156134635761344f8161304a565b83526001969096019591830191830161343e565b5096505086013592505080821115613479578283fd5b50613486858286016130a2565b9150509250929050565b600080600080608085870312156134a5578182fd5b84356001600160401b038111156134ba578283fd5b8501601f810187136134ca578283fd5b803560206134d782613c27565b6040516134e48282613d64565b8381528281019150848301838502860184018c1015613501578788fd5b8795505b84861015613523578035835260019590950194918301918301613505565b50975050870135945061353b91505060408601613133565b915061354960608601613133565b905092959194509250565b600060208284031215613565578081fd5b81356001600160401b0381111561357a578182fd5b6120a3848285016130a2565b600080600080600060a0868803121561359d578283fd5b853594506020860135600381106135b2578384fd5b9350604086013592506135c760608701613133565b91506135d560808701613133565b90509295509295909350565b6000602082840312156135f2578081fd5b813561182481613ecd565b60006020828403121561360e578081fd5b815161182481613ecd565b60006020828403121561362a578081fd5b81356001600160401b0381111561363f578182fd5b8201601f8101841361364f578182fd5b6120a384823560208401612fed565b60006020828403121561366f578081fd5b5035919050565b60008060408385031215613688578182fd5b50508035926020909101359150565b6000806000606084860312156136ab578081fd5b833592506136bb60208501613133565b91506136c96040850161304a565b90509250925092565b6000806000606084860312156136e6578081fd5b833592506136f660208501613133565b9150604084013590509250925092565b600060208284031215613717578081fd5b61182482613133565b6000815180845260208085019450808401835b8381101561374f57815187529582019590820190600101613733565b509495945050505050565b6000815180845260208085019450808401835b8381101561374f57815163ffffffff168752958201959082019060010161376d565b600081518084526137a7816020860160208601613cf9565b601f01601f19169290920160200192915050565b600081516137cd818560208601613cf9565b9290920192915050565b82546000908190600281046001808316806137f357607f831692505b602080841082141561381357634e487b7160e01b87526022600452602487fd5b818015613827576001811461383857613864565b60ff19861689528489019650613864565b60008b815260209020885b8681101561385c5781548b820152908501908301613843565b505084890196505b50505050505061388861387782866137bb565b64173539b7b760d91b815260050190565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906138bd90830186613720565b82810360608401526138cf8186613720565b905082810360808401526138e3818561378f565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906139299083018461378f565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b818110156139755783516001600160a01b031683529284019291840191600101613950565b50909695505050505050565b6000602082526118246020830184613720565b6000604082526139a76040830185613720565b82810360208401526138888185613720565b6000600386106139d757634e487b7160e01b81526021600452602481fd5b858252608060208301526139ee6080830186613720565b8281036040840152613a00818661375a565b90508281036060840152613929818561375a565b600060208252611824602083018461378f565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b602080825260159082015274151bdad95b88139bdd08125b9a5d1a585b1a5e9959605a1b604082015260600190565b602080825260129082015271115e18d9595908145d5bdd1848131a5b5a5d60721b604082015260600190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001600160401b03821115613c4057613c40613e0f565b5060209081020190565b60008219821115613c5d57613c5d613de3565b500190565b600063ffffffff808316818516808303821115613c8157613c81613de3565b01949350505050565b600082613c9957613c99613df9565b500490565b6000816000190483118215151615613cb857613cb8613de3565b500290565b600082821015613ccf57613ccf613de3565b500390565b600063ffffffff83811690831681811015613cf157613cf1613de3565b039392505050565b60005b83811015613d14578181015183820152602001613cfc565b83811115613d23576000848401525b50505050565b600281046001821680613d3d57607f821691505b60208210811415613d5e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b0381118282101715613d8957613d89613e0f565b6040525050565b6000600019821415613da457613da4613de3565b5060010190565b600063ffffffff80831681811415613dc557613dc5613de3565b6001019392505050565b600082613dde57613dde613df9565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115610d0657600481823e5160e01c90565b600060443d1015613e4c57610d06565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613e7d575050505050610d06565b8285019150815181811115613e9757505050505050610d06565b843d8701016020828501011115613eb357505050505050610d06565b613ec260208286010187613d64565b509094505050505090565b6001600160e01b03198116811461070f57600080fdfea2646970667358221220c14f24fdd9ea09d6f57618f3e87c4a791eae5b6a2f536acf3fa97552792861f364736f6c63430008020033

Deployed Bytecode

0x6080604052600436106101c15760003560e01c80638da5cb5b116100f7578063e77c2b4711610095578063f02efdb611610064578063f02efdb614610548578063f242432a14610568578063f2fde38b14610588578063f62d1888146105a8576101c1565b8063e77c2b47146104c6578063e8a3d485146104f3578063e985e9c514610508578063ed5eb85214610528576101c1565b8063a72478b6116100d1578063a72478b614610443578063c2492d1b14610456578063d06ca99d14610486578063d2db26cb146104a6576101c1565b80638da5cb5b146103d6578063938e3d7b14610403578063a22cb46514610423576101c1565b80632eb2c2d61161016457806364f101f01161013e57806364f101f0146103575780636d6663431461036c578063715018a6146103a15780637bff17ba146103b6576101c1565b80632eb2c2d6146102f75780634e1273f41461031757806351cff8d914610344576101c1565b806304634d8d116101a057806304634d8d1461024b5780630e89341c1461026b578063239cbe9f146102985780632a55205a146102b8576101c1565b8062fdd58e146101c657806301ffc9a7146101f957806302fe530514610229575b600080fd5b3480156101d257600080fd5b506101e66101e13660046132d4565b6105c8565b6040519081526020015b60405180910390f35b34801561020557600080fd5b506102196102143660046135e1565b610664565b60405190151581526020016101f0565b34801561023557600080fd5b50610249610244366004613619565b6106c7565b005b34801561025757600080fd5b506102496102663660046132fd565b610712565b34801561027757600080fd5b5061028b61028636600461365e565b61075f565b6040516101f09190613a14565b3480156102a457600080fd5b506102496102b33660046136d2565b6107c9565b3480156102c457600080fd5b506102d86102d3366004613676565b61089b565b604080516001600160a01b0390931683526020830191909152016101f0565b34801561030357600080fd5b50610249610312366004613193565b610949565b34801561032357600080fd5b506103376103323660046133c8565b6109f2565b6040516101f09190613981565b610249610352366004613147565b610b53565b34801561036357600080fd5b50610249610bbf565b34801561037857600080fd5b5061038c610387366004613147565b610c0b565b60405163ffffffff90911681526020016101f0565b3480156103ad57600080fd5b50610249610c21565b3480156103c257600080fd5b506102496103d1366004613697565b610caa565b3480156103e257600080fd5b506103eb610cf9565b6040516001600160a01b0390911681526020016101f0565b34801561040f57600080fd5b5061024961041e366004613619565b610d09565b34801561042f57600080fd5b5061024961043e36600461329a565b610d5c565b610249610451366004613490565b610d6e565b34801561046257600080fd5b50610476610471366004613554565b6111b4565b6040516101f094939291906139b9565b34801561049257600080fd5b5061038c6104a1366004613147565b611465565b3480156104b257600080fd5b506102496104c13660046136d2565b61147b565b3480156104d257600080fd5b506104e66104e136600461365e565b611522565b6040516101f09190613934565b3480156104ff57600080fd5b5061028b611745565b34801561051457600080fd5b50610219610523366004613161565b6117d8565b34801561053457600080fd5b50610249610543366004613333565b61182b565b34801561055457600080fd5b50610249610563366004613586565b611ad0565b34801561057457600080fd5b50610249610583366004613238565b611bdb565b34801561059457600080fd5b506102496105a3366004613147565b611c74565b3480156105b457600080fd5b506102496105c3366004613619565b611d21565b60006001600160a01b0383166106395760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061069557506001600160e01b031982166303a24d0760e21b145b806106b057506001600160e01b0319821663152a902d60e11b145b806106bf57506106bf82611e2d565b90505b919050565b6106cf611e52565b6001600160a01b03166106e0610cf9565b6001600160a01b0316146107065760405162461bcd60e51b815260040161063090613ba7565b61070f81611e61565b50565b61071a611e52565b6001600160a01b031661072b610cf9565b6001600160a01b0316146107515760405162461bcd60e51b815260040161063090613ba7565b61075b8282611e75565b5050565b6000818152610132602052604090205460609060ff1615156001146107965760405162461bcd60e51b815260040161063090613a6f565b61012f6107a283611f89565b6040516020016107b39291906137d7565b6040516020818303038152906040529050919050565b6107d1611e52565b6001600160a01b03166107e2610cf9565b6001600160a01b0316146108085760405162461bcd60e51b815260040161063090613ba7565b6000838152610132602052604090205460ff16156108575760405162461bcd60e51b815260206004820152600c60248201526b155cd959081d1bdad95b925960a21b6044820152606401610630565b60009283526101326020526040909220805463ffffffff92909216610100026cffffffffffffffffffffffff001960ff199093166001908117939093161781550155565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109105750604080518082019091526097546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101516000906127109061092f906001600160601b031687613c9e565b6109399190613c8a565b91519350909150505b9250929050565b610951611e52565b6001600160a01b0316856001600160a01b03161480610977575061097785610523611e52565b6109de5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610630565b6109eb85858585856120ab565b5050505050565b60608151835114610a575760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610630565b600083516001600160401b03811115610a8057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610aa9578160200160208202803683370190505b50905060005b8451811015610b4b57610b10858281518110610adb57634e487b7160e01b600052603260045260246000fd5b6020026020010151858381518110610b0357634e487b7160e01b600052603260045260246000fd5b60200260200101516105c8565b828281518110610b3057634e487b7160e01b600052603260045260246000fd5b6020908102919091010152610b4481613d90565b9050610aaf565b509392505050565b610b5b611e52565b6001600160a01b0316610b6c610cf9565b6001600160a01b031614610b925760405162461bcd60e51b815260040161063090613ba7565b6040516001600160a01b038216904780156108fc02916000818181858888f1935050505061070f57600080fd5b610bc7611e52565b6001600160a01b0316610bd8610cf9565b6001600160a01b031614610bfe5760405162461bcd60e51b815260040161063090613ba7565b610133805460ff19169055565b600080610c17836122c0565b5095945050505050565b610c29611e52565b6001600160a01b0316610c3a610cf9565b6001600160a01b031614610c605760405162461bcd60e51b815260040161063090613ba7565b60405162461bcd60e51b815260206004820152601d60248201527f72656e6f756e63654f776e6572736869702069732064697361626c65640000006044820152606401610630565b565b610cb2611e52565b6001600160a01b0316610cc3610cf9565b6001600160a01b031614610ce95760405162461bcd60e51b815260040161063090613ba7565b610cf4838383612371565b505050565b60c9546001600160a01b03165b90565b610d11611e52565b6001600160a01b0316610d22610cf9565b6001600160a01b031614610d485760405162461bcd60e51b815260040161063090613ba7565b805161075b9061012e906020840190612f5d565b61075b610d67611e52565b838361248e565b60016101335460ff166002811115610d9657634e487b7160e01b600052602160045260246000fd5b1480610dc7575060026101335460ff166002811115610dc557634e487b7160e01b600052602160045260246000fd5b145b610e215760405162461bcd60e51b815260206004820152602560248201527f5468697320746f6b656e206973206e6f7420616c6c6f77656420746f206d696e60448201526474206e6f7760d81b6064820152608401610630565b61013454421015610e805760405162461bcd60e51b8152602060048201526024808201527f506c65617365207761697420756e74696c207374617274206d696e74696e672060448201526374696d6560e01b6064820152608401610630565b610ea78461013360020154610ea28563ffffffff16610e9d611e52565b61256f565b6125bd565b610eea5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21036b2b935b63290383937b7b360611b6044820152606401610630565b60008163ffffffff1611610f4b5760405162461bcd60e51b815260206004820152602260248201527f596f752061726520657870656374656420746f206d696e7420736f6d657468696044820152616e6760f01b6064820152608401610630565b600080600080610f61610f5c611e52565b6122c0565b9296509094509250905060016101335460ff166002811115610f9357634e487b7160e01b600052602160045260246000fd5b141561101f578380610fab575060008563ffffffff16115b93508163ffffffff168563ffffffff1611156110005760405162461bcd60e51b8152602060048201526014602482015273457863656564696e6720467265652051756f746160601b6044820152606401610630565b611012878661100d611e52565b612371565b61101c8583613cd4565b91505b60026101335460ff16600281111561104757634e487b7160e01b600052602160045260246000fd5b141561115a57828061105f575060008563ffffffff16115b92508063ffffffff168563ffffffff1611156110b45760405162461bcd60e51b8152602060048201526014602482015273457863656564696e6720506169642051756f746160601b6044820152606401610630565b600087815261013260205260409020600101546110d79063ffffffff8716613c9e565b3410156111405760405162461bcd60e51b815260206004820152603160248201527f55736572206e6565647320746f20706179206d6f726520746f20757365207468604482015270652070616964206d696e742071756f746160781b6064820152608401610630565b61114d878661100d611e52565b6111578582613cd4565b90505b6000611168858585856125d3565b9050806101366000611178611e52565b6001600160a01b031681526020810191909152604001600020805463ffffffff191663ffffffff92909216919091179055505050505050505050565b60006060806060610133600101544210156111d05760006111d8565b6101335460ff165b935084516001600160401b0381111561120157634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561122a578160200160208202803683370190505b50925084516001600160401b0381111561125457634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561127d578160200160208202803683370190505b50915084516001600160401b038111156112a757634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156112d0578160200160208202803683370190505b50905060005b85518163ffffffff16101561145d576000868263ffffffff168151811061130d57634e487b7160e01b600052603260045260246000fd5b602090810291909101810151600081815261013290925260409091205490915060ff1661134c5760405162461bcd60e51b815260040161063090613a6f565b600081815261013260205260409020600101548551869063ffffffff851690811061138757634e487b7160e01b600052603260045260246000fd5b602002602001018181525050610132600082815260200190815260200160002060000160059054906101000a900463ffffffff16848363ffffffff16815181106113e157634e487b7160e01b600052603260045260246000fd5b63ffffffff928316602091820292909201810191909152600083815261013290915260409020548451610100909104821691859190851690811061143557634e487b7160e01b600052603260045260246000fd5b63ffffffff90921660209283029190910190910152508061145581613dab565b9150506112d6565b509193509193565b600080611471836122c0565b9695505050505050565b611483611e52565b6001600160a01b0316611494610cf9565b6001600160a01b0316146114ba5760405162461bcd60e51b815260040161063090613ba7565b6000838152610132602052604090205460ff1615156001146114ee5760405162461bcd60e51b815260040161063090613a6f565b60009283526101326020526040909220805463ffffffff9092166101000264ffffffff001990921691909117815560010155565b60008181526101326020526040812054606091600160481b90910463ffffffff169080826001600160401b0381111561156b57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611594578160200160208202803683370190505b50905060005b8363ffffffff168163ffffffff1610156116555760008681526101326020908152604080832063ffffffff851684526002019091529020546001600160a01b03166115e581886105c8565b6115ef5750611643565b8083856115fb81613dab565b965063ffffffff168151811061162157634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b031681525050505b8061164d81613dab565b91505061159a565b5060008263ffffffff166001600160401b0381111561168457634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156116ad578160200160208202803683370190505b50905060005b8363ffffffff168163ffffffff161015610c1757828163ffffffff16815181106116ed57634e487b7160e01b600052603260045260246000fd5b6020026020010151828263ffffffff168151811061171b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03909216602092830291909101909101528061173d81613dab565b9150506116b3565b606061012e805461175590613d29565b80601f016020809104026020016040519081016040528092919081815260200182805461178190613d29565b80156117ce5780601f106117a3576101008083540402835291602001916117ce565b820191906000526020600020905b8154815290600101906020018083116117b157829003601f168201915b5050505050905090565b61012d546000906001600160a01b03838116911614156117fa5750600161065e565b6001600160a01b0380841660009081526066602090815260408083209386168352929052205460ff165b9392505050565b611833611e52565b6001600160a01b0316611844610cf9565b6001600160a01b03161461186a5760405162461bcd60e51b815260040161063090613ba7565b8483146118d55760405162461bcd60e51b815260206004820152603360248201527f6163636f756e747320616e64206672656551756f7461732073686f756c6420686044820152720c2ecca40e8d0ca40e6c2daca40d8cadccee8d606b1b6064820152608401610630565b8083146119425760405162461bcd60e51b815260206004820152603560248201527f7061696451756f74617320616e64206672656551756f7461732073686f756c64604482015274040d0c2ecca40e8d0ca40e6c2daca40d8cadccee8d605b1b6064820152608401610630565b60005b85811015611ac757600087878381811061196f57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906119849190613147565b905060008686848181106119a857634e487b7160e01b600052603260045260246000fd5b90506020020160208101906119bd9190613706565b905060008585858181106119e157634e487b7160e01b600052603260045260246000fd5b90506020020160208101906119f69190613706565b9050610131548263ffffffff1610611a205760405162461bcd60e51b815260040161063090613a9e565b610131548163ffffffff1610611a485760405162461bcd60e51b815260040161063090613a9e565b6000611a5760018085856125d3565b6001600160a01b0385166000908152610136602052604090205490915063ffffffff808316911614611ab0576001600160a01b038416600090815261013660205260409020805463ffffffff191663ffffffff83161790555b505050508080611abf90613d90565b915050611945565b50505050505050565b611ad8611e52565b6001600160a01b0316611ae9610cf9565b6001600160a01b031614611b0f5760405162461bcd60e51b815260040161063090613ba7565b610131548263ffffffff1610611b375760405162461bcd60e51b815260040161063090613a9e565b610131548163ffffffff1610611b5f5760405162461bcd60e51b815260040161063090613a9e565b610135859055610133805485919060ff19166001836002811115611b9357634e487b7160e01b600052602160045260246000fd5b021790555061013492909255610133805463ffffffff938416600160281b0268ffffffff000000000019949093166101000264ffffffff001990911617929092161790555050565b611be3611e52565b6001600160a01b0316856001600160a01b03161480611c095750611c0985610523611e52565b611c675760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610630565b6109eb8585858585612647565b611c7c611e52565b6001600160a01b0316611c8d610cf9565b6001600160a01b031614611cb35760405162461bcd60e51b815260040161063090613ba7565b6001600160a01b038116611d185760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610630565b61070f8161278e565b6000611d2d60016127e0565b90508015611d45576000805461ff0019166101001790555b611d4e82612865565b611d56612895565b61012d80546001600160a01b03191673207fa8df3a17d96ca7ea4f2893fcdcb78a3041011790558151611d919061012e906020850190612f5d565b508151611da69061012f906020850190612f5d565b50610130805460ff19908116600f1791829055600160ff9092169190911b6101315561013380549091169055611de4611ddd611e52565b6000611e75565b801561075b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b60006001600160e01b0319821663152a902d60e11b14806106bf57506106bf826128c4565b6000611e5c612914565b905090565b805161075b9061012f906020840190612f5d565b6127106001600160601b0382161115611ee35760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610630565b6001600160a01b038216611f395760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610630565b604080518082019091526001600160a01b039283168082526001600160601b03929092166020909101819052609780546001600160a01b031916909217909216600160a01b909202919091179055565b606081611fae57506040805180820190915260018152600360fc1b60208201526106c2565b8160005b8115611fd85780611fc281613d90565b9150611fd19050600a83613c8a565b9150611fb2565b6000816001600160401b0381111561200057634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561202a576020820181803683370190505b5090505b84156120a35761203f600183613cbd565b915061204c600a86613dcf565b612057906030613c4a565b60f81b81838151811061207a57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535061209c600a86613c8a565b945061202e565b949350505050565b815183511461210d5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610630565b6001600160a01b0384166121335760405162461bcd60e51b815260040161063090613aca565b600061213d611e52565b905061214d818787878787612970565b60005b845181101561225257600085828151811061217b57634e487b7160e01b600052603260045260246000fd5b6020026020010151905060008583815181106121a757634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156121f85760405162461bcd60e51b815260040161063090613b5d565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612237908490613c4a565b925050819055505050508061224b90613d90565b9050612150565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516122a2929190613994565b60405180910390a46122b8818787878787612a5b565b505050505050565b6101305460009081908190819081906122e19060019060ff1681901b613cd4565b6001600160a01b038716600090815261013660205260409020546101305491925063ffffffff808216926001601f84901c8116151593601e81901c90911615159260ff90921685901c86169190861616836123485761013354610100900463ffffffff1691505b82612360575061013354600160281b900463ffffffff165b929a91995097509095509350505050565b6000838152610132602052604090205463ffffffff61010082048116916123a39185811691600160281b900416612bc6565b11156123fc5760405162461bcd60e51b815260206004820152602260248201527f4d696e74696e6720616d6f756e74206578636565647320746f6b656e537570706044820152616c7960f01b6064820152608401610630565b604080516000815260208101909152612420908290859063ffffffff861690612bd2565b600083815261013260205260409020546124549061244f9063ffffffff600160281b9091048116908516612bc6565b612cf9565b60009384526101326020526040909320805463ffffffff94909416600160281b0268ffffffff000000000019909416939093179092555050565b816001600160a01b0316836001600160a01b031614156125025760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610630565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000828260405160200161259f92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b60405160208183030381529060405280519060200120905092915050565b6000826125ca8584612d62565b14949350505050565b6101305460009081906125ee9060019060ff1681901b613cd4565b610130549091508382169063ffffffff8684161660ff9091161b601e87612616576000612619565b60015b63ffffffff16901b601f8961262f576000612632565b60015b63ffffffff16901b1717179695505050505050565b6001600160a01b03841661266d5760405162461bcd60e51b815260040161063090613aca565b6000612677611e52565b9050600061268485612ddc565b9050600061269185612ddc565b90506126a1838989858589612970565b60008681526065602090815260408083206001600160a01b038c168452909152902054858110156126e45760405162461bcd60e51b815260040161063090613b5d565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612723908490613c4a565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612783848a8a8a8a8a612e35565b505050505050505050565b60c980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008054610100900460ff1615612827578160ff1660011480156128035750303b155b61281f5760405162461bcd60e51b815260040161063090613b0f565b5060006106c2565b60005460ff80841691161061284e5760405162461bcd60e51b815260040161063090613b0f565b506000805460ff191660ff831617905560016106c2565b600054610100900460ff1661288c5760405162461bcd60e51b815260040161063090613bdc565b61070f81612eff565b600054610100900460ff166128bc5760405162461bcd60e51b815260040161063090613bdc565b610ca8612f26565b60006001600160e01b03198216636cdb3d1360e11b14806128f557506001600160e01b031982166303a24d0760e21b145b806106bf57506301ffc9a760e01b6001600160e01b03198316146106bf565b60003330141561296b57600080368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050503601516001600160a01b03169150610d069050565b503390565b60005b8351811015612a5557600084828151811061299e57634e487b7160e01b600052603260045260246000fd5b602002602001015190506129b8868263ffffffff166105c8565b612a425763ffffffff8181166000818152610132602081815260408084208054600160481b908190048816865260028201845291852080546001600160a01b0319166001600160a01b038f1617905594909352528154600193600992612a2392869291900416613c62565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b5080612a4d81613d90565b915050612973565b506122b8565b6001600160a01b0384163b156122b85760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612a9f9089908990889088908890600401613891565b602060405180830381600087803b158015612ab957600080fd5b505af1925050508015612ae9575060408051601f3d908101601f19168201909252612ae6918101906135fd565b60015b612b9657612af5613e25565b806308c379a01415612b2f5750612b0a613e3c565b80612b155750612b31565b8060405162461bcd60e51b81526004016106309190613a14565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610630565b6001600160e01b0319811663bc197c8160e01b14611ac75760405162461bcd60e51b815260040161063090613a27565b60006118248284613c4a565b6001600160a01b038416612c325760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610630565b6000612c3c611e52565b90506000612c4985612ddc565b90506000612c5685612ddc565b9050612c6783600089858589612970565b60008681526065602090815260408083206001600160a01b038b16845290915281208054879290612c99908490613c4a565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611ac783600089898989612e35565b600063ffffffff821115612d5e5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610630565b5090565b600081815b8451811015610b4b576000858281518110612d9257634e487b7160e01b600052603260045260246000fd5b60200260200101519050808311612db85760008381526020829052604090209250612dc9565b600081815260208490526040902092505b5080612dd481613d90565b915050612d67565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612e2457634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b6001600160a01b0384163b156122b85760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612e7990899089908890889088906004016138ef565b602060405180830381600087803b158015612e9357600080fd5b505af1925050508015612ec3575060408051601f3d908101601f19168201909252612ec0918101906135fd565b60015b612ecf57612af5613e25565b6001600160e01b0319811663f23a6e6160e01b14611ac75760405162461bcd60e51b815260040161063090613a27565b600054610100900460ff166107065760405162461bcd60e51b815260040161063090613bdc565b600054610100900460ff16612f4d5760405162461bcd60e51b815260040161063090613bdc565b610ca8612f58611e52565b61278e565b828054612f6990613d29565b90600052602060002090601f016020900481019282612f8b5760008555612fd1565b82601f10612fa457805160ff1916838001178555612fd1565b82800160010185558215612fd1579182015b82811115612fd1578251825591602001919060010190612fb6565b50612d5e9291505b80821115612d5e5760008155600101612fd9565b60006001600160401b0383111561300657613006613e0f565b60405161301d601f8501601f191660200182613d64565b80915083815284848401111561303257600080fd5b83836020830137600060208583010152509392505050565b80356001600160a01b03811681146106c257600080fd5b60008083601f840112613072578182fd5b5081356001600160401b03811115613088578182fd5b602083019150836020808302850101111561094257600080fd5b600082601f8301126130b2578081fd5b813560206130bf82613c27565b6040516130cc8282613d64565b8381528281019150858301838502870184018810156130e9578586fd5b855b85811015613107578135845292840192908401906001016130eb565b5090979650505050505050565b600082601f830112613124578081fd5b61182483833560208501612fed565b803563ffffffff811681146106c257600080fd5b600060208284031215613158578081fd5b6118248261304a565b60008060408385031215613173578081fd5b61317c8361304a565b915061318a6020840161304a565b90509250929050565b600080600080600060a086880312156131aa578081fd5b6131b38661304a565b94506131c16020870161304a565b935060408601356001600160401b03808211156131dc578283fd5b6131e889838a016130a2565b945060608801359150808211156131fd578283fd5b61320989838a016130a2565b9350608088013591508082111561321e578283fd5b5061322b88828901613114565b9150509295509295909350565b600080600080600060a0868803121561324f578081fd5b6132588661304a565b94506132666020870161304a565b9350604086013592506060860135915060808601356001600160401b0381111561328e578182fd5b61322b88828901613114565b600080604083850312156132ac578182fd5b6132b58361304a565b9150602083013580151581146132c9578182fd5b809150509250929050565b600080604083850312156132e6578182fd5b6132ef8361304a565b946020939093013593505050565b6000806040838503121561330f578182fd5b6133188361304a565b915060208301356001600160601b03811681146132c9578182fd5b6000806000806000806060878903121561334b578384fd5b86356001600160401b0380821115613361578586fd5b61336d8a838b01613061565b90985096506020890135915080821115613385578586fd5b6133918a838b01613061565b909650945060408901359150808211156133a9578283fd5b506133b689828a01613061565b979a9699509497509295939492505050565b600080604083850312156133da578182fd5b82356001600160401b03808211156133f0578384fd5b818501915085601f830112613403578384fd5b8135602061341082613c27565b60405161341d8282613d64565b8381528281019150858301838502870184018b101561343a578889fd5b8896505b848710156134635761344f8161304a565b83526001969096019591830191830161343e565b5096505086013592505080821115613479578283fd5b50613486858286016130a2565b9150509250929050565b600080600080608085870312156134a5578182fd5b84356001600160401b038111156134ba578283fd5b8501601f810187136134ca578283fd5b803560206134d782613c27565b6040516134e48282613d64565b8381528281019150848301838502860184018c1015613501578788fd5b8795505b84861015613523578035835260019590950194918301918301613505565b50975050870135945061353b91505060408601613133565b915061354960608601613133565b905092959194509250565b600060208284031215613565578081fd5b81356001600160401b0381111561357a578182fd5b6120a3848285016130a2565b600080600080600060a0868803121561359d578283fd5b853594506020860135600381106135b2578384fd5b9350604086013592506135c760608701613133565b91506135d560808701613133565b90509295509295909350565b6000602082840312156135f2578081fd5b813561182481613ecd565b60006020828403121561360e578081fd5b815161182481613ecd565b60006020828403121561362a578081fd5b81356001600160401b0381111561363f578182fd5b8201601f8101841361364f578182fd5b6120a384823560208401612fed565b60006020828403121561366f578081fd5b5035919050565b60008060408385031215613688578182fd5b50508035926020909101359150565b6000806000606084860312156136ab578081fd5b833592506136bb60208501613133565b91506136c96040850161304a565b90509250925092565b6000806000606084860312156136e6578081fd5b833592506136f660208501613133565b9150604084013590509250925092565b600060208284031215613717578081fd5b61182482613133565b6000815180845260208085019450808401835b8381101561374f57815187529582019590820190600101613733565b509495945050505050565b6000815180845260208085019450808401835b8381101561374f57815163ffffffff168752958201959082019060010161376d565b600081518084526137a7816020860160208601613cf9565b601f01601f19169290920160200192915050565b600081516137cd818560208601613cf9565b9290920192915050565b82546000908190600281046001808316806137f357607f831692505b602080841082141561381357634e487b7160e01b87526022600452602487fd5b818015613827576001811461383857613864565b60ff19861689528489019650613864565b60008b815260209020885b8681101561385c5781548b820152908501908301613843565b505084890196505b50505050505061388861387782866137bb565b64173539b7b760d91b815260050190565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906138bd90830186613720565b82810360608401526138cf8186613720565b905082810360808401526138e3818561378f565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906139299083018461378f565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b818110156139755783516001600160a01b031683529284019291840191600101613950565b50909695505050505050565b6000602082526118246020830184613720565b6000604082526139a76040830185613720565b82810360208401526138888185613720565b6000600386106139d757634e487b7160e01b81526021600452602481fd5b858252608060208301526139ee6080830186613720565b8281036040840152613a00818661375a565b90508281036060840152613929818561375a565b600060208252611824602083018461378f565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b602080825260159082015274151bdad95b88139bdd08125b9a5d1a585b1a5e9959605a1b604082015260600190565b602080825260129082015271115e18d9595908145d5bdd1848131a5b5a5d60721b604082015260600190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001600160401b03821115613c4057613c40613e0f565b5060209081020190565b60008219821115613c5d57613c5d613de3565b500190565b600063ffffffff808316818516808303821115613c8157613c81613de3565b01949350505050565b600082613c9957613c99613df9565b500490565b6000816000190483118215151615613cb857613cb8613de3565b500290565b600082821015613ccf57613ccf613de3565b500390565b600063ffffffff83811690831681811015613cf157613cf1613de3565b039392505050565b60005b83811015613d14578181015183820152602001613cfc565b83811115613d23576000848401525b50505050565b600281046001821680613d3d57607f821691505b60208210811415613d5e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b0381118282101715613d8957613d89613e0f565b6040525050565b6000600019821415613da457613da4613de3565b5060010190565b600063ffffffff80831681811415613dc557613dc5613de3565b6001019392505050565b600082613dde57613dde613df9565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d1115610d0657600481823e5160e01c90565b600060443d1015613e4c57610d06565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613e7d575050505050610d06565b8285019150815181811115613e9757505050505050610d06565b843d8701016020828501011115613eb357505050505050610d06565b613ec260208286010187613d64565b509094505050505090565b6001600160e01b03198116811461070f57600080fdfea2646970667358221220c14f24fdd9ea09d6f57618f3e87c4a791eae5b6a2f536acf3fa97552792861f364736f6c63430008020033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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