@artblocks/contracts 1.0.4 → 1.2.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 (289) hide show
  1. package/README.md +75 -7
  2. package/artifacts/contracts/AdminACLV0.sol/AdminACLV0.json +2 -2
  3. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  4. package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +336 -131
  5. package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +2047 -0
  6. package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +2021 -0
  7. package/artifacts/contracts/{minter-suite → archive/minter-suite}/Minters/MinterBase_v0_1_1.sol/MinterBase.json +1 -1
  8. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
  9. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
  10. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExp}/MinterDAExpV4.sol/MinterDAExpV4.json +3 -3
  11. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  12. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
  13. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +1109 -0
  14. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
  15. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
  16. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDALin}/MinterDALinV4.sol/MinterDALinV4.json +3 -3
  17. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
  18. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
  19. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
  20. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterHolder}/MinterHolderV4.sol/MinterHolderV4.json +3 -3
  21. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
  22. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
  23. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
  24. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
  25. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterMerkle}/MinterMerkleV5.sol/MinterMerkleV5.json +3 -3
  26. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +31 -63
  27. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol/MinterPolyptychV0.json +3 -3
  28. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSEA}/MinterSEAV0.sol/MinterSEAV0.json +3 -3
  29. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  30. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  31. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPrice}/MinterSetPriceV4.sol/MinterSetPriceV4.json +3 -3
  32. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol/MinterSetPriceERC20V0.json +65 -2
  33. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol/MinterSetPriceERC20V1.json +65 -2
  34. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  35. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  36. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +807 -0
  37. package/artifacts/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol/GenArt721MinterBurner_PBAB.json +65 -2
  38. package/artifacts/contracts/engine/V2/GenArt721Minter_PBAB.sol/GenArt721Minter_PBAB.json +65 -2
  39. package/artifacts/contracts/engine/V3/EngineFactoryV0.sol/EngineFactoryV0.json +606 -0
  40. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +565 -209
  41. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +785 -227
  42. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +40 -15
  43. package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +2 -2
  44. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +40 -15
  45. package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +36 -68
  46. package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
  47. package/artifacts/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol/IAdminACLV0_Extended.json +140 -0
  48. package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol/IBytecodeStorageReaderV2.json +130 -0
  49. package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +6 -6
  50. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +71 -39
  51. package/artifacts/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol/IEngineFactoryV0.json +283 -0
  52. package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol/IFilteredMinterDAExpSettlementV0.json +12 -12
  53. package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +12 -12
  54. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +30 -62
  55. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +30 -62
  56. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +170 -104
  57. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +170 -104
  58. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +1028 -0
  59. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +741 -0
  60. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol/IGenArt721CoreContractV3_ProjectFinance.json +87 -0
  61. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol/IGenArt721Minter_PBAB.json +279 -0
  62. package/artifacts/contracts/interfaces/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +22 -22
  63. package/artifacts/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
  64. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +26 -101
  65. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +1 -57
  66. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +1 -57
  67. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +2 -21
  68. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
  69. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +15 -90
  70. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +10 -36
  71. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol/ISharedMinterRAMV0.json +62 -0
  72. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol/ISharedMinterRequired.json +37 -0
  73. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +4 -236
  74. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +5 -5
  75. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +7 -423
  76. package/artifacts/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +17 -17
  77. package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol/ISplitAtomicFactoryV0.json +170 -0
  78. package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol/ISplitAtomicV0.json +126 -0
  79. package/artifacts/contracts/interfaces/v0.8.x/ISplitProviderV0.sol/ISplitProviderV0.json +98 -0
  80. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol/ISplitFactoryV2.json +123 -0
  81. package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
  82. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeMock.sol/GnosisSafeMock.json +2 -2
  83. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeProxyFactoryMock.sol/GnosisSafeProxyFactoryMock.json +2 -2
  84. package/artifacts/contracts/libs/integration-refs/gnosis-safe/MultiSendMock.sol/MultiSendMock.json +2 -2
  85. package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +2 -2
  86. package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
  87. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  88. package/artifacts/contracts/libs/v0.8.x/BitMap.sol/BitMaps256.json +10 -0
  89. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV0.sol/BytecodeStorage.json +2 -2
  90. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageReader.json +2 -2
  91. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageWriter.json +2 -2
  92. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageReader.json +214 -0
  93. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageWriter.json +10 -0
  94. package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
  95. package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +10 -0
  96. package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +2 -2
  97. package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol/ERC721_PackedHashSeedV1.json +444 -0
  98. package/artifacts/contracts/libs/v0.8.x/PackedBools.sol/PackedBools.json +10 -0
  99. package/artifacts/contracts/libs/v0.8.x/SSTORE2.sol/SSTORE2.json +2 -2
  100. package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +208 -0
  101. package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +60 -3
  102. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
  103. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +60 -3
  104. package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
  105. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +29 -3
  106. package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +30 -3
  107. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  108. package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +398 -0
  109. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +254 -3
  110. package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +48 -3
  111. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +41 -3
  112. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +35 -3
  113. package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +79 -3
  114. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  115. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +41 -41
  116. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +66 -632
  117. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +67 -594
  118. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +33 -524
  119. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +66 -632
  120. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +33 -524
  121. package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +1374 -0
  122. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +56 -722
  123. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +58 -454
  124. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +61 -552
  125. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +55 -497
  126. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +110 -571
  127. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +69 -560
  128. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +28 -444
  129. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +417 -0
  130. package/artifacts/contracts/mock/BytecodeV2LibCallsMock.sol/BytecodeV2LibCallsMock.json +154 -0
  131. package/artifacts/contracts/mock/BytecodeV2TextCR_DMock.sol/BytecodeV2TextCR_DMock.json +428 -0
  132. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  133. package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +2 -2
  134. package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +24 -0
  135. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -9
  136. package/artifacts/contracts/mock/Mock0xSplitsV2PullFactory.sol/Mock0xSplitsV2PullFactory.json +149 -0
  137. package/artifacts/contracts/mock/Mock0xSplitsV2Splitter.sol/Mock0xSplitsV2Splitter.json +99 -0
  138. package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +20 -2
  139. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +20 -2
  140. package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
  141. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  142. package/artifacts/contracts/mock/ReentrancyGenArt721MinterMock.sol/ReentrancyGenArt721MinterMock.json +100 -0
  143. package/artifacts/contracts/mock/ReentrancyHolderMock.sol/ReentrancyHolderMock.json +2 -2
  144. package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
  145. package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
  146. package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
  147. package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
  148. package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
  149. package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +2 -2
  150. package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
  151. package/artifacts/contracts/mock/ReentrancySplitterMocks.sol/ReentrancySplitterDrainETHMock.json +54 -0
  152. package/artifacts/contracts/mock/ReentrancySplitterMocks.sol/ReentrancySplitterSendETHMock.json +54 -0
  153. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
  154. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
  155. package/artifacts/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +2 -2
  156. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +19 -19
  157. package/artifacts/contracts/split/SplitAtomicFactoryV0.sol/SplitAtomicFactoryV0.json +203 -0
  158. package/artifacts/contracts/split/SplitAtomicV0.sol/SplitAtomicV0.json +168 -0
  159. package/artifacts/contracts/split/split-provider/SplitProviderV0.sol/SplitProviderV0.json +141 -0
  160. package/contracts/AdminACLV0.sol +6 -2
  161. package/contracts/AdminACLV1.sol +2 -2
  162. package/contracts/DependencyRegistryV0.sol +737 -390
  163. package/contracts/{GenArt721CoreV3.sol → archive/GenArt721CoreV3.sol} +56 -20
  164. package/contracts/{explorations → archive}/GenArt721CoreV3_Explorations.sol +49 -13
  165. package/contracts/{minter-suite → archive/minter-suite}/Minters/MinterBase_v0_1_1.sol +4 -4
  166. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExp}/MinterDAExpV4.sol +4 -4
  167. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +4 -4
  168. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +5 -5
  169. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV2.sol +9 -62
  170. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDALin}/MinterDALinV4.sol +4 -4
  171. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterHolder}/MinterHolderV4.sol +5 -5
  172. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterMerkle}/MinterMerkleV5.sol +5 -5
  173. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol +7 -7
  174. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSEA}/MinterSEAV0.sol +13 -13
  175. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPrice}/MinterSetPriceV4.sol +4 -4
  176. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol +82 -10
  177. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol +82 -10
  178. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPriceERC20}/MinterSetPriceERC20V4.sol +88 -21
  179. package/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol +81 -22
  180. package/contracts/engine/V2/GenArt721Minter_PBAB.sol +80 -22
  181. package/contracts/engine/V3/EngineFactoryV0.sol +419 -0
  182. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +893 -493
  183. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +1053 -655
  184. package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +7 -13
  185. package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +5 -11
  186. package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +2 -2
  187. package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
  188. package/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol +20 -0
  189. package/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol +23 -0
  190. package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +6 -8
  191. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +48 -43
  192. package/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol +124 -0
  193. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol +1 -3
  194. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol +1 -3
  195. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpV1.sol +1 -3
  196. package/contracts/interfaces/v0.8.x/IFilteredMinterDALinV1.sol +1 -3
  197. package/contracts/interfaces/v0.8.x/IFilteredMinterHolderV2.sol +1 -3
  198. package/contracts/interfaces/v0.8.x/IFilteredMinterMerkleV2.sol +1 -3
  199. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +115 -11
  200. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +84 -8
  201. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol +26 -8
  202. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol +141 -0
  203. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol +78 -0
  204. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol +47 -0
  205. package/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol +91 -0
  206. package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +25 -25
  207. package/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol +1 -3
  208. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +30 -20
  209. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +1 -14
  210. package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +1 -15
  211. package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +2 -8
  212. package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
  213. package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +15 -43
  214. package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +10 -20
  215. package/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol +23 -0
  216. package/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol +20 -0
  217. package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +1 -67
  218. package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +5 -5
  219. package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +18 -160
  220. package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +37 -37
  221. package/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol +81 -0
  222. package/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol +72 -0
  223. package/contracts/interfaces/v0.8.x/ISplitProviderV0.sol +49 -0
  224. package/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol +62 -0
  225. package/contracts/libs/v0.8.x/ABHelpers.sol +31 -17
  226. package/contracts/libs/v0.8.x/AuthLib.sol +101 -102
  227. package/contracts/libs/v0.8.x/BitMap.sol +112 -0
  228. package/contracts/libs/v0.8.x/BytecodeStorageV2.sol +593 -0
  229. package/contracts/libs/v0.8.x/Bytes32Strings.sol +5 -5
  230. package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +90 -0
  231. package/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol +591 -0
  232. package/contracts/libs/v0.8.x/PackedBools.sol +42 -0
  233. package/contracts/libs/v0.8.x/V3FlexLib.sol +591 -0
  234. package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +162 -39
  235. package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
  236. package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +139 -37
  237. package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
  238. package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +299 -158
  239. package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +268 -55
  240. package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +138 -58
  241. package/contracts/libs/v0.8.x/minter-libs/RAMLib.sol +2927 -0
  242. package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +796 -123
  243. package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +131 -13
  244. package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +607 -224
  245. package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +494 -330
  246. package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +217 -78
  247. package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +358 -309
  248. package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +391 -491
  249. package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +396 -632
  250. package/contracts/minter-suite/Minters/MinterDAExpV5.sol +212 -273
  251. package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +393 -488
  252. package/contracts/minter-suite/Minters/MinterDALinV5.sol +220 -277
  253. package/contracts/minter-suite/Minters/MinterRAMV0.sol +1205 -0
  254. package/contracts/minter-suite/Minters/MinterSEAV1.sol +329 -677
  255. package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +287 -303
  256. package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +355 -446
  257. package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +328 -416
  258. package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +552 -622
  259. package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +429 -553
  260. package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +180 -227
  261. package/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol +446 -0
  262. package/contracts/mock/BytecodeV2LibCallsMock.sol +128 -0
  263. package/contracts/mock/BytecodeV2TextCR_DMock.sol +316 -0
  264. package/contracts/mock/ForceSendMock.sol +22 -0
  265. package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +3 -10
  266. package/contracts/mock/Mock0xSplitsV2PullFactory.sol +75 -0
  267. package/contracts/mock/Mock0xSplitsV2Splitter.sol +47 -0
  268. package/contracts/mock/MockAdminACLV0.sol +21 -0
  269. package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +21 -0
  270. package/contracts/mock/ReentrancyGenArt721MinterMock.sol +47 -0
  271. package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
  272. package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
  273. package/contracts/mock/ReentrancyMockShared.sol +48 -0
  274. package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
  275. package/contracts/mock/ReentrancySplitterMocks.sol +67 -0
  276. package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
  277. package/contracts/randomizer/shared/SharedRandomizerV0.sol +79 -71
  278. package/contracts/split/SplitAtomicFactoryV0.sol +121 -0
  279. package/contracts/split/SplitAtomicV0.sol +265 -0
  280. package/contracts/split/split-provider/SplitProviderV0.sol +201 -0
  281. package/package.json +79 -45
  282. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +0 -1965
  283. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +0 -1939
  284. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +0 -1127
  285. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +0 -768
  286. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +0 -208
  287. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol/GenArt721RoyaltyOverride_PBAB.json +0 -301
  288. package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +0 -168
  289. package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +0 -221
