@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,632 @@
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 an on-chain address allowlist.
26
+ * This is designed to be used with GenArt721CoreContractV3 flagship or
27
+ * engine contracts.
28
+ * This minter also supports an optional hash seed assignment during purchase,
29
+ * allowing the purchaser to assign a hash seed in the same transaction as the
30
+ * mint via the `purchaseToWithHashSeed` function.
31
+ * @author Art Blocks Inc.
32
+ * @notice Privileged Roles and Ownership:
33
+ * This contract is designed to be managed, with limited powers.
34
+ * Privileged roles and abilities are controlled by the project's artist, which
35
+ * can be modified by the core contract's Admin ACL contract. Both of these
36
+ * roles hold extensive power and can modify minter details.
37
+ * Care must be taken to ensure that the admin ACL contract and artist
38
+ * addresses are secure behind a multi-sig or other access control mechanism.
39
+ * ----------------------------------------------------------------------------
40
+ * The following functions are restricted to a project's artist:
41
+ * - updatePricePerTokenInWei
42
+ * - syncProjectMaxInvocationsToCore
43
+ * - manuallyLimitProjectMaxInvocations
44
+ * - addAddressesToAllowlist
45
+ * - removeAddressesFromAllowlist
46
+ * - addAndRemoveAddressesFromAllowlist
47
+ * ----------------------------------------------------------------------------
48
+ * Additional admin and artist privileged roles may be described on other
49
+ * contracts that this minter integrates with.
50
+ * ----------------------------------------------------------------------------
51
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
52
+ * Core Registry to assign this minter, this minter does not enforce that a
53
+ * project is registered when configured or queried. This is primarily for gas
54
+ * optimization purposes. It is, therefore, possible that fake projects may be
55
+ * configured on this minter, but they will not be able to mint tokens due to
56
+ * checks performed by this minter's Minter Filter.
57
+ */
58
+ contract MinterSetPriceOnChainAllowV0 is
59
+ ReentrancyGuard,
60
+ ISharedMinterSimplePurchaseV0,
61
+ ISharedMinterV0
62
+ {
63
+ /// Minter filter address this minter interacts with
64
+ address public immutable minterFilterAddress;
65
+
66
+ /// Minter filter this minter may interact with.
67
+ IMinterFilterV1 private immutable _minterFilter;
68
+
69
+ /// minterType for this minter
70
+ string public constant minterType = "MinterSetPriceOnChainAllowV0";
71
+
72
+ /// minter version for this minter
73
+ string public constant minterVersion = "v0.1.0";
74
+
75
+ // MODIFIERS
76
+ // @dev contract uses modifier-like internal functions instead of modifiers
77
+ // to reduce contract bytecode size
78
+ // @dev contract uses AuthLib for some modifier-like functions
79
+
80
+ /**
81
+ * @notice Initializes contract to be a Filtered Minter for
82
+ * `minterFilter` minter filter.
83
+ * @param minterFilter Minter filter for which this will be a
84
+ * filtered minter.
85
+ */
86
+ constructor(address minterFilter) ReentrancyGuard() {
87
+ minterFilterAddress = minterFilter;
88
+ _minterFilter = IMinterFilterV1(minterFilter);
89
+ }
90
+
91
+ /**
92
+ * @notice Manually sets the local maximum invocations of project `projectId`
93
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
94
+ * than or equal to the value of project `project_id`'s maximum invocations that is
95
+ * set on the core contract.
96
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
97
+ * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
98
+ * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
99
+ * @param projectId Project ID to set the maximum invocations for.
100
+ * @param coreContract Core contract address for the given project.
101
+ * @param maxInvocations Maximum invocations to set for the project.
102
+ */
103
+ function manuallyLimitProjectMaxInvocations(
104
+ uint256 projectId,
105
+ address coreContract,
106
+ uint24 maxInvocations
107
+ ) external {
108
+ AuthLib.onlyArtist({
109
+ projectId: projectId,
110
+ coreContract: coreContract,
111
+ sender: msg.sender
112
+ });
113
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
114
+ projectId: projectId,
115
+ coreContract: coreContract,
116
+ maxInvocations: maxInvocations
117
+ });
118
+ }
119
+
120
+ /**
121
+ * @notice Updates this minter's price per token of project `projectId`
122
+ * to be '_pricePerTokenInWei`, in Wei.
123
+ * @dev Note that it is intentionally supported here that the configured
124
+ * price may be explicitly set to `0`.
125
+ * @param projectId Project ID to set the price per token for.
126
+ * @param coreContract Core contract address for the given project.
127
+ * @param pricePerTokenInWei Price per token to set for the project, in Wei.
128
+ */
129
+ function updatePricePerTokenInWei(
130
+ uint256 projectId,
131
+ address coreContract,
132
+ uint248 pricePerTokenInWei
133
+ ) external {
134
+ AuthLib.onlyArtist({
135
+ projectId: projectId,
136
+ coreContract: coreContract,
137
+ sender: msg.sender
138
+ });
139
+ SetPriceLib.updatePricePerToken({
140
+ projectId: projectId,
141
+ coreContract: coreContract,
142
+ pricePerToken: pricePerTokenInWei
143
+ });
144
+
145
+ // for convenience, sync local max invocations to the core contract if
146
+ // and only if max invocations have not already been synced.
147
+ // @dev do not sync if max invocations have already been synced, as
148
+ // local max invocations could have been manually set to be
149
+ // intentionally less than the core contract's max invocations.
150
+ // @dev if local maxInvocations and maxHasBeenInvoked are both
151
+ // initial values, we know they have not been populated on this minter
152
+ if (
153
+ MaxInvocationsLib.maxInvocationsIsUnconfigured({
154
+ projectId: projectId,
155
+ coreContract: coreContract
156
+ })
157
+ ) {
158
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
159
+ projectId: projectId,
160
+ coreContract: coreContract
161
+ });
162
+ }
163
+ }
164
+
165
+ /**
166
+ * @notice Adds addresses to the allowlist for project `projectId`.
167
+ * @param projectId Project ID to add addresses to the allowlist for.
168
+ * @param coreContract Core contract address for the given project.
169
+ * @param addresses Array of addresses to add to the allowlist.
170
+ */
171
+ function addAddressesToAllowlist(
172
+ uint256 projectId,
173
+ address coreContract,
174
+ address[] calldata addresses
175
+ ) external {
176
+ AuthLib.onlyArtist({
177
+ projectId: projectId,
178
+ coreContract: coreContract,
179
+ sender: msg.sender
180
+ });
181
+ OnChainAllowlistLib.addAddressesToAllowlist({
182
+ projectId: projectId,
183
+ coreContract: coreContract,
184
+ addresses: addresses
185
+ });
186
+ }
187
+
188
+ /**
189
+ * @notice Removes addresses from the allowlist for project `projectId`.
190
+ * @param projectId Project ID to remove addresses from the allowlist for.
191
+ * @param coreContract Core contract address for the given project.
192
+ * @param addresses Array of addresses to remove from the allowlist.
193
+ */
194
+ function removeAddressesFromAllowlist(
195
+ uint256 projectId,
196
+ address coreContract,
197
+ address[] calldata addresses
198
+ ) external {
199
+ AuthLib.onlyArtist({
200
+ projectId: projectId,
201
+ coreContract: coreContract,
202
+ sender: msg.sender
203
+ });
204
+ OnChainAllowlistLib.removeAddressesFromAllowlist({
205
+ projectId: projectId,
206
+ coreContract: coreContract,
207
+ addresses: addresses
208
+ });
209
+ }
210
+
211
+ /**
212
+ * @notice Adds and removes addresses from the allowlist for project
213
+ * `projectId` in a single transaction.
214
+ * @param projectId Project ID to modify the allowlist for.
215
+ * @param coreContract Core contract address for the given project.
216
+ * @param addressesToAdd Array of addresses to add to the allowlist.
217
+ * @param addressesToRemove Array of addresses to remove from the allowlist.
218
+ * @dev if an address is included in both add and remove arrays, it will
219
+ * be removed.
220
+ */
221
+ function addAndRemoveAddressesFromAllowlist(
222
+ uint256 projectId,
223
+ address coreContract,
224
+ address[] calldata addressesToAdd,
225
+ address[] calldata addressesToRemove
226
+ ) external {
227
+ AuthLib.onlyArtist({
228
+ projectId: projectId,
229
+ coreContract: coreContract,
230
+ sender: msg.sender
231
+ });
232
+ OnChainAllowlistLib.addAddressesToAllowlist({
233
+ projectId: projectId,
234
+ coreContract: coreContract,
235
+ addresses: addressesToAdd
236
+ });
237
+ OnChainAllowlistLib.removeAddressesFromAllowlist({
238
+ projectId: projectId,
239
+ coreContract: coreContract,
240
+ addresses: addressesToRemove
241
+ });
242
+ }
243
+
244
+ /**
245
+ * @notice Purchases a token from project `projectId`.
246
+ * @param projectId Project ID to mint a token on.
247
+ * @param coreContract Core contract address for the given project.
248
+ * @return tokenId Token ID of minted token
249
+ */
250
+ function purchase(
251
+ uint256 projectId,
252
+ address coreContract
253
+ ) external payable returns (uint256 tokenId) {
254
+ tokenId = purchaseTo({
255
+ to: msg.sender,
256
+ projectId: projectId,
257
+ coreContract: coreContract
258
+ });
259
+ return tokenId;
260
+ }
261
+
262
+ /**
263
+ * @notice Purchases a token from project `projectId` and assigns a hash
264
+ * seed to the token in the same transaction.
265
+ * @param projectId Project ID to mint a token on.
266
+ * @param coreContract Core contract address for the given project.
267
+ * @param hashSeed Hash seed to assign to the token. Must be non-zero.
268
+ * @return tokenId Token ID of minted token
269
+ */
270
+ function purchaseWithHashSeed(
271
+ uint256 projectId,
272
+ address coreContract,
273
+ bytes12 hashSeed
274
+ ) external payable returns (uint256 tokenId) {
275
+ tokenId = purchaseToWithHashSeed({
276
+ to: msg.sender,
277
+ projectId: projectId,
278
+ coreContract: coreContract,
279
+ hashSeed: hashSeed
280
+ });
281
+ return tokenId;
282
+ }
283
+
284
+ // public getter functions
285
+ /**
286
+ * @notice Gets the maximum invocations project configuration.
287
+ * @param projectId The ID of the project whose data needs to be fetched.
288
+ * @param coreContract The address of the core contract.
289
+ * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
290
+ * configuration data.
291
+ */
292
+ function maxInvocationsProjectConfig(
293
+ uint256 projectId,
294
+ address coreContract
295
+ )
296
+ external
297
+ view
298
+ returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
299
+ {
300
+ return
301
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
302
+ projectId: projectId,
303
+ coreContract: coreContract
304
+ });
305
+ }
306
+
307
+ /**
308
+ * @notice Gets the set price project configuration.
309
+ * @param projectId The ID of the project whose data needs to be fetched.
310
+ * @param coreContract The address of the core contract.
311
+ * @return SetPriceProjectConfig struct with the fixed price project
312
+ * configuration data.
313
+ */
314
+ function setPriceProjectConfig(
315
+ uint256 projectId,
316
+ address coreContract
317
+ ) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
318
+ return
319
+ SetPriceLib.getSetPriceProjectConfig({
320
+ projectId: projectId,
321
+ coreContract: coreContract
322
+ });
323
+ }
324
+
325
+ /**
326
+ * @notice Returns whether an address is on the allowlist for a given
327
+ * project.
328
+ * @param projectId The ID of the project to check the allowlist for.
329
+ * @param coreContract Core contract address for the given project.
330
+ * @param wallet The address to check.
331
+ * @return bool True if the address is on the allowlist, false otherwise.
332
+ */
333
+ function isAllowlisted(
334
+ uint256 projectId,
335
+ address coreContract,
336
+ address wallet
337
+ ) external view returns (bool) {
338
+ return
339
+ OnChainAllowlistLib.isAllowlisted({
340
+ projectId: projectId,
341
+ coreContract: coreContract,
342
+ wallet: wallet
343
+ });
344
+ }
345
+
346
+ /**
347
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
348
+ * @dev This function retrieves the cached value of `isEngine` from
349
+ * the `isEngineCache` mapping. If the cached value is already set, it
350
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
351
+ * function from the `SplitFundsLib` library to check if `coreContract`
352
+ * is a valid engine contract.
353
+ * @dev This function will revert if the provided `coreContract` is not
354
+ * a valid Engine or V3 Flagship contract.
355
+ * @param coreContract The address of the contract to check.
356
+ * @return bool indicating if `coreContract` is a valid engine contract.
357
+ */
358
+ function isEngineView(address coreContract) external view returns (bool) {
359
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
360
+ .getIsEngineCacheConfig(coreContract);
361
+ if (isEngineCache.isCached) {
362
+ return isEngineCache.isEngine;
363
+ } else {
364
+ // @dev this calls the non-state-modifying variant of isEngine
365
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
366
+ }
367
+ }
368
+
369
+ /**
370
+ * @notice projectId => has project reached its maximum number of
371
+ * invocations? Note that this returns a local cache of the core contract's
372
+ * state, and may be out of sync with the core contract. This is
373
+ * intentional, as it only enables gas optimization of mints after a
374
+ * project's maximum invocations has been reached. A false negative will
375
+ * only result in a gas cost increase, since the core contract will still
376
+ * enforce a maxInvocation check during minting. A false positive is not
377
+ * possible because the V3 core contract only allows maximum invocations
378
+ * to be reduced, not increased. Based on this rationale, we intentionally
379
+ * do not do input validation in this method as to whether or not the input
380
+ * @param projectId is an existing project ID.
381
+ * @param coreContract is an existing core contract address.
382
+ */
383
+ function projectMaxHasBeenInvoked(
384
+ uint256 projectId,
385
+ address coreContract
386
+ ) external view returns (bool) {
387
+ return
388
+ MaxInvocationsLib.getMaxHasBeenInvoked({
389
+ projectId: projectId,
390
+ coreContract: coreContract
391
+ });
392
+ }
393
+
394
+ /**
395
+ * @notice projectId => project's maximum number of invocations.
396
+ * Optionally synced with core contract value, for gas optimization.
397
+ * Note that this returns a local cache of the core contract's
398
+ * state, and may be out of sync with the core contract. This is
399
+ * intentional, as it only enables gas optimization of mints after a
400
+ * project's maximum invocations has been reached.
401
+ * @dev A number greater than the core contract's project max invocations
402
+ * will only result in a gas cost increase, since the core contract will
403
+ * still enforce a maxInvocation check during minting. A number less than
404
+ * the core contract's project max invocations is only possible when the
405
+ * project's max invocations have not been synced on this minter, since the
406
+ * V3 core contract only allows maximum invocations to be reduced, not
407
+ * increased. When this happens, the minter will enable minting, allowing
408
+ * the core contract to enforce the max invocations check. Based on this
409
+ * rationale, we intentionally do not do input validation in this method as
410
+ * to whether or not the input `projectId` is an existing project ID.
411
+ * @param projectId is an existing project ID.
412
+ * @param coreContract is an existing core contract address.
413
+ */
414
+ function projectMaxInvocations(
415
+ uint256 projectId,
416
+ address coreContract
417
+ ) external view returns (uint256) {
418
+ return
419
+ MaxInvocationsLib.getMaxInvocations({
420
+ projectId: projectId,
421
+ coreContract: coreContract
422
+ });
423
+ }
424
+
425
+ /**
426
+ * @notice Gets if price of token is configured, price of minting a
427
+ * token on project `projectId`, and currency symbol and address to be
428
+ * used as payment.
429
+ * @param projectId Project ID to get price information for
430
+ * @param coreContract Contract address of the core contract
431
+ * @return isConfigured true only if token price has been configured on
432
+ * this minter
433
+ * @return tokenPriceInWei current price of token on this minter - invalid
434
+ * if price has not yet been configured
435
+ * @return currencySymbol currency symbol for purchases of project on this
436
+ * minter. This minter always returns "ETH"
437
+ * @return currencyAddress currency address for purchases of project on
438
+ * this minter. This minter always returns null address, reserved for ether
439
+ */
440
+ function getPriceInfo(
441
+ uint256 projectId,
442
+ address coreContract
443
+ )
444
+ external
445
+ view
446
+ returns (
447
+ bool isConfigured,
448
+ uint256 tokenPriceInWei,
449
+ string memory currencySymbol,
450
+ address currencyAddress
451
+ )
452
+ {
453
+ SetPriceLib.SetPriceProjectConfig
454
+ storage setPriceProjectConfig_ = SetPriceLib
455
+ .getSetPriceProjectConfig({
456
+ projectId: projectId,
457
+ coreContract: coreContract
458
+ });
459
+ isConfigured = setPriceProjectConfig_.priceIsConfigured;
460
+ tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
461
+ currencySymbol = "ETH";
462
+ currencyAddress = address(0);
463
+ }
464
+
465
+ /**
466
+ * @notice Syncs local maximum invocations of project `projectId` based on
467
+ * the value currently defined in the core contract.
468
+ * @param projectId Project ID to set the maximum invocations for.
469
+ * @param coreContract Core contract address for the given project.
470
+ * @dev this enables gas reduction after maxInvocations have been reached -
471
+ * core contracts shall still enforce a maxInvocation check during mint.
472
+ */
473
+ function syncProjectMaxInvocationsToCore(
474
+ uint256 projectId,
475
+ address coreContract
476
+ ) public {
477
+ AuthLib.onlyArtist({
478
+ projectId: projectId,
479
+ coreContract: coreContract,
480
+ sender: msg.sender
481
+ });
482
+
483
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
484
+ projectId: projectId,
485
+ coreContract: coreContract
486
+ });
487
+ }
488
+
489
+ /**
490
+ * @notice Purchases a token from project `projectId` and sets
491
+ * the token's owner to `to`.
492
+ * @param to Address to be the new token's owner.
493
+ * @param projectId Project ID to mint a token on.
494
+ * @param coreContract Core contract address for the given project.
495
+ * @return tokenId Token ID of minted token
496
+ */
497
+ function purchaseTo(
498
+ address to,
499
+ uint256 projectId,
500
+ address coreContract
501
+ ) public payable nonReentrant returns (uint256 tokenId) {
502
+ tokenId = _purchaseToInternal({
503
+ to: to,
504
+ projectId: projectId,
505
+ coreContract: coreContract,
506
+ hashSeed: bytes12(0)
507
+ });
508
+ return tokenId;
509
+ }
510
+
511
+ /**
512
+ * @notice Purchases a token from project `projectId`, sets the token's
513
+ * owner to `to`, and assigns hash seed `hashSeed` to the token in the
514
+ * same transaction.
515
+ * @param to Address to be the new token's owner.
516
+ * @param projectId Project ID to mint a token on.
517
+ * @param coreContract Core contract address for the given project.
518
+ * @param hashSeed Hash seed to assign to the token. Must be non-zero.
519
+ * @return tokenId Token ID of minted token
520
+ */
521
+ function purchaseToWithHashSeed(
522
+ address to,
523
+ uint256 projectId,
524
+ address coreContract,
525
+ bytes12 hashSeed
526
+ ) public payable nonReentrant returns (uint256 tokenId) {
527
+ require(hashSeed != bytes12(0), "Only non-zero hash seeds");
528
+ tokenId = _purchaseToInternal({
529
+ to: to,
530
+ projectId: projectId,
531
+ coreContract: coreContract,
532
+ hashSeed: hashSeed
533
+ });
534
+ return tokenId;
535
+ }
536
+
537
+ /**
538
+ * @notice Internal function to handle token purchases, with optional hash
539
+ * seed assignment.
540
+ * @param to Address to be the new token's owner.
541
+ * @param projectId Project ID to mint a token on.
542
+ * @param coreContract Core contract address for the given project.
543
+ * @param hashSeed Hash seed to assign to the token. If bytes12(0), no hash
544
+ * seed assignment is performed.
545
+ * @return tokenId Token ID of minted token
546
+ */
547
+ function _purchaseToInternal(
548
+ address to,
549
+ uint256 projectId,
550
+ address coreContract,
551
+ bytes12 hashSeed
552
+ ) private returns (uint256 tokenId) {
553
+ // CHECKS
554
+ // pre-mint MaxInvocationsLib checks
555
+ // Note that `maxHasBeenInvoked` is only checked here to reduce gas
556
+ // consumption after a project has been fully minted.
557
+ // `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
558
+ // gas consumption, but if not in sync with the core contract's value,
559
+ // the core contract also enforces its own max invocation check during
560
+ // minting.
561
+ MaxInvocationsLib.preMintChecks({
562
+ projectId: projectId,
563
+ coreContract: coreContract
564
+ });
565
+
566
+ // pre-mint checks for set price lib, and get price per token in wei
567
+ // @dev price per token is loaded into memory here for gas efficiency
568
+ uint256 pricePerTokenInWei = SetPriceLib.preMintChecksAndGetPrice({
569
+ projectId: projectId,
570
+ coreContract: coreContract
571
+ });
572
+
573
+ require(msg.value >= pricePerTokenInWei, "Min value to mint req.");
574
+
575
+ // require sender to be on the allowlist for the project
576
+ OnChainAllowlistLib.preMintChecks({
577
+ projectId: projectId,
578
+ coreContract: coreContract,
579
+ sender: msg.sender
580
+ });
581
+
582
+ // EFFECTS
583
+ // if hash seed is provided, pre-set it before minting
584
+ if (hashSeed != bytes12(0)) {
585
+ // get current invocations to pre-compute the new token ID
586
+ (uint256 invocations, , , , , ) = IGenArt721CoreContractV3_Base(
587
+ coreContract
588
+ ).projectStateData(projectId);
589
+ uint256 newTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
590
+ projectId: projectId,
591
+ // @dev next token number is current invocations due to
592
+ // number being zero-based-indexed
593
+ tokenNumber: invocations
594
+ });
595
+ PolyptychLib.setPolyptychHashSeed({
596
+ coreContract: coreContract,
597
+ tokenId: newTokenId,
598
+ hashSeed: hashSeed
599
+ });
600
+ }
601
+
602
+ tokenId = _minterFilter.mint_joo({
603
+ to: to,
604
+ projectId: projectId,
605
+ coreContract: coreContract,
606
+ sender: msg.sender
607
+ });
608
+
609
+ // validate hash seed was assigned correctly, if provided
610
+ if (hashSeed != bytes12(0)) {
611
+ PolyptychLib.validateAssignedHashSeed({
612
+ coreContract: coreContract,
613
+ tokenId: tokenId,
614
+ targetHashSeed: hashSeed
615
+ });
616
+ }
617
+
618
+ MaxInvocationsLib.validateMintEffectsInvocations({
619
+ tokenId: tokenId,
620
+ coreContract: coreContract
621
+ });
622
+
623
+ // INTERACTIONS
624
+ SplitFundsLib.splitFundsETHRefundSender({
625
+ projectId: projectId,
626
+ pricePerTokenInWei: pricePerTokenInWei,
627
+ coreContract: coreContract
628
+ });
629
+
630
+ return tokenId;
631
+ }
632
+ }