ETH Price: $2,624.66 (-0.34%)

Contract

0x4F1d3838CD6b3C408Ac260615763cB42270592b5
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60a06040184188852023-10-24 8:19:35343 days ago1698135575IN
 Create: TAMAHAGANE
0 ETH0.05487512.84714121

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TAMAHAGANE

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

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

// ████████╗ █████╗ ███╗   ███╗ █████╗   ██╗  ██╗ █████╗  ██████╗  █████╗ ███╗   ██╗███████╗
// ╚══██╔══╝██╔══██╗████╗ ████║██╔══██╗  ██║  ██║██╔══██╗██╔════╝ ██╔══██╗████╗  ██║██╔════╝
//    ██║   ███████║██╔████╔██║███████║  ███████║███████║██║  ███╗███████║██╔██╗ ██║█████╗
//    ██║   ██╔══██║██║╚██╔╝██║██╔══██║  ██╔══██║██╔══██║██║   ██║██╔══██║██║╚██╗██║██╔══╝
//    ██║   ██║  ██║██║ ╚═╝ ██║██║  ██║  ██║  ██║██║  ██║╚██████╔╝██║  ██║██║ ╚████║███████╗
//    ╚═╝   ╚═╝  ╚═╝╚═╝     ╚═╝╚═╝  ╚═╝  ╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═══╝╚══════╝

pragma solidity ^0.8.13;

import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "./ITAMAHAGANEErrorCodes.sol";
import {RevokableDefaultOperatorFiltererUpgradeable} from "./operatorFilterer/RevokableDefaultOperatorFiltererUpgradeable.sol";
import {RevokableOperatorFiltererUpgradeable} from "./operatorFilterer/RevokableOperatorFiltererUpgradeable.sol";

