@artblocks/contracts 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/README.md +11 -10
  2. package/artifacts/contracts/AdminACLV0RoyaltyRegistry.sol/AdminACLV0RoyaltyRegistry.json +193 -0
  3. package/artifacts/contracts/AdminACLV0RoyaltyRegistry.sol/IRoyaltyRegistry.json +35 -0
  4. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  5. package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol/BytecodeStorageReaderContractV2.json +2 -2
  6. package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol/BytecodeStorageReaderContractV2_Web3Call.json +2 -2
  7. package/artifacts/contracts/BytecodeStorageV2Writer.sol/BytecodeStorageV2Writer.json +2 -2
  8. package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +210 -2
  9. package/artifacts/contracts/GenArt721CoreV3_Curated.sol/GenArt721CoreV3_Curated.json +235 -20
  10. package/artifacts/contracts/GenArt721CoreV3_Curated_Flex.sol/GenArt721CoreV3_Curated_Flex.json +3197 -0
  11. package/artifacts/contracts/GenArt721CoreV3_Explorations_Flex.sol/GenArt721CoreV3_Explorations_Flex.json +3192 -0
  12. package/artifacts/contracts/OwnedCreate2FactoryV0.sol/OwnedCreate2FactoryV0.json +2 -2
  13. package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +27 -2
  14. package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +27 -2
  15. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
  16. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
  17. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
  18. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  19. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
  20. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
  21. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
  22. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
  23. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV4.sol/MinterDALinV4.json +2 -2
  24. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
  25. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
  26. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
  27. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV4.sol/MinterHolderV4.json +2 -2
  28. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
  29. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
  30. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
  31. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
  32. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
  33. package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +25 -0
  34. package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
  35. package/artifacts/contracts/archive/minter-suite/Minters/MinterSEA/MinterSEAV0.sol/MinterSEAV0.json +2 -2
  36. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  37. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  38. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
  39. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  40. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  41. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
  42. package/artifacts/contracts/engine/V3/EngineFactoryV0.sol/EngineFactoryV0.json +28 -2
  43. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +239 -20
  44. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +267 -48
  45. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +27 -2
  46. package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +2 -2
  47. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +27 -2
  48. package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +25 -0
  49. package/artifacts/contracts/engine/V3/transfer-hooks/AbstractTransferHook.sol/AbstractTransferHook.json +79 -0
  50. package/artifacts/contracts/engine/V3/transfer-hooks/OwnerHistoryTransferHook.sol/OwnerHistoryTransferHook.json +315 -0
  51. package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/GenArt721GeneratorV0.json +2 -2
  52. package/artifacts/contracts/interfaces/v0.8.x/IClaimMinter.sol/IClaimMinter.json +189 -0
  53. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +149 -0
  54. package/artifacts/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol/IEngineFactoryV0.json +26 -0
  55. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +25 -0
  56. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +25 -0
  57. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +123 -0
  58. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +123 -0
  59. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +25 -0
  60. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +25 -0
  61. package/artifacts/contracts/interfaces/v0.8.x/IOwnerHistoryTransferHook.sol/IOwnerHistoryTransferHook.json +299 -0
  62. package/artifacts/contracts/interfaces/v0.8.x/ISRHooks.sol/ISRHooks.json +432 -0
  63. package/artifacts/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol/ISeaDropShimForContract.json +0 -13
  64. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterTieredAllowV0.sol/ISharedMinterTieredAllowV0.json +94 -0
  65. package/artifacts/contracts/interfaces/v0.8.x/ITransferHook.sol/ITransferHook.json +63 -0
  66. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  67. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageReader.json +2 -2
  68. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageWriter.json +2 -2
  69. package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +2 -2
  70. package/artifacts/contracts/libs/v0.8.x/ENSLib.sol/ENSLib.json +10 -0
  71. package/artifacts/contracts/libs/v0.8.x/ENSLib.sol/IUniversalResolver.json +45 -0
  72. package/artifacts/contracts/libs/v0.8.x/EnumerableSetUint16.sol/EnumerableSetUint16.json +10 -0
  73. package/artifacts/contracts/libs/v0.8.x/FeistelWalkLib.sol/FeistelWalkLib.json +10 -0
  74. package/artifacts/contracts/libs/v0.8.x/ImmutableUint16Array.sol/ImmutableUint16Array.json +10 -0
  75. package/artifacts/contracts/libs/v0.8.x/V3EngineLib.sol/V3EngineLib.json +163 -0
  76. package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +2 -2
  77. package/artifacts/contracts/libs/v0.8.x/V3TransferHookLib.sol/V3TransferHookLib.json +79 -0
  78. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
  79. package/artifacts/contracts/libs/v0.8.x/minter-libs/OnChainAllowlistLib.sol/OnChainAllowlistLib.json +10 -0
  80. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  81. package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +2 -2
  82. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +2 -2
  83. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +2 -2
  84. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +2 -2
  85. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  86. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +2 -2
  87. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +2 -2
  88. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +2 -2
  89. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +2 -2
  90. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +2 -2
  91. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +2 -2
  92. package/artifacts/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol/MinterMinPriceMerkleV0.json +2 -2
  93. package/artifacts/contracts/minter-suite/Minters/MinterMinPriceV0.sol/MinterMinPriceV0.json +2 -2
  94. package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +2 -2
  95. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +2 -2
  96. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +2 -2
  97. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +2 -2
  98. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +2 -2
  99. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceOnChainAllowV0.sol/MinterSetPriceOnChainAllowV0.json +522 -0
  100. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +2 -2
  101. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +2 -2
  102. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceTieredAllowV1.sol/MinterSetPriceTieredAllowV1.json +715 -0
  103. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
  104. package/artifacts/contracts/minter-suite/Minters/MinterSlidingScaleV0.sol/MinterSlidingScaleV0.json +431 -0
  105. package/artifacts/contracts/minter-suite/Minters/one-off/ClaimMinter.sol/ClaimMinter.json +502 -0
  106. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceTieredOnChainAllowV0.sol/MinterSetPriceTieredOnChainAllowV0.json +673 -0
  107. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +2 -2
  108. package/artifacts/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol/SeaDropXArtBlocksShim.json +6 -19
  109. package/artifacts/contracts/mock/BytecodeV2TextCR_DMock.sol/BytecodeV2TextCR_DMock.json +2 -2
  110. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  111. package/artifacts/contracts/mock/ENSLibMock.sol/ENSLibMock.json +30 -0
  112. package/artifacts/contracts/mock/EnumerableSetUint16Mock.sol/EnumerableSetUint16Mock.json +146 -0
  113. package/artifacts/contracts/mock/FeistelWalkLibMock.sol/FeistelWalkLibMock.json +142 -0
  114. package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +2 -2
  115. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
  116. package/artifacts/contracts/mock/ImmutableUint16ArrayMock.sol/ImmutableUint16ArrayMock.json +89 -0
  117. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
  118. package/artifacts/contracts/mock/MockGenArt721V3Core.sol/MockGenArt721V3Core.json +490 -0
  119. package/artifacts/contracts/mock/MockPMP.sol/MockPMP.json +523 -0
  120. package/artifacts/contracts/mock/MockTransferHook.sol/MockTransferHook.json +453 -0
  121. package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockBatchTransferrer.json +39 -0
  122. package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockForwardingERC721Receiver.json +71 -0
  123. package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockSpoofingCore.json +94 -0
  124. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  125. package/artifacts/contracts/mock/ReentrancyBatchMockShared.sol/IBatchMinter.json +64 -0
  126. package/artifacts/contracts/mock/ReentrancyBatchMockShared.sol/ReentrancyBatchMockShared.json +113 -0
  127. package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/MockTarget.json +74 -0
  128. package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/RelayExecutorPartialRevertsTestHelper.json +138 -0
  129. package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/RelayExecutorTestHelper.json +119 -0
  130. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
  131. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
  132. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +2 -2
  133. package/artifacts/contracts/relay/RelayExecutor.sol/RelayExecutor.json +101 -0
  134. package/artifacts/contracts/relay/RelayExecutorPartialReverts.sol/RelayExecutorPartialReverts.json +120 -0
  135. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverrideSplits.sol/GenArt721RoyaltyOverrideSplits.json +263 -0
  136. package/artifacts/contracts/utils/MintMulticallUtil.sol/IMinterSetPriceV5.json +40 -0
  137. package/artifacts/contracts/utils/MintMulticallUtil.sol/MintMulticallUtil.json +163 -0
  138. package/artifacts/contracts/web3call/PMPV0.sol/PMPV0.json +2 -2
  139. package/artifacts/contracts/web3call/PMPV1.sol/PMPV1.json +648 -0
  140. package/artifacts/contracts/web3call/augment-hooks/InjectBaseGasFee.sol/InjectBaseGasFee.json +2 -2
  141. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeight.sol/InjectBlockHeight.json +83 -0
  142. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightAndArtistProjectOverrides.sol/InjectBlockHeightAndArtistProjectOverrides.json +226 -0
  143. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightAndNumOwnedProjectTokens.sol/InjectBlockHeightAndNumOwnedProjectTokens.json +182 -0
  144. package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.sol/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.json +226 -0
  145. package/artifacts/contracts/web3call/augment-hooks/InjectBlockTimestamp.sol/InjectBlockTimestamp.json +83 -0
  146. package/artifacts/contracts/web3call/augment-hooks/InjectBytesPerToken.sol/InjectBytesPerToken.json +358 -0
  147. package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/InjectChromieSquiggleFloorPrice.json +2 -2
  148. package/artifacts/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol/InjectIsNounsDaoMember.json +2 -2
  149. package/artifacts/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol/InjectIsProjectFullyMinted.json +2 -2
  150. package/artifacts/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol/InjectPolyptychTokenHash.json +2 -2
  151. package/artifacts/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol/InjectTokenHashSeed.json +2 -2
  152. package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwner.sol/InjectTokenOwner.json +2 -2
  153. package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol/InjectTokenOwnerEthBalance.json +2 -2
  154. package/artifacts/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol/InjectUSDCTotalSupply.json +2 -2
  155. package/artifacts/contracts/web3call/augment-hooks/SRHooks.sol/SRHooks.json +899 -0
  156. package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/IGenArt721V0_Minimal.json +30 -0
  157. package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/IRelic.json +35 -0
  158. package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/LiftHooks.json +256 -0
  159. package/artifacts/contracts/web3call/configure-hooks/{abstractPMPConfigureHook.sol → AbstractPMPConfigureHook.sol}/AbstractPMPConfigureHook.json +1 -1
  160. package/artifacts/contracts/web3call/configure-hooks/PMPConfigureLockHook.sol/PMPConfigureLockHook.json +195 -0
  161. package/contracts/AdminACLV0RoyaltyRegistry.sol +142 -0
  162. package/contracts/DependencyRegistryV0.sol +143 -13
  163. package/contracts/GenArt721CoreV3_Curated.sol +1 -1
  164. package/contracts/GenArt721CoreV3_Curated_Flex.sol +173 -0
  165. package/contracts/GenArt721CoreV3_Explorations_Flex.sol +159 -0
  166. package/contracts/engine/V3/EngineFactoryV0.sol +20 -1
  167. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +286 -299
  168. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +292 -301
  169. package/contracts/engine/V3/transfer-hooks/AbstractTransferHook.sol +101 -0
  170. package/contracts/engine/V3/transfer-hooks/OwnerHistoryTransferHook.sol +291 -0
  171. package/contracts/generator/GenArt721GeneratorV0.sol +145 -47
  172. package/contracts/helpers/ERC1967ProxyImport.sol +5 -0
  173. package/contracts/interfaces/v0.8.x/IArtblocksRoyaltyOverride.sol +1 -1
  174. package/contracts/interfaces/v0.8.x/IClaimMinter.sol +70 -0
  175. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +95 -0
  176. package/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol +15 -0
  177. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +21 -2
  178. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +72 -0
  179. package/contracts/interfaces/v0.8.x/IOwnerHistoryTransferHook.sol +119 -0
  180. package/contracts/interfaces/v0.8.x/ISRHooks.sol +229 -0
  181. package/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol +0 -6
  182. package/contracts/interfaces/v0.8.x/ISharedMinterTieredAllowV0.sol +69 -0
  183. package/contracts/interfaces/v0.8.x/ITransferHook.sol +48 -0
  184. package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +12 -0
  185. package/contracts/libs/v0.8.x/ENSLib.sol +85 -0
  186. package/contracts/libs/v0.8.x/EnumerableSetUint16.sol +429 -0
  187. package/contracts/libs/v0.8.x/FeistelWalkLib.sol +221 -0
  188. package/contracts/libs/v0.8.x/ImmutableUint16Array.sol +201 -0
  189. package/contracts/libs/v0.8.x/V3EngineLib.sol +490 -0
  190. package/contracts/libs/v0.8.x/V3TransferHookLib.sol +251 -0
  191. package/contracts/libs/v0.8.x/minter-libs/OnChainAllowlistLib.sol +165 -0
  192. package/contracts/minter-suite/Minters/MinterSetPriceOnChainAllowV0.sol +632 -0
  193. package/contracts/minter-suite/Minters/MinterSetPriceTieredAllowV1.sol +871 -0
  194. package/contracts/minter-suite/Minters/MinterSlidingScaleV0.sol +493 -0
  195. package/contracts/minter-suite/Minters/one-off/ClaimMinter.sol +595 -0
  196. package/contracts/minter-suite/Minters/one-off/MinterSetPriceTieredOnChainAllowV0.sol +894 -0
  197. package/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol +59 -41
  198. package/contracts/mock/ENSLibMock.sol +25 -0
  199. package/contracts/mock/EnumerableSetUint16Mock.sol +88 -0
  200. package/contracts/mock/FeistelWalkLibMock.sol +81 -0
  201. package/contracts/mock/ImmutableUint16ArrayMock.sol +62 -0
  202. package/contracts/mock/MockGenArt721V3Core.sol +416 -0
  203. package/contracts/mock/MockPMP.sol +287 -0
  204. package/contracts/mock/MockTransferHook.sol +160 -0
  205. package/contracts/mock/MockTransferHookTestHelpers.sol +96 -0
  206. package/contracts/mock/ReentrancyBatchMockShared.sol +53 -0
  207. package/contracts/mock/RelayExecutorTestHelper.sol +44 -0
  208. package/contracts/relay/RelayExecutor.sol +61 -0
  209. package/contracts/relay/RelayExecutorPartialReverts.sol +79 -0
  210. package/contracts/royalty-registry/GenArt721RoyaltyOverrideSplits.sol +130 -0
  211. package/contracts/utils/MintMulticallUtil.sol +103 -0
  212. package/contracts/web3call/PMPV1.sol +1204 -0
  213. package/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol +1 -1
  214. package/contracts/web3call/augment-hooks/InjectBaseGasFee.sol +1 -1
  215. package/contracts/web3call/augment-hooks/InjectBlockHeight.sol +57 -0
  216. package/contracts/web3call/augment-hooks/InjectBlockHeightAndArtistProjectOverrides.sol +310 -0
  217. package/contracts/web3call/augment-hooks/InjectBlockHeightAndNumOwnedProjectTokens.sol +141 -0
  218. package/contracts/web3call/augment-hooks/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.sol +326 -0
  219. package/contracts/web3call/augment-hooks/InjectBlockTimestamp.sol +57 -0
  220. package/contracts/web3call/augment-hooks/InjectBytesPerToken.sol +279 -0
  221. package/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol +1 -1
  222. package/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol +1 -1
  223. package/contracts/web3call/augment-hooks/InjectTokenOwner.sol +1 -1
  224. package/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol +1 -1
  225. package/contracts/web3call/augment-hooks/SRHooks.sol +1722 -0
  226. package/contracts/web3call/combined-hooks/LiftHooks.sol +304 -0
  227. package/contracts/web3call/configure-hooks/{abstractPMPConfigureHook.sol → AbstractPMPConfigureHook.sol} +1 -1
  228. package/contracts/web3call/configure-hooks/PMPConfigureLockHook.sol +107 -0
  229. package/package.json +39 -24
