@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,18 +1,19 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
- import "../../interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol";
5
- import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
6
- 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;
7
7
 
8
- import "../../libs/v0.8.x/AuthLib.sol";
9
- import "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
10
- import "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
11
- import "../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
8
+ import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
9
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
12
10
 
13
- import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
11
+ import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
12
+ import {SplitFundsLib} from "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
13
+ import {MaxInvocationsLib} from "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
14
+ import {SetPriceLib} from "../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
14
15
 
15
- pragma solidity 0.8.19;
16
+ import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
16
17
 
17
18
  /**
18
19
  * @title Shared, filtered Minter contract that allows tokens to be minted with
@@ -37,17 +38,20 @@ pragma solidity 0.8.19;
37
38
  * ----------------------------------------------------------------------------
38
39
  * Additional admin and artist privileged roles may be described on other
39
40
  * contracts that this minter integrates with.
41
+ * ----------------------------------------------------------------------------
42
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
43
+ * Core Registry to assign this minter, this minter does not enforce that a
44
+ * project is registered when configured or queried. This is primarily for gas
45
+ * optimization purposes. It is, therefore, possible that fake projects may be
46
+ * configured on this minter, but they will not be able to mint tokens due to
47
+ * checks performed by this minter's Minter Filter.
40
48
  */
