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