@@ -0,0 +1,894 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ // @dev fixed to specific solidity version for clarity and for more clear
5
+ // source code verification purposes.
6
+ pragma solidity 0.8.19;
7
+
8
+ import {IGenArt721CoreContractV3_Base} from "../../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
9
+ import {ISharedMinterSimplePurchaseV0} from "../../../interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol";
10
+ import {ISharedMinterV0} from "../../../interfaces/v0.8.x/ISharedMinterV0.sol";
11
+ import {IMinterFilterV1} from "../../../interfaces/v0.8.x/IMinterFilterV1.sol";
12
+
13
+ import {ABHelpers} from "../../../libs/v0.8.x/ABHelpers.sol";
14
+ import {AuthLib} from "../../../libs/v0.8.x/AuthLib.sol";
15
+ import {SplitFundsLib} from "../../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
16
+ import {MaxInvocationsLib} from "../../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
17
+ import {SetPriceLib} from "../../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
18
+ import {OnChainAllowlistLib} from "../../../libs/v0.8.x/minter-libs/OnChainAllowlistLib.sol";
19
+ import {PolyptychLib} from "../../../libs/v0.8.x/minter-libs/PolyptychLib.sol";
20
+
21
+ import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
22
+
23
+ /**
24
+ * @title Shared, filtered Minter contract that allows tokens to be minted with
25
+ * ETH, with dual pricing for on-chain allowlisted addresses and the general
26
+ * public.
27
+ * Allowlisted addresses mint at the artist-configured allowlist price, while
28
+ * non-allowlisted addresses mint at the artist-configured public price.
29
+ * This is designed to be used with GenArt721CoreContractV3 flagship or
30
+ * engine contracts.
31
+ * This minter also supports an optional hash seed assignment during purchase,
32
+ * allowing the purchaser to assign a hash seed in the same transaction as the
33
+ * mint via the `purchaseToWithHashSeed` function.
34
+ * @author Art Blocks Inc.
35
+ * @notice Privileged Roles and Ownership:
36
+ * This contract is designed to be managed, with limited powers.
37
+ * Privileged roles and abilities are controlled by the project's artist, which
38
+ * can be modified by the core contract's Admin ACL contract. Both of these
39
+ * roles hold extensive power and can modify minter details.
40
+ * Care must be taken to ensure that the admin ACL contract and artist
41
+ * addresses are secure behind a multi-sig or other access control mechanism.
42
+ * ----------------------------------------------------------------------------
43
+ * The following functions are restricted to a project's artist:
44
+ * - updatePricesPerTokenInWei
45
+ * - syncProjectMaxInvocationsToCore
46
+ * - manuallyLimitProjectMaxInvocations
47
+ * - addAddressesToAllowlist
48
+ * - removeAddressesFromAllowlist
49
+ * - addAndRemoveAddressesFromAllowlist
50
+ * ----------------------------------------------------------------------------
51
+ * Additional admin and artist privileged roles may be described on other
52
+ * contracts that this minter integrates with.
53
+ * ----------------------------------------------------------------------------
54
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
55
+ * Core Registry to assign this minter, this minter does not enforce that a
56
+ * project is registered when configured or queried. This is primarily for gas
57
+ * optimization purposes. It is, therefore, possible that fake projects may be
58
+ * configured on this minter, but they will not be able to mint tokens due to
59
+ * checks performed by this minter's Minter Filter.
60
+ */
61
+ contract MinterSetPriceTieredOnChainAllowV0 is
62
+ ReentrancyGuard,
63
+ ISharedMinterSimplePurchaseV0,
64
+ ISharedMinterV0
65
+ {
66
+ /// Minter filter address this minter interacts with
67
+ address public immutable minterFilterAddress;
68
+
69
+ /// Minter filter this minter may interact with.
70
+ IMinterFilterV1 private immutable _minterFilter;
71
+
72
+ /// minterType for this minter
73
+ string public constant minterType = "MinterSetPriceTieredOnChainAllowV0";
74
+
75
+ /// minter version for this minter
76
+ string public constant minterVersion = "v0.1.0";
77
+
78
+ // MODIFIERS
79
+ // @dev contract uses modifier-like internal functions instead of modifiers
80
+ // to reduce contract bytecode size
81
+ // @dev contract uses AuthLib for some modifier-like functions
82
+
83
+ // Diamond storage for allowlist price configuration (minter-specific)
84
+ bytes32 constant ALLOWLIST_PRICE_STORAGE_POSITION =
85
+ keccak256("mintersetpricetieredonchainallowv0.allowlistprice.storage");
86
+
87
+ struct AllowlistPriceStorage {
88
+ mapping(address coreContract => mapping(uint256 projectId => uint256 allowlistPricePerToken)) prices;
89
+ }
90
+
91
+ event AllowlistPricePerTokenUpdated(
92
+ uint256 indexed projectId,
93
+ address indexed coreContract,
94
+ uint256 indexed allowlistPricePerToken
95
+ );
96
+
97
+ /**
98
+ * @notice Initializes contract to be a Filtered Minter for
99
+ * `minterFilter` minter filter.
100
+ * @param minterFilter Minter filter for which this will be a
101
+ * filtered minter.
102
+ */
103
+ constructor(address minterFilter) ReentrancyGuard() {
104
+ minterFilterAddress = minterFilter;
105
+ _minterFilter = IMinterFilterV1(minterFilter);
106
+ }
107
+
108
+ /**
109
+ * @notice Manually sets the local maximum invocations of project `projectId`
110
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
111
+ * than or equal to the value of project `project_id`'s maximum invocations that is
112
+ * set on the core contract.
113
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
114
+ * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
115
+ * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
116
+ * @param projectId Project ID to set the maximum invocations for.
117
+ * @param coreContract Core contract address for the given project.
118
+ * @param maxInvocations Maximum invocations to set for the project.
119
+ */
120
+ function manuallyLimitProjectMaxInvocations(
121
+ uint256 projectId,
122
+ address coreContract,
123
+ uint24 maxInvocations
124
+ ) external {
125
+ AuthLib.onlyArtist({
126
+ projectId: projectId,
127
+ coreContract: coreContract,
128
+ sender: msg.sender
129
+ });
130
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
131
+ projectId: projectId,
132
+ coreContract: coreContract,
133
+ maxInvocations: maxInvocations
134
+ });
135
+ }
136
+
137
+ /**
138
+ * @notice Updates this minter's public and allowlist prices per token of
139
+ * project `projectId`, in Wei. The public price is paid by
140
+ * non-allowlisted addresses, and the allowlist price is paid by
141
+ * allowlisted addresses.
142
+ * @dev Note that it is intentionally supported here that either configured
143
+ * price may be explicitly set to `0`.
144
+ * @param projectId Project ID to set the prices for.
145
+ * @param coreContract Core contract address for the given project.
146
+ * @param publicPricePerTokenInWei Public price per token, in Wei.
147
+ * @param allowlistPricePerTokenInWei Allowlist price per token, in Wei.
148
+ */
149
+ function updatePricesPerTokenInWei(
150
+ uint256 projectId,
151
+ address coreContract,
152
+ uint248 publicPricePerTokenInWei,
153
+ uint248 allowlistPricePerTokenInWei
154
+ ) external {
155
+ AuthLib.onlyArtist({
156
+ projectId: projectId,
157
+ coreContract: coreContract,
158
+ sender: msg.sender
159
+ });
160
+ SetPriceLib.updatePricePerToken({
161
+ projectId: projectId,
162
+ coreContract: coreContract,
163
+ pricePerToken: publicPricePerTokenInWei
164
+ });
165
+ _allowlistPriceStorage().prices[coreContract][
166
+ projectId
167
+ ] = allowlistPricePerTokenInWei;
168
+ emit AllowlistPricePerTokenUpdated(
169
+ projectId,
170
+ coreContract,
171
+ allowlistPricePerTokenInWei
172
+ );
173
+
174
+ // for convenience, sync local max invocations to the core contract if
175
+ // and only if max invocations have not already been synced.
176
+ // @dev do not sync if max invocations have already been synced, as
177
+ // local max invocations could have been manually set to be
178
+ // intentionally less than the core contract's max invocations.
179
+ // @dev if local maxInvocations and maxHasBeenInvoked are both
180
+ // initial values, we know they have not been populated on this minter
181
+ if (
182
+ MaxInvocationsLib.maxInvocationsIsUnconfigured({
183
+ projectId: projectId,
184
+ coreContract: coreContract
185
+ })
186
+ ) {
187
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
188
+ projectId: projectId,
189
+ coreContract: coreContract
190
+ });
191
+ }
192
+ }
193
+
194
+ /**
195
+ * @notice Adds addresses to the allowlist for project `projectId`.
196
+ * @param projectId Project ID to add addresses to the allowlist for.
197
+ * @param coreContract Core contract address for the given project.
198
+ * @param addresses Array of addresses to add to the allowlist.
199
+ */
200
+ function addAddressesToAllowlist(
201
+ uint256 projectId,
202
+ address coreContract,
203
+ address[] calldata addresses
204
+ ) external {
205
+ AuthLib.onlyArtist({
206
+ projectId: projectId,
207
+ coreContract: coreContract,
208
+ sender: msg.sender
209
+ });
210
+ OnChainAllowlistLib.addAddressesToAllowlist({
211
+ projectId: projectId,
212
+ coreContract: coreContract,
213
+ addresses: addresses
214
+ });
215
+ }
216
+
217
+ /**
218
+ * @notice Removes addresses from the allowlist for project `projectId`.
219
+ * @param projectId Project ID to remove addresses from the allowlist for.
220
+ * @param coreContract Core contract address for the given project.
221
+ * @param addresses Array of addresses to remove from the allowlist.
222
+ */
223
+ function removeAddressesFromAllowlist(
224
+ uint256 projectId,
225
+ address coreContract,
226
+ address[] calldata addresses
227
+ ) external {
228
+ AuthLib.onlyArtist({
229
+ projectId: projectId,
230
+ coreContract: coreContract,
231
+ sender: msg.sender
232
+ });
233
+ OnChainAllowlistLib.removeAddressesFromAllowlist({
234
+ projectId: projectId,
235
+ coreContract: coreContract,
236
+ addresses: addresses
237
+ });
238
+ }
239
+
240
+ /**
241
+ * @notice Adds and removes addresses from the allowlist for project
242
+ * `projectId` in a single transaction.
243
+ * @param projectId Project ID to modify the allowlist for.
244
+ * @param coreContract Core contract address for the given project.
245
+ * @param addressesToAdd Array of addresses to add to the allowlist.
246
+ * @param addressesToRemove Array of addresses to remove from the allowlist.
247
+ * @dev if an address is included in both add and remove arrays, it will
248
+ * be removed.
249
+ */
250
+ function addAndRemoveAddressesFromAllowlist(
251
+ uint256 projectId,
252
+ address coreContract,
253
+ address[] calldata addressesToAdd,
254
+ address[] calldata addressesToRemove
255
+ ) external {
256
+ AuthLib.onlyArtist({
257
+ projectId: projectId,
258
+ coreContract: coreContract,
259
+ sender: msg.sender
260
+ });
261
+ OnChainAllowlistLib.addAddressesToAllowlist({
262
+ projectId: projectId,
263
+ coreContract: coreContract,
264
+ addresses: addressesToAdd
265
+ });
266
+ OnChainAllowlistLib.removeAddressesFromAllowlist({
267
+ projectId: projectId,
268
+ coreContract: coreContract,
269
+ addresses: addressesToRemove
270
+ });
271
+ }
272
+
273
+ /**
274
+ * @notice Purchases a token from project `projectId`.
275
+ * @param projectId Project ID to mint a token on.
276
+ * @param coreContract Core contract address for the given project.
277
+ * @return tokenId Token ID of minted token
278
+ */
279
+ function purchase(
280
+ uint256 projectId,
281
+ address coreContract
282
+ ) external payable returns (uint256 tokenId) {
283
+ tokenId = purchaseTo({
284
+ to: msg.sender,
285
+ projectId: projectId,
286
+ coreContract: coreContract
287
+ });
288
+ return tokenId;
289
+ }
290
+
291
+ /**
292
+ * @notice Purchases `quantity` tokens from project `projectId`.
293
+ * Validates that msg.value is sufficient for the total cost based on the
294
+ * caller's price tier. Refunds any excess ETH.
295
+ * @param projectId Project ID to mint tokens on.
296
+ * @param coreContract Core contract address for the given project.
297
+ * @param quantity Number of tokens to purchase. Must be greater than 0.
298
+ * @return tokenIds Array of token IDs of minted tokens
299
+ */
300
+ function purchaseMultiple(
301
+ uint256 projectId,
302
+ address coreContract,
303
+ uint24 quantity
304
+ ) external payable returns (uint256[] memory tokenIds) {
305
+ tokenIds = purchaseMultipleTo({
306
+ to: msg.sender,
307
+ projectId: projectId,
308
+ coreContract: coreContract,
309
+ quantity: quantity
310
+ });
311
+ return tokenIds;
312
+ }
313
+
314
+ /**
315
+ * @notice Purchases a token from project `projectId` and assigns a hash
316
+ * seed to the token in the same transaction.
317
+ * @param projectId Project ID to mint a token on.
318
+ * @param coreContract Core contract address for the given project.
319
+ * @param hashSeed Hash seed to assign to the token. Must be non-zero.
320
+ * @return tokenId Token ID of minted token
321
+ */
322
+ function purchaseWithHashSeed(
323
+ uint256 projectId,
324
+ address coreContract,
325
+ bytes12 hashSeed
326
+ ) external payable returns (uint256 tokenId) {
327
+ tokenId = purchaseToWithHashSeed({
328
+ to: msg.sender,
329
+ projectId: projectId,
330
+ coreContract: coreContract,
331
+ hashSeed: hashSeed
332
+ });
333
+ return tokenId;
334
+ }
335
+
336
+ // public getter functions
337
+ /**
338
+ * @notice Gets the maximum invocations project configuration.
339
+ * @param projectId The ID of the project whose data needs to be fetched.
340
+ * @param coreContract The address of the core contract.
341
+ * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
342
+ * configuration data.
343
+ */
344
+ function maxInvocationsProjectConfig(
345
+ uint256 projectId,
346
+ address coreContract
347
+ )
348
+ external
349
+ view
350
+ returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
351
+ {
352
+ return
353
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
354
+ projectId: projectId,
355
+ coreContract: coreContract
356
+ });
357
+ }
358
+
359
+ /**
360
+ * @notice Gets the set price project configuration (public price).
361
+ * @param projectId The ID of the project whose data needs to be fetched.
362
+ * @param coreContract The address of the core contract.
363
+ * @return SetPriceProjectConfig struct with the fixed price project
364
+ * configuration data.
365
+ */
366
+ function setPriceProjectConfig(
367
+ uint256 projectId,
368
+ address coreContract
369
+ ) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
370
+ return
371
+ SetPriceLib.getSetPriceProjectConfig({
372
+ projectId: projectId,
373
+ coreContract: coreContract
374
+ });
375
+ }
376
+
377
+ /**
378
+ * @notice Returns whether an address is on the allowlist for a given
379
+ * project.
380
+ * @param projectId The ID of the project to check the allowlist for.
381
+ * @param coreContract Core contract address for the given project.
382
+ * @param wallet The address to check.
383
+ * @return bool True if the address is on the allowlist, false otherwise.
384
+ */
385
+ function isAllowlisted(
386
+ uint256 projectId,
387
+ address coreContract,
388
+ address wallet
389
+ ) external view returns (bool) {
390
+ return
391
+ OnChainAllowlistLib.isAllowlisted({
392
+ projectId: projectId,
393
+ coreContract: coreContract,
394
+ wallet: wallet
395
+ });
396
+ }
397
+
398
+ /**
399
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
400
+ * @dev This function retrieves the cached value of `isEngine` from
401
+ * the `isEngineCache` mapping. If the cached value is already set, it
402
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
403
+ * function from the `SplitFundsLib` library to check if `coreContract`
404
+ * is a valid engine contract.
405
+ * @dev This function will revert if the provided `coreContract` is not
406
+ * a valid Engine or V3 Flagship contract.
407
+ * @param coreContract The address of the contract to check.
408
+ * @return bool indicating if `coreContract` is a valid engine contract.
409
+ */
410
+ function isEngineView(address coreContract) external view returns (bool) {
411
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
412
+ .getIsEngineCacheConfig(coreContract);
413
+ if (isEngineCache.isCached) {
414
+ return isEngineCache.isEngine;
415
+ } else {
416
+ // @dev this calls the non-state-modifying variant of isEngine
417
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
418
+ }
419
+ }
420
+
421
+ /**
422
+ * @notice projectId => has project reached its maximum number of
423
+ * invocations? Note that this returns a local cache of the core contract's
424
+ * state, and may be out of sync with the core contract. This is
425
+ * intentional, as it only enables gas optimization of mints after a
426
+ * project's maximum invocations has been reached. A false negative will
427
+ * only result in a gas cost increase, since the core contract will still
428
+ * enforce a maxInvocation check during minting. A false positive is not
429
+ * possible because the V3 core contract only allows maximum invocations
430
+ * to be reduced, not increased. Based on this rationale, we intentionally
431
+ * do not do input validation in this method as to whether or not the input
432
+ * @param projectId is an existing project ID.
433
+ * @param coreContract is an existing core contract address.
434
+ */
435
+ function projectMaxHasBeenInvoked(
436
+ uint256 projectId,
437
+ address coreContract
438
+ ) external view returns (bool) {
439
+ return
440
+ MaxInvocationsLib.getMaxHasBeenInvoked({
441
+ projectId: projectId,
442
+ coreContract: coreContract
443
+ });
444
+ }
445
+
446
+ /**
447
+ * @notice projectId => project's maximum number of invocations.
448
+ * Optionally synced with core contract value, for gas optimization.
449
+ * Note that this returns a local cache of the core contract's
450
+ * state, and may be out of sync with the core contract. This is
451
+ * intentional, as it only enables gas optimization of mints after a
452
+ * project's maximum invocations has been reached.
453
+ * @dev A number greater than the core contract's project max invocations
454
+ * will only result in a gas cost increase, since the core contract will
455
+ * still enforce a maxInvocation check during minting. A number less than
456
+ * the core contract's project max invocations is only possible when the
457
+ * project's max invocations have not been synced on this minter, since the
458
+ * V3 core contract only allows maximum invocations to be reduced, not
459
+ * increased. When this happens, the minter will enable minting, allowing
460
+ * the core contract to enforce the max invocations check. Based on this
461
+ * rationale, we intentionally do not do input validation in this method as
462
+ * to whether or not the input `projectId` is an existing project ID.
463
+ * @param projectId is an existing project ID.
464
+ * @param coreContract is an existing core contract address.
465
+ */
466
+ function projectMaxInvocations(
467
+ uint256 projectId,
468
+ address coreContract
469
+ ) external view returns (uint256) {
470
+ return
471
+ MaxInvocationsLib.getMaxInvocations({
472
+ projectId: projectId,
473
+ coreContract: coreContract
474
+ });
475
+ }
476
+
477
+ /**
478
+ * @notice Gets if price of token is configured, price of minting a
479
+ * token on project `projectId`, and currency symbol and address to be
480
+ * used as payment. Returns the public price.
481
+ * `isConfigured` is true only if both the public price and the allowlist
482
+ * price have been configured on this minter.
483
+ * @param projectId Project ID to get price information for
484
+ * @param coreContract Contract address of the core contract
485
+ * @return isConfigured true only if both public and allowlist prices have
486
+ * been configured on this minter
487
+ * @return tokenPriceInWei current public price of token on this minter -
488
+ * invalid if price has not yet been configured
489
+ * @return currencySymbol currency symbol for purchases of project on this
490
+ * minter. This minter always returns "ETH"
491
+ * @return currencyAddress currency address for purchases of project on
492
+ * this minter. This minter always returns null address, reserved for ether
493
+ */
494
+ function getPriceInfo(
495
+ uint256 projectId,
496
+ address coreContract
497
+ )
498
+ external
499
+ view
500
+ returns (
501
+ bool isConfigured,
502
+ uint256 tokenPriceInWei,
503
+ string memory currencySymbol,
504
+ address currencyAddress
505
+ )
506
+ {
507
+ SetPriceLib.SetPriceProjectConfig
508
+ storage setPriceProjectConfig_ = SetPriceLib
509
+ .getSetPriceProjectConfig({
510
+ projectId: projectId,
511
+ coreContract: coreContract
512
+ });
513
+ isConfigured = setPriceProjectConfig_.priceIsConfigured;
514
+ tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
515
+ currencySymbol = "ETH";
516
+ currencyAddress = address(0);
517
+ }
518
+
519
+ /**
520
+ * @notice Gets the allowlist price for project `projectId`.
521
+ * @param projectId Project ID to get allowlist price information for
522
+ * @param coreContract Contract address of the core contract
523
+ * @return allowlistPricePerTokenInWei current allowlist price per token
524
+ * on this minter, in Wei. Only valid if prices have been configured
525
+ * (check via `getPriceInfo`).
526
+ */
527
+ function getAllowlistPriceInfo(
528
+ uint256 projectId,
529
+ address coreContract
530
+ ) external view returns (uint256 allowlistPricePerTokenInWei) {
531
+ allowlistPricePerTokenInWei = _allowlistPriceStorage().prices[
532
+ coreContract
533
+ ][projectId];
534
+ }
535
+
536
+ /**
537
+ * @notice Returns the effective price for a given wallet address on
538
+ * project `projectId`. If the wallet is allowlisted, returns the
539
+ * allowlist price; otherwise returns the public price.
540
+ * @param projectId Project ID to get price information for
541
+ * @param coreContract Contract address of the core contract
542
+ * @param wallet Address to check the effective price for
543
+ * @return isConfigured true only if prices have been configured for the
544
+ * project
545
+ * @return tokenPriceInWei effective price per token for the given wallet,
546
+ * in Wei
547
+ */
548
+ function getPriceInfoForAddress(
549
+ uint256 projectId,
550
+ address coreContract,
551
+ address wallet
552
+ ) external view returns (bool isConfigured, uint256 tokenPriceInWei) {
553
+ SetPriceLib.SetPriceProjectConfig
554
+ storage setPriceProjectConfig_ = SetPriceLib
555
+ .getSetPriceProjectConfig({
556
+ projectId: projectId,
557
+ coreContract: coreContract
558
+ });
559
+ isConfigured = setPriceProjectConfig_.priceIsConfigured;
560
+ if (
561
+ OnChainAllowlistLib.isAllowlisted({
562
+ projectId: projectId,
563
+ coreContract: coreContract,
564
+ wallet: wallet
565
+ })
566
+ ) {
567
+ tokenPriceInWei = _allowlistPriceStorage().prices[coreContract][
568
+ projectId
569
+ ];
570
+ } else {
571
+ tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
572
+ }
573
+ }
574
+
575
+ /**
576
+ * @notice Syncs local maximum invocations of project `projectId` based on
577
+ * the value currently defined in the core contract.
578
+ * @param projectId Project ID to set the maximum invocations for.
579
+ * @param coreContract Core contract address for the given project.
580
+ * @dev this enables gas reduction after maxInvocations have been reached -
581
+ * core contracts shall still enforce a maxInvocation check during mint.
582
+ */
583
+ function syncProjectMaxInvocationsToCore(
584
+ uint256 projectId,
585
+ address coreContract
586
+ ) public {
587
+ AuthLib.onlyArtist({
588
+ projectId: projectId,
589
+ coreContract: coreContract,
590
+ sender: msg.sender
591
+ });
592
+
593
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
594
+ projectId: projectId,
595
+ coreContract: coreContract
596
+ });
597
+ }
598
+
599
+ /**
600
+ * @notice Purchases a token from project `projectId` and sets
601
+ * the token's owner to `to`.
602
+ * @param to Address to be the new token's owner.
603
+ * @param projectId Project ID to mint a token on.
604
+ * @param coreContract Core contract address for the given project.
605
+ * @return tokenId Token ID of minted token
606
+ */
607
+ function purchaseTo(
608
+ address to,
609
+ uint256 projectId,
610
+ address coreContract
611
+ ) public payable nonReentrant returns (uint256 tokenId) {
612
+ tokenId = _purchaseToInternal({
613
+ to: to,
614
+ projectId: projectId,
615
+ coreContract: coreContract,
616
+ hashSeed: bytes12(0)
617
+ });
618
+ return tokenId;
619
+ }
620
+
621
+ /**
622
+ * @notice Purchases a token from project `projectId`, sets the token's
623
+ * owner to `to`, and assigns hash seed `hashSeed` to the token in the
624
+ * same transaction.
625
+ * @param to Address to be the new token's owner.
626
+ * @param projectId Project ID to mint a token on.
627
+ * @param coreContract Core contract address for the given project.
628
+ * @param hashSeed Hash seed to assign to the token. Must be non-zero.
629
+ * @return tokenId Token ID of minted token
630
+ */
631
+ function purchaseToWithHashSeed(
632
+ address to,
633
+ uint256 projectId,
634
+ address coreContract,
635
+ bytes12 hashSeed
636
+ ) public payable nonReentrant returns (uint256 tokenId) {
637
+ require(hashSeed != bytes12(0), "Only non-zero hash seeds");
638
+ tokenId = _purchaseToInternal({
639
+ to: to,
640
+ projectId: projectId,
641
+ coreContract: coreContract,
642
+ hashSeed: hashSeed
643
+ });
644
+ return tokenId;
645
+ }
646
+
647
+ /**
648
+ * @notice Internal function to handle token purchases, with optional hash
649
+ * seed assignment. Determines effective price based on allowlist status:
650
+ * allowlisted addresses pay the allowlist price, others pay the public
651
+ * price.
652
+ * @param to Address to be the new token's owner.
653
+ * @param projectId Project ID to mint a token on.
654
+ * @param coreContract Core contract address for the given project.
655
+ * @param hashSeed Hash seed to assign to the token. If bytes12(0), no hash
656
+ * seed assignment is performed.
657
+ * @return tokenId Token ID of minted token
658
+ */
659
+ function _purchaseToInternal(
660
+ address to,
661
+ uint256 projectId,
662
+ address coreContract,
663
+ bytes12 hashSeed
664
+ ) private returns (uint256 tokenId) {
665
+ // CHECKS
666
+ // pre-mint MaxInvocationsLib checks
667
+ // Note that `maxHasBeenInvoked` is only checked here to reduce gas
668
+ // consumption after a project has been fully minted.
669
+ // `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
670
+ // gas consumption, but if not in sync with the core contract's value,
671
+ // the core contract also enforces its own max invocation check during
672
+ // minting.
673
+ MaxInvocationsLib.preMintChecks({
674
+ projectId: projectId,
675
+ coreContract: coreContract
676
+ });
677
+
678
+ // pre-mint checks for set price lib (reverts if not configured)
679
+ // @dev since both prices are set atomically, this also confirms the
680
+ // allowlist price has been configured
681
+ uint256 publicPricePerTokenInWei = SetPriceLib
682
+ .preMintChecksAndGetPrice({
683
+ projectId: projectId,
684
+ coreContract: coreContract
685
+ });
686
+
687
+ // determine effective price based on allowlist status
688
+ uint256 pricePerTokenInWei;
689
+ if (
690
+ OnChainAllowlistLib.isAllowlisted({
691
+ projectId: projectId,
692
+ coreContract: coreContract,
693
+ wallet: msg.sender
694
+ })
695
+ ) {
696
+ pricePerTokenInWei = _allowlistPriceStorage().prices[coreContract][
697
+ projectId
698
+ ];
699
+ } else {
700
+ pricePerTokenInWei = publicPricePerTokenInWei;
701
+ }
702
+
703
+ require(msg.value >= pricePerTokenInWei, "Min value to mint req.");
704
+
705
+ // EFFECTS
706
+ // if hash seed is provided, pre-set it before minting
707
+ if (hashSeed != bytes12(0)) {
708
+ // get current invocations to pre-compute the new token ID
709
+ (uint256 invocations, , , , , ) = IGenArt721CoreContractV3_Base(
710
+ coreContract
711
+ ).projectStateData(projectId);
712
+ uint256 newTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
713
+ projectId: projectId,
714
+ // @dev next token number is current invocations due to
715
+ // number being zero-based-indexed
716
+ tokenNumber: invocations
717
+ });
718
+ PolyptychLib.setPolyptychHashSeed({
719
+ coreContract: coreContract,
720
+ tokenId: newTokenId,
721
+ hashSeed: hashSeed
722
+ });
723
+ }
724
+
725
+ tokenId = _minterFilter.mint_joo({
726
+ to: to,
727
+ projectId: projectId,
728
+ coreContract: coreContract,
729
+ sender: msg.sender
730
+ });
731
+
732
+ // validate hash seed was assigned correctly, if provided
733
+ if (hashSeed != bytes12(0)) {
734
+ PolyptychLib.validateAssignedHashSeed({
735
+ coreContract: coreContract,
736
+ tokenId: tokenId,
737
+ targetHashSeed: hashSeed
738
+ });
739
+ }
740
+
741
+ MaxInvocationsLib.validateMintEffectsInvocations({
742
+ tokenId: tokenId,
743
+ coreContract: coreContract
744
+ });
745
+
746
+ // INTERACTIONS
747
+ SplitFundsLib.splitFundsETHRefundSender({
748
+ projectId: projectId,
749
+ pricePerTokenInWei: pricePerTokenInWei,
750
+ coreContract: coreContract
751
+ });
752
+
753
+ return tokenId;
754
+ }
755
+
756
+ /**
757
+ * @notice Purchases `quantity` tokens from project `projectId` and sets
758
+ * the tokens' owner to `to`.
759
+ * Validates that msg.value is sufficient for the total cost based on the
760
+ * caller's price tier. Refunds any excess ETH.
761
+ * @param to Address to be the new tokens' owner.
762
+ * @param projectId Project ID to mint tokens on.
763
+ * @param coreContract Core contract address for the given project.
764
+ * @param quantity Number of tokens to purchase. Must be greater than 0.
765
+ * @return tokenIds Array of token IDs of minted tokens
766
+ */
767
+ function purchaseMultipleTo(
768
+ address to,
769
+ uint256 projectId,
770
+ address coreContract,
771
+ uint24 quantity
772
+ ) public payable nonReentrant returns (uint256[] memory tokenIds) {
773
+ tokenIds = _purchaseMultipleToInternal({
774
+ to: to,
775
+ projectId: projectId,
776
+ coreContract: coreContract,
777
+ quantity: quantity
778
+ });
779
+ return tokenIds;
780
+ }
781
+
782
+ /**
783
+ * @notice Internal function to handle batch token purchases. Determines
784
+ * effective price based on allowlist status, validates total msg.value,
785
+ * mints all tokens, splits funds per-token, and refunds any excess ETH.
786
+ * @param to Address to be the new tokens' owner.
787
+ * @param projectId Project ID to mint tokens on.
788
+ * @param coreContract Core contract address for the given project.
789
+ * @param quantity Number of tokens to purchase.
790
+ * @return tokenIds Array of token IDs of minted tokens
791
+ */
792
+ function _purchaseMultipleToInternal(
793
+ address to,
794
+ uint256 projectId,
795
+ address coreContract,
796
+ uint24 quantity
797
+ ) private returns (uint256[] memory tokenIds) {
798
+ require(quantity > 0, "Must mint at least one token");
799
+
800
+ // CHECKS
801
+ MaxInvocationsLib.preMintChecks({
802
+ projectId: projectId,
803
+ coreContract: coreContract
804
+ });
805
+
806
+ // pre-mint checks for set price lib (reverts if not configured)
807
+ // @dev since both prices are set atomically, this also confirms the
808
+ // allowlist price has been configured
809
+ uint256 publicPricePerTokenInWei = SetPriceLib
810
+ .preMintChecksAndGetPrice({
811
+ projectId: projectId,
812
+ coreContract: coreContract
813
+ });
814
+
815
+ // determine effective price based on allowlist status
816
+ uint256 pricePerTokenInWei;
817
+ if (
818
+ OnChainAllowlistLib.isAllowlisted({
819
+ projectId: projectId,
820
+ coreContract: coreContract,
821
+ wallet: msg.sender
822
+ })
823
+ ) {
824
+ pricePerTokenInWei = _allowlistPriceStorage().prices[coreContract][
825
+ projectId
826
+ ];
827
+ } else {
828
+ pricePerTokenInWei = publicPricePerTokenInWei;
829
+ }
830
+
831
+ // @dev overflow automatically reverts in Solidity 0.8.x
832
+ uint256 totalCost = pricePerTokenInWei * uint256(quantity);
833
+ require(msg.value >= totalCost, "Min value to mint req.");
834
+
835
+ // EFFECTS
836
+ tokenIds = new uint256[](quantity);
837
+ for (uint256 i; i < quantity; ) {
838
+ tokenIds[i] = _minterFilter.mint_joo({
839
+ to: to,
840
+ projectId: projectId,
841
+ coreContract: coreContract,
842
+ sender: msg.sender
843
+ });
844
+
845
+ MaxInvocationsLib.validateMintEffectsInvocations({
846
+ tokenId: tokenIds[i],
847
+ coreContract: coreContract
848
+ });
849
+
850
+ unchecked {
851
+ ++i;
852
+ }
853
+ }
854
+
855
+ // INTERACTIONS
856
+ // split funds for each token individually (revenue splits are
857
+ // calculated per-token by the core contract)
858
+ for (uint256 i; i < quantity; ) {
859
+ SplitFundsLib.splitRevenuesETHNoRefund({
860
+ projectId: projectId,
861
+ valueInWei: pricePerTokenInWei,
862
+ coreContract: coreContract
863
+ });
864
+ unchecked {
865
+ ++i;
866
+ }
867
+ }
868
+
869
+ // refund any excess ETH
870
+ uint256 refund = msg.value - totalCost;
871
+ if (refund > 0) {
872
+ (bool success_, ) = msg.sender.call{value: refund}("");
873
+ require(success_, "Refund failed");
874
+ }
875
+
876
+ return tokenIds;
877
+ }
878
+
879
+ /**
880
+ * @notice Return the storage struct for reading and writing. Uses a
881
+ * diamond storage pattern for the allowlist price configuration.
882
+ * @return storageStruct The AllowlistPriceStorage struct.
883
+ */
884
+ function _allowlistPriceStorage()
885
+ private
886
+ pure
887
+ returns (AllowlistPriceStorage storage storageStruct)
888
+ {
889
+ bytes32 position = ALLOWLIST_PRICE_STORAGE_POSITION;
890
+ assembly ("memory-safe") {
891
+ storageStruct.slot := position
892
+ }
893
+ }
894
+ }