41
- contract MinterSetPriceERC20V5 is
42
- ReentrancyGuard,
43
- ISharedMinterSimplePurchaseV0,
44
- ISharedMinterV0
45
- {
49
+ contract MinterSetPriceERC20V5 is ReentrancyGuard, ISharedMinterV0 {
46
50
  /// Minter filter address this minter interacts with
47
51
  address public immutable minterFilterAddress;
48
52
 
49
53
  /// Minter filter this minter may interact with.
50
- IMinterFilterV1 private immutable minterFilter;
54
+ IMinterFilterV1 private immutable _minterFilter;
51
55
 
52
56
  /// minterType for this minter
53
57
  string public constant minterType = "MinterSetPriceERC20V5";
@@ -55,45 +59,6 @@ contract MinterSetPriceERC20V5 is
55
59
  /// minter version for this minter
56
60
  string public constant minterVersion = "v5.0.0";
57
61
 
58
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
59
- // STATE VARIABLES FOR SetPriceLib begin here
60
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
61
-
62
- /// contractAddress => projectId => set price project config
63
- mapping(address => mapping(uint256 => SetPriceLib.SetPriceProjectConfig))
64
- private _setPriceProjectConfigMapping;
65
-
66
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
67
- // STATE VARIABLES FOR SetPriceLib end here
68
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
69
-
70
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
71
- // STATE VARIABLES FOR SplitFundsLib begin here
72
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
73
-
74
- // contractAddress => IsEngineCache
75
- mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
76
-
77
- // contractAddress => projectId => SplitFundsProjectConfig
78
- mapping(address => mapping(uint256 => SplitFundsLib.SplitFundsProjectConfig))
79
- private _splitFundsProjectConfigs;
80
-
81
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
82
- // STATE VARIABLES FOR SplitFundsLib end here
83
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
84
-
85
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
86
- // STATE VARIABLES FOR MaxInvocationsLib begin here
87
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
88
-
89
- // contractAddress => projectId => max invocations specific project config
90
- mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
91
- private _maxInvocationsProjectConfigMapping;
92
-
93
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
94
- // STATE VARIABLES FOR MaxInvocationsLib end here
95
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
96
-
97
62
  // MODIFIERS
98
63
  // @dev contract uses modifier-like internal functions instead of modifiers
99
64
  // to reduce contract bytecode size
@@ -101,209 +66,223 @@ contract MinterSetPriceERC20V5 is
101
66
 
102
67
  /**
103
68
  * @notice Initializes contract to be a Filtered Minter for
104
- * `_minterFilter` minter filter.
105
- * @param _minterFilter Minter filter for which this will be a
69
+ * `minterFilter` minter filter.
70
+ * @param minterFilter Minter filter for which this will be a
106
71
  * filtered minter.
107
72
  */
108
- constructor(address _minterFilter) ReentrancyGuard() {
109
- minterFilterAddress = _minterFilter;
110
- minterFilter = IMinterFilterV1(_minterFilter);
73
+ constructor(address minterFilter) ReentrancyGuard() {
74
+ minterFilterAddress = minterFilter;
75
+ _minterFilter = IMinterFilterV1(minterFilter);
111
76
  }
112
77
 
113
78
  /**
114
- * @notice Manually sets the local maximum invocations of project `_projectId`
115
- * with the provided `_maxInvocations`, checking that `_maxInvocations` is less
116
- * than or equal to the value of project `_project_id`'s maximum invocations that is
79
+ * @notice Manually sets the local maximum invocations of project `projectId`
80
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
81
+ * than or equal to the value of project `project_id`'s maximum invocations that is
117
82
  * set on the core contract.
118
- * @dev Note that a `_maxInvocations` of 0 can only be set if the current `invocations`
83
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
119
84
  * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
120
85
  * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
121
- * @param _projectId Project ID to set the maximum invocations for.
122
- * @param _coreContract Core contract address for the given project.
123
- * @param _maxInvocations Maximum invocations to set for the project.
86
+ * @param projectId Project ID to set the maximum invocations for.
87
+ * @param coreContract Core contract address for the given project.
88
+ * @param maxInvocations Maximum invocations to set for the project.
124
89
  */
125
90
  function manuallyLimitProjectMaxInvocations(
126
- uint256 _projectId,
127
- address _coreContract,
128
- uint24 _maxInvocations
91
+ uint256 projectId,
92
+ address coreContract,
93
+ uint24 maxInvocations
129
94
  ) external {
130
95
  AuthLib.onlyArtist({
131
- _projectId: _projectId,
132
- _coreContract: _coreContract,
133
- _sender: msg.sender
96
+ projectId: projectId,
97
+ coreContract: coreContract,
98
+ sender: msg.sender
99
+ });
100
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
101
+ projectId: projectId,
102
+ coreContract: coreContract,
103
+ maxInvocations: maxInvocations
134
104
  });
135
- MaxInvocationsLib.manuallyLimitProjectMaxInvocations(
136
- _projectId,
137
- _coreContract,
138
- _maxInvocations,
139
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
140
- );
141
- emit ProjectMaxInvocationsLimitUpdated(
142
- _projectId,
143
- _coreContract,
144
- _maxInvocations
145
- );
146
105
  }
147
106
 
148
107
  /**
149
- * @notice Updates this minter's price per token of project `_projectId`
150
- * to be '_pricePerTokenInWei`, in Wei.
108
+ * @notice Updates this minter's price per token of project `projectId`
109
+ * to be `pricePerTokenInWei`. Note that "in wei" is a misnomer on this
110
+ * ERC20 minter, but is used for consistency with the ETH minters. The
111
+ * price value represents the ERC20 token price in base units.
151
112
  * @dev Note that it is intentionally supported here that the configured
152
113
  * price may be explicitly set to `0`.
153
- * @param _projectId Project ID to set the price per token for.
154
- * @param _coreContract Core contract address for the given project.
155
- * @param _pricePerTokenInWei Price per token to set for the project, in Wei.
114
+ * @param projectId Project ID to set the price per token for.
115
+ * @param coreContract Core contract address for the given project.
116
+ * @param pricePerTokenInWei Price per token to set for the project.
117
+ * Represents the ERC20 token price in base units. For example, if the
118
+ * ERC20 token has 6 decimals, an input value of `1_000_000` would
119
+ * represent a price of `1.000000` tokens.
156
120
  */
157
121
  function updatePricePerTokenInWei(
158
- uint256 _projectId,
159
- address _coreContract,
160
- uint248 _pricePerTokenInWei
122
+ uint256 projectId,
123
+ address coreContract,
124
+ uint248 pricePerTokenInWei
161
125
  ) external {
162
126
  AuthLib.onlyArtist({
163
- _projectId: _projectId,
164
- _coreContract: _coreContract,
165
- _sender: msg.sender
127
+ projectId: projectId,
128
+ coreContract: coreContract,
129
+ sender: msg.sender
130
+ });
131
+ SetPriceLib.updatePricePerToken({
132
+ projectId: projectId,
133
+ coreContract: coreContract,
134
+ pricePerToken: pricePerTokenInWei
166
135
  });
167
- SetPriceLib.SetPriceProjectConfig
168
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
169
- _coreContract
170
- ][_projectId];
171
- SetPriceLib.updatePricePerTokenInWei(
172
- _pricePerTokenInWei,
173
- _setPriceProjectConfig
174
- );
175
- emit PricePerTokenInWeiUpdated(
176
- _projectId,
177
- _coreContract,
178
- _pricePerTokenInWei
179
- );
180
136
 
181
137
  // for convenience, sync local max invocations to the core contract if
182
138
  // and only if max invocations have not already been synced.
183
139
  // @dev do not sync if max invocations have already been synced, as
184
140
  // local max invocations could have been manually set to be
185
141
  // intentionally less than the core contract's max invocations.
186
- MaxInvocationsLib.MaxInvocationsProjectConfig
187
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
188
- _coreContract
189
- ][_projectId];
190
142
  // @dev if local maxInvocations and maxHasBeenInvoked are both