@@ -1,23 +1,25 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
- import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
5
- import "../../interfaces/v0.8.x/IDelegationRegistry.sol";
6
- import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
7
- import "../../interfaces/v0.8.x/ISharedMinterHolderV0.sol";
8
- import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
4
+ // @dev fixed to specific solidity version for clarity and for more clear
5
+ // source code verification purposes.
6
+ pragma solidity 0.8.19;
9
7
 
10
- import "../../libs/v0.8.x/AuthLib.sol";
11
- import "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
12
- import "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
13
- import "../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
14
- import "../../libs/v0.8.x/minter-libs/TokenHolderLib.sol";
15
- import "../../libs/v0.8.x/minter-libs/PolyptychLib.sol";
8
+ import {IGenArt721CoreContractV3_Base} from "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
9
+ import {IDelegationRegistry} from "../../interfaces/v0.8.x/IDelegationRegistry.sol";
10
+ import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
11
+ import {ISharedMinterHolderERC20V0} from "../../interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol";
12
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
16
13
 
17
- import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
18
- import "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.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 {TokenHolderLib} from "../../libs/v0.8.x/minter-libs/TokenHolderLib.sol";
19
+ import {PolyptychLib} from "../../libs/v0.8.x/minter-libs/PolyptychLib.sol";
19
20
 
20
- pragma solidity 0.8.19;
21
+ import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
22
+ import {EnumerableSet} from "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.sol";
21
23
 
22
24
  /**
23
25
  * @title Shared, filtered Minter contract that allows tokens to be minted with
@@ -72,11 +74,18 @@ pragma solidity 0.8.19;
72
74
  * Token-level delegations are configured by the vault owner, and contract-
73
75
  * level delegations must be configured for the core token contract as returned
74
76
  * by the public immutable variable `genArt721CoreAddress`.
77
+ * ----------------------------------------------------------------------------
78
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
79
+ * Core Registry to assign this minter, this minter does not enforce that a
80
+ * project is registered when configured or queried. This is primarily for gas
81
+ * optimization purposes. It is, therefore, possible that fake projects may be
82
+ * configured on this minter, but they will not be able to mint tokens due to
83
+ * checks performed by this minter's Minter Filter.
75
84
  */
76
85
  contract MinterSetPricePolyptychERC20V5 is
77
86
  ReentrancyGuard,
78
87
  ISharedMinterV0,
79
- ISharedMinterHolderV0
88
+ ISharedMinterHolderERC20V0
80
89
  {
81
90
  // add Enumerable Set methods
82
91
  using EnumerableSet for EnumerableSet.AddressSet;
@@ -85,13 +94,13 @@ contract MinterSetPricePolyptychERC20V5 is
85
94
  address public immutable minterFilterAddress;
86
95
 
87
96
  /// Minter filter this minter may interact with.
88
- IMinterFilterV1 private immutable minterFilter;
97
+ IMinterFilterV1 private immutable _minterFilter;
89
98
 
90
99
  /// Delegation registry address
91
100
  address public immutable delegationRegistryAddress;
92
101
 
93
102
  /// Delegation registry address
94
- IDelegationRegistry private immutable delegationRegistryContract;
103
+ IDelegationRegistry private immutable _delegationRegistryContract;
95
104
 
96
105
  /// minterType for this minter
97
106
  string public constant minterType = "MinterSetPricePolyptychERC20V5";
@@ -99,73 +108,7 @@ contract MinterSetPricePolyptychERC20V5 is
99
108
  /// minter version for this minter
100
109
  string public constant minterVersion = "v5.0.0";
101
110
 
102
- uint256 constant ONE_MILLION = 1_000_000;
103
-
104
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
105
- // STATE VARIABLES FOR SetPriceLib begin here
106
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
107
-
108
- /// contractAddress => projectId => set price project config
109
- mapping(address => mapping(uint256 => SetPriceLib.SetPriceProjectConfig))
110
- private _setPriceProjectConfigMapping;
111
-
112
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
113
- // STATE VARIABLES FOR SetPriceLib end here
114
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
115
-
116
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
117
- // STATE VARIABLES FOR SplitFundsLib begin here
118
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
119
-
120
- // contractAddress => IsEngineCache
121
- mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
122
-
123
- // contractAddress => projectId => SplitFundsProjectConfig
124
- mapping(address => mapping(uint256 => SplitFundsLib.SplitFundsProjectConfig))
125
- private _splitFundsProjectConfigs;
126
-
127
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
128
- // STATE VARIABLES FOR SplitFundsLib end here
129
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
130
-
131
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
132
- // STATE VARIABLES FOR MaxInvocationsLib begin here
133
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
134
-
135
- // contractAddress => projectId => max invocations specific project config
136
- mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
137
- private _maxInvocationsProjectConfigMapping;
138
-
139
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
140
- // STATE VARIABLES FOR MaxInvocationsLib end here
141
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
142
-
143
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
144
- // STATE VARIABLES FOR PolyptychLib begin here
145
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
146
-
147
- // contractAddress => projectId => polyptych project config
148
- mapping(address => mapping(uint256 => PolyptychLib.PolyptychProjectConfig))
149
- private _polyptychProjectConfigs;
150
-
151
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
152
- // STATE VARIABLES FOR PolyptychLib end here
153
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
154
-
155
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
156
- // STATE VARIABLES FOR TokenHolderLib begin here
157
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
158
-
159
- /**
160
- * coreContract => projectId => ownedNFTAddress => ownedNFTProjectIds => bool
161
- * projects whose holders are allowed to purchase a token on `projectId`
162
- */
163
- mapping(address => mapping(uint256 => TokenHolderLib.HolderProjectConfig))
164
- private _allowedProjectHoldersMapping;
165
-
166
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
167
- // STATE VARIABLES FOR TokenHolderLib end here
168
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
111
+ uint256 internal constant ONE_MILLION = 1_000_000;
169
112
 
170
113
  // MODIFIERS
171
114
  // @dev contract uses modifier-like internal functions instead of modifiers
@@ -174,498 +117,484 @@ contract MinterSetPricePolyptychERC20V5 is
174
117
 
175
118
  /**
176
119
  * @notice Initializes contract to be a Filtered Minter for
177
- * `_minterFilter` minter filter.
178
- * @param _minterFilter Minter filter for which this will be a
120
+ * `minterFilter` minter filter.
121
+ * @param minterFilter Minter filter for which this will be a
179
122
  * filtered minter.
180
- * @param _delegationRegistryAddress Delegation registry contract address.
123
+ * @param delegationRegistryAddress_ Delegation registry contract address.
181
124
  */
182
125
  constructor(
183
- address _minterFilter,
184
- address _delegationRegistryAddress
126
+ address minterFilter,
127
+ address delegationRegistryAddress_
185
128
  ) ReentrancyGuard() {
186
- minterFilterAddress = _minterFilter;
187
- minterFilter = IMinterFilterV1(_minterFilter);
129
+ minterFilterAddress = minterFilter;
130
+ _minterFilter = IMinterFilterV1(minterFilter);
188
131
 
189
- delegationRegistryAddress = _delegationRegistryAddress;
190
- delegationRegistryContract = IDelegationRegistry(
191
- _delegationRegistryAddress
132
+ delegationRegistryAddress = delegationRegistryAddress_;
133
+ _delegationRegistryContract = IDelegationRegistry(
134
+ delegationRegistryAddress_
135
+ );
136
+ emit TokenHolderLib.DelegationRegistryUpdated(
137
+ delegationRegistryAddress_
192
138
  );
193
- emit DelegationRegistryUpdated(_delegationRegistryAddress);
194
139
  }
195
140
 
196
141
  /**
197
- * @notice Manually sets the local maximum invocations of project `_projectId`
198
- * with the provided `_maxInvocations`, checking that `_maxInvocations` is less
199
- * than or equal to the value of project `_project_id`'s maximum invocations that is
142
+ * @notice Manually sets the local maximum invocations of project `projectId`
143
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
144
+ * than or equal to the value of project `project_id`'s maximum invocations that is
200
145
  * set on the core contract.
201
- * @dev Note that a `_maxInvocations` of 0 can only be set if the current `invocations`
146
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
202
147
  * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
203
148
  * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
204
- * @param _projectId Project ID to set the maximum invocations for.
205
- * @param _coreContract Core contract address for the given project.
206
- * @param _maxInvocations Maximum invocations to set for the project.
149
+ * @param projectId Project ID to set the maximum invocations for.
150
+ * @param coreContract Core contract address for the given project.
151
+ * @param maxInvocations Maximum invocations to set for the project.
207
152
  */
208
153
  function manuallyLimitProjectMaxInvocations(
209
- uint256 _projectId,
210
- address _coreContract,
211
- uint24 _maxInvocations
154
+ uint256 projectId,
155
+ address coreContract,
156
+ uint24 maxInvocations
212
157
  ) external {
213
158
  AuthLib.onlyArtist({
214
- _projectId: _projectId,
215
- _coreContract: _coreContract,
216
- _sender: msg.sender
159
+ projectId: projectId,
160
+ coreContract: coreContract,
161
+ sender: msg.sender
162
+ });
163
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
164
+ projectId: projectId,
165
+ coreContract: coreContract,
166
+ maxInvocations: maxInvocations
217
167
  });
218
- MaxInvocationsLib.manuallyLimitProjectMaxInvocations(
219
- _projectId,
220
- _coreContract,
221
- _maxInvocations,
222
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
223
- );
224
- emit ProjectMaxInvocationsLimitUpdated(
225
- _projectId,
226
- _coreContract,
227
- _maxInvocations
228
- );
229
168
  }
