creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "node_modules/@zoralabs/zora-1155-contracts/src/delegation/ZoraCreator1155PremintExecutorImpl.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {ICreatorRoyaltiesControl} from \"../interfaces/ICreatorRoyaltiesControl.sol\";\nimport {UUPSUpgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol\";\nimport {Ownable2StepUpgradeable} from \"../utils/ownable/Ownable2StepUpgradeable.sol\";\nimport {IHasContractName} from \"../interfaces/IContractMetadata.sol\";\nimport {IZoraCreator1155} from \"../interfaces/IZoraCreator1155.sol\";\nimport {IZoraCreator1155Errors} from \"../interfaces/IZoraCreator1155Errors.sol\";\nimport {IZoraCreator1155Factory} from \"../interfaces/IZoraCreator1155Factory.sol\";\nimport {SharedBaseConstants} from \"../shared/SharedBaseConstants.sol\";\nimport {ZoraCreatorFixedPriceSaleStrategy} from \"../minters/fixed-price/ZoraCreatorFixedPriceSaleStrategy.sol\";\nimport {IMinter1155} from \"../interfaces/IMinter1155.sol\";\nimport {ERC1155DelegationStorageV1} from \"../delegation/ERC1155DelegationStorageV1.sol\";\nimport {ZoraCreator1155PremintExecutorImplLib} from \"./ZoraCreator1155PremintExecutorImplLib.sol\";\nimport {ZoraCreator1155Attribution, DelegatedTokenCreation} from \"./ZoraCreator1155Attribution.sol\";\nimport {PremintEncoding, EncodedPremintConfig} from \"@zoralabs/shared-contracts/premint/PremintEncoding.sol\";\nimport {ContractCreationConfig, PremintConfig, PremintConfigV2, TokenCreationConfig, TokenCreationConfigV2, MintArguments, PremintResult, Erc20PremintConfigV1, Erc20TokenCreationConfigV1} from \"@zoralabs/shared-contracts/entities/Premint.sol\";\nimport {ZoraCreator1155Attribution, DelegatedTokenCreation} from \"./ZoraCreator1155Attribution.sol\";\nimport {IZoraCreator1155PremintExecutor} from \"../interfaces/IZoraCreator1155PremintExecutor.sol\";\nimport {IZoraCreator1155DelegatedCreationLegacy, IHasSupportedPremintSignatureVersions} from \"../interfaces/IZoraCreator1155DelegatedCreation.sol\";\nimport {ZoraCreator1155FactoryImpl} from \"../factory/ZoraCreator1155FactoryImpl.sol\";\nimport {IRewardsErrors} from \"@zoralabs/protocol-rewards/src/interfaces/IRewardsErrors.sol\";\nimport {IERC1155} from \"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\";\nimport {IERC1155Receiver} from \"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\";\n\n/// @title Enables creation of and minting tokens on Zora1155 contracts transactions using eip-712 signatures.\n/// Signature must provided by the contract creator, or an account that's permitted to create new tokens on the contract.\n/// Mints the first x tokens to the executor of the transaction.\n/// @author @oveddan\ncontract ZoraCreator1155PremintExecutorImpl is\n    IZoraCreator1155PremintExecutor,\n    Ownable2StepUpgradeable,\n    UUPSUpgradeable,\n    IHasContractName,\n    IZoraCreator1155Errors,\n    IRewardsErrors\n{\n    IZoraCreator1155Factory public immutable zora1155Factory;\n\n    constructor(IZoraCreator1155Factory _factory) {\n        zora1155Factory = _factory;\n        _disableInitializers();\n    }\n\n    function initialize(address _initialOwner) public initializer {\n        __Ownable_init(_initialOwner);\n        __UUPSUpgradeable_init();\n    }\n\n    /// @notice Executes the creation of an 1155 contract, token, and/or ERC20 sale signed by a creator, and mints the first tokens to the executor of this transaction.\n    ///         To mint the first token(s) of an ERC20 sale, the executor must approve this contract the quantity * price of the mint.\n    /// @dev For use with v3 of premint config, PremintConfig3, which supports ERC20 mints.\n    /// @param contractConfig Parameters for creating a new contract, if one doesn't exist yet.  Used to resolve the deterministic contract address.\n    /// @param premintConfig Parameters for creating the token, and minting the initial x tokens to the executor.\n    /// @param signature Signature of the creator of the token, which must match the signer of the premint config, or have permission to create new tokens on the erc1155 contract if it's already been created\n    /// @param quantityToMint How many tokens to mint to the mintRecipient\n    /// @param mintArguments mint arguments specifying the token mint recipient, mint comment, and mint referral\n    /// @param signerContract If a smart wallet was used to create the premint, the address of that smart wallet. Otherwise, set to address(0)\n    function premintErc20V1(\n        ContractCreationConfig calldata contractConfig,\n        Erc20PremintConfigV1 calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        MintArguments calldata mintArguments,\n        address firstMinter,\n        address signerContract\n    ) external returns (PremintResult memory result) {\n        result = ZoraCreator1155PremintExecutorImplLib.getOrCreateContractAndToken(\n            zora1155Factory,\n            contractConfig,\n            PremintEncoding.encodePremintErc20V1(premintConfig),\n            signature,\n            firstMinter,\n            signerContract\n        );\n\n        if (quantityToMint > 0) {\n            ZoraCreator1155PremintExecutorImplLib.performERC20Mint(\n                premintConfig.tokenConfig.erc20Minter,\n                premintConfig.tokenConfig.currency,\n                premintConfig.tokenConfig.pricePerToken,\n                quantityToMint,\n                result,\n                mintArguments\n            );\n        }\n\n        {\n            emit PremintedV2({\n                contractAddress: result.contractAddress,\n                tokenId: result.tokenId,\n                createdNewContract: result.createdNewContract,\n                uid: premintConfig.uid,\n                minter: firstMinter,\n                quantityMinted: quantityToMint\n            });\n        }\n    }\n\n    /// @notice Creates a new token on the given erc1155 contract on behalf of a creator, and mints x tokens to the executor of this transaction.\n    /// For use for EIP-1271 based signatures, where there is a signer contract.\n    /// If the erc1155 contract hasn't been created yet, it will be created with the given config within this same transaction.\n    /// The creator must sign the intent to create the token, and must have mint new token permission on the erc1155 contract,\n    /// or match the contract admin on the contract creation config if the contract hasn't been created yet.\n    /// Contract address of the created contract is deterministically generated from the contract config and this contract's address.\n    /// @dev For use with v2 of premint config, PremintConfigV2, which supports setting `createReferral`.\n    /// @param contractConfig Parameters for creating a new contract, if one doesn't exist yet.  Used to resolve the deterministic contract address.\n    /// @param premintConfig Parameters for creating the token, and minting the initial x tokens to the executor.\n    /// @param signature Signature of the creator of the token, which must match the signer of the premint config, or have permission to create new tokens on the erc1155 contract if it's already been created\n    /// @param quantityToMint How many tokens to mint to the mintRecipient\n    /// @param mintArguments mint arguments specifying the token mint recipient, mint comment, and mint referral\n    /// @param signerContract If a smart wallet was used to create the premint, the address of that smart wallet. Otherwise, set to address(0)\n    function premintV2WithSignerContract(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfigV2 calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        MintArguments calldata mintArguments,\n        address firstMinter,\n        address signerContract\n    ) public payable returns (PremintResult memory result) {\n        result = ZoraCreator1155PremintExecutorImplLib.getOrCreateContractAndToken(\n            zora1155Factory,\n            contractConfig,\n            PremintEncoding.encodePremintV2(premintConfig),\n            signature,\n            firstMinter,\n            signerContract\n        );\n\n        if (quantityToMint > 0) {\n            ZoraCreator1155PremintExecutorImplLib.mintWithEth(\n                IZoraCreator1155(result.contractAddress),\n                premintConfig.tokenConfig.fixedPriceMinter,\n                result.tokenId,\n                quantityToMint,\n                mintArguments\n            );\n        }\n\n        emit PremintedV2({\n            contractAddress: result.contractAddress,\n            tokenId: result.tokenId,\n            createdNewContract: result.createdNewContract,\n            uid: premintConfig.uid,\n            minter: firstMinter,\n            quantityMinted: quantityToMint\n        });\n    }\n\n    /// @notice Creates a new token on the given erc1155 contract on behalf of a creator, and mints x tokens to the executor of this transaction.\n    /// If the erc1155 contract hasn't been created yet, it will be created with the given config within this same transaction.\n    /// The creator must sign the intent to create the token, and must have mint new token permission on the erc1155 contract,\n    /// or match the contract admin on the contract creation config if the contract hasn't been created yet.\n    /// Contract address of the created contract is deterministically generated from the contract config and this contract's address.\n    /// @dev For use with v2 of premint config, PremintConfigV2, which supports setting `createReferral`.\n    /// @param contractConfig Parameters for creating a new contract, if one doesn't exist yet.  Used to resolve the deterministic contract address.\n    /// @param premintConfig Parameters for creating the token, and minting the initial x tokens to the executor.\n    /// @param signature Signature of the creator of the token, which must match the signer of the premint config, or have permission to create new tokens on the erc1155 contract if it's already been created\n    /// @param quantityToMint How many tokens to mint to the mintRecipient\n    /// @param mintArguments mint arguments specifying the token mint recipient, mint comment, and mint referral\n    function premintV2(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfigV2 calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        MintArguments calldata mintArguments\n    ) external payable returns (PremintResult memory result) {\n        return premintV2WithSignerContract(contractConfig, premintConfig, signature, quantityToMint, mintArguments, msg.sender, address(0));\n    }\n\n    /// Creates a new token on the given erc1155 contract on behalf of a creator, and mints x tokens to the executor of this transaction.\n    /// If the erc1155 contract hasn't been created yet, it will be created with the given config within this same transaction.\n    /// The creator must sign the intent to create the token, and must have mint new token permission on the erc1155 contract,\n    /// or match the contract admin on the contract creation config if the contract hasn't been created yet.\n    /// Contract address of the created contract is deterministically generated from the contract config and this contract's address.\n    /// @dev For use with v1 of premint config, PremintConfigV2, which supports setting `createReferral`.\n    /// @param contractConfig Parameters for creating a new contract, if one doesn't exist yet.  Used to resolve the deterministic contract address.\n    /// @param premintConfig Parameters for creating the token, and minting the initial x tokens to the executor.\n    /// @param signature Signature of the creator of the token, which must match the signer of the premint config, or have permission to create new tokens on the erc1155 contract if it's already been created\n    /// @param quantityToMint How many tokens to mint to the mintRecipient\n    /// @param mintArguments mint arguments specifying the token mint recipient, mint comment, and mint referral\n    function premintV1(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfig calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        MintArguments calldata mintArguments\n    ) external payable returns (PremintResult memory result) {\n        result = ZoraCreator1155PremintExecutorImplLib.getOrCreateContractAndToken(\n            zora1155Factory,\n            contractConfig,\n            PremintEncoding.encodePremintV1(premintConfig),\n            signature,\n            msg.sender,\n            address(0)\n        );\n\n        if (quantityToMint > 0) {\n            ZoraCreator1155PremintExecutorImplLib.mintWithEth(\n                IZoraCreator1155(result.contractAddress),\n                premintConfig.tokenConfig.fixedPriceMinter,\n                result.tokenId,\n                quantityToMint,\n                mintArguments\n            );\n        }\n\n        emit PremintedV2({\n            contractAddress: result.contractAddress,\n            tokenId: result.tokenId,\n            createdNewContract: result.createdNewContract,\n            uid: premintConfig.uid,\n            minter: msg.sender,\n            quantityMinted: quantityToMint\n        });\n    }\n\n    /// @notice Gets the deterministic contract address for the given contract creation config.\n    /// Contract address is generated deterministically from a hash based on the contract uri, contract name,\n    /// contract admin, and the msg.sender, which is this contract's address.\n    function getContractAddress(ContractCreationConfig calldata contractConfig) public view override returns (address) {\n        return ZoraCreator1155PremintExecutorImplLib.getContractAddress(zora1155Factory, contractConfig);\n    }\n\n    /// @notice Utility function to determine if a premint contract has been created for a uid of a premint, and if so,\n    /// What is the token id that was created for the uid.\n    function premintStatus(address contractAddress, uint32 uid) public view returns (bool contractCreated, uint256 tokenIdForPremint) {\n        if (contractAddress.code.length == 0) {\n            return (false, 0);\n        }\n        return (true, ERC1155DelegationStorageV1(contractAddress).delegatedTokenId(uid));\n    }\n\n    // @custom:deprecated use isAuthorizedToCreatePremint instead\n    function isValidSignature(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfig calldata premintConfig,\n        bytes calldata signature\n    ) public view returns (bool isValid, address contractAddress, address recoveredSigner) {\n        contractAddress = getContractAddress(contractConfig);\n\n        recoveredSigner = ZoraCreator1155Attribution.recoverSignerHashed(\n            ZoraCreator1155Attribution.hashPremint(premintConfig),\n            signature,\n            contractAddress,\n            PremintEncoding.HASHED_VERSION_1,\n            block.chainid,\n            address(0)\n        );\n\n        if (recoveredSigner == address(0)) {\n            return (false, address(0), recoveredSigner);\n        }\n\n        isValid = isAuthorizedToCreatePremint(recoveredSigner, contractConfig.contractAdmin, contractAddress);\n    }\n\n    /// @notice Checks if the signer of a premint is authorized to sign a premint for a given contract.  If the contract hasn't been created yet,\n    /// then the signer is authorized if the signer's address matches contractConfig.contractAdmin.  Otherwise, the signer must have the PERMISSION_BIT_MINTER\n    /// role on the contract\n    /// @param signer The signer of the premint\n    /// @param premintContractConfigContractAdmin If this contract was created via premint, the original contractConfig.contractAdmin.  Otherwise, set to address(0)\n    /// @param contractAddress The determinstic 1155 contract address the premint is for\n    /// @return isAuthorized Whether the signer is authorized\n    function isAuthorizedToCreatePremint(\n        address signer,\n        address premintContractConfigContractAdmin,\n        address contractAddress\n    ) public view returns (bool isAuthorized) {\n        return ZoraCreator1155Attribution.isAuthorizedToCreatePremint(signer, premintContractConfigContractAdmin, contractAddress);\n    }\n\n    /// @notice Returns the versions of the premint signature that the contract supports\n    /// @param contractAddress The address of the contract to check\n    /// @return versions The versions of the premint signature that the contract supports.  If contract hasn't been created yet,\n    /// assumes that when it will be created it will support the latest versions of the signatures, so the function returns all versions.\n    function supportedPremintSignatureVersions(address contractAddress) external view returns (string[] memory versions) {\n        // if contract hasn't been created yet, assume it will be created with the latest version\n        // and thus supports all versions of the signature\n        if (contractAddress.code.length == 0) {\n            return DelegatedTokenCreation._supportedPremintSignatureVersions();\n        }\n\n        IZoraCreator1155 creatorContract = IZoraCreator1155(contractAddress);\n        if (\n            creatorContract.supportsInterface(type(IZoraCreator1155DelegatedCreationLegacy).interfaceId) ||\n            creatorContract.supportsInterface(type(IHasSupportedPremintSignatureVersions).interfaceId)\n        ) {\n            return IHasSupportedPremintSignatureVersions(contractAddress).supportedPremintSignatureVersions();\n        }\n\n        // try get token id for uid 0 - if call fails, we know this didn't support premint\n        try ERC1155DelegationStorageV1(contractAddress).delegatedTokenId(uint32(0)) returns (uint256) {\n            versions = new string[](1);\n            versions[0] = PremintEncoding.VERSION_1;\n        } catch {\n            versions = new string[](0);\n        }\n    }\n\n    // upgrade related functionality\n\n    /// @notice The name of the contract for upgrade purposes\n    function contractName() external pure returns (string memory) {\n        return \"ZORA 1155 Premint Executor\";\n    }\n\n    // upgrade functionality\n    /// @notice Returns the current implementation address\n    function implementation() external view returns (address) {\n        return _getImplementation();\n    }\n\n    error UpgradeToMismatchedContractName(string expected, string actual);\n\n    /// @notice Ensures the caller is authorized to upgrade the contract\n    /// @dev This function is called in `upgradeTo` & `upgradeToAndCall`\n    /// @param _newImpl The new implementation address\n    function _authorizeUpgrade(address _newImpl) internal override onlyOwner {\n        if (!_equals(IHasContractName(_newImpl).contractName(), this.contractName())) {\n            revert UpgradeToMismatchedContractName(this.contractName(), IHasContractName(_newImpl).contractName());\n        }\n    }\n\n    function _equals(string memory a, string memory b) internal pure returns (bool) {\n        return (keccak256(bytes(a)) == keccak256(bytes(b)));\n    }\n\n    function mintFee(address collectionAddress) external view returns (uint256) {\n        if (collectionAddress.code.length == 0) {\n            return ZoraCreator1155FactoryImpl(address(zora1155Factory)).zora1155Impl().mintFee();\n        }\n\n        return IZoraCreator1155(collectionAddress).mintFee();\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/ICreatorRoyaltiesControl.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IERC2981} from \"@openzeppelin/contracts/interfaces/IERC2981.sol\";\n\ninterface ICreatorRoyaltyErrors {\n    /// @notice Thrown when a user tries to have 100% supply royalties\n    error InvalidMintSchedule();\n}\n\ninterface ICreatorRoyaltiesControl is IERC2981 {\n    /// @notice The RoyaltyConfiguration struct is used to store the royalty configuration for a given token.\n    /// @param royaltyMintSchedule Every nth token will go to the royalty recipient.\n    /// @param royaltyBPS The royalty amount in basis points for secondary sales.\n    /// @param royaltyRecipient The address that will receive the royalty payments.\n    struct RoyaltyConfiguration {\n        uint32 royaltyMintSchedule;\n        uint32 royaltyBPS;\n        address royaltyRecipient;\n    }\n\n    /// @notice Event emitted when royalties are updated\n    event UpdatedRoyalties(uint256 indexed tokenId, address indexed user, RoyaltyConfiguration configuration);\n\n    /// @notice External data getter to get royalties for a token\n    /// @param tokenId tokenId to get royalties configuration for\n    function getRoyalties(uint256 tokenId) external view returns (RoyaltyConfiguration memory);\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../ERC1967/ERC1967UpgradeUpgradeable.sol\";\nimport \"./Initializable.sol\";\n\nerror FUNCTION_MUST_BE_CALLED_THROUGH_DELEGATECALL();\nerror FUNCTION_MUST_BE_CALLED_THROUGH_ACTIVE_PROXY();\nerror UUPS_UPGRADEABLE_MUST_NOT_BE_CALLED_THROUGH_DELEGATECALL();\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n    address private immutable __self = address(this);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        if (address(this) == __self) {\n            revert FUNCTION_MUST_BE_CALLED_THROUGH_DELEGATECALL();\n        }\n        if (_getImplementation() != __self) {\n            revert FUNCTION_MUST_BE_CALLED_THROUGH_ACTIVE_PROXY();\n        }\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        if (address(this) != __self) {\n            revert UUPS_UPGRADEABLE_MUST_NOT_BE_CALLED_THROUGH_DELEGATECALL();\n        }\n        _;\n    }\n\n    /**\n     * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n        return _IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeTo(address newImplementation) public virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data, true);\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeTo} and {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal override onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\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"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/utils/ownable/Ownable2StepUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {IOwnable2StepUpgradeable} from \"./IOwnable2StepUpgradeable.sol\";\nimport {IOwnable2StepStorageV1} from \"./IOwnable2StepStorageV1.sol\";\nimport {Initializable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\";\n\n/// @title Ownable\n/// @author Rohan Kulkarni / Iain Nash\n/// @notice Modified from OpenZeppelin Contracts v4.7.3 (access/OwnableUpgradeable.sol)\n/// - Uses custom errors declared in IOwnable\n/// - Adds optional two-step ownership transfer (`safeTransferOwnership` + `acceptOwnership`)\nabstract contract Ownable2StepUpgradeable is IOwnable2StepUpgradeable, IOwnable2StepStorageV1, Initializable {\n    ///                                                          ///\n    ///                            STORAGE                       ///\n    ///                                                          ///\n\n    /// @dev Modifier to check if the address argument is the zero/burn address\n    modifier notZeroAddress(address check) {\n        if (check == address(0)) {\n            revert OWNER_CANNOT_BE_ZERO_ADDRESS();\n        }\n        _;\n    }\n\n    ///                                                          ///\n    ///                           MODIFIERS                      ///\n    ///                                                          ///\n\n    /// @dev Ensures the caller is the owner\n    modifier onlyOwner() {\n        if (msg.sender != _owner) {\n            revert ONLY_OWNER();\n        }\n        _;\n    }\n\n    /// @dev Ensures the caller is the pending owner\n    modifier onlyPendingOwner() {\n        if (msg.sender != _pendingOwner) {\n            revert ONLY_PENDING_OWNER();\n        }\n        _;\n    }\n\n    ///                                                          ///\n    ///                           FUNCTIONS                      ///\n    ///                                                          ///\n\n    /// @dev Initializes contract ownership\n    /// @param _initialOwner The initial owner address\n    function __Ownable_init(address _initialOwner) internal notZeroAddress(_initialOwner) onlyInitializing {\n        _owner = _initialOwner;\n\n        emit OwnerUpdated(address(0), _initialOwner);\n    }\n\n    /// @notice The address of the owner\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /// @notice The address of the pending owner\n    function pendingOwner() public view returns (address) {\n        return _pendingOwner;\n    }\n\n    /// @notice Forces an ownership transfer from the last owner\n    /// @param _newOwner The new owner address\n    function transferOwnership(address _newOwner) public notZeroAddress(_newOwner) onlyOwner {\n        _transferOwnership(_newOwner);\n    }\n\n    /// @notice Forces an ownership transfer from any sender\n    /// @param _newOwner New owner to transfer contract to\n    /// @dev Ensure is called only from trusted internal code, no access control checks.\n    function _transferOwnership(address _newOwner) internal {\n        emit OwnerUpdated(_owner, _newOwner);\n\n        _owner = _newOwner;\n\n        if (_pendingOwner != address(0)) {\n            delete _pendingOwner;\n        }\n    }\n\n    /// @notice Initiates a two-step ownership transfer\n    /// @param _newOwner The new owner address\n    function safeTransferOwnership(address _newOwner) public notZeroAddress(_newOwner) onlyOwner {\n        _pendingOwner = _newOwner;\n\n        emit OwnerPending(_owner, _newOwner);\n    }\n\n    /// @notice Resign ownership of contract\n    /// @dev only callably by the owner, dangerous call.\n    function resignOwnership() public onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /// @notice Accepts an ownership transfer\n    function acceptOwnership() public onlyPendingOwner {\n        emit OwnerUpdated(_owner, msg.sender);\n\n        _transferOwnership(msg.sender);\n    }\n\n    /// @notice Cancels a pending ownership transfer\n    function cancelOwnershipTransfer() public onlyOwner {\n        emit OwnerCanceled(_owner, _pendingOwner);\n\n        delete _pendingOwner;\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IContractMetadata.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IHasContractName {\n    /// @notice Contract name returns the pretty contract name\n    function contractName() external returns (string memory);\n}\n\ninterface IContractMetadata is IHasContractName {\n    /// @notice Contract URI returns the uri for more information about the given contract\n    function contractURI() external returns (string memory);\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IERC165Upgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol\";\nimport {IERC1155MetadataURIUpgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1155MetadataURIUpgradeable.sol\";\nimport {IZoraCreator1155TypesV1} from \"../nft/IZoraCreator1155TypesV1.sol\";\nimport {IZoraCreator1155Errors} from \"./IZoraCreator1155Errors.sol\";\nimport {IRenderer1155} from \"../interfaces/IRenderer1155.sol\";\nimport {IMinter1155} from \"../interfaces/IMinter1155.sol\";\nimport {IOwnable} from \"../interfaces/IOwnable.sol\";\nimport {IVersionedContract} from \"@zoralabs/shared-contracts/interfaces/IVersionedContract.sol\";\nimport {ICreatorRoyaltiesControl} from \"../interfaces/ICreatorRoyaltiesControl.sol\";\nimport {IZoraCreator1155DelegatedCreation} from \"./IZoraCreator1155DelegatedCreation.sol\";\nimport {IMintWithRewardsRecipients} from \"./IMintWithRewardsRecipients.sol\";\nimport {IMintWithMints} from \"@zoralabs/mints-contracts/src/IMintWithMints.sol\";\n\n/*\n\n\n             ░░░░░░░░░░░░░░              \n        ░░▒▒░░░░░░░░░░░░░░░░░░░░        \n      ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░      \n    ░░▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░    \n   ░▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░    \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░░  \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░░░  \n  ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░  \n  ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░  \n   ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░  \n    ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░    \n    ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░    \n      ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░      \n          ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░          \n\n               OURS TRULY,\n\n */\n\n/// @notice Main interface for the ZoraCreator1155 contract\n/// @author @iainnash / @tbtstl\ninterface IZoraCreator1155 is\n    IZoraCreator1155TypesV1,\n    IZoraCreator1155Errors,\n    IVersionedContract,\n    IOwnable,\n    IERC1155MetadataURIUpgradeable,\n    IZoraCreator1155DelegatedCreation,\n    IMintWithRewardsRecipients,\n    IMintWithMints\n{\n    function PERMISSION_BIT_ADMIN() external returns (uint256);\n\n    /// @notice This user role allows for only mint actions to be performed\n    function PERMISSION_BIT_MINTER() external returns (uint256);\n\n    /// @notice This user role allows for only managing sales configurations\n    function PERMISSION_BIT_SALES() external returns (uint256);\n\n    /// @notice This user role allows for only managing metadata configuration\n    function PERMISSION_BIT_METADATA() external returns (uint256);\n\n    /// @notice This user role allows for only withdrawing funds and setting funds withdraw address\n    function PERMISSION_BIT_FUNDS_MANAGER() external returns (uint256);\n\n    /// @notice Used to label the configuration update type\n    enum ConfigUpdate {\n        OWNER,\n        FUNDS_RECIPIENT,\n        TRANSFER_HOOK\n    }\n    event ConfigUpdated(address indexed updater, ConfigUpdate indexed updateType, ContractConfig newConfig);\n\n    event UpdatedToken(address indexed from, uint256 indexed tokenId, TokenData tokenData);\n    event SetupNewToken(uint256 indexed tokenId, address indexed sender, string newURI, uint256 maxSupply);\n\n    function setOwner(address newOwner) external;\n\n    function owner() external view returns (address);\n\n    event ContractRendererUpdated(IRenderer1155 renderer);\n    event ContractMetadataUpdated(address indexed updater, string uri, string name);\n    event Purchased(address indexed sender, address indexed minter, uint256 indexed tokenId, uint256 quantity, uint256 value);\n\n    /// @dev Deprecated: call mint\n    function mintWithRewards(IMinter1155 minter, uint256 tokenId, uint256 quantity, bytes calldata minterArguments, address mintReferral) external payable;\n\n    function adminMint(address recipient, uint256 tokenId, uint256 quantity, bytes memory data) external;\n\n    function burnBatch(address user, uint256[] calldata tokenIds, uint256[] calldata amounts) external;\n\n    /// @notice Contract call to setupNewToken\n    /// @param tokenURI URI for the token\n    /// @param maxSupply maxSupply for the token, set to 0 for open edition\n    function setupNewToken(string memory tokenURI, uint256 maxSupply) external returns (uint256 tokenId);\n\n    function setupNewTokenWithCreateReferral(string calldata newURI, uint256 maxSupply, address createReferral) external returns (uint256);\n\n    function getCreatorRewardRecipient(uint256 tokenId) external view returns (address);\n\n    function updateTokenURI(uint256 tokenId, string memory _newURI) external;\n\n    function updateContractMetadata(string memory _newURI, string memory _newName) external;\n\n    // Public interface for `setTokenMetadataRenderer(uint256, address) has been deprecated.\n\n    function contractURI() external view returns (string memory);\n\n    function assumeLastTokenIdMatches(uint256 tokenId) external;\n\n    function updateRoyaltiesForToken(uint256 tokenId, ICreatorRoyaltiesControl.RoyaltyConfiguration memory royaltyConfiguration) external;\n\n    /// @notice Set funds recipient address\n    /// @param fundsRecipient new funds recipient address\n    function setFundsRecipient(address payable fundsRecipient) external;\n\n    /// @notice Allows the create referral to update the address that can claim their rewards\n    function updateCreateReferral(uint256 tokenId, address recipient) external;\n\n    function addPermission(uint256 tokenId, address user, uint256 permissionBits) external;\n\n    function removePermission(uint256 tokenId, address user, uint256 permissionBits) external;\n\n    function isAdminOrRole(address user, uint256 tokenId, uint256 role) external view returns (bool);\n\n    function getTokenInfo(uint256 tokenId) external view returns (TokenData memory);\n\n    function callRenderer(uint256 tokenId, bytes memory data) external;\n\n    function callSale(uint256 tokenId, IMinter1155 salesConfig, bytes memory data) external;\n\n    function mintFee() external view returns (uint256);\n\n    /// @notice Withdraws all ETH from the contract to the funds recipient address\n    function withdraw() external;\n\n    /// @notice Returns the current implementation address\n    function implementation() external view returns (address);\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155Errors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {IZoraCreator1155Errors} from \"@zoralabs/shared-contracts/interfaces/errors/IZoraCreator1155Errors.sol\";\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155Factory.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {ICreatorRoyaltiesControl} from \"./ICreatorRoyaltiesControl.sol\";\nimport {IMinter1155} from \"./IMinter1155.sol\";\nimport {IVersionedContract} from \"@zoralabs/shared-contracts/interfaces/IVersionedContract.sol\";\n\n/// @notice Factory for 1155 contracts\n/// @author @iainnash / @tbtstl\ninterface IZoraCreator1155Factory is IVersionedContract {\n    error Constructor_ImplCannotBeZero();\n    error UpgradeToMismatchedContractName(string expected, string actual);\n\n    event FactorySetup();\n    event SetupNewContract(\n        address indexed newContract,\n        address indexed creator,\n        address indexed defaultAdmin,\n        string contractURI,\n        string name,\n        ICreatorRoyaltiesControl.RoyaltyConfiguration defaultRoyaltyConfiguration\n    );\n\n    function createContract(\n        string memory contractURI,\n        string calldata name,\n        ICreatorRoyaltiesControl.RoyaltyConfiguration memory defaultRoyaltyConfiguration,\n        address payable defaultAdmin,\n        bytes[] calldata setupActions\n    ) external returns (address);\n\n    /// @notice creates the contract, using a deterministic address based on the name, contract uri, and defaultAdmin\n    function createContractDeterministic(\n        string calldata contractURI,\n        string calldata name,\n        ICreatorRoyaltiesControl.RoyaltyConfiguration calldata defaultRoyaltyConfiguration,\n        address payable defaultAdmin,\n        bytes[] calldata setupActions\n    ) external returns (address);\n\n    function deterministicContractAddress(\n        address msgSender,\n        string calldata newContractURI,\n        string calldata name,\n        address contractAdmin\n    ) external view returns (address);\n\n    function defaultMinters() external returns (IMinter1155[] memory minters);\n\n    function initialize(address _owner) external;\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/shared/SharedBaseConstants.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\ncontract SharedBaseConstants {\n    uint256 public constant CONTRACT_BASE_ID = 0;\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/minters/fixed-price/ZoraCreatorFixedPriceSaleStrategy.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {Enjoy} from \"_imagine/mint/Enjoy.sol\";\nimport {IMinter1155} from \"../../interfaces/IMinter1155.sol\";\nimport {ICreatorCommands} from \"../../interfaces/ICreatorCommands.sol\";\nimport {SaleStrategy} from \"../SaleStrategy.sol\";\nimport {SaleCommandHelper} from \"../utils/SaleCommandHelper.sol\";\nimport {LimitedMintPerAddress} from \"../utils/LimitedMintPerAddress.sol\";\nimport {IMinterErrors} from \"../../interfaces/IMinterErrors.sol\";\n\n/*\n\n\n             ░░░░░░░░░░░░░░              \n        ░░▒▒░░░░░░░░░░░░░░░░░░░░        \n      ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░      \n    ░░▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░    \n   ░▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░    \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░░  \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░░░  \n  ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░  \n  ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░  \n   ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░  \n    ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░    \n    ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░    \n      ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░      \n          ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░          \n\n               OURS TRULY,\n\n\n    github.com/ourzora/zora-1155-contracts\n\n*/\n\n/// @title ZoraCreatorFixedPriceSaleStrategy\n/// @notice A sale strategy for ZoraCreator that allows for fixed price sales over a given time period\n/// @author @iainnash / @tbtstl\ncontract ZoraCreatorFixedPriceSaleStrategy is Enjoy, SaleStrategy, LimitedMintPerAddress, IMinterErrors {\n    struct SalesConfig {\n        /// @notice Unix timestamp for the sale start\n        uint64 saleStart;\n        /// @notice Unix timestamp for the sale end\n        uint64 saleEnd;\n        /// @notice Max tokens that can be minted for an address, 0 if unlimited\n        uint64 maxTokensPerAddress;\n        /// @notice Price per token in eth wei\n        uint96 pricePerToken;\n        /// @notice Funds recipient (0 if no different funds recipient than the contract global)\n        address fundsRecipient;\n    }\n\n    // target -> tokenId -> settings\n    mapping(address => mapping(uint256 => SalesConfig)) internal salesConfigs;\n\n    using SaleCommandHelper for ICreatorCommands.CommandSet;\n\n    function contractURI() external pure override returns (string memory) {\n        return \"https://github.com/ourzora/zora-1155-contracts/\";\n    }\n\n    /// @notice The name of the sale strategy\n    function contractName() external pure override returns (string memory) {\n        return \"Fixed Price Sale Strategy\";\n    }\n\n    /// @notice The version of the sale strategy\n    function contractVersion() external pure override returns (string memory) {\n        return \"1.1.0\";\n    }\n\n    event SaleSet(address indexed mediaContract, uint256 indexed tokenId, SalesConfig salesConfig);\n    event MintComment(address indexed sender, address indexed tokenContract, uint256 indexed tokenId, uint256 quantity, string comment);\n\n    /// @notice Compiles and returns the commands needed to mint a token using this sales strategy\n    /// @param tokenId The token ID to mint\n    /// @param quantity The quantity of tokens to mint\n    /// @param ethValueSent The amount of ETH sent with the transaction\n    /// @param minterArguments The arguments passed to the minter, which should be the address to mint to\n    function requestMint(\n        address,\n        uint256 tokenId,\n        uint256 quantity,\n        uint256 ethValueSent,\n        bytes calldata minterArguments\n    ) external returns (ICreatorCommands.CommandSet memory commands) {\n        address mintTo;\n        string memory comment = \"\";\n        if (minterArguments.length == 32) {\n            mintTo = abi.decode(minterArguments, (address));\n        } else {\n            (mintTo, comment) = abi.decode(minterArguments, (address, string));\n        }\n\n        SalesConfig storage config = salesConfigs[msg.sender][tokenId];\n\n        // If sales config does not exist this first check will always fail.\n\n        // Check sale end\n        if (block.timestamp > config.saleEnd) {\n            revert SaleEnded();\n        }\n\n        // Check sale start\n        if (block.timestamp < config.saleStart) {\n            revert SaleHasNotStarted();\n        }\n\n        // Check value sent\n        if (config.pricePerToken * quantity != ethValueSent) {\n            revert WrongValueSent();\n        }\n\n        // Check minted per address limit\n        if (config.maxTokensPerAddress > 0) {\n            _requireMintNotOverLimitAndUpdate(config.maxTokensPerAddress, quantity, msg.sender, tokenId, mintTo);\n        }\n\n        bool shouldTransferFunds = config.fundsRecipient != address(0);\n        commands.setSize(shouldTransferFunds ? 2 : 1);\n\n        // Mint command\n        commands.mint(mintTo, tokenId, quantity);\n\n        if (bytes(comment).length > 0) {\n            emit MintComment(mintTo, msg.sender, tokenId, quantity, comment);\n        }\n\n        // Should transfer funds if funds recipient is set to a non-default address\n        if (shouldTransferFunds) {\n            commands.transfer(config.fundsRecipient, ethValueSent);\n        }\n    }\n\n    /// @notice Sets the sale config for a given token\n    function setSale(uint256 tokenId, SalesConfig memory salesConfig) external {\n        salesConfigs[msg.sender][tokenId] = salesConfig;\n\n        // Emit event\n        emit SaleSet(msg.sender, tokenId, salesConfig);\n    }\n\n    /// @notice Deletes the sale config for a given token\n    function resetSale(uint256 tokenId) external override {\n        delete salesConfigs[msg.sender][tokenId];\n\n        // Deleted sale emit event\n        emit SaleSet(msg.sender, tokenId, salesConfigs[msg.sender][tokenId]);\n    }\n\n    /// @notice Returns the sale config for a given token\n    function sale(address tokenContract, uint256 tokenId) external view returns (SalesConfig memory) {\n        return salesConfigs[tokenContract][tokenId];\n    }\n\n    function supportsInterface(bytes4 interfaceId) public pure virtual override(LimitedMintPerAddress, SaleStrategy) returns (bool) {\n        return super.supportsInterface(interfaceId) || LimitedMintPerAddress.supportsInterface(interfaceId) || SaleStrategy.supportsInterface(interfaceId);\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IMinter1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IMinter1155} from \"@zoralabs/shared-contracts/interfaces/IMinter1155.sol\";\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/delegation/ERC1155DelegationStorageV1.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\ncontract ERC1155DelegationStorageV1 {\n    mapping(uint32 => uint256) public delegatedTokenId;\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/delegation/ZoraCreator1155PremintExecutorImplLib.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {ContractCreationConfig, PremintConfig, PremintResult, MintArguments} from \"@zoralabs/shared-contracts/entities/Premint.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {IERC20Minter} from \"../interfaces/IERC20Minter.sol\";\nimport {IZoraCreator1155} from \"../interfaces/IZoraCreator1155.sol\";\nimport {IZoraCreator1155Factory} from \"../interfaces/IZoraCreator1155Factory.sol\";\nimport {ICreatorRoyaltiesControl} from \"../interfaces/ICreatorRoyaltiesControl.sol\";\nimport {IMinter1155} from \"../interfaces/IMinter1155.sol\";\nimport {IZoraCreator1155PremintExecutor} from \"../interfaces/IZoraCreator1155PremintExecutor.sol\";\nimport {IZoraCreator1155DelegatedCreation, IZoraCreator1155DelegatedCreationLegacy, ISupportsAABasedDelegatedTokenCreation} from \"../interfaces/IZoraCreator1155DelegatedCreation.sol\";\nimport {EncodedPremintConfig} from \"@zoralabs/shared-contracts/premint/PremintEncoding.sol\";\nimport {IMintWithRewardsRecipients} from \"../interfaces/IMintWithRewardsRecipients.sol\";\nimport {IERC20Minter} from \"../interfaces/IERC20Minter.sol\";\n\ninterface ILegacyZoraCreator1155DelegatedMinter {\n    function delegateSetupNewToken(PremintConfig calldata premintConfig, bytes calldata signature, address sender) external returns (uint256 newTokenId);\n}\n\nlibrary ZoraCreator1155PremintExecutorImplLib {\n    function getOrCreateContract(\n        IZoraCreator1155Factory zora1155Factory,\n        ContractCreationConfig calldata contractConfig\n    ) internal returns (IZoraCreator1155 tokenContract, bool isNewContract) {\n        address contractAddress = getContractAddress(zora1155Factory, contractConfig);\n        // first we see if the code is already deployed for the contract\n        isNewContract = contractAddress.code.length == 0;\n\n        if (isNewContract) {\n            // if address doesn't exist for hash, create it\n            tokenContract = createContract(zora1155Factory, contractConfig);\n        } else {\n            tokenContract = IZoraCreator1155(contractAddress);\n        }\n    }\n\n    function createContract(\n        IZoraCreator1155Factory zora1155Factory,\n        ContractCreationConfig calldata contractConfig\n    ) internal returns (IZoraCreator1155 tokenContract) {\n        // we need to build the setup actions, that must:\n        bytes[] memory setupActions = new bytes[](0);\n\n        // create the contract via the factory.\n        address newContractAddresss = zora1155Factory.createContractDeterministic(\n            contractConfig.contractURI,\n            contractConfig.contractName,\n            // default royalty config is empty, since we set it on a token level\n            ICreatorRoyaltiesControl.RoyaltyConfiguration({royaltyBPS: 0, royaltyRecipient: address(0), royaltyMintSchedule: 0}),\n            payable(contractConfig.contractAdmin),\n            setupActions\n        );\n        tokenContract = IZoraCreator1155(newContractAddresss);\n    }\n\n    /// Gets the deterministic contract address for the given contract creation config.\n    /// Contract address is generated deterministically from a hash based on the contract uri, contract name,\n    /// contract admin, and the msg.sender, which is this contract's address.\n    function getContractAddress(IZoraCreator1155Factory zora1155Factory, ContractCreationConfig calldata contractConfig) internal view returns (address) {\n        return\n            zora1155Factory.deterministicContractAddress(address(this), contractConfig.contractURI, contractConfig.contractName, contractConfig.contractAdmin);\n    }\n\n    function encodeMintArguments(address mintRecipient, string memory mintComment) internal pure returns (bytes memory) {\n        return abi.encode(mintRecipient, mintComment);\n    }\n\n    function decodeMintArguments(bytes memory mintArguments) internal pure returns (address mintRecipient, string memory mintComment) {\n        return abi.decode(mintArguments, (address, string));\n    }\n\n    function legacySetupNewToken(address contractAddress, bytes memory encodedPremintConfig, bytes calldata signature) private returns (uint256) {\n        // for use when the erc1155 contract does not support the new delegateSetupNewToken interface, where it expects\n        // a PremintConfig as an argument.\n\n        // decode the PremintConfig from the encoded bytes.\n        PremintConfig memory premintConfig = abi.decode(encodedPremintConfig, (PremintConfig));\n\n        // call the legacy version of the delegateSetupNewToken function.\n        return ILegacyZoraCreator1155DelegatedMinter(contractAddress).delegateSetupNewToken(premintConfig, signature, msg.sender);\n    }\n\n    function getOrCreateContractAndToken(\n        IZoraCreator1155Factory zora1155Factory,\n        ContractCreationConfig calldata contractConfig,\n        EncodedPremintConfig memory encodedPremintConfig,\n        bytes calldata signature,\n        address firstMinter,\n        address signerContract\n    ) internal returns (PremintResult memory premintResult) {\n        // get or create the contract with the given params\n        // contract address is deterministic.\n        (IZoraCreator1155 tokenContract, bool isNewContract) = getOrCreateContract(zora1155Factory, contractConfig);\n\n        premintResult.contractAddress = address(tokenContract);\n        premintResult.createdNewContract = isNewContract;\n\n        if (tokenContract.supportsInterface(type(ISupportsAABasedDelegatedTokenCreation).interfaceId)) {\n            // if the contract supports the new interface, we can use it to create the token.\n\n            // pass the signature and the premint config to the token contract to create the token.\n            // The token contract will verify the signature and that the signer has permission to create a new token.\n            // and then create and setup the token using the given token config.\n            premintResult.tokenId = ISupportsAABasedDelegatedTokenCreation(tokenContract).delegateSetupNewToken(\n                encodedPremintConfig.premintConfig,\n                encodedPremintConfig.premintConfigVersion,\n                signature,\n                firstMinter,\n                signerContract\n            );\n        } else if (tokenContract.supportsInterface(type(IZoraCreator1155DelegatedCreationLegacy).interfaceId)) {\n            if (signerContract != address(0)) {\n                revert(\"Smart contract signing not supported on version of 1155 contract\");\n            }\n\n            premintResult.tokenId = IZoraCreator1155DelegatedCreationLegacy(address(tokenContract)).delegateSetupNewToken(\n                encodedPremintConfig.premintConfig,\n                encodedPremintConfig.premintConfigVersion,\n                signature,\n                firstMinter\n            );\n        } else {\n            // otherwise, we need to use the legacy interface.\n            premintResult.tokenId = legacySetupNewToken(address(tokenContract), encodedPremintConfig.premintConfig, signature);\n        }\n    }\n\n    function performERC20Mint(\n        address erc20Minter,\n        address currency,\n        uint256 pricePerToken,\n        uint256 quantityToMint,\n        PremintResult memory premintResult,\n        MintArguments memory mintArguments\n    ) internal {\n        if (quantityToMint != 0) {\n            address mintReferral = mintArguments.mintRewardsRecipients.length > 0 ? mintArguments.mintRewardsRecipients[0] : address(0);\n\n            uint256 totalValue = pricePerToken * quantityToMint;\n\n            uint256 beforeBalance = IERC20(currency).balanceOf(address(this));\n            IERC20(currency).transferFrom(msg.sender, address(this), totalValue);\n            uint256 afterBalance = IERC20(currency).balanceOf(address(this));\n\n            if ((beforeBalance + totalValue) != afterBalance) {\n                revert IERC20Minter.ERC20TransferSlippage();\n            }\n\n            IERC20(currency).approve(erc20Minter, totalValue);\n\n            IERC20Minter(erc20Minter).mint(\n                mintArguments.mintRecipient,\n                quantityToMint,\n                premintResult.contractAddress,\n                premintResult.tokenId,\n                totalValue,\n                currency,\n                mintReferral,\n                mintArguments.mintComment\n            );\n        }\n    }\n\n    function mintWithEth(\n        IZoraCreator1155 tokenContract,\n        address fixedPriceMinter,\n        uint256 tokenId,\n        uint256 quantityToMint,\n        MintArguments memory mintArguments\n    ) internal {\n        bytes memory mintSettings = _toMintSettings(mintArguments);\n        if (quantityToMint != 0) {\n            if (tokenContract.supportsInterface(type(IMintWithRewardsRecipients).interfaceId)) {\n                tokenContract.mint{value: msg.value}(IMinter1155(fixedPriceMinter), tokenId, quantityToMint, mintArguments.mintRewardsRecipients, mintSettings);\n            } else {\n                // mint the number of specified tokens to the executor\n                address mintReferral = mintArguments.mintRewardsRecipients.length > 0 ? mintArguments.mintRewardsRecipients[0] : address(0);\n\n                tokenContract.mintWithRewards{value: msg.value}(IMinter1155(fixedPriceMinter), tokenId, quantityToMint, mintSettings, mintReferral);\n            }\n        }\n    }\n\n    function _toMintSettings(MintArguments memory mintArguments) internal pure returns (bytes memory) {\n        return abi.encode(mintArguments.mintRecipient, mintArguments.mintComment);\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/delegation/ZoraCreator1155Attribution.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {IMinter1155} from \"../interfaces/IMinter1155.sol\";\nimport {IZoraCreator1155} from \"../interfaces/IZoraCreator1155.sol\";\nimport {IZoraCreator1155Errors} from \"@zoralabs/shared-contracts/interfaces/errors/IZoraCreator1155Errors.sol\";\nimport {ICreatorRoyaltiesControl} from \"../interfaces/ICreatorRoyaltiesControl.sol\";\nimport {ECDSAUpgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/ECDSAUpgradeable.sol\";\nimport {ZoraCreatorFixedPriceSaleStrategy} from \"../minters/fixed-price/ZoraCreatorFixedPriceSaleStrategy.sol\";\nimport {PremintEncoding} from \"@zoralabs/shared-contracts/premint/PremintEncoding.sol\";\nimport {IERC20Minter, ERC20Minter} from \"../minters/erc20/ERC20Minter.sol\";\nimport {IERC1271} from \"../interfaces/IERC1271.sol\";\n\nimport {PremintConfig, ContractCreationConfig, TokenCreationConfig, PremintConfigV2, TokenCreationConfigV2, Erc20TokenCreationConfigV1, Erc20PremintConfigV1} from \"@zoralabs/shared-contracts/entities/Premint.sol\";\n\nlibrary ZoraCreator1155Attribution {\n    string internal constant NAME = \"Preminter\";\n    bytes32 internal constant HASHED_NAME = keccak256(bytes(NAME));\n\n    /**\n     * @dev Returns the domain separator for the specified chain.\n     */\n    function _domainSeparatorV4(uint256 chainId, address verifyingContract, bytes32 hashedName, bytes32 hashedVersion) private pure returns (bytes32) {\n        return _buildDomainSeparator(hashedName, hashedVersion, verifyingContract, chainId);\n    }\n\n    function _buildDomainSeparator(bytes32 nameHash, bytes32 versionHash, address verifyingContract, uint256 chainId) private pure returns (bytes32) {\n        return keccak256(abi.encode(TYPE_HASH, nameHash, versionHash, chainId, verifyingContract));\n    }\n\n    function _hashTypedDataV4(\n        bytes32 structHash,\n        bytes32 hashedName,\n        bytes32 hashedVersion,\n        address verifyingContract,\n        uint256 chainId\n    ) private pure returns (bytes32) {\n        return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(chainId, verifyingContract, hashedName, hashedVersion), structHash);\n    }\n\n    /// @notice Define magic value to verify smart contract signatures (ERC1271).\n    bytes4 internal constant MAGIC_VALUE = bytes4(keccak256(\"isValidSignature(bytes32,bytes)\"));\n\n    function recoverSignerHashed(\n        bytes32 hashedPremintConfig,\n        bytes calldata signature,\n        address erc1155Contract,\n        bytes32 signatureVersion,\n        uint256 chainId,\n        address premintSignerContract\n    ) internal view returns (address signatory) {\n        // first validate the signature - the creator must match the signer of the message\n        bytes32 digest = premintHashedTypeDataV4(\n            hashedPremintConfig,\n            // here we pass the current contract and chain id, ensuring that the message\n            // only works for the current chain and contract id\n            erc1155Contract,\n            signatureVersion,\n            chainId\n        );\n\n        if (premintSignerContract != address(0)) {\n            // if the smart contract wallet is set, then the signature must be validated by that address\n            if (premintSignerContract.code.length == 0) {\n                revert IZoraCreator1155Errors.premintSignerContractNotAContract();\n            }\n\n            try IERC1271(premintSignerContract).isValidSignature(digest, signature) returns (bytes4 magicValue) {\n                if (MAGIC_VALUE == magicValue) {\n                    return premintSignerContract;\n                }\n                revert IZoraCreator1155Errors.InvalidSigner(magicValue);\n            } catch {\n                revert IZoraCreator1155Errors.premintSignerContractFailedToRecoverSigner();\n            }\n        } else {\n            ECDSAUpgradeable.RecoverError recoverError;\n            // if the smart contract signer is not set, then the signature must be from the signer of the message\n            (signatory, recoverError) = ECDSAUpgradeable.tryRecover(digest, signature);\n\n            if (recoverError != ECDSAUpgradeable.RecoverError.NoError) {\n                revert IZoraCreator1155Errors.InvalidSignature();\n            }\n        }\n    }\n\n    /// Gets hash data to sign for a premint.\n    /// @param erc1155Contract Contract address that signature is to be verified against\n    /// @param chainId Chain id that signature is to be verified on\n    function premintHashedTypeDataV4(bytes32 structHash, address erc1155Contract, bytes32 signatureVersion, uint256 chainId) internal pure returns (bytes32) {\n        // build the struct hash to be signed\n        // here we pass the chain id, allowing the message to be signed for another chain\n        return _hashTypedDataV4(structHash, HASHED_NAME, signatureVersion, erc1155Contract, chainId);\n    }\n\n    bytes32 constant ATTRIBUTION_DOMAIN_V1 =\n        keccak256(\n            \"CreatorAttribution(TokenCreationConfig tokenConfig,uint32 uid,uint32 version,bool deleted)TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyMintSchedule,uint32 royaltyBPS,address royaltyRecipient,address fixedPriceMinter)\"\n        );\n\n    function hashPremint(PremintConfig memory premintConfig) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(ATTRIBUTION_DOMAIN_V1, _hashToken(premintConfig.tokenConfig), premintConfig.uid, premintConfig.version, premintConfig.deleted)\n            );\n    }\n\n    bytes32 constant ATTRIBUTION_DOMAIN_V2 =\n        keccak256(\n            \"CreatorAttribution(TokenCreationConfig tokenConfig,uint32 uid,uint32 version,bool deleted)TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyBPS,address payoutRecipient,address fixedPriceMinter,address createReferral)\"\n        );\n\n    function hashPremint(PremintConfigV2 memory premintConfig) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(ATTRIBUTION_DOMAIN_V2, _hashToken(premintConfig.tokenConfig), premintConfig.uid, premintConfig.version, premintConfig.deleted)\n            );\n    }\n\n    bytes32 constant ATTRIBUTION_DOMAIN_ERC20_V1 =\n        keccak256(\n            \"CreatorAttribution(TokenCreationConfig tokenConfig,uint32 uid,uint32 version,bool deleted)TokenCreationConfig(string tokenURI,uint256 maxSupply,uint32 royaltyBPS,address payoutRecipient,address createReferral,address erc20Minter,uint64 mintStart,uint64 mintDuration,uint64 maxTokensPerAddress,address currency,uint256 pricePerToken)\"\n        );\n\n    function hashPremint(Erc20PremintConfigV1 memory premintConfig) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(ATTRIBUTION_DOMAIN_ERC20_V1, _hashToken(premintConfig.tokenConfig), premintConfig.uid, premintConfig.version, premintConfig.deleted)\n            );\n    }\n\n    bytes32 constant TOKEN_DOMAIN_V1 =\n        keccak256(\n            \"TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyMintSchedule,uint32 royaltyBPS,address royaltyRecipient,address fixedPriceMinter)\"\n        );\n\n    function _hashToken(TokenCreationConfig memory tokenConfig) private pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    TOKEN_DOMAIN_V1,\n                    _stringHash(tokenConfig.tokenURI),\n                    tokenConfig.maxSupply,\n                    tokenConfig.maxTokensPerAddress,\n                    tokenConfig.pricePerToken,\n                    tokenConfig.mintStart,\n                    tokenConfig.mintDuration,\n                    tokenConfig.royaltyMintSchedule,\n                    tokenConfig.royaltyBPS,\n                    tokenConfig.royaltyRecipient,\n                    tokenConfig.fixedPriceMinter\n                )\n            );\n    }\n\n    bytes32 constant TOKEN_DOMAIN_V2 =\n        keccak256(\n            \"TokenCreationConfig(string tokenURI,uint256 maxSupply,uint64 maxTokensPerAddress,uint96 pricePerToken,uint64 mintStart,uint64 mintDuration,uint32 royaltyBPS,address payoutRecipient,address fixedPriceMinter,address createReferral)\"\n        );\n\n    function _hashToken(TokenCreationConfigV2 memory tokenConfig) private pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    TOKEN_DOMAIN_V2,\n                    _stringHash(tokenConfig.tokenURI),\n                    tokenConfig.maxSupply,\n                    tokenConfig.maxTokensPerAddress,\n                    tokenConfig.pricePerToken,\n                    tokenConfig.mintStart,\n                    tokenConfig.mintDuration,\n                    tokenConfig.royaltyBPS,\n                    tokenConfig.payoutRecipient,\n                    tokenConfig.fixedPriceMinter,\n                    tokenConfig.createReferral\n                )\n            );\n    }\n\n    bytes32 constant TOKEN_DOMAIN_ERC20_V1 =\n        keccak256(\n            \"TokenCreationConfig(string tokenURI,uint256 maxSupply,uint32 royaltyBPS,address payoutRecipient,address createReferral,address erc20Minter,uint64 mintStart,uint64 mintDuration,uint64 maxTokensPerAddress,address currency,uint256 pricePerToken)\"\n        );\n\n    function _hashToken(Erc20TokenCreationConfigV1 memory tokenConfig) private pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    TOKEN_DOMAIN_ERC20_V1,\n                    _stringHash(tokenConfig.tokenURI),\n                    tokenConfig.maxSupply,\n                    tokenConfig.royaltyBPS,\n                    tokenConfig.payoutRecipient,\n                    tokenConfig.createReferral,\n                    tokenConfig.erc20Minter,\n                    tokenConfig.mintStart,\n                    tokenConfig.mintDuration,\n                    tokenConfig.maxTokensPerAddress,\n                    tokenConfig.currency,\n                    tokenConfig.pricePerToken\n                )\n            );\n    }\n\n    bytes32 internal constant TYPE_HASH = keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    function _stringHash(string memory value) private pure returns (bytes32) {\n        return keccak256(bytes(value));\n    }\n\n    /// @notice copied from SharedBaseConstants\n    uint256 constant CONTRACT_BASE_ID = 0;\n    /// @dev copied from ZoraCreator1155Impl\n    uint256 constant PERMISSION_BIT_MINTER = 2 ** 2;\n\n    function isAuthorizedToCreatePremint(\n        address signer,\n        address premintContractConfigContractAdmin,\n        address contractAddress\n    ) internal view returns (bool authorized) {\n        // if contract hasn't been created, signer must be the contract admin on the premint config\n        if (contractAddress.code.length == 0) {\n            return signer == premintContractConfigContractAdmin;\n        } else {\n            // if contract has been created, signer must have mint new token permission\n            authorized = IZoraCreator1155(contractAddress).isAdminOrRole(signer, CONTRACT_BASE_ID, PERMISSION_BIT_MINTER);\n        }\n    }\n}\n\n/// @notice Utility library to setup tokens created via premint.  Functions exposed as external to not increase contract size in calling contract.\n/// @author oveddan\nlibrary PremintTokenSetup {\n    uint256 constant PERMISSION_BIT_MINTER = 2 ** 2;\n\n    /// @notice Build token setup actions for a v3 preminted token\n    function makeSetupNewTokenCalls(uint256 newTokenId, Erc20TokenCreationConfigV1 memory tokenConfig) internal view returns (bytes[] memory calls) {\n        return\n            _buildCalls({\n                newTokenId: newTokenId,\n                erc20MinterAddress: tokenConfig.erc20Minter,\n                currency: tokenConfig.currency,\n                pricePerToken: tokenConfig.pricePerToken,\n                maxTokensPerAddress: tokenConfig.maxTokensPerAddress,\n                mintDuration: tokenConfig.mintDuration,\n                royaltyBPS: tokenConfig.royaltyBPS,\n                payoutRecipient: tokenConfig.payoutRecipient\n            });\n    }\n\n    /// @notice Build token setup actions for a v2 preminted token\n    function makeSetupNewTokenCalls(uint256 newTokenId, TokenCreationConfigV2 memory tokenConfig) internal view returns (bytes[] memory calls) {\n        return\n            _buildCalls({\n                newTokenId: newTokenId,\n                fixedPriceMinterAddress: tokenConfig.fixedPriceMinter,\n                pricePerToken: tokenConfig.pricePerToken,\n                maxTokensPerAddress: tokenConfig.maxTokensPerAddress,\n                mintDuration: tokenConfig.mintDuration,\n                royaltyBPS: tokenConfig.royaltyBPS,\n                payoutRecipient: tokenConfig.payoutRecipient\n            });\n    }\n\n    /// @notice Build token setup actions for a v1 preminted token\n    function makeSetupNewTokenCalls(uint256 newTokenId, TokenCreationConfig memory tokenConfig) internal view returns (bytes[] memory calls) {\n        return\n            _buildCalls({\n                newTokenId: newTokenId,\n                fixedPriceMinterAddress: tokenConfig.fixedPriceMinter,\n                pricePerToken: tokenConfig.pricePerToken,\n                maxTokensPerAddress: tokenConfig.maxTokensPerAddress,\n                mintDuration: tokenConfig.mintDuration,\n                royaltyBPS: tokenConfig.royaltyBPS,\n                payoutRecipient: tokenConfig.royaltyRecipient\n            });\n    }\n\n    function _buildCalls(\n        uint256 newTokenId,\n        address erc20MinterAddress,\n        address currency,\n        uint256 pricePerToken,\n        uint64 maxTokensPerAddress,\n        uint64 mintDuration,\n        uint32 royaltyBPS,\n        address payoutRecipient\n    ) private view returns (bytes[] memory calls) {\n        calls = new bytes[](3);\n\n        calls[0] = abi.encodeWithSelector(IZoraCreator1155.addPermission.selector, newTokenId, erc20MinterAddress, PERMISSION_BIT_MINTER);\n\n        calls[1] = abi.encodeWithSelector(\n            IZoraCreator1155.callSale.selector,\n            newTokenId,\n            IMinter1155(erc20MinterAddress),\n            abi.encodeWithSelector(\n                IERC20Minter.setSale.selector,\n                newTokenId,\n                _buildNewERC20SalesConfig(currency, pricePerToken, maxTokensPerAddress, mintDuration, payoutRecipient)\n            )\n        );\n\n        calls[2] = abi.encodeWithSelector(\n            IZoraCreator1155.updateRoyaltiesForToken.selector,\n            newTokenId,\n            ICreatorRoyaltiesControl.RoyaltyConfiguration({royaltyBPS: royaltyBPS, royaltyRecipient: payoutRecipient, royaltyMintSchedule: 0})\n        );\n    }\n\n    function _buildCalls(\n        uint256 newTokenId,\n        address fixedPriceMinterAddress,\n        uint96 pricePerToken,\n        uint64 maxTokensPerAddress,\n        uint64 mintDuration,\n        uint32 royaltyBPS,\n        address payoutRecipient\n    ) private view returns (bytes[] memory calls) {\n        calls = new bytes[](3);\n\n        // build array of the calls to make\n        // get setup actions and invoke them\n        // set up the sales strategy\n        // first, grant the fixed price sale strategy minting capabilities on the token\n        // tokenContract.addPermission(newTokenId, address(fixedPriceMinter), PERMISSION_BIT_MINTER);\n        calls[0] = abi.encodeWithSelector(IZoraCreator1155.addPermission.selector, newTokenId, fixedPriceMinterAddress, PERMISSION_BIT_MINTER);\n\n        // set the sales config on that token\n        calls[1] = abi.encodeWithSelector(\n            IZoraCreator1155.callSale.selector,\n            newTokenId,\n            IMinter1155(fixedPriceMinterAddress),\n            abi.encodeWithSelector(\n                ZoraCreatorFixedPriceSaleStrategy.setSale.selector,\n                newTokenId,\n                _buildNewSalesConfig(pricePerToken, maxTokensPerAddress, mintDuration, payoutRecipient)\n            )\n        );\n\n        // set the royalty config on that token:\n        calls[2] = abi.encodeWithSelector(\n            IZoraCreator1155.updateRoyaltiesForToken.selector,\n            newTokenId,\n            ICreatorRoyaltiesControl.RoyaltyConfiguration({royaltyBPS: royaltyBPS, royaltyRecipient: payoutRecipient, royaltyMintSchedule: 0})\n        );\n    }\n\n    function _buildNewERC20SalesConfig(\n        address currency,\n        uint256 pricePerToken,\n        uint64 maxTokensPerAddress,\n        uint64 duration,\n        address payoutRecipient\n    ) private view returns (ERC20Minter.SalesConfig memory) {\n        uint64 saleStart = uint64(block.timestamp);\n        uint64 saleEnd = duration == 0 ? type(uint64).max : saleStart + duration;\n\n        return\n            IERC20Minter.SalesConfig({\n                saleStart: saleStart,\n                saleEnd: saleEnd,\n                maxTokensPerAddress: maxTokensPerAddress,\n                pricePerToken: pricePerToken,\n                fundsRecipient: payoutRecipient,\n                currency: currency\n            });\n    }\n\n    function _buildNewSalesConfig(\n        uint96 pricePerToken,\n        uint64 maxTokensPerAddress,\n        uint64 duration,\n        address payoutRecipient\n    ) private view returns (ZoraCreatorFixedPriceSaleStrategy.SalesConfig memory) {\n        uint64 saleStart = uint64(block.timestamp);\n        uint64 saleEnd = duration == 0 ? type(uint64).max : saleStart + duration;\n\n        return\n            ZoraCreatorFixedPriceSaleStrategy.SalesConfig({\n                pricePerToken: pricePerToken,\n                saleStart: saleStart,\n                saleEnd: saleEnd,\n                maxTokensPerAddress: maxTokensPerAddress,\n                fundsRecipient: payoutRecipient\n            });\n    }\n}\n\nstruct DecodedCreatorAttribution {\n    bytes32 structHash;\n    string domainName;\n    string version;\n    address creator;\n    bytes signature;\n}\n\nstruct DelegatedTokenSetup {\n    DecodedCreatorAttribution attribution;\n    uint32 uid;\n    string tokenURI;\n    uint256 maxSupply;\n    address createReferral;\n}\n\n/// @notice Utility library to decode and recover delegated token setup data from a signature.\n/// Function called by the erc1155 contract is marked external to reduce contract size in calling contract.\nlibrary DelegatedTokenCreation {\n    /// @notice Decode and recover delegated token setup data from a signature. Works with multiple versions of\n    /// a signature.  Takes an abi encoded premint config, version of the encoded premint config, and a signature,\n    /// decodes the config, and recoveres the signer of the config.  Based on the premint config, builds\n    /// setup actions for the token to be created.\n    /// @param premintConfigEncoded The abi encoded premint config\n    /// @param premintVersion The version of the premint config\n    /// @param signature The signature of the premint config\n    /// @param tokenContract The address of the token contract that the premint config is for\n    /// @param newTokenId The id of the token to be created\n    function decodeAndRecoverDelegatedTokenSetup(\n        bytes memory premintConfigEncoded,\n        bytes32 premintVersion,\n        bytes calldata signature,\n        address tokenContract,\n        uint256 newTokenId,\n        address premintSignerContract\n    ) external view returns (DelegatedTokenSetup memory params, DecodedCreatorAttribution memory creatorAttribution, bytes[] memory tokenSetupActions) {\n        // based on version of encoded premint config, decode corresponding premint config,\n        // and then recover signer from the signature, and then build token setup actions based\n        // on the decoded premint config.\n        if (premintVersion == PremintEncoding.HASHED_VERSION_1) {\n            PremintConfig memory premintConfig = abi.decode(premintConfigEncoded, (PremintConfig));\n\n            creatorAttribution = recoverCreatorAttribution(\n                PremintEncoding.VERSION_1,\n                ZoraCreator1155Attribution.hashPremint(premintConfig),\n                tokenContract,\n                signature,\n                premintSignerContract\n            );\n\n            (params, tokenSetupActions) = _recoverDelegatedTokenSetup(premintConfig, newTokenId);\n        } else if (premintVersion == PremintEncoding.HASHED_VERSION_2) {\n            PremintConfigV2 memory premintConfig = abi.decode(premintConfigEncoded, (PremintConfigV2));\n\n            creatorAttribution = recoverCreatorAttribution(\n                PremintEncoding.VERSION_2,\n                ZoraCreator1155Attribution.hashPremint(premintConfig),\n                tokenContract,\n                signature,\n                premintSignerContract\n            );\n\n            (params, tokenSetupActions) = _recoverDelegatedTokenSetup(premintConfig, newTokenId);\n        } else if (premintVersion == PremintEncoding.HASHED_ERC20_VERSION_1) {\n            Erc20PremintConfigV1 memory premintConfig = abi.decode(premintConfigEncoded, (Erc20PremintConfigV1));\n\n            creatorAttribution = recoverCreatorAttribution(\n                PremintEncoding.ERC20_VERSION_1,\n                ZoraCreator1155Attribution.hashPremint(premintConfig),\n                tokenContract,\n                signature,\n                premintSignerContract\n            );\n\n            (params, tokenSetupActions) = _recoverDelegatedTokenSetup(premintConfig, newTokenId);\n        } else {\n            revert IZoraCreator1155Errors.InvalidPremintVersion();\n        }\n    }\n\n    function supportedPremintSignatureVersions() external pure returns (string[] memory versions) {\n        return _supportedPremintSignatureVersions();\n    }\n\n    function _supportedPremintSignatureVersions() internal pure returns (string[] memory versions) {\n        versions = new string[](3);\n        versions[0] = PremintEncoding.VERSION_1;\n        versions[1] = PremintEncoding.VERSION_2;\n        versions[2] = PremintEncoding.ERC20_VERSION_1;\n    }\n\n    function recoverCreatorAttribution(\n        string memory version,\n        bytes32 structHash,\n        address tokenContract,\n        bytes calldata signature,\n        address premintSignerContract\n    ) internal view returns (DecodedCreatorAttribution memory attribution) {\n        attribution.structHash = structHash;\n        attribution.version = version;\n\n        attribution.creator = ZoraCreator1155Attribution.recoverSignerHashed(\n            structHash,\n            signature,\n            tokenContract,\n            keccak256(bytes(version)),\n            block.chainid,\n            premintSignerContract\n        );\n\n        attribution.signature = signature;\n        attribution.domainName = ZoraCreator1155Attribution.NAME;\n    }\n\n    function _recoverDelegatedTokenSetup(\n        Erc20PremintConfigV1 memory premintConfig,\n        uint256 nextTokenId\n    ) private view returns (DelegatedTokenSetup memory params, bytes[] memory tokenSetupActions) {\n        validatePremint(premintConfig.tokenConfig.mintStart, premintConfig.deleted);\n\n        params.uid = premintConfig.uid;\n\n        tokenSetupActions = PremintTokenSetup.makeSetupNewTokenCalls({newTokenId: nextTokenId, tokenConfig: premintConfig.tokenConfig});\n\n        params.tokenURI = premintConfig.tokenConfig.tokenURI;\n        params.maxSupply = premintConfig.tokenConfig.maxSupply;\n        params.createReferral = premintConfig.tokenConfig.createReferral;\n    }\n\n    function _recoverDelegatedTokenSetup(\n        PremintConfigV2 memory premintConfig,\n        uint256 nextTokenId\n    ) private view returns (DelegatedTokenSetup memory params, bytes[] memory tokenSetupActions) {\n        validatePremint(premintConfig.tokenConfig.mintStart, premintConfig.deleted);\n\n        params.uid = premintConfig.uid;\n\n        tokenSetupActions = PremintTokenSetup.makeSetupNewTokenCalls({newTokenId: nextTokenId, tokenConfig: premintConfig.tokenConfig});\n\n        params.tokenURI = premintConfig.tokenConfig.tokenURI;\n        params.maxSupply = premintConfig.tokenConfig.maxSupply;\n        params.createReferral = premintConfig.tokenConfig.createReferral;\n    }\n\n    function _recoverDelegatedTokenSetup(\n        PremintConfig memory premintConfig,\n        uint256 nextTokenId\n    ) private view returns (DelegatedTokenSetup memory params, bytes[] memory tokenSetupActions) {\n        validatePremint(premintConfig.tokenConfig.mintStart, premintConfig.deleted);\n\n        params.uid = premintConfig.uid;\n\n        tokenSetupActions = PremintTokenSetup.makeSetupNewTokenCalls(nextTokenId, premintConfig.tokenConfig);\n\n        params.tokenURI = premintConfig.tokenConfig.tokenURI;\n        params.maxSupply = premintConfig.tokenConfig.maxSupply;\n    }\n\n    function validatePremint(uint64 mintStart, bool deleted) private view {\n        if (mintStart != 0 && mintStart > block.timestamp) {\n            // if the mint start is in the future, then revert\n            revert IZoraCreator1155Errors.MintNotYetStarted();\n        }\n        if (deleted) {\n            // if the signature says to be deleted, then dont execute any further minting logic;\n            // return 0\n            revert IZoraCreator1155Errors.PremintDeleted();\n        }\n    }\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/premint/PremintEncoding.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {PremintConfig, PremintConfigV2, Erc20PremintConfigV1} from \"../entities/Premint.sol\";\nimport {IMinter1155} from \"../interfaces/IMinter1155.sol\";\n\nstruct EncodedPremintConfig {\n    bytes premintConfig;\n    bytes32 premintConfigVersion;\n    uint32 uid;\n    address minter;\n}\n\nlibrary PremintEncoding {\n    string internal constant VERSION_1 = \"1\";\n    bytes32 internal constant HASHED_VERSION_1 = keccak256(bytes(VERSION_1));\n    string internal constant VERSION_2 = \"2\";\n    bytes32 internal constant HASHED_VERSION_2 = keccak256(bytes(VERSION_2));\n    string internal constant ERC20_VERSION_1 = \"ERC20_1\";\n    bytes32 internal constant HASHED_ERC20_VERSION_1 = keccak256(bytes(ERC20_VERSION_1));\n\n    function encodePremintV1(PremintConfig memory premintConfig) internal pure returns (EncodedPremintConfig memory) {\n        return EncodedPremintConfig(abi.encode(premintConfig), HASHED_VERSION_1, premintConfig.uid, premintConfig.tokenConfig.fixedPriceMinter);\n    }\n\n    function encodePremintV2(PremintConfigV2 memory premintConfig) internal pure returns (EncodedPremintConfig memory) {\n        return EncodedPremintConfig(abi.encode(premintConfig), HASHED_VERSION_2, premintConfig.uid, premintConfig.tokenConfig.fixedPriceMinter);\n    }\n\n    function encodePremintErc20V1(Erc20PremintConfigV1 memory premintConfig) internal pure returns (EncodedPremintConfig memory)  {\n        return EncodedPremintConfig(abi.encode(premintConfig), HASHED_ERC20_VERSION_1, premintConfig.uid, premintConfig.tokenConfig.erc20Minter);\n    }\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/entities/Premint.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nstruct ContractCreationConfig {\n    // Creator/admin of the created contract.  Must match the account that signed the message\n    address contractAdmin;\n    // Metadata URI for the created contract\n    string contractURI;\n    // Name of the created contract\n    string contractName;\n}\n\nstruct PremintConfig {\n    // The config for the token to be created\n    TokenCreationConfig tokenConfig;\n    // Unique id of the token, used to ensure that multiple signatures can't be used to create the same intended token.\n    // only one signature per token id, scoped to the contract hash can be executed.\n    uint32 uid;\n    // Version of this premint, scoped to the uid and contract.  Not used for logic in the contract, but used externally to track the newest version\n    uint32 version;\n    // If executing this signature results in preventing any signature with this uid from being minted.\n    bool deleted;\n}\n\nstruct TokenCreationConfig {\n    // Metadata URI for the created token\n    string tokenURI;\n    // Max supply of the created token\n    uint256 maxSupply;\n    // Max tokens that can be minted for an address, 0 if unlimited\n    uint64 maxTokensPerAddress;\n    // Price per token in eth wei. 0 for a free mint.\n    uint96 pricePerToken;\n    // The start time of the mint, 0 for immediate.  Prevents signatures from being used until the start time.\n    uint64 mintStart;\n    // The duration of the mint, starting from the first mint of this token. 0 for infinite\n    uint64 mintDuration;\n    // deperecated field; will be ignored.\n    uint32 royaltyMintSchedule;\n    // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales.\n    uint32 royaltyBPS;\n    // This is the address that will be set on the `royaltyRecipient` for the created token on the 1155 contract,\n    // which is the address that receives creator rewards and secondary royalties for the token,\n    // and on the `fundsRecipient` on the ZoraCreatorFixedPriceSaleStrategy contract for the token,\n    // which is the address that receives paid mint funds for the token.\n    address royaltyRecipient;\n    // Fixed price minter address\n    address fixedPriceMinter;\n}\n\nstruct PremintConfigV2 {\n    // The config for the token to be created\n    TokenCreationConfigV2 tokenConfig;\n    // Unique id of the token, used to ensure that multiple signatures can't be used to create the same intended token.\n    // only one signature per token id, scoped to the contract hash can be executed.\n    uint32 uid;\n    // Version of this premint, scoped to the uid and contract.  Not used for logic in the contract, but used externally to track the newest version\n    uint32 version;\n    // If executing this signature results in preventing any signature with this uid from being minted.\n    bool deleted;\n}\n\nstruct TokenCreationConfigV2 {\n    // Metadata URI for the created token\n    string tokenURI;\n    // Max supply of the created token\n    uint256 maxSupply;\n    // Max tokens that can be minted for an address, 0 if unlimited\n    uint64 maxTokensPerAddress;\n    // Price per token in eth wei. 0 for a free mint.\n    uint96 pricePerToken;\n    // The start time of the mint, 0 for immediate.  Prevents signatures from being used until the start time.\n    uint64 mintStart;\n    // The duration of the mint, starting from the first mint of this token. 0 for infinite\n    uint64 mintDuration;\n    // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales.\n    uint32 royaltyBPS;\n    // This is the address that will be set on the `royaltyRecipient` for the created token on the 1155 contract,\n    // which is the address that receives creator rewards and secondary royalties for the token,\n    // and on the `fundsRecipient` on the ZoraCreatorFixedPriceSaleStrategy contract for the token,\n    // which is the address that receives paid mint funds for the token.\n    address payoutRecipient;\n    // Fixed price minter address\n    address fixedPriceMinter;\n    // create referral\n    address createReferral;\n}\n\nstruct Erc20PremintConfigV1 {\n    // The config for the token to be created\n    Erc20TokenCreationConfigV1 tokenConfig;\n    // Unique id of the token, used to ensure that multiple signatures can't be used to create the same intended token.\n    // only one signature per token id, scoped to the contract hash can be executed.\n    uint32 uid;\n    // Version of this premint, scoped to the uid and contract.  Not used for logic in the contract, but used externally to track the newest version\n    uint32 version;\n    // If executing this signature results in preventing any signature with this uid from being minted.\n    bool deleted;\n}\n\nstruct Erc20TokenCreationConfigV1 {\n    // Metadata URI for the created token\n    string tokenURI;\n    // Max supply of the created token\n    uint256 maxSupply;\n    // RoyaltyBPS for created tokens. The royalty amount in basis points for secondary sales.\n    uint32 royaltyBPS;\n    // The address that the will receive rewards/funds/royalties.\n    address payoutRecipient;\n    // The address that referred the creation of the token.\n    address createReferral;\n    // The address of the ERC20 minter module.\n    address erc20Minter;\n    // The start time of the mint, 0 for immediate.\n    uint64 mintStart;\n    // The duration of the mint, starting from the first mint of this token. 0 for infinite\n    uint64 mintDuration;\n    // Max tokens that can be minted for an address, 0 if unlimited\n    uint64 maxTokensPerAddress;\n    // The ERC20 currency address\n    address currency;\n    // Price per token in ERC20 currency\n    uint256 pricePerToken;\n}\n\nstruct MintArguments {\n    address mintRecipient;\n    string mintComment;\n    /// array of accounts to receive rewards - mintReferral is first argument, and platformReferral is second.  platformReferral isn't supported as of now but will be in a future release.\n    address[] mintRewardsRecipients;\n}\n\nstruct PremintResult {\n    address contractAddress;\n    uint256 tokenId;\n    bool createdNewContract;\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155PremintExecutor.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {PremintEncoding, ZoraCreator1155Attribution, ContractCreationConfig, PremintConfig, PremintConfigV2, TokenCreationConfig, TokenCreationConfigV2} from \"../delegation/ZoraCreator1155Attribution.sol\";\nimport {IOwnable2StepUpgradeable} from \"../utils/ownable/IOwnable2StepUpgradeable.sol\";\nimport {IZoraCreator1155Factory} from \"./IZoraCreator1155Factory.sol\";\nimport {IGetContractAddress} from \"@zoralabs/shared-contracts/interfaces/IGetContractAddress.sol\";\nimport {MintArguments, PremintResult} from \"@zoralabs/shared-contracts/entities/Premint.sol\";\nimport {IZoraCreator1155PremintExecutorV2} from \"@zoralabs/shared-contracts/interfaces/IZoraCreator1155PremintExecutorV2.sol\";\n\n// this contains functions we have removed, but want to keep around for for testing purposes\ninterface IRemovedZoraCreator1155PremintExecutorFunctions {\n    function premint(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfig calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        string calldata mintComment\n    ) external payable returns (uint256 newTokenId);\n}\n\n// interface for legacy v1 of premint executor methods\n// maintained in order to not break existing calls\n// to legacy api when this api is upgraded\ninterface ILegacyZoraCreator1155PremintExecutor {\n    event Preminted(\n        address indexed contractAddress,\n        uint256 indexed tokenId,\n        bool indexed createdNewContract,\n        uint32 uid,\n        ContractCreationConfig contractConfig,\n        TokenCreationConfig tokenConfig,\n        address minter,\n        uint256 quantityMinted\n    );\n\n    function isAuthorizedToCreatePremint(\n        address signer,\n        address premintContractConfigContractAdmin,\n        address contractAddress\n    ) external view returns (bool isAuthorized);\n}\n\ninterface IZoraCreator1155PremintExecutorV1 {\n    function premintV1(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfig calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        MintArguments calldata mintArguments\n    ) external payable returns (PremintResult memory);\n}\n\ninterface IZoraCreator1155PremintExecutor is\n    ILegacyZoraCreator1155PremintExecutor,\n    IGetContractAddress,\n    IZoraCreator1155PremintExecutorV1,\n    IZoraCreator1155PremintExecutorV2,\n    IOwnable2StepUpgradeable\n{\n    event PremintedV2(\n        address indexed contractAddress,\n        uint256 indexed tokenId,\n        bool indexed createdNewContract,\n        uint32 uid,\n        address minter,\n        uint256 quantityMinted\n    );\n\n    function zora1155Factory() external view returns (IZoraCreator1155Factory);\n\n    function supportedPremintSignatureVersions(address contractAddress) external view returns (string[] memory);\n\n    function mintFee(address contractAddress) external view returns (uint256);\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155DelegatedCreation.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IHasCreatorAttribution {\n    event CreatorAttribution(bytes32 structHash, string domainName, string version, address creator, bytes signature);\n}\n\ninterface IHasSupportedPremintSignatureVersions {\n    function supportedPremintSignatureVersions() external pure returns (string[] memory);\n}\n\n// this is the current version of the Zora Token contract creation\ninterface ISupportsAABasedDelegatedTokenCreation {\n    function delegateSetupNewToken(\n        bytes memory premintConfigEncoded,\n        bytes32 premintVersion,\n        bytes calldata signature,\n        address sender,\n        address premintSignerContract\n    ) external returns (uint256 newTokenId);\n}\n\ninterface IZoraCreator1155DelegatedCreation is IHasCreatorAttribution, IHasSupportedPremintSignatureVersions, ISupportsAABasedDelegatedTokenCreation {}\n\n// this was the legacy interface which has both functions bundled in it - ideally these would be defined in their\n// own interfaces that can be checked if the interface method is supported.  going forward (above) they are separate\ninterface IZoraCreator1155DelegatedCreationLegacy {\n    event CreatorAttribution(bytes32 structHash, string domainName, string version, address creator, bytes signature);\n\n    function supportedPremintSignatureVersions() external pure returns (string[] memory);\n\n    function delegateSetupNewToken(\n        bytes memory premintConfigEncoded,\n        bytes32 premintVersion,\n        bytes calldata signature,\n        address sender\n    ) external returns (uint256 newTokenId);\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/factory/ZoraCreator1155FactoryImpl.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {Initializable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\";\nimport {UUPSUpgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol\";\nimport {IZoraCreator1155Factory} from \"../interfaces/IZoraCreator1155Factory.sol\";\nimport {IZoraCreator1155Initializer} from \"../interfaces/IZoraCreator1155Initializer.sol\";\nimport {IZoraCreator1155} from \"../interfaces/IZoraCreator1155.sol\";\nimport {ICreatorRoyaltiesControl} from \"../interfaces/ICreatorRoyaltiesControl.sol\";\nimport {IMinter1155} from \"../interfaces/IMinter1155.sol\";\nimport {IContractMetadata} from \"../interfaces/IContractMetadata.sol\";\nimport {Ownable2StepUpgradeable} from \"../utils/ownable/Ownable2StepUpgradeable.sol\";\nimport {Zora1155} from \"../proxies/Zora1155.sol\";\nimport {Create2Upgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/Create2Upgradeable.sol\";\nimport {CREATE3} from \"solmate/src/utils/CREATE3.sol\";\n\nimport {ContractVersionBase} from \"../version/ContractVersionBase.sol\";\n\n/// @title ZoraCreator1155FactoryImpl\n/// @notice Factory contract for creating new ZoraCreator1155 contracts\ncontract ZoraCreator1155FactoryImpl is IZoraCreator1155Factory, Ownable2StepUpgradeable, ContractVersionBase, UUPSUpgradeable, IContractMetadata {\n    IZoraCreator1155 public immutable zora1155Impl;\n    IMinter1155 public immutable merkleMinter;\n    IMinter1155 public immutable fixedPriceMinter;\n    IMinter1155 public immutable redeemMinterFactory;\n\n    constructor(IZoraCreator1155 _zora1155Impl, IMinter1155 _merkleMinter, IMinter1155 _fixedPriceMinter, IMinter1155 _redeemMinterFactory) initializer {\n        if (address(_zora1155Impl) == address(0)) {\n            revert Constructor_ImplCannotBeZero();\n        }\n        zora1155Impl = _zora1155Impl;\n        merkleMinter = _merkleMinter;\n        fixedPriceMinter = _fixedPriceMinter;\n        redeemMinterFactory = _redeemMinterFactory;\n    }\n\n    /// @notice ContractURI for contract information with the strategy\n    function contractURI() external pure returns (string memory) {\n        return \"https://github.com/ourzora/zora-1155-contracts/\";\n    }\n\n    /// @notice The name of the sale strategy\n    function contractName() external pure returns (string memory) {\n        return \"ZORA 1155 Contract Factory\";\n    }\n\n    /// @notice The default minters for new 1155 contracts\n    function defaultMinters() external view returns (IMinter1155[] memory minters) {\n        minters = new IMinter1155[](3);\n        minters[0] = fixedPriceMinter;\n        minters[1] = merkleMinter;\n        minters[2] = redeemMinterFactory;\n    }\n\n    function initialize(address _initialOwner) public initializer {\n        __Ownable_init(_initialOwner);\n        __UUPSUpgradeable_init();\n\n        emit FactorySetup();\n    }\n\n    /// @notice Creates a new ZoraCreator1155 contract\n    /// @param newContractURI The URI for the contract metadata\n    /// @param name The name of the contract\n    /// @param defaultRoyaltyConfiguration The default royalty configuration for the contract\n    /// @param defaultAdmin The default admin for the contract\n    /// @param setupActions The actions to perform on the new contract upon initialization\n    function createContract(\n        string calldata newContractURI,\n        string calldata name,\n        ICreatorRoyaltiesControl.RoyaltyConfiguration memory defaultRoyaltyConfiguration,\n        address payable defaultAdmin,\n        bytes[] calldata setupActions\n    ) external returns (address) {\n        Zora1155 newContract = new Zora1155(address(zora1155Impl));\n\n        _initializeContract(Zora1155(newContract), newContractURI, name, defaultRoyaltyConfiguration, defaultAdmin, setupActions);\n\n        return address(newContract);\n    }\n\n    function createContractDeterministic(\n        string calldata newContractURI,\n        string calldata name,\n        ICreatorRoyaltiesControl.RoyaltyConfiguration calldata defaultRoyaltyConfiguration,\n        address payable defaultAdmin,\n        bytes[] calldata setupActions\n    ) external returns (address) {\n        bytes32 digest = _hashContract(msg.sender, newContractURI, name, defaultAdmin);\n\n        address createdContract = CREATE3.deploy(digest, abi.encodePacked(type(Zora1155).creationCode, abi.encode(zora1155Impl)), 0);\n\n        Zora1155 newContract = Zora1155(payable(createdContract));\n\n        _initializeContract(newContract, newContractURI, name, defaultRoyaltyConfiguration, defaultAdmin, setupActions);\n\n        return address(newContract);\n    }\n\n    function deterministicContractAddress(\n        address msgSender,\n        string calldata newContractURI,\n        string calldata name,\n        address contractAdmin\n    ) external view returns (address) {\n        bytes32 digest = _hashContract(msgSender, newContractURI, name, contractAdmin);\n\n        return CREATE3.getDeployed(digest);\n    }\n\n    function _initializeContract(\n        Zora1155 newContract,\n        string calldata newContractURI,\n        string calldata name,\n        ICreatorRoyaltiesControl.RoyaltyConfiguration memory defaultRoyaltyConfiguration,\n        address payable defaultAdmin,\n        bytes[] calldata setupActions\n    ) private {\n        emit SetupNewContract({\n            newContract: address(newContract),\n            creator: msg.sender,\n            defaultAdmin: defaultAdmin,\n            contractURI: newContractURI,\n            name: name,\n            defaultRoyaltyConfiguration: defaultRoyaltyConfiguration\n        });\n\n        IZoraCreator1155Initializer(address(newContract)).initialize(name, newContractURI, defaultRoyaltyConfiguration, defaultAdmin, setupActions);\n    }\n\n    function _hashContract(address msgSender, string calldata newContractURI, string calldata name, address contractAdmin) private pure returns (bytes32) {\n        return keccak256(abi.encode(msgSender, contractAdmin, _stringHash(newContractURI), _stringHash(name)));\n    }\n\n    function _stringHash(string calldata value) private pure returns (bytes32) {\n        return keccak256(bytes(value));\n    }\n\n    ///                                                          ///\n    ///                         MANAGER UPGRADE                  ///\n    ///                                                          ///\n\n    /// @notice Ensures the caller is authorized to upgrade the contract\n    /// @dev This function is called in `upgradeTo` & `upgradeToAndCall`\n    /// @param _newImpl The new implementation address\n    function _authorizeUpgrade(address _newImpl) internal override onlyOwner {\n        if (!_equals(IContractMetadata(_newImpl).contractName(), this.contractName())) {\n            revert UpgradeToMismatchedContractName(this.contractName(), IContractMetadata(_newImpl).contractName());\n        }\n    }\n\n    /// @notice Returns the current implementation address\n    function implementation() external view returns (address) {\n        return _getImplementation();\n    }\n\n    function _equals(string memory a, string memory b) internal pure returns (bool) {\n        return (keccak256(bytes(a)) == keccak256(bytes(b)));\n    }\n}\n"
      },
      "node_modules/@zoralabs/protocol-rewards/src/interfaces/IRewardsErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IRewardsErrors {\n    error CREATOR_FUNDS_RECIPIENT_NOT_SET();\n    error INVALID_ADDRESS_ZERO();\n    error INVALID_ETH_AMOUNT();\n    error ONLY_CREATE_REFERRAL();\n}\n"
      },
      "node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155.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/IERC165.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 IERC1155 is IERC165 {\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"
      },
      "node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.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/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\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"
      },
      "node_modules/@openzeppelin/contracts/interfaces/IERC2981.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/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 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"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/draft-IERC1822Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822ProxiableUpgradeable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeaconUpgradeable.sol\";\nimport \"../../interfaces/draft-IERC1822Upgradeable.sol\";\nimport \"../../utils/AddressUpgradeable.sol\";\nimport \"../../utils/StorageSlotUpgradeable.sol\";\nimport \"../utils/Initializable.sol\";\n\nerror ERC1967_NEW_IMPL_NOT_CONTRACT();\nerror ERC1967_UNSUPPORTED_PROXIABLEUUID();\nerror ERC1967_NEW_IMPL_NOT_UUPS();\nerror ERC1967_NEW_ADMIN_IS_ZERO_ADDRESS();\nerror ERC1967_NEW_BEACON_IS_NOT_CONTRACT();\nerror ERC1967_BEACON_IMPL_IS_NOT_CONTRACT();\nerror ADDRESS_DELEGATECALL_TO_NON_CONTRACT();\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967UpgradeUpgradeable is Initializable {\n    function __ERC1967Upgrade_init() internal onlyInitializing {\n    }\n\n    function __ERC1967Upgrade_init_unchained() internal onlyInitializing {\n    }\n    // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _getImplementation() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (!AddressUpgradeable.isContract(newImplementation)) {\n            revert ERC1967_NEW_IMPL_NOT_CONTRACT();\n        } \n        StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Perform implementation upgrade\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeTo(address newImplementation) internal {\n        _setImplementation(newImplementation);\n        emit Upgraded(newImplementation);\n    }\n\n    /**\n     * @dev Perform implementation upgrade with additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n        _upgradeTo(newImplementation);\n        if (data.length > 0 || forceCall) {\n            _functionDelegateCall(newImplementation, data);\n        }\n    }\n\n    /**\n     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n        // Upgrades from old implementations will perform a rollback test. This test requires the new\n        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n        // this special case will break upgrade paths from old UUPS implementation to new ones.\n        if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {\n            _setImplementation(newImplementation);\n        } else {\n            try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n                if (slot != _IMPLEMENTATION_SLOT) {\n                    revert ERC1967_UNSUPPORTED_PROXIABLEUUID();\n                }\n            } catch {\n                revert ERC1967_NEW_IMPL_NOT_UUPS();\n            }\n            _upgradeToAndCall(newImplementation, data, forceCall);\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Returns the current admin.\n     */\n    function _getAdmin() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967_NEW_ADMIN_IS_ZERO_ADDRESS();\n        }\n        StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {AdminChanged} event.\n     */\n    function _changeAdmin(address newAdmin) internal {\n        emit AdminChanged(_getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n     */\n    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Emitted when the beacon is upgraded.\n     */\n    event BeaconUpgraded(address indexed beacon);\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function _getBeacon() internal view returns (address) {\n        return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the EIP1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (!AddressUpgradeable.isContract(newBeacon)) {\n            revert ERC1967_NEW_BEACON_IS_NOT_CONTRACT();\n        }\n        if (!AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation())) {\n            revert ERC1967_BEACON_IMPL_IS_NOT_CONTRACT();\n        }\n        StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n    }\n\n    /**\n     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n     *\n     * Emits a {BeaconUpgraded} event.\n     */\n    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n        _setBeacon(newBeacon);\n        emit BeaconUpgraded(newBeacon);\n        if (data.length > 0 || forceCall) {\n            _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);\n        }\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(address target, bytes memory data) private returns (bytes memory) {\n        if (!AddressUpgradeable.isContract(target)) {\n            revert ADDRESS_DELEGATECALL_TO_NON_CONTRACT();\n        }\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return AddressUpgradeable.verifyCallResult(success, returndata);\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"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\nerror INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED();\nerror INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING();\nerror INITIALIZABLE_CONTRACT_IS_INITIALIZING();\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        if ((!isTopLevelCall || _initialized != 0) && (AddressUpgradeable.isContract(address(this)) || _initialized != 1)) {\n            revert INITIALIZABLE_CONTRACT_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        if (_initializing || _initialized >= version) {\n            revert INITIALIZABLE_CONTRACT_ALREADY_INITIALIZED();\n        }\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        if (!_initializing) {\n            revert INITIALIZABLE_CONTRACT_IS_NOT_INITIALIZING();\n        }\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        if (_initializing) {\n            revert INITIALIZABLE_CONTRACT_IS_INITIALIZING();\n        }\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"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/utils/ownable/IOwnable2StepUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\n/// @title IOwnable2StepUpgradeable\n/// @author Rohan Kulkarni\n/// @notice The external Ownable events, errors, and functions\ninterface IOwnable2StepUpgradeable {\n    ///                                                          ///\n    ///                            EVENTS                        ///\n    ///                                                          ///\n\n    /// @notice Emitted when ownership has been updated\n    /// @param prevOwner The previous owner address\n    /// @param newOwner The new owner address\n    event OwnerUpdated(address indexed prevOwner, address indexed newOwner);\n\n    /// @notice Emitted when an ownership transfer is pending\n    /// @param owner The current owner address\n    /// @param pendingOwner The pending new owner address\n    event OwnerPending(address indexed owner, address indexed pendingOwner);\n\n    /// @notice Emitted when a pending ownership transfer has been canceled\n    /// @param owner The current owner address\n    /// @param canceledOwner The canceled owner address\n    event OwnerCanceled(address indexed owner, address indexed canceledOwner);\n\n    ///                                                          ///\n    ///                            ERRORS                        ///\n    ///                                                          ///\n\n    /// @dev Reverts if an unauthorized user calls an owner function\n    error ONLY_OWNER();\n\n    /// @dev Reverts if an unauthorized user calls a pending owner function\n    error ONLY_PENDING_OWNER();\n\n    /// @dev Owner cannot be the zero/burn address\n    error OWNER_CANNOT_BE_ZERO_ADDRESS();\n\n    ///                                                          ///\n    ///                           FUNCTIONS                      ///\n    ///                                                          ///\n\n    /// @notice The address of the owner\n    function owner() external view returns (address);\n\n    /// @notice The address of the pending owner\n    function pendingOwner() external view returns (address);\n\n    /// @notice Forces an ownership transfer\n    /// @param newOwner The new owner address\n    function transferOwnership(address newOwner) external;\n\n    /// @notice Initiates a two-step ownership transfer\n    /// @param newOwner The new owner address\n    function safeTransferOwnership(address newOwner) external;\n\n    /// @notice Accepts an ownership transfer\n    function acceptOwnership() external;\n\n    /// @notice Cancels a pending ownership transfer\n    function cancelOwnershipTransfer() external;\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/utils/ownable/IOwnable2StepStorageV1.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nabstract contract IOwnable2StepStorageV1 {\n    /// @dev The address of the owner\n    address internal _owner;\n\n    /// @dev The address of the pending owner\n    address internal _pendingOwner;\n\n    /// @dev storage gap\n    uint256[50] private __gap;\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/introspection/IERC165Upgradeable.sol\";\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC1155MetadataURIUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.sol\";\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/nft/IZoraCreator1155TypesV1.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {ITransferHookReceiver} from \"../interfaces/ITransferHookReceiver.sol\";\n\n/*\n\n\n             ░░░░░░░░░░░░░░              \n        ░░▒▒░░░░░░░░░░░░░░░░░░░░        \n      ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░      \n    ░░▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░    \n   ░▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░    \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░░  \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░░░  \n  ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░  \n  ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░  \n   ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░  \n    ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░    \n    ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░    \n      ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░      \n          ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░          \n\n               OURS TRULY,\n\n */\n\n/// Imagine. Mint. Enjoy.\n/// @notice Interface for types used across the ZoraCreator1155 contract\n/// @author @iainnash / @tbtstl\ninterface IZoraCreator1155TypesV1 {\n    /// @notice Used to store individual token data\n    struct TokenData {\n        string uri;\n        uint256 maxSupply;\n        uint256 totalMinted;\n    }\n\n    /// @notice Used to store contract-level configuration\n    struct ContractConfig {\n        address owner;\n        uint96 __gap1;\n        address payable fundsRecipient;\n        uint96 __gap2;\n        ITransferHookReceiver transferHook;\n        uint96 __gap3;\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IRenderer1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IERC165Upgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol\";\n\n/// @dev IERC165 type required\ninterface IRenderer1155 is IERC165Upgradeable {\n    /// @notice Called for assigned tokenId, or when token id is globally set to a renderer\n    /// @dev contract target is assumed to be msg.sender\n    /// @param tokenId token id to get uri for\n    function uri(uint256 tokenId) external view returns (string memory);\n\n    /// @notice Only called for tokenId == 0\n    /// @dev contract target is assumed to be msg.sender\n    function contractURI() external view returns (string memory);\n\n    /// @notice Sets up renderer from contract\n    /// @param initData data to setup renderer with\n    /// @dev contract target is assumed to be msg.sender\n    function setup(bytes memory initData) external;\n\n    // IERC165 type required – set in base helper\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IOwnable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IOwnable {\n    function owner() external returns (address);\n\n    event OwnershipTransferred(address lastOwner, address newOwner);\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/IVersionedContract.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IVersionedContract {\n    function contractVersion() external pure returns (string memory);\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IMintWithRewardsRecipients.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IMinter1155} from \"./IMinter1155.sol\";\n\ninterface IMintWithRewardsRecipients {\n    /// @notice Mint tokens and payout rewards given a minter contract, minter arguments, and rewards arguments\n    /// @param minter The minter contract to use\n    /// @param tokenId The token ID to mint\n    /// @param quantity The quantity of tokens to mint\n    /// @param rewardsRecipients The addresses of rewards arguments - mintReferral and platformReferral\n    /// @param minterArguments The arguments to pass to the minter\n    function mint(IMinter1155 minter, uint256 tokenId, uint256 quantity, address[] memory rewardsRecipients, bytes calldata minterArguments) external payable;\n}\n"
      },
      "node_modules/@zoralabs/mints-contracts/src/IMintWithMints.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IMinter1155} from \"@zoralabs/shared-contracts/interfaces/IMinter1155.sol\";\n\n/// @title IMintWithMints\n/// @notice Interface intended to be implemented by a 1155 creator contract to be able to mint tokens using MINTs\ninterface IMintWithMints {\n    /// @notice Mint tokens and payout rewards given a minter contract, minter arguments, and rewards arguments,\n    /// while MINTs are redeemed to pay for the mint fee, instead of paying with ETH directly.\n    /// The MINTs must have been transferred to be owned by this contract before calling this function.\n    /// Value sent is used for paid mints, if this is a paid mint.\n    /// @param mintTokenIds The MINT token IDs that are to be redeemed.\n    /// @param quantities The quantities of each MINT token id to redeem.\n    /// @param minter The minter contract to use\n    /// @param tokenId The token ID to mint\n    /// @param rewardsRecipients The addresses of rewards arguments - rewardsRecipients[0] = mintReferral, rewardsRecipients[1] = platformReferral\n    /// @param minterArguments The arguments to pass to the minter\n    /// @return quantityMinted The total quantity of tokens minted\n    function mintWithMints(\n        uint256[] calldata mintTokenIds,\n        uint256[] calldata quantities,\n        IMinter1155 minter,\n        uint256 tokenId,\n        address[] memory rewardsRecipients,\n        bytes calldata minterArguments\n    ) external payable returns (uint256 quantityMinted);\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/errors/IZoraCreator1155Errors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IMinterErrors} from \"./IMinterErrors.sol\";\n\ninterface ILimitedMintPerAddressErrors {\n    error UserExceedsMintLimit(address user, uint256 limit, uint256 requestedAmount);\n}\n\ninterface ICreatorRoyaltyErrors {\n    /// @notice Thrown when a user tries to have 100% supply royalties\n    error InvalidMintSchedule();\n}\n\ninterface IZoraCreator1155Errors is ICreatorRoyaltyErrors, ILimitedMintPerAddressErrors, IMinterErrors {\n    error OnlyTransfersFromZoraMints();\n    error Call_TokenIdMismatch();\n    error TokenIdMismatch(uint256 expected, uint256 actual);\n    error UserMissingRoleForToken(address user, uint256 tokenId, uint256 role);\n\n    error Config_TransferHookNotSupported(address proposedAddress);\n\n    error Mint_InsolventSaleTransfer();\n    error Mint_ValueTransferFail();\n    error Mint_TokenIDMintNotAllowed();\n    error Mint_UnknownCommand();\n    error Mint_InvalidMintArrayLength();\n\n    error Burn_NotOwnerOrApproved(address operator, address user);\n\n    error NewOwnerNeedsToBeAdmin();\n\n    error Sale_CannotCallNonSalesContract(address targetContract);\n\n    error CallFailed(bytes reason);\n    error Renderer_NotValidRendererContract();\n\n    error ETHWithdrawFailed(address recipient, uint256 amount);\n    error FundsWithdrawInsolvent(uint256 amount, uint256 contractValue);\n    error ProtocolRewardsWithdrawFailed(address caller, address recipient, uint256 amount);\n\n    error CannotMintMoreTokens(uint256 tokenId, uint256 quantity, uint256 totalMinted, uint256 maxSupply);\n\n    error MintNotYetStarted();\n    error PremintDeleted();\n\n    // DelegatedMinting related errors\n    error InvalidSignatureVersion();\n    error premintSignerContractNotAContract();\n    error InvalidSignature();\n    error InvalidSigner(bytes4 magicValue);\n    error premintSignerContractFailedToRecoverSigner();\n    error FirstMinterAddressZero();\n\n    error ERC1155_MINT_TO_ZERO_ADDRESS();\n\n    error InvalidPremintVersion();\n    error NonEthRedemption();\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/_imagine/mint/Enjoy.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\n/*\n\n\n\n\n\n             ░░░░░░░░░░░░░░              \n        ░░▒▒░░░░░░░░░░░░░░░░░░░░        \n      ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░      \n    ░░▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░    \n   ░▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░    \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░░  \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░░░  \n  ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░  \n  ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░  \n   ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░  \n    ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░    \n    ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░    \n      ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░      \n          ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░          \n\n               OURS TRULY,\n\n\n\n\n\n\n\n\n\n\n\n */\n\ninterface Enjoy {\n\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/ICreatorCommands.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {ICreatorCommands} from \"@zoralabs/shared-contracts/interfaces/ICreatorCommands.sol\";\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/minters/SaleStrategy.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {IERC165Upgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol\";\nimport {IMinter1155} from \"../interfaces/IMinter1155.sol\";\nimport {IContractMetadata} from \"../interfaces/IContractMetadata.sol\";\nimport {IVersionedContract} from \"@zoralabs/shared-contracts/interfaces/IVersionedContract.sol\";\n\n/// @notice Sales Strategy Helper contract template on top of IMinter1155\n/// @author @iainnash / @tbtstl\nabstract contract SaleStrategy is IMinter1155, IVersionedContract, IContractMetadata {\n    /// @notice This function resets the sales configuration for a given tokenId and contract.\n    /// @dev This function is intentioned to be called directly from the affected sales contract\n    function resetSale(uint256 tokenId) external virtual;\n\n    function supportsInterface(bytes4 interfaceId) public pure virtual returns (bool) {\n        return interfaceId == type(IMinter1155).interfaceId || interfaceId == type(IERC165Upgradeable).interfaceId;\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/minters/utils/SaleCommandHelper.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {ICreatorCommands} from \"../../interfaces/ICreatorCommands.sol\";\n\n/// @title SaleCommandHelper\n/// @notice Helper library for creating commands for the sale contract\n/// @author @iainnash / @tbtstl\nlibrary SaleCommandHelper {\n    /// @notice Sets the size of commands and initializes command array. Empty entries are skipped by the resolver.\n    /// @dev Beware: this removes all previous command entries from memory\n    /// @param commandSet command set struct storage.\n    /// @param size size to set for the new struct\n    function setSize(ICreatorCommands.CommandSet memory commandSet, uint256 size) internal pure {\n        commandSet.commands = new ICreatorCommands.Command[](size);\n    }\n\n    /// @notice Creates a command to mint a token\n    /// @param commandSet The command set to add the command to\n    /// @param to The address to mint to\n    /// @param tokenId The token ID to mint\n    /// @param quantity The quantity of tokens to mint\n    function mint(ICreatorCommands.CommandSet memory commandSet, address to, uint256 tokenId, uint256 quantity) internal pure {\n        unchecked {\n            commandSet.commands[commandSet.at++] = ICreatorCommands.Command({\n                method: ICreatorCommands.CreatorActions.MINT,\n                args: abi.encode(to, tokenId, quantity)\n            });\n        }\n    }\n\n    /// @notice Creates a command to transfer ETH\n    /// @param commandSet The command set to add the command to\n    /// @param to The address to transfer to\n    /// @param amount The amount of ETH to transfer\n    function transfer(ICreatorCommands.CommandSet memory commandSet, address to, uint256 amount) internal pure {\n        unchecked {\n            commandSet.commands[commandSet.at++] = ICreatorCommands.Command({method: ICreatorCommands.CreatorActions.SEND_ETH, args: abi.encode(to, amount)});\n        }\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/minters/utils/LimitedMintPerAddress.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {ILimitedMintPerAddress} from \"../../interfaces/ILimitedMintPerAddress.sol\";\n\ncontract LimitedMintPerAddress is ILimitedMintPerAddress {\n    /// @notice Storage for slot to check user mints\n    /// @notice target contract -> tokenId -> minter user -> numberMinted\n    /// @dev No gap or stroage interface since this is used within non-upgradeable contracts\n    mapping(address => mapping(uint256 => mapping(address => uint256))) internal mintedPerAddress;\n\n    function getMintedPerWallet(address tokenContract, uint256 tokenId, address wallet) external view returns (uint256) {\n        return mintedPerAddress[tokenContract][tokenId][wallet];\n    }\n\n    function _requireMintNotOverLimitAndUpdate(uint256 limit, uint256 numRequestedMint, address tokenContract, uint256 tokenId, address wallet) internal {\n        mintedPerAddress[tokenContract][tokenId][wallet] += numRequestedMint;\n        if (mintedPerAddress[tokenContract][tokenId][wallet] > limit) {\n            revert UserExceedsMintLimit(wallet, limit, mintedPerAddress[tokenContract][tokenId][wallet]);\n        }\n    }\n\n    function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) {\n        return interfaceId == type(ILimitedMintPerAddress).interfaceId;\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IMinterErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {IMinterErrors} from \"@zoralabs/shared-contracts/interfaces/errors/IMinterErrors.sol\";\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/IMinter1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {ICreatorCommands} from \"./ICreatorCommands.sol\";\nimport {IERC165Upgradeable} from \"./IERC165Upgradeable.sol\";\n\n/// @notice Minter standard interface\n/// @dev Minters need to confirm to the ERC165 selector of type(IMinter1155).interfaceId\ninterface IMinter1155 is IERC165Upgradeable {\n    function requestMint(\n        address sender,\n        uint256 tokenId,\n        uint256 quantity,\n        uint256 ethValueSent,\n        bytes calldata minterArguments\n    ) external returns (ICreatorCommands.CommandSet memory commands);\n}\n"
      },
      "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IERC20Minter.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IERC20Minter {\n    struct RewardsSettings {\n        /// @notice Amount of the create referral reward\n        uint256 createReferralReward;\n        /// @notice Amount of the mint referral reward\n        uint256 mintReferralReward;\n        /// @notice Amount of the zora reward\n        uint256 zoraReward;\n        /// @notice Amount of the first minter reward\n        uint256 firstMinterReward;\n    }\n\n    struct SalesConfig {\n        /// @notice Unix timestamp for the sale start\n        uint64 saleStart;\n        /// @notice Unix timestamp for the sale end\n        uint64 saleEnd;\n        /// @notice Max tokens that can be minted for an address, 0 if unlimited\n        uint64 maxTokensPerAddress;\n        /// @notice Price per token in ERC20 currency\n        uint256 pricePerToken;\n        /// @notice Funds recipient (0 if no different funds recipient than the contract global)\n        address fundsRecipient;\n        /// @notice ERC20 Currency address\n        address currency;\n    }\n\n    /// @notice Rewards Deposit Event\n    /// @param createReferral Creator referral address\n    /// @param mintReferral Mint referral address\n    /// @param firstMinter First minter address\n    /// @param zora ZORA recipient address\n    /// @param collection The collection address of the token\n    /// @param currency Currency used for the deposit\n    /// @param tokenId Token ID\n    /// @param createReferralReward Creator referral reward\n    /// @param mintReferralReward Mint referral amount\n    /// @param firstMinterReward First minter amount\n    /// @param zoraReward ZORA amount\n    event ERC20RewardsDeposit(\n        address indexed createReferral,\n        address indexed mintReferral,\n        address indexed firstMinter,\n        address zora,\n        address collection,\n        address currency,\n        uint256 tokenId,\n        uint256 createReferralReward,\n        uint256 mintReferralReward,\n        uint256 firstMinterReward,\n        uint256 zoraReward\n    );\n\n    /// @notice ERC20MinterInitialized Event\n    /// @param rewardPercentage The reward percentage\n    event ERC20MinterInitialized(uint256 rewardPercentage);\n\n    /// @notice MintComment Event\n    /// @param sender The sender of the comment\n    /// @param tokenContract The token contract address\n    /// @param tokenId The token ID\n    /// @param quantity The quantity of tokens minted\n    /// @param comment The comment\n    event MintComment(address indexed sender, address indexed tokenContract, uint256 indexed tokenId, uint256 quantity, string comment);\n\n    /// @notice SaleSet Event\n    /// @param mediaContract The media contract address\n    /// @param tokenId The token ID\n    /// @param salesConfig The sales configuration\n    event SaleSet(address indexed mediaContract, uint256 indexed tokenId, SalesConfig salesConfig);\n\n    /// @notice ZoraRewardsRecipientSet Event\n    /// @param prevRecipient The previous recipient address\n    /// @param newRecipient The new recipient address\n    event ZoraRewardsRecipientSet(address indexed prevRecipient, address indexed newRecipient);\n\n    /// @notice Cannot set address to zero\n    error AddressZero();\n\n    /// @notice Cannot set currency address to zero\n    error InvalidCurrency();\n\n    /// @notice Price per ERC20 token is too low\n    error PricePerTokenTooLow();\n\n    /// @notice requestMint() is not used in ERC20 minter, use mint() instead\n    error RequestMintInvalidUseMint();\n\n    /// @notice Sale has already ended\n    error SaleEnded();\n\n    /// @notice Sale has not started yet\n    error SaleHasNotStarted();\n\n    /// @notice Value sent is incorrect\n    error WrongValueSent();\n\n    /// @notice ERC20 transfer slippage\n    error ERC20TransferSlippage();\n\n    /// @notice ERC20Minter is already initialized\n    error AlreadyInitialized();\n\n    /// @notice Only the Zora rewards recipient can call this function\n    error OnlyZoraRewardsRecipient();\n\n    /// @notice Mints a token using an ERC20 currency, note the total value must have been approved prior to calling this function\n    /// @param mintTo The address to mint the token to\n    /// @param quantity The quantity of tokens to mint\n    /// @param tokenAddress The address of the token to mint\n    /// @param tokenId The ID of the token to mint\n    /// @param totalValue The total value of the mint\n    /// @param currency The address of the currency to use for the mint\n    /// @param mintReferral The address of the mint referral\n    /// @param comment The optional mint comment\n    function mint(\n        address mintTo,\n        uint256 quantity,\n        address tokenAddress,\n        uint256 tokenId,\n        uint256 totalValue,\n        address currency,\n        address mintReferral,\n        string calldata comment\n    ) external;\n\n    /// @notice Sets the sale config for a given token\n    function setSale(uint256 tokenId, SalesConfig memory salesConfig) external;\n\n    /// @notice Returns the sale config for a given token\n    function sale(address tokenContract, uint256 tokenId) external view returns (SalesConfig memory);\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/cryptography/ECDSAUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS,\n        InvalidSignatureV // Deprecated in v4.8\n    }\n\n    function _throwError(RecoverError error) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert(\"ECDSA: invalid signature\");\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert(\"ECDSA: invalid signature length\");\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert(\"ECDSA: invalid signature 's' value\");\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature` or error string. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            /// @solidity memory-safe-assembly\n            assembly {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength);\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, signature);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\n        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n        uint8 v = uint8((uint256(vs) >> 255) + 27);\n        return tryRecover(hash, v, r, s);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     *\n     * _Available since v4.2._\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature);\n        }\n\n        return (signer, RecoverError.NoError);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\n        // 32 is the length in bytes of hash,\n        // enforced by the type signature above\n        /// @solidity memory-safe-assembly\n        assembly {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\")\n            mstore(0x1c, hash)\n            message := keccak256(0x00, 0x3c)\n        }\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from `s`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Typed Data, created from a\n     * `domainSeparator` and a `structHash`. This produces hash corresponding\n     * to the one signed with the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n     * JSON-RPC method as part of EIP-712.\n     *\n     * See {recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ptr := mload(0x40)\n            mstore(ptr, \"\\x19\\x01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            data := keccak256(ptr, 0x42)\n        }\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/minters/erc20/ERC20Minter.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {IProtocolRewards} from \"@zoralabs/protocol-rewards/src/interfaces/IProtocolRewards.sol\";\nimport {IERC20Minter} from \"../../interfaces/IERC20Minter.sol\";\nimport {LimitedMintPerAddress} from \"../../minters/utils/LimitedMintPerAddress.sol\";\nimport {SaleStrategy} from \"../../minters/SaleStrategy.sol\";\nimport {ICreatorCommands} from \"../../interfaces/ICreatorCommands.sol\";\nimport {ERC20MinterRewards} from \"./ERC20MinterRewards.sol\";\nimport {IZora1155} from \"./IZora1155.sol\";\n\n/*\n\n\n             ░░░░░░░░░░░░░░              \n        ░░▒▒░░░░░░░░░░░░░░░░░░░░        \n      ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░      \n    ░░▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░    \n   ░▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░    \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░░  \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░░░  \n  ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░  \n  ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░  \n   ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░  \n    ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░    \n    ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░    \n      ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░      \n          ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░          \n\n               OURS TRULY,\n\n\n    github.com/ourzora/zora-protocol\n\n*/\n\n/// @title ERC20Minter\n/// @notice Allows for ZoraCreator Mints to be purchased using ERC20 tokens\n/// @dev While this contract _looks_ like a minter, we need to be able to directly manage ERC20 tokens. Therefore, we need to establish minter permissions but instead of using the `requestMint` flow we directly request tokens to be minted in order to safely handle the incoming ERC20 tokens.\n/// @author @isabellasmallcombe\ncontract ERC20Minter is ReentrancyGuard, IERC20Minter, SaleStrategy, LimitedMintPerAddress, ERC20MinterRewards {\n    using SafeERC20 for IERC20;\n\n    /// @notice The address of the Zora rewards recipient\n    address public zoraRewardRecipientAddress;\n\n    /// @notice The ERC20 sale configuration for a given 1155 token\n    /// @dev 1155 token address => 1155 token id => SalesConfig\n    mapping(address => mapping(uint256 => SalesConfig)) internal salesConfigs;\n\n    /// @notice Initializes the contract with a Zora rewards recipient address\n    /// @dev Allows deterministic contract address, called on deploy\n    function initialize(address _zoraRewardRecipientAddress) external {\n        if (_zoraRewardRecipientAddress == address(0)) {\n            revert AddressZero();\n        }\n\n        if (zoraRewardRecipientAddress != address(0)) {\n            revert AlreadyInitialized();\n        }\n\n        zoraRewardRecipientAddress = _zoraRewardRecipientAddress;\n\n        emit ERC20MinterInitialized(TOTAL_REWARD_PCT);\n    }\n\n    /// @notice Computes the total reward value for a given amount of ERC20 tokens\n    /// @param totalValue The total number of ERC20 tokens\n    function computeTotalReward(uint256 totalValue) public pure returns (uint256) {\n        return (totalValue * TOTAL_REWARD_PCT) / BPS_TO_PERCENT_2_DECIMAL_PERCISION;\n    }\n\n    /// @notice Computes the rewards value given an amount and a reward percentage\n    /// @param totalReward The total reward to be distributed\n    /// @param rewardPct The percentage of the reward to be distributed\n    function computeReward(uint256 totalReward, uint256 rewardPct) public pure returns (uint256) {\n        return (totalReward * rewardPct) / BPS_TO_PERCENT_8_DECIMAL_PERCISION;\n    }\n\n    /// @notice Computes the rewards for an ERC20 mint\n    /// @param totalReward The total reward to be distributed\n    function computePaidMintRewards(uint256 totalReward) public pure returns (RewardsSettings memory) {\n        uint256 createReferralReward = computeReward(totalReward, CREATE_REFERRAL_PAID_MINT_REWARD_PCT);\n        uint256 mintReferralReward = computeReward(totalReward, MINT_REFERRAL_PAID_MINT_REWARD_PCT);\n        uint256 firstMinterReward = computeReward(totalReward, FIRST_MINTER_REWARD_PCT);\n        uint256 zoraReward = totalReward - (createReferralReward + mintReferralReward + firstMinterReward);\n\n        return\n            RewardsSettings({\n                createReferralReward: createReferralReward,\n                mintReferralReward: mintReferralReward,\n                zoraReward: zoraReward,\n                firstMinterReward: firstMinterReward\n            });\n    }\n\n    /// @notice Gets the create referral address for a given token\n    /// @param tokenContract The address of the token contract\n    /// @param tokenId The ID of the token\n    function getCreateReferral(address tokenContract, uint256 tokenId) public view returns (address createReferral) {\n        try IZora1155(tokenContract).createReferrals(tokenId) returns (address contractCreateReferral) {\n            createReferral = contractCreateReferral;\n        } catch {}\n\n        if (createReferral == address(0)) {\n            createReferral = zoraRewardRecipientAddress;\n        }\n    }\n\n    /// @notice Gets the first minter address for a given token\n    /// @param tokenContract The address of the token contract\n    /// @param tokenId The ID of the token\n    function getFirstMinter(address tokenContract, uint256 tokenId) public view returns (address firstMinter) {\n        try IZora1155(tokenContract).firstMinters(tokenId) returns (address contractFirstMinter) {\n            firstMinter = contractFirstMinter;\n\n            if (firstMinter == address(0)) {\n                firstMinter = IZora1155(tokenContract).getCreatorRewardRecipient(tokenId);\n            }\n        } catch {\n            firstMinter = zoraRewardRecipientAddress;\n        }\n    }\n\n    /// @notice Handles the incoming transfer of ERC20 tokens\n    /// @param currency The address of the currency to use for the mint\n    /// @param totalValue The total value of the mint\n    function _handleIncomingTransfer(address currency, uint256 totalValue) internal {\n        uint256 beforeBalance = IERC20(currency).balanceOf(address(this));\n        IERC20(currency).safeTransferFrom(msg.sender, address(this), totalValue);\n        uint256 afterBalance = IERC20(currency).balanceOf(address(this));\n\n        if ((beforeBalance + totalValue) != afterBalance) {\n            revert ERC20TransferSlippage();\n        }\n    }\n\n    /// @notice Distributes the rewards to the appropriate addresses\n    /// @param totalReward The total reward to be distributed\n    /// @param currency The currency used for the mint\n    /// @param tokenId The ID of the token to mint\n    /// @param tokenAddress The address of the token to mint\n    /// @param mintReferral The address of the mint referral\n    function _distributeRewards(uint256 totalReward, address currency, uint256 tokenId, address tokenAddress, address mintReferral) private {\n        RewardsSettings memory settings = computePaidMintRewards(totalReward);\n\n        address createReferral = getCreateReferral(tokenAddress, tokenId);\n        address firstMinter = getFirstMinter(tokenAddress, tokenId);\n\n        if (mintReferral == address(0)) {\n            mintReferral = zoraRewardRecipientAddress;\n        }\n\n        IERC20(currency).safeTransfer(createReferral, settings.createReferralReward);\n        IERC20(currency).safeTransfer(firstMinter, settings.firstMinterReward);\n        IERC20(currency).safeTransfer(mintReferral, settings.mintReferralReward);\n        IERC20(currency).safeTransfer(zoraRewardRecipientAddress, settings.zoraReward);\n\n        emit ERC20RewardsDeposit(\n            createReferral,\n            mintReferral,\n            firstMinter,\n            zoraRewardRecipientAddress,\n            tokenAddress,\n            currency,\n            tokenId,\n            settings.createReferralReward,\n            settings.mintReferralReward,\n            settings.firstMinterReward,\n            settings.zoraReward\n        );\n    }\n\n    /// @notice Mints a token using an ERC20 currency, note the total value must have been approved prior to calling this function\n    /// @param mintTo The address to mint the token to\n    /// @param quantity The quantity of tokens to mint\n    /// @param tokenAddress The address of the token to mint\n    /// @param tokenId The ID of the token to mint\n    /// @param totalValue The total value of the mint\n    /// @param currency The address of the currency to use for the mint\n    /// @param mintReferral The address of the mint referral\n    /// @param comment The optional mint comment\n    function mint(\n        address mintTo,\n        uint256 quantity,\n        address tokenAddress,\n        uint256 tokenId,\n        uint256 totalValue,\n        address currency,\n        address mintReferral,\n        string calldata comment\n    ) external nonReentrant {\n        SalesConfig storage config = salesConfigs[tokenAddress][tokenId];\n\n        if (config.currency == address(0) || config.currency != currency) {\n            revert InvalidCurrency();\n        }\n\n        if (totalValue != (config.pricePerToken * quantity)) {\n            revert WrongValueSent();\n        }\n\n        if (block.timestamp < config.saleStart) {\n            revert SaleHasNotStarted();\n        }\n\n        if (block.timestamp > config.saleEnd) {\n            revert SaleEnded();\n        }\n\n        if (config.maxTokensPerAddress > 0) {\n            _requireMintNotOverLimitAndUpdate(config.maxTokensPerAddress, quantity, tokenAddress, tokenId, mintTo);\n        }\n\n        _handleIncomingTransfer(currency, totalValue);\n\n        IZora1155(tokenAddress).adminMint(mintTo, tokenId, quantity, \"\");\n\n        uint256 totalReward = computeTotalReward(totalValue);\n\n        _distributeRewards(totalReward, currency, tokenId, tokenAddress, mintReferral);\n\n        IERC20(config.currency).safeTransfer(config.fundsRecipient, totalValue - totalReward);\n\n        if (bytes(comment).length > 0) {\n            emit MintComment(mintTo, tokenAddress, tokenId, quantity, comment);\n        }\n    }\n\n    /// @notice The percentage of the total value that is distributed as rewards\n    function totalRewardPct() external pure returns (uint256) {\n        return TOTAL_REWARD_PCT;\n    }\n\n    /// @notice The URI of the contract\n    function contractURI() external pure returns (string memory) {\n        return \"https://github.com/ourzora/zora-protocol/\";\n    }\n\n    /// @notice The name of the contract\n    function contractName() external pure returns (string memory) {\n        return \"ERC20 Minter\";\n    }\n\n    /// @notice The version of the contract\n    function contractVersion() external pure returns (string memory) {\n        return \"1.0.0\";\n    }\n\n    /// @notice Sets the sale config for a given token\n    function setSale(uint256 tokenId, SalesConfig memory salesConfig) external {\n        if (salesConfig.pricePerToken < MIN_PRICE_PER_TOKEN) {\n            revert PricePerTokenTooLow();\n        }\n        if (salesConfig.currency == address(0)) {\n            revert AddressZero();\n        }\n        if (salesConfig.fundsRecipient == address(0)) {\n            revert AddressZero();\n        }\n\n        salesConfigs[msg.sender][tokenId] = salesConfig;\n\n        // Emit event\n        emit SaleSet(msg.sender, tokenId, salesConfig);\n    }\n\n    /// @notice Deletes the sale config for a given token\n    function resetSale(uint256 tokenId) external override {\n        delete salesConfigs[msg.sender][tokenId];\n\n        // Deleted sale emit event\n        emit SaleSet(msg.sender, tokenId, salesConfigs[msg.sender][tokenId]);\n    }\n\n    /// @notice Returns the sale config for a given token\n    function sale(address tokenContract, uint256 tokenId) external view returns (SalesConfig memory) {\n        return salesConfigs[tokenContract][tokenId];\n    }\n\n    /// @notice IERC165 interface support\n    function supportsInterface(bytes4 interfaceId) public pure virtual override(LimitedMintPerAddress, SaleStrategy) returns (bool) {\n        return super.supportsInterface(interfaceId) || LimitedMintPerAddress.supportsInterface(interfaceId) || SaleStrategy.supportsInterface(interfaceId);\n    }\n\n    /// @notice Reverts as `requestMint` is not used in the ERC20 minter. Call `mint` instead.\n    function requestMint(address, uint256, uint256, uint256, bytes calldata) external pure returns (ICreatorCommands.CommandSet memory) {\n        revert RequestMintInvalidUseMint();\n    }\n\n    /// @notice Set the Zora rewards recipient address\n    /// @param recipient The new recipient address\n    function setZoraRewardsRecipient(address recipient) external {\n        if (msg.sender != zoraRewardRecipientAddress) {\n            revert OnlyZoraRewardsRecipient();\n        }\n\n        if (recipient == address(0)) {\n            revert AddressZero();\n        }\n\n        emit ZoraRewardsRecipientSet(zoraRewardRecipientAddress, recipient);\n\n        zoraRewardRecipientAddress = recipient;\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IERC1271.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\ninterface IERC1271 {\n    function isValidSignature(bytes32 _hash, bytes calldata _signature) external view returns (bytes4);\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/IGetContractAddress.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {ContractCreationConfig} from \"../entities/Premint.sol\";\n\ninterface IGetContractAddress {\n    function getContractAddress(ContractCreationConfig calldata contractConfig) external view returns (address);\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/IZoraCreator1155PremintExecutorV2.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {ContractCreationConfig, PremintConfigV2, PremintResult, MintArguments} from \"../entities/Premint.sol\";\nimport {IGetContractAddress} from \"./IGetContractAddress.sol\";\n\ninterface IZoraCreator1155PremintExecutorV2 is IGetContractAddress {\n    function premintV2(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfigV2 calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        MintArguments calldata mintArguments\n    ) external payable returns (PremintResult memory);\n\n    function premintV2WithSignerContract(\n        ContractCreationConfig calldata contractConfig,\n        PremintConfigV2 calldata premintConfig,\n        bytes calldata signature,\n        uint256 quantityToMint,\n        MintArguments calldata mintArguments,\n        address firstMinter,\n        address signerContract\n    ) external payable returns (PremintResult memory result);\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/IZoraCreator1155Initializer.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {ICreatorRoyaltiesControl} from \"../interfaces/ICreatorRoyaltiesControl.sol\";\n\ninterface IZoraCreator1155Initializer {\n    function initialize(\n        string memory contractName,\n        string memory newContractURI,\n        ICreatorRoyaltiesControl.RoyaltyConfiguration memory defaultRoyaltyConfiguration,\n        address payable defaultAdmin,\n        bytes[] calldata setupActions\n    ) external;\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/proxies/Zora1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {Enjoy} from \"_imagine/mint/Enjoy.sol\";\nimport {ERC1967Proxy} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/*\n\n\n             ░░░░░░░░░░░░░░              \n        ░░▒▒░░░░░░░░░░░░░░░░░░░░        \n      ░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░      \n    ░░▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░    \n   ░▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░    \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░        ░░░░░░░░  \n  ░▓▓▓▒▒▒▒░░░░░░░░░░░░░░    ░░░░░░░░░░  \n  ░▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░  \n  ░▓▓▓▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░  \n   ░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░  \n    ░░▓▓▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░    \n    ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░▒▒▒▒▒░░    \n      ░░▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░      \n          ░░▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░          \n\n               OURS TRULY,\n\n\n */\n\n/// Imagine. Mint. Enjoy.\n/// @notice Imagine. Mint. Enjoy.\n/// @author ZORA @iainnash / @tbtstl\ncontract Zora1155 is Enjoy, ERC1967Proxy {\n    constructor(address _logic) ERC1967Proxy(_logic, \"\") {}\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/Create2Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as 'counterfactual interactions'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2Upgradeable {\n    /**\n     * @dev Deploys a contract using `CREATE2`. The address where the contract\n     * will be deployed can be known in advance via {computeAddress}.\n     *\n     * The bytecode for a contract can be obtained from Solidity with\n     * `type(contractName).creationCode`.\n     *\n     * Requirements:\n     *\n     * - `bytecode` must not be empty.\n     * - `salt` must have not been used for `bytecode` already.\n     * - the factory must have a balance of at least `amount`.\n     * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n     */\n    function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\n        require(address(this).balance >= amount, \"Create2: insufficient balance\");\n        require(bytecode.length != 0, \"Create2: bytecode length is zero\");\n        /// @solidity memory-safe-assembly\n        assembly {\n            addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n        }\n        require(addr != address(0), \"Create2: Failed on deploy\");\n    }\n\n    /**\n     * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n     * `bytecodeHash` or `salt` will result in a new destination address.\n     */\n    function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n        return computeAddress(salt, bytecodeHash, address(this));\n    }\n\n    /**\n     * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n     * `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.\n     */\n    function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            let ptr := mload(0x40) // Get free memory pointer\n\n            // |                   | ↓ ptr ...  ↓ ptr + 0x0B (start) ...  ↓ ptr + 0x20 ...  ↓ ptr + 0x40 ...   |\n            // |-------------------|---------------------------------------------------------------------------|\n            // | bytecodeHash      |                                                        CCCCCCCCCCCCC...CC |\n            // | salt              |                                      BBBBBBBBBBBBB...BB                   |\n            // | deployer          | 000000...0000AAAAAAAAAAAAAAAAAAA...AA                                     |\n            // | 0xFF              |            FF                                                             |\n            // |-------------------|---------------------------------------------------------------------------|\n            // | memory            | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n            // | keccak(start, 85) |            ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n            mstore(add(ptr, 0x40), bytecodeHash)\n            mstore(add(ptr, 0x20), salt)\n            mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n            let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n            mstore8(start, 0xff)\n            addr := keccak256(start, 85)\n        }\n    }\n}\n"
      },
      "node_modules/solmate/src/utils/CREATE3.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\nimport {Bytes32AddressLib} from \"./Bytes32AddressLib.sol\";\n\n/// @notice Deploy to deterministic addresses without an initcode factor.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/CREATE3.sol)\n/// @author Modified from 0xSequence (https://github.com/0xSequence/create3/blob/master/contracts/Create3.sol)\nlibrary CREATE3 {\n    using Bytes32AddressLib for bytes32;\n\n    //--------------------------------------------------------------------------------//\n    // Opcode     | Opcode + Arguments    | Description      | Stack View             //\n    //--------------------------------------------------------------------------------//\n    // 0x36       |  0x36                 | CALLDATASIZE     | size                   //\n    // 0x3d       |  0x3d                 | RETURNDATASIZE   | 0 size                 //\n    // 0x3d       |  0x3d                 | RETURNDATASIZE   | 0 0 size               //\n    // 0x37       |  0x37                 | CALLDATACOPY     |                        //\n    // 0x36       |  0x36                 | CALLDATASIZE     | size                   //\n    // 0x3d       |  0x3d                 | RETURNDATASIZE   | 0 size                 //\n    // 0x34       |  0x34                 | CALLVALUE        | value 0 size           //\n    // 0xf0       |  0xf0                 | CREATE           | newContract            //\n    //--------------------------------------------------------------------------------//\n    // Opcode     | Opcode + Arguments    | Description      | Stack View             //\n    //--------------------------------------------------------------------------------//\n    // 0x67       |  0x67XXXXXXXXXXXXXXXX | PUSH8 bytecode   | bytecode               //\n    // 0x3d       |  0x3d                 | RETURNDATASIZE   | 0 bytecode             //\n    // 0x52       |  0x52                 | MSTORE           |                        //\n    // 0x60       |  0x6008               | PUSH1 08         | 8                      //\n    // 0x60       |  0x6018               | PUSH1 18         | 24 8                   //\n    // 0xf3       |  0xf3                 | RETURN           |                        //\n    //--------------------------------------------------------------------------------//\n    bytes internal constant PROXY_BYTECODE = hex\"67_36_3d_3d_37_36_3d_34_f0_3d_52_60_08_60_18_f3\";\n\n    bytes32 internal constant PROXY_BYTECODE_HASH = keccak256(PROXY_BYTECODE);\n\n    function deploy(\n        bytes32 salt,\n        bytes memory creationCode,\n        uint256 value\n    ) internal returns (address deployed) {\n        bytes memory proxyChildBytecode = PROXY_BYTECODE;\n\n        address proxy;\n        /// @solidity memory-safe-assembly\n        assembly {\n            // Deploy a new contract with our pre-made bytecode via CREATE2.\n            // We start 32 bytes into the code to avoid copying the byte length.\n            proxy := create2(0, add(proxyChildBytecode, 32), mload(proxyChildBytecode), salt)\n        }\n        require(proxy != address(0), \"DEPLOYMENT_FAILED\");\n\n        deployed = getDeployed(salt);\n        (bool success, ) = proxy.call{value: value}(creationCode);\n        require(success && deployed.code.length != 0, \"INITIALIZATION_FAILED\");\n    }\n\n    function getDeployed(bytes32 salt) internal view returns (address) {\n        address proxy = keccak256(\n            abi.encodePacked(\n                // Prefix:\n                bytes1(0xFF),\n                // Creator:\n                address(this),\n                // Salt:\n                salt,\n                // Bytecode hash:\n                PROXY_BYTECODE_HASH\n            )\n        ).fromLast20Bytes();\n\n        return\n            keccak256(\n                abi.encodePacked(\n                    // 0xd6 = 0xc0 (short RLP prefix) + 0x16 (length of: 0x94 ++ proxy ++ 0x01)\n                    // 0x94 = 0x80 + 0x14 (0x14 = the length of an address, 20 bytes, in hex)\n                    hex\"d6_94\",\n                    proxy,\n                    hex\"01\" // Nonce of the proxy contract (1)\n                )\n            ).fromLast20Bytes();\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/version/ContractVersionBase.sol": {
        "content": "// This file is automatically generated by code; do not manually update\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.17;\n\nimport {IVersionedContract} from \"@zoralabs/shared-contracts/interfaces/IVersionedContract.sol\";\n\n/// @title ContractVersionBase\n/// @notice Base contract for versioning contracts\ncontract ContractVersionBase is IVersionedContract {\n    /// @notice The version of the contract\n    function contractVersion() external pure override returns (string memory) {\n        return \"2.9.0\";\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts/utils/introspection/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 * 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 IERC165 {\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"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/proxy/beacon/IBeaconUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeaconUpgradeable {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {BeaconProxy} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n\nerror ADDRESS_INSUFFICIENT_BALANCE();\nerror ADDRESS_UNABLE_TO_SEND_VALUE();\nerror ADDRESS_LOW_LEVEL_CALL_FAILED();\nerror ADDRESS_LOW_LEVEL_CALL_WITH_VALUE_FAILED();\nerror ADDRESS_INSUFFICIENT_BALANCE_FOR_CALL();\nerror ADDRESS_LOW_LEVEL_STATIC_CALL_FAILED();\nerror ADDRESS_CALL_TO_NON_CONTRACT();\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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance > amount) {\n            revert ADDRESS_INSUFFICIENT_BALANCE();\n        }\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            revert ADDRESS_UNABLE_TO_SEND_VALUE();\n        }\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);\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(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert ADDRESS_INSUFFICIENT_BALANCE();\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\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(\n        address target,\n        bytes memory data\n    ) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\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    ) 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                if (!isContract(target)) {\n                    revert ADDRESS_CALL_TO_NON_CONTRACT();\n                }\n            }\n            return returndata;\n        } else {\n            _revert(returndata);\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    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            _revert(returndata);\n        }\n    }\n\n    function _revert(bytes memory returndata) 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 ADDRESS_LOW_LEVEL_CALL_FAILED();\n        }\n    }\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/StorageSlotUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlotUpgradeable {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n}\n"
      },
      "node_modules/@zoralabs/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"
      },
      "node_modules/@zoralabs/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"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/ITransferHookReceiver.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IERC165Upgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol\";\n\ninterface ITransferHookReceiver is IERC165Upgradeable {\n    /// @notice Token transfer batch callback\n    /// @param target target contract for transfer\n    /// @param operator operator address for transfer\n    /// @param from user address for amount transferred\n    /// @param to user address for amount transferred\n    /// @param ids list of token ids transferred\n    /// @param amounts list of values transferred\n    /// @param data data as perscribed by 1155 standard\n    function onTokenTransferBatch(\n        address target,\n        address operator,\n        address from,\n        address to,\n        uint256[] memory ids,\n        uint256[] memory amounts,\n        bytes memory data\n    ) external;\n\n    /// @notice Token transfer batch callback\n    /// @param target target contract for transfer\n    /// @param operator operator address for transfer\n    /// @param from user address for amount transferred\n    /// @param to user address for amount transferred\n    /// @param id token id transferred\n    /// @param amount value transferred\n    /// @param data data as perscribed by 1155 standard\n    function onTokenTransfer(address target, address operator, address from, address to, uint256 id, uint256 amount, bytes memory data) external;\n    // IERC165 type required\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/errors/IMinterErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IMinterErrors {\n    error CallerNotZoraCreator1155();\n    error MinterContractAlreadyExists();\n    error MinterContractDoesNotExist();\n\n    error SaleEnded();\n    error SaleHasNotStarted();\n    error WrongValueSent();\n    error InvalidMerkleProof(address mintTo, bytes32[] merkleProof, bytes32 merkleRoot);\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/ICreatorCommands.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\n/// @notice Creator Commands used by minter modules passed back to the main modules\ninterface ICreatorCommands {\n    /// @notice This enum is used to define supported creator action types.\n    /// This can change in the future\n    enum CreatorActions {\n        // No operation - also the default for mintings that may not return a command\n        NO_OP,\n        // Send ether\n        SEND_ETH,\n        // Mint operation\n        MINT\n    }\n\n    /// @notice This command is for\n    struct Command {\n        // Method for operation\n        CreatorActions method;\n        // Arguments used for this operation\n        bytes args;\n    }\n\n    /// @notice This command set is returned from the minter back to the user\n    struct CommandSet {\n        Command[] commands;\n        uint256 at;\n    }\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/interfaces/ILimitedMintPerAddress.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IERC165Upgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol\";\nimport {ILimitedMintPerAddressErrors} from \"@zoralabs/shared-contracts/interfaces/errors/IZoraCreator1155Errors.sol\";\n\ninterface ILimitedMintPerAddress is IERC165Upgradeable, ILimitedMintPerAddressErrors {\n    function getMintedPerWallet(address token, uint256 tokenId, address wallet) external view returns (uint256);\n}\n"
      },
      "node_modules/@zoralabs/shared-contracts/src/interfaces/IERC165Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\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"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/StringsUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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"
      },
      "node_modules/@openzeppelin/contracts/security/ReentrancyGuard.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant _NOT_ENTERED = 1;\n    uint256 private constant _ENTERED = 2;\n\n    uint256 private _status;\n\n    constructor() {\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        // On the first call to nonReentrant, _status will be _NOT_ENTERED\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        return _status == _ENTERED;\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../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    /**\n     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    /**\n     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\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    /**\n     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\n     */\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 oldAllowance = token.allowance(address(this), spender);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n    }\n\n    /**\n     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful.\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            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n        }\n    }\n\n    /**\n     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n     * non-reverting calls are assumed to be successful. Compatible with tokens that require the approval to be set to\n     * 0 before setting it to a non-zero value.\n     */\n    function forceApprove(IERC20 token, address spender, uint256 value) internal {\n        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n        if (!_callOptionalReturnBool(token, approvalCall)) {\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n            _callOptionalReturn(token, approvalCall);\n        }\n    }\n\n    /**\n     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n     * Revert on invalid signature.\n     */\n    function safePermit(\n        IERC20Permit token,\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal {\n        uint256 nonceBefore = token.nonces(owner);\n        token.permit(owner, spender, value, deadline, v, r, s);\n        uint256 nonceAfter = token.nonces(owner);\n        require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\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        require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\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     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n     */\n    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\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 cannot use {Address-functionCall} here since this should return false\n        // and not revert is the subcall reverts.\n\n        (bool success, bytes memory returndata) = address(token).call(data);\n        return\n            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n    }\n}\n"
      },
      "node_modules/@zoralabs/protocol-rewards/src/interfaces/IProtocolRewards.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\n/// @title IProtocolRewards\n/// @notice The interface for deposits & withdrawals for Protocol Rewards\ninterface IProtocolRewards {\n    /// @notice Rewards Deposit Event\n    /// @param creator Creator for NFT rewards\n    /// @param createReferral Creator referral\n    /// @param mintReferral Mint referral user\n    /// @param firstMinter First minter reward recipient\n    /// @param zora ZORA recipient\n    /// @param from The caller of the deposit\n    /// @param creatorReward Creator reward amount\n    /// @param createReferralReward Creator referral reward\n    /// @param mintReferralReward Mint referral amount\n    /// @param firstMinterReward First minter reward amount\n    /// @param zoraReward ZORA amount\n    event RewardsDeposit(\n        address indexed creator,\n        address indexed createReferral,\n        address indexed mintReferral,\n        address firstMinter,\n        address zora,\n        address from,\n        uint256 creatorReward,\n        uint256 createReferralReward,\n        uint256 mintReferralReward,\n        uint256 firstMinterReward,\n        uint256 zoraReward\n    );\n\n    /// @notice Deposit Event\n    /// @param from From user\n    /// @param to To user (within contract)\n    /// @param reason Optional bytes4 reason for indexing\n    /// @param amount Amount of deposit\n    /// @param comment Optional user comment\n    event Deposit(address indexed from, address indexed to, bytes4 indexed reason, uint256 amount, string comment);\n\n    /// @notice Withdraw Event\n    /// @param from From user\n    /// @param to To user (within contract)\n    /// @param amount Amount of deposit\n    event Withdraw(address indexed from, address indexed to, uint256 amount);\n\n    /// @notice Cannot send to address zero\n    error ADDRESS_ZERO();\n\n    /// @notice Function argument array length mismatch\n    error ARRAY_LENGTH_MISMATCH();\n\n    /// @notice Invalid deposit\n    error INVALID_DEPOSIT();\n\n    /// @notice Invalid signature for deposit\n    error INVALID_SIGNATURE();\n\n    /// @notice Invalid withdraw\n    error INVALID_WITHDRAW();\n\n    /// @notice Signature for withdraw is too old and has expired\n    error SIGNATURE_DEADLINE_EXPIRED();\n\n    /// @notice Low-level ETH transfer has failed\n    error TRANSFER_FAILED();\n\n    /// @notice Generic function to deposit ETH for a recipient, with an optional comment\n    /// @param to Address to deposit to\n    /// @param to Reason system reason for deposit (used for indexing)\n    /// @param comment Optional comment as reason for deposit\n    function deposit(address to, bytes4 why, string calldata comment) external payable;\n\n    /// @notice Generic function to deposit ETH for multiple recipients, with an optional comment\n    /// @param recipients recipients to send the amount to, array aligns with amounts\n    /// @param amounts amounts to send to each recipient, array aligns with recipients\n    /// @param reasons optional bytes4 hash for indexing\n    /// @param comment Optional comment to include with mint\n    function depositBatch(address[] calldata recipients, uint256[] calldata amounts, bytes4[] calldata reasons, string calldata comment) external payable;\n\n    /// @notice Used by Zora ERC-721 & ERC-1155 contracts to deposit protocol rewards\n    /// @param creator Creator for NFT rewards\n    /// @param creatorReward Creator reward amount\n    /// @param createReferral Creator referral\n    /// @param createReferralReward Creator referral reward\n    /// @param mintReferral Mint referral user\n    /// @param mintReferralReward Mint referral amount\n    /// @param firstMinter First minter reward\n    /// @param firstMinterReward First minter reward amount\n    /// @param zora ZORA recipient\n    /// @param zoraReward ZORA amount\n    function depositRewards(\n        address creator,\n        uint256 creatorReward,\n        address createReferral,\n        uint256 createReferralReward,\n        address mintReferral,\n        uint256 mintReferralReward,\n        address firstMinter,\n        uint256 firstMinterReward,\n        address zora,\n        uint256 zoraReward\n    ) external payable;\n\n    /// @notice Withdraw protocol rewards\n    /// @param to Withdraws from msg.sender to this address\n    /// @param amount amount to withdraw\n    function withdraw(address to, uint256 amount) external;\n\n    /// @notice Execute a withdraw of protocol rewards via signature\n    /// @param from Withdraw from this address\n    /// @param to Withdraw to this address\n    /// @param amount Amount to withdraw\n    /// @param deadline Deadline for the signature to be valid\n    /// @param v V component of signature\n    /// @param r R component of signature\n    /// @param s S component of signature\n    function withdrawWithSig(address from, address to, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/minters/erc20/ERC20MinterRewards.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\n/// @notice ERC20Minter Helper contract template\nabstract contract ERC20MinterRewards {\n    uint256 internal constant MIN_PRICE_PER_TOKEN = 10_000;\n    uint256 internal constant TOTAL_REWARD_PCT = 5; // 5%\n    uint256 internal constant BPS_TO_PERCENT_2_DECIMAL_PERCISION = 100;\n    uint256 internal constant BPS_TO_PERCENT_8_DECIMAL_PERCISION = 100_000_000;\n    uint256 internal constant CREATE_REFERRAL_PAID_MINT_REWARD_PCT = 28_571400; // 28.5714%, roughly 0.000222 ETH at a 0.000777 value\n    uint256 internal constant MINT_REFERRAL_PAID_MINT_REWARD_PCT = 28_571400; // 28.5714%, roughly 0.000222 ETH at a 0.000777 value\n    uint256 internal constant ZORA_PAID_MINT_REWARD_PCT = 28_571400; // 28.5714%, roughly 0.000222 ETH at a 0.000777 value\n    uint256 internal constant FIRST_MINTER_REWARD_PCT = 14_228500; // 14.2285%, roughly 0.000111 ETH at a 0.000777 value\n}\n"
      },
      "node_modules/@zoralabs/zora-1155-contracts/src/minters/erc20/IZora1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\n/// @notice The set of public functions on a Zora 1155 contract that are called by the ERC20 minter contract\ninterface IZora1155 {\n    function createReferrals(uint256 tokenId) external view returns (address);\n\n    function firstMinters(uint256 tokenId) external view returns (address);\n\n    function getCreatorRewardRecipient(uint256 tokenId) external view returns (address);\n\n    function adminMint(address recipient, uint256 tokenId, uint256 quantity, bytes memory data) external;\n}\n"
      },
      "node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n    /**\n     * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n     *\n     * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n     * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n     */\n    constructor(address _logic, bytes memory _data) payable {\n        _upgradeToAndCall(_logic, _data, false);\n    }\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _implementation() internal view virtual override returns (address impl) {\n        return ERC1967Upgrade._getImplementation();\n    }\n}\n"
      },
      "node_modules/solmate/src/utils/Bytes32AddressLib.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Library for converting between addresses and bytes32 values.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/Bytes32AddressLib.sol)\nlibrary Bytes32AddressLib {\n    function fromLast20Bytes(bytes32 bytesValue) internal pure returns (address) {\n        return address(uint160(uint256(bytesValue)));\n    }\n\n    function fillLast12Bytes(address addressValue) internal pure returns (bytes32) {\n        return bytes32(bytes20(addressValue));\n    }\n}\n"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/IERC1155Upgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.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"
      },
      "node_modules/@zoralabs/openzeppelin-contracts-upgradeable/contracts/utils/math/MathUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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                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"
      },
      "node_modules/@zoralabs/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"
      },
      "node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n    /**\n     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n     * given ``owner``'s signed approval.\n     *\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n     * ordering also apply here.\n     *\n     * Emits an {Approval} event.\n     *\n     * Requirements:\n     *\n     * - `spender` cannot be the zero address.\n     * - `deadline` must be a timestamp in the future.\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n     * over the EIP712-formatted function arguments.\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\n     *\n     * For more information on the signature format, see the\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n     * section].\n     */\n    function permit(\n        address owner,\n        address spender,\n        uint256 value,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    /**\n     * @dev Returns the current nonce for `owner`. This value must be\n     * included whenever a signature is generated for {permit}.\n     *\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\n     * prevents a signature from being used multiple times.\n     */\n    function nonces(address owner) external view returns (uint256);\n\n    /**\n     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n     */\n    // solhint-disable-next-line func-name-mixedcase\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n"
      },
      "node_modules/@openzeppelin/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"
      },
      "node_modules/@openzeppelin/contracts/proxy/Proxy.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n    /**\n     * @dev Delegates the current call to `implementation`.\n     *\n     * This function does not return to its internal call site, it will return directly to the external caller.\n     */\n    function _delegate(address implementation) internal virtual {\n        assembly {\n            // Copy msg.data. We take full control of memory in this inline assembly\n            // block because it will not return to Solidity code. We overwrite the\n            // Solidity scratch pad at memory position 0.\n            calldatacopy(0, 0, calldatasize())\n\n            // Call the implementation.\n            // out and outsize are 0 because we don't know the size yet.\n            let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n            // Copy the returned data.\n            returndatacopy(0, 0, returndatasize())\n\n            switch result\n            // delegatecall returns 0 on error.\n            case 0 {\n                revert(0, returndatasize())\n            }\n            default {\n                return(0, returndatasize())\n            }\n        }\n    }\n\n    /**\n     * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n     * and {_fallback} should delegate.\n     */\n    function _implementation() internal view virtual returns (address);\n\n    /**\n     * @dev Delegates the current call to the address returned by `_implementation()`.\n     *\n     * This function does not return to its internal call site, it will return directly to the external caller.\n     */\n    function _fallback() internal virtual {\n        _beforeFallback();\n        _delegate(_implementation());\n    }\n\n    /**\n     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n     * function in the contract matches the call data.\n     */\n    fallback() external payable virtual {\n        _fallback();\n    }\n\n    /**\n     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n     * is empty.\n     */\n    receive() external payable virtual {\n        _fallback();\n    }\n\n    /**\n     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n     * call, or as part of the Solidity `fallback` or `receive` functions.\n     *\n     * If overridden should call `super._beforeFallback()`.\n     */\n    function _beforeFallback() internal virtual {}\n}\n"
      },
      "node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/IERC1967.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n    // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n    bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n    /**\n     * @dev Storage slot with the address of the current implementation.\n     * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev Returns the current implementation address.\n     */\n    function _getImplementation() internal view returns (address) {\n        return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n        StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Perform implementation upgrade\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeTo(address newImplementation) internal {\n        _setImplementation(newImplementation);\n        emit Upgraded(newImplementation);\n    }\n\n    /**\n     * @dev Perform implementation upgrade with additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n        _upgradeTo(newImplementation);\n        if (data.length > 0 || forceCall) {\n            Address.functionDelegateCall(newImplementation, data);\n        }\n    }\n\n    /**\n     * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n     *\n     * Emits an {Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n        // Upgrades from old implementations will perform a rollback test. This test requires the new\n        // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n        // this special case will break upgrade paths from old UUPS implementation to new ones.\n        if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n            _setImplementation(newImplementation);\n        } else {\n            try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n                require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n            } catch {\n                revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n            }\n            _upgradeToAndCall(newImplementation, data, forceCall);\n        }\n    }\n\n    /**\n     * @dev Storage slot with the admin of the contract.\n     * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n     * validated in the constructor.\n     */\n    bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n    /**\n     * @dev Returns the current admin.\n     */\n    function _getAdmin() internal view returns (address) {\n        return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new address in the EIP1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n        StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {AdminChanged} event.\n     */\n    function _changeAdmin(address newAdmin) internal {\n        emit AdminChanged(_getAdmin(), newAdmin);\n        _setAdmin(newAdmin);\n    }\n\n    /**\n     * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n     * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n     */\n    bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n    /**\n     * @dev Returns the current beacon.\n     */\n    function _getBeacon() internal view returns (address) {\n        return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n    }\n\n    /**\n     * @dev Stores a new beacon in the EIP1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n        require(\n            Address.isContract(IBeacon(newBeacon).implementation()),\n            \"ERC1967: beacon implementation is not a contract\"\n        );\n        StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n    }\n\n    /**\n     * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n     * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n     *\n     * Emits a {BeaconUpgraded} event.\n     */\n    function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n        _setBeacon(newBeacon);\n        emit BeaconUpgraded(newBeacon);\n        if (data.length > 0 || forceCall) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        }\n    }\n}\n"
      },
      "node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n    /**\n     * @dev Must return an address that can be used as a delegate call target.\n     *\n     * {BeaconProxy} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"
      },
      "node_modules/@openzeppelin/contracts/interfaces/IERC1967.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n    /**\n     * @dev Emitted when the implementation is upgraded.\n     */\n    event Upgraded(address indexed implementation);\n\n    /**\n     * @dev Emitted when the admin account has changed.\n     */\n    event AdminChanged(address previousAdmin, address newAdmin);\n\n    /**\n     * @dev Emitted when the beacon is changed.\n     */\n    event BeaconUpgraded(address indexed beacon);\n}\n"
      },
      "node_modules/@openzeppelin/contracts/interfaces/draft-IERC1822.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n    /**\n     * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n     * address.\n     *\n     * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n     * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n     * function revert if invoked through a proxy.\n     */\n    function proxiableUUID() external view returns (bytes32);\n}\n"
      },
      "node_modules/@openzeppelin/contracts/utils/StorageSlot.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n *     function _getImplementation() internal view returns (address) {\n *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n *     }\n *\n *     function _setImplementation(address newImplementation) internal {\n *         require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n    struct AddressSlot {\n        address value;\n    }\n\n    struct BooleanSlot {\n        bool value;\n    }\n\n    struct Bytes32Slot {\n        bytes32 value;\n    }\n\n    struct Uint256Slot {\n        uint256 value;\n    }\n\n    struct StringSlot {\n        string value;\n    }\n\n    struct BytesSlot {\n        bytes value;\n    }\n\n    /**\n     * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n     */\n    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n     */\n    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n     */\n    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n        /// @solidity memory-safe-assembly\n        assembly {\n            r.slot := store.slot\n        }\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=node_modules/ds-test/src/",
        "forge-std/=node_modules/forge-std/src/",
        "@zoralabs/openzeppelin-contracts-upgradeable/=node_modules/@zoralabs/openzeppelin-contracts-upgradeable/",
        "@zoralabs/protocol-rewards/src/=node_modules/@zoralabs/protocol-rewards/src/",
        "@zoralabs/zora-1155-contracts/src/=node_modules/@zoralabs/zora-1155-contracts/src/",
        "@zoralabs/mints-contracts/src/=node_modules/@zoralabs/mints-contracts/src/",
        "@zoralabs/shared-contracts/=node_modules/@zoralabs/shared-contracts/src/",
        "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
        "_imagine/=node_modules/@zoralabs/zora-1155-contracts/_imagine/",
        "solemate/=/node_modules/solemate/src/",
        "solady/=node_modules/solady/src/",
        "solmate/=node_modules/solmate/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 50
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs"
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "london",
      "viaIR": true,
      "libraries": {
        "node_modules/@zoralabs/zora-1155-contracts/src/delegation/ZoraCreator1155Attribution.sol": {
          "DelegatedTokenCreation": "0x91509707F397e357DCe975399Fc98bB58081Ad63"
        }
      }
    }
  }}