creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/eip/interface/IERC165.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * [EIP](https://eips.ethereum.org/EIPS/eip-165).\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
      },
      "contracts/eip/interface/IERC20.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n * @title ERC20 interface\n * @dev see https://github.com/ethereum/EIPs/issues/20\n */\ninterface IERC20 {\n    function totalSupply() external view returns (uint256);\n\n    function balanceOf(address who) external view returns (uint256);\n\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    function transfer(address to, uint256 value) external returns (bool);\n\n    function approve(address spender, uint256 value) external returns (bool);\n\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
      },
      "contracts/eip/interface/IERC2981.sol": {
        "content": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981 is IERC165 {\n    /**\n     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n     * exchange. The royalty amount is denominated and should be payed in that same unit of exchange.\n     */\n    function royaltyInfo(\n        uint256 tokenId,\n        uint256 salePrice\n    ) external view returns (address receiver, uint256 royaltyAmount);\n}\n"
      },
      "contracts/extension/BatchMintMetadata.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  @title   Batch-mint Metadata\n *  @notice  The `BatchMintMetadata` is a contract extension for any base NFT contract. It lets the smart contract\n *           using this extension set metadata for `n` number of NFTs all at once. This is enabled by storing a single\n *           base URI for a batch of `n` NFTs, where the metadata for each NFT in a relevant batch is `baseURI/tokenId`.\n */\n\ncontract BatchMintMetadata {\n    /// @dev Largest tokenId of each batch of tokens with the same baseURI + 1 {ex: batchId 100 at position 0 includes tokens 0-99}\n    uint256[] private batchIds;\n\n    /// @dev Mapping from id of a batch of tokens => to base URI for the respective batch of tokens.\n    mapping(uint256 => string) private baseURI;\n\n    /// @dev Mapping from id of a batch of tokens => to whether the base URI for the respective batch of tokens is frozen.\n    mapping(uint256 => bool) public batchFrozen;\n\n    /// @dev This event emits when the metadata of all tokens are frozen.\n    /// While not currently supported by marketplaces, this event allows\n    /// future indexing if desired.\n    event MetadataFrozen();\n\n    // @dev This event emits when the metadata of a range of tokens is updated.\n    /// So that the third-party platforms such as NFT market could\n    /// timely update the images and related attributes of the NFTs.\n    event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n\n    /**\n     *  @notice         Returns the count of batches of NFTs.\n     *  @dev            Each batch of tokens has an in ID and an associated `baseURI`.\n     *                  See {batchIds}.\n     */\n    function getBaseURICount() public view returns (uint256) {\n        return batchIds.length;\n    }\n\n    /**\n     *  @notice         Returns the ID for the batch of tokens at the given index.\n     *  @dev            See {getBaseURICount}.\n     *  @param _index   Index of the desired batch in batchIds array.\n     */\n    function getBatchIdAtIndex(uint256 _index) public view returns (uint256) {\n        if (_index >= getBaseURICount()) {\n            revert(\"Invalid index\");\n        }\n        return batchIds[_index];\n    }\n\n    /// @dev Returns the id for the batch of tokens the given tokenId belongs to.\n    function _getBatchId(uint256 _tokenId) internal view returns (uint256 batchId, uint256 index) {\n        uint256 numOfTokenBatches = getBaseURICount();\n        uint256[] memory indices = batchIds;\n\n        for (uint256 i = 0; i < numOfTokenBatches; i += 1) {\n            if (_tokenId < indices[i]) {\n                index = i;\n                batchId = indices[i];\n\n                return (batchId, index);\n            }\n        }\n\n        revert(\"Invalid tokenId\");\n    }\n\n    /// @dev Returns the baseURI for a token. The intended metadata URI for the token is baseURI + tokenId.\n    function _getBaseURI(uint256 _tokenId) internal view returns (string memory) {\n        uint256 numOfTokenBatches = getBaseURICount();\n        uint256[] memory indices = batchIds;\n\n        for (uint256 i = 0; i < numOfTokenBatches; i += 1) {\n            if (_tokenId < indices[i]) {\n                return baseURI[indices[i]];\n            }\n        }\n        revert(\"Invalid tokenId\");\n    }\n\n    /// @dev returns the starting tokenId of a given batchId.\n    function _getBatchStartId(uint256 _batchID) internal view returns (uint256) {\n        uint256 numOfTokenBatches = getBaseURICount();\n        uint256[] memory indices = batchIds;\n\n        for (uint256 i = 0; i < numOfTokenBatches; i++) {\n            if (_batchID == indices[i]) {\n                if (i > 0) {\n                    return indices[i - 1];\n                }\n                return 0;\n            }\n        }\n        revert(\"Invalid batchId\");\n    }\n\n    /// @dev Sets the base URI for the batch of tokens with the given batchId.\n    function _setBaseURI(uint256 _batchId, string memory _baseURI) internal {\n        require(!batchFrozen[_batchId], \"Batch frozen\");\n        baseURI[_batchId] = _baseURI;\n        emit BatchMetadataUpdate(_getBatchStartId(_batchId), _batchId);\n    }\n\n    /// @dev Freezes the base URI for the batch of tokens with the given batchId.\n    function _freezeBaseURI(uint256 _batchId) internal {\n        string memory baseURIForBatch = baseURI[_batchId];\n        require(bytes(baseURIForBatch).length > 0, \"Invalid batch\");\n        batchFrozen[_batchId] = true;\n        emit MetadataFrozen();\n    }\n\n    /// @dev Mints a batch of tokenIds and associates a common baseURI to all those Ids.\n    function _batchMintMetadata(\n        uint256 _startId,\n        uint256 _amountToMint,\n        string memory _baseURIForTokens\n    ) internal returns (uint256 nextTokenIdToMint, uint256 batchId) {\n        batchId = _startId + _amountToMint;\n        nextTokenIdToMint = batchId;\n\n        batchIds.push(batchId);\n\n        baseURI[batchId] = _baseURIForTokens;\n    }\n}\n"
      },
      "contracts/extension/ContractMetadata.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IContractMetadata.sol\";\n\n/**\n *  @title   Contract Metadata\n *  @notice  Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI\n *           for you contract.\n *           Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea.\n */\n\nabstract contract ContractMetadata is IContractMetadata {\n    /// @notice Returns the contract metadata URI.\n    string public override contractURI;\n\n    /**\n     *  @notice         Lets a contract admin set the URI for contract-level metadata.\n     *  @dev            Caller should be authorized to setup contractURI, e.g. contract admin.\n     *                  See {_canSetContractURI}.\n     *                  Emits {ContractURIUpdated Event}.\n     *\n     *  @param _uri     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     */\n    function setContractURI(string memory _uri) external override {\n        if (!_canSetContractURI()) {\n            revert(\"Not authorized\");\n        }\n\n        _setupContractURI(_uri);\n    }\n\n    /// @dev Lets a contract admin set the URI for contract-level metadata.\n    function _setupContractURI(string memory _uri) internal {\n        string memory prevURI = contractURI;\n        contractURI = _uri;\n\n        emit ContractURIUpdated(prevURI, _uri);\n    }\n\n    /// @dev Returns whether contract metadata can be set in the given execution context.\n    function _canSetContractURI() internal view virtual returns (bool);\n}\n"
      },
      "contracts/extension/Drop1155.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IDrop1155.sol\";\nimport \"../lib/MerkleProof.sol\";\n\nabstract contract Drop1155 is IDrop1155 {\n    /*///////////////////////////////////////////////////////////////\n                            State variables\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Mapping from token ID => the set of all claim conditions, at any given moment, for tokens of the token ID.\n    mapping(uint256 => ClaimConditionList) public claimCondition;\n\n    /*///////////////////////////////////////////////////////////////\n                            Drop logic\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Lets an account claim tokens.\n    function claim(\n        address _receiver,\n        uint256 _tokenId,\n        uint256 _quantity,\n        address _currency,\n        uint256 _pricePerToken,\n        AllowlistProof calldata _allowlistProof,\n        bytes memory _data\n    ) public payable virtual override {\n        _beforeClaim(_tokenId, _receiver, _quantity, _currency, _pricePerToken, _allowlistProof, _data);\n\n        uint256 activeConditionId = getActiveClaimConditionId(_tokenId);\n\n        verifyClaim(\n            activeConditionId,\n            _dropMsgSender(),\n            _tokenId,\n            _quantity,\n            _currency,\n            _pricePerToken,\n            _allowlistProof\n        );\n\n        // Update contract state.\n        claimCondition[_tokenId].conditions[activeConditionId].supplyClaimed += _quantity;\n        claimCondition[_tokenId].supplyClaimedByWallet[activeConditionId][_dropMsgSender()] += _quantity;\n\n        // If there's a price, collect price.\n        collectPriceOnClaim(_tokenId, address(0), _quantity, _currency, _pricePerToken);\n\n        // Mint the relevant NFTs to claimer.\n        transferTokensOnClaim(_receiver, _tokenId, _quantity);\n\n        emit TokensClaimed(activeConditionId, _dropMsgSender(), _receiver, _tokenId, _quantity);\n\n        _afterClaim(_tokenId, _receiver, _quantity, _currency, _pricePerToken, _allowlistProof, _data);\n    }\n\n    /// @dev Lets a contract admin set claim conditions.\n    function setClaimConditions(\n        uint256 _tokenId,\n        ClaimCondition[] calldata _conditions,\n        bool _resetClaimEligibility\n    ) external virtual override {\n        if (!_canSetClaimConditions()) {\n            revert(\"Not authorized\");\n        }\n        ClaimConditionList storage conditionList = claimCondition[_tokenId];\n        uint256 existingStartIndex = conditionList.currentStartId;\n        uint256 existingPhaseCount = conditionList.count;\n\n        /**\n         *  The mapping `supplyClaimedByWallet` uses a claim condition's UID as a key.\n         *\n         *  If `_resetClaimEligibility == true`, we assign completely new UIDs to the claim\n         *  conditions in `_conditions`, effectively resetting the restrictions on claims expressed\n         *  by `supplyClaimedByWallet`.\n         */\n        uint256 newStartIndex = existingStartIndex;\n        if (_resetClaimEligibility) {\n            newStartIndex = existingStartIndex + existingPhaseCount;\n        }\n\n        conditionList.count = _conditions.length;\n        conditionList.currentStartId = newStartIndex;\n\n        uint256 lastConditionStartTimestamp;\n        for (uint256 i = 0; i < _conditions.length; i++) {\n            require(i == 0 || lastConditionStartTimestamp < _conditions[i].startTimestamp, \"ST\");\n\n            uint256 supplyClaimedAlready = conditionList.conditions[newStartIndex + i].supplyClaimed;\n            if (supplyClaimedAlready > _conditions[i].maxClaimableSupply) {\n                revert(\"max supply claimed\");\n            }\n\n            conditionList.conditions[newStartIndex + i] = _conditions[i];\n            conditionList.conditions[newStartIndex + i].supplyClaimed = supplyClaimedAlready;\n\n            lastConditionStartTimestamp = _conditions[i].startTimestamp;\n        }\n\n        /**\n         *  Gas refunds (as much as possible)\n         *\n         *  If `_resetClaimEligibility == true`, we assign completely new UIDs to the claim\n         *  conditions in `_conditions`. So, we delete claim conditions with UID < `newStartIndex`.\n         *\n         *  If `_resetClaimEligibility == false`, and there are more existing claim conditions\n         *  than in `_conditions`, we delete the existing claim conditions that don't get replaced\n         *  by the conditions in `_conditions`.\n         */\n        if (_resetClaimEligibility) {\n            for (uint256 i = existingStartIndex; i < newStartIndex; i++) {\n                delete conditionList.conditions[i];\n            }\n        } else {\n            if (existingPhaseCount > _conditions.length) {\n                for (uint256 i = _conditions.length; i < existingPhaseCount; i++) {\n                    delete conditionList.conditions[newStartIndex + i];\n                }\n            }\n        }\n\n        emit ClaimConditionsUpdated(_tokenId, _conditions, _resetClaimEligibility);\n    }\n\n    /// @dev Checks a request to claim NFTs against the active claim condition's criteria.\n    function verifyClaim(\n        uint256 _conditionId,\n        address _claimer,\n        uint256 _tokenId,\n        uint256 _quantity,\n        address _currency,\n        uint256 _pricePerToken,\n        AllowlistProof calldata _allowlistProof\n    ) public view virtual returns (bool isOverride) {\n        ClaimCondition memory currentClaimPhase = claimCondition[_tokenId].conditions[_conditionId];\n        uint256 claimLimit = currentClaimPhase.quantityLimitPerWallet;\n        uint256 claimPrice = currentClaimPhase.pricePerToken;\n        address claimCurrency = currentClaimPhase.currency;\n\n        /*\n         * Here `isOverride` implies that if the merkle proof verification fails,\n         * the claimer would claim through open claim limit instead of allowlisted limit.\n         */\n        if (currentClaimPhase.merkleRoot != bytes32(0)) {\n            (isOverride, ) = MerkleProof.verify(\n                _allowlistProof.proof,\n                currentClaimPhase.merkleRoot,\n                keccak256(\n                    abi.encodePacked(\n                        _claimer,\n                        _allowlistProof.quantityLimitPerWallet,\n                        _allowlistProof.pricePerToken,\n                        _allowlistProof.currency\n                    )\n                )\n            );\n        }\n\n        if (isOverride) {\n            claimLimit = _allowlistProof.quantityLimitPerWallet != 0\n                ? _allowlistProof.quantityLimitPerWallet\n                : claimLimit;\n            claimPrice = _allowlistProof.pricePerToken != type(uint256).max\n                ? _allowlistProof.pricePerToken\n                : claimPrice;\n            claimCurrency = _allowlistProof.pricePerToken != type(uint256).max && _allowlistProof.currency != address(0)\n                ? _allowlistProof.currency\n                : claimCurrency;\n        }\n\n        uint256 supplyClaimedByWallet = claimCondition[_tokenId].supplyClaimedByWallet[_conditionId][_claimer];\n\n        if (_currency != claimCurrency || _pricePerToken != claimPrice) {\n            revert(\"!PriceOrCurrency\");\n        }\n\n        if (_quantity == 0 || (_quantity + supplyClaimedByWallet > claimLimit)) {\n            revert(\"!Qty\");\n        }\n\n        if (currentClaimPhase.supplyClaimed + _quantity > currentClaimPhase.maxClaimableSupply) {\n            revert(\"!MaxSupply\");\n        }\n\n        if (currentClaimPhase.startTimestamp > block.timestamp) {\n            revert(\"cant claim yet\");\n        }\n    }\n\n    /// @dev At any given moment, returns the uid for the active claim condition.\n    function getActiveClaimConditionId(uint256 _tokenId) public view returns (uint256) {\n        ClaimConditionList storage conditionList = claimCondition[_tokenId];\n        for (uint256 i = conditionList.currentStartId + conditionList.count; i > conditionList.currentStartId; i--) {\n            if (block.timestamp >= conditionList.conditions[i - 1].startTimestamp) {\n                return i - 1;\n            }\n        }\n\n        revert(\"!CONDITION.\");\n    }\n\n    /// @dev Returns the claim condition at the given uid.\n    function getClaimConditionById(\n        uint256 _tokenId,\n        uint256 _conditionId\n    ) external view returns (ClaimCondition memory condition) {\n        condition = claimCondition[_tokenId].conditions[_conditionId];\n    }\n\n    /// @dev Returns the supply claimed by claimer for a given conditionId.\n    function getSupplyClaimedByWallet(\n        uint256 _tokenId,\n        uint256 _conditionId,\n        address _claimer\n    ) public view returns (uint256 supplyClaimedByWallet) {\n        supplyClaimedByWallet = claimCondition[_tokenId].supplyClaimedByWallet[_conditionId][_claimer];\n    }\n\n    /*////////////////////////////////////////////////////////////////////\n        Optional hooks that can be implemented in the derived contract\n    ///////////////////////////////////////////////////////////////////*/\n\n    /// @dev Exposes the ability to override the msg sender.\n    function _dropMsgSender() internal virtual returns (address) {\n        return msg.sender;\n    }\n\n    /// @dev Runs before every `claim` function call.\n    function _beforeClaim(\n        uint256 _tokenId,\n        address _receiver,\n        uint256 _quantity,\n        address _currency,\n        uint256 _pricePerToken,\n        AllowlistProof calldata _allowlistProof,\n        bytes memory _data\n    ) internal virtual {}\n\n    /// @dev Runs after every `claim` function call.\n    function _afterClaim(\n        uint256 _tokenId,\n        address _receiver,\n        uint256 _quantity,\n        address _currency,\n        uint256 _pricePerToken,\n        AllowlistProof calldata _allowlistProof,\n        bytes memory _data\n    ) internal virtual {}\n\n    /*///////////////////////////////////////////////////////////////\n        Virtual functions: to be implemented in derived contract\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Collects and distributes the primary sale value of NFTs being claimed.\n    function collectPriceOnClaim(\n        uint256 _tokenId,\n        address _primarySaleRecipient,\n        uint256 _quantityToClaim,\n        address _currency,\n        uint256 _pricePerToken\n    ) internal virtual;\n\n    /// @dev Transfers the NFTs being claimed.\n    function transferTokensOnClaim(address _to, uint256 _tokenId, uint256 _quantityBeingClaimed) internal virtual;\n\n    /// @dev Determine what wallet can update claim conditions\n    function _canSetClaimConditions() internal view virtual returns (bool);\n}\n"
      },
      "contracts/extension/LazyMint.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/ILazyMint.sol\";\nimport \"./BatchMintMetadata.sol\";\n\n/**\n *  The `LazyMint` is a contract extension for any base NFT contract. It lets you 'lazy mint' any number of NFTs\n *  at once. Here, 'lazy mint' means defining the metadata for particular tokenIds of your NFT contract, without actually\n *  minting a non-zero balance of NFTs of those tokenIds.\n */\n\nabstract contract LazyMint is ILazyMint, BatchMintMetadata {\n    /// @notice The tokenId assigned to the next new NFT to be lazy minted.\n    uint256 internal nextTokenIdToLazyMint;\n\n    /**\n     *  @notice                  Lets an authorized address lazy mint a given amount of NFTs.\n     *\n     *  @param _amount           The number of NFTs to lazy mint.\n     *  @param _baseURIForTokens The base URI for the 'n' number of NFTs being lazy minted, where the metadata for each\n     *                           of those NFTs is `${baseURIForTokens}/${tokenId}`.\n     *  @param _data             Additional bytes data to be used at the discretion of the consumer of the contract.\n     *  @return batchId          A unique integer identifier for the batch of NFTs lazy minted together.\n     */\n    function lazyMint(\n        uint256 _amount,\n        string calldata _baseURIForTokens,\n        bytes calldata _data\n    ) public virtual override returns (uint256 batchId) {\n        if (!_canLazyMint()) {\n            revert(\"Not authorized\");\n        }\n\n        if (_amount == 0) {\n            revert(\"0 amt\");\n        }\n\n        uint256 startId = nextTokenIdToLazyMint;\n\n        (nextTokenIdToLazyMint, batchId) = _batchMintMetadata(startId, _amount, _baseURIForTokens);\n\n        emit TokensLazyMinted(startId, startId + _amount - 1, _baseURIForTokens, _data);\n\n        return batchId;\n    }\n\n    /// @dev Returns whether lazy minting can be performed in the given execution context.\n    function _canLazyMint() internal view virtual returns (bool);\n}\n"
      },
      "contracts/extension/Multicall.sol": {
        "content": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../lib/Address.sol\";\nimport \"./interface/IMulticall.sol\";\n\n/**\n * @dev Provides a function to batch together multiple calls in a single external call.\n *\n * _Available since v4.1._\n */\ncontract Multicall is IMulticall {\n    /**\n     *  @notice Receives and executes a batch of function calls on this contract.\n     *  @dev Receives and executes a batch of function calls on this contract.\n     *\n     *  @param data The bytes data that makes up the batch of function calls to execute.\n     *  @return results The bytes data that makes up the result of the batch of function calls executed.\n     */\n    function multicall(bytes[] calldata data) external returns (bytes[] memory results) {\n        results = new bytes[](data.length);\n        address sender = _msgSender();\n        bool isForwarder = msg.sender != sender;\n        for (uint256 i = 0; i < data.length; i++) {\n            if (isForwarder) {\n                results[i] = Address.functionDelegateCall(address(this), abi.encodePacked(data[i], sender));\n            } else {\n                results[i] = Address.functionDelegateCall(address(this), data[i]);\n            }\n        }\n        return results;\n    }\n\n    /// @notice Returns the sender in the given execution context.\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n}\n"
      },
      "contracts/extension/Ownable.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IOwnable.sol\";\n\n/**\n *  @title   Ownable\n *  @notice  Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *           who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses\n *           information about who the contract's owner is.\n */\n\nabstract contract Ownable is IOwnable {\n    /// @dev Owner of the contract (purpose: OpenSea compatibility)\n    address private _owner;\n\n    /// @dev Reverts if caller is not the owner.\n    modifier onlyOwner() {\n        if (msg.sender != _owner) {\n            revert(\"Not authorized\");\n        }\n        _;\n    }\n\n    /**\n     *  @notice Returns the owner of the contract.\n     */\n    function owner() public view override returns (address) {\n        return _owner;\n    }\n\n    /**\n     *  @notice Lets an authorized wallet set a new owner for the contract.\n     *  @param _newOwner The address to set as the new owner of the contract.\n     */\n    function setOwner(address _newOwner) external override {\n        if (!_canSetOwner()) {\n            revert(\"Not authorized\");\n        }\n        _setupOwner(_newOwner);\n    }\n\n    /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin.\n    function _setupOwner(address _newOwner) internal {\n        address _prevOwner = _owner;\n        _owner = _newOwner;\n\n        emit OwnerUpdated(_prevOwner, _newOwner);\n    }\n\n    /// @dev Returns whether owner can be set in the given execution context.\n    function _canSetOwner() internal view virtual returns (bool);\n}\n"
      },
      "contracts/extension/Permissions.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPermissions.sol\";\nimport \"../lib/Strings.sol\";\n\n/**\n *  @title   Permissions\n *  @dev     This contracts provides extending-contracts with role-based access control mechanisms\n */\ncontract Permissions is IPermissions {\n    /// @dev Map from keccak256 hash of a role => a map from address => whether address has role.\n    mapping(bytes32 => mapping(address => bool)) private _hasRole;\n\n    /// @dev Map from keccak256 hash of a role to role admin. See {getRoleAdmin}.\n    mapping(bytes32 => bytes32) private _getRoleAdmin;\n\n    /// @dev Default admin role for all roles. Only accounts with this role can grant/revoke other roles.\n    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n    /// @dev Modifier that checks if an account has the specified role; reverts otherwise.\n    modifier onlyRole(bytes32 role) {\n        _checkRole(role, msg.sender);\n        _;\n    }\n\n    /**\n     *  @notice         Checks whether an account has a particular role.\n     *  @dev            Returns `true` if `account` has been granted `role`.\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     *  @param account  Address of the account for which the role is being checked.\n     */\n    function hasRole(bytes32 role, address account) public view override returns (bool) {\n        return _hasRole[role][account];\n    }\n\n    /**\n     *  @notice         Checks whether an account has a particular role;\n     *                  role restrictions can be swtiched on and off.\n     *\n     *  @dev            Returns `true` if `account` has been granted `role`.\n     *                  Role restrictions can be swtiched on and off:\n     *                      - If address(0) has ROLE, then the ROLE restrictions\n     *                        don't apply.\n     *                      - If address(0) does not have ROLE, then the ROLE\n     *                        restrictions will apply.\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     *  @param account  Address of the account for which the role is being checked.\n     */\n    function hasRoleWithSwitch(bytes32 role, address account) public view returns (bool) {\n        if (!_hasRole[role][address(0)]) {\n            return _hasRole[role][account];\n        }\n\n        return true;\n    }\n\n    /**\n     *  @notice         Returns the admin role that controls the specified role.\n     *  @dev            See {grantRole} and {revokeRole}.\n     *                  To change a role's admin, use {_setRoleAdmin}.\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     */\n    function getRoleAdmin(bytes32 role) external view override returns (bytes32) {\n        return _getRoleAdmin[role];\n    }\n\n    /**\n     *  @notice         Grants a role to an account, if not previously granted.\n     *  @dev            Caller must have admin role for the `role`.\n     *                  Emits {RoleGranted Event}.\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     *  @param account  Address of the account to which the role is being granted.\n     */\n    function grantRole(bytes32 role, address account) public virtual override {\n        _checkRole(_getRoleAdmin[role], msg.sender);\n        if (_hasRole[role][account]) {\n            revert(\"Can only grant to non holders\");\n        }\n        _setupRole(role, account);\n    }\n\n    /**\n     *  @notice         Revokes role from an account.\n     *  @dev            Caller must have admin role for the `role`.\n     *                  Emits {RoleRevoked Event}.\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     *  @param account  Address of the account from which the role is being revoked.\n     */\n    function revokeRole(bytes32 role, address account) public virtual override {\n        _checkRole(_getRoleAdmin[role], msg.sender);\n        _revokeRole(role, account);\n    }\n\n    /**\n     *  @notice         Revokes role from the account.\n     *  @dev            Caller must have the `role`, with caller being the same as `account`.\n     *                  Emits {RoleRevoked Event}.\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     *  @param account  Address of the account from which the role is being revoked.\n     */\n    function renounceRole(bytes32 role, address account) public virtual override {\n        if (msg.sender != account) {\n            revert(\"Can only renounce for self\");\n        }\n        _revokeRole(role, account);\n    }\n\n    /// @dev Sets `adminRole` as `role`'s admin role.\n    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n        bytes32 previousAdminRole = _getRoleAdmin[role];\n        _getRoleAdmin[role] = adminRole;\n        emit RoleAdminChanged(role, previousAdminRole, adminRole);\n    }\n\n    /// @dev Sets up `role` for `account`\n    function _setupRole(bytes32 role, address account) internal virtual {\n        _hasRole[role][account] = true;\n        emit RoleGranted(role, account, msg.sender);\n    }\n\n    /// @dev Revokes `role` from `account`\n    function _revokeRole(bytes32 role, address account) internal virtual {\n        _checkRole(role, account);\n        delete _hasRole[role][account];\n        emit RoleRevoked(role, account, msg.sender);\n    }\n\n    /// @dev Checks `role` for `account`. Reverts with a message including the required role.\n    function _checkRole(bytes32 role, address account) internal view virtual {\n        if (!_hasRole[role][account]) {\n            revert(\n                string(\n                    abi.encodePacked(\n                        \"Permissions: account \",\n                        Strings.toHexString(uint160(account), 20),\n                        \" is missing role \",\n                        Strings.toHexString(uint256(role), 32)\n                    )\n                )\n            );\n        }\n    }\n\n    /// @dev Checks `role` for `account`. Reverts with a message including the required role.\n    function _checkRoleWithSwitch(bytes32 role, address account) internal view virtual {\n        if (!hasRoleWithSwitch(role, account)) {\n            revert(\n                string(\n                    abi.encodePacked(\n                        \"Permissions: account \",\n                        Strings.toHexString(uint160(account), 20),\n                        \" is missing role \",\n                        Strings.toHexString(uint256(role), 32)\n                    )\n                )\n            );\n        }\n    }\n}\n"
      },
      "contracts/extension/PermissionsEnumerable.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPermissionsEnumerable.sol\";\nimport \"./Permissions.sol\";\n\n/**\n *  @title   PermissionsEnumerable\n *  @dev     This contracts provides extending-contracts with role-based access control mechanisms.\n *           Also provides interfaces to view all members with a given role, and total count of members.\n */\ncontract PermissionsEnumerable is IPermissionsEnumerable, Permissions {\n    /**\n     *  @notice A data structure to store data of members for a given role.\n     *\n     *  @param index    Current index in the list of accounts that have a role.\n     *  @param members  map from index => address of account that has a role\n     *  @param indexOf  map from address => index which the account has.\n     */\n    struct RoleMembers {\n        uint256 index;\n        mapping(uint256 => address) members;\n        mapping(address => uint256) indexOf;\n    }\n\n    /// @dev map from keccak256 hash of a role to its members' data. See {RoleMembers}.\n    mapping(bytes32 => RoleMembers) private roleMembers;\n\n    /**\n     *  @notice         Returns the role-member from a list of members for a role,\n     *                  at a given index.\n     *  @dev            Returns `member` who has `role`, at `index` of role-members list.\n     *                  See struct {RoleMembers}, and mapping {roleMembers}\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     *  @param index    Index in list of current members for the role.\n     *\n     *  @return member  Address of account that has `role`\n     */\n    function getRoleMember(bytes32 role, uint256 index) external view override returns (address member) {\n        uint256 currentIndex = roleMembers[role].index;\n        uint256 check;\n\n        for (uint256 i = 0; i < currentIndex; i += 1) {\n            if (roleMembers[role].members[i] != address(0)) {\n                if (check == index) {\n                    member = roleMembers[role].members[i];\n                    return member;\n                }\n                check += 1;\n            } else if (hasRole(role, address(0)) && i == roleMembers[role].indexOf[address(0)]) {\n                check += 1;\n            }\n        }\n    }\n\n    /**\n     *  @notice         Returns total number of accounts that have a role.\n     *  @dev            Returns `count` of accounts that have `role`.\n     *                  See struct {RoleMembers}, and mapping {roleMembers}\n     *\n     *  @param role     keccak256 hash of the role. e.g. keccak256(\"TRANSFER_ROLE\")\n     *\n     *  @return count   Total number of accounts that have `role`\n     */\n    function getRoleMemberCount(bytes32 role) external view override returns (uint256 count) {\n        uint256 currentIndex = roleMembers[role].index;\n\n        for (uint256 i = 0; i < currentIndex; i += 1) {\n            if (roleMembers[role].members[i] != address(0)) {\n                count += 1;\n            }\n        }\n        if (hasRole(role, address(0))) {\n            count += 1;\n        }\n    }\n\n    /// @dev Revokes `role` from `account`, and removes `account` from {roleMembers}\n    ///      See {_removeMember}\n    function _revokeRole(bytes32 role, address account) internal override {\n        super._revokeRole(role, account);\n        _removeMember(role, account);\n    }\n\n    /// @dev Grants `role` to `account`, and adds `account` to {roleMembers}\n    ///      See {_addMember}\n    function _setupRole(bytes32 role, address account) internal override {\n        super._setupRole(role, account);\n        _addMember(role, account);\n    }\n\n    /// @dev adds `account` to {roleMembers}, for `role`\n    function _addMember(bytes32 role, address account) internal {\n        uint256 idx = roleMembers[role].index;\n        roleMembers[role].index += 1;\n\n        roleMembers[role].members[idx] = account;\n        roleMembers[role].indexOf[account] = idx;\n    }\n\n    /// @dev removes `account` from {roleMembers}, for `role`\n    function _removeMember(bytes32 role, address account) internal {\n        uint256 idx = roleMembers[role].indexOf[account];\n\n        delete roleMembers[role].members[idx];\n        delete roleMembers[role].indexOf[account];\n    }\n}\n"
      },
      "contracts/extension/PlatformFee.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPlatformFee.sol\";\n\n/**\n *  @title   Platform Fee\n *  @notice  Thirdweb's `PlatformFee` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *           the recipient of platform fee and the platform fee basis points, and lets the inheriting contract perform conditional logic\n *           that uses information about platform fees, if desired.\n */\n\nabstract contract PlatformFee is IPlatformFee {\n    /// @dev The address that receives all platform fees from all sales.\n    address private platformFeeRecipient;\n\n    /// @dev The % of primary sales collected as platform fees.\n    uint16 private platformFeeBps;\n\n    /// @dev Fee type variants: percentage fee and flat fee\n    PlatformFeeType private platformFeeType;\n\n    /// @dev The flat amount collected by the contract as fees on primary sales.\n    uint256 private flatPlatformFee;\n\n    /// @dev Returns the platform fee recipient and bps.\n    function getPlatformFeeInfo() public view override returns (address, uint16) {\n        return (platformFeeRecipient, uint16(platformFeeBps));\n    }\n\n    /// @dev Returns the platform fee bps and recipient.\n    function getFlatPlatformFeeInfo() public view returns (address, uint256) {\n        return (platformFeeRecipient, flatPlatformFee);\n    }\n\n    /// @dev Returns the platform fee type.\n    function getPlatformFeeType() public view returns (PlatformFeeType) {\n        return platformFeeType;\n    }\n\n    /**\n     *  @notice         Updates the platform fee recipient and bps.\n     *  @dev            Caller should be authorized to set platform fee info.\n     *                  See {_canSetPlatformFeeInfo}.\n     *                  Emits {PlatformFeeInfoUpdated Event}; See {_setupPlatformFeeInfo}.\n     *\n     *  @param _platformFeeRecipient   Address to be set as new platformFeeRecipient.\n     *  @param _platformFeeBps         Updated platformFeeBps.\n     */\n    function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external override {\n        if (!_canSetPlatformFeeInfo()) {\n            revert(\"Not authorized\");\n        }\n        _setupPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps);\n    }\n\n    /// @dev Sets the platform fee recipient and bps\n    function _setupPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) internal {\n        if (_platformFeeBps > 10_000) {\n            revert(\"Exceeds max bps\");\n        }\n        if (_platformFeeRecipient == address(0)) {\n            revert(\"Invalid recipient\");\n        }\n\n        platformFeeBps = uint16(_platformFeeBps);\n        platformFeeRecipient = _platformFeeRecipient;\n\n        emit PlatformFeeInfoUpdated(_platformFeeRecipient, _platformFeeBps);\n    }\n\n    /// @notice Lets a module admin set a flat fee on primary sales.\n    function setFlatPlatformFeeInfo(address _platformFeeRecipient, uint256 _flatFee) external {\n        if (!_canSetPlatformFeeInfo()) {\n            revert(\"Not authorized\");\n        }\n\n        _setupFlatPlatformFeeInfo(_platformFeeRecipient, _flatFee);\n    }\n\n    /// @dev Sets a flat fee on primary sales.\n    function _setupFlatPlatformFeeInfo(address _platformFeeRecipient, uint256 _flatFee) internal {\n        flatPlatformFee = _flatFee;\n        platformFeeRecipient = _platformFeeRecipient;\n\n        emit FlatPlatformFeeUpdated(_platformFeeRecipient, _flatFee);\n    }\n\n    /// @notice Lets a module admin set platform fee type.\n    function setPlatformFeeType(PlatformFeeType _feeType) external {\n        if (!_canSetPlatformFeeInfo()) {\n            revert(\"Not authorized\");\n        }\n        _setupPlatformFeeType(_feeType);\n    }\n\n    /// @dev Sets platform fee type.\n    function _setupPlatformFeeType(PlatformFeeType _feeType) internal {\n        platformFeeType = _feeType;\n\n        emit PlatformFeeTypeUpdated(_feeType);\n    }\n\n    /// @dev Returns whether platform fee info can be set in the given execution context.\n    function _canSetPlatformFeeInfo() internal view virtual returns (bool);\n}\n"
      },
      "contracts/extension/PrimarySale.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IPrimarySale.sol\";\n\n/**\n *  @title   Primary Sale\n *  @notice  Thirdweb's `PrimarySale` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *           the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about\n *           primary sales, if desired.\n */\n\nabstract contract PrimarySale is IPrimarySale {\n    /// @dev The address that receives all primary sales value.\n    address private recipient;\n\n    /// @dev Returns primary sale recipient address.\n    function primarySaleRecipient() public view override returns (address) {\n        return recipient;\n    }\n\n    /**\n     *  @notice         Updates primary sale recipient.\n     *  @dev            Caller should be authorized to set primary sales info.\n     *                  See {_canSetPrimarySaleRecipient}.\n     *                  Emits {PrimarySaleRecipientUpdated Event}; See {_setupPrimarySaleRecipient}.\n     *\n     *  @param _saleRecipient   Address to be set as new recipient of primary sales.\n     */\n    function setPrimarySaleRecipient(address _saleRecipient) external override {\n        if (!_canSetPrimarySaleRecipient()) {\n            revert(\"Not authorized\");\n        }\n        _setupPrimarySaleRecipient(_saleRecipient);\n    }\n\n    /// @dev Lets a contract admin set the recipient for all primary sales.\n    function _setupPrimarySaleRecipient(address _saleRecipient) internal {\n        if (_saleRecipient == address(0)) {\n            revert(\"Invalid recipient\");\n        }\n        recipient = _saleRecipient;\n        emit PrimarySaleRecipientUpdated(_saleRecipient);\n    }\n\n    /// @dev Returns whether primary sale recipient can be set in the given execution context.\n    function _canSetPrimarySaleRecipient() internal view virtual returns (bool);\n}\n"
      },
      "contracts/extension/Royalty.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./interface/IRoyalty.sol\";\n\n/**\n *  @title   Royalty\n *  @notice  Thirdweb's `Royalty` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *           the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic\n *           that uses information about royalty fees, if desired.\n *\n *  @dev     The `Royalty` contract is ERC2981 compliant.\n */\n\nabstract contract Royalty is IRoyalty {\n    /// @dev The (default) address that receives all royalty value.\n    address private royaltyRecipient;\n\n    /// @dev The (default) % of a sale to take as royalty (in basis points).\n    uint16 private royaltyBps;\n\n    /// @dev Token ID => royalty recipient and bps for token\n    mapping(uint256 => RoyaltyInfo) private royaltyInfoForToken;\n\n    /**\n     *  @notice   View royalty info for a given token and sale price.\n     *  @dev      Returns royalty amount and recipient for `tokenId` and `salePrice`.\n     *  @param tokenId          The tokenID of the NFT for which to query royalty info.\n     *  @param salePrice        Sale price of the token.\n     *\n     *  @return receiver        Address of royalty recipient account.\n     *  @return royaltyAmount   Royalty amount calculated at current royaltyBps value.\n     */\n    function royaltyInfo(\n        uint256 tokenId,\n        uint256 salePrice\n    ) external view virtual override returns (address receiver, uint256 royaltyAmount) {\n        (address recipient, uint256 bps) = getRoyaltyInfoForToken(tokenId);\n        receiver = recipient;\n        royaltyAmount = (salePrice * bps) / 10_000;\n    }\n\n    /**\n     *  @notice          View royalty info for a given token.\n     *  @dev             Returns royalty recipient and bps for `_tokenId`.\n     *  @param _tokenId  The tokenID of the NFT for which to query royalty info.\n     */\n    function getRoyaltyInfoForToken(uint256 _tokenId) public view override returns (address, uint16) {\n        RoyaltyInfo memory royaltyForToken = royaltyInfoForToken[_tokenId];\n\n        return\n            royaltyForToken.recipient == address(0)\n                ? (royaltyRecipient, uint16(royaltyBps))\n                : (royaltyForToken.recipient, uint16(royaltyForToken.bps));\n    }\n\n    /**\n     *  @notice Returns the defualt royalty recipient and BPS for this contract's NFTs.\n     */\n    function getDefaultRoyaltyInfo() external view override returns (address, uint16) {\n        return (royaltyRecipient, uint16(royaltyBps));\n    }\n\n    /**\n     *  @notice         Updates default royalty recipient and bps.\n     *  @dev            Caller should be authorized to set royalty info.\n     *                  See {_canSetRoyaltyInfo}.\n     *                  Emits {DefaultRoyalty Event}; See {_setupDefaultRoyaltyInfo}.\n     *\n     *  @param _royaltyRecipient   Address to be set as default royalty recipient.\n     *  @param _royaltyBps         Updated royalty bps.\n     */\n    function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external override {\n        if (!_canSetRoyaltyInfo()) {\n            revert(\"Not authorized\");\n        }\n\n        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);\n    }\n\n    /// @dev Lets a contract admin update the default royalty recipient and bps.\n    function _setupDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) internal {\n        if (_royaltyBps > 10_000) {\n            revert(\"Exceeds max bps\");\n        }\n\n        royaltyRecipient = _royaltyRecipient;\n        royaltyBps = uint16(_royaltyBps);\n\n        emit DefaultRoyalty(_royaltyRecipient, _royaltyBps);\n    }\n\n    /**\n     *  @notice         Updates default royalty recipient and bps for a particular token.\n     *  @dev            Sets royalty info for `_tokenId`. Caller should be authorized to set royalty info.\n     *                  See {_canSetRoyaltyInfo}.\n     *                  Emits {RoyaltyForToken Event}; See {_setupRoyaltyInfoForToken}.\n     *\n     *  @param _recipient   Address to be set as royalty recipient for given token Id.\n     *  @param _bps         Updated royalty bps for the token Id.\n     */\n    function setRoyaltyInfoForToken(uint256 _tokenId, address _recipient, uint256 _bps) external override {\n        if (!_canSetRoyaltyInfo()) {\n            revert(\"Not authorized\");\n        }\n\n        _setupRoyaltyInfoForToken(_tokenId, _recipient, _bps);\n    }\n\n    /// @dev Lets a contract admin set the royalty recipient and bps for a particular token Id.\n    function _setupRoyaltyInfoForToken(uint256 _tokenId, address _recipient, uint256 _bps) internal {\n        if (_bps > 10_000) {\n            revert(\"Exceeds max bps\");\n        }\n\n        royaltyInfoForToken[_tokenId] = RoyaltyInfo({ recipient: _recipient, bps: _bps });\n\n        emit RoyaltyForToken(_tokenId, _recipient, _bps);\n    }\n\n    /// @dev Returns whether royalty info can be set in the given execution context.\n    function _canSetRoyaltyInfo() internal view virtual returns (bool);\n}\n"
      },
      "contracts/extension/interface/IClaimCondition.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  The interface `IClaimCondition` is written for thirdweb's 'Drop' contracts, which are distribution mechanisms for tokens.\n *\n *  A claim condition defines criteria under which accounts can mint tokens. Claim conditions can be overwritten\n *  or added to by the contract admin. At any moment, there is only one active claim condition.\n */\n\ninterface IClaimCondition {\n    /**\n     *  @notice The criteria that make up a claim condition.\n     *\n     *  @param startTimestamp                 The unix timestamp after which the claim condition applies.\n     *                                        The same claim condition applies until the `startTimestamp`\n     *                                        of the next claim condition.\n     *\n     *  @param maxClaimableSupply             The maximum total number of tokens that can be claimed under\n     *                                        the claim condition.\n     *\n     *  @param supplyClaimed                  At any given point, the number of tokens that have been claimed\n     *                                        under the claim condition.\n     *\n     *  @param quantityLimitPerWallet         The maximum number of tokens that can be claimed by a wallet.\n     *\n     *  @param merkleRoot                     The allowlist of addresses that can claim tokens under the claim\n     *                                        condition.\n     *\n     *  @param pricePerToken                  The price required to pay per token claimed.\n     *\n     *  @param currency                       The currency in which the `pricePerToken` must be paid.\n     *\n     *  @param metadata                       Claim condition metadata.\n     */\n    struct ClaimCondition {\n        uint256 startTimestamp;\n        uint256 maxClaimableSupply;\n        uint256 supplyClaimed;\n        uint256 quantityLimitPerWallet;\n        bytes32 merkleRoot;\n        uint256 pricePerToken;\n        address currency;\n        string metadata;\n    }\n}\n"
      },
      "contracts/extension/interface/IClaimConditionMultiPhase.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IClaimCondition.sol\";\n\n/**\n *  The interface `IClaimConditionMultiPhase` is written for thirdweb's 'Drop' contracts, which are distribution mechanisms for tokens.\n *\n *  An authorized wallet can set a series of claim conditions, ordered by their respective `startTimestamp`.\n *  A claim condition defines criteria under which accounts can mint tokens. Claim conditions can be overwritten\n *  or added to by the contract admin. At any moment, there is only one active claim condition.\n */\n\ninterface IClaimConditionMultiPhase is IClaimCondition {\n    /**\n     *  @notice The set of all claim conditions, at any given moment.\n     *  Claim Phase ID = [currentStartId, currentStartId + length - 1];\n     *\n     *  @param currentStartId           The uid for the first claim condition amongst the current set of\n     *                                  claim conditions. The uid for each next claim condition is one\n     *                                  more than the previous claim condition's uid.\n     *\n     *  @param count                    The total number of phases / claim conditions in the list\n     *                                  of claim conditions.\n     *\n     *  @param conditions                   The claim conditions at a given uid. Claim conditions\n     *                                  are ordered in an ascending order by their `startTimestamp`.\n     *\n     *  @param supplyClaimedByWallet    Map from a claim condition uid and account to supply claimed by account.\n     */\n    struct ClaimConditionList {\n        uint256 currentStartId;\n        uint256 count;\n        mapping(uint256 => ClaimCondition) conditions;\n        mapping(uint256 => mapping(address => uint256)) supplyClaimedByWallet;\n    }\n}\n"
      },
      "contracts/extension/interface/IContractMetadata.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI\n *  for you contract.\n *\n *  Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea.\n */\n\ninterface IContractMetadata {\n    /// @dev Returns the metadata URI of the contract.\n    function contractURI() external view returns (string memory);\n\n    /**\n     *  @dev Sets contract URI for the storefront-level metadata of the contract.\n     *       Only module admin can call this function.\n     */\n    function setContractURI(string calldata _uri) external;\n\n    /// @dev Emitted when the contract URI is updated.\n    event ContractURIUpdated(string prevURI, string newURI);\n}\n"
      },
      "contracts/extension/interface/IDrop1155.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IClaimConditionMultiPhase.sol\";\n\n/**\n *  The interface `IDrop1155` is written for thirdweb's 'Drop' contracts, which are distribution mechanisms for tokens.\n *\n *  An authorized wallet can set a series of claim conditions, ordered by their respective `startTimestamp`.\n *  A claim condition defines criteria under which accounts can mint tokens. Claim conditions can be overwritten\n *  or added to by the contract admin. At any moment, there is only one active claim condition.\n */\n\ninterface IDrop1155 is IClaimConditionMultiPhase {\n    /**\n     *  @param proof Proof of concerned wallet's inclusion in an allowlist.\n     *  @param quantityLimitPerWallet The total quantity of tokens the allowlisted wallet is eligible to claim over time.\n     *  @param pricePerToken The price per token the allowlisted wallet must pay to claim tokens.\n     *  @param currency The currency in which the allowlisted wallet must pay the price for claiming tokens.\n     */\n    struct AllowlistProof {\n        bytes32[] proof;\n        uint256 quantityLimitPerWallet;\n        uint256 pricePerToken;\n        address currency;\n    }\n\n    /// @notice Emitted when tokens are claimed.\n    event TokensClaimed(\n        uint256 indexed claimConditionIndex,\n        address indexed claimer,\n        address indexed receiver,\n        uint256 tokenId,\n        uint256 quantityClaimed\n    );\n\n    /// @notice Emitted when the contract's claim conditions are updated.\n    event ClaimConditionsUpdated(uint256 indexed tokenId, ClaimCondition[] claimConditions, bool resetEligibility);\n\n    /**\n     *  @notice Lets an account claim a given quantity of NFTs.\n     *\n     *  @param receiver                       The receiver of the NFTs to claim.\n     *  @param tokenId                        The tokenId of the NFT to claim.\n     *  @param quantity                       The quantity of NFTs to claim.\n     *  @param currency                       The currency in which to pay for the claim.\n     *  @param pricePerToken                  The price per token to pay for the claim.\n     *  @param allowlistProof                 The proof of the claimer's inclusion in the merkle root allowlist\n     *                                        of the claim conditions that apply.\n     *  @param data                           Arbitrary bytes data that can be leveraged in the implementation of this interface.\n     */\n    function claim(\n        address receiver,\n        uint256 tokenId,\n        uint256 quantity,\n        address currency,\n        uint256 pricePerToken,\n        AllowlistProof calldata allowlistProof,\n        bytes memory data\n    ) external payable;\n\n    /**\n     *  @notice Lets a contract admin (account with `DEFAULT_ADMIN_ROLE`) set claim conditions.\n     *\n     *  @param tokenId                  The token ID for which to set mint conditions.\n     *  @param phases                   Claim conditions in ascending order by `startTimestamp`.\n     *\n     *  @param resetClaimEligibility    Whether to honor the restrictions applied to wallets who have claimed tokens in the current conditions,\n     *                                  in the new claim conditions being set.\n     *\n     */\n    function setClaimConditions(uint256 tokenId, ClaimCondition[] calldata phases, bool resetClaimEligibility) external;\n}\n"
      },
      "contracts/extension/interface/ILazyMint.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `LazyMint` is a contract extension for any base NFT contract. It lets you 'lazy mint' any number of NFTs\n *  at once. Here, 'lazy mint' means defining the metadata for particular tokenIds of your NFT contract, without actually\n *  minting a non-zero balance of NFTs of those tokenIds.\n */\n\ninterface ILazyMint {\n    /// @dev Emitted when tokens are lazy minted.\n    event TokensLazyMinted(uint256 indexed startTokenId, uint256 endTokenId, string baseURI, bytes encryptedBaseURI);\n\n    /**\n     *  @notice Lazy mints a given amount of NFTs.\n     *\n     *  @param amount           The number of NFTs to lazy mint.\n     *\n     *  @param baseURIForTokens The base URI for the 'n' number of NFTs being lazy minted, where the metadata for each\n     *                          of those NFTs is `${baseURIForTokens}/${tokenId}`.\n     *\n     *  @param extraData        Additional bytes data to be used at the discretion of the consumer of the contract.\n     *\n     *  @return batchId         A unique integer identifier for the batch of NFTs lazy minted together.\n     */\n    function lazyMint(\n        uint256 amount,\n        string calldata baseURIForTokens,\n        bytes calldata extraData\n    ) external returns (uint256 batchId);\n}\n"
      },
      "contracts/extension/interface/IMulticall.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * @dev Provides a function to batch together multiple calls in a single external call.\n *\n * _Available since v4.1._\n */\ninterface IMulticall {\n    /**\n     * @dev Receives and executes a batch of function calls on this contract.\n     */\n    function multicall(bytes[] calldata data) external returns (bytes[] memory results);\n}\n"
      },
      "contracts/extension/interface/IOwnable.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *  who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses\n *  information about who the contract's owner is.\n */\n\ninterface IOwnable {\n    /// @dev Returns the owner of the contract.\n    function owner() external view returns (address);\n\n    /// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin.\n    function setOwner(address _newOwner) external;\n\n    /// @dev Emitted when a new Owner is set.\n    event OwnerUpdated(address indexed prevOwner, address indexed newOwner);\n}\n"
      },
      "contracts/extension/interface/IPermissions.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IPermissions {\n    /**\n     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n     *\n     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n     * {RoleAdminChanged} not being emitted signaling this.\n     *\n     * _Available since v3.1._\n     */\n    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n    /**\n     * @dev Emitted when `account` is granted `role`.\n     *\n     * `sender` is the account that originated the contract call, an admin role\n     * bearer except when using {AccessControl-_setupRole}.\n     */\n    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Emitted when `account` is revoked `role`.\n     *\n     * `sender` is the account that originated the contract call:\n     *   - if using `revokeRole`, it is the admin role bearer\n     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n     */\n    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n    /**\n     * @dev Returns `true` if `account` has been granted `role`.\n     */\n    function hasRole(bytes32 role, address account) external view returns (bool);\n\n    /**\n     * @dev Returns the admin role that controls `role`. See {grantRole} and\n     * {revokeRole}.\n     *\n     * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n     */\n    function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n    /**\n     * @dev Grants `role` to `account`.\n     *\n     * If `account` had not been already granted `role`, emits a {RoleGranted}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function grantRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from `account`.\n     *\n     * If `account` had been granted `role`, emits a {RoleRevoked} event.\n     *\n     * Requirements:\n     *\n     * - the caller must have ``role``'s admin role.\n     */\n    function revokeRole(bytes32 role, address account) external;\n\n    /**\n     * @dev Revokes `role` from the calling account.\n     *\n     * Roles are often managed via {grantRole} and {revokeRole}: this function's\n     * purpose is to provide a mechanism for accounts to lose their privileges\n     * if they are compromised (such as when a trusted device is misplaced).\n     *\n     * If the calling account had been granted `role`, emits a {RoleRevoked}\n     * event.\n     *\n     * Requirements:\n     *\n     * - the caller must be `account`.\n     */\n    function renounceRole(bytes32 role, address account) external;\n}\n"
      },
      "contracts/extension/interface/IPermissionsEnumerable.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"./IPermissions.sol\";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IPermissionsEnumerable is IPermissions {\n    /**\n     * @dev Returns one of the accounts that have `role`. `index` must be a\n     * value between 0 and {getRoleMemberCount}, non-inclusive.\n     *\n     * Role bearers are not sorted in any particular way, and their ordering may\n     * change at any point.\n     *\n     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n     * you perform all queries on the same block. See the following\n     * [forum post](https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296)\n     * for more information.\n     */\n    function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n    /**\n     * @dev Returns the number of accounts that have `role`. Can be used\n     * together with {getRoleMember} to enumerate all bearers of a role.\n     */\n    function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n"
      },
      "contracts/extension/interface/IPlatformFee.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `PlatformFee` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *  the recipient of platform fee and the platform fee basis points, and lets the inheriting contract perform conditional logic\n *  that uses information about platform fees, if desired.\n */\n\ninterface IPlatformFee {\n    /// @dev Fee type variants: percentage fee and flat fee\n    enum PlatformFeeType {\n        Bps,\n        Flat\n    }\n\n    /// @dev Returns the platform fee bps and recipient.\n    function getPlatformFeeInfo() external view returns (address, uint16);\n\n    /// @dev Lets a module admin update the fees on primary sales.\n    function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external;\n\n    /// @dev Emitted when fee on primary sales is updated.\n    event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps);\n\n    /// @dev Emitted when the flat platform fee is updated.\n    event FlatPlatformFeeUpdated(address platformFeeRecipient, uint256 flatFee);\n\n    /// @dev Emitted when the platform fee type is updated.\n    event PlatformFeeTypeUpdated(PlatformFeeType feeType);\n}\n"
      },
      "contracts/extension/interface/IPrimarySale.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n *  Thirdweb's `Primary` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *  the recipient of primary sales, and lets the inheriting contract perform conditional logic that uses information about\n *  primary sales, if desired.\n */\n\ninterface IPrimarySale {\n    /// @dev The adress that receives all primary sales value.\n    function primarySaleRecipient() external view returns (address);\n\n    /// @dev Lets a module admin set the default recipient of all primary sales.\n    function setPrimarySaleRecipient(address _saleRecipient) external;\n\n    /// @dev Emitted when a new sale recipient is set.\n    event PrimarySaleRecipientUpdated(address indexed recipient);\n}\n"
      },
      "contracts/extension/interface/IRoyalty.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nimport \"../../eip/interface/IERC2981.sol\";\n\n/**\n *  Thirdweb's `Royalty` is a contract extension to be used with any base contract. It exposes functions for setting and reading\n *  the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic\n *  that uses information about royalty fees, if desired.\n *\n *  The `Royalty` contract is ERC2981 compliant.\n */\n\ninterface IRoyalty is IERC2981 {\n    struct RoyaltyInfo {\n        address recipient;\n        uint256 bps;\n    }\n\n    /// @dev Returns the royalty recipient and fee bps.\n    function getDefaultRoyaltyInfo() external view returns (address, uint16);\n\n    /// @dev Lets a module admin update the royalty bps and recipient.\n    function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external;\n\n    /// @dev Lets a module admin set the royalty recipient for a particular token Id.\n    function setRoyaltyInfoForToken(uint256 tokenId, address recipient, uint256 bps) external;\n\n    /// @dev Returns the royalty recipient for a particular token Id.\n    function getRoyaltyInfoForToken(uint256 tokenId) external view returns (address, uint16);\n\n    /// @dev Emitted when royalty info is updated.\n    event DefaultRoyalty(address indexed newRoyaltyRecipient, uint256 newRoyaltyBps);\n\n    /// @dev Emitted when royalty recipient for tokenId is set\n    event RoyaltyForToken(uint256 indexed tokenId, address indexed royaltyRecipient, uint256 royaltyBps);\n}\n"
      },
      "contracts/external-deps/openzeppelin/metatx/ERC2771ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.0 (metatx/ERC2771Context.sol)\n\npragma solidity ^0.8.11;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\n/**\n * @dev Context variant with ERC2771 support.\n */\nabstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable {\n    mapping(address => bool) private _trustedForwarder;\n\n    function __ERC2771Context_init(address[] memory trustedForwarder) internal onlyInitializing {\n        __Context_init_unchained();\n        __ERC2771Context_init_unchained(trustedForwarder);\n    }\n\n    function __ERC2771Context_init_unchained(address[] memory trustedForwarder) internal onlyInitializing {\n        for (uint256 i = 0; i < trustedForwarder.length; i++) {\n            _trustedForwarder[trustedForwarder[i]] = true;\n        }\n    }\n\n    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {\n        return _trustedForwarder[forwarder];\n    }\n\n    function _msgSender() internal view virtual override returns (address sender) {\n        if (isTrustedForwarder(msg.sender)) {\n            // The assembly code is more direct than the Solidity version using `abi.decode`.\n            assembly {\n                sender := shr(96, calldataload(sub(calldatasize(), 20)))\n            }\n        } else {\n            return super._msgSender();\n        }\n    }\n\n    function _msgData() internal view virtual override returns (bytes calldata) {\n        if (isTrustedForwarder(msg.sender)) {\n            return msg.data[:msg.data.length - 20];\n        } else {\n            return super._msgData();\n        }\n    }\n\n    uint256[49] private __gap;\n}\n"
      },
      "contracts/external-deps/openzeppelin/token/ERC20/utils/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../../../../eip/interface/IERC20.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 newAllowance = token.allowance(address(this), spender) + value;\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            uint256 newAllowance = oldAllowance - value;\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        if (returndata.length > 0) {\n            // Return data is optional\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"
      },
      "contracts/infra/interface/IWETH.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\ninterface IWETH {\n    function deposit() external payable;\n\n    function withdraw(uint256 amount) external;\n\n    function transfer(address to, uint256 value) external returns (bool);\n}\n"
      },
      "contracts/lib/Address.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.1;\n\n/// @author thirdweb, OpenZeppelin Contracts (v4.9.0)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{ value: amount }(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{ value: value }(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
      },
      "contracts/lib/CurrencyTransferLib.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n// Helper interfaces\nimport { IWETH } from \"../infra/interface/IWETH.sol\";\nimport { SafeERC20, IERC20 } from \"../external-deps/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\n\nlibrary CurrencyTransferLib {\n    using SafeERC20 for IERC20;\n\n    /// @dev The address interpreted as native token of the chain.\n    address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n    /// @dev Transfers a given amount of currency.\n    function transferCurrency(address _currency, address _from, address _to, uint256 _amount) internal {\n        if (_amount == 0) {\n            return;\n        }\n\n        if (_currency == NATIVE_TOKEN) {\n            safeTransferNativeToken(_to, _amount);\n        } else {\n            safeTransferERC20(_currency, _from, _to, _amount);\n        }\n    }\n\n    /// @dev Transfers a given amount of currency. (With native token wrapping)\n    function transferCurrencyWithWrapper(\n        address _currency,\n        address _from,\n        address _to,\n        uint256 _amount,\n        address _nativeTokenWrapper\n    ) internal {\n        if (_amount == 0) {\n            return;\n        }\n\n        if (_currency == NATIVE_TOKEN) {\n            if (_from == address(this)) {\n                // withdraw from weth then transfer withdrawn native token to recipient\n                IWETH(_nativeTokenWrapper).withdraw(_amount);\n                safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);\n            } else if (_to == address(this)) {\n                // store native currency in weth\n                require(_amount == msg.value, \"msg.value != amount\");\n                IWETH(_nativeTokenWrapper).deposit{ value: _amount }();\n            } else {\n                safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);\n            }\n        } else {\n            safeTransferERC20(_currency, _from, _to, _amount);\n        }\n    }\n\n    /// @dev Transfer `amount` of ERC20 token from `from` to `to`.\n    function safeTransferERC20(address _currency, address _from, address _to, uint256 _amount) internal {\n        if (_from == _to) {\n            return;\n        }\n\n        if (_from == address(this)) {\n            IERC20(_currency).safeTransfer(_to, _amount);\n        } else {\n            IERC20(_currency).safeTransferFrom(_from, _to, _amount);\n        }\n    }\n\n    /// @dev Transfers `amount` of native token to `to`.\n    function safeTransferNativeToken(address to, uint256 value) internal {\n        // solhint-disable avoid-low-level-calls\n        // slither-disable-next-line low-level-calls\n        (bool success, ) = to.call{ value: value }(\"\");\n        require(success, \"native token transfer failed\");\n    }\n\n    /// @dev Transfers `amount` of native token to `to`. (With native token wrapping)\n    function safeTransferNativeTokenWithWrapper(address to, uint256 value, address _nativeTokenWrapper) internal {\n        // solhint-disable avoid-low-level-calls\n        // slither-disable-next-line low-level-calls\n        (bool success, ) = to.call{ value: value }(\"\");\n        if (!success) {\n            IWETH(_nativeTokenWrapper).deposit{ value: value }();\n            IERC20(_nativeTokenWrapper).safeTransfer(to, value);\n        }\n    }\n}\n"
      },
      "contracts/lib/MerkleProof.sol": {
        "content": "// SPDX-License-Identifier: Apache 2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\nlibrary MerkleProof {\n    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool, uint256) {\n        bytes32 computedHash = leaf;\n        uint256 index = 0;\n\n        for (uint256 i = 0; i < proof.length; i++) {\n            index *= 2;\n            bytes32 proofElement = proof[i];\n\n            if (computedHash <= proofElement) {\n                // Hash(current computed hash + current element of the proof)\n                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));\n            } else {\n                // Hash(current element of the proof + current computed hash)\n                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));\n                index += 1;\n            }\n        }\n\n        // Check if the computed hash (root) is equal to the provided root\n        return (computedHash == root, index);\n    }\n}\n"
      },
      "contracts/lib/Strings.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/// @author thirdweb\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        // Inspired by OraclizeAPI's implementation - MIT licence\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n        if (value == 0) {\n            return \"0\";\n        }\n        uint256 temp = value;\n        uint256 digits;\n        while (temp != 0) {\n            digits++;\n            temp /= 10;\n        }\n        bytes memory buffer = new bytes(digits);\n        while (value != 0) {\n            digits -= 1;\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n            value /= 10;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        if (value == 0) {\n            return \"0x00\";\n        }\n        uint256 temp = value;\n        uint256 length = 0;\n        while (temp != 0) {\n            length++;\n            temp >>= 8;\n        }\n        return toHexString(value, length);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _HEX_SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n\n    /// @dev Returns the hexadecimal representation of `value`.\n    /// The output is prefixed with \"0x\", encoded using 2 hexadecimal digits per byte,\n    /// and the alphabets are capitalized conditionally according to\n    /// https://eips.ethereum.org/EIPS/eip-55\n    function toHexStringChecksummed(address value) internal pure returns (string memory str) {\n        str = toHexString(value);\n        /// @solidity memory-safe-assembly\n        assembly {\n            let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...`\n            let o := add(str, 0x22)\n            let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... `\n            let t := shl(240, 136) // `0b10001000 << 240`\n            for {\n                let i := 0\n            } 1 {\n\n            } {\n                mstore(add(i, i), mul(t, byte(i, hashed)))\n                i := add(i, 1)\n                if eq(i, 20) {\n                    break\n                }\n            }\n            mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask)))))\n            o := add(o, 0x20)\n            mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask)))))\n        }\n    }\n\n    /// @dev Returns the hexadecimal representation of `value`.\n    /// The output is prefixed with \"0x\" and encoded using 2 hexadecimal digits per byte.\n    function toHexString(address value) internal pure returns (string memory str) {\n        str = toHexStringNoPrefix(value);\n        /// @solidity memory-safe-assembly\n        assembly {\n            let strLength := add(mload(str), 2) // Compute the length.\n            mstore(str, 0x3078) // Write the \"0x\" prefix.\n            str := sub(str, 2) // Move the pointer.\n            mstore(str, strLength) // Write the length.\n        }\n    }\n\n    /// @dev Returns the hexadecimal representation of `value`.\n    /// The output is encoded using 2 hexadecimal digits per byte.\n    function toHexStringNoPrefix(address value) internal pure returns (string memory str) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            str := mload(0x40)\n\n            // Allocate the memory.\n            // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,\n            // 0x02 bytes for the prefix, and 0x28 bytes for the digits.\n            // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80.\n            mstore(0x40, add(str, 0x80))\n\n            // Store \"0123456789abcdef\" in scratch space.\n            mstore(0x0f, 0x30313233343536373839616263646566)\n\n            str := add(str, 2)\n            mstore(str, 40)\n\n            let o := add(str, 0x20)\n            mstore(add(o, 40), 0)\n\n            value := shl(96, value)\n\n            // We write the string from rightmost digit to leftmost digit.\n            // The following is essentially a do-while loop that also handles the zero case.\n            for {\n                let i := 0\n            } 1 {\n\n            } {\n                let p := add(o, add(i, i))\n                let temp := byte(i, value)\n                mstore8(add(p, 1), mload(and(temp, 15)))\n                mstore8(p, mload(shr(4, temp)))\n                i := add(i, 1)\n                if eq(i, 20) {\n                    break\n                }\n            }\n        }\n    }\n\n    /// @dev Returns the hex encoded string from the raw bytes.\n    /// The output is encoded using 2 hexadecimal digits per byte.\n    function toHexString(bytes memory raw) internal pure returns (string memory str) {\n        str = toHexStringNoPrefix(raw);\n        /// @solidity memory-safe-assembly\n        assembly {\n            let strLength := add(mload(str), 2) // Compute the length.\n            mstore(str, 0x3078) // Write the \"0x\" prefix.\n            str := sub(str, 2) // Move the pointer.\n            mstore(str, strLength) // Write the length.\n        }\n    }\n\n    /// @dev Returns the hex encoded string from the raw bytes.\n    /// The output is encoded using 2 hexadecimal digits per byte.\n    function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let length := mload(raw)\n            str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix.\n            mstore(str, add(length, length)) // Store the length of the output.\n\n            // Store \"0123456789abcdef\" in scratch space.\n            mstore(0x0f, 0x30313233343536373839616263646566)\n\n            let o := add(str, 0x20)\n            let end := add(raw, length)\n\n            for {\n\n            } iszero(eq(raw, end)) {\n\n            } {\n                raw := add(raw, 1)\n                mstore8(add(o, 1), mload(and(mload(raw), 15)))\n                mstore8(o, mload(and(shr(4, mload(raw)), 15)))\n                o := add(o, 2)\n            }\n            mstore(o, 0) // Zeroize the slot after the string.\n            mstore(0x40, add(o, 0x20)) // Allocate the memory.\n        }\n    }\n}\n"
      },
      "contracts/prebuilts/drop/DropERC1155.sol": {
        "content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.11;\n\n/// @author thirdweb\n\n//   $$\\     $$\\       $$\\                 $$\\                         $$\\\n//   $$ |    $$ |      \\__|                $$ |                        $$ |\n// $$$$$$\\   $$$$$$$\\  $$\\  $$$$$$\\   $$$$$$$ |$$\\  $$\\  $$\\  $$$$$$\\  $$$$$$$\\\n// \\_$$  _|  $$  __$$\\ $$ |$$  __$$\\ $$  __$$ |$$ | $$ | $$ |$$  __$$\\ $$  __$$\\\n//   $$ |    $$ |  $$ |$$ |$$ |  \\__|$$ /  $$ |$$ | $$ | $$ |$$$$$$$$ |$$ |  $$ |\n//   $$ |$$\\ $$ |  $$ |$$ |$$ |      $$ |  $$ |$$ | $$ | $$ |$$   ____|$$ |  $$ |\n//   \\$$$$  |$$ |  $$ |$$ |$$ |      \\$$$$$$$ |\\$$$$$\\$$$$  |\\$$$$$$$\\ $$$$$$$  |\n//    \\____/ \\__|  \\__|\\__|\\__|       \\_______| \\_____\\____/  \\_______|\\_______/\n\n//  ==========  External imports    ==========\n\nimport \"@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol\";\n\nimport \"../../extension/Multicall.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol\";\n\n//  ==========  Internal imports    ==========\n\nimport \"../../external-deps/openzeppelin/metatx/ERC2771ContextUpgradeable.sol\";\nimport \"../../lib/CurrencyTransferLib.sol\";\n\n//  ==========  Features    ==========\n\nimport \"../../extension/ContractMetadata.sol\";\nimport \"../../extension/PlatformFee.sol\";\nimport \"../../extension/Royalty.sol\";\nimport \"../../extension/PrimarySale.sol\";\nimport \"../../extension/Ownable.sol\";\nimport \"../../extension/LazyMint.sol\";\nimport \"../../extension/PermissionsEnumerable.sol\";\nimport \"../../extension/Drop1155.sol\";\n\ncontract DropERC1155 is\n    Initializable,\n    ContractMetadata,\n    PlatformFee,\n    Royalty,\n    PrimarySale,\n    Ownable,\n    LazyMint,\n    PermissionsEnumerable,\n    Drop1155,\n    ERC2771ContextUpgradeable,\n    Multicall,\n    ERC1155Upgradeable\n{\n    using StringsUpgradeable for uint256;\n\n    /*///////////////////////////////////////////////////////////////\n                            State variables\n    //////////////////////////////////////////////////////////////*/\n\n    // Token name\n    string public name;\n\n    // Token symbol\n    string public symbol;\n\n    /// @dev Only transfers to or from TRANSFER_ROLE holders are valid, when transfers are restricted.\n    bytes32 private transferRole;\n    /// @dev Only MINTER_ROLE holders can sign off on `MintRequest`s and lazy mint tokens.\n    bytes32 private minterRole;\n    /// @dev Only METADATA_ROLE holders can reveal the URI for a batch of delayed reveal NFTs, and update or freeze batch metadata.\n    bytes32 private metadataRole;\n\n    /// @dev Max bps in the thirdweb system.\n    uint256 private constant MAX_BPS = 10_000;\n\n    /*///////////////////////////////////////////////////////////////\n                                Mappings\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Mapping from token ID => total circulating supply of tokens with that ID.\n    mapping(uint256 => uint256) public totalSupply;\n\n    /// @dev Mapping from token ID => maximum possible total circulating supply of tokens with that ID.\n    mapping(uint256 => uint256) public maxTotalSupply;\n\n    /// @dev Mapping from token ID => the address of the recipient of primary sales.\n    mapping(uint256 => address) public saleRecipient;\n\n    /*///////////////////////////////////////////////////////////////\n                               Events\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Emitted when the global max supply of a token is updated.\n    event MaxTotalSupplyUpdated(uint256 tokenId, uint256 maxTotalSupply);\n\n    /// @dev Emitted when the sale recipient for a particular tokenId is updated.\n    event SaleRecipientForTokenUpdated(uint256 indexed tokenId, address saleRecipient);\n\n    /*///////////////////////////////////////////////////////////////\n                    Constructor + initializer logic\n    //////////////////////////////////////////////////////////////*/\n\n    constructor() initializer {}\n\n    /// @dev Initializes the contract, like a constructor.\n    function initialize(\n        address _defaultAdmin,\n        string memory _name,\n        string memory _symbol,\n        string memory _contractURI,\n        address[] memory _trustedForwarders,\n        address _saleRecipient,\n        address _royaltyRecipient,\n        uint128 _royaltyBps,\n        uint128 _platformFeeBps,\n        address _platformFeeRecipient\n    ) external initializer {\n        bytes32 _transferRole = keccak256(\"TRANSFER_ROLE\");\n        bytes32 _minterRole = keccak256(\"MINTER_ROLE\");\n        bytes32 _metadataRole = keccak256(\"METADATA_ROLE\");\n\n        // Initialize inherited contracts, most base-like -> most derived.\n        __ERC2771Context_init(_trustedForwarders);\n        __ERC1155_init_unchained(\"\");\n\n        // Initialize this contract's state.\n        _setupContractURI(_contractURI);\n        _setupOwner(_defaultAdmin);\n\n        _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);\n        _setupRole(_minterRole, _defaultAdmin);\n        _setupRole(_transferRole, _defaultAdmin);\n        _setupRole(_transferRole, address(0));\n        _setupRole(_metadataRole, _defaultAdmin);\n        _setRoleAdmin(_metadataRole, _metadataRole);\n\n        _setupPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps);\n        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);\n        _setupPrimarySaleRecipient(_saleRecipient);\n\n        transferRole = _transferRole;\n        minterRole = _minterRole;\n        metadataRole = _metadataRole;\n        name = _name;\n        symbol = _symbol;\n    }\n\n    /*///////////////////////////////////////////////////////////////\n                        ERC 165 / 1155 / 2981 logic\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Returns the uri for a given tokenId.\n    function uri(uint256 _tokenId) public view override returns (string memory) {\n        string memory batchUri = _getBaseURI(_tokenId);\n        return string(abi.encodePacked(batchUri, _tokenId.toString()));\n    }\n\n    /// @dev See ERC 165\n    function supportsInterface(\n        bytes4 interfaceId\n    ) public view virtual override(ERC1155Upgradeable, IERC165) returns (bool) {\n        return super.supportsInterface(interfaceId) || type(IERC2981Upgradeable).interfaceId == interfaceId;\n    }\n\n    /*///////////////////////////////////////////////////////////////\n                        Contract identifiers\n    //////////////////////////////////////////////////////////////*/\n\n    function contractType() external pure returns (bytes32) {\n        return bytes32(\"DropERC1155\");\n    }\n\n    function contractVersion() external pure returns (uint8) {\n        return uint8(4);\n    }\n\n    /*///////////////////////////////////////////////////////////////\n                        Setter functions\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Lets a module admin set a max total supply for token.\n    function setMaxTotalSupply(uint256 _tokenId, uint256 _maxTotalSupply) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        maxTotalSupply[_tokenId] = _maxTotalSupply;\n        emit MaxTotalSupplyUpdated(_tokenId, _maxTotalSupply);\n    }\n\n    /// @dev Lets a contract admin set the recipient for all primary sales.\n    function setSaleRecipientForToken(uint256 _tokenId, address _saleRecipient) external onlyRole(DEFAULT_ADMIN_ROLE) {\n        saleRecipient[_tokenId] = _saleRecipient;\n        emit SaleRecipientForTokenUpdated(_tokenId, _saleRecipient);\n    }\n\n    /**\n     * @notice Updates the base URI for a batch of tokens.\n     *\n     * @param _index Index of the desired batch in batchIds array.\n     * @param _uri   the new base URI for the batch.\n     */\n    function updateBatchBaseURI(uint256 _index, string calldata _uri) external onlyRole(metadataRole) {\n        uint256 batchId = getBatchIdAtIndex(_index);\n        _setBaseURI(batchId, _uri);\n    }\n\n    /**\n     * @notice Freezes the base URI for a batch of tokens.\n     *\n     * @param _index Index of the desired batch in batchIds array.\n     */\n    function freezeBatchBaseURI(uint256 _index) external onlyRole(metadataRole) {\n        uint256 batchId = getBatchIdAtIndex(_index);\n        _freezeBaseURI(batchId);\n    }\n\n    /*///////////////////////////////////////////////////////////////\n                        Internal functions\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev Runs before every `claim` function call.\n    function _beforeClaim(\n        uint256 _tokenId,\n        address,\n        uint256 _quantity,\n        address,\n        uint256,\n        AllowlistProof calldata,\n        bytes memory\n    ) internal view override {\n        require(\n            maxTotalSupply[_tokenId] == 0 || totalSupply[_tokenId] + _quantity <= maxTotalSupply[_tokenId],\n            \"exceed max total supply\"\n        );\n    }\n\n    /// @dev Collects and distributes the primary sale value of NFTs being claimed.\n    function collectPriceOnClaim(\n        uint256 _tokenId,\n        address _primarySaleRecipient,\n        uint256 _quantityToClaim,\n        address _currency,\n        uint256 _pricePerToken\n    ) internal override {\n        if (_pricePerToken == 0) {\n            require(msg.value == 0, \"!V\");\n            return;\n        }\n\n        (address platformFeeRecipient, uint16 platformFeeBps) = getPlatformFeeInfo();\n\n        address _saleRecipient = _primarySaleRecipient == address(0)\n            ? (saleRecipient[_tokenId] == address(0) ? primarySaleRecipient() : saleRecipient[_tokenId])\n            : _primarySaleRecipient;\n\n        uint256 totalPrice = _quantityToClaim * _pricePerToken;\n        uint256 platformFees = (totalPrice * platformFeeBps) / MAX_BPS;\n\n        bool validMsgValue;\n        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {\n            validMsgValue = msg.value == totalPrice;\n        } else {\n            validMsgValue = msg.value == 0;\n        }\n        require(validMsgValue, \"!V\");\n\n        CurrencyTransferLib.transferCurrency(_currency, _msgSender(), platformFeeRecipient, platformFees);\n        CurrencyTransferLib.transferCurrency(_currency, _msgSender(), _saleRecipient, totalPrice - platformFees);\n    }\n\n    /// @dev Transfers the NFTs being claimed.\n    function transferTokensOnClaim(address _to, uint256 _tokenId, uint256 _quantityBeingClaimed) internal override {\n        _mint(_to, _tokenId, _quantityBeingClaimed, \"\");\n    }\n\n    /// @dev Checks whether platform fee info can be set in the given execution context.\n    function _canSetPlatformFeeInfo() internal view override returns (bool) {\n        return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());\n    }\n\n    /// @dev Checks whether primary sale recipient can be set in the given execution context.\n    function _canSetPrimarySaleRecipient() internal view override returns (bool) {\n        return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());\n    }\n\n    /// @dev Checks whether owner can be set in the given execution context.\n    function _canSetOwner() internal view override returns (bool) {\n        return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());\n    }\n\n    /// @dev Checks whether royalty info can be set in the given execution context.\n    function _canSetRoyaltyInfo() internal view override returns (bool) {\n        return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());\n    }\n\n    /// @dev Checks whether contract metadata can be set in the given execution context.\n    function _canSetContractURI() internal view override returns (bool) {\n        return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());\n    }\n\n    /// @dev Checks whether platform fee info can be set in the given execution context.\n    function _canSetClaimConditions() internal view override returns (bool) {\n        return hasRole(DEFAULT_ADMIN_ROLE, _msgSender());\n    }\n\n    /// @dev Returns whether lazy minting can be done in the given execution context.\n    function _canLazyMint() internal view virtual override returns (bool) {\n        return hasRole(minterRole, _msgSender());\n    }\n\n    /*///////////////////////////////////////////////////////////////\n                        Miscellaneous\n    //////////////////////////////////////////////////////////////*/\n\n    /// @dev The tokenId of the next NFT that will be minted / lazy minted.\n    function nextTokenIdToMint() external view returns (uint256) {\n        return nextTokenIdToLazyMint;\n    }\n\n    /// @dev Lets a token owner burn multiple tokens they own at once (i.e. destroy for good)\n    function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual {\n        require(\n            account == _msgSender() || isApprovedForAll(account, _msgSender()),\n            \"ERC1155: caller is not owner nor approved.\"\n        );\n\n        _burnBatch(account, ids, values);\n    }\n\n    /**\n     * @dev See {ERC1155-_beforeTokenTransfer}.\n     */\n    function _beforeTokenTransfer(\n        address operator,\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual override {\n        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n        // if transfer is restricted on the contract, we still want to allow burning and minting\n        if (!hasRole(transferRole, address(0)) && from != address(0) && to != address(0)) {\n            require(hasRole(transferRole, from) || hasRole(transferRole, to), \"restricted to TRANSFER_ROLE holders.\");\n        }\n\n        if (from == address(0)) {\n            for (uint256 i = 0; i < ids.length; ++i) {\n                totalSupply[ids[i]] += amounts[i];\n            }\n        }\n\n        if (to == address(0)) {\n            for (uint256 i = 0; i < ids.length; ++i) {\n                totalSupply[ids[i]] -= amounts[i];\n            }\n        }\n    }\n\n    function _dropMsgSender() internal view virtual override returns (address) {\n        return _msgSender();\n    }\n\n    function _msgSender()\n        internal\n        view\n        virtual\n        override(ContextUpgradeable, ERC2771ContextUpgradeable, Multicall)\n        returns (address sender)\n    {\n        return ERC2771ContextUpgradeable._msgSender();\n    }\n\n    function _msgData()\n        internal\n        view\n        virtual\n        override(ContextUpgradeable, ERC2771ContextUpgradeable)\n        returns (bytes calldata)\n    {\n        return ERC2771ContextUpgradeable._msgData();\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC2981Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981Upgradeable is IERC165Upgradeable {\n    /**\n     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.\n     */\n    function royaltyInfo(\n        uint256 tokenId,\n        uint256 salePrice\n    ) external view returns (address receiver, uint256 royaltyAmount);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n            \"Initializable: contract is already initialized\"\n        );\n        _initialized = 1;\n        if (isTopLevelCall) {\n            _initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            _initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: setting the version to 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n        _initialized = version;\n        _initializing = true;\n        _;\n        _initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized != type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _initializing;\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155Upgradeable.sol\";\nimport \"./IERC1155ReceiverUpgradeable.sol\";\nimport \"./extensions/IERC1155MetadataURIUpgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/ContextUpgradeable.sol\";\nimport \"../../utils/introspection/ERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {\n    using AddressUpgradeable for address;\n\n    // Mapping from token ID to account balances\n    mapping(uint256 => mapping(address => uint256)) private _balances;\n\n    // Mapping from account to operator approvals\n    mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n    string private _uri;\n\n    /**\n     * @dev See {_setURI}.\n     */\n    function __ERC1155_init(string memory uri_) internal onlyInitializing {\n        __ERC1155_init_unchained(uri_);\n    }\n\n    function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {\n        _setURI(uri_);\n    }\n\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {\n        return\n            interfaceId == type(IERC1155Upgradeable).interfaceId ||\n            interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId ||\n            super.supportsInterface(interfaceId);\n    }\n\n    /**\n     * @dev See {IERC1155MetadataURI-uri}.\n     *\n     * This implementation returns the same URI for *all* token types. It relies\n     * on the token type ID substitution mechanism\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n     *\n     * Clients calling this function must replace the `\\{id\\}` substring with the\n     * actual token type ID.\n     */\n    function uri(uint256) public view virtual override returns (string memory) {\n        return _uri;\n    }\n\n    /**\n     * @dev See {IERC1155-balanceOf}.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n        require(account != address(0), \"ERC1155: address zero is not a valid owner\");\n        return _balances[id][account];\n    }\n\n    /**\n     * @dev See {IERC1155-balanceOfBatch}.\n     *\n     * Requirements:\n     *\n     * - `accounts` and `ids` must have the same length.\n     */\n    function balanceOfBatch(\n        address[] memory accounts,\n        uint256[] memory ids\n    ) public view virtual override returns (uint256[] memory) {\n        require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n        uint256[] memory batchBalances = new uint256[](accounts.length);\n\n        for (uint256 i = 0; i < accounts.length; ++i) {\n            batchBalances[i] = balanceOf(accounts[i], ids[i]);\n        }\n\n        return batchBalances;\n    }\n\n    /**\n     * @dev See {IERC1155-setApprovalForAll}.\n     */\n    function setApprovalForAll(address operator, bool approved) public virtual override {\n        _setApprovalForAll(_msgSender(), operator, approved);\n    }\n\n    /**\n     * @dev See {IERC1155-isApprovedForAll}.\n     */\n    function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n        return _operatorApprovals[account][operator];\n    }\n\n    /**\n     * @dev See {IERC1155-safeTransferFrom}.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes memory data\n    ) public virtual override {\n        require(\n            from == _msgSender() || isApprovedForAll(from, _msgSender()),\n            \"ERC1155: caller is not token owner or approved\"\n        );\n        _safeTransferFrom(from, to, id, amount, data);\n    }\n\n    /**\n     * @dev See {IERC1155-safeBatchTransferFrom}.\n     */\n    function safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) public virtual override {\n        require(\n            from == _msgSender() || isApprovedForAll(from, _msgSender()),\n            \"ERC1155: caller is not token owner or approved\"\n        );\n        _safeBatchTransferFrom(from, to, ids, amounts, data);\n    }\n\n    /**\n     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - `from` must have a balance of tokens of type `id` of at least `amount`.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n     * acceptance magic value.\n     */\n    function _safeTransferFrom(\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes memory data\n    ) internal virtual {\n        require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n        address operator = _msgSender();\n        uint256[] memory ids = _asSingletonArray(id);\n        uint256[] memory amounts = _asSingletonArray(amount);\n\n        _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n        uint256 fromBalance = _balances[id][from];\n        require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n        unchecked {\n            _balances[id][from] = fromBalance - amount;\n        }\n        _balances[id][to] += amount;\n\n        emit TransferSingle(operator, from, to, id, amount);\n\n        _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n    }\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n     * acceptance magic value.\n     */\n    function _safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {\n        require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n        require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n        address operator = _msgSender();\n\n        _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n        for (uint256 i = 0; i < ids.length; ++i) {\n            uint256 id = ids[i];\n            uint256 amount = amounts[i];\n\n            uint256 fromBalance = _balances[id][from];\n            require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n            unchecked {\n                _balances[id][from] = fromBalance - amount;\n            }\n            _balances[id][to] += amount;\n        }\n\n        emit TransferBatch(operator, from, to, ids, amounts);\n\n        _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n    }\n\n    /**\n     * @dev Sets a new URI for all token types, by relying on the token type ID\n     * substitution mechanism\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n     *\n     * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n     * URI or any of the amounts in the JSON file at said URI will be replaced by\n     * clients with the token type ID.\n     *\n     * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n     * interpreted by clients as\n     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n     * for token type ID 0x4cce0.\n     *\n     * See {uri}.\n     *\n     * Because these URIs cannot be meaningfully represented by the {URI} event,\n     * this function emits no events.\n     */\n    function _setURI(string memory newuri) internal virtual {\n        _uri = newuri;\n    }\n\n    /**\n     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n     * acceptance magic value.\n     */\n    function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {\n        require(to != address(0), \"ERC1155: mint to the zero address\");\n\n        address operator = _msgSender();\n        uint256[] memory ids = _asSingletonArray(id);\n        uint256[] memory amounts = _asSingletonArray(amount);\n\n        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n        _balances[id][to] += amount;\n        emit TransferSingle(operator, address(0), to, id, amount);\n\n        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n    }\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - `ids` and `amounts` must have the same length.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n     * acceptance magic value.\n     */\n    function _mintBatch(\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {\n        require(to != address(0), \"ERC1155: mint to the zero address\");\n        require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n        address operator = _msgSender();\n\n        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n        for (uint256 i = 0; i < ids.length; i++) {\n            _balances[ids[i]][to] += amounts[i];\n        }\n\n        emit TransferBatch(operator, address(0), to, ids, amounts);\n\n        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n    }\n\n    /**\n     * @dev Destroys `amount` tokens of token type `id` from `from`\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `from` must have at least `amount` tokens of token type `id`.\n     */\n    function _burn(address from, uint256 id, uint256 amount) internal virtual {\n        require(from != address(0), \"ERC1155: burn from the zero address\");\n\n        address operator = _msgSender();\n        uint256[] memory ids = _asSingletonArray(id);\n        uint256[] memory amounts = _asSingletonArray(amount);\n\n        _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n        uint256 fromBalance = _balances[id][from];\n        require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n        unchecked {\n            _balances[id][from] = fromBalance - amount;\n        }\n\n        emit TransferSingle(operator, from, address(0), id, amount);\n\n        _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n    }\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - `ids` and `amounts` must have the same length.\n     */\n    function _burnBatch(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual {\n        require(from != address(0), \"ERC1155: burn from the zero address\");\n        require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n        address operator = _msgSender();\n\n        _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n        for (uint256 i = 0; i < ids.length; i++) {\n            uint256 id = ids[i];\n            uint256 amount = amounts[i];\n\n            uint256 fromBalance = _balances[id][from];\n            require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n            unchecked {\n                _balances[id][from] = fromBalance - amount;\n            }\n        }\n\n        emit TransferBatch(operator, from, address(0), ids, amounts);\n\n        _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n    }\n\n    /**\n     * @dev Approve `operator` to operate on all of `owner` tokens\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n        require(owner != operator, \"ERC1155: setting approval status for self\");\n        _operatorApprovals[owner][operator] = approved;\n        emit ApprovalForAll(owner, operator, approved);\n    }\n\n    /**\n     * @dev Hook that is called before any token transfer. This includes minting\n     * and burning, as well as batched variants.\n     *\n     * The same hook is called on both single and batched variants. For single\n     * transfers, the length of the `ids` and `amounts` arrays will be 1.\n     *\n     * Calling conditions (for each `id` and `amount` pair):\n     *\n     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * of token type `id` will be  transferred to `to`.\n     * - When `from` is zero, `amount` tokens of token type `id` will be minted\n     * for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n     * will be burned.\n     * - `from` and `to` are never both zero.\n     * - `ids` and `amounts` have the same, non-zero length.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _beforeTokenTransfer(\n        address operator,\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {}\n\n    /**\n     * @dev Hook that is called after any token transfer. This includes minting\n     * and burning, as well as batched variants.\n     *\n     * The same hook is called on both single and batched variants. For single\n     * transfers, the length of the `id` and `amount` arrays will be 1.\n     *\n     * Calling conditions (for each `id` and `amount` pair):\n     *\n     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n     * of token type `id` will be  transferred to `to`.\n     * - When `from` is zero, `amount` tokens of token type `id` will be minted\n     * for `to`.\n     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n     * will be burned.\n     * - `from` and `to` are never both zero.\n     * - `ids` and `amounts` have the same, non-zero length.\n     *\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n     */\n    function _afterTokenTransfer(\n        address operator,\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) internal virtual {}\n\n    function _doSafeTransferAcceptanceCheck(\n        address operator,\n        address from,\n        address to,\n        uint256 id,\n        uint256 amount,\n        bytes memory data\n    ) private {\n        if (to.isContract()) {\n            try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n                if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) {\n                    revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n                }\n            } catch Error(string memory reason) {\n                revert(reason);\n            } catch {\n                revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n            }\n        }\n    }\n\n    function _doSafeBatchTransferAcceptanceCheck(\n        address operator,\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) private {\n        if (to.isContract()) {\n            try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n                bytes4 response\n            ) {\n                if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) {\n                    revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n                }\n            } catch Error(string memory reason) {\n                revert(reason);\n            } catch {\n                revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n            }\n        }\n    }\n\n    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n        uint256[] memory array = new uint256[](1);\n        array[0] = element;\n\n        return array;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[47] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/IERC1155ReceiverUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155ReceiverUpgradeable is IERC165Upgradeable {\n    /**\n     * @dev Handles the receipt of a single ERC1155 token type. This function is\n     * called at the end of a `safeTransferFrom` after the balance has been updated.\n     *\n     * NOTE: To accept the transfer, this must return\n     * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n     * (i.e. 0xf23a6e61, or its own function selector).\n     *\n     * @param operator The address which initiated the transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param id The ID of the token being transferred\n     * @param value The amount of tokens being transferred\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n     */\n    function onERC1155Received(\n        address operator,\n        address from,\n        uint256 id,\n        uint256 value,\n        bytes calldata data\n    ) external returns (bytes4);\n\n    /**\n     * @dev Handles the receipt of a multiple ERC1155 token types. This function\n     * is called at the end of a `safeBatchTransferFrom` after the balances have\n     * been updated.\n     *\n     * NOTE: To accept the transfer(s), this must return\n     * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n     * (i.e. 0xbc197c81, or its own function selector).\n     *\n     * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n     * @param from The address which previously owned the token\n     * @param ids An array containing ids of each token being transferred (order and length must match values array)\n     * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n     * @param data Additional data with no specified format\n     * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n     */\n    function onERC1155BatchReceived(\n        address operator,\n        address from,\n        uint256[] calldata ids,\n        uint256[] calldata values,\n        bytes calldata data\n    ) external returns (bytes4);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/IERC1155Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155Upgradeable is IERC165Upgradeable {\n    /**\n     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n     */\n    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n    /**\n     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n     * transfers.\n     */\n    event TransferBatch(\n        address indexed operator,\n        address indexed from,\n        address indexed to,\n        uint256[] ids,\n        uint256[] values\n    );\n\n    /**\n     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n     * `approved`.\n     */\n    event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n    /**\n     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n     *\n     * If an {URI} event was emitted for `id`, the standard\n     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n     * returned by {IERC1155MetadataURI-uri}.\n     */\n    event URI(string value, uint256 indexed id);\n\n    /**\n     * @dev Returns the amount of tokens of token type `id` owned by `account`.\n     *\n     * Requirements:\n     *\n     * - `account` cannot be the zero address.\n     */\n    function balanceOf(address account, uint256 id) external view returns (uint256);\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n     *\n     * Requirements:\n     *\n     * - `accounts` and `ids` must have the same length.\n     */\n    function balanceOfBatch(\n        address[] calldata accounts,\n        uint256[] calldata ids\n    ) external view returns (uint256[] memory);\n\n    /**\n     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n     *\n     * Emits an {ApprovalForAll} event.\n     *\n     * Requirements:\n     *\n     * - `operator` cannot be the caller.\n     */\n    function setApprovalForAll(address operator, bool approved) external;\n\n    /**\n     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n     *\n     * See {setApprovalForAll}.\n     */\n    function isApprovedForAll(address account, address operator) external view returns (bool);\n\n    /**\n     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n     *\n     * Emits a {TransferSingle} event.\n     *\n     * Requirements:\n     *\n     * - `to` cannot be the zero address.\n     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n     * - `from` must have a balance of tokens of type `id` of at least `amount`.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n     * acceptance magic value.\n     */\n    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;\n\n    /**\n     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n     *\n     * Emits a {TransferBatch} event.\n     *\n     * Requirements:\n     *\n     * - `ids` and `amounts` must have the same length.\n     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n     * acceptance magic value.\n     */\n    function safeBatchTransferFrom(\n        address from,\n        address to,\n        uint256[] calldata ids,\n        uint256[] calldata amounts,\n        bytes calldata data\n    ) external;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155Upgradeable.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable {\n    /**\n     * @dev Returns the URI for token type `id`.\n     *\n     * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n     * clients with the actual token type ID.\n     */\n    function uri(uint256 id) external view returns (string memory);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/StringsUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\nimport \"./math/SignedMathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n    bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n    uint8 private constant _ADDRESS_LENGTH = 20;\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            uint256 length = MathUpgradeable.log10(value) + 1;\n            string memory buffer = new string(length);\n            uint256 ptr;\n            /// @solidity memory-safe-assembly\n            assembly {\n                ptr := add(buffer, add(32, length))\n            }\n            while (true) {\n                ptr--;\n                /// @solidity memory-safe-assembly\n                assembly {\n                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n                }\n                value /= 10;\n                if (value == 0) break;\n            }\n            return buffer;\n        }\n    }\n\n    /**\n     * @dev Converts a `int256` to its ASCII `string` decimal representation.\n     */\n    function toString(int256 value) internal pure returns (string memory) {\n        return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMathUpgradeable.abs(value))));\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        unchecked {\n            return toHexString(value, MathUpgradeable.log256(value) + 1);\n        }\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n     */\n    function toHexString(address addr) internal pure returns (string memory) {\n        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n    }\n\n    /**\n     * @dev Returns true if the two strings are equal.\n     */\n    function equal(string memory a, string memory b) internal pure returns (bool) {\n        return keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {\n    function __ERC165_init() internal onlyInitializing {\n    }\n\n    function __ERC165_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev See {IERC165-supportsInterface}.\n     */\n    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n        return interfaceId == type(IERC165Upgradeable).interfaceId;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/IERC165Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165Upgradeable {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/math/MathUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary MathUpgradeable {\n    enum Rounding {\n        Down, // Toward negative infinity\n        Up, // Toward infinity\n        Zero // Toward zero\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds up instead\n     * of rounding down.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b - 1) / b can overflow on addition, so we distribute.\n        return a == 0 ? 0 : (a - 1) / b + 1;\n    }\n\n    /**\n     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n     * with further edits by Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n            // variables such that product = prod1 * 2^256 + prod0.\n            uint256 prod0; // Least significant 256 bits of the product\n            uint256 prod1; // Most significant 256 bits of the product\n            assembly {\n                let mm := mulmod(x, y, not(0))\n                prod0 := mul(x, y)\n                prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n            }\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (prod1 == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return prod0 / denominator;\n            }\n\n            // Make sure the result is less than 2^256. Also prevents denominator == 0.\n            require(denominator > prod1, \"Math: mulDiv overflow\");\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [prod1 prod0].\n            uint256 remainder;\n            assembly {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                prod1 := sub(prod1, gt(remainder, prod0))\n                prod0 := sub(prod0, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n            // See https://cs.stackexchange.com/q/138556/92363.\n\n            // Does not overflow because the denominator cannot be zero at this stage in the function.\n            uint256 twos = denominator & (~denominator + 1);\n            assembly {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [prod1 prod0] by twos.\n                prod0 := div(prod0, twos)\n\n                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from prod1 into prod0.\n            prod0 |= prod1 * twos;\n\n            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv = 1 mod 2^4.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n            // in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2^8\n            inverse *= 2 - denominator * inverse; // inverse mod 2^16\n            inverse *= 2 - denominator * inverse; // inverse mod 2^32\n            inverse *= 2 - denominator * inverse; // inverse mod 2^64\n            inverse *= 2 - denominator * inverse; // inverse mod 2^128\n            inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n            // is no longer required.\n            result = prod0 * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        uint256 result = mulDiv(x, y, denominator);\n        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n            result += 1;\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n     *\n     * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        if (a == 0) {\n            return 0;\n        }\n\n        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n        //\n        // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n        //\n        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n        //\n        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n        uint256 result = 1 << (log2(a) >> 1);\n\n        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n        // into the expected uint128 result.\n        unchecked {\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            result = (result + a / result) >> 1;\n            return min(result, a / result);\n        }\n    }\n\n    /**\n     * @notice Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 128;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 64;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 32;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 16;\n            }\n            if (value >> 8 > 0) {\n                value >>= 8;\n                result += 8;\n            }\n            if (value >> 4 > 0) {\n                value >>= 4;\n                result += 4;\n            }\n            if (value >> 2 > 0) {\n                value >>= 2;\n                result += 2;\n            }\n            if (value >> 1 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256, rounded down, of a positive value.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >> 128 > 0) {\n                value >>= 128;\n                result += 16;\n            }\n            if (value >> 64 > 0) {\n                value >>= 64;\n                result += 8;\n            }\n            if (value >> 32 > 0) {\n                value >>= 32;\n                result += 4;\n            }\n            if (value >> 16 > 0) {\n                value >>= 16;\n                result += 2;\n            }\n            if (value >> 8 > 0) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts-upgradeable/contracts/utils/math/SignedMathUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMathUpgradeable {\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return a > b ? a : b;\n    }\n\n    /**\n     * @dev Returns the smallest of two signed numbers.\n     */\n    function min(int256 a, int256 b) internal pure returns (int256) {\n        return a < b ? a : b;\n    }\n\n    /**\n     * @dev Returns the average of two signed numbers without overflow.\n     * The result is rounded towards zero.\n     */\n    function average(int256 a, int256 b) internal pure returns (int256) {\n        // Formula from the book \"Hacker's Delight\"\n        int256 x = (a & b) + ((a ^ b) >> 1);\n        return x + (int256(uint256(x) >> 255) & (a ^ b));\n    }\n\n    /**\n     * @dev Returns the absolute unsigned value of a signed value.\n     */\n    function abs(int256 n) internal pure returns (uint256) {\n        unchecked {\n            // must be unchecked in order to support `n = type(int256).min`\n            return uint256(n >= 0 ? n : -n);\n        }\n    }\n}\n"
      },
      "lib/openzeppelin-contracts/contracts/utils/Address.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     *\n     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n     *\n     * _Available since v4.8._\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        if (success) {\n            if (returndata.length == 0) {\n                // only check isContract if the call was successful and the return data is empty\n                // otherwise we already know that it was a contract\n                require(isContract(target), \"Address: call to non-contract\");\n            }\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason or using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata, errorMessage);\n        }\n    }\n\n    function _revert(bytes memory returndata, string memory errorMessage) private pure {\n        // Look for revert reason and bubble it up if present\n        if (returndata.length > 0) {\n            // The easiest way to bubble the revert reason is using memory via assembly\n            /// @solidity memory-safe-assembly\n            assembly {\n                let returndata_size := mload(returndata)\n                revert(add(32, returndata), returndata_size)\n            }\n        } else {\n            revert(errorMessage);\n        }\n    }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 20
      },
      "evmVersion": "london",
      "remappings": [
        ":@chainlink/=lib/chainlink/",
        ":@ds-test/=lib/ds-test/src/",
        ":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
        ":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
        ":@std/=lib/forge-std/src/",
        ":@thirdweb-dev/dynamic-contracts/=lib/dynamic-contracts/",
        ":ERC721A-Upgradeable/=lib/ERC721A-Upgradeable/contracts/",
        ":ERC721A/=lib/ERC721A/contracts/",
        ":chainlink/=lib/chainlink/contracts/",
        ":contracts/=contracts/",
        ":ds-test/=lib/ds-test/src/",
        ":dynamic-contracts/=lib/dynamic-contracts/src/",
        ":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
        ":erc721a-upgradeable/=lib/ERC721A-Upgradeable/",
        ":erc721a/=lib/ERC721A/",
        ":forge-std/=lib/forge-std/src/",
        ":lib/sstore2/=lib/dynamic-contracts/lib/sstore2/",
        ":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
        ":openzeppelin-contracts/=lib/openzeppelin-contracts/",
        ":openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/",
        ":sstore2/=lib/dynamic-contracts/lib/sstore2/contracts/"
      ],
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}