creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "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/@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/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/@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"
      },
      "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"
      },
      "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"
      },
      "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 \"../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"
      },
      "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"
      },
      "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"
      },
      "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/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"
      },
      "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\";\n\ninterface ILimitedMintPerAddressErrors {\n    error UserExceedsMintLimit(address user, uint256 limit, uint256 requestedAmount);\n}\n\ninterface ILimitedMintPerAddress is IERC165Upgradeable, ILimitedMintPerAddressErrors {\n    function getMintedPerWallet(address token, uint256 tokenId, address wallet) external view returns (uint256);\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"
      },
      "src/interfaces/IMinter1155.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\nimport {IERC165Upgradeable} from \"@zoralabs/openzeppelin-contracts-upgradeable/contracts/interfaces/IERC165Upgradeable.sol\";\nimport {ICreatorCommands} from \"./ICreatorCommands.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"
      },
      "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"
      },
      "src/interfaces/IVersionedContract.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.17;\n\ninterface IVersionedContract {\n    function contractVersion() external returns (string memory);\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"
      }
    },
    "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/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/=_imagine/",
        "solemate/=/node_modules/solemate/src/",
        "solady/=node_modules/solady/src/",
        "mint/=_imagine/mint/",
        "solmate/=node_modules/solmate/"
      ],
      "optimizer": {
        "enabled": false,
        "runs": 0
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs"
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "london",
      "viaIR": false,
      "libraries": {}
    }
  }}