191
143
  // initial values, we know they have not been populated on this minter
192
144
  if (
193
- MaxInvocationsLib.maxInvocationsIsUnconfigured(
194
- _maxInvocationsProjectConfig
195
- )
145
+ MaxInvocationsLib.maxInvocationsIsUnconfigured({
146
+ projectId: projectId,
147
+ coreContract: coreContract
148
+ })
196
149
  ) {
197
- syncProjectMaxInvocationsToCore(_projectId, _coreContract);
150
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
151
+ projectId: projectId,
152
+ coreContract: coreContract
153
+ });
198
154
  }
199
155
  }
200
156
 
201
157
  /**
202
- * @notice Updates payment currency of project `_projectId` on core
203
- * contract `_coreContract` to be `_currencySymbol` at address
204
- * `_currencyAddress`.
158
+ * @notice Updates payment currency of project `projectId` on core
159
+ * contract `coreContract` to be `currencySymbol` at address
160
+ * `currencyAddress`.
205
161
  * Only supports ERC20 tokens - for ETH minting, use a different minter.
206
- * @param _projectId Project ID to update.
207
- * @param _coreContract Core contract address for the given project.
208
- * @param _currencySymbol Currency symbol.
209
- * @param _currencyAddress Currency address.
162
+ * Resets price to be unconfigured if currency was previously configured,
163
+ * as a safeguard against accidentally setting a price in one currency
164
+ * and then changing the currency but not the price.
165
+ * @dev nonReentrant because no reentrant use cases, and to eliminate an
166
+ * entire branch of reentrancy attack vectors.
167
+ * @param projectId Project ID to update.
168
+ * @param coreContract Core contract address for the given project.
169
+ * @param currencySymbol Currency symbol.
170
+ * @param currencyAddress Currency address.
210
171
  */
211
172
  function updateProjectCurrencyInfo(
212
- uint256 _projectId,
213
- address _coreContract,
214
- string memory _currencySymbol,
215
- address _currencyAddress
173
+ uint256 projectId,
174
+ address coreContract,
175
+ string memory currencySymbol,
176
+ address currencyAddress
216
177
  ) external nonReentrant {
217
178
  AuthLib.onlyArtist({
218
- _projectId: _projectId,
219
- _coreContract: _coreContract,
220
- _sender: msg.sender
221
- });
222
- SplitFundsLib.SplitFundsProjectConfig
223
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
224
- _coreContract
225
- ][_projectId];
226
- SplitFundsLib.updateProjectCurrencyInfoERC20({
227
- _splitFundsProjectConfig: _splitFundsProjectConfig,
228
- _currencySymbol: _currencySymbol,
229
- _currencyAddress: _currencyAddress
230
- });
231
- emit ProjectCurrencyInfoUpdated({
232
- _projectId: _projectId,
233
- _coreContract: _coreContract,
234
- _currencyAddress: _currencyAddress,
235
- _currencySymbol: _currencySymbol
179
+ projectId: projectId,
180
+ coreContract: coreContract,
181
+ sender: msg.sender
236
182
  });