230
169
 
231
170
  /**
232
- * @notice Updates this minter's price per token of project `_projectId`
233
- * to be '_pricePerTokenInWei`, in Wei.
171
+ * @notice Updates this minter's price per token of project `projectId`
172
+ * to be `pricePerTokenInWei`. Note that "in wei" is a misnomer on this
173
+ * ERC20 minter, but is used for consistency with the ETH minters. The
174
+ * price value represents the ERC20 token price in base units.
175
+ * @dev Note that it is intentionally supported here that the configured
176
+ * price may be explicitly set to `0`.
234
177
  * @dev Note that it is intentionally supported here that the configured
235
178
  * price may be explicitly set to `0`.
236
- * @param _projectId Project ID to set the price per token for.
237
- * @param _coreContract Core contract address for the given project.
238
- * @param _pricePerTokenInWei Price per token to set for the project, in Wei.
179
+ * @param projectId Project ID to set the price per token for.
180
+ * @param coreContract Core contract address for the given project.
181
+ * @param pricePerTokenInWei Price per token to set for the project.
182
+ * Represents the ERC20 token price in base units. For example, if the
183
+ * ERC20 token has 6 decimals, an input value of `1_000_000` would
184
+ * represent a price of `1.000000` tokens.
239
185
  */
240
186
  function updatePricePerTokenInWei(
241
- uint256 _projectId,
242
- address _coreContract,
243
- uint248 _pricePerTokenInWei
187
+ uint256 projectId,
188
+ address coreContract,
189
+ uint248 pricePerTokenInWei
244
190
  ) external {
245
191
  AuthLib.onlyArtist({
246
- _projectId: _projectId,
247
- _coreContract: _coreContract,
248
- _sender: msg.sender
192
+ projectId: projectId,
193
+ coreContract: coreContract,
194
+ sender: msg.sender
195
+ });
196
+ SetPriceLib.updatePricePerToken({
197
+ projectId: projectId,
198
+ coreContract: coreContract,
199
+ pricePerToken: pricePerTokenInWei
249
200
  });
250
- SetPriceLib.SetPriceProjectConfig
251
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
252
- _coreContract
253
- ][_projectId];
254
- SetPriceLib.updatePricePerTokenInWei(
255
- _pricePerTokenInWei,
256
- _setPriceProjectConfig
257
- );
258
- emit PricePerTokenInWeiUpdated(
259
- _projectId,
260
- _coreContract,
261
- _pricePerTokenInWei
262
- );
263
201
 
264
202
  // for convenience, sync local max invocations to the core contract if
265
203
  // and only if max invocations have not already been synced.
266
204
  // @dev do not sync if max invocations have already been synced, as
267
205
  // local max invocations could have been manually set to be
268
206
  // intentionally less than the core contract's max invocations.
269
- MaxInvocationsLib.MaxInvocationsProjectConfig
270
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
271
- _coreContract
272
- ][_projectId];
273
207
  // @dev if local maxInvocations and maxHasBeenInvoked are both
274
208
  // initial values, we know they have not been populated on this minter
275
209
  if (
276
- MaxInvocationsLib.maxInvocationsIsUnconfigured(
277
- _maxInvocationsProjectConfig
278
- )
210
+ MaxInvocationsLib.maxInvocationsIsUnconfigured({
211
+ projectId: projectId,
212
+ coreContract: coreContract
213
+ })
279
214
  ) {
280
- syncProjectMaxInvocationsToCore(_projectId, _coreContract);
215
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
216
+ projectId: projectId,
217
+ coreContract: coreContract
218
+ });
281
219
  }
282
220
  }
283
221
 
284
222
  /**
285
- * @notice Updates payment currency of project `_projectId` on core
286
- * contract `_coreContract` to be `_currencySymbol` at address
287
- * `_currencyAddress`.
223
+ * @notice Updates payment currency of project `projectId` on core
224
+ * contract `coreContract` to be `currencySymbol` at address
225
+ * `currencyAddress`.
288
226
  * Only supports ERC20 tokens - for ETH minting, use a different minter.
289
- * @param _projectId Project ID to update.
290
- * @param _coreContract Core contract address for the given project.
291
- * @param _currencySymbol Currency symbol.
292
- * @param _currencyAddress Currency address.
227
+ * Resets price to be unconfigured if currency was previously configured,
228
+ * as a safeguard against accidentally setting a price in one currency
229
+ * and then changing the currency but not the price.
230
+ * @dev nonReentrant because no reentrant use cases, and to eliminate an
231
+ * entire branch of reentrancy attack vectors.
232
+ * @param projectId Project ID to update.
233
+ * @param coreContract Core contract address for the given project.
234
+ * @param currencySymbol Currency symbol.
235
+ * @param currencyAddress Currency address.
293
236
  */
294
237
  function updateProjectCurrencyInfo(
295
- uint256 _projectId,
296
- address _coreContract,
297
- string memory _currencySymbol,
298
- address _currencyAddress
238
+ uint256 projectId,
239
+ address coreContract,
240
+ string memory currencySymbol,
241
+ address currencyAddress
299
242
  ) external nonReentrant {
300
243
  AuthLib.onlyArtist({
301
- _projectId: _projectId,
302
- _coreContract: _coreContract,
303
- _sender: msg.sender
304
- });
305
- SplitFundsLib.SplitFundsProjectConfig
306
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
307
- _coreContract
308
- ][_projectId];
309
- SplitFundsLib.updateProjectCurrencyInfoERC20({
310
- _splitFundsProjectConfig: _splitFundsProjectConfig,
311
- _currencySymbol: _currencySymbol,
312
- _currencyAddress: _currencyAddress
313
- });
314
- emit ProjectCurrencyInfoUpdated({
315
- _projectId: _projectId,
316
- _coreContract: _coreContract,
317
- _currencyAddress: _currencyAddress,
318
- _currencySymbol: _currencySymbol
244
+ projectId: projectId,
245
+ coreContract: coreContract,
246
+ sender: msg.sender
319
247
  });
248
+ bool recommendPriceReset = SplitFundsLib
249
+ .updateProjectCurrencyInfoERC20({
250
+ projectId: projectId,
251
+ coreContract: coreContract,
252
+ currencySymbol: currencySymbol,
253
+ currencyAddress: currencyAddress
254
+ });
255
+ if (recommendPriceReset) {
256
+ SetPriceLib.resetPricePerToken({
257
+ projectId: projectId,
258
+ coreContract: coreContract
259
+ });
260
+ }
320
261
  }
321
262
 
322
263
  /**
323
- * @notice Allows holders of NFTs at addresses `_ownedNFTAddresses`,
324
- * project IDs `_ownedNFTProjectIds` to mint on project `_projectId`.
325
- * `_ownedNFTAddresses` assumed to be aligned with `_ownedNFTProjectIds`.
326
- * e.g. Allows holders of project `_ownedNFTProjectIds[0]` on token
327
- * contract `_ownedNFTAddresses[0]` to mint `_projectId`.
264
+ * @notice Allows holders of NFTs at addresses `ownedNFTAddresses`,
265
+ * project IDs `ownedNFTProjectIds` to mint on project `projectId`.
266
+ * `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
267
+ * e.g. Allows holders of project `ownedNFTProjectIds[0]` on token
268
+ * contract `ownedNFTAddresses[0]` to mint `projectId`.
328
269
  * WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
329
270
  * due to assumptions about tokenId and projectId relationships.
330
- * @param _projectId Project ID to enable minting on.
331
- * @param _coreContract Core contract address for the given project.
332
- * @param _ownedNFTAddresses NFT core addresses of projects to be
333
- * allowlisted. Indexes must align with `_ownedNFTProjectIds`.
334
- * @param _ownedNFTProjectIds Project IDs on `_ownedNFTAddresses` whose
335
- * holders shall be allowlisted to mint project `_projectId`. Indexes must
336
- * align with `_ownedNFTAddresses`.
271
+ * @param projectId Project ID to enable minting on.
272
+ * @param coreContract Core contract address for the given project.
273
+ * @param ownedNFTAddresses NFT core addresses of projects to be
274
+ * allowlisted. Indexes must align with `ownedNFTProjectIds`.
275
+ * @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
276
+ * holders shall be allowlisted to mint project `projectId`. Indexes must
277
+ * align with `ownedNFTAddresses`.
337
278
  */
338
279
  function allowHoldersOfProjects(
339
- uint256 _projectId,
340
- address _coreContract,
341
- address[] memory _ownedNFTAddresses,
342
- uint256[] memory _ownedNFTProjectIds
280
+ uint256 projectId,
281
+ address coreContract,
282
+ address[] calldata ownedNFTAddresses,
283
+ uint256[] calldata ownedNFTProjectIds
343
284
  ) external {
344
285
  AuthLib.onlyArtist({
345
- _projectId: _projectId,
346
- _coreContract: _coreContract,
347
- _sender: msg.sender
286
+ projectId: projectId,
287
+ coreContract: coreContract,
288
+ sender: msg.sender
348
289
  });
349
290
  TokenHolderLib.allowHoldersOfProjects({
350
- holderProjectConfig: _allowedProjectHoldersMapping[_coreContract][
351
- _projectId
352
- ],
353
- _ownedNFTAddresses: _ownedNFTAddresses,
354
- _ownedNFTProjectIds: _ownedNFTProjectIds
291
+ projectId: projectId,
292
+ coreContract: coreContract,
293
+ ownedNFTAddresses: ownedNFTAddresses,
294
+ ownedNFTProjectIds: ownedNFTProjectIds
355
295
  });
356
-
357
- // emit approve event
358
- emit AllowedHoldersOfProjects(
359
- _projectId,
360
- _coreContract,
361
- _ownedNFTAddresses,
362
- _ownedNFTProjectIds
363
- );
364
296
  }
365
297
 
366
298
  /**
367
- * @notice Removes holders of NFTs at addresses `_ownedNFTAddresses`,
368
- * project IDs `_ownedNFTProjectIds` to mint on project `_projectId`. If
299
+ * @notice Removes holders of NFTs at addresses `ownedNFTAddresses`,
300
+ * project IDs `ownedNFTProjectIds` to mint on project `projectId`. If
369
301
  * other projects owned by a holder are still allowed to mint, holder will
370
302
  * maintain ability to purchase.
371
- * `_ownedNFTAddresses` assumed to be aligned with `_ownedNFTProjectIds`.
372
- * e.g. Removes holders of project `_ownedNFTProjectIds[0]` on token
373
- * contract `_ownedNFTAddresses[0]` from mint allowlist of `_projectId`.
374
- * @param _projectId Project ID to enable minting on.
375
- * @param _coreContract Core contract address for the given project.
376
- * @param _ownedNFTAddresses NFT core addresses of projects to be removed
377
- * from allowlist. Indexes must align with `_ownedNFTProjectIds`.
378
- * @param _ownedNFTProjectIds Project IDs on `_ownedNFTAddresses` whose
379
- * holders will be removed from allowlist to mint project `_projectId`.
380
- * Indexes must align with `_ownedNFTAddresses`.
303
+ * `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
304
+ * e.g. Removes holders of project `ownedNFTProjectIds[0]` on token
305
+ * contract `ownedNFTAddresses[0]` from mint allowlist of `projectId`.
306
+ * @param projectId Project ID to enable minting on.
307
+ * @param coreContract Core contract address for the given project.
308
+ * @param ownedNFTAddresses NFT core addresses of projects to be removed
309
+ * from allowlist. Indexes must align with `ownedNFTProjectIds`.
310
+ * @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
311
+ * holders will be removed from allowlist to mint project `projectId`.
312
+ * Indexes must align with `ownedNFTAddresses`.
381
313
  */
382
314
  function removeHoldersOfProjects(
383
- uint256 _projectId,
384
- address _coreContract,
385
- address[] memory _ownedNFTAddresses,
386
- uint256[] memory _ownedNFTProjectIds
315
+ uint256 projectId,
316
+ address coreContract,
317
+ address[] calldata ownedNFTAddresses,
318
+ uint256[] calldata ownedNFTProjectIds
387
319
  ) external {
388
320
  AuthLib.onlyArtist({
389
- _projectId: _projectId,
390
- _coreContract: _coreContract,
391
- _sender: msg.sender
321
+ projectId: projectId,
322
+ coreContract: coreContract,
323
+ sender: msg.sender
392
324
  });
393
325
  // require same length arrays
394
326
  TokenHolderLib.removeHoldersOfProjects({
395
- holderProjectConfig: _allowedProjectHoldersMapping[_coreContract][
396
- _projectId
397
- ],
398
- _ownedNFTAddresses: _ownedNFTAddresses,
399
- _ownedNFTProjectIds: _ownedNFTProjectIds
327
+ projectId: projectId,
328
+ coreContract: coreContract,
329
+ ownedNFTAddresses: ownedNFTAddresses,
330
+ ownedNFTProjectIds: ownedNFTProjectIds
400
331
  });
401
- // emit removed event
402
- emit RemovedHoldersOfProjects(
403
- _projectId,
404
- _coreContract,
405
- _ownedNFTAddresses,
406
- _ownedNFTProjectIds
407
- );
408
332
  }
409
333
 
410
334
  /**
411
- * @notice Allows holders of NFTs at addresses `_ownedNFTAddressesAdd`,
412
- * project IDs `_ownedNFTProjectIdsAdd` to mint on project `_projectId`.
413
- * Also removes holders of NFTs at addresses `_ownedNFTAddressesRemove`,
414
- * project IDs `_ownedNFTProjectIdsRemove` from minting on project
415
- * `_projectId`.
416
- * `_ownedNFTAddressesAdd` assumed to be aligned with
417
- * `_ownedNFTProjectIdsAdd`.
418
- * e.g. Allows holders of project `_ownedNFTProjectIdsAdd[0]` on token
419
- * contract `_ownedNFTAddressesAdd[0]` to mint `_projectId`.
420
- * `_ownedNFTAddressesRemove` also assumed to be aligned with
421
- * `_ownedNFTProjectIdsRemove`.
335
+ * @notice Allows holders of NFTs at addresses `ownedNFTAddressesAdd`,
336
+ * project IDs `ownedNFTProjectIdsAdd` to mint on project `projectId`.
337
+ * Also removes holders of NFTs at addresses `ownedNFTAddressesRemove`,
338
+ * project IDs `ownedNFTProjectIdsRemove` from minting on project
339
+ * `projectId`.
340
+ * `ownedNFTAddressesAdd` assumed to be aligned with
341
+ * `ownedNFTProjectIdsAdd`.
342
+ * e.g. Allows holders of project `ownedNFTProjectIdsAdd[0]` on token
343
+ * contract `ownedNFTAddressesAdd[0]` to mint `projectId`.
344
+ * `ownedNFTAddressesRemove` also assumed to be aligned with
345
+ * `ownedNFTProjectIdsRemove`.
422
346
  * WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
423
347
  * due to assumptions about tokenId and projectId relationships.
424
- * @param _projectId Project ID to enable minting on.
425
- * @param _coreContract Core contract address for the given project.
426
- * @param _ownedNFTAddressesAdd NFT core addresses of projects to be
427
- * allowlisted. Indexes must align with `_ownedNFTProjectIdsAdd`.
428
- * @param _ownedNFTProjectIdsAdd Project IDs on `_ownedNFTAddressesAdd`
429
- * whose holders shall be allowlisted to mint project `_projectId`. Indexes
430
- * must align with `_ownedNFTAddressesAdd`.
431
- * @param _ownedNFTAddressesRemove NFT core addresses of projects to be
348
+ * @param projectId Project ID to enable minting on.
349
+ * @param coreContract Core contract address for the given project.
350
+ * @param ownedNFTAddressesAdd NFT core addresses of projects to be
351
+ * allowlisted. Indexes must align with `ownedNFTProjectIdsAdd`.
352
+ * @param ownedNFTProjectIdsAdd Project IDs on `ownedNFTAddressesAdd`
353
+ * whose holders shall be allowlisted to mint project `projectId`. Indexes
354
+ * must align with `ownedNFTAddressesAdd`.
355
+ * @param ownedNFTAddressesRemove NFT core addresses of projects to be
432
356
  * removed from allowlist. Indexes must align with
433
- * `_ownedNFTProjectIdsRemove`.
434
- * @param _ownedNFTProjectIdsRemove Project IDs on
435
- * `_ownedNFTAddressesRemove` whose holders will be removed from allowlist
436
- * to mint project `_projectId`. Indexes must align with
437
- * `_ownedNFTAddressesRemove`.
357
+ * `ownedNFTProjectIdsRemove`.
358
+ * @param ownedNFTProjectIdsRemove Project IDs on
359
+ * `ownedNFTAddressesRemove` whose holders will be removed from allowlist
360
+ * to mint project `projectId`. Indexes must align with
361
+ * `ownedNFTAddressesRemove`.
438
362
  * @dev if a project is included in both add and remove arrays, it will be
439
363
  * removed.
440
364
  */
441
365
  function allowAndRemoveHoldersOfProjects(
442
- uint256 _projectId,
443
- address _coreContract,
444
- address[] memory _ownedNFTAddressesAdd,
445
- uint256[] memory _ownedNFTProjectIdsAdd,
446
- address[] memory _ownedNFTAddressesRemove,
447
- uint256[] memory _ownedNFTProjectIdsRemove
366
+ uint256 projectId,
367
+ address coreContract,
368
+ address[] calldata ownedNFTAddressesAdd,
369
+ uint256[] calldata ownedNFTProjectIdsAdd,
370
+ address[] calldata ownedNFTAddressesRemove,
371
+ uint256[] calldata ownedNFTProjectIdsRemove
448
372
  ) external {
449
373
  AuthLib.onlyArtist({
450
- _projectId: _projectId,
451
- _coreContract: _coreContract,
452
- _sender: msg.sender
374
+ projectId: projectId,
375
+ coreContract: coreContract,
376
+ sender: msg.sender
453
377
  });
454
378
  TokenHolderLib.allowAndRemoveHoldersOfProjects({
455
- holderProjectConfig: _allowedProjectHoldersMapping[_coreContract][
456
- _projectId
457
- ],
458
- _ownedNFTAddressesAdd: _ownedNFTAddressesAdd,
459
- _ownedNFTProjectIdsAdd: _ownedNFTProjectIdsAdd,
460
- _ownedNFTAddressesRemove: _ownedNFTAddressesRemove,
461
- _ownedNFTProjectIdsRemove: _ownedNFTProjectIdsRemove
379
+ projectId: projectId,
380
+ coreContract: coreContract,
381
+ ownedNFTAddressesAdd: ownedNFTAddressesAdd,
382
+ ownedNFTProjectIdsAdd: ownedNFTProjectIdsAdd,
383
+ ownedNFTAddressesRemove: ownedNFTAddressesRemove,
384
+ ownedNFTProjectIdsRemove: ownedNFTProjectIdsRemove
462
385
  });
463
-
464
- // emit events
465
- emit AllowedHoldersOfProjects(
466
- _projectId,
467
- _coreContract,
468
- _ownedNFTAddressesAdd,
469
- _ownedNFTProjectIdsAdd
470
- );
471
- emit RemovedHoldersOfProjects(
472
- _projectId,
473
- _coreContract,
474
- _ownedNFTAddressesRemove,
475
- _ownedNFTProjectIdsRemove
476
- );
477
386
  }
478
387
 
479
388
  /**
480
389
  * @notice Allows the artist to increment the minter to the next polyptych panel
481
- * @param _projectId Project ID to increment to its next polyptych panel
482
- * @param _coreContract Core contract address for the given project.
390
+ * @param projectId Project ID to increment to its next polyptych panel
391
+ * @param coreContract Core contract address for the given project.
483
392
  */
484
393
  function incrementPolyptychProjectPanelId(
485
- uint256 _projectId,
486
- address _coreContract
394
+ uint256 projectId,
395
+ address coreContract
487
396
  ) public {
488
397
  AuthLib.onlyArtist({
489
- _projectId: _projectId,
490
- _coreContract: _coreContract,
491
- _sender: msg.sender
398
+ projectId: projectId,
399
+ coreContract: coreContract,
400
+ sender: msg.sender
401
+ });
402
+ PolyptychLib.incrementPolyptychProjectPanelId({
403
+ projectId: projectId,
404
+ coreContract: coreContract
492
405
  });
493
- PolyptychLib.PolyptychProjectConfig
494
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
495
- _coreContract
496
- ][_projectId];
497
- PolyptychLib.incrementPolyptychProjectPanelId(_polyptychProjectConfig);
498
- // index the update
499
- emit ConfigValueSet(
500
- _projectId,
501
- _coreContract,
502
- PolyptychLib.POLYPTYCH_PANEL_ID,
503
- _polyptychProjectConfig.polyptychPanelId
504
- );
505
406
  }
506
407
 
507
408
  /**
508
- * @notice Purchases a token from project `_projectId` on core contract
509
- * `_coreContract` using an owned NFT at address `_ownedNFTAddress` and
510
- * token ID `_ownedNFTTokenId` as the parent token.
511
- * @param _projectId Project ID to mint a token on.
512
- * @param _coreContract Core contract address for the given project.
513
- * @param _ownedNFTAddress ERC-721 NFT address holding the project token
409
+ * @notice Purchases a token from project `projectId` on core contract
410
+ * `coreContract` using an owned NFT at address `ownedNFTAddress` and
411
+ * token ID `ownedNFTTokenId` as the parent token.
412
+ * @param projectId Project ID to mint a token on.
413
+ * @param coreContract Core contract address for the given project.
414
+ * @param maxPricePerToken Maximum price of token being allowed by the
415
+ * purchaser, in base units. For example, if the ERC20 token has 6
416
+ * decimals, an input value of `1_000_000` would represent a maximum price
417
+ * of `1.000000` tokens.
418
+ * @param currencyAddress Currency address of token.
419
+ * @param ownedNFTAddress ERC-721 NFT address holding the project token
514
420
  * owned by msg.sender being used as the parent token.
515
- * @param _ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender to be
421
+ * @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender to be
516
422
  * used as the parent token.
517
423
  * @return tokenId Token ID of minted token
518
424
  */
519
425
  function purchase(
520
- uint256 _projectId,
521
- address _coreContract,
522
- address _ownedNFTAddress,
523
- uint256 _ownedNFTTokenId
524
- ) external payable returns (uint256 tokenId) {
525
- tokenId = purchaseTo(
526
- msg.sender,
527
- _projectId,
528
- _coreContract,
529
- _ownedNFTAddress,
530
- _ownedNFTTokenId,
531
- address(0)
532
- );
426
+ uint256 projectId,
427
+ address coreContract,
428
+ uint256 maxPricePerToken,
429
+ address currencyAddress,
430
+ address ownedNFTAddress,
431
+ uint256 ownedNFTTokenId
432
+ ) external returns (uint256 tokenId) {
433
+ tokenId = purchaseTo({
434
+ to: msg.sender,
435
+ projectId: projectId,
436
+ coreContract: coreContract,
437
+ maxPricePerToken: maxPricePerToken,
438
+ currencyAddress: currencyAddress,
439
+ ownedNFTAddress: ownedNFTAddress,
440
+ ownedNFTTokenId: ownedNFTTokenId,
441
+ vault: address(0)
442
+ });
533
443
  return tokenId;
534
444
  }
535
445
 
536
446
  /**
537
- * @notice Purchases a token from project `_projectId` on core contract
538
- * `_coreContract` using an owned NFT at address `_ownedNFTAddress` and
539
- * token ID `_ownedNFTTokenId` as the parent token.
540
- * Sets the token's owner to `_to`.
541
- * @param _to Address to be the new token's owner.
542
- * @param _projectId Project ID to mint a token on.
543
- * @param _coreContract Core contract address for the given project.
544
- * @param _ownedNFTAddress ERC-721 NFT holding the project token owned by
447
+ * @notice Purchases a token from project `projectId` on core contract
448
+ * `coreContract` using an owned NFT at address `ownedNFTAddress` and
449
+ * token ID `ownedNFTTokenId` as the parent token.
450
+ * Sets the token's owner to `to`.
451
+ * @param to Address to be the new token's owner.
452
+ * @param projectId Project ID to mint a token on.
453
+ * @param coreContract Core contract address for the given project.
454
+ * @param maxPricePerToken Maximum price of token being allowed by the
455
+ * purchaser, in base units. For example, if the ERC20 token has 6
456
+ * decimals, an input value of `1_000_000` would represent a maximum price
457
+ * of `1.000000` tokens.
458
+ * @param currencyAddress Currency address of token.
459
+ * @param ownedNFTAddress ERC-721 NFT holding the project token owned by
545
460
  * msg.sender being used as the parent token.
546
- * @param _ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
461
+ * @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
547
462
  * as the parent token.
548
463
  * @return tokenId Token ID of minted token
549
464
  */
550
465
  function purchaseTo(
551
- address _to,
552
- uint256 _projectId,
553
- address _coreContract,
554
- address _ownedNFTAddress,
555
- uint256 _ownedNFTTokenId
556
- ) external payable returns (uint256 tokenId) {
466
+ address to,
467
+ uint256 projectId,
468
+ address coreContract,
469
+ uint256 maxPricePerToken,
470
+ address currencyAddress,
471
+ address ownedNFTAddress,
472
+ uint256 ownedNFTTokenId
473
+ ) external returns (uint256 tokenId) {
557
474
  return
558
- purchaseTo(
559
- _to,
560
- _projectId,
561
- _coreContract,
562
- _ownedNFTAddress,
563
- _ownedNFTTokenId,
564
- address(0)
565
- );
475
+ purchaseTo({
476
+ to: to,
477
+ projectId: projectId,
478
+ coreContract: coreContract,
479
+ maxPricePerToken: maxPricePerToken,
480
+ currencyAddress: currencyAddress,
481
+ ownedNFTAddress: ownedNFTAddress,
482
+ ownedNFTTokenId: ownedNFTTokenId,
483
+ vault: address(0)
484
+ });
566
485
  }
567
486
 
568
487
  // public getter functions
569
488
  /**
570
489
  * @notice Gets the maximum invocations project configuration.
571
- * @param _projectId The ID of the project whose data needs to be fetched.
572
- * @param _coreContract The address of the core contract.
490
+ * @param projectId The ID of the project whose data needs to be fetched.
491
+ * @param coreContract The address of the core contract.
573
492
  * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
574
493
  * configuration data.
575
494
  */
576
495
  function maxInvocationsProjectConfig(
577
- uint256 _projectId,
578
- address _coreContract
496
+ uint256 projectId,
497
+ address coreContract
579
498
  )
580
499
  external
581
500
  view
582
501
  returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
583
502
  {
584
- return _maxInvocationsProjectConfigMapping[_coreContract][_projectId];
503
+ return
504
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
505
+ projectId: projectId,
506
+ coreContract: coreContract
507
+ });
585
508
  }
586
509
 
587
510
  /**
588
511
  * @notice Gets the set price project configuration.
589
- * @param _projectId The ID of the project whose data needs to be fetched.
590
- * @param _coreContract The address of the core contract.
512
+ * @param projectId The ID of the project whose data needs to be fetched.
513
+ * @param coreContract The address of the core contract.
591
514
  * @return SetPriceProjectConfig struct with the fixed price project
592
515
  * configuration data.
593
516
  */
594
517
  function setPriceProjectConfig(
595
- uint256 _projectId,
596
- address _coreContract
518
+ uint256 projectId,
519
+ address coreContract
597
520
  ) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
598
- return _setPriceProjectConfigMapping[_coreContract][_projectId];
521
+ return
522
+ SetPriceLib.getSetPriceProjectConfig({
523
+ projectId: projectId,
524
+ coreContract: coreContract
525
+ });
599
526
  }
600
527
 
601
528
  /**
602
529
  * @notice Checks if a specific NFT owner is allowed in a given project.
603
530
  * @dev This function retrieves the allowance status of an NFT owner
604
531
  * within a specific project from the allowedProjectHoldersMapping.
605
- * @param _projectId The ID of the project to check.
606
- * @param _coreContract Core contract address for the given project.
607
- * @param _ownedNFTAddress The address of the owned NFT contract.
608
- * @param _ownedNFTProjectId The ID of the owned NFT project.
532
+ * @param projectId The ID of the project to check.
533
+ * @param coreContract Core contract address for the given project.
534
+ * @param ownedNFTAddress The address of the owned NFT contract.
535
+ * @param ownedNFTProjectId The ID of the owned NFT project.
609
536
  * @return bool True if the NFT owner is allowed in the given project, False otherwise.
610
537
  */
611
538
  function allowedProjectHolders(
612
- uint256 _projectId,
613
- address _coreContract,
614
- address _ownedNFTAddress,
615
- uint256 _ownedNFTProjectId
539
+ uint256 projectId,
540
+ address coreContract,
541
+ address ownedNFTAddress,
542
+ uint256 ownedNFTProjectId
616
543
  ) external view returns (bool) {
617
544
  return
618
- _allowedProjectHoldersMapping[_coreContract][_projectId]
619
- .allowedProjectHolders[_ownedNFTAddress][_ownedNFTProjectId];
545
+ TokenHolderLib
546
+ .getHolderProjectConfig({
547
+ projectId: projectId,
548
+ coreContract: coreContract
549
+ })
550
+ .allowedProjectHolders[ownedNFTAddress][ownedNFTProjectId];
620
551
  }
621
552
 
622
553
  /**
623
- * @notice Returns if token is an allowlisted NFT for project `_projectId`.
624
- * @param _projectId Project ID to be checked.
625
- * @param _coreContract Core contract address for the given project.
626
- * @param _ownedNFTAddress ERC-721 NFT token address to be checked.
627
- * @param _ownedNFTTokenId ERC-721 NFT token ID to be checked.
554
+ * @notice Returns if token is an allowlisted NFT for project `projectId`.
555
+ * @param projectId Project ID to be checked.
556
+ * @param coreContract Core contract address for the given project.
557
+ * @param ownedNFTAddress ERC-721 NFT token address to be checked.
558
+ * @param ownedNFTTokenId ERC-721 NFT token ID to be checked.
628
559
  * @return bool Token is allowlisted
629
560
  * @dev does not check if token has been used to purchase
630
561
  * @dev assumes project ID can be derived from tokenId / 1_000_000
631
562
  */
632
563
  function isAllowlistedNFT(
633
- uint256 _projectId,
634
- address _coreContract,
635
- address _ownedNFTAddress,
636
- uint256 _ownedNFTTokenId
564
+ uint256 projectId,
565
+ address coreContract,
566
+ address ownedNFTAddress,
567
+ uint256 ownedNFTTokenId
637
568
  ) external view returns (bool) {
638
569
  return
639
570
  TokenHolderLib.isAllowlistedNFT({
640
- holderProjectConfig: _allowedProjectHoldersMapping[
641
- _coreContract
642
- ][_projectId],
643
- _ownedNFTAddress: _ownedNFTAddress,
644
- _ownedNFTTokenId: _ownedNFTTokenId
571
+ projectId: projectId,
572
+ coreContract: coreContract,
573
+ ownedNFTAddress: ownedNFTAddress,
574
+ ownedNFTTokenId: ownedNFTTokenId
645
575
  });
646
576
  }
647
577
 
648
578
  /**
649
- * @notice Checks if the specified `_coreContract` is a valid engine contract.
650
- * @dev This function retrieves the cached value of `_isEngine` from
579
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
580
+ * @dev This function retrieves the cached value of `isEngine` from
651
581
  * the `isEngineCache` mapping. If the cached value is already set, it
652
- * returns the cached value. Otherwise, it calls the `getV3CoreIsEngine`
653
- * function from the `SplitFundsLib` library to check if `_coreContract`
582
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
583
+ * function from the `SplitFundsLib` library to check if `coreContract`
654
584
  * is a valid engine contract.
655
- * @dev This function will revert if the provided `_coreContract` is not
585
+ * @dev This function will revert if the provided `coreContract` is not
656
586
  * a valid Engine or V3 Flagship contract.
657
- * @param _coreContract The address of the contract to check.
658
- * @return bool indicating if `_coreContract` is a valid engine contract.
587
+ * @param coreContract The address of the contract to check.
588
+ * @return bool indicating if `coreContract` is a valid engine contract.
659
589
  */
660
- function isEngineView(address _coreContract) external view returns (bool) {
661
- SplitFundsLib.IsEngineCache storage isEngineCache = _isEngineCaches[
662
- _coreContract
663
- ];
590
+ function isEngineView(address coreContract) external view returns (bool) {
591
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
592
+ .getIsEngineCacheConfig(coreContract);
664
593
  if (isEngineCache.isCached) {
665
594
  return isEngineCache.isEngine;
666
595
  } else {
667
- // @dev this calls the non-modifying variant of getV3CoreIsEngine
668
- return SplitFundsLib.getV3CoreIsEngineView(_coreContract);
596
+ // @dev this calls the non-state-modifying variant of isEngine
597
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
669
598
  }
670
599
  }
671
600
 
@@ -680,17 +609,18 @@ contract MinterSetPricePolyptychERC20V5 is
680
609
  * possible because the V3 core contract only allows maximum invocations
681
610
  * to be reduced, not increased. Based on this rationale, we intentionally
682
611
  * do not do input validation in this method as to whether or not the input
683
- * @param `_projectId` is an existing project ID.
684
- * @param `_coreContract` is an existing core contract address.
612
+ * @param projectId is an existing project ID.
613
+ * @param coreContract is an existing core contract address.
685
614
  */
686
615
  function projectMaxHasBeenInvoked(
687
- uint256 _projectId,
688
- address _coreContract
616
+ uint256 projectId,
617
+ address coreContract
689
618
  ) external view returns (bool) {
690
619
  return
691
- MaxInvocationsLib.getMaxHasBeenInvoked(
692
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
693
- );
620
+ MaxInvocationsLib.getMaxHasBeenInvoked({
621
+ projectId: projectId,
622
+ coreContract: coreContract
623
+ });
694
624
  }
695
625
 
696
626
  /**
@@ -709,79 +639,84 @@ contract MinterSetPricePolyptychERC20V5 is
709
639
  * increased. When this happens, the minter will enable minting, allowing
710
640
  * the core contract to enforce the max invocations check. Based on this
711
641
  * rationale, we intentionally do not do input validation in this method as
712
- * to whether or not the input `_projectId` is an existing project ID.
713
- * @param `_projectId` is an existing project ID.
714
- * @param `_coreContract` is an existing core contract address.
642
+ * to whether or not the input `projectId` is an existing project ID.
643
+ * @param projectId is an existing project ID.
644
+ * @param coreContract is an existing core contract address.
715
645
  */
716
646
  function projectMaxInvocations(
717
- uint256 _projectId,
718
- address _coreContract
647
+ uint256 projectId,
648
+ address coreContract
719
649
  ) external view returns (uint256) {
720
650
  return
721
- MaxInvocationsLib.getMaxInvocations(
722
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
723
- );
651
+ MaxInvocationsLib.getMaxInvocations({
652
+ projectId: projectId,
653
+ coreContract: coreContract
654
+ });
724
655
  }
725
656
 
726
657
  /**
727
658
  * @notice Gets your balance of the ERC20 token currently set
728
- * as the payment currency for project `_projectId` in the core
729
- * contract `_coreContract`.
730
- * @param _projectId Project ID to be queried.
731
- * @param _coreContract The address of the core contract.
659
+ * as the payment currency for project `projectId` in the core
660
+ * contract `coreContract`.
661
+ * @param projectId Project ID to be queried.
662
+ * @param coreContract The address of the core contract.
732
663
  * @return balance Balance of ERC20
733
664
  */
734
665
  function getYourBalanceOfProjectERC20(
735
- uint256 _projectId,
736
- address _coreContract
666
+ uint256 projectId,
667
+ address coreContract
737
668
  ) external view returns (uint256 balance) {
738
- SplitFundsLib.SplitFundsProjectConfig
739
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
740
- _coreContract
741
- ][_projectId];
742
- balance = SplitFundsLib.getERC20Balance(
743
- _splitFundsProjectConfig.currencyAddress,
744
- msg.sender
669
+ (address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20(
670
+ projectId,
671
+ coreContract
745
672
  );
673
+ balance = SplitFundsLib.getERC20Balance({
674
+ currencyAddress: currencyAddress,
675
+ walletAddress: msg.sender
676
+ });
746
677
  return balance;
747
678
  }
748
679
 
749
680
  /**
750
681
  * @notice Gets your allowance for this minter of the ERC20
751
682
  * token currently set as the payment currency for project
752
- * `_projectId`.
753
- * @param _projectId Project ID to be queried.
754
- * @param _coreContract The address of the core contract.
683
+ * `projectId`.
684
+ * @param projectId Project ID to be queried.
685
+ * @param coreContract The address of the core contract.
755
686
  * @return remaining Remaining allowance of ERC20
756
687
  */
757
688
  function checkYourAllowanceOfProjectERC20(
758
- uint256 _projectId,
759
- address _coreContract
689
+ uint256 projectId,
690
+ address coreContract
760
691
  ) external view returns (uint256 remaining) {
761
- SplitFundsLib.SplitFundsProjectConfig
762
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
763
- _coreContract
764
- ][_projectId];
692
+ (address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20({
693
+ projectId: projectId,
694
+ coreContract: coreContract
695
+ });
765
696
  remaining = SplitFundsLib.getERC20Allowance({
766
- _currencyAddress: _splitFundsProjectConfig.currencyAddress,
767
- _walletAddress: msg.sender,
768
- _spenderAddress: address(this)
697
+ currencyAddress: currencyAddress,
698
+ walletAddress: msg.sender,
699
+ spenderAddress: address(this)
769
700
  });
770
701
  return remaining;
771
702
  }
772
703
 
773
704
  /**
774
705
  * @notice Gets if price of token is configured, price of minting a
775
- * token on project `_projectId`, and currency symbol and address to be
706
+ * token on project `projectId`, and currency symbol and address to be
776
707
  * used as payment.
777
708
  * `isConfigured` is only true if a price has been configured, and an ERC20
778
709
  * token has been configured.
779
- * @param _projectId Project ID to get price information for
780
- * @param _coreContract Contract address of the core contract
710
+ * @param projectId Project ID to get price information for
711
+ * @param coreContract Contract address of the core contract
781
712
  * @return isConfigured true only if token price has been configured on
782
713
  * this minter and an ERC20 token has been configured
783
714
  * @return tokenPriceInWei current price of token on this minter - invalid
784
- * if price has not yet been configured
715
+ * if price has not yet been configured. Note that "in wei" is a misnomer
716
+ * for ERC20 tokens, but is used here for ABI consistency with the ETH
717
+ * minters. The value returned represents the price per token in base units.
718
+ * For example, if the ERC20 token has 6 decimals, an input value of
719
+ * `1_000_000` would represent a price of `1.000000` tokens.
785
720
  * @return currencySymbol currency symbol for purchases of project on this
786
721
  * minter. "UNCONFIG" if not yet configured. Note that currency symbol is
787
722
  * defined by the artist, and is not necessarily the same as the ERC20
@@ -790,8 +725,8 @@ contract MinterSetPricePolyptychERC20V5 is
790
725
  * this minter. Null address if not yet configured.
791
726
  */
792
727
  function getPriceInfo(
793
- uint256 _projectId,
794
- address _coreContract
728
+ uint256 projectId,
729
+ address coreContract
795
730
  )
796
731
  external
797
732
  view
@@ -803,164 +738,173 @@ contract MinterSetPricePolyptychERC20V5 is
803
738
  )
804
739
  {
805
740
  SetPriceLib.SetPriceProjectConfig
806
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
807
- _coreContract
808
- ][_projectId];
809
- tokenPriceInWei = _setPriceProjectConfig.pricePerTokenInWei;
741
+ storage setPriceProjectConfig_ = SetPriceLib
742
+ .getSetPriceProjectConfig({
743
+ projectId: projectId,
744
+ coreContract: coreContract
745
+ });
746
+ tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
810
747
  // get currency info from SplitFundsLib
811
- SplitFundsLib.SplitFundsProjectConfig
812
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
813
- _coreContract
814
- ][_projectId];
815
- (currencyAddress, currencySymbol) = SplitFundsLib.getCurrencyInfoERC20(
816
- _splitFundsProjectConfig
817
- );
748
+ (currencyAddress, currencySymbol) = SplitFundsLib.getCurrencyInfoERC20({
749
+ projectId: projectId,
750
+ coreContract: coreContract
751
+ });
818
752
  // report if price and ERC20 token are configured
819
753
  // @dev currencyAddress is non-zero if an ERC20 token is configured
820
754
  isConfigured =
821
- _setPriceProjectConfig.priceIsConfigured &&
755
+ setPriceProjectConfig_.priceIsConfigured &&
822
756
  currencyAddress != address(0);
823
757
  }
824
758
 
825
759
  /**
826
760
  * Gets the current polyptych panel ID for the given project.
827
- * @param _projectId Project ID to be queried
828
- * @param _coreContract Contract address of the core contract
761
+ * @param projectId Project ID to be queried
762
+ * @param coreContract Contract address of the core contract
829
763
  * @return uint256 representing the current polyptych panel ID for the
830
764
  * given project
831
765
  */
832
766
  function getCurrentPolyptychPanelId(
833
- uint256 _projectId,
834
- address _coreContract
767
+ uint256 projectId,
768
+ address coreContract
835
769
  ) external view returns (uint256) {
836
- PolyptychLib.PolyptychProjectConfig
837
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
838
- _coreContract
839
- ][_projectId];
840
- return PolyptychLib.getPolyptychPanelId(_polyptychProjectConfig);
770
+ return
771
+ PolyptychLib.getPolyptychPanelId({
772
+ projectId: projectId,
773
+ coreContract: coreContract
774
+ });
841
775
  }
842
776
 
843
777
  /**
844
778
  * Gets if the hash seed for the given project has been used on a given
845
779
  * polyptych panel id. The current polyptych panel ID for a given project
846
780
  * can be queried via the view function `getCurrentPolyptychPanelId`.
847
- * @param _projectId Project ID to be queried
848
- * @param _coreContract Contract address of the core contract
849
- * @param _panelId Panel ID to be queried
850
- * @param _hashSeed Hash seed to be queried
781
+ * @param projectId Project ID to be queried
782
+ * @param coreContract Contract address of the core contract
783
+ * @param panelId Panel ID to be queried
784
+ * @param hashSeed Hash seed to be queried
851
785
  * @return bool representing if the hash seed has been used on the given
852
786
  * polyptych panel ID
853
787
  */
854
788
  function getPolyptychPanelHashSeedIsMinted(
855
- uint256 _projectId,
856
- address _coreContract,
857
- uint256 _panelId,
858
- bytes12 _hashSeed
789
+ uint256 projectId,
790
+ address coreContract,
791
+ uint256 panelId,
792
+ bytes12 hashSeed
859
793
  ) external view returns (bool) {
860
- PolyptychLib.PolyptychProjectConfig
861
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
862
- _coreContract
863
- ][_projectId];
864
794
  return
865
- PolyptychLib.getPolyptychPanelHashSeedIsMinted(
866
- _polyptychProjectConfig,
867
- _panelId,
868
- _hashSeed
869
- );
795
+ PolyptychLib.getPolyptychPanelHashSeedIsMinted({
796
+ projectId: projectId,
797
+ coreContract: coreContract,
798
+ panelId: panelId,
799
+ hashSeed: hashSeed
800
+ });
870
801
  }
871
802
 
872
803
  /**
873
- * @notice Syncs local maximum invocations of project `_projectId` based on
804
+ * @notice Syncs local maximum invocations of project `projectId` based on
874
805
  * the value currently defined in the core contract.
875
- * @param _projectId Project ID to set the maximum invocations for.
876
- * @param _coreContract Core contract address for the given project.
806
+ * @param projectId Project ID to set the maximum invocations for.
807
+ * @param coreContract Core contract address for the given project.
877
808
  * @dev this enables gas reduction after maxInvocations have been reached -
878
809
  * core contracts shall still enforce a maxInvocation check during mint.
879
810
  */
880
811
  function syncProjectMaxInvocationsToCore(
881
- uint256 _projectId,
882
- address _coreContract
812
+ uint256 projectId,
813
+ address coreContract
883
814
  ) public {
884
815
  AuthLib.onlyArtist({
885
- _projectId: _projectId,
886
- _coreContract: _coreContract,
887
- _sender: msg.sender
816
+ projectId: projectId,
817
+ coreContract: coreContract,
818
+ sender: msg.sender
888
819
  });
889
820
 
890
- uint256 maxInvocations = MaxInvocationsLib
891
- .syncProjectMaxInvocationsToCore(
892
- _projectId,
893
- _coreContract,
894
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
895
- );
896
- emit ProjectMaxInvocationsLimitUpdated(
897
- _projectId,
898
- _coreContract,
899
- maxInvocations
900
- );
821
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
822
+ projectId: projectId,
823
+ coreContract: coreContract
824
+ });
901
825
  }
902
826
 
903
827
  /**
904
- * @notice Purchases a token from project `_projectId` on core contract
905
- * `_coreContract` using an owned NFT at address `_ownedNFTAddress` and
906
- * token ID `_ownedNFTTokenId` as the parent token.
907
- * Sets the token's owner to `_to`.
908
- * Parent token must be owned by `msg.sender`, or `_vault` if `msg.sender`
909
- * is a valid delegate for `_vault`.
910
- * @param _to Address to be the new token's owner.
911
- * @param _projectId Project ID to mint a token on.
912
- * @param _coreContract Core contract address for the given project.
913
- * @param _ownedNFTAddress ERC-721 NFT holding the project token owned by
914
- * msg.sender or `_vault` being used as the parent token.
915
- * @param _ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender or
916
- * `_vault` being used as the parent token.
828
+ * @notice Purchases a token from project `projectId` on core contract
829
+ * `coreContract` using an owned NFT at address `ownedNFTAddress` and
830
+ * token ID `ownedNFTTokenId` as the parent token.
831
+ * Sets the token's owner to `to`.
832
+ * Parent token must be owned by `msg.sender`, or `vault` if `msg.sender`
833
+ * is a valid delegate for `vault`.
834
+ * @param to Address to be the new token's owner.
835
+ * @param projectId Project ID to mint a token on.
836
+ * @param coreContract Core contract address for the given project.
837
+ * @param maxPricePerToken Maximum price of token being allowed by the
838
+ * purchaser, in base units. For example, if the ERC20 token has 6
839
+ * decimals, an input value of `1_000_000` would represent a maximum price
840
+ * of `1.000000` tokens.
841
+ * @param currencyAddress Currency address of token.
842
+ * @param ownedNFTAddress ERC-721 NFT holding the project token owned by
843
+ * msg.sender or `vault` being used as the parent token.
844
+ * @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender or
845
+ * `vault` being used as the parent token.
917
846
  * @return tokenId Token ID of minted token
918
847
  */
919
848
  function purchaseTo(
920
- address _to,
921
- uint256 _projectId,
922
- address _coreContract,
923
- address _ownedNFTAddress,
924
- uint256 _ownedNFTTokenId,
925
- address _vault
926
- ) public payable nonReentrant returns (uint256 tokenId) {
849
+ address to,
850
+ uint256 projectId,
851
+ address coreContract,
852
+ uint256 maxPricePerToken,
853
+ address currencyAddress,
854
+ address ownedNFTAddress,
855
+ uint256 ownedNFTTokenId,
856
+ address vault
857
+ ) public nonReentrant returns (uint256 tokenId) {
927
858
  // CHECKS
928
- SetPriceLib.SetPriceProjectConfig
929
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
930
- _coreContract
931
- ][_projectId];
932
- MaxInvocationsLib.MaxInvocationsProjectConfig
933
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
934
- _coreContract
935
- ][_projectId];
936
-
859
+ // pre-mint MaxInvocationsLib checks
937
860
  // Note that `maxHasBeenInvoked` is only checked here to reduce gas
938
861
  // consumption after a project has been fully minted.
939
- // `_maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
862
+ // `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
940
863
  // gas consumption, but if not in sync with the core contract's value,
941
864
  // the core contract also enforces its own max invocation check during
942
865
  // minting.
943
- require(
944
- !_maxInvocationsProjectConfig.maxHasBeenInvoked,
945
- "Max invocations reached"
946
- );
866
+ MaxInvocationsLib.preMintChecks({
867
+ projectId: projectId,
868
+ coreContract: coreContract
869
+ });
870
+
871
+ // pre-mint checks for set price lib, and get price per token
872
+ // @dev price per token is loaded into memory here for gas efficiency
873
+ uint256 pricePerToken = SetPriceLib.preMintChecksAndGetPrice({
874
+ projectId: projectId,
875
+ coreContract: coreContract
876
+ });
877
+
878
+ // @dev block scope to avoid stack too deep error
879
+ {
880
+ // get the currency address configured on the project
881
+ // @dev revert occurs during payment split if ERC20 token is not
882
+ // configured (i.e. address(0)), so check is not performed here
883
+ (address configuredCurrencyAddress, ) = SplitFundsLib
884
+ .getCurrencyInfoERC20({
885
+ projectId: projectId,
886
+ coreContract: coreContract
887
+ });
888
+ // validate that the currency address and symbols matches the project configured currency
889
+ require(
890
+ currencyAddress == configuredCurrencyAddress,
891
+ "Currency addresses must match"
892
+ );
893
+ }
947
894
 
948
- // require artist to have configured price of token on this minter
895
+ // validate that the specified maximum price is greater than or equal to the price per token
949
896
  require(
950
- _setPriceProjectConfig.priceIsConfigured,
951
- "Price not configured"
897
+ maxPricePerToken >= pricePerToken,
898
+ "Only max price gte token price"
952
899
  );
953
- // @dev revert occurs during payment split if ERC20 token is not
954
- // configured (i.e. address(0)), so check is not performed here
955
900
 
956
901
  // require token used to claim to be in set of allowlisted NFTs
957
902
  require(
958
903
  TokenHolderLib.isAllowlistedNFT({
959
- holderProjectConfig: _allowedProjectHoldersMapping[
960
- _coreContract
961
- ][_projectId],
962
- _ownedNFTAddress: _ownedNFTAddress,
963
- _ownedNFTTokenId: _ownedNFTTokenId
904
+ projectId: projectId,
905
+ coreContract: coreContract,
906
+ ownedNFTAddress: ownedNFTAddress,
907
+ ownedNFTTokenId: ownedNFTTokenId
964
908
  }),
965
909
  "Only allowlisted NFTs"
966
910
  );
@@ -968,90 +912,86 @@ contract MinterSetPricePolyptychERC20V5 is
968
912
  // NOTE: delegate-vault handling **begins here**.
969
913
 
970
914
  // handle that the vault may be either the `msg.sender` in the case
971
- // that there is not a true vault, or may be `_vault` if one is
915
+ // that there is not a true vault, or may be `vault` if one is
972
916
  // provided explicitly (and it is valid).
973
- address vault = msg.sender;
974
- if (_vault != address(0)) {
917
+ address vault_ = msg.sender;
918
+ if (vault != address(0)) {
975
919
  // If a vault is provided, it must be valid, otherwise throw rather
976
920
  // than optimistically-minting with original `msg.sender`.
977
921
  // Note, we do not check `checkDelegateForAll` or `checkDelegateForContract` as well,
978
922
  // as they are known to be implicitly checked by calling `checkDelegateForToken`.
979
- bool isValidVault = delegationRegistryContract
980
- .checkDelegateForToken(
981
- msg.sender, // delegate
982
- _vault, // vault
983
- _coreContract, // contract
984
- _ownedNFTTokenId // tokenId
985
- );
923
+ bool isValidVault = _delegationRegistryContract
924
+ .checkDelegateForToken({
925
+ delegate: msg.sender,
926
+ vault: vault,
927
+ contract_: coreContract,
928
+ tokenId: ownedNFTTokenId
929
+ });
986
930
  require(isValidVault, "Invalid delegate-vault pairing");
987
- vault = _vault;
931
+ vault_ = vault;
988
932
  }
989
933
 
990
934
  // we need the new token ID in advance of the randomizer setting a token hash
991
935
  IGenArt721CoreContractV3_Base genArtCoreContract = IGenArt721CoreContractV3_Base(
992
- _coreContract
936
+ coreContract
993
937
  );
994
- (uint256 _invocations, , , , , ) = genArtCoreContract.projectStateData(
995
- _projectId
938
+ (uint256 invocations, , , , , ) = genArtCoreContract.projectStateData(
939
+ projectId
996
940
  );
997
941
 
998
942
  // EFFECTS
999
943
 
1000
944
  // we need to store the new token ID before it is minted so the randomizer can query it
1001
- // block scope to avoid stack too deep error
945
+ // @dev block scope to avoid stack too deep error
1002
946
  {
1003
- bytes12 _targetHashSeed = PolyptychLib.getTokenHashSeed(
1004
- _ownedNFTAddress,
1005
- _ownedNFTTokenId
1006
- );
947
+ bytes12 targetHashSeed = PolyptychLib.getTokenHashSeed({
948
+ coreContract: ownedNFTAddress,
949
+ tokenId: ownedNFTTokenId
950
+ });
951
+
952
+ PolyptychLib.validatePolyptychEffects({
953
+ projectId: projectId,
954
+ coreContract: coreContract,
955
+ tokenHashSeed: targetHashSeed
956
+ });
1007
957
 
1008
- // block scope to avoid stack too deep error (nested)
958
+ // @dev block scope to avoid stack too deep error
1009
959
  {
1010
- // validates hash seed and ensures each hash seed used max once per panel
1011
- PolyptychLib.PolyptychProjectConfig
1012
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
1013
- _coreContract
1014
- ][_projectId];
1015
- PolyptychLib.validatePolyptychEffects(
1016
- _polyptychProjectConfig,
1017
- _targetHashSeed
1018
- );
960
+ uint256 newTokenId = (projectId * ONE_MILLION) + invocations;
961
+ PolyptychLib.setPolyptychHashSeed({
962
+ coreContract: coreContract,
963
+ tokenId: newTokenId, // new token ID
964
+ hashSeed: targetHashSeed
965
+ });
1019
966
  }
1020
967
 
1021
- uint256 _newTokenId = (_projectId * ONE_MILLION) + _invocations;
1022
- PolyptychLib.setPolyptychHashSeed({
1023
- _coreContract: _coreContract,
1024
- _tokenId: _newTokenId, // new token ID
1025
- _hashSeed: _targetHashSeed
1026
- });
1027
-
1028
968
  // once mint() is called, the polyptych randomizer will either:
1029
969
  // 1) assign a random token hash
1030
970
  // 2) if configured, obtain the token hash from the `polyptychSeedHashes` mapping
1031
- tokenId = minterFilter.mint_joo(
1032
- _to,
1033
- _projectId,
1034
- _coreContract,
1035
- vault
1036
- );
971
+ tokenId = _minterFilter.mint_joo({
972
+ to: to,
973
+ projectId: projectId,
974
+ coreContract: coreContract,
975
+ sender: vault_
976
+ });
1037
977
 
1038
978
  // NOTE: delegate-vault handling **ends here**.
1039
979
 
1040
980
  // redundant check against reentrancy
1041
981
  PolyptychLib.validateAssignedHashSeed({
1042
- _coreContract: _coreContract,
1043
- _tokenId: tokenId,
1044
- _targetHashSeed: _targetHashSeed
982
+ coreContract: coreContract,
983
+ tokenId: tokenId,
984
+ targetHashSeed: targetHashSeed
1045
985
  });
1046
986
  }
1047
987
 
1048
- MaxInvocationsLib.validatePurchaseEffectsInvocations(
1049
- tokenId,
1050
- _maxInvocationsProjectConfig
1051
- );
988
+ MaxInvocationsLib.validateMintEffectsInvocations({
989
+ tokenId: tokenId,
990
+ coreContract: coreContract
991
+ });
1052
992
 
1053
993
  // INTERACTIONS
1054
- // block scope to avoid stack too deep error
994
+ // @dev block scope to avoid stack too deep error
1055
995
  {
1056
996
  // require proper ownership of NFT used to redeem
1057
997
  /**
@@ -1061,34 +1001,24 @@ contract MinterSetPricePolyptychERC20V5 is
1061
1001
  * function is non-reentrant, so this is extra cautious.
1062
1002
  */
1063
1003
  // @dev if the artist is the sender, then the NFT must be owned by the
1064
- // recipient, otherwise the NFT must be owned by the vault
1004
+ // recipient, otherwise the NFT must be owned by the vault_
1065
1005
  address _artist = genArtCoreContract.projectIdToArtistAddress(
1066
- _projectId
1006
+ projectId
1067
1007
  );
1068
- address targetOwner = (msg.sender == _artist) ? _to : vault;
1008
+ address targetOwner = (msg.sender == _artist) ? to : vault_;
1069
1009
  TokenHolderLib.validateNFTOwnership({
1070
- _ownedNFTAddress: _ownedNFTAddress,
1071
- _ownedNFTTokenId: _ownedNFTTokenId,
1072
- _targetOwner: targetOwner
1010
+ ownedNFTAddress: ownedNFTAddress,
1011
+ ownedNFTTokenId: ownedNFTTokenId,
1012
+ targetOwner: targetOwner
1073
1013
  });
1074
1014
  }
1075
1015
 
1076
1016
  // split funds
1077
- bool isEngine = SplitFundsLib.isEngine(
1078
- _coreContract,
1079
- _isEngineCaches[_coreContract]
1080
- );
1081
1017
  // process payment in ERC20
1082
- SplitFundsLib.SplitFundsProjectConfig
1083
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
1084
- _coreContract
1085
- ][_projectId];
1086
1018
  SplitFundsLib.splitFundsERC20({
1087
- _splitFundsProjectConfig: _splitFundsProjectConfig,
1088
- _projectId: _projectId,
1089
- _pricePerTokenInWei: _setPriceProjectConfig.pricePerTokenInWei,
1090
- _coreContract: _coreContract,
1091
- _isEngine: isEngine
1019
+ projectId: projectId,
1020
+ pricePerToken: pricePerToken,
1021
+ coreContract: coreContract
1092
1022
  });
1093
1023
 
1094
1024
  return tokenId;