contract TAMAHAGANE is
    ITAMAHAGANEErrorCodes,
    Initializable,
    UUPSUpgradeable,
    ERC1155Upgradeable,
    OwnableUpgradeable,
    ERC2981Upgradeable,
    ReentrancyGuardUpgradeable,
    RevokableDefaultOperatorFiltererUpgradeable
{
    using StringsUpgradeable for uint256;

    // public variables
    mapping(uint256 => uint256) public maxTokens;
    mapping(uint256 => uint256) public mintedTokens;
    mapping(address => bool) public isBurnableContract;
    uint256 public maxSupply;
    uint256 public maxAmountAtOneTime;
    uint256 public currentTamaHaganeId;
    uint256 public price;
    bool public isCreatingKatanaActive;
    bool public isPreActive;
    bool public isContractSaleActive;
    string public name;
    string public symbol;

    // private variables
    mapping(uint256 => string) private _tokenURIs;
    mapping(uint256 => uint256[]) private _availableTokensByTamaHagane;
    mapping(uint256 => mapping(address => uint256))
        private _amountMintedByTamaHaganeId;
    mapping(uint256 => mapping(address => uint256))
        private _amountSaleTransferredByTamaHaganeId;
    mapping(uint256 => bool) private _isTamaHagane;
    uint256 private _totalMinted;
    uint256 private _burnCounter;
    uint256 private _nonce;
    bytes32 private _merkleRoot;

    mapping(uint256 => uint256) public publicContractSalePrice;

    // Events
    event MintAmount(
        uint256 _mintAmountLeft,
        uint256 _totalMinted,
        address _minter
    );
   event TransferredAmount(
        uint256 _transferAmountLeft,
        uint256 _contractBalance,
        uint256 _tokenId,
        address _caller
    );

    // Modifiers
    modifier mintCompliance(uint256 _mintAmount, uint256 _tokenId) {
        if (_mintAmount <= 0) revert TAMAHAGANE__MintAmountIsTooSmall();
        if (totalSupply() + _mintAmount > maxSupply)
            revert TAMAHAGANE__MustMintWithinMaxSupply();
        if (mintedTokens[_tokenId] + _mintAmount > maxTokens[_tokenId])
            revert TAMAHAGANE__ReachedMaxTokens();
        _;
    }

    modifier saleCompliance(
        uint256 _mintAmount,
        uint256 _maxMintableAmount,
        uint256 _tokenId,
        uint256 _processedAmount,
        bool _isSaleActive
    ) {
        if (!_isSaleActive) revert TAMAHAGANE__NotReadyYet();
        if (_mintAmount > _maxMintableAmount - _processedAmount)
            revert TAMAHAGANE__InsufficientMintsLeft();
        if (msg.value != price * _mintAmount)
            revert TAMAHAGANE__InsufficientMintPrice();
        _;
    }

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers();
    }

    function initialize(
        uint256 _maxSupply,
        uint256 _maxSupplyByTokenId,
        uint256 _price,
        uint256 _tamaHaganeId,
        bytes32 merkleRoot_
    ) public initializer {
        __ERC1155_init("");
        __ERC2981_init();
        __Ownable_init();
        __RevokableDefaultOperatorFilterer_init();
        __UUPSUpgradeable_init();
        setRoyaltyInfo(_msgSender(), 750); // 750 == 7.5%
        setTamaHaganeId(_tamaHaganeId, true);
        name = "TAMAHAGANE";
        symbol = "TH";
        maxAmountAtOneTime = 100;
        maxSupply = _maxSupply;
        maxTokens[_tamaHaganeId] = _maxSupplyByTokenId;
        price = _price;
        _merkleRoot = merkleRoot_;
    }

    /**
     * @dev For receiving ETH just in case someone tries to send it.
     */
    receive() external payable {}

    function ownerMint(
        address _to,
        uint256 _tokenId,
        uint256 _mintAmount
    ) external onlyOwner mintCompliance(_mintAmount, _tokenId) {
        mint_(_to, _tokenId, _mintAmount);
    }

    function airdrop(
        uint256 _tokenId,
        address[] memory _toList,
        uint256[] memory _amountList
    ) external onlyOwner {
        if (_toList.length != _amountList.length)
            revert TAMAHAGANE__MismatchedArrayLengths();
        uint256 maxCount = _toList.length;
        for (uint256 i = 0; i < maxCount; ) {
            mint_(_toList[i], _tokenId, _amountList[i]);
            unchecked {
                ++i;
            }
        }
    }

    function preMint(
        uint256 _amount,
        uint256 _maxMintableAmount,
        bytes32[] calldata _merkleProof
    )
        external
        payable
        mintCompliance(_amount, currentTamaHaganeId)
        saleCompliance(
            _amount,
            _maxMintableAmount,
            currentTamaHaganeId,
            amountMinted(currentTamaHaganeId, _msgSender()),
            isPreActive
        )
    {
        address to = _msgSender();
        if (!_verify(to, _maxMintableAmount, _merkleProof))
            revert TAMAHAGANE__InvalidMerkleProof();
        unchecked {
            _amountMintedByTamaHaganeId[currentTamaHaganeId][to] += _amount;
        }
        mint_(to, currentTamaHaganeId, _amount);
        uint256 mintAmountLeft;
        unchecked {
            mintAmountLeft =
                _maxMintableAmount -
                amountMinted(currentTamaHaganeId, to);
        }
        emit MintAmount(mintAmountLeft, mintedTokens[currentTamaHaganeId], to);
    }

    function createKatana(
        uint256 _tamaHaganeId,
        uint256 _amount
    ) external nonReentrant {
        if (!isCreatingKatanaActive) revert TAMAHAGANE__NotReadyYet();
        if (maxAmountAtOneTime < _amount) revert TAMAHAGANE__AmountIsTooBig();
        if (_availableTokensByTamaHagane[_tamaHaganeId].length == 0)
            revert TAMAHAGANE__NoAvailableTokens();
        if (!isTamaHagane(_tamaHaganeId)) revert TAMAHAGANE__NotTamaHaganeId();
        address caller = _msgSender();
        if (balanceOf(caller, _tamaHaganeId) < _amount)
            revert TAMAHAGANE__NotEnoughTamaHagane();
        burn(caller, _tamaHaganeId, _amount);
        for (uint256 i; i < _amount; ) {
            uint256 tokenId = _randomTokenId(_tamaHaganeId);
            mint_(caller, tokenId, 1);
            unchecked {
                ++i;
            }
        }
    }

    function contractPublicSaleTransfer(
        uint256 _tokenId,
        uint256 _amount
    ) external payable nonReentrant {
        if (!isContractSaleActive) revert TAMAHAGANE__NotReadyYet();
        if (msg.value != publicContractSalePrice[_tokenId] * _amount)
            revert TAMAHAGANE__InsufficientMintPrice();
        if (!isTamaHagane(_tokenId)) revert TAMAHAGANE__NotTamaHaganeId();
        address to = _msgSender();
        _safeTransferFromByContract(to, _tokenId, _amount);

        uint256 balance = balanceOf(address(this), _tokenId);
        emit TransferredAmount(balance, balance, _tokenId, to);
    }

    function contractSaleTransfer(
        uint256 _amount,
        uint256 _maxTransferableAmount,
        bytes32[] calldata _merkleProof
    )
        external
        payable
        saleCompliance(
            _amount,
            _maxTransferableAmount,
            currentTamaHaganeId,
            _amountSaleTransferredByTamaHaganeId[currentTamaHaganeId][
                _msgSender()
            ],
            isContractSaleActive
        )
    {
        address to = _msgSender();
        if (!_verify(to, _maxTransferableAmount, _merkleProof))
            revert TAMAHAGANE__InvalidMerkleProof();
        unchecked {
            _amountSaleTransferredByTamaHaganeId[currentTamaHaganeId][
                to
            ] += _amount;
        }
        _safeTransferFromByContract(to, currentTamaHaganeId, _amount);
        uint256 transferAmountLeft;
        unchecked {
            transferAmountLeft =
                _maxTransferableAmount -
                _amountSaleTransferredByTamaHaganeId[currentTamaHaganeId][to];
        }
        emit TransferredAmount(
            transferAmountLeft,
            balanceOf(address(this), currentTamaHaganeId),
            currentTamaHaganeId,
            to
        );
    }

    function toggleCreatingKatanaActive() external onlyOwner {
        isCreatingKatanaActive = !isCreatingKatanaActive;
    }

    function togglePreActive() external onlyOwner {
        isPreActive = !isPreActive;
    }

    function toggleContractSaleActive() external onlyOwner {
        isContractSaleActive = !isContractSaleActive;
    }

    /**
     * @notice Only the owner can withdraw all of the contract balance.
     * @dev All the balance transfers to the owner's address.
     */
    function withdraw() external onlyOwner {
        (bool success, ) = payable(owner()).call{value: address(this).balance}(
            ""
        );
        if (!success) revert TAMAHAGANE__WithdrawFailed();
    }

    function transferERC1155To(
        address _to,
        uint256 _tokenId,
        uint256 _amount
    ) external onlyOwner {
        _safeTransferFromByContract(_to, _tokenId, _amount);
    }

    function setPublicContractSalePrice(
        uint256 _tokenId,
        uint256 _newPrice
    ) external onlyOwner {
        publicContractSalePrice[_tokenId] = _newPrice;
    }

    function setMaxAmountAtOneTime(uint256 _newMax) external onlyOwner {
        maxAmountAtOneTime = _newMax;
    }

    function setMaxSupply(uint256 _newMaxSupply) external onlyOwner {
        maxSupply = _newMaxSupply;
    }

    function setBurnableContract(
        address _contractAddress,
        bool _isBurnable
    ) external onlyOwner {
        isBurnableContract[_contractAddress] = _isBurnable;
    }

    function setMerkleProof(bytes32 _newMerkleRoot) external onlyOwner {
        _merkleRoot = _newMerkleRoot;
    }

    function setPrice(uint256 _newPrice) external onlyOwner {
        price = _newPrice;
    }

    function setURIs(
        uint256[] memory _tokenIds,
        string[] memory _newTokenURIs
    ) external onlyOwner {
        if (_tokenIds.length != _newTokenURIs.length || _tokenIds.length == 0)
            revert TAMAHAGANE__MismatchedArrayLengths();
        uint256 max = _tokenIds.length;
        for (uint256 i = 0; i < max; ) {
            setURI(_tokenIds[i], _newTokenURIs[i]);
            unchecked {
                ++i;
            }
        }
    }

    function setBatchMaxAndAvailableTokens(
        uint256[] memory _tokenIdList,
        uint256[] memory _maxList,
        uint256 _tamaHaganeId
    ) external onlyOwner {
        if (_tokenIdList.length != _maxList.length)
            revert TAMAHAGANE__MismatchedArrayLengths();
        uint256 maxCount = _tokenIdList.length;
        for (uint256 i = 0; i < maxCount; ) {
            setMaxTokens(_tokenIdList[i], _maxList[i]);
            setAvailableTokens(_tokenIdList[i], _tamaHaganeId);
            unchecked {
                ++i;
            }
        }
    }

    function setURI(
        uint256 _tokenId,
        string memory _newTokenURI
    ) public onlyOwner {
        _tokenURIs[_tokenId] = _newTokenURI;
    }

    function setMaxTokens(uint256 _tokenId, uint256 _max) public onlyOwner {
        maxTokens[_tokenId] = _max;
    }

    function setAvailableTokens(
        uint256 _tokenId,
        uint256 _tamaHaganeId
    ) public onlyOwner {
        if (mintedTokens[_tokenId] >= maxTokens[_tokenId])
            revert TAMAHAGANE__ReachedMaxTokens();
        uint256[] memory availableTokens = _availableTokensByTamaHagane[
            _tamaHaganeId
        ];
        for (uint256 i = 0; i < availableTokens.length; ) {
            if (availableTokens[i] == _tokenId)
                revert TAMAHAGANE__TokenIdAlreadyExists();
            unchecked {
                ++i;
            }
        }
        _availableTokensByTamaHagane[_tamaHaganeId].push(_tokenId);
    }

    /**
     * @dev Set the new royalty fee and the new receiver.
     */
    function setRoyaltyInfo(
        address _receiver,
        uint96 _royaltyFee
    ) public onlyOwner {
        _setDefaultRoyalty(_receiver, _royaltyFee);
    }

    function setTamaHaganeId(
        uint256 _tokenId,
        bool _isTamaHaganeFlag
    ) public onlyOwner {
        _isTamaHagane[_tokenId] = _isTamaHaganeFlag;
        if (_isTamaHaganeFlag) currentTamaHaganeId = _tokenId;
    }

    function burn(address _account, uint256 _id, uint256 _amount) public {
        address caller = _msgSender();
        if (caller != _account && !isBurnableContract[caller])
            revert TAMAHAGANE__NotOwnerOrBurnableContract();
        unchecked {
            _burnCounter += _amount;
        }
        _burn(_account, _id, _amount);
    }

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

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

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override onlyAllowedOperator(from) {
        super.safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    function _authorizeUpgrade(
        address _newImplementation
    ) internal override onlyOwner {}

    function mint_(address _to, uint256 _tokenId, uint256 _amount) private {
        unchecked {
            _totalMinted += _amount;
            mintedTokens[_tokenId] += _amount;
        }
        _mint(_to, _tokenId, _amount, "");
    }

    function _safeTransferFromByContract(
        address _to,
        uint256 _tokenId,
        uint256 _amount
    ) private {
        this.safeTransferFrom(address(this), _to, _tokenId, _amount, "");
    }

    function _randomTokenIdAndIndex(
        uint256[] memory availableTokens,
        uint256 availableTokensNum
    ) private returns (uint256, uint256) {
        unchecked {
            _nonce += availableTokensNum;
            uint256 index = uint256(
                keccak256(abi.encodePacked(block.timestamp, msg.sender, _nonce))
            ) % availableTokensNum;
            uint256 tokenId = availableTokens[index];
            return (tokenId, index);
        }
    }

    function _randomTokenId(uint256 _tamaHaganeId) private returns (uint256) {
        uint256[] memory availableTokens = _availableTokensByTamaHagane[
            _tamaHaganeId
        ];
        uint256 availableTokensNum = availableTokens.length;
        (uint256 tokenId, uint256 index) = _randomTokenIdAndIndex(
            availableTokens,
            availableTokensNum
        );
        uint256 totalMintingAmountByTokenId = mintedTokens[tokenId] + 1;

        if (totalMintingAmountByTokenId > maxTokens[tokenId])
            revert TAMAHAGANE__CannotMintAnymore();
        if (totalMintingAmountByTokenId == maxTokens[tokenId]) {
            availableTokens[index] = availableTokens[availableTokensNum - 1];
            _availableTokensByTamaHagane[_tamaHaganeId] = availableTokens;
            _availableTokensByTamaHagane[_tamaHaganeId].pop();
        }
        return tokenId;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(
        bytes4 interfaceId
    )
        public
        view
        virtual
        override(ERC1155Upgradeable, ERC2981Upgradeable)
        returns (bool)
    {
        return
            ERC1155Upgradeable.supportsInterface(interfaceId) ||
            ERC2981Upgradeable.supportsInterface(interfaceId);
    }

    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    /**
     * @dev Returns the owner of the ERC1155 token contract.
     */
    function owner()
        public
        view
        virtual
        override(OwnableUpgradeable, RevokableOperatorFiltererUpgradeable)
        returns (address)
    {
        return OwnableUpgradeable.owner();
    }

    function isTamaHagane(uint256 _tokenId) public view returns (bool) {
        return _isTamaHagane[_tokenId];
    }

    /**
     * @dev Return tokenURI for the specified token ID.
     * @param _tokenId The token ID the token URI is returned for.
     */
    function uri(
        uint256 _tokenId
    ) public view override returns (string memory) {
        return _tokenURIs[_tokenId];
    }

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

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function totalMinted() public view returns (uint256) {
        return _totalMinted;
    }

    function amountMinted(
        uint256 _tamaHaganeId,
        address _address
    ) public view returns (uint256) {
        return _amountMintedByTamaHaganeId[_tamaHaganeId][_address];
    }

    function mintableAmount(
        uint256 _tamaHaganeId,
        address _address,
        uint256 _maxMintableAmount,
        bytes32[] calldata _merkleProof
    ) external view returns (uint256) {
        if (
            _verify(_address, _maxMintableAmount, _merkleProof) &&
            _amountMintedByTamaHaganeId[_tamaHaganeId][_address] <
            _maxMintableAmount
        )
            return
                _maxMintableAmount -
                _amountMintedByTamaHaganeId[_tamaHaganeId][_address];
        else return 0;
    }

    function availableTokensByTamaHagane(
        uint256 _tamaHaganeId
    ) external view onlyOwner returns (uint256[] memory) {
        return _availableTokensByTamaHagane[_tamaHaganeId];
    }

    function _verify(
        address _address,
        uint256 _maxMintableAmount,
        bytes32[] calldata _merkleProof
    ) private view returns (bool) {
        bytes32 leaf = keccak256(
            abi.encodePacked(_address, _maxMintableAmount.toString())
        );

        return MerkleProofUpgradeable.verify(_merkleProof, _merkleRoot, leaf);
    }
}

File 2 of 30 : ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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: address zero is not a valid owner");
        return _balances[id][account];
    }

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

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

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

        return batchBalances;
    }

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try 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 30 : ERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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:
     *
     * - `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 30 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @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 5 of 30 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

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

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

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

    uint256 private _status;

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

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

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

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

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

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

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

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

File 6 of 30 : MerkleProofUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProofUpgradeable {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

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

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

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

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 7 of 30 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";

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

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

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
    }

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

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

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

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

File 8 of 30 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

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

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

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

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

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

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 9 of 30 : UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)

pragma solidity ^0.8.0;

import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";

/**
 * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
 * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
 *
 * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
 * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
 * `UUPSUpgradeable` with a custom implementation of upgrades.
 *
 * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
 *
 * _Available since v4.1._
 */
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
    function __UUPSUpgradeable_init() internal onlyInitializing {
    }

    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
    }
    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
    address private immutable __self = address(this);

    /**
     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is
     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
     * fail.
     */
    modifier onlyProxy() {
        require(address(this) != __self, "Function must be called through delegatecall");
        require(_getImplementation() == __self, "Function must be called through active proxy");
        _;
    }

    /**
     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be
     * callable on the implementing contract but not through proxies.
     */
    modifier notDelegated() {
        require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
        _;
    }

    /**
     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
     */
    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
        return _IMPLEMENTATION_SLOT;
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeTo(address newImplementation) public virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
    }

    /**
     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
     * encoded in `data`.
     *
     * Calls {_authorizeUpgrade}.
     *
     * Emits an {Upgraded} event.
     *
     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall
     */
    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
        _authorizeUpgrade(newImplementation);
        _upgradeToAndCallUUPS(newImplementation, data, true);
    }

    /**
     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
     * {upgradeTo} and {upgradeToAndCall}.
     *
     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
     *
     * ```solidity
     * function _authorizeUpgrade(address) internal override onlyOwner {}
     * ```
     */
    function _authorizeUpgrade(address newImplementation) internal virtual;

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

File 10 of 30 : ITAMAHAGANEErrorCodes.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

/**
 * @dev custom error codes common to many contracts are predefined here
 */
interface ITAMAHAGANEErrorCodes {
    error TAMAHAGANE__AmountIsTooBig();
    error TAMAHAGANE__CannotMintAnymore();
    error TAMAHAGANE__InsufficientMintPrice();
    error TAMAHAGANE__InsufficientMintsLeft();
    error TAMAHAGANE__InvalidMerkleProof();
    error TAMAHAGANE__MismatchedArrayLengths();
    error TAMAHAGANE__MintAmountIsTooSmall();
    error TAMAHAGANE__MustMintWithinMaxSupply();
    error TAMAHAGANE__NoAvailableTokens();
    error TAMAHAGANE__NotEnoughTamaHagane();
    error TAMAHAGANE__NotOwnerOrBurnableContract();
    error TAMAHAGANE__NotReadyYet();
    error TAMAHAGANE__NotTamaHaganeId();
    error TAMAHAGANE__ReachedMaxTokens();
    error TAMAHAGANE__TokenIdAlreadyExists();
    error TAMAHAGANE__WithdrawFailed();
}

File 11 of 30 : RevokableDefaultOperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {RevokableOperatorFiltererUpgradeable} from "./RevokableOperatorFiltererUpgradeable.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "./Constants.sol";

/**
 * @title  RevokableDefaultOperatorFiltererUpgradeable
 * @notice Inherits from RevokableOperatorFiltererUpgradeable and automatically subscribes to the default OpenSea subscription
 *         when the init function is called.
 *         Note that OpenSea will disable creator earnings enforcement if filtered operators begin fulfilling orders
 *         on-chain, eg, if the registry is revoked or bypassed.
 */
abstract contract RevokableDefaultOperatorFiltererUpgradeable is
    RevokableOperatorFiltererUpgradeable
{
    /// @dev The upgradeable initialize function that should be called when the contract is being upgraded.
    function __RevokableDefaultOperatorFilterer_init()
        internal
        onlyInitializing
    {
        RevokableOperatorFiltererUpgradeable.__RevokableOperatorFilterer_init(
            CANONICAL_CORI_SUBSCRIPTION,
            true
        );
    }
}

File 12 of 30 : RevokableOperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

/**
 * @title  Upgradeable storage layout for RevokableOperatorFiltererUpgradeable.
 * @notice Upgradeable contracts must use a storage layout that can be used across upgrades.
 *         Only append new variables to the end of the layout.
 */
library RevokableOperatorFiltererUpgradeableStorage {
    struct Layout {
        /// @dev Whether the OperatorFilterRegistry has been revoked.
        bool _isOperatorFilterRegistryRevoked;
    }

    /// @dev The storage slot for the layout.
    bytes32 internal constant STORAGE_SLOT =
        keccak256("RevokableOperatorFiltererUpgradeable.contracts.storage");

    /// @dev The layout of the storage.
    function layout() internal pure returns (Layout storage l) {
        bytes32 slot = STORAGE_SLOT;
        assembly {
            l.slot := slot
        }
    }
}

/**
 * @title  RevokableOperatorFilterer
 * @notice This contract is meant to allow contracts to permanently opt out of the OperatorFilterRegistry. The Registry
 *         itself has an "unregister" function, but if the contract is ownable, the owner can re-register at any point.
 *         As implemented, this abstract contract allows the contract owner to toggle the
 *         isOperatorFilterRegistryRevoked flag in order to permanently bypass the OperatorFilterRegistry checks.
 */
abstract contract RevokableOperatorFiltererUpgradeable is
    OperatorFiltererUpgradeable
{
    using RevokableOperatorFiltererUpgradeableStorage for RevokableOperatorFiltererUpgradeableStorage.Layout;

    error OnlyOwner();
    error AlreadyRevoked();

    event OperatorFilterRegistryRevoked();

    function __RevokableOperatorFilterer_init(
        address subscriptionOrRegistrantToCopy,
        bool subscribe
    ) internal {
        OperatorFiltererUpgradeable.__OperatorFilterer_init(
            subscriptionOrRegistrantToCopy,
            subscribe
        );
    }

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    function _checkFilterOperator(
        address operator
    ) internal view virtual override {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (
            !RevokableOperatorFiltererUpgradeableStorage
                .layout()
                ._isOperatorFilterRegistryRevoked &&
            address(OPERATOR_FILTER_REGISTRY).code.length > 0
        ) {
            // under normal circumstances, this function will revert rather than return false, but inheriting or
            // upgraded contracts may specify their own OperatorFilterRegistry implementations, which may behave
            // differently
            if (
                !OPERATOR_FILTER_REGISTRY.isOperatorAllowed(
                    address(this),
                    operator
                )
            ) {
                revert OperatorNotAllowed(operator);
            }
        }
    }

    /**
     * @notice Disable the isOperatorFilterRegistryRevoked flag. OnlyOwner.
     */
    function revokeOperatorFilterRegistry() external {
        if (msg.sender != owner()) {
            revert OnlyOwner();
        }
        if (
            RevokableOperatorFiltererUpgradeableStorage
                .layout()
                ._isOperatorFilterRegistryRevoked
        ) {
            revert AlreadyRevoked();
        }
        RevokableOperatorFiltererUpgradeableStorage
            .layout()
            ._isOperatorFilterRegistryRevoked = true;
        emit OperatorFilterRegistryRevoked();
    }

    function isOperatorFilterRegistryRevoked() public view returns (bool) {
        return
            RevokableOperatorFiltererUpgradeableStorage
                .layout()
                ._isOperatorFilterRegistryRevoked;
    }

    /**
     * @dev assume the contract has an owner, but leave specific Ownable implementation up to inheriting contract
     */
    function owner() public view virtual returns (address);
}

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 17 of 30 : 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 18 of 30 : 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 19 of 30 : 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 20 of 30 : IERC2981Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

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

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

File 21 of 30 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

File 23 of 30 : draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
 * proxy whose upgrades are fully controlled by the current implementation.
 */
interface IERC1822ProxiableUpgradeable {
    /**
     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
     * address.
     *
     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
     * function revert if invoked through a proxy.
     */
    function proxiableUUID() external view returns (bytes32);
}

File 24 of 30 : ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)

pragma solidity ^0.8.2;

import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";

/**
 * @dev This abstract contract provides getters and event emitting update functions for
 * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
 *
 * _Available since v4.1._
 */
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
    function __ERC1967Upgrade_init() internal onlyInitializing {
    }

    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
    }
    // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;

    /**
     * @dev Storage slot with the address of the current implementation.
     * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;

    /**
     * @dev Returns the current implementation address.
     */
    function _getImplementation() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 implementation slot.
     */
    function _setImplementation(address newImplementation) private {
        require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
    }

    /**
     * @dev Perform implementation upgrade
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeTo(address newImplementation) internal {
        _setImplementation(newImplementation);
        emit Upgraded(newImplementation);
    }

    /**
     * @dev Perform implementation upgrade with additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
        _upgradeTo(newImplementation);
        if (data.length > 0 || forceCall) {
            AddressUpgradeable.functionDelegateCall(newImplementation, data);
        }
    }

    /**
     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
     *
     * Emits an {Upgraded} event.
     */
    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
        // Upgrades from old implementations will perform a rollback test. This test requires the new
        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
        // this special case will break upgrade paths from old UUPS implementation to new ones.
        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
            _setImplementation(newImplementation);
        } else {
            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
                require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
            } catch {
                revert("ERC1967Upgrade: new implementation is not UUPS");
            }
            _upgradeToAndCall(newImplementation, data, forceCall);
        }
    }

    /**
     * @dev Storage slot with the admin of the contract.
     * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
     * validated in the constructor.
     */
    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;

    /**
     * @dev Returns the current admin.
     */
    function _getAdmin() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
    }

    /**
     * @dev Stores a new address in the EIP1967 admin slot.
     */
    function _setAdmin(address newAdmin) private {
        require(newAdmin != address(0), "ERC1967: new admin is the zero address");
        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
    }

    /**
     * @dev Changes the admin of the proxy.
     *
     * Emits an {AdminChanged} event.
     */
    function _changeAdmin(address newAdmin) internal {
        emit AdminChanged(_getAdmin(), newAdmin);
        _setAdmin(newAdmin);
    }

    /**
     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
     */
    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;

    /**
     * @dev Returns the current beacon.
     */
    function _getBeacon() internal view returns (address) {
        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
    }

    /**
     * @dev Stores a new beacon in the EIP1967 beacon slot.
     */
    function _setBeacon(address newBeacon) private {
        require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
        require(
            AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
            "ERC1967: beacon implementation is not a contract"
        );
        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
    }

    /**
     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
     *
     * Emits a {BeaconUpgraded} event.
     */
    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
        _setBeacon(newBeacon);
        emit BeaconUpgraded(newBeacon);
        if (data.length > 0 || forceCall) {
            AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), 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 25 of 30 : IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)

pragma solidity ^0.8.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IBeaconUpgradeable {
    /**
     * @dev Must return an address that can be used as a delegate call target.
     *
     * {BeaconProxy} will check that this address is a contract.
     */
    function implementation() external view returns (address);
}

File 26 of 30 : IERC1967Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.0;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 *
 * _Available since v4.8.3._
 */
interface IERC1967Upgradeable {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}

File 27 of 30 : StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlotUpgradeable {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 28 of 30 : Constants.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

File 29 of 30 : OperatorFiltererUpgradeable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

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

    IOperatorFilterRegistry constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    /// @dev The upgradeable initialize function that should be called when the contract is being upgraded.
    function __OperatorFilterer_init(
        address subscriptionOrRegistrantToCopy,
        bool subscribe
    ) internal onlyInitializing {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isRegistered(address(this))) {
                if (subscribe) {
                    OPERATOR_FILTER_REGISTRY.registerAndSubscribe(
                        address(this),
                        subscriptionOrRegistrantToCopy
                    );
                } else {
                    if (subscriptionOrRegistrantToCopy != address(0)) {
                        OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(
                            address(this),
                            subscriptionOrRegistrantToCopy
                        );
                    } else {
                        OPERATOR_FILTER_REGISTRY.register(address(this));
                    }
                }
            }
        }
    }

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

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

    /**
     * @dev A helper function to check if the operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting or
            // upgraded contracts may specify their own OperatorFilterRegistry implementations, which may behave
            // differently
            if (
                !OPERATOR_FILTER_REGISTRY.isOperatorAllowed(
                    address(this),
                    operator
                )
            ) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

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

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(
        address registrant,
        address operator
    ) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(
        address registrant,
        address subscription
    ) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(
        address registrant,
        address registrantToCopy
    ) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(
        address registrant,
        address operator,
        bool filtered
    ) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(
        address registrant,
        address[] calldata operators,
        bool filtered
    ) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(
        address registrant,
        bytes32 codehash,
        bool filtered
    ) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(
        address registrant,
        bytes32[] calldata codeHashes,
        bool filtered
    ) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(
        address registrant,
        address registrantToSubscribe
    ) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(
        address registrant
    ) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(
        address registrant,
        uint256 index
    ) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(
        address registrant,
        address registrantToCopy
    ) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(
        address registrant,
        address operator
    ) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(
        address registrant,
        address operatorWithCode
    ) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(
        address registrant,
        bytes32 codeHash
    ) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(
        address addr
    ) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(
        address addr
    ) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(
        address registrant,
        uint256 index
    ) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(
        address registrant,
        uint256 index
    ) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyRevoked","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"TAMAHAGANE__AmountIsTooBig","type":"error"},{"inputs":[],"name":"TAMAHAGANE__CannotMintAnymore","type":"error"},{"inputs":[],"name":"TAMAHAGANE__InsufficientMintPrice","type":"error"},{"inputs":[],"name":"TAMAHAGANE__InsufficientMintsLeft","type":"error"},{"inputs":[],"name":"TAMAHAGANE__InvalidMerkleProof","type":"error"},{"inputs":[],"name":"TAMAHAGANE__MintAmountIsTooSmall","type":"error"},{"inputs":[],"name":"TAMAHAGANE__MismatchedArrayLengths","type":"error"},{"inputs":[],"name":"TAMAHAGANE__MustMintWithinMaxSupply","type":"error"},{"inputs":[],"name":"TAMAHAGANE__NoAvailableTokens","type":"error"},{"inputs":[],"name":"TAMAHAGANE__NotEnoughTamaHagane","type":"error"},{"inputs":[],"name":"TAMAHAGANE__NotOwnerOrBurnableContract","type":"error"},{"inputs":[],"name":"TAMAHAGANE__NotReadyYet","type":"error"},{"inputs":[],"name":"TAMAHAGANE__NotTamaHaganeId","type":"error"},{"inputs":[],"name":"TAMAHAGANE__ReachedMaxTokens","type":"error"},{"inputs":[],"name":"TAMAHAGANE__TokenIdAlreadyExists","type":"error"},{"inputs":[],"name":"TAMAHAGANE__WithdrawFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_mintAmountLeft","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_totalMinted","type":"uint256"},{"indexed":false,"internalType":"address","name":"_minter","type":"address"}],"name":"MintAmount","type":"event"},{"anonymous":false,"inputs":[],"name":"OperatorFilterRegistryRevoked","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":"uint256","name":"_transferAmountLeft","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_contractBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"_caller","type":"address"}],"name":"TransferredAmount","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address[]","name":"_toList","type":"address[]"},{"internalType":"uint256[]","name":"_amountList","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tamaHaganeId","type":"uint256"},{"internalType":"address","name":"_address","type":"address"}],"name":"amountMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tamaHaganeId","type":"uint256"}],"name":"availableTokensByTamaHagane","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"contractPublicSaleTransfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_maxTransferableAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"contractSaleTransfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tamaHaganeId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"createKatana","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentTamaHaganeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_maxSupplyByTokenId","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_tamaHaganeId","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isBurnableContract","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isContractSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isCreatingKatanaActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperatorFilterRegistryRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPreActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"isTamaHagane","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAmountAtOneTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tamaHaganeId","type":"uint256"},{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"_maxMintableAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"mintableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_maxMintableAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"preMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"publicContractSalePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeOperatorFilterRegistry","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":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_tamaHaganeId","type":"uint256"}],"name":"setAvailableTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIdList","type":"uint256[]"},{"internalType":"uint256[]","name":"_maxList","type":"uint256[]"},{"internalType":"uint256","name":"_tamaHaganeId","type":"uint256"}],"name":"setBatchMaxAndAvailableTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_contractAddress","type":"address"},{"internalType":"bool","name":"_isBurnable","type":"bool"}],"name":"setBurnableContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMax","type":"uint256"}],"name":"setMaxAmountAtOneTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMaxSupply","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_max","type":"uint256"}],"name":"setMaxTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_newMerkleRoot","type":"bytes32"}],"name":"setMerkleProof","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newPrice","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_newPrice","type":"uint256"}],"name":"setPublicContractSalePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint96","name":"_royaltyFee","type":"uint96"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"bool","name":"_isTamaHaganeFlag","type":"bool"}],"name":"setTamaHaganeId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newTokenURI","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"_newTokenURIs","type":"string[]"}],"name":"setURIs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleContractSaleActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleCreatingKatanaActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"togglePreActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferERC1155To","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b608051614bd16200011f6000396000818161102901528181611069015281816117060152818161174601526117d50152614bd16000f3fe6080604052600436106103c65760003560e01c8063715018a6116101f2578063d5516e7f1161010d578063f06a7933116100a0578063f4bf07a91161006f578063f4bf07a914610bb9578063f5298aca14610bd9578063f67bdda214610bf9578063f6ba204614610c0c57600080fd5b8063f06a793314610b1c578063f23a6e6114610b4d578063f242432a14610b79578063f2fde38b14610b9957600080fd5b8063e7cdbea6116100dc578063e7cdbea614610a77578063e985e9c514610a8e578063ecba222a14610ad7578063ef94688514610afc57600080fd5b8063d5516e7f14610a00578063d5abeb0114610a20578063db46ef1014610a37578063e39058ac14610a5757600080fd5b80639412399911610185578063a2309ff811610154578063a2309ff814610989578063a3824bf61461099f578063b0c55a02146109b4578063bc197c81146109c757600080fd5b8063941239991461091d57806395d89b411461093d578063a035b1fe14610952578063a22cb4651461096957600080fd5b80638da5cb5b116101c15780638da5cb5b14610871578063905a42cf1461089e5780639073810c146108cf57806391b7f5ed146108fd57600080fd5b8063715018a6146107ee5780637ef758d414610803578063862440e214610831578063867589121461085157600080fd5b80633659cfe6116102e25780634ee83f84116102755780635bdc95d0116102445780635bdc95d01461076b5780635ef9432a1461078b5780635f6fce46146107a05780636f8b44b0146107ce57600080fd5b80634ee83f84146107035780634f1ef2861461072357806352d1902d1461073657806353221d391461074b57600080fd5b80633cb00e39116102b15780633cb00e391461068e5780633ccfd60b146106ae5780634024cece146106c35780634e1273f4146106d657600080fd5b80633659cfe61461061e578063382499901461063e578063384079b514610659578063388b9fe01461066e57600080fd5b80630ee9b3951161035a5780631f6ab6a8116103295780631f6ab6a81461055b57806321e266c71461059f5780632a55205a146105bf5780632eb2c2d6146105fe57600080fd5b80630ee9b395146104e55780631790d1e31461050557806318160ddd146105265780631e49e2f21461053b57600080fd5b806304fae86b1161039657806304fae86b1461047757806306fdde031461048c5780630900dffa146104ae5780630e89341c146104c557600080fd5b8062fdd58e146103d257806301ffc9a71461040557806302fa7c4714610435578063042454ff1461045757600080fd5b366103cd57005b600080fd5b3480156103de57600080fd5b506103f26103ed366004613c03565b610c2c565b6040519081526020015b60405180910390f35b34801561041157600080fd5b50610425610420366004613c43565b610cc7565b60405190151581526020016103fc565b34801561044157600080fd5b50610455610450366004613c60565b610ce1565b005b34801561046357600080fd5b50610455610472366004613cb1565b610cf7565b34801561048357600080fd5b50610455610d2b565b34801561049857600080fd5b506104a1610d53565b6040516103fc9190613d2d565b3480156104ba57600080fd5b506103f26101965481565b3480156104d157600080fd5b506104a16104e0366004613d40565b610de2565b3480156104f157600080fd5b50610455610500366004613ea2565b610e85565b34801561051157600080fd5b50610198546104259062010000900460ff1681565b34801561053257600080fd5b506103f2610f12565b34801561054757600080fd5b506101985461042590610100900460ff1681565b34801561056757600080fd5b506103f2610576366004613f81565b600091825261019d602090815260408084206001600160a01b0393909316845291905290205490565b3480156105ab57600080fd5b506104556105ba366004613fad565b610f28565b3480156105cb57600080fd5b506105df6105da366004613fe0565b610f40565b604080516001600160a01b0390931683526020830191909152016103fc565b34801561060a57600080fd5b50610455610619366004614002565b610ff0565b34801561062a57600080fd5b506104556106393660046140ab565b61101f565b34801561064a57600080fd5b50610198546104259060ff1681565b34801561066557600080fd5b506104556110fe565b34801561067a57600080fd5b50610455610689366004613fad565b611124565b34801561069a57600080fd5b506104556106a9366004613fe0565b6111de565b3480156106ba57600080fd5b506104556111f9565b6104556106d136600461410a565b61127c565b3480156106e257600080fd5b506106f66106f13660046141c9565b6114c1565b6040516103fc9190614267565b34801561070f57600080fd5b5061045561071e366004613fe0565b6115ea565b61045561073136600461427a565b6116fc565b34801561074257600080fd5b506103f26117c8565b34801561075757600080fd5b506104556107663660046142bd565b61187c565b34801561077757600080fd5b506104556107863660046142f8565b611a5a565b34801561079757600080fd5b50610455611a8d565b3480156107ac57600080fd5b506103f26107bb366004613d40565b6101a46020526000908152604090205481565b3480156107da57600080fd5b506104556107e9366004613d40565b611b3c565b3480156107fa57600080fd5b50610455611b4a565b34801561080f57600080fd5b506103f261081e366004613d40565b6101926020526000908152604090205481565b34801561083d57600080fd5b5061045561084c36600461431d565b611b5e565b34801561085d57600080fd5b5061045561086c366004613d40565b611b7f565b34801561087d57600080fd5b50610886611b8d565b6040516001600160a01b0390911681526020016103fc565b3480156108aa57600080fd5b506104256108b9366004613d40565b600090815261019f602052604090205460ff1690565b3480156108db57600080fd5b506103f26108ea366004613d40565b6101916020526000908152604090205481565b34801561090957600080fd5b50610455610918366004613d40565b611ba6565b34801561092957600080fd5b5061045561093836600461434d565b611bb4565b34801561094957600080fd5b506104a1611c52565b34801561095e57600080fd5b506103f26101975481565b34801561097557600080fd5b50610455610984366004613cb1565b611c60565b34801561099557600080fd5b506101a0546103f2565b3480156109ab57600080fd5b50610455611c74565b6104556109c2366004613fe0565b611c91565b3480156109d357600080fd5b506109e76109e2366004614002565b611da5565b6040516001600160e01b031990911681526020016103fc565b348015610a0c57600080fd5b50610455610a1b3660046143b9565b611db7565b348015610a2c57600080fd5b506103f26101945481565b348015610a4357600080fd5b50610455610a52366004613fe0565b611e33565b348015610a6357600080fd5b50610455610a72366004613d40565b611e4e565b348015610a8357600080fd5b506103f26101955481565b348015610a9a57600080fd5b50610425610aa9366004614425565b6001600160a01b03918216600090815260ca6020908152604080832093909416825291909152205460ff1690565b348015610ae357600080fd5b50600080516020614b358339815191525460ff16610425565b348015610b0857600080fd5b506103f2610b1736600461444f565b611e5c565b348015610b2857600080fd5b50610425610b373660046140ab565b6101936020526000908152604090205460ff1681565b348015610b5957600080fd5b506109e7610b683660046144b6565b63f23a6e6160e01b95945050505050565b348015610b8557600080fd5b50610455610b943660046144b6565b611eda565b348015610ba557600080fd5b50610455610bb43660046140ab565b611f01565b348015610bc557600080fd5b506106f6610bd4366004613d40565b611f77565b348015610be557600080fd5b50610455610bf4366004613fad565b611fe2565b610455610c0736600461410a565b612048565b348015610c1857600080fd5b50610455610c27366004613fe0565b6121ed565b60006001600160a01b038316610c9c5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610cd28261230c565b80610cc15750610cc18261235c565b610ce9612381565b610cf382826123e0565b5050565b610cff612381565b6001600160a01b0391909116600090815261019360205260409020805460ff1916911515919091179055565b610d33612381565b610198805462ff0000198116620100009182900460ff1615909102179055565b6101998054610d619061451a565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8d9061451a565b8015610dda5780601f10610daf57610100808354040283529160200191610dda565b820191906000526020600020905b815481529060010190602001808311610dbd57829003601f168201915b505050505081565b600081815261019b60205260409020805460609190610e009061451a565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2c9061451a565b8015610e795780601f10610e4e57610100808354040283529160200191610e79565b820191906000526020600020905b815481529060010190602001808311610e5c57829003601f168201915b50505050509050919050565b610e8d612381565b80518251141580610e9d57508151155b15610ebb57604051632a6de9df60e11b815260040160405180910390fd5b815160005b81811015610f0c57610f04848281518110610edd57610edd614554565b6020026020010151848381518110610ef757610ef7614554565b6020026020010151611b5e565b600101610ec0565b50505050565b60006101a154610f226101a05490565b03905090565b610f30612381565b610f3b8383836124de565b505050565b600082815261012e602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610fb757506040805180820190915261012d546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610fd6906001600160601b031687614580565b610fe091906145ad565b91519350909150505b9250929050565b846001600160a01b038116331461100a5761100a3361255f565b6110178686868686612636565b505050505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036110675760405162461bcd60e51b8152600401610c93906145cf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166110b0600080516020614b55833981519152546001600160a01b031690565b6001600160a01b0316146110d65760405162461bcd60e51b8152600401610c939061461b565b6110df8161267b565b604080516000808252602082019092526110fb91839190612683565b50565b611106612381565b610198805461ff001981166101009182900460ff1615909102179055565b61112c612381565b80826000821161114f5760405163360b521960e21b815260040160405180910390fd5b610194548261115c610f12565b6111669190614667565b1115611185576040516320fa981560e21b815260040160405180910390fd5b60008181526101916020908152604080832054610192909252909120546111ad908490614667565b11156111cc5760405163067dbce560e41b815260040160405180910390fd5b6111d78585856127ee565b5050505050565b6111e6612381565b6000918252610191602052604090912055565b611201612381565b600061120b611b8d565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611255576040519150601f19603f3d011682016040523d82523d6000602084013e61125a565b606091505b50509050806110fb5760405163195dcc8b60e31b815260040160405180910390fd5b8361019654600082116112a25760405163360b521960e21b815260040160405180910390fd5b61019454826112af610f12565b6112b99190614667565b11156112d8576040516320fa981560e21b815260040160405180910390fd5b6000818152610191602090815260408083205461019290925290912054611300908490614667565b111561131f5760405163067dbce560e41b815260040160405180910390fd5b858561019654611333610196546105763390565b61019854610100900460ff168061135d5760405163fa1eb5f760e01b815260040160405180910390fd5b611367828561467a565b8511156113875760405163493268f760e01b815260040160405180910390fd5b84610197546113969190614580565b34146113b5576040516328cc098160e01b815260040160405180910390fd5b336113c2818c8c8c612828565b6113df57604051632798825760e01b815260040160405180910390fd5b6101968054600090815261019d602090815260408083206001600160a01b0386168452909152902080548e0190555461141a9082908e6127ee565b61019654600090815261019d602090815260408083206001600160a01b03851684529091528120548c0390507f4f61faeb3c52dffd20c1512e79f4c78a3bce93cdd610a99d72e1c0760360fb4f81610192600061019654815260200190815260200160002054846040516114aa9392919092835260208301919091526001600160a01b0316604082015260600190565b60405180910390a150505050505050505050505050565b606081518351146115265760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610c93565b600083516001600160401b0381111561154157611541613d59565b60405190808252806020026020018201604052801561156a578160200160208202803683370190505b50905060005b84518110156115e2576115b585828151811061158e5761158e614554565b60200260200101518583815181106115a8576115a8614554565b6020026020010151610c2c565b8282815181106115c7576115c7614554565b60209081029190910101526115db8161468d565b9050611570565b509392505050565b6115f2612381565b60008281526101916020908152604080832054610192909252909120541061162d5760405163067dbce560e41b815260040160405180910390fd5b600081815261019c602090815260408083208054825181850281018501909352808352919290919083018282801561168457602002820191906000526020600020905b815481526020019060010190808311611670575b5050505050905060005b81518110156116d857838282815181106116aa576116aa614554565b6020026020010151036116d057604051635fff945360e01b815260040160405180910390fd5b60010161168e565b5050600090815261019c602090815260408220805460018101825590835291200155565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036117445760405162461bcd60e51b8152600401610c93906145cf565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661178d600080516020614b55833981519152546001600160a01b031690565b6001600160a01b0316146117b35760405162461bcd60e51b8152600401610c939061461b565b6117bc8261267b565b610cf382826001612683565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146118685760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610c93565b50600080516020614b558339815191525b90565b600054610100900460ff161580801561189c5750600054600160ff909116105b806118b65750303b1580156118b6575060005460ff166001145b6119195760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c93565b6000805460ff19166001179055801561193c576000805461ff0019166101001790555b611954604051806020016040528060008152506128ac565b61195c6128dc565b611964612903565b61196c612932565b6119746128dc565b611980336102ee610ce1565b61198b836001611a5a565b60408051808201909152600a81526954414d41484147414e4560b01b6020820152610199906119ba90826146ec565b506040805180820190915260028152610a8960f31b602082015261019a906119e290826146ec565b506064610195556101948690556000838152610191602052604090208590556101978490556101a38290558015611017576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b611a62612381565b600082815261019f60205260409020805460ff19168215801591909117909155610cf3575061019655565b611a95611b8d565b6001600160a01b0316336001600160a01b031614611ac657604051635fc483c560e01b815260040160405180910390fd5b600080516020614b358339815191525460ff1615611af75760405163905e710760e01b815260040160405180910390fd5b600080516020614b35833981519152805460ff191660011790556040517f51e2d870cc2e10853e38dc06fcdae46ad3c3f588f326608803dac6204541ad1690600090a1565b611b44612381565b61019455565b611b52612381565b611b5c6000612978565b565b611b66612381565b600082815261019b60205260409020610f3b82826146ec565b611b87612381565b6101a355565b6000611ba160fb546001600160a01b031690565b905090565b611bae612381565b61019755565b611bbc612381565b8151835114611bde57604051632a6de9df60e11b815260040160405180910390fd5b825160005b818110156111d757611c27858281518110611c0057611c00614554565b6020026020010151858381518110611c1a57611c1a614554565b60200260200101516111de565b611c4a858281518110611c3c57611c3c614554565b6020026020010151846115ea565b600101611be3565b61019a8054610d619061451a565b81611c6a8161255f565b610f3b83836129ca565b611c7c612381565b610198805460ff19811660ff90911615179055565b611c996129d5565b6101985462010000900460ff16611cc35760405163fa1eb5f760e01b815260040160405180910390fd5b60008281526101a46020526040902054611cde908290614580565b3414611cfd576040516328cc098160e01b815260040160405180910390fd5b600082815261019f602052604090205460ff16611d2d576040516397c21b2f60e01b815260040160405180910390fd5b33611d398184846124de565b6000611d453085610c2c565b60408051828152602081018390529081018690526001600160a01b03841660608201529091507fc7b64b4e5e52c1922b4d78258817e8f6726402ce2bd58e2b69df8ab483f917759060800160405180910390a15050610cf3600161015f55565b63bc197c8160e01b5b95945050505050565b611dbf612381565b8051825114611de157604051632a6de9df60e11b815260040160405180910390fd5b815160005b818110156111d757611e2b848281518110611e0357611e03614554565b602002602001015186858481518110611e1e57611e1e614554565b60200260200101516127ee565b600101611de6565b611e3b612381565b60009182526101a4602052604090912055565b611e56612381565b61019555565b6000611e6a85858585612828565b8015611e985750600086815261019d602090815260408083206001600160a01b038916845290915290205484115b15611ed257600086815261019d602090815260408083206001600160a01b0389168452909152902054611ecb908561467a565b9050611dae565b506000611dae565b846001600160a01b0381163314611ef457611ef43361255f565b6110178686868686612a30565b611f09612381565b6001600160a01b038116611f6e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c93565b6110fb81612978565b6060611f81612381565b600082815261019c602090815260409182902080548351818402810184019094528084529091830182828015610e7957602002820191906000526020600020905b815481526020019060010190808311611fc257505050505090505b919050565b336001600160a01b038416811480159061201657506001600160a01b0381166000908152610193602052604090205460ff16155b156120345760405163db5de9e760e01b815260040160405180910390fd5b6101a1805483019055610f0c848484612a75565b61019654600081815261019e602090815260408083203384529091529020546101985486928692909162010000900460ff16806120985760405163fa1eb5f760e01b815260040160405180910390fd5b6120a2828561467a565b8511156120c25760405163493268f760e01b815260040160405180910390fd5b84610197546120d19190614580565b34146120f0576040516328cc098160e01b815260040160405180910390fd5b336120fd818a8a8a612828565b61211a57604051632798825760e01b815260040160405180910390fd5b6101968054600090815261019e602090815260408083206001600160a01b0386168452909152902080548c019055546121559082908c6124de565b61019654600081815261019e602090815260408083206001600160a01b03861684529091529020548a03907fc7b64b4e5e52c1922b4d78258817e8f6726402ce2bd58e2b69df8ab483f917759082906121af903090610c2c565b61019654604080519384526020840192909252908201526001600160a01b038416606082015260800160405180910390a15050505050505050505050565b6121f56129d5565b6101985460ff166122195760405163fa1eb5f760e01b815260040160405180910390fd5b8061019554101561223d576040516362df389960e01b815260040160405180910390fd5b600082815261019c6020526040812054900361226c57604051633d2efc0360e21b815260040160405180910390fd5b600082815261019f602052604090205460ff1661229c576040516397c21b2f60e01b815260040160405180910390fd5b33816122a88285610c2c565b10156122c757604051631ef0a7b560e21b815260040160405180910390fd5b6122d2818484611fe2565b60005b828110156122ff5760006122e885612bf4565b90506122f6838260016127ee565b506001016122d5565b5050610cf3600161015f55565b60006001600160e01b03198216636cdb3d1360e11b148061233d57506001600160e01b031982166303a24d0760e21b145b80610cc157506301ffc9a760e01b6001600160e01b0319831614610cc1565b60006001600160e01b0319821663152a902d60e11b1480610cc15750610cc18261230c565b3361238a611b8d565b6001600160a01b031614611b5c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c93565b6127106001600160601b038216111561244e5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610c93565b6001600160a01b0382166124a45760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610c93565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b9091021761012d55565b604051637921219560e11b815230600482018190526001600160a01b0385166024830152604482018490526064820183905260a06084830152600060a48301529063f242432a9060c401600060405180830381600087803b15801561254257600080fd5b505af1158015612556573d6000803e3d6000fd5b50505050505050565b600080516020614b358339815191525460ff1615801561258d57506daaeb6d7670e522a718067333cd4e3b15155b156110fb57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156125ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061260e91906147ab565b6110fb57604051633b79c77360e21b81526001600160a01b0382166004820152602401610c93565b6001600160a01b03851633148061265257506126528533610aa9565b61266e5760405162461bcd60e51b8152600401610c93906147c8565b6111d78585858585612d6f565b6110fb612381565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126b657610f3b83612f47565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612710575060408051601f3d908101601f1916820190925261270d91810190614816565b60015b6127735760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610c93565b600080516020614b5583398151915281146127e25760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610c93565b50610f3b838383612fe3565b6101a080548201905560008281526101926020908152604080832080548501905580519182019052908152610f3b90849084908490613008565b6000808561283586613115565b60405160200161284692919061482f565b6040516020818303038152906040528051906020012090506128a0848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506101a35491508490506131a7565b9150505b949350505050565b600054610100900460ff166128d35760405162461bcd60e51b8152600401610c9390614862565b6110fb816131bd565b600054610100900460ff16611b5c5760405162461bcd60e51b8152600401610c9390614862565b600054610100900460ff1661292a5760405162461bcd60e51b8152600401610c9390614862565b611b5c6131ed565b600054610100900460ff166129595760405162461bcd60e51b8152600401610c9390614862565b611b5c733cc6cdda760b79bafa08df41ecfa224f810dceb6600161321d565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610cf3338383613227565b600261015f5403612a285760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c93565b600261015f55565b6001600160a01b038516331480612a4c5750612a4c8533610aa9565b612a685760405162461bcd60e51b8152600401610c93906147c8565b6111d78585858585613307565b6001600160a01b038316612ad75760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610c93565b336000612ae384613435565b90506000612af084613435565b604080516020808201835260009182905288825260c981528282206001600160a01b038b1683529052205490915084811015612b7a5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610c93565b600086815260c9602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612556565b600081815261019c6020908152604080832080548251818502810185019093528083528493830182828015612c4857602002820191906000526020600020905b815481526020019060010190808311612c34575b50505050509050600081519050600080612c628484613480565b6000828152610192602052604081205492945090925090612c84906001614667565b60008481526101916020526040902054909150811115612cb757604051634a0883ff60e01b815260040160405180910390fd5b600083815261019160205260409020548103612d645784612cd960018661467a565b81518110612ce957612ce9614554565b6020026020010151858381518110612d0357612d03614554565b602090810291909101810191909152600088815261019c8252604090208651612d2e92880190613b8c565b50600087815261019c60205260409020805480612d4d57612d4d6148ad565b600190038181906000526020600020016000905590555b509095945050505050565b8151835114612dd15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610c93565b6001600160a01b038416612df75760405162461bcd60e51b8152600401610c93906148c3565b3360005b8451811015612ee1576000858281518110612e1857612e18614554565b602002602001015190506000858381518110612e3657612e36614554565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015612e875760405162461bcd60e51b8152600401610c9390614908565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612ec6908490614667565b9250508190555050505080612eda9061468d565b9050612dfb565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612f31929190614952565b60405180910390a4611017818787878787613517565b6001600160a01b0381163b612fb45760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c93565b600080516020614b5583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612fec83613672565b600082511180612ff95750805b15610f3b57610f0c83836136b2565b6001600160a01b0384166130685760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610c93565b33600061307485613435565b9050600061308185613435565b9050600086815260c9602090815260408083206001600160a01b038b168452909152812080548792906130b5908490614667565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612556836000898989896136de565b6060600061312283613799565b60010190506000816001600160401b0381111561314157613141613d59565b6040519080825280601f01601f19166020018201604052801561316b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461317557509392505050565b6000826131b48584613871565b14949350505050565b600054610100900460ff166131e45760405162461bcd60e51b8152600401610c9390614862565b6110fb816138b6565b600054610100900460ff166132145760405162461bcd60e51b8152600401610c9390614862565b611b5c33612978565b610cf382826138c2565b816001600160a01b0316836001600160a01b03160361329a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610c93565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03841661332d5760405162461bcd60e51b8152600401610c93906148c3565b33600061333985613435565b9050600061334685613435565b9050600086815260c9602090815260408083206001600160a01b038c1684529091529020548581101561338b5760405162461bcd60e51b8152600401610c9390614908565b600087815260c9602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906133ca908490614667565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461342a848a8a8a8a8a6136de565b505050505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061346f5761346f614554565b602090810291909101015292915050565b6101a28054820190819055604080514260208201526bffffffffffffffffffffffff193360601b169181019190915260548101919091526000908190819084906074016040516020818303038152906040528051906020012060001c816134e9576134e9614597565b069050600085828151811061350057613500614554565b602090810291909101015196919550909350505050565b6001600160a01b0384163b156110175760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061355b9089908990889088908890600401614977565b6020604051808303816000875af1925050508015613596575060408051601f3d908101601f19168201909252613593918101906149d5565b60015b613642576135a26149f2565b806308c379a0036135db57506135b6614a0d565b806135c157506135dd565b8060405162461bcd60e51b8152600401610c939190613d2d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610c93565b6001600160e01b0319811663bc197c8160e01b146125565760405162461bcd60e51b8152600401610c9390614a8b565b61367b81612f47565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606136d78383604051806060016040528060278152602001614b7560279139613a61565b9392505050565b6001600160a01b0384163b156110175760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906137229089908990889088908890600401614ad3565b6020604051808303816000875af192505050801561375d575060408051601f3d908101601f1916820190925261375a918101906149d5565b60015b613769576135a26149f2565b6001600160e01b0319811663f23a6e6160e01b146125565760405162461bcd60e51b8152600401610c9390614a8b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106137d85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613804576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061382257662386f26fc10000830492506010015b6305f5e100831061383a576305f5e100830492506008015b612710831061384e57612710830492506004015b60648310613860576064830492506002015b600a8310610cc15760010192915050565b600081815b84518110156115e2576138a28286838151811061389557613895614554565b6020026020010151613ad9565b9150806138ae8161468d565b915050613876565b60cb610cf382826146ec565b600054610100900460ff166138e95760405162461bcd60e51b8152600401610c9390614862565b6daaeb6d7670e522a718067333cd4e3b15610cf35760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015613949573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396d91906147ab565b610cf35780156139e157604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156139cd57600080fd5b505af1158015611017573d6000803e3d6000fd5b6001600160a01b03821615613a305760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016139b3565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e486906024016139b3565b6060600080856001600160a01b031685604051613a7e9190614b18565b600060405180830381855af49150503d8060008114613ab9576040519150601f19603f3d011682016040523d82523d6000602084013e613abe565b606091505b5091509150613acf86838387613b08565b9695505050505050565b6000818310613af55760008281526020849052604090206136d7565b60008381526020839052604090206136d7565b60608315613b77578251600003613b70576001600160a01b0385163b613b705760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c93565b50816128a4565b6128a483838151156135c15781518083602001fd5b828054828255906000526020600020908101928215613bc7579160200282015b82811115613bc7578251825591602001919060010190613bac565b50613bd3929150613bd7565b5090565b5b80821115613bd35760008155600101613bd8565b80356001600160a01b0381168114611fdd57600080fd5b60008060408385031215613c1657600080fd5b613c1f83613bec565b946020939093013593505050565b6001600160e01b0319811681146110fb57600080fd5b600060208284031215613c5557600080fd5b81356136d781613c2d565b60008060408385031215613c7357600080fd5b613c7c83613bec565b915060208301356001600160601b0381168114613c9857600080fd5b809150509250929050565b80151581146110fb57600080fd5b60008060408385031215613cc457600080fd5b613ccd83613bec565b91506020830135613c9881613ca3565b60005b83811015613cf8578181015183820152602001613ce0565b50506000910152565b60008151808452613d19816020860160208601613cdd565b601f01601f19169290920160200192915050565b6020815260006136d76020830184613d01565b600060208284031215613d5257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613d9457613d94613d59565b6040525050565b60006001600160401b03821115613db457613db4613d59565b5060051b60200190565b600082601f830112613dcf57600080fd5b81356020613ddc82613d9b565b604051613de98282613d6f565b83815260059390931b8501820192828101915086841115613e0957600080fd5b8286015b84811015613e245780358352918301918301613e0d565b509695505050505050565b600082601f830112613e4057600080fd5b81356001600160401b03811115613e5957613e59613d59565b604051613e70601f8301601f191660200182613d6f565b818152846020838601011115613e8557600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215613eb557600080fd5b82356001600160401b0380821115613ecc57600080fd5b613ed886838701613dbe565b9350602091508185013581811115613eef57600080fd5b8501601f81018713613f0057600080fd5b8035613f0b81613d9b565b604051613f188282613d6f565b82815260059290921b8301850191858101915089831115613f3857600080fd5b8584015b83811015613f7057803586811115613f545760008081fd5b613f628c8983890101613e2f565b845250918601918601613f3c565b508096505050505050509250929050565b60008060408385031215613f9457600080fd5b82359150613fa460208401613bec565b90509250929050565b600080600060608486031215613fc257600080fd5b613fcb84613bec565b95602085013595506040909401359392505050565b60008060408385031215613ff357600080fd5b50508035926020909101359150565b600080600080600060a0868803121561401a57600080fd5b61402386613bec565b945061403160208701613bec565b935060408601356001600160401b038082111561404d57600080fd5b61405989838a01613dbe565b9450606088013591508082111561406f57600080fd5b61407b89838a01613dbe565b9350608088013591508082111561409157600080fd5b5061409e88828901613e2f565b9150509295509295909350565b6000602082840312156140bd57600080fd5b6136d782613bec565b60008083601f8401126140d857600080fd5b5081356001600160401b038111156140ef57600080fd5b6020830191508360208260051b8501011115610fe957600080fd5b6000806000806060858703121561412057600080fd5b843593506020850135925060408501356001600160401b0381111561414457600080fd5b614150878288016140c6565b95989497509550505050565b600082601f83011261416d57600080fd5b8135602061417a82613d9b565b6040516141878282613d6f565b83815260059390931b85018201928281019150868411156141a757600080fd5b8286015b84811015613e24576141bc81613bec565b83529183019183016141ab565b600080604083850312156141dc57600080fd5b82356001600160401b03808211156141f357600080fd5b6141ff8683870161415c565b9350602085013591508082111561421557600080fd5b5061422285828601613dbe565b9150509250929050565b600081518084526020808501945080840160005b8381101561425c57815187529582019590820190600101614240565b509495945050505050565b6020815260006136d7602083018461422c565b6000806040838503121561428d57600080fd5b61429683613bec565b915060208301356001600160401b038111156142b157600080fd5b61422285828601613e2f565b600080600080600060a086880312156142d557600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000806040838503121561430b57600080fd5b823591506020830135613c9881613ca3565b6000806040838503121561433057600080fd5b8235915060208301356001600160401b038111156142b157600080fd5b60008060006060848603121561436257600080fd5b83356001600160401b038082111561437957600080fd5b61438587838801613dbe565b9450602086013591508082111561439b57600080fd5b506143a886828701613dbe565b925050604084013590509250925092565b6000806000606084860312156143ce57600080fd5b8335925060208401356001600160401b03808211156143ec57600080fd5b6143f88783880161415c565b9350604086013591508082111561440e57600080fd5b5061441b86828701613dbe565b9150509250925092565b6000806040838503121561443857600080fd5b61444183613bec565b9150613fa460208401613bec565b60008060008060006080868803121561446757600080fd5b8535945061447760208701613bec565b93506040860135925060608601356001600160401b0381111561449957600080fd5b6144a5888289016140c6565b969995985093965092949392505050565b600080600080600060a086880312156144ce57600080fd5b6144d786613bec565b94506144e560208701613bec565b9350604086013592506060860135915060808601356001600160401b0381111561450e57600080fd5b61409e88828901613e2f565b600181811c9082168061452e57607f821691505b60208210810361454e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610cc157610cc161456a565b634e487b7160e01b600052601260045260246000fd5b6000826145ca57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b80820180821115610cc157610cc161456a565b81810381811115610cc157610cc161456a565b60006001820161469f5761469f61456a565b5060010190565b601f821115610f3b57600081815260208120601f850160051c810160208610156146cd5750805b601f850160051c820191505b81811015611017578281556001016146d9565b81516001600160401b0381111561470557614705613d59565b61471981614713845461451a565b846146a6565b602080601f83116001811461474e57600084156147365750858301515b600019600386901b1c1916600185901b178555611017565b600085815260208120601f198616915b8281101561477d5788860151825594840194600190910190840161475e565b508582101561479b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156147bd57600080fd5b81516136d781613ca3565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561482857600080fd5b5051919050565b6001600160601b03198360601b16815260008251614854816014850160208701613cdd565b919091016014019392505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000614965604083018561422c565b8281036020840152611dae818561422c565b6001600160a01b0386811682528516602082015260a0604082018190526000906149a39083018661422c565b82810360608401526149b5818661422c565b905082810360808401526149c98185613d01565b98975050505050505050565b6000602082840312156149e757600080fd5b81516136d781613c2d565b600060033d11156118795760046000803e5060005160e01c90565b600060443d1015614a1b5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715614a4a57505050505090565b8285019150815181811115614a625750505050505090565b843d8701016020828501011115614a7c5750505050505090565b612d6460208286010187613d6f565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614b0d90830184613d01565b979650505050505050565b60008251614b2a818460208701613cdd565b919091019291505056fe5763ff58c27377b9a9b40e9e2f5e53a9dd7cff5464aac8fc758a651823f78e5e360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204994a4e8023f0e0d0ef8cf88165086215ceb455f88093a838658cdbf6ba1d8ff64736f6c63430008110033

Deployed Bytecode

0x6080604052600436106103c65760003560e01c8063715018a6116101f2578063d5516e7f1161010d578063f06a7933116100a0578063f4bf07a91161006f578063f4bf07a914610bb9578063f5298aca14610bd9578063f67bdda214610bf9578063f6ba204614610c0c57600080fd5b8063f06a793314610b1c578063f23a6e6114610b4d578063f242432a14610b79578063f2fde38b14610b9957600080fd5b8063e7cdbea6116100dc578063e7cdbea614610a77578063e985e9c514610a8e578063ecba222a14610ad7578063ef94688514610afc57600080fd5b8063d5516e7f14610a00578063d5abeb0114610a20578063db46ef1014610a37578063e39058ac14610a5757600080fd5b80639412399911610185578063a2309ff811610154578063a2309ff814610989578063a3824bf61461099f578063b0c55a02146109b4578063bc197c81146109c757600080fd5b8063941239991461091d57806395d89b411461093d578063a035b1fe14610952578063a22cb4651461096957600080fd5b80638da5cb5b116101c15780638da5cb5b14610871578063905a42cf1461089e5780639073810c146108cf57806391b7f5ed146108fd57600080fd5b8063715018a6146107ee5780637ef758d414610803578063862440e214610831578063867589121461085157600080fd5b80633659cfe6116102e25780634ee83f84116102755780635bdc95d0116102445780635bdc95d01461076b5780635ef9432a1461078b5780635f6fce46146107a05780636f8b44b0146107ce57600080fd5b80634ee83f84146107035780634f1ef2861461072357806352d1902d1461073657806353221d391461074b57600080fd5b80633cb00e39116102b15780633cb00e391461068e5780633ccfd60b146106ae5780634024cece146106c35780634e1273f4146106d657600080fd5b80633659cfe61461061e578063382499901461063e578063384079b514610659578063388b9fe01461066e57600080fd5b80630ee9b3951161035a5780631f6ab6a8116103295780631f6ab6a81461055b57806321e266c71461059f5780632a55205a146105bf5780632eb2c2d6146105fe57600080fd5b80630ee9b395146104e55780631790d1e31461050557806318160ddd146105265780631e49e2f21461053b57600080fd5b806304fae86b1161039657806304fae86b1461047757806306fdde031461048c5780630900dffa146104ae5780630e89341c146104c557600080fd5b8062fdd58e146103d257806301ffc9a71461040557806302fa7c4714610435578063042454ff1461045757600080fd5b366103cd57005b600080fd5b3480156103de57600080fd5b506103f26103ed366004613c03565b610c2c565b6040519081526020015b60405180910390f35b34801561041157600080fd5b50610425610420366004613c43565b610cc7565b60405190151581526020016103fc565b34801561044157600080fd5b50610455610450366004613c60565b610ce1565b005b34801561046357600080fd5b50610455610472366004613cb1565b610cf7565b34801561048357600080fd5b50610455610d2b565b34801561049857600080fd5b506104a1610d53565b6040516103fc9190613d2d565b3480156104ba57600080fd5b506103f26101965481565b3480156104d157600080fd5b506104a16104e0366004613d40565b610de2565b3480156104f157600080fd5b50610455610500366004613ea2565b610e85565b34801561051157600080fd5b50610198546104259062010000900460ff1681565b34801561053257600080fd5b506103f2610f12565b34801561054757600080fd5b506101985461042590610100900460ff1681565b34801561056757600080fd5b506103f2610576366004613f81565b600091825261019d602090815260408084206001600160a01b0393909316845291905290205490565b3480156105ab57600080fd5b506104556105ba366004613fad565b610f28565b3480156105cb57600080fd5b506105df6105da366004613fe0565b610f40565b604080516001600160a01b0390931683526020830191909152016103fc565b34801561060a57600080fd5b50610455610619366004614002565b610ff0565b34801561062a57600080fd5b506104556106393660046140ab565b61101f565b34801561064a57600080fd5b50610198546104259060ff1681565b34801561066557600080fd5b506104556110fe565b34801561067a57600080fd5b50610455610689366004613fad565b611124565b34801561069a57600080fd5b506104556106a9366004613fe0565b6111de565b3480156106ba57600080fd5b506104556111f9565b6104556106d136600461410a565b61127c565b3480156106e257600080fd5b506106f66106f13660046141c9565b6114c1565b6040516103fc9190614267565b34801561070f57600080fd5b5061045561071e366004613fe0565b6115ea565b61045561073136600461427a565b6116fc565b34801561074257600080fd5b506103f26117c8565b34801561075757600080fd5b506104556107663660046142bd565b61187c565b34801561077757600080fd5b506104556107863660046142f8565b611a5a565b34801561079757600080fd5b50610455611a8d565b3480156107ac57600080fd5b506103f26107bb366004613d40565b6101a46020526000908152604090205481565b3480156107da57600080fd5b506104556107e9366004613d40565b611b3c565b3480156107fa57600080fd5b50610455611b4a565b34801561080f57600080fd5b506103f261081e366004613d40565b6101926020526000908152604090205481565b34801561083d57600080fd5b5061045561084c36600461431d565b611b5e565b34801561085d57600080fd5b5061045561086c366004613d40565b611b7f565b34801561087d57600080fd5b50610886611b8d565b6040516001600160a01b0390911681526020016103fc565b3480156108aa57600080fd5b506104256108b9366004613d40565b600090815261019f602052604090205460ff1690565b3480156108db57600080fd5b506103f26108ea366004613d40565b6101916020526000908152604090205481565b34801561090957600080fd5b50610455610918366004613d40565b611ba6565b34801561092957600080fd5b5061045561093836600461434d565b611bb4565b34801561094957600080fd5b506104a1611c52565b34801561095e57600080fd5b506103f26101975481565b34801561097557600080fd5b50610455610984366004613cb1565b611c60565b34801561099557600080fd5b506101a0546103f2565b3480156109ab57600080fd5b50610455611c74565b6104556109c2366004613fe0565b611c91565b3480156109d357600080fd5b506109e76109e2366004614002565b611da5565b6040516001600160e01b031990911681526020016103fc565b348015610a0c57600080fd5b50610455610a1b3660046143b9565b611db7565b348015610a2c57600080fd5b506103f26101945481565b348015610a4357600080fd5b50610455610a52366004613fe0565b611e33565b348015610a6357600080fd5b50610455610a72366004613d40565b611e4e565b348015610a8357600080fd5b506103f26101955481565b348015610a9a57600080fd5b50610425610aa9366004614425565b6001600160a01b03918216600090815260ca6020908152604080832093909416825291909152205460ff1690565b348015610ae357600080fd5b50600080516020614b358339815191525460ff16610425565b348015610b0857600080fd5b506103f2610b1736600461444f565b611e5c565b348015610b2857600080fd5b50610425610b373660046140ab565b6101936020526000908152604090205460ff1681565b348015610b5957600080fd5b506109e7610b683660046144b6565b63f23a6e6160e01b95945050505050565b348015610b8557600080fd5b50610455610b943660046144b6565b611eda565b348015610ba557600080fd5b50610455610bb43660046140ab565b611f01565b348015610bc557600080fd5b506106f6610bd4366004613d40565b611f77565b348015610be557600080fd5b50610455610bf4366004613fad565b611fe2565b610455610c0736600461410a565b612048565b348015610c1857600080fd5b50610455610c27366004613fe0565b6121ed565b60006001600160a01b038316610c9c5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610cd28261230c565b80610cc15750610cc18261235c565b610ce9612381565b610cf382826123e0565b5050565b610cff612381565b6001600160a01b0391909116600090815261019360205260409020805460ff1916911515919091179055565b610d33612381565b610198805462ff0000198116620100009182900460ff1615909102179055565b6101998054610d619061451a565b80601f0160208091040260200160405190810160405280929190818152602001828054610d8d9061451a565b8015610dda5780601f10610daf57610100808354040283529160200191610dda565b820191906000526020600020905b815481529060010190602001808311610dbd57829003601f168201915b505050505081565b600081815261019b60205260409020805460609190610e009061451a565b80601f0160208091040260200160405190810160405280929190818152602001828054610e2c9061451a565b8015610e795780601f10610e4e57610100808354040283529160200191610e79565b820191906000526020600020905b815481529060010190602001808311610e5c57829003601f168201915b50505050509050919050565b610e8d612381565b80518251141580610e9d57508151155b15610ebb57604051632a6de9df60e11b815260040160405180910390fd5b815160005b81811015610f0c57610f04848281518110610edd57610edd614554565b6020026020010151848381518110610ef757610ef7614554565b6020026020010151611b5e565b600101610ec0565b50505050565b60006101a154610f226101a05490565b03905090565b610f30612381565b610f3b8383836124de565b505050565b600082815261012e602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610fb757506040805180820190915261012d546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610fd6906001600160601b031687614580565b610fe091906145ad565b91519350909150505b9250929050565b846001600160a01b038116331461100a5761100a3361255f565b6110178686868686612636565b505050505050565b6001600160a01b037f0000000000000000000000004f1d3838cd6b3c408ac260615763cb42270592b51630036110675760405162461bcd60e51b8152600401610c93906145cf565b7f0000000000000000000000004f1d3838cd6b3c408ac260615763cb42270592b56001600160a01b03166110b0600080516020614b55833981519152546001600160a01b031690565b6001600160a01b0316146110d65760405162461bcd60e51b8152600401610c939061461b565b6110df8161267b565b604080516000808252602082019092526110fb91839190612683565b50565b611106612381565b610198805461ff001981166101009182900460ff1615909102179055565b61112c612381565b80826000821161114f5760405163360b521960e21b815260040160405180910390fd5b610194548261115c610f12565b6111669190614667565b1115611185576040516320fa981560e21b815260040160405180910390fd5b60008181526101916020908152604080832054610192909252909120546111ad908490614667565b11156111cc5760405163067dbce560e41b815260040160405180910390fd5b6111d78585856127ee565b5050505050565b6111e6612381565b6000918252610191602052604090912055565b611201612381565b600061120b611b8d565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611255576040519150601f19603f3d011682016040523d82523d6000602084013e61125a565b606091505b50509050806110fb5760405163195dcc8b60e31b815260040160405180910390fd5b8361019654600082116112a25760405163360b521960e21b815260040160405180910390fd5b61019454826112af610f12565b6112b99190614667565b11156112d8576040516320fa981560e21b815260040160405180910390fd5b6000818152610191602090815260408083205461019290925290912054611300908490614667565b111561131f5760405163067dbce560e41b815260040160405180910390fd5b858561019654611333610196546105763390565b61019854610100900460ff168061135d5760405163fa1eb5f760e01b815260040160405180910390fd5b611367828561467a565b8511156113875760405163493268f760e01b815260040160405180910390fd5b84610197546113969190614580565b34146113b5576040516328cc098160e01b815260040160405180910390fd5b336113c2818c8c8c612828565b6113df57604051632798825760e01b815260040160405180910390fd5b6101968054600090815261019d602090815260408083206001600160a01b0386168452909152902080548e0190555461141a9082908e6127ee565b61019654600090815261019d602090815260408083206001600160a01b03851684529091528120548c0390507f4f61faeb3c52dffd20c1512e79f4c78a3bce93cdd610a99d72e1c0760360fb4f81610192600061019654815260200190815260200160002054846040516114aa9392919092835260208301919091526001600160a01b0316604082015260600190565b60405180910390a150505050505050505050505050565b606081518351146115265760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610c93565b600083516001600160401b0381111561154157611541613d59565b60405190808252806020026020018201604052801561156a578160200160208202803683370190505b50905060005b84518110156115e2576115b585828151811061158e5761158e614554565b60200260200101518583815181106115a8576115a8614554565b6020026020010151610c2c565b8282815181106115c7576115c7614554565b60209081029190910101526115db8161468d565b9050611570565b509392505050565b6115f2612381565b60008281526101916020908152604080832054610192909252909120541061162d5760405163067dbce560e41b815260040160405180910390fd5b600081815261019c602090815260408083208054825181850281018501909352808352919290919083018282801561168457602002820191906000526020600020905b815481526020019060010190808311611670575b5050505050905060005b81518110156116d857838282815181106116aa576116aa614554565b6020026020010151036116d057604051635fff945360e01b815260040160405180910390fd5b60010161168e565b5050600090815261019c602090815260408220805460018101825590835291200155565b6001600160a01b037f0000000000000000000000004f1d3838cd6b3c408ac260615763cb42270592b51630036117445760405162461bcd60e51b8152600401610c93906145cf565b7f0000000000000000000000004f1d3838cd6b3c408ac260615763cb42270592b56001600160a01b031661178d600080516020614b55833981519152546001600160a01b031690565b6001600160a01b0316146117b35760405162461bcd60e51b8152600401610c939061461b565b6117bc8261267b565b610cf382826001612683565b6000306001600160a01b037f0000000000000000000000004f1d3838cd6b3c408ac260615763cb42270592b516146118685760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610c93565b50600080516020614b558339815191525b90565b600054610100900460ff161580801561189c5750600054600160ff909116105b806118b65750303b1580156118b6575060005460ff166001145b6119195760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610c93565b6000805460ff19166001179055801561193c576000805461ff0019166101001790555b611954604051806020016040528060008152506128ac565b61195c6128dc565b611964612903565b61196c612932565b6119746128dc565b611980336102ee610ce1565b61198b836001611a5a565b60408051808201909152600a81526954414d41484147414e4560b01b6020820152610199906119ba90826146ec565b506040805180820190915260028152610a8960f31b602082015261019a906119e290826146ec565b506064610195556101948690556000838152610191602052604090208590556101978490556101a38290558015611017576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050505050565b611a62612381565b600082815261019f60205260409020805460ff19168215801591909117909155610cf3575061019655565b611a95611b8d565b6001600160a01b0316336001600160a01b031614611ac657604051635fc483c560e01b815260040160405180910390fd5b600080516020614b358339815191525460ff1615611af75760405163905e710760e01b815260040160405180910390fd5b600080516020614b35833981519152805460ff191660011790556040517f51e2d870cc2e10853e38dc06fcdae46ad3c3f588f326608803dac6204541ad1690600090a1565b611b44612381565b61019455565b611b52612381565b611b5c6000612978565b565b611b66612381565b600082815261019b60205260409020610f3b82826146ec565b611b87612381565b6101a355565b6000611ba160fb546001600160a01b031690565b905090565b611bae612381565b61019755565b611bbc612381565b8151835114611bde57604051632a6de9df60e11b815260040160405180910390fd5b825160005b818110156111d757611c27858281518110611c0057611c00614554565b6020026020010151858381518110611c1a57611c1a614554565b60200260200101516111de565b611c4a858281518110611c3c57611c3c614554565b6020026020010151846115ea565b600101611be3565b61019a8054610d619061451a565b81611c6a8161255f565b610f3b83836129ca565b611c7c612381565b610198805460ff19811660ff90911615179055565b611c996129d5565b6101985462010000900460ff16611cc35760405163fa1eb5f760e01b815260040160405180910390fd5b60008281526101a46020526040902054611cde908290614580565b3414611cfd576040516328cc098160e01b815260040160405180910390fd5b600082815261019f602052604090205460ff16611d2d576040516397c21b2f60e01b815260040160405180910390fd5b33611d398184846124de565b6000611d453085610c2c565b60408051828152602081018390529081018690526001600160a01b03841660608201529091507fc7b64b4e5e52c1922b4d78258817e8f6726402ce2bd58e2b69df8ab483f917759060800160405180910390a15050610cf3600161015f55565b63bc197c8160e01b5b95945050505050565b611dbf612381565b8051825114611de157604051632a6de9df60e11b815260040160405180910390fd5b815160005b818110156111d757611e2b848281518110611e0357611e03614554565b602002602001015186858481518110611e1e57611e1e614554565b60200260200101516127ee565b600101611de6565b611e3b612381565b60009182526101a4602052604090912055565b611e56612381565b61019555565b6000611e6a85858585612828565b8015611e985750600086815261019d602090815260408083206001600160a01b038916845290915290205484115b15611ed257600086815261019d602090815260408083206001600160a01b0389168452909152902054611ecb908561467a565b9050611dae565b506000611dae565b846001600160a01b0381163314611ef457611ef43361255f565b6110178686868686612a30565b611f09612381565b6001600160a01b038116611f6e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c93565b6110fb81612978565b6060611f81612381565b600082815261019c602090815260409182902080548351818402810184019094528084529091830182828015610e7957602002820191906000526020600020905b815481526020019060010190808311611fc257505050505090505b919050565b336001600160a01b038416811480159061201657506001600160a01b0381166000908152610193602052604090205460ff16155b156120345760405163db5de9e760e01b815260040160405180910390fd5b6101a1805483019055610f0c848484612a75565b61019654600081815261019e602090815260408083203384529091529020546101985486928692909162010000900460ff16806120985760405163fa1eb5f760e01b815260040160405180910390fd5b6120a2828561467a565b8511156120c25760405163493268f760e01b815260040160405180910390fd5b84610197546120d19190614580565b34146120f0576040516328cc098160e01b815260040160405180910390fd5b336120fd818a8a8a612828565b61211a57604051632798825760e01b815260040160405180910390fd5b6101968054600090815261019e602090815260408083206001600160a01b0386168452909152902080548c019055546121559082908c6124de565b61019654600081815261019e602090815260408083206001600160a01b03861684529091529020548a03907fc7b64b4e5e52c1922b4d78258817e8f6726402ce2bd58e2b69df8ab483f917759082906121af903090610c2c565b61019654604080519384526020840192909252908201526001600160a01b038416606082015260800160405180910390a15050505050505050505050565b6121f56129d5565b6101985460ff166122195760405163fa1eb5f760e01b815260040160405180910390fd5b8061019554101561223d576040516362df389960e01b815260040160405180910390fd5b600082815261019c6020526040812054900361226c57604051633d2efc0360e21b815260040160405180910390fd5b600082815261019f602052604090205460ff1661229c576040516397c21b2f60e01b815260040160405180910390fd5b33816122a88285610c2c565b10156122c757604051631ef0a7b560e21b815260040160405180910390fd5b6122d2818484611fe2565b60005b828110156122ff5760006122e885612bf4565b90506122f6838260016127ee565b506001016122d5565b5050610cf3600161015f55565b60006001600160e01b03198216636cdb3d1360e11b148061233d57506001600160e01b031982166303a24d0760e21b145b80610cc157506301ffc9a760e01b6001600160e01b0319831614610cc1565b60006001600160e01b0319821663152a902d60e11b1480610cc15750610cc18261230c565b3361238a611b8d565b6001600160a01b031614611b5c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c93565b6127106001600160601b038216111561244e5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610c93565b6001600160a01b0382166124a45760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610c93565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b9091021761012d55565b604051637921219560e11b815230600482018190526001600160a01b0385166024830152604482018490526064820183905260a06084830152600060a48301529063f242432a9060c401600060405180830381600087803b15801561254257600080fd5b505af1158015612556573d6000803e3d6000fd5b50505050505050565b600080516020614b358339815191525460ff1615801561258d57506daaeb6d7670e522a718067333cd4e3b15155b156110fb57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156125ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061260e91906147ab565b6110fb57604051633b79c77360e21b81526001600160a01b0382166004820152602401610c93565b6001600160a01b03851633148061265257506126528533610aa9565b61266e5760405162461bcd60e51b8152600401610c93906147c8565b6111d78585858585612d6f565b6110fb612381565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126b657610f3b83612f47565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612710575060408051601f3d908101601f1916820190925261270d91810190614816565b60015b6127735760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610c93565b600080516020614b5583398151915281146127e25760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610c93565b50610f3b838383612fe3565b6101a080548201905560008281526101926020908152604080832080548501905580519182019052908152610f3b90849084908490613008565b6000808561283586613115565b60405160200161284692919061482f565b6040516020818303038152906040528051906020012090506128a0848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250506101a35491508490506131a7565b9150505b949350505050565b600054610100900460ff166128d35760405162461bcd60e51b8152600401610c9390614862565b6110fb816131bd565b600054610100900460ff16611b5c5760405162461bcd60e51b8152600401610c9390614862565b600054610100900460ff1661292a5760405162461bcd60e51b8152600401610c9390614862565b611b5c6131ed565b600054610100900460ff166129595760405162461bcd60e51b8152600401610c9390614862565b611b5c733cc6cdda760b79bafa08df41ecfa224f810dceb6600161321d565b60fb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610cf3338383613227565b600261015f5403612a285760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c93565b600261015f55565b6001600160a01b038516331480612a4c5750612a4c8533610aa9565b612a685760405162461bcd60e51b8152600401610c93906147c8565b6111d78585858585613307565b6001600160a01b038316612ad75760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610c93565b336000612ae384613435565b90506000612af084613435565b604080516020808201835260009182905288825260c981528282206001600160a01b038b1683529052205490915084811015612b7a5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610c93565b600086815260c9602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052612556565b600081815261019c6020908152604080832080548251818502810185019093528083528493830182828015612c4857602002820191906000526020600020905b815481526020019060010190808311612c34575b50505050509050600081519050600080612c628484613480565b6000828152610192602052604081205492945090925090612c84906001614667565b60008481526101916020526040902054909150811115612cb757604051634a0883ff60e01b815260040160405180910390fd5b600083815261019160205260409020548103612d645784612cd960018661467a565b81518110612ce957612ce9614554565b6020026020010151858381518110612d0357612d03614554565b602090810291909101810191909152600088815261019c8252604090208651612d2e92880190613b8c565b50600087815261019c60205260409020805480612d4d57612d4d6148ad565b600190038181906000526020600020016000905590555b509095945050505050565b8151835114612dd15760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608401610c93565b6001600160a01b038416612df75760405162461bcd60e51b8152600401610c93906148c3565b3360005b8451811015612ee1576000858281518110612e1857612e18614554565b602002602001015190506000858381518110612e3657612e36614554565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015612e875760405162461bcd60e51b8152600401610c9390614908565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612ec6908490614667565b9250508190555050505080612eda9061468d565b9050612dfb565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612f31929190614952565b60405180910390a4611017818787878787613517565b6001600160a01b0381163b612fb45760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610c93565b600080516020614b5583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612fec83613672565b600082511180612ff95750805b15610f3b57610f0c83836136b2565b6001600160a01b0384166130685760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610c93565b33600061307485613435565b9050600061308185613435565b9050600086815260c9602090815260408083206001600160a01b038b168452909152812080548792906130b5908490614667565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612556836000898989896136de565b6060600061312283613799565b60010190506000816001600160401b0381111561314157613141613d59565b6040519080825280601f01601f19166020018201604052801561316b576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461317557509392505050565b6000826131b48584613871565b14949350505050565b600054610100900460ff166131e45760405162461bcd60e51b8152600401610c9390614862565b6110fb816138b6565b600054610100900460ff166132145760405162461bcd60e51b8152600401610c9390614862565b611b5c33612978565b610cf382826138c2565b816001600160a01b0316836001600160a01b03160361329a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610c93565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03841661332d5760405162461bcd60e51b8152600401610c93906148c3565b33600061333985613435565b9050600061334685613435565b9050600086815260c9602090815260408083206001600160a01b038c1684529091529020548581101561338b5760405162461bcd60e51b8152600401610c9390614908565b600087815260c9602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906133ca908490614667565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461342a848a8a8a8a8a6136de565b505050505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061346f5761346f614554565b602090810291909101015292915050565b6101a28054820190819055604080514260208201526bffffffffffffffffffffffff193360601b169181019190915260548101919091526000908190819084906074016040516020818303038152906040528051906020012060001c816134e9576134e9614597565b069050600085828151811061350057613500614554565b602090810291909101015196919550909350505050565b6001600160a01b0384163b156110175760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061355b9089908990889088908890600401614977565b6020604051808303816000875af1925050508015613596575060408051601f3d908101601f19168201909252613593918101906149d5565b60015b613642576135a26149f2565b806308c379a0036135db57506135b6614a0d565b806135c157506135dd565b8060405162461bcd60e51b8152600401610c939190613d2d565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610c93565b6001600160e01b0319811663bc197c8160e01b146125565760405162461bcd60e51b8152600401610c9390614a8b565b61367b81612f47565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606136d78383604051806060016040528060278152602001614b7560279139613a61565b9392505050565b6001600160a01b0384163b156110175760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906137229089908990889088908890600401614ad3565b6020604051808303816000875af192505050801561375d575060408051601f3d908101601f1916820190925261375a918101906149d5565b60015b613769576135a26149f2565b6001600160e01b0319811663f23a6e6160e01b146125565760405162461bcd60e51b8152600401610c9390614a8b565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106137d85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613804576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061382257662386f26fc10000830492506010015b6305f5e100831061383a576305f5e100830492506008015b612710831061384e57612710830492506004015b60648310613860576064830492506002015b600a8310610cc15760010192915050565b600081815b84518110156115e2576138a28286838151811061389557613895614554565b6020026020010151613ad9565b9150806138ae8161468d565b915050613876565b60cb610cf382826146ec565b600054610100900460ff166138e95760405162461bcd60e51b8152600401610c9390614862565b6daaeb6d7670e522a718067333cd4e3b15610cf35760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015613949573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396d91906147ab565b610cf35780156139e157604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156139cd57600080fd5b505af1158015611017573d6000803e3d6000fd5b6001600160a01b03821615613a305760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016139b3565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e486906024016139b3565b6060600080856001600160a01b031685604051613a7e9190614b18565b600060405180830381855af49150503d8060008114613ab9576040519150601f19603f3d011682016040523d82523d6000602084013e613abe565b606091505b5091509150613acf86838387613b08565b9695505050505050565b6000818310613af55760008281526020849052604090206136d7565b60008381526020839052604090206136d7565b60608315613b77578251600003613b70576001600160a01b0385163b613b705760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c93565b50816128a4565b6128a483838151156135c15781518083602001fd5b828054828255906000526020600020908101928215613bc7579160200282015b82811115613bc7578251825591602001919060010190613bac565b50613bd3929150613bd7565b5090565b5b80821115613bd35760008155600101613bd8565b80356001600160a01b0381168114611fdd57600080fd5b60008060408385031215613c1657600080fd5b613c1f83613bec565b946020939093013593505050565b6001600160e01b0319811681146110fb57600080fd5b600060208284031215613c5557600080fd5b81356136d781613c2d565b60008060408385031215613c7357600080fd5b613c7c83613bec565b915060208301356001600160601b0381168114613c9857600080fd5b809150509250929050565b80151581146110fb57600080fd5b60008060408385031215613cc457600080fd5b613ccd83613bec565b91506020830135613c9881613ca3565b60005b83811015613cf8578181015183820152602001613ce0565b50506000910152565b60008151808452613d19816020860160208601613cdd565b601f01601f19169290920160200192915050565b6020815260006136d76020830184613d01565b600060208284031215613d5257600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613d9457613d94613d59565b6040525050565b60006001600160401b03821115613db457613db4613d59565b5060051b60200190565b600082601f830112613dcf57600080fd5b81356020613ddc82613d9b565b604051613de98282613d6f565b83815260059390931b8501820192828101915086841115613e0957600080fd5b8286015b84811015613e245780358352918301918301613e0d565b509695505050505050565b600082601f830112613e4057600080fd5b81356001600160401b03811115613e5957613e59613d59565b604051613e70601f8301601f191660200182613d6f565b818152846020838601011115613e8557600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215613eb557600080fd5b82356001600160401b0380821115613ecc57600080fd5b613ed886838701613dbe565b9350602091508185013581811115613eef57600080fd5b8501601f81018713613f0057600080fd5b8035613f0b81613d9b565b604051613f188282613d6f565b82815260059290921b8301850191858101915089831115613f3857600080fd5b8584015b83811015613f7057803586811115613f545760008081fd5b613f628c8983890101613e2f565b845250918601918601613f3c565b508096505050505050509250929050565b60008060408385031215613f9457600080fd5b82359150613fa460208401613bec565b90509250929050565b600080600060608486031215613fc257600080fd5b613fcb84613bec565b95602085013595506040909401359392505050565b60008060408385031215613ff357600080fd5b50508035926020909101359150565b600080600080600060a0868803121561401a57600080fd5b61402386613bec565b945061403160208701613bec565b935060408601356001600160401b038082111561404d57600080fd5b61405989838a01613dbe565b9450606088013591508082111561406f57600080fd5b61407b89838a01613dbe565b9350608088013591508082111561409157600080fd5b5061409e88828901613e2f565b9150509295509295909350565b6000602082840312156140bd57600080fd5b6136d782613bec565b60008083601f8401126140d857600080fd5b5081356001600160401b038111156140ef57600080fd5b6020830191508360208260051b8501011115610fe957600080fd5b6000806000806060858703121561412057600080fd5b843593506020850135925060408501356001600160401b0381111561414457600080fd5b614150878288016140c6565b95989497509550505050565b600082601f83011261416d57600080fd5b8135602061417a82613d9b565b6040516141878282613d6f565b83815260059390931b85018201928281019150868411156141a757600080fd5b8286015b84811015613e24576141bc81613bec565b83529183019183016141ab565b600080604083850312156141dc57600080fd5b82356001600160401b03808211156141f357600080fd5b6141ff8683870161415c565b9350602085013591508082111561421557600080fd5b5061422285828601613dbe565b9150509250929050565b600081518084526020808501945080840160005b8381101561425c57815187529582019590820190600101614240565b509495945050505050565b6020815260006136d7602083018461422c565b6000806040838503121561428d57600080fd5b61429683613bec565b915060208301356001600160401b038111156142b157600080fd5b61422285828601613e2f565b600080600080600060a086880312156142d557600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000806040838503121561430b57600080fd5b823591506020830135613c9881613ca3565b6000806040838503121561433057600080fd5b8235915060208301356001600160401b038111156142b157600080fd5b60008060006060848603121561436257600080fd5b83356001600160401b038082111561437957600080fd5b61438587838801613dbe565b9450602086013591508082111561439b57600080fd5b506143a886828701613dbe565b925050604084013590509250925092565b6000806000606084860312156143ce57600080fd5b8335925060208401356001600160401b03808211156143ec57600080fd5b6143f88783880161415c565b9350604086013591508082111561440e57600080fd5b5061441b86828701613dbe565b9150509250925092565b6000806040838503121561443857600080fd5b61444183613bec565b9150613fa460208401613bec565b60008060008060006080868803121561446757600080fd5b8535945061447760208701613bec565b93506040860135925060608601356001600160401b0381111561449957600080fd5b6144a5888289016140c6565b969995985093965092949392505050565b600080600080600060a086880312156144ce57600080fd5b6144d786613bec565b94506144e560208701613bec565b9350604086013592506060860135915060808601356001600160401b0381111561450e57600080fd5b61409e88828901613e2f565b600181811c9082168061452e57607f821691505b60208210810361454e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610cc157610cc161456a565b634e487b7160e01b600052601260045260246000fd5b6000826145ca57634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b80820180821115610cc157610cc161456a565b81810381811115610cc157610cc161456a565b60006001820161469f5761469f61456a565b5060010190565b601f821115610f3b57600081815260208120601f850160051c810160208610156146cd5750805b601f850160051c820191505b81811015611017578281556001016146d9565b81516001600160401b0381111561470557614705613d59565b61471981614713845461451a565b846146a6565b602080601f83116001811461474e57600084156147365750858301515b600019600386901b1c1916600185901b178555611017565b600085815260208120601f198616915b8281101561477d5788860151825594840194600190910190840161475e565b508582101561479b5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156147bd57600080fd5b81516136d781613ca3565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561482857600080fd5b5051919050565b6001600160601b03198360601b16815260008251614854816014850160208701613cdd565b919091016014019392505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000614965604083018561422c565b8281036020840152611dae818561422c565b6001600160a01b0386811682528516602082015260a0604082018190526000906149a39083018661422c565b82810360608401526149b5818661422c565b905082810360808401526149c98185613d01565b98975050505050505050565b6000602082840312156149e757600080fd5b81516136d781613c2d565b600060033d11156118795760046000803e5060005160e01c90565b600060443d1015614a1b5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715614a4a57505050505090565b8285019150815181811115614a625750505050505090565b843d8701016020828501011115614a7c5750505050505090565b612d6460208286010187613d6f565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614b0d90830184613d01565b979650505050505050565b60008251614b2a818460208701613cdd565b919091019291505056fe5763ff58c27377b9a9b40e9e2f5e53a9dd7cff5464aac8fc758a651823f78e5e360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204994a4e8023f0e0d0ef8cf88165086215ceb455f88093a838658cdbf6ba1d8ff64736f6c63430008110033

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.