183
+ bool recommendPriceReset = SplitFundsLib
184
+ .updateProjectCurrencyInfoERC20({
185
+ projectId: projectId,
186
+ coreContract: coreContract,
187
+ currencySymbol: currencySymbol,
188
+ currencyAddress: currencyAddress
189
+ });
190
+ if (recommendPriceReset) {
191
+ SetPriceLib.resetPricePerToken({
192
+ projectId: projectId,
193
+ coreContract: coreContract
194
+ });
195
+ }
237
196
  }
238
197
 
239
198
  /**
240
- * @notice Purchases a token from project `_projectId`.
241
- * @param _projectId Project ID to mint a token on.
242
- * @param _coreContract Core contract address for the given project.
199
+ * @notice Purchases a token from project `projectId`.
200
+ * @param projectId Project ID to mint a token on.
201
+ * @param coreContract Core contract address for the given project.
202
+ * @param maxPricePerToken Maximum price of token being allowed by the
203
+ * purchaser, in base units. For example, if the ERC20 token has 6
204
+ * decimals, an input value of `1_000_000` would represent a maximum price
205
+ * of `1.000000` tokens.
206
+ * @param currencyAddress Currency address of token.
243
207
  * @return tokenId Token ID of minted token
244
208
  */
245
209
  function purchase(
246
- uint256 _projectId,
247
- address _coreContract
248
- ) external payable returns (uint256 tokenId) {
249
- tokenId = purchaseTo(msg.sender, _projectId, _coreContract);
210
+ uint256 projectId,
211
+ address coreContract,
212
+ uint256 maxPricePerToken,
213
+ address currencyAddress
214
+ ) external returns (uint256 tokenId) {
215
+ tokenId = purchaseTo({
216
+ to: msg.sender,
217
+ projectId: projectId,
218
+ coreContract: coreContract,
219
+ maxPricePerToken: maxPricePerToken,
220
+ currencyAddress: currencyAddress
221
+ });
250
222
  return tokenId;
251
223
  }
252
224
 
253
225
  // public getter functions
254
226
  /**
255
227
  * @notice Gets the maximum invocations project configuration.
256
- * @param _projectId The ID of the project whose data needs to be fetched.
257
- * @param _coreContract The address of the core contract.
228
+ * @param projectId The ID of the project whose data needs to be fetched.
229
+ * @param coreContract The address of the core contract.
258
230
  * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
259
231
  * configuration data.
260
232
  */
261
233
  function maxInvocationsProjectConfig(
262
- uint256 _projectId,
263
- address _coreContract
234
+ uint256 projectId,
235
+ address coreContract
264
236
  )
265
237
  external
266
238
  view
267
239
  returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
268
240
  {
269
- return _maxInvocationsProjectConfigMapping[_coreContract][_projectId];
241
+ return
242
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
243
+ projectId: projectId,
244
+ coreContract: coreContract
245
+ });
270
246
  }
271
247
 
272
248
  /**
273
249
  * @notice Gets the set price project configuration.
274
- * @param _projectId The ID of the project whose data needs to be fetched.
275
- * @param _coreContract The address of the core contract.
250
+ * @param projectId The ID of the project whose data needs to be fetched.
251
+ * @param coreContract The address of the core contract.
276
252
  * @return SetPriceProjectConfig struct with the fixed price project
277
253
  * configuration data.
278
254
  */
279
255
  function setPriceProjectConfig(
280
- uint256 _projectId,
281
- address _coreContract
256
+ uint256 projectId,
257
+ address coreContract
282
258
  ) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
283
- return _setPriceProjectConfigMapping[_coreContract][_projectId];
259
+ return
260
+ SetPriceLib.getSetPriceProjectConfig({
261
+ projectId: projectId,
262
+ coreContract: coreContract
263
+ });
284
264
  }
285
265
 
286
266
  /**
287
- * @notice Checks if the specified `_coreContract` is a valid engine contract.
288
- * @dev This function retrieves the cached value of `_isEngine` from
267
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
268
+ * @dev This function retrieves the cached value of `isEngine` from
289
269
  * the `isEngineCache` mapping. If the cached value is already set, it
290
- * returns the cached value. Otherwise, it calls the `getV3CoreIsEngine`
291
- * function from the `SplitFundsLib` library to check if `_coreContract`
270
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
271
+ * function from the `SplitFundsLib` library to check if `coreContract`
292
272
  * is a valid engine contract.
293
- * @dev This function will revert if the provided `_coreContract` is not
273
+ * @dev This function will revert if the provided `coreContract` is not
294
274
  * a valid Engine or V3 Flagship contract.
295
- * @param _coreContract The address of the contract to check.
296
- * @return bool indicating if `_coreContract` is a valid engine contract.
275
+ * @param coreContract The address of the contract to check.
276
+ * @return bool indicating if `coreContract` is a valid engine contract.
297
277
  */
298
- function isEngineView(address _coreContract) external view returns (bool) {
299
- SplitFundsLib.IsEngineCache storage isEngineCache = _isEngineCaches[
300
- _coreContract
301
- ];
278
+ function isEngineView(address coreContract) external view returns (bool) {
279
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
280
+ .getIsEngineCacheConfig(coreContract);
302
281
  if (isEngineCache.isCached) {
303
282
  return isEngineCache.isEngine;
304
283
  } else {
305
- // @dev this calls the non-modifying variant of getV3CoreIsEngine
306
- return SplitFundsLib.getV3CoreIsEngineView(_coreContract);
284
+ // @dev this calls the non-state-modifying variant of isEngine
285
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
307
286
  }
308
287
  }
309
288
 
@@ -318,17 +297,18 @@ contract MinterSetPriceERC20V5 is
318
297
  * possible because the V3 core contract only allows maximum invocations
319
298
  * to be reduced, not increased. Based on this rationale, we intentionally
320
299
  * do not do input validation in this method as to whether or not the input
321
- * @param `_projectId` is an existing project ID.
322
- * @param `_coreContract` is an existing core contract address.
300
+ * @param projectId is an existing project ID.
301
+ * @param coreContract is an existing core contract address.
323
302
  */
324
303
  function projectMaxHasBeenInvoked(
325
- uint256 _projectId,
326
- address _coreContract
304
+ uint256 projectId,
305
+ address coreContract
327
306
  ) external view returns (bool) {
328
307
  return
329
- MaxInvocationsLib.getMaxHasBeenInvoked(
330
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
331
- );
308
+ MaxInvocationsLib.getMaxHasBeenInvoked({
309
+ projectId: projectId,
310
+ coreContract: coreContract
311
+ });
332
312
  }
333
313
 
334
314
  /**
@@ -347,79 +327,84 @@ contract MinterSetPriceERC20V5 is
347
327
  * increased. When this happens, the minter will enable minting, allowing
348
328
  * the core contract to enforce the max invocations check. Based on this
349
329
  * rationale, we intentionally do not do input validation in this method as
350
- * to whether or not the input `_projectId` is an existing project ID.
351
- * @param `_projectId` is an existing project ID.
352
- * @param `_coreContract` is an existing core contract address.
330
+ * to whether or not the input `projectId` is an existing project ID.
331
+ * @param projectId is an existing project ID.
332
+ * @param coreContract is an existing core contract address.
353
333
  */
354
334
  function projectMaxInvocations(
355
- uint256 _projectId,
356
- address _coreContract
335
+ uint256 projectId,
336
+ address coreContract
357
337
  ) external view returns (uint256) {
358
338
  return
359
- MaxInvocationsLib.getMaxInvocations(
360
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
361
- );
339
+ MaxInvocationsLib.getMaxInvocations({
340
+ projectId: projectId,
341
+ coreContract: coreContract
342
+ });
362
343
  }
363
344
 
364
345
  /**
365
346
  * @notice Gets your balance of the ERC20 token currently set
366
- * as the payment currency for project `_projectId` in the core
367
- * contract `_coreContract`.
368
- * @param _projectId Project ID to be queried.
369
- * @param _coreContract The address of the core contract.
347
+ * as the payment currency for project `projectId` in the core
348
+ * contract `coreContract`.
349
+ * @param projectId Project ID to be queried.
350
+ * @param coreContract The address of the core contract.
370
351
  * @return balance Balance of ERC20
371
352
  */
372
353
  function getYourBalanceOfProjectERC20(
373
- uint256 _projectId,
374
- address _coreContract
354
+ uint256 projectId,
355
+ address coreContract
375
356
  ) external view returns (uint256 balance) {
376
- SplitFundsLib.SplitFundsProjectConfig
377
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
378
- _coreContract
379
- ][_projectId];
380
- balance = SplitFundsLib.getERC20Balance(
381
- _splitFundsProjectConfig.currencyAddress,
382
- msg.sender
383
- );
357
+ (address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20({
358
+ projectId: projectId,
359
+ coreContract: coreContract
360
+ });
361
+ balance = SplitFundsLib.getERC20Balance({
362
+ currencyAddress: currencyAddress,
363
+ walletAddress: msg.sender
364
+ });
384
365
  return balance;
385
366
  }
386
367
 
387
368
  /**
388
369
  * @notice Gets your allowance for this minter of the ERC20
389
370
  * token currently set as the payment currency for project
390
- * `_projectId`.
391
- * @param _projectId Project ID to be queried.
392
- * @param _coreContract The address of the core contract.
371
+ * `projectId`.
372
+ * @param projectId Project ID to be queried.
373
+ * @param coreContract The address of the core contract.
393
374
  * @return remaining Remaining allowance of ERC20
394
375
  */
395
376
  function checkYourAllowanceOfProjectERC20(
396
- uint256 _projectId,
397
- address _coreContract
377
+ uint256 projectId,
378
+ address coreContract
398
379
  ) external view returns (uint256 remaining) {
399
- SplitFundsLib.SplitFundsProjectConfig
400
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
401
- _coreContract
402
- ][_projectId];
380
+ (address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20({
381
+ projectId: projectId,
382
+ coreContract: coreContract
383
+ });
403
384
  remaining = SplitFundsLib.getERC20Allowance({
404
- _currencyAddress: _splitFundsProjectConfig.currencyAddress,
405
- _walletAddress: msg.sender,
406
- _spenderAddress: address(this)
385
+ currencyAddress: currencyAddress,
386
+ walletAddress: msg.sender,
387
+ spenderAddress: address(this)
407
388
  });
408
389
  return remaining;
409
390
  }
410
391
 
411
392
  /**
412
393
  * @notice Gets if price of token is configured, price of minting a
413
- * token on project `_projectId`, and currency symbol and address to be
394
+ * token on project `projectId`, and currency symbol and address to be
414
395
  * used as payment.
415
396
  * `isConfigured` is only true if a price has been configured, and an ERC20
416
397
  * token has been configured.
417
- * @param _projectId Project ID to get price information for
418
- * @param _coreContract Contract address of the core contract
398
+ * @param projectId Project ID to get price information for
399
+ * @param coreContract Contract address of the core contract
419
400
  * @return isConfigured true only if token price has been configured on
420
401
  * this minter and an ERC20 token has been configured
421
402
  * @return tokenPriceInWei current price of token on this minter - invalid
422
- * if price has not yet been configured
403
+ * if price has not yet been configured. Note that "in wei" is a misnomer
404
+ * for ERC20 tokens, but is used here for ABI consistency with the ETH
405
+ * minters. The value returned represents the price per token in base units.
406
+ * For example, if the ERC20 token has 6 decimals, an input value of
407
+ * `1_000_000` would represent a price of `1.000000` tokens.
423
408
  * @return currencySymbol currency symbol for purchases of project on this
424
409
  * minter. "UNCONFIG" if not yet configured. Note that currency symbol is
425
410
  * defined by the artist, and is not necessarily the same as the ERC20
@@ -428,8 +413,8 @@ contract MinterSetPriceERC20V5 is
428
413
  * this minter. Null address if not yet configured.
429
414
  */
430
415
  function getPriceInfo(
431
- uint256 _projectId,
432
- address _coreContract
416
+ uint256 projectId,
417
+ address coreContract
433
418
  )
434
419
  external
435
420
  view
@@ -441,128 +426,127 @@ contract MinterSetPriceERC20V5 is
441
426
  )
442
427
  {
443
428
  SetPriceLib.SetPriceProjectConfig
444
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
445
- _coreContract
446
- ][_projectId];
447
- tokenPriceInWei = _setPriceProjectConfig.pricePerTokenInWei;
448
- // get currency info from SplitFundsLib
449
- SplitFundsLib.SplitFundsProjectConfig
450
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
451
- _coreContract
452
- ][_projectId];
453
- (currencyAddress, currencySymbol) = SplitFundsLib.getCurrencyInfoERC20(
454
- _splitFundsProjectConfig
455
- );
429
+ storage setPriceProjectConfig_ = SetPriceLib
430
+ .getSetPriceProjectConfig({
431
+ projectId: projectId,
432
+ coreContract: coreContract
433
+ });
434
+ tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
435
+ (currencyAddress, currencySymbol) = SplitFundsLib.getCurrencyInfoERC20({
436
+ projectId: projectId,
437
+ coreContract: coreContract
438
+ });
456
439
  // report if price and ERC20 token are configured
457
440
  // @dev currencyAddress is non-zero if an ERC20 token is configured
458
441
  isConfigured =
459
- _setPriceProjectConfig.priceIsConfigured &&
442
+ setPriceProjectConfig_.priceIsConfigured &&
460
443
  currencyAddress != address(0);
461
444
  }
462
445
 
463
446
  /**
464
- * @notice Syncs local maximum invocations of project `_projectId` based on
447
+ * @notice Syncs local maximum invocations of project `projectId` based on
465
448
  * the value currently defined in the core contract.
466
- * @param _projectId Project ID to set the maximum invocations for.
467
- * @param _coreContract Core contract address for the given project.
449
+ * @param projectId Project ID to set the maximum invocations for.
450
+ * @param coreContract Core contract address for the given project.
468
451
  * @dev this enables gas reduction after maxInvocations have been reached -
469
452
  * core contracts shall still enforce a maxInvocation check during mint.
470
453
  */
471
454
  function syncProjectMaxInvocationsToCore(
472
- uint256 _projectId,
473
- address _coreContract
455
+ uint256 projectId,
456
+ address coreContract
474
457
  ) public {
475
458
  AuthLib.onlyArtist({
476
- _projectId: _projectId,
477
- _coreContract: _coreContract,
478
- _sender: msg.sender
459
+ projectId: projectId,
460
+ coreContract: coreContract,
461
+ sender: msg.sender
479
462
  });
480
463
 
481
- uint256 maxInvocations = MaxInvocationsLib
482
- .syncProjectMaxInvocationsToCore(
483
- _projectId,
484
- _coreContract,
485
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
486
- );
487
- emit ProjectMaxInvocationsLimitUpdated(
488
- _projectId,
489
- _coreContract,
490
- maxInvocations
491
- );
464
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
465
+ projectId: projectId,
466
+ coreContract: coreContract
467
+ });
492
468
  }
493
469
 
494
470
  /**
495
- * @notice Purchases a token from project `_projectId` and sets
496
- * the token's owner to `_to`.
497
- * @param _to Address to be the new token's owner.
498
- * @param _projectId Project ID to mint a token on.
499
- * @param _coreContract Core contract address for the given project.
471
+ * @notice Purchases a token from project `projectId` and sets
472
+ * the token's owner to `to`.
473
+ * @param to Address to be the new token's owner.
474
+ * @param projectId Project ID to mint a token on.
475
+ * @param coreContract Core contract address for the given project.
476
+ * @param maxPricePerToken Maximum price of token being allowed by the
477
+ * purchaser, in base units. For example, if the ERC20 token has 6
478
+ * decimals, an input value of `1_000_000` would represent a maximum price
479
+ * of `1.000000` tokens.
480
+ * @param currencyAddress Currency address of token.
500
481
  * @return tokenId Token ID of minted token
501
482
  */
502
483
  function purchaseTo(
503
- address _to,
504
- uint256 _projectId,
505
- address _coreContract
506
- ) public payable nonReentrant returns (uint256 tokenId) {
484
+ address to,
485
+ uint256 projectId,
486
+ address coreContract,
487
+ uint256 maxPricePerToken,
488
+ address currencyAddress
489
+ ) public nonReentrant returns (uint256 tokenId) {
507
490
  // CHECKS
508
- SetPriceLib.SetPriceProjectConfig
509
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
510
- _coreContract
511
- ][_projectId];
512
- MaxInvocationsLib.MaxInvocationsProjectConfig
513
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
514
- _coreContract
515
- ][_projectId];
516
-
491
+ // pre-mint MaxInvocationsLib checks
517
492
  // Note that `maxHasBeenInvoked` is only checked here to reduce gas
518
493
  // consumption after a project has been fully minted.
519
- // `_maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
494
+ // `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
520
495
  // gas consumption, but if not in sync with the core contract's value,
521
496
  // the core contract also enforces its own max invocation check during
522
497
  // minting.
498
+ MaxInvocationsLib.preMintChecks({
499
+ projectId: projectId,
500
+ coreContract: coreContract
501
+ });
502
+
503
+ // pre-mint checks for set price lib, and get price per token
504
+ // @dev price per token is loaded into memory here for gas efficiency
505
+ uint256 pricePerToken = SetPriceLib.preMintChecksAndGetPrice({
506
+ projectId: projectId,
507
+ coreContract: coreContract
508
+ });
509
+
510
+ // get the currency address configured on the project
511
+ // @dev revert occurs during payment split if ERC20 token is not
512
+ // configured (i.e. address(0)), so check is not performed here
513
+ (address configuredCurrencyAddress, ) = SplitFundsLib
514
+ .getCurrencyInfoERC20({
515
+ projectId: projectId,
516
+ coreContract: coreContract
517
+ });
518
+
519
+ // validate that the currency address matches the project configured currency
523
520
  require(
524
- !_maxInvocationsProjectConfig.maxHasBeenInvoked,
525
- "Max invocations reached"
521
+ currencyAddress == configuredCurrencyAddress,
522
+ "Currency addresses must match"
526
523
  );
527
524
 
528
- // require artist to have configured price of token on this minter
525
+ // validate that the specified maximum price is greater than or equal to the price per token
529
526
  require(
530
- _setPriceProjectConfig.priceIsConfigured,
531
- "Price not configured"
527
+ maxPricePerToken >= pricePerToken,
528
+ "Only max price gte token price"
532
529
  );
533
- // @dev revert occurs during payment split if ERC20 token is not
534
- // configured (i.e. address(0)), so check is not performed here
535
530
 
536
531
  // EFFECTS
537
- tokenId = minterFilter.mint_joo(
538
- _to,
539
- _projectId,
540
- _coreContract,
541
- msg.sender
542
- );
532
+ tokenId = _minterFilter.mint_joo({
533
+ to: to,
534
+ projectId: projectId,
535
+ coreContract: coreContract,
536
+ sender: msg.sender
537
+ });
543
538
 
544
- MaxInvocationsLib.validatePurchaseEffectsInvocations(
545
- tokenId,
546
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
547
- );
539
+ MaxInvocationsLib.validateMintEffectsInvocations({
540
+ tokenId: tokenId,
541
+ coreContract: coreContract
542
+ });
548
543
 
549
544
  // INTERACTIONS
550
545
  // split ERC20 funds
551
- bool isEngine = SplitFundsLib.isEngine(
552
- _coreContract,
553
- _isEngineCaches[_coreContract]
554
- );
555
- // process payment in ERC20
556
- SplitFundsLib.SplitFundsProjectConfig
557
- storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
558
- _coreContract
559
- ][_projectId];
560
546
  SplitFundsLib.splitFundsERC20({
561
- _splitFundsProjectConfig: _splitFundsProjectConfig,
562
- _projectId: _projectId,
563
- _pricePerTokenInWei: _setPriceProjectConfig.pricePerTokenInWei,
564
- _coreContract: _coreContract,
565
- _isEngine: isEngine
547
+ projectId: projectId,
548
+ pricePerToken: pricePerToken,
549
+ coreContract: coreContract
566
550
  });
567
551
 
568
552
  return tokenId;