creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\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[49] private __gap;\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/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"
      },
      "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    bool private _paused;\n\n    /**\n     * @dev Initializes the contract in unpaused state.\n     */\n    function __Pausable_init() internal onlyInitializing {\n        __Pausable_init_unchained();\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n        _paused = false;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        return _paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        require(!paused(), \"Pausable: paused\");\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        require(paused(), \"Pausable: not paused\");\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        _paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        _paused = false;\n        emit Unpaused(_msgSender());\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[49] private __gap;\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721Upgradeable is IERC165Upgradeable {\n    /**\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n     */\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n     */\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n    /**\n     * @dev Returns the number of tokens in ``owner``'s account.\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId) external view returns (address owner);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n     * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Transfers `tokenId` token from `from` to `to`.\n     *\n     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n     * understand this adds an external call which potentially creates a reentrancy vulnerability.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 tokenId) external;\n\n    /**\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n     * The approval is cleared when the token is transferred.\n     *\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n     *\n     * Requirements:\n     *\n     * - The caller must own the token or be an approved operator.\n     * - `tokenId` must exist.\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address to, uint256 tokenId) external;\n\n    /**\n     * @dev Approve or remove `operator` as an operator for the caller.\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n     *\n     * Requirements:\n     *\n     * - The `operator` cannot be the caller.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function setApprovalForAll(address operator, bool approved) external;\n\n    /**\n     * @dev Returns the account approved for `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function getApproved(uint256 tokenId) external view returns (address operator);\n\n    /**\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n     *\n     * See {setApprovalForAll}\n     */\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/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"
      },
      "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport {Initializable} from \"../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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\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"
      },
      "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n */\nlibrary CountersUpgradeable {\n    struct Counter {\n        // This variable should never be directly accessed by users of the library: interactions must be restricted to\n        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n        // this feature: see https://github.com/ethereum/solidity/issues/4637\n        uint256 _value; // default: 0\n    }\n\n    function current(Counter storage counter) internal view returns (uint256) {\n        return counter._value;\n    }\n\n    function increment(Counter storage counter) internal {\n        unchecked {\n            counter._value += 1;\n        }\n    }\n\n    function decrement(Counter storage counter) internal {\n        uint256 value = counter._value;\n        require(value > 0, \"Counter: decrement overflow\");\n        unchecked {\n            counter._value = value - 1;\n        }\n    }\n\n    function reset(Counter storage counter) internal {\n        counter._value = 0;\n    }\n}\n"
      },
      "@openzeppelin/contracts-upgradeable/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"
      },
      "contracts/interfaces/IFeeDistributor.sol": {
        "content": "// SPDX-License-Identifier: UNLICSENSED\npragma solidity 0.8.18;\n\ninterface IFeeDistributor {\n    /**\n     * @dev Defines a fee item during a fee distribution request. It specifies\n     * the following fields:\n     * - `payee` who should receve a fee transfer\n     * - `token` symbol (e.g. ETH, MATIC, USDC, APE)\n     * - `amount` which the `payee` should receive\n     */\n    struct Fee {\n        address payable payee;\n        bytes32 token;\n        uint256 amount;\n    }\n\n    /**\n     * @dev Emitted when some Ether amount received by the current contract.\n     */\n    event EtherReceived(address sender, uint256 value);\n\n    /**\n     * @dev Emitted when a limit of fee item count is set for a given caller.\n     */\n    event FeeCountLimitSet(uint256 feeCountLimit);\n\n    /**\n     * @dev Emitted when an ERC20 token used for fee distribution is registered.\n     */\n    event TokenAddressSet(bytes32 tokenSymbol, address tokenAddress);\n\n    /**\n     * @dev Emitted when fees are distributed for a given caller.\n     */\n    event FeesDistributed(uint256 feeCount);\n\n    /**\n     * @dev Fee item count exceeded an upper boundary for a given caller.\n     */\n    error FeeCountLimitExceeded(uint256 feeCount);\n\n    /**\n     * @dev Sets an item limit for each fee distribution request. The limit is specific for\n     * each caller. If the limit is not set, the contract-wide default value is used.\n     *\n     * Emits a {FeeCountLimitSet} event.\n     */\n    function setFeeCountLimit(address contractAddress, uint256 feeCountLimit) external;\n\n    /**\n     * @dev Set an ERC20 token which is allowed to be used for fee distribution.\n     *\n     * Emits a {TokenAddressSet} event.\n     */\n    function setTokenAddress(bytes32 tokenSymbol, address tokenAddress) external;\n\n    /**\n     * @dev Pauses the current contract, e.g. in case of an emergency.\n     *\n     * Emits a {Paused} event.\n     */\n    function pause() external;\n\n    /**\n     * @dev Unpauses the current contract.\n     *\n     * Emits an {Unpaused} event.\n     */\n    function unpause() external;\n\n    /**\n     * @dev Distributes fees, which can be expressed both in a native token\n     * (e.g. Ether, Matic) and/or in a registered ERC20 token. Native and ERC20 fee\n     * distributions can be intermixed in a single request.\n     *\n     * Requirements:\n     *\n     * - the `fees` item count is limited for each caller. If the limit for a caller\n     * is not specified, the contract-wide default value is used.\n     *\n     * WARNING: If a caller sends some excessive native token amount, it is locked up\n     * in an escrow. This amount can be released further by executing\n     * `withdrawPayments` method for the given caller.\n     *\n     * Emits a {FeesDistributed} event.\n     *\n     * Also, can emit an {EtherReceived} event if a caller sends an execessive native\n     * token amount.\n     */\n    function distributeFees(Fee[] calldata fees) external payable;\n\n    /**\n     * @dev Returns the token address by its symbol.\n     */\n    function tokenAddresses(bytes32 tokenSymbol) external view returns (address);\n}\n"
      },
      "contracts/interfaces/IHotWallet.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\ninterface IHotWallet {\n    function getHotWallet(address coldWallet) external view returns (address);\n\n    function balanceOf(address contractAddress, address owner) external view returns (uint256);\n\n    function ownerOf(address contractAddress, uint256 tokenId) external view returns (address);\n}\n"
      },
      "contracts/interfaces/IIncinerator.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\nimport { IFeeDistributor } from \"./IFeeDistributor.sol\";\n\ninterface IIncinerator {\n    /**\n     * @dev Defines parameters to burn items:\n     *  - `transactionId` is an transaction identifier required to track it on\n     *    the caller's side.\n     *  - `deduplicationId` is the deduplication group identifier used to check\n     *     maximum usage of a given token.\n     *  - `maxUsage` is the maximum usage allowed for a given token.\n     *  - `nftItems` is a list of NFT items.\n     *  - `deadline` is a timestamp when a request is expired.\n     *  - `fees` is an optional list of fees to be distributed between payees.\n     */\n    struct BurnItemsParams {\n        uint256 transactionId;\n        uint256 deduplicationId;\n        uint256 maxUsage;\n        NFTItem[] nftItems;\n        uint256 deadline;\n        IFeeDistributor.Fee[] fees;\n    }\n\n    /**\n     * @dev Defines parameters to permit to burn items:\n     *  - `transactionId` is an transaction identifier required to track it on\n     *    the caller's side.\n     *  - `deduplicationId` is the deduplication group identifier used to check\n     *     maximum usage of a given token.\n     *  - `maxUsage` is the maximum usage allowed for a given token.\n     *  - `nftItems` is a list of NFT items.\n     *  - `deadline` is a timestamp when a request is expired.\n     *  - `fees` is an optional list of fees to be distributed between payees.\n     *  - `message` is a message signed on the caller's side.\n     */\n    struct PermitBurnItemsParams {\n        uint256 transactionId;\n        uint256 deduplicationId;\n        uint256 maxUsage;\n        NFTItem[] nftItems;\n        uint256 deadline;\n        IFeeDistributor.Fee[] fees;\n        Message message;\n    }\n\n    /**\n     * @dev Defines data required to burn a token within an NFT collection\n     *  - `collection` is the address of an NFT collection.\n     *  - `tokenId` is the token identifier within this NFT collection.\n     */\n    struct NFTItem {\n        address collection;\n        uint256 tokenId;\n    }\n\n    /**\n     * @dev Defines data required to burn items with a permit. See\n     * the {permitBurnItems} method for more details.\n     *  - `hash` is a hash signed by a user.\n     *  - `signature` is a user's signatured.\n     */\n    struct Message {\n        bytes32 hash;\n        bytes signature;\n    }\n\n    /**\n     * @dev Emitted when some Ether amount received by the current contract.\n     */\n    event EtherReceived(address sender, uint256 value);\n\n    /**\n     * @dev Emitted when the address of a verifier contract is set.\n     */\n    event VerifierSet(address indexed verifier);\n\n    /**\n     * @dev Emitted when an allowed range of tokens to be burnt.\n     *\n     * Emits an {NFTItemRangeSet} event.\n     */\n    event NFTItemRangeSet(uint8[2] nftItemRange);\n\n    /**\n     * @dev Emitted when the address of a NFT operator contract is set.\n     */\n    event NFTOperatorSet(address indexed nftOperator);\n\n    /**\n     * @dev Emitted when the address of a fee distributor contract is set.\n     */\n    event FeeDistributorSet(address indexed feeDistributor);\n\n    /**\n     * @dev Emitted when a group of tokens burnt within an NFT collection.\n     */\n    event TokensBurnt(uint256 nftItemCount);\n\n    /**\n     * @dev Emitted when a group of tokens burnt within an NFT collection.\n     */\n    event TransactionProcessed(uint256 indexed transactionId);\n\n    /**\n     * @dev The zero address of a verifier contract is given.\n     */\n    error ZeroVerifier();\n\n    /**\n     * @dev The zero address of an NFT operator contract is given.\n     */\n    error ZeroNFTOperator();\n\n    /**\n     * @dev The zero address of a fee distributor contract is given.\n     */\n    error ZeroFeeDistributor();\n\n    /**\n     * @dev A request dealine exceeds the current block timestamp.\n     */\n    error DeadlineExceeded(uint256 currentTimestamp, uint256 deadline);\n\n    /**\n     * @dev The item count is out of an allowed range.\n     */\n    error NFTItemRangeMissed(uint8[2] nftItemRange, uint256 currentNFTItemCount);\n\n    /**\n     * @dev The lower boundary of an item range is greater than the upper one.\n     */\n    error InconsistentNFTItemRange(uint8[2] nftItemRange);\n\n    /**\n     * @dev The upper boundary for token burns within a certain deduplication group\n     * identifier is reached.\n     */\n    error MaxItemUsageReached(uint256 deduplicationId, uint256 currentUsage);\n\n    /**\n     * @dev An invalid NFT owner attempts to burn a token with a permit.\n     */\n    error InvalidNFTOwner(address collection, uint256 tokenId, address currentOwner, address claimedOnwer);\n\n    /**\n     * @dev Sets the address of a verifier contract, which allows to verify\n     * signatures restricted to authorized callers only.\n     *\n     * Emits a {VerifierSet} event.\n     */\n    function setVerifier(address verifier) external;\n\n    /**\n     * @dev Sets an allowed range of tokens to be burnt.\n     *\n     * Emits an {NFTItemRangeSet} event.\n     */\n    function setNFTItemRange(uint8[2] calldata nftItemRange) external;\n\n    /**\n     * @dev Sets the address of an NFT oeperator contract, which manages token\n     * approvals.\n     *\n     * Emits an {NFTOperatorSet} event.\n     */\n    function setNFTOperator(address nftOperator) external;\n\n    /**\n     * @dev Sets the address of a fee distributor contract, which handles fee\n     * distribution from a caller.\n     *\n     * Emits a {FeeDistributor} event.\n     */\n    function setFeeDistributor(address feeDistributor) external;\n\n    /**\n     * @dev Pauses the current contract, e.g. in case of an emergency.\n     *\n     * Emits a {Paused} event.\n     */\n    function pause() external;\n\n    /**\n     * @dev Unpauses the current contract.\n     *\n     * Emits an {Unpaused} event.\n     */\n    function unpause() external;\n\n    /**\n     * @dev Handles token burning within an NFT collection.\n     *\n     * Requirements:\n     *\n     * - Before calling this method, it is required to generate a hash from a getter\n     *   with corresponding parameters and sign it by an authorized caller registered\n     *   on the {Verifier} contract.\n     *\n     * Emits {TokensBurnt} and {TransactionProcessed} events.\n     */\n    function burnItems(BurnItemsParams calldata params, bytes calldata signature) external payable;\n\n    /**\n     * @dev Handles token burning within an NFT collection with a permit, i.e. it\n     * it is required to provide a user's signatures to enable gasless transactions.\n     *\n     * Requirements:\n     *\n     * - Before calling this method, it is required to generate a hash from a getter\n     *   with corresponding parameters and sign it by an authorized caller registered\n     *   on the {Verifier} contract.\n     *\n     * Emits {TokensBurnt} and {TransactionProcessed} events.\n     */\n    function permitBurnItems(PermitBurnItemsParams calldata params, bytes calldata signature) external payable;\n\n    /**\n     * @dev Generates a hash in order to call the method to burn items.\n     */\n    function burnItemsHash(BurnItemsParams calldata params, address sender) external pure returns (bytes32);\n\n    /**\n     * @dev Generates a hash in order to call the method to burn items with a permit.\n     */\n    function permitBurnItemsHash(PermitBurnItemsParams calldata params, address sender) external pure returns (bytes32);\n}\n"
      },
      "contracts/interfaces/INFTFactory.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\nimport { CountersUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\";\nimport { IFeeDistributor } from \"./IFeeDistributor.sol\";\nimport { IRoyaltySplitter } from \"./IRoyaltySplitter.sol\";\n\ninterface INFTFactory {\n    /**\n     * @dev Defines parameters to create an NFT collection:\n     *  - `transactionId` is an transaction identifier required to track it on\n     *    the caller's side.\n     *  - `collectionsId` is an NFT collection identifier required to track it on\n     *    the caller's side.\n     *  - `name` is an NFT collection name.\n     *  - `symbol` is an NFT collection symbol.\n     *  - `itemLimit` is the upper boundary for token mints within an NFT collection.\n     *  - `deadline` is a timestamp when a request is expired.\n     *  - `royalites` is an optional list of royalties to be distributed between\n     *    payees with their shares at the collection wide level.\n     *  - `fees` is an optional list of fees to be distributed between payees.\n     */\n    struct CreateCollectionParams {\n        uint256 transactionId;\n        uint256 collectionId;\n        string name;\n        string symbol;\n        uint256 itemLimit;\n        uint256 deadline;\n        IRoyaltySplitter.Royalty[] royalties;\n        IFeeDistributor.Fee[] fees;\n    }\n\n    /**\n     * @dev Defines parameters to mint an item within an NFT collection:\n     *  - `transactionId` is an transaction identifier required to track it on\n     *    the caller's side.\n     *  - `collectionsId` is a NFT collection identifier required to track it on\n     *    the caller's side.\n     *  - `deduplicationId` is deduplication group identifier used to define\n     *    the upper boundary of token mints within an NFT collection.\n     *  - `maxItemSupply` is the maximum item limit set for a certain deduplication\n     *    group identifier.\n     *  - `tokenId` is a token identifier generated on the caller's side.\n     *  - `tokenReceiver` is an account which is intended to receive a token.\n     *  - `tokenURI` is a token URI generated on the caller's side.\n     *  - `deadline` is a timestamp when a request is expired.\n     *  - `royalites` is an optional list of royalties to be distributed between\n     *    payees with their shares at the token level.\n     *  - `fees` is an optional list of fees to be distributed between payees.\n     */\n    struct MintItemParams {\n        uint256 transactionId;\n        uint256 collectionId;\n        uint256 deduplicationId;\n        uint256 maxItemSupply;\n        uint256 tokenId;\n        address tokenReceiver;\n        string tokenURI;\n        uint256 deadline;\n        IRoyaltySplitter.Royalty[] royalties;\n        IFeeDistributor.Fee[] fees;\n    }\n\n    /**\n     * @dev Defines a registered NFT collection:\n     *  - `nft` is the address of an NFT collection.\n     *  - `itemLimit` is the upper boundary for token mints within an NFT collection.\n     *  - `itemCount` is the current number of token mints within an NFT collection.\n     */\n    struct Collection {\n        address nft;\n        uint256 itemLimit;\n        CountersUpgradeable.Counter itemCount;\n    }\n\n    /**\n     * @dev Emitted when some Ether amount received by the current contract.\n     */\n    event EtherReceived(address sender, uint256 value);\n\n    /**\n     * @dev Emitted when the address of a verifier contract is set.\n     */\n    event VerifierSet(address indexed verifier);\n\n    /**\n     * @dev Emitted when the address of an NFT deployer contract is set.\n     */\n    event NFTDeployerSet(address indexed nftDeployer);\n\n    /**\n     * @dev Emitted when the default royalty for an NFT collection is set.\n     */\n    event NFTDefaultRoyaltySet(uint256 indexed collectionId, address receiver, uint96 feeNumerator);\n\n    /**\n     * @dev Emitted when a token royalty for an NFT collection is set.\n     */\n    event NFTTokenRoyaltySet(\n        uint256 indexed collectionId,\n        uint256 indexed tokenId,\n        address receiver,\n        uint96 feeNumerator\n    );\n\n    /**\n     * @dev Emitted when the address of a royalty splitter contract is set.\n     */\n    event RoyaltySplitterSet(address indexed royaltySplitter);\n\n    /**\n     * @dev Emitted when the address of a fee distributor contract is set.\n     */\n    event FeeDistributorSet(address indexed feeDistributor);\n\n    /**\n     * @dev Emitted when a disablement status of an whitelist/blacklist registry for\n     * a registered NFT collection is set.\n     */\n    event NFTRegistryDisabled(uint256 indexed collectionId, bool registryDisabled);\n\n    /**\n     * @dev Emitted when ownership of a registered NFT collection is transferred to\n     * another account.\n     */\n    event NFTOwnershipTransferred(uint256 indexed collectionId, address newOwner);\n\n    /**\n     * @dev Emitted when the upper boundary for token mints within an NFT collection\n     * is set.\n     */\n    event MaxItemSupplySet(uint256 maxItemSupply);\n\n    /**\n     * @dev Emitted when an NFT collection is deployed into a blockchain.\n     */\n    event CollectionCreated(uint256 indexed collectionId);\n\n    /**\n     * @dev Emitted when a token is minted within an NFT collection.\n     */\n    event TokenMinted(uint256 indexed collectionId, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when either an NFT collection is created or a token within\n     * an NFT collection is minted.\n     */\n    event TransactionProcessed(uint256 indexed transactionId);\n\n    /**\n     * @dev Emitted when fees are distributed for a given caller.\n     */\n    event FeesDistributed(uint256 feeCount);\n\n    /**\n     * @dev The zero address of a verifier contract is given.\n     */\n    error ZeroVerifier();\n\n    /**\n     * @dev The zero address of a NFT deployer contract is given.\n     */\n    error ZeroNFTDeployer();\n\n    /**\n     * @dev The zero address of an royalty splitter contract is given.\n     */\n    error ZeroRoyaltySplitter();\n\n    /**\n     * @dev The zero address of a fee distributor contract is given.\n     */\n    error ZeroFeeDistributor();\n\n    /**\n     * @dev A request dealine exceeds the current block timestamp.\n     */\n    error DeadlineExceeded(uint256 currentTimestamp, uint256 deadline);\n\n    /**\n     * @dev An NFT collection has been already registered in the current contract.\n     */\n    error CollectionExists(uint256 collectionId);\n\n    /**\n     * @dev An NFT collection is not registred in the current contract.\n     */\n    error CollectionNotFound(uint256 collectionId);\n\n    /**\n     * @dev The maximum number of token mints within an NFT collection exceeds\n     * the allowed upper boundary.\n     */\n    error CollectionItemLimitExceeded(uint256 collectionId, uint256 currentItemCount);\n\n    /**\n     * @dev The maximum number of token mints within a deduplication group identifier\n     * exceeds the allowed upper boundary.\n     */\n    error ItemSupplyLimitExceeded(uint256 collectionId, uint256 deduplicationId, uint256 currentItemSupply);\n\n    /**\n     * @dev Sets the address of a verifier contract, which allows to verify\n     * signatures restricted to authorized callers only.\n     *\n     * Emits a {VerifierSet} event.\n     */\n    function setVerifier(address verifier) external;\n\n    /**\n     * @dev Sets the address of a NFT deployer contract, which is responsible for\n     * deployment of NFT collections into a blockchain.\n     *\n     * Emits an {NFTDeployerSet} event.\n     */\n    function setNFTDeployer(address nftDeployer) external;\n\n    /**\n     * @dev Sets the address of a royalty splitter contract, which manages royalty\n     * shares for created NFT collections and tokens related to them.\n     *\n     * Emits a {RoyaltySplitterSet} event.\n     */\n    function setRoyaltySplitter(address royaltySplitter) external;\n\n    /**\n     * @dev Sets the address of a fee distributor contract, which handles any fee\n     * transfers connected with NFT collection creation and a token mint.\n     *\n     * Emits a {FeeDistributorSet} event.\n     */\n    function setFeeDistributor(address feeDistributor) external;\n\n    /**\n     * @dev Pauses the current contract, e.g. in case of an emergency.\n     *\n     * Emits a {Paused} event.\n     */\n    function pause() external;\n\n    /**\n     * @dev Unpauses the current contract.\n     *\n     * Emits an {Unpaused} event.\n     */\n    function unpause() external;\n\n    /**\n     * @dev Sets the disablement status of a whitelist/blacklist registry in an NFT\n     * collection registered in the current contract.\n     *\n     * Emits an {NFTRegistryDisabled} event.\n     */\n    function setNFTRegistryDisabled(uint256 collectionId, bool registryDisabled) external;\n\n    /**\n     * @dev Sets the default royalty for a given NFT collection.\n     *\n     * Emits an {NFTDefaultRoyaltySet} event.\n     */\n    function setNFTDefaultRoyalty(uint256 collectionId, address receiver, uint96 feeNumerator) external;\n\n    /**\n     * @dev Sets the token royalty for a given NFT collection.\n     *\n     * Emits an {NFTTokenRoyaltySet} event.\n     */\n    function setNFTTokenRoyalty(uint256 collectionId, uint256 tokenId, address receiver, uint96 feeNumerator) external;\n\n    /**\n     * @dev Transfers NFT collection's ownership from the current contract to a new\n     * account.\n     *\n     * Emits an {NFTOwnershipTransferred} event.\n     */\n    function transferNFTOwnership(uint256 collectionId, address newOwner) external;\n\n    /**\n     * @dev Deploys an upgradealbe NFT collection into a blockchain. The collection\n     * is represented by proxy and implementation contracts.\n     *\n     * A caller might additionally pass a list of collection wide royalties with\n     * payees and their shares. It causes creation a royalty fowrader contract bound\n     * to a royalty splitter contract. See the {RoyaltyForwarder} and\n     * {RoyaltySplitter} contracts for more detail.\n     *\n     * Also, a caller might additionally pass a list of fees, which are required to\n     * be distributed between payees.\n     *\n     * Requirements:\n     *\n     * - Before calling this method, it is required to generate a hash from a getter\n     *   with corresponding parameters and sign it by an authorized caller registered\n     *   on the {Verifier} contract.\n     *\n     * Emits {CollectionCreated} and {TransactionProcessed} events.\n     */\n    function createCollection(CreateCollectionParams calldata params, bytes calldata signature) external payable;\n\n    /**\n     * @dev Mints a token within a registered NFT collection.\n     *\n     * A caller might additionally pass a list of token specific royalties with\n     * payees and their shares. It causes creation a royalty fowrader contract bound\n     * to a royalty splitter contract. See the {RoyaltyForwarder} and\n     * {RoyaltySplitter} contracts for more detail.\n     *\n     * Also, a caller might additionally pass a list of fees, which are required to\n     * be distributed between payees.\n     *\n     * Requirements:\n     *\n     * - Before calling this method, it is required to generate a hash from a getter\n     *   with corresponding parameters and sign it by an authorized caller registered\n     *   on the {Verifier} contract.\n     *\n     * Emits {CollectionCreated} and {TransactionProcessed} events.\n     */\n    function mintItem(MintItemParams calldata params, bytes calldata signature) external payable;\n\n    /**\n     * @dev Mints a token within a registered NFT collection by an authorized account\n     * with the minter role (e.g. the {PassClaim} contract).\n     *\n     * A caller might additionally pass a list of token specific royalties with\n     * payees and their shares. It causes creation a royalty fowrader contract bound\n     * to a royalty splitter contract. See the {RoyaltyForwarder} and\n     * {RoyaltySplitter} contracts for more detail.\n     *\n     * Also, a caller might additionally pass a list of fees, which are required to\n     * be distributed between payees.\n     *\n     * Requirements:\n     *\n     * - Before calling this method, it is required to generate a hash from a getter\n     *   with corresponding parameters and sign it by an authorized caller registered\n     *   on the {Verifier} contract.\n     *\n     * Emits {CollectionCreated} and {TransactionProcessed} events.\n     */\n    function mintItemUnsigned(MintItemParams calldata params) external payable;\n\n    /**\n     * @dev Computes the address of an NFT collection address based on the Create2\n     * opcode.\n     */\n    function computeCollectionAddress(\n        uint256 collectionId,\n        string memory name,\n        string memory symbol\n    ) external view returns (address);\n\n    /**\n     * @dev Generates a hash in order to call the method to create an NFT collection.\n     */\n    function createCollectionHash(\n        CreateCollectionParams calldata params,\n        address sender\n    ) external pure returns (bytes32);\n\n    /**\n     * @dev Generates a hash in order to call the method to mint a token inside\n     * an NFT collection.\n     */\n    function mintItemHash(MintItemParams calldata params, address sender) external pure returns (bytes32);\n}\n"
      },
      "contracts/interfaces/IPassClaim.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\nimport { INFTFactory } from \"./INFTFactory.sol\";\n\ninterface IPassClaim {\n    /**\n     * @dev Defines data required to check given NFT Items.\n     *  - `collection` is the address of an NFT collection.\n     *  - `tokenId` is the token identifier within this NFT collection.\n     *  - `deduplicationId` is the deduplication group identifier used to check\n     *     maximum usage of a given token.\n     *  - `maxUsage` is the maximum usage allowed for a given token.\n     */\n    struct NFTItem {\n        address collection;\n        uint256 tokenId;\n        uint256 deduplicationId;\n        uint256 maxUsage;\n    }\n\n    /**\n     * @dev Emitted when some Ether amount received by the current contract.\n     */\n    event EtherReceived(address sender, uint256 value);\n\n    /**\n     * @dev Emitted when the address of a verifier contract is set.\n     */\n    event VerifierSet(address indexed verifier);\n\n    /**\n     * @dev Emitted when the address of an NFT contract is set.\n     */\n    event NFTFactorySet(address indexed nftFactory);\n\n    /**\n     * @dev Emitted when the address of an hot wallet contract is set. The address is\n     * allowed to be zero.\n     */\n    event HotWalletSet(address indexed hotWallet);\n\n    /**\n     * @dev Emitted when an allowed range of NFT items is set.\n     */\n    event NFTItemRangeSet(uint8[2] nftItemRange);\n\n    /**\n     * @dev Emitted when item usage for given deduplication group identifiers within\n     * an NFT collection.\n     */\n    event ItemUsagesReset(address indexed collection, uint256 deduplicationIdCount);\n\n    /**\n     * @dev Emitted when an item is minted.\n     */\n    event ItemMinted(\n        uint256 indexed transactionId,\n        uint256 indexed collectionId,\n        uint256 deduplicationId,\n        uint256 maxItemSupply,\n        uint256 tokenId,\n        address tokenReceiver\n    );\n\n    /**\n     * @dev The zero address of a verifier contract is given.\n     */\n    error ZeroVerifier();\n\n    /**\n     * @dev Emitted when the address of a NFT contract is set.\n     */\n    error ZeroNFTFactory();\n\n    /**\n     * @dev The item count is out of an allowed range.\n     */\n    error NFTItemRangeMissed(uint8[2] nftItemRange, uint256 currentNFTItemCount);\n\n    /**\n     * @dev The lower boundary of an item range is greater than the upper one.\n     */\n    error InconsistentNFTItemRange(uint8[2] nftItemRange);\n\n    /**\n     * @dev The upper boundary for token burns within a certain deduplication group\n     * identifier is reached.\n     */\n    error MaxItemUsageReached(address collection, uint256 deduplicationId, uint256 currentUsage);\n\n    /**\n     * @dev The sender is not the owner of a given token.\n     */\n    error InvalidNFTOwner(address collection, uint256 tokenId, address sender);\n\n    /**\n     * @dev Sets the address of a verifier contract, which allows to verify\n     * signatures restricted to authorized callers only.\n     *\n     * Emits a {VerifierSet} event.\n     */\n    function setVerifier(address verifier) external;\n\n    /**\n     * @dev Sets the address of an NFT factory contract, which produces NFT passes.\n     *\n     * Emits a {NFTFactorySet} event.\n     */\n    function setNFTFactory(address nftFactory) external;\n\n    /**\n     * @dev Sets the address of an external hot wallet contract, which used to check\n     * NFT's ownership.\n     *\n     * Emits a {HotWalletSet} event.\n     */\n    function setHotWallet(address hotWallet) external;\n\n    /**\n     * @dev Sets an allowed range of tokens to be checked.\n     *\n     * Emits an {NFTItemRangeSet} event.\n     */\n    function setNFTItemRange(uint8[2] calldata nftItemRange) external;\n\n    /**\n     * @dev Pauses the current contract, e.g. in case of an emergency.\n     *\n     * Emits a {Paused} event.\n     */\n    function pause() external;\n\n    /**\n     * @dev Unpauses the current contract.\n     *\n     * Emits an {Unpaused} event.\n     */\n    function unpause() external;\n\n    /**\n     * @dev Handles item (NFT pass) minting over an NFT factory contract.\n     *\n     * Requirements:\n     *\n     * - Before calling this method, it is required to generate a hash from a getter\n     *   with corresponding parameters and sign it by an authorized caller registered\n     *   on the {Verifier} contract.\n     *\n     * Emits an {ItemMinted} event.\n     */\n    function mintItem(\n        NFTItem[] calldata nftItems,\n        INFTFactory.MintItemParams calldata params,\n        bytes calldata signature\n    ) external payable;\n\n    /**\n     * @dev Resets item usage for given deduplication group identifiers within\n     * an NFT collection.\n     *\n     * Emits an {ItemUsagesReset} event.\n     */\n    function resetItemUsages(address collection, uint256[] calldata deduplicationIds) external;\n\n    /**\n     * @dev Generates a hash in order to call the method to mint an item.\n     */\n    function mintItemHash(\n        NFTItem[] calldata nftItems,\n        INFTFactory.MintItemParams calldata params,\n        address sender\n    ) external pure returns (bytes32);\n}\n"
      },
      "contracts/interfaces/IRoyaltySplitter.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\ninterface IRoyaltySplitter {\n    /**\n     * @dev Royalty data passed for registration in the contract.\n     *\n     * Required fields:\n     *\n     * - `payee` is an account that should receive Ether or ERC20 royalty amount.\n     * - `share` is a share from a list of all registered royalty payees for a given\n     *    collection or for a non fungible token.\n     */\n    struct Royalty {\n        address payable payee;\n        uint96 share;\n    }\n\n    /**\n     * @dev Royalty information about royalty payees and their total shares stored\n     * in the contract.\n     *\n     * Required fields:\n     *\n     * - `royalties` is a list of royalties.\n     * - `totalShares` is the total share of all registered royalty payees.\n     */\n    struct RoyaltyInfo {\n        Royalty[] royalties;\n        uint96 totalShares;\n    }\n\n    /**\n     * @dev Emitted when collection wide royalty information is registered in\n     * the contract and when a royalty forwarder contract is deployed into\n     * the blockchain.\n     */\n    event CollectionRoyaltyRegistered(address indexed forwarder, address indexed collection, uint256 totalShares);\n\n    /**\n     * @dev Emitted when a token royalty information is registered in the contract\n     * and when a royalty forwarder contract is deployed into\n     * the blockchain.\n     */\n    event TokenRoyaltyRegistered(\n        address indexed forwarder,\n        address indexed collection,\n        uint256 indexed tokenId,\n        uint256 totalShares\n    );\n\n    /**\n     * @dev Emitted when Ether royalty amounts are transferred to royalty payees\n     * according to their shares.\n     */\n    event EtherRoyaltyReleased(address indexed forwarder, uint256 amount);\n\n    /**\n     * @dev Emitted when ERC20 royalty amounts are transferred to royalty payees\n     * according to their shares.\n     */\n    event ERC20RoyaltyReleased(address indexed forwarder, address indexed token, uint256 amount);\n\n    /**\n     * @dev No royalty data is passed to be registered in the contract.\n     */\n    error NoRoyaltiesFound();\n\n    /**\n     * @dev The zero payee address passed in royalty data to be registered in\n     * the contract.\n     */\n    error ZeroRoyaltyPayee();\n\n    /**\n     * @dev The zero payee share passed in royalty data to be registered in\n     * the contract.\n     */\n    error ZeroRoyaltyShare();\n\n    /**\n     * @dev The zero royalty amount is passed during a royalty release.\n     */\n    error ZeroRoyaltyAmount();\n\n    /**\n     * @dev A royalty payee has been already set from a passed list of royalties.\n     */\n    error RoyaltyPayeeIsSet(address roayltyPayee);\n\n    /**\n     * @dev No registered royalty information is found in the contract during\n     * a royalty release.\n     */\n    error NoRoyaltyInfoRegistered(address forwarder);\n\n    /**\n     * @dev Registers royalty shares for an NFT collection in this contract and\n     * deploys a related royalty forwarder contract into a blockchain.\n     *\n     * Emits a {CollectionRoyltyRegistered} event.\n     */\n    function registerCollectionRoyalty(\n        address collection,\n        Royalty[] calldata royalties\n    ) external returns (address, uint96);\n\n    /**\n     * @dev Registers royalty shares for a given non fungible token in this contract\n     *and deploys a related royalty forwarder contract into a blockchain.\n     *\n     * Emits a {TokenRoyltyRegistered} event.\n     */\n    function registerTokenRoyalty(\n        address collection,\n        uint256 tokenId,\n        Royalty[] calldata royalties\n    ) external returns (address royaltyForwarder, uint96 totalShares);\n\n    /**\n     * @dev Transfers Ether royalty amounts to royalty payees according to their shares.\n     *\n     * WARNING: The royalty contract should explicitly regitster a royalty forwarder\n     * contract, otherwise a transaction will be reverted.\n     *\n     * If a release amount is negligible, a royalty payee with a low share might have\n     * the zero Ether amount distributed consequently.\n     *\n     * Emits a {EtherRoyaltyReleased} event.\n     */\n    function releaseRoyalty() external payable;\n\n    /**\n     * @dev Transfers ERC20 royalty amounts to royalty payees according to their shares.\n     *\n     * WARNING: The royalty contract should explicitly regitster a royalty forwarder\n     * contract, otherwise a transaction will be reverted.\n     *\n     * If a release amount is negligible, a royalty payee with a low share might have\n     * the zero ERC20 token amount distributed consequently.\n     *\n     * Emits a {ERC20RoyaltyReleased} event.\n     */\n    function releaseRoyalty(address token, uint256 amount) external;\n\n    /**\n     * @dev Computes the address of a royalty forwarder contract, which should accept\n     * collection wide royalties.\n     */\n    function computeCollectionRoyaltyForwarderAddress(address collection) external view returns (address);\n\n    /**\n     * @dev Computes the address of a royalty forwarder contract, which should accept\n     * token royalties.\n     */\n    function computeTokenRoyaltyForwarderAddress(address collection, uint256 tokenId) external view returns (address);\n}\n"
      },
      "contracts/interfaces/IVerifier.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\ninterface IVerifier {\n    /**\n     * @dev Emitted when the signer's address is added to the contract's storage.\n     */\n    event SignerAdded(address indexed signer);\n\n    /**\n     * @dev Emitted when the signer's address is removed from the contract's storage.\n     */\n    event SignerRemoved(address indexed signer);\n\n    /**\n     * @dev Emitted when the signer's address is recovered from the provided hash and signature.\n     */\n    event SignerRecovered(address indexed signer);\n\n    /**\n     * @dev A given hash signer is not verified based on the provided signature.\n     */\n    error SignerNotVerified(bytes32 hash, bytes signature);\n\n    /**\n     * @dev A signed hash has been already saved in the contract's storage.\n     */\n    error SignedHashAlreadyApplied(bytes32 hash);\n\n    /**\n     * @dev Recovers a signer's address from a provided `hash` and `singature`.\n     *\n     * Requirements:\n     *\n     * - the `hash` can be used only once for each successful recovery\n     *\n     * WARNING: This check requires a client to send a transaction, as it requires\n     * to write a checked hash into the contract's storage.\n     *\n     * Emits a `SignerRecovered` event.\n     */\n    function recoverSigner(bytes32 hash, bytes memory signature) external returns (address);\n\n    /**\n     * @dev Verifies if a given hash signed by an authorized signer.\n     */\n    function verifySigner(bytes32 hash, bytes memory signature) external view returns (bool);\n\n    /**\n     * @dev Checks if a given hash has been already applied.\n     */\n    function signedHashApplied(bytes32 hash) external view returns (bool);\n}\n"
      },
      "contracts/libraries/LParamEncoder.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\nimport { IFeeDistributor } from \"../interfaces/IFeeDistributor.sol\";\nimport { IRoyaltySplitter } from \"../interfaces/IRoyaltySplitter.sol\";\nimport { IPassClaim } from \"../interfaces/IPassClaim.sol\";\nimport { IIncinerator } from \"../interfaces/IIncinerator.sol\";\n\nlibrary LParamEncoder {\n    function encodeFees(IFeeDistributor.Fee[] calldata fees) internal pure returns (bytes memory encodedFees) {\n        uint256 feeCount = fees.length;\n        for (uint256 i = 0; i < feeCount; ) {\n            IFeeDistributor.Fee calldata fee = fees[i];\n            encodedFees = bytes.concat(encodedFees, abi.encode(fee.payee, fee.token, fee.amount));\n\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    function encodeRoyalties(\n        IRoyaltySplitter.Royalty[] calldata royalties\n    ) internal pure returns (bytes memory encodedRoyalties) {\n        uint256 royaltyCount = royalties.length;\n        for (uint256 i = 0; i < royaltyCount; ) {\n            IRoyaltySplitter.Royalty calldata royalty = royalties[i];\n            encodedRoyalties = bytes.concat(encodedRoyalties, abi.encode(royalty.payee, royalty.share));\n\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    // slither-disable-next-line dead-code\n    function encodeNFTItems(\n        IPassClaim.NFTItem[] calldata nftItems\n    ) internal pure returns (bytes memory encodedNFTItems) {\n        uint256 nftItemCount = nftItems.length;\n        for (uint256 i = 0; i < nftItemCount; ) {\n            IPassClaim.NFTItem calldata nftItem = nftItems[i];\n            bytes.concat(\n                encodedNFTItems,\n                abi.encode(nftItem.collection, nftItem.tokenId, nftItem.deduplicationId, nftItem.maxUsage)\n            );\n\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    // slither-disable-next-line dead-code\n    function encodeNFTItems(\n        IIncinerator.NFTItem[] calldata nftItems\n    ) internal pure returns (bytes memory encodedNFTItems) {\n        uint256 nftItemCount = nftItems.length;\n        for (uint256 i = 0; i < nftItemCount; ) {\n            IIncinerator.NFTItem calldata nftItem = nftItems[i];\n            bytes.concat(encodedNFTItems, abi.encode(nftItem.collection, nftItem.tokenId));\n\n            unchecked {\n                ++i;\n            }\n        }\n    }\n}\n"
      },
      "contracts/PassClaim.sol": {
        "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.18;\n\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport { OwnableUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport { PausableUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport { CountersUpgradeable } from \"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\";\nimport { IERC721Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol\";\nimport { IPassClaim } from \"./interfaces/IPassClaim.sol\";\nimport { IVerifier } from \"./interfaces/IVerifier.sol\";\nimport { INFTFactory } from \"./interfaces/INFTFactory.sol\";\nimport { IHotWallet } from \"./interfaces/IHotWallet.sol\";\nimport { LParamEncoder } from \"./libraries/LParamEncoder.sol\";\n\n/**\n * @dev This contract is responsible for claiming NFT passes produced by an NFT\n * factory contract.\n *\n * Also, this contract relies on NFT ownership checking based on the user's hot/cold\n * wallet concept during such claiming. See https://warm.xyz/get-started for more\n * details.\n */\ncontract PassClaim is IPassClaim, Initializable, OwnableUpgradeable, PausableUpgradeable {\n    using CountersUpgradeable for CountersUpgradeable.Counter;\n\n    bytes32 public constant VERSION = \"1.2.0\";\n\n    IVerifier public verifier;\n    INFTFactory public nftFactory;\n    IHotWallet public hotWallet;\n    uint8[2] public nftItemRange;\n    // slither-disable-next-line uninitialized-state\n    mapping(address collection => mapping(uint256 deduplicationId => CountersUpgradeable.Counter itemUsage))\n        public itemUsages;\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(\n        address verifier_,\n        address nftFactory_,\n        address hotWallet_,\n        uint8[2] calldata nftItemRange_\n    ) external initializer {\n        OwnableUpgradeable.__Ownable_init();\n        PausableUpgradeable.__Pausable_init();\n\n        if (verifier_ == address(0)) {\n            revert ZeroVerifier();\n        }\n        verifier = IVerifier(verifier_);\n\n        if (nftFactory_ == address(0)) {\n            revert ZeroNFTFactory();\n        }\n        nftFactory = INFTFactory(nftFactory_);\n\n        hotWallet = IHotWallet(hotWallet_);\n\n        if (nftItemRange_[0] > nftItemRange_[1]) {\n            revert InconsistentNFTItemRange(nftItemRange_);\n        }\n        nftItemRange = nftItemRange_;\n    }\n\n    receive() external payable {\n        emit EtherReceived(msg.sender, msg.value);\n    }\n\n    /**\n     * @dev Sets the address of a verifier contract, which allows to verify\n     * signatures restricted to authorized callers only.\n     *\n     * Emits a {VerifierSet} event.\n     */\n    function setVerifier(address verifier_) external onlyOwner {\n        if (verifier_ == address(0)) {\n            revert ZeroVerifier();\n        }\n\n        verifier = IVerifier(verifier_);\n        emit VerifierSet(verifier_);\n    }\n\n    /**\n     * @dev Sets the address of an NFT factory contract, which produces NFT passes.\n     *\n     * Emits a {NFTFactorySet} event.\n     */\n    function setNFTFactory(address nftFactory_) external onlyOwner {\n        if (nftFactory_ == address(0)) {\n            revert ZeroNFTFactory();\n        }\n\n        nftFactory = INFTFactory(nftFactory_);\n        emit NFTFactorySet(nftFactory_);\n    }\n\n    /**\n     * @dev Sets the address of an external hot wallet contract, which used to check\n     * NFT's ownership.\n     *\n     * Emits a {HotWalletSet} event.\n     */\n    function setHotWallet(address hotWallet_) external onlyOwner {\n        hotWallet = IHotWallet(hotWallet_);\n        emit HotWalletSet(hotWallet_);\n    }\n\n    /**\n     * @dev Sets an allowed range of tokens to be checked.\n     *\n     * Emits an {NFTItemRangeSet} event.\n     */\n    function setNFTItemRange(uint8[2] calldata nftItemRange_) external onlyOwner {\n        if (nftItemRange_[0] > nftItemRange_[1]) {\n            revert InconsistentNFTItemRange(nftItemRange_);\n        }\n\n        nftItemRange = nftItemRange_;\n        emit NFTItemRangeSet(nftItemRange_);\n    }\n\n    /**\n     * @dev Pauses the current contract, e.g. in case of an emergency.\n     *\n     * Emits a {Paused} event.\n     */\n    function pause() external onlyOwner {\n        _pause();\n    }\n\n    /**\n     * @dev Unpauses the current contract.\n     *\n     * Emits an {Unpaused} event.\n     */\n    function unpause() external onlyOwner {\n        _unpause();\n    }\n\n    /**\n     * @dev Handles item (NFT pass) minting over an NFT factory contract.\n     *\n     * Requirements:\n     *\n     * - Before calling this method, it is required to generate a hash from a getter\n     *   with corresponding parameters and sign it by an authorized caller registered\n     *   on the {Verifier} contract.\n     *\n     * Emits an {ItemMinted} event.\n     */\n    function mintItem(\n        NFTItem[] calldata nftItems,\n        INFTFactory.MintItemParams calldata params,\n        bytes calldata signature\n    ) external payable whenNotPaused {\n        bytes32 hash = _mintItemHash(nftItems, params, msg.sender);\n        bool verified = verifier.verifySigner(hash, signature);\n        if (!verified) {\n            revert IVerifier.SignerNotVerified(hash, signature);\n        }\n\n        _mintItem(nftItems, params);\n    }\n\n    /**\n     * @dev Resets item usage for given deduplication group identifiers within\n     * an NFT collection.\n     *\n     * Emits an {ItemUsagesReset} event.\n     */\n    function resetItemUsages(address collection, uint256[] calldata deduplicationIds) external onlyOwner {\n        uint256 deduplicationIdCount = deduplicationIds.length;\n\n        for (uint256 i = 0; i < deduplicationIdCount; ) {\n            uint256 deduplicationId = deduplicationIds[i];\n            itemUsages[collection][deduplicationId].reset();\n\n            unchecked {\n                ++i;\n            }\n        }\n\n        emit ItemUsagesReset(collection, deduplicationIdCount);\n    }\n\n    /**\n     * @dev Generates a hash in order to call the method to mint an item.\n     */\n    function mintItemHash(\n        NFTItem[] calldata nftItems,\n        INFTFactory.MintItemParams calldata params,\n        address sender\n    ) external pure returns (bytes32) {\n        return _mintItemHash(nftItems, params, sender);\n    }\n\n    /**\n     * @dev Checks if given NFT items have the allowed maximum usage limit and\n     * the right ownership.\n     *\n     * Note if the address of a hot wallet contract is set, the NFT ownership will be\n     * checked both for user's hot and cold wallets. Otherwise it will be checked\n     * for a user's cold wallet only.\n     *\n     * WARNING: If the NFT item address is zero the ownership checking is skipped as\n     * it happens offchain.\n     */\n    function _checkNFTItems(NFTItem[] calldata nftItems) private {\n        uint256 nftItemCount = nftItems.length;\n        if (nftItemCount < nftItemRange[0] || nftItemCount > nftItemRange[1]) {\n            revert NFTItemRangeMissed(nftItemRange, nftItemCount);\n        }\n\n        bool shouldCheckHotWallet = address(hotWallet) != address(0);\n        for (uint256 i = 0; i < nftItemCount; ) {\n            NFTItem calldata nftItem = nftItems[i];\n            _setItemUsage(nftItem.collection, nftItem.deduplicationId, nftItem.maxUsage);\n\n            if (nftItem.collection != address(0)) {\n                shouldCheckHotWallet\n                    ? _checkHotWalletOwner(nftItem.collection, nftItem.tokenId)\n                    : _checkColdWalletOwner(nftItem.collection, nftItem.tokenId);\n            }\n\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    /**\n     * @dev Handles item (NFT pass) minting over an NFT factory contract.\n     *\n     * See the {mintItem} method for more details.\n     */\n    function _mintItem(NFTItem[] calldata nftItems, INFTFactory.MintItemParams calldata params) private {\n        _checkNFTItems(nftItems);\n\n        emit ItemMinted(\n            params.transactionId,\n            params.collectionId,\n            params.deduplicationId,\n            params.maxItemSupply,\n            params.tokenId,\n            params.tokenReceiver\n        );\n\n        nftFactory.mintItemUnsigned{ value: msg.value }(params);\n    }\n\n    /**\n     * @dev Checks the upper boundary for token burns within a certain deduplication\n     * group identifier.\n     */\n    function _setItemUsage(address collection, uint256 deduplicationId, uint256 maxUsage) private {\n        CountersUpgradeable.Counter storage currentUsage = itemUsages[collection][deduplicationId];\n        if (maxUsage != 0 && currentUsage.current() >= maxUsage) {\n            revert MaxItemUsageReached(collection, deduplicationId, currentUsage.current());\n        }\n        currentUsage.increment();\n    }\n\n    /**\n     * @dev Checks the owner of a hot wallet for a given token.\n     */\n    function _checkHotWalletOwner(address collection, uint256 tokenId) private view {\n        address nftOwner = hotWallet.ownerOf(collection, tokenId);\n        if (nftOwner != msg.sender && nftOwner != hotWallet.getHotWallet(msg.sender)) {\n            revert InvalidNFTOwner(collection, tokenId, msg.sender);\n        }\n    }\n\n    /**\n     * @dev Checks the owner of a cold wallet for a given token.\n     */\n    function _checkColdWalletOwner(address collection, uint256 tokenId) private view {\n        address nftOwner = IERC721Upgradeable(collection).ownerOf(tokenId);\n        if (nftOwner != msg.sender) {\n            revert InvalidNFTOwner(collection, tokenId, msg.sender);\n        }\n    }\n\n    /**\n     * @dev Generates a hash in order to call the method to mint an item.\n     */\n    // slither-disable-next-line encode-packed-collision\n    function _mintItemHash(\n        NFTItem[] calldata nftItems,\n        INFTFactory.MintItemParams calldata params,\n        address sender\n    ) private pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encodePacked(\n                    LParamEncoder.encodeNFTItems(nftItems),\n                    params.transactionId,\n                    params.collectionId,\n                    params.tokenReceiver,\n                    params.tokenId,\n                    params.tokenURI,\n                    params.deduplicationId,\n                    params.maxItemSupply,\n                    LParamEncoder.encodeRoyalties(params.royalties),\n                    LParamEncoder.encodeFees(params.fees),\n                    sender\n                )\n            );\n    }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "libraries": {}
    }
  }}