@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,20 +1,22 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
- import "../../interfaces/v0.8.x/IDelegationRegistry.sol";
5
- import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
6
- import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
7
- import "../../interfaces/v0.8.x/ISharedMinterMerkleV0.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;
8
7
 
9
- import "../../libs/v0.8.x/AuthLib.sol";
10
- import "../../libs/v0.8.x/minter-libs/MerkleLib.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";
8
+ import {IDelegationRegistry} from "../../interfaces/v0.8.x/IDelegationRegistry.sol";
9
+ import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
10
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
11
+ import {ISharedMinterMerkleV0} from "../../interfaces/v0.8.x/ISharedMinterMerkleV0.sol";
14
12
 
15
- import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
13
+ import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
14
+ import {MerkleLib} from "../../libs/v0.8.x/minter-libs/MerkleLib.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";
16
18
 
17
- pragma solidity 0.8.19;
19
+ import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
18
20
 
19
21
  /**
20
22
  * @title Shared, filtered Minter contract that allows tokens to be minted with
@@ -53,6 +55,13 @@ pragma solidity 0.8.19;
53
55
  * Token-level delegations are configured by the vault owner, and contract-
54
56
  * level delegations must be configured for the core token contract as returned
55
57
  * by the public immutable variable `genArt721CoreAddress`.
58
+ * ----------------------------------------------------------------------------
59
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
60
+ * Core Registry to assign this minter, this minter does not enforce that a
61
+ * project is registered when configured or queried. This is primarily for gas
62
+ * optimization purposes. It is, therefore, possible that fake projects may be
63
+ * configured on this minter, but they will not be able to mint tokens due to
64
+ * checks performed by this minter's Minter Filter.
56
65
  */
57
66
  contract MinterSetPriceMerkleV5 is
58
67
  ReentrancyGuard,
@@ -63,7 +72,7 @@ contract MinterSetPriceMerkleV5 is
63
72
  address public immutable minterFilterAddress;
64
73
 
65
74
  /// Minter filter this minter may interact with.
66
- IMinterFilterV1 private immutable minterFilter;
75
+ IMinterFilterV1 private immutable _minterFilter;
67
76
 
68
77
  /// minterType for this minter
69
78
  string public constant minterType = "MinterSetPriceMerkleV5";
@@ -74,54 +83,7 @@ contract MinterSetPriceMerkleV5 is
74
83
  /// Delegation registry address
75
84
  address public immutable delegationRegistryAddress;
76
85
  /// Delegation registry address
77
- IDelegationRegistry private immutable delegationRegistryContract;
78
-
79
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
80
- // STATE VARIABLES FOR SetPriceLib begin here
81
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
82
-
83
- /// contractAddress => projectId => set price project config
84
- mapping(address => mapping(uint256 => SetPriceLib.SetPriceProjectConfig))
85
- private _setPriceProjectConfigMapping;
86
-
87
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
88
- // STATE VARIABLES FOR SetPriceLib end here
89
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
90
-
91
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
92
- // STATE VARIABLES FOR SplitFundsLib begin here
93
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
94
-
95
- // contractAddress => IsEngineCache
96
- mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
97
-
98
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
99
- // STATE VARIABLES FOR SplitFundsLib end here
100
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
101
-
102
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
103
- // STATE VARIABLES FOR MerkleLib begin here
104
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
105
-
106
- /// contractAddress => projectId => merkle specific project config
107
- mapping(address => mapping(uint256 => MerkleLib.MerkleProjectConfig))
108
- private _merkleProjectConfigMapping;
109
-
110
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
111
- // STATE VARIABLES FOR MerkleLib end here
112
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
113
-
114
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
115
- // STATE VARIABLES FOR MaxInvocationsLib begin here
116
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
117
-
118
- /// contractAddress => projectId => max invocations specific project config
119
- mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
120
- private _maxInvocationsProjectConfigMapping;
121
-
122
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
123
- // STATE VARIABLES FOR MaxInvocationsLib end here
124
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
86
+ IDelegationRegistry private immutable _delegationRegistryContract;
125
87
 
126
88
  // MODIFIERS
127
89
  // @dev contract uses modifier-like internal functions instead of modifiers
@@ -130,281 +92,266 @@ contract MinterSetPriceMerkleV5 is
130
92
 
131
93
  /**
132
94
  * @notice Initializes contract to be a Filtered Minter for
133
- * `_minterFilter` minter filter.
134
- * @param _minterFilter Minter filter for which this will be a
95
+ * `minterFilter` minter filter.
96
+ * @param minterFilter Minter filter for which this will be a
135
97
  * filtered minter.
136
- * @param _delegationRegistryAddress Delegation registry contract address.
98
+ * @param delegationRegistryAddress_ Delegation registry contract address.
137
99
  */
138
100
  constructor(
139
- address _minterFilter,
140
- address _delegationRegistryAddress
101
+ address minterFilter,
102
+ address delegationRegistryAddress_
141
103
  ) ReentrancyGuard() {
142
- minterFilterAddress = _minterFilter;
143
- minterFilter = IMinterFilterV1(_minterFilter);
104
+ minterFilterAddress = minterFilter;
105
+ _minterFilter = IMinterFilterV1(minterFilter);
144
106
 
145
- delegationRegistryAddress = _delegationRegistryAddress;
146
- delegationRegistryContract = IDelegationRegistry(
147
- _delegationRegistryAddress
107
+ delegationRegistryAddress = delegationRegistryAddress_;
108
+ _delegationRegistryContract = IDelegationRegistry(
109
+ delegationRegistryAddress_
148
110
  );
149
- emit DelegationRegistryUpdated(_delegationRegistryAddress);
111
+ emit MerkleLib.DelegationRegistryUpdated(delegationRegistryAddress_);
150
112
  // broadcast default max invocations per address for this minter
151
- emit DefaultMaxInvocationsPerAddress(
113
+ emit MerkleLib.DefaultMaxInvocationsPerAddress(
152
114
  MerkleLib.DEFAULT_MAX_INVOCATIONS_PER_ADDRESS
153
115
  );
154
116
  }
155
117
 
156
118
  /**
157
- * @notice Manually sets the local maximum invocations of project `_projectId`
158
- * with the provided `_maxInvocations`, checking that `_maxInvocations` is less
159
- * than or equal to the value of project `_project_id`'s maximum invocations that is
119
+ * @notice Manually sets the local maximum invocations of project `projectId`
120
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
121
+ * than or equal to the value of project `project_id`'s maximum invocations that is
160
122
  * set on the core contract.
161
- * @dev Note that a `_maxInvocations` of 0 can only be set if the current `invocations`
123
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
162
124
  * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
163
125
  * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
164
- * @param _projectId Project ID to set the maximum invocations for.
165
- * @param _coreContract Core contract address for the given project.
166
- * @param _maxInvocations Maximum invocations to set for the project.
126
+ * @param projectId Project ID to set the maximum invocations for.
127
+ * @param coreContract Core contract address for the given project.
128
+ * @param maxInvocations Maximum invocations to set for the project.
167
129
  */
168
130
  function manuallyLimitProjectMaxInvocations(
169
- uint256 _projectId,
170
- address _coreContract,
171
- uint24 _maxInvocations
131
+ uint256 projectId,
132
+ address coreContract,
133
+ uint24 maxInvocations
172
134
  ) external {
173
135
  AuthLib.onlyArtist({
174
- _projectId: _projectId,
175
- _coreContract: _coreContract,
176
- _sender: msg.sender
136
+ projectId: projectId,
137
+ coreContract: coreContract,
138
+ sender: msg.sender
139
+ });
140
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
141
+ projectId: projectId,
142
+ coreContract: coreContract,
143
+ maxInvocations: maxInvocations
177
144
  });
178
- MaxInvocationsLib.manuallyLimitProjectMaxInvocations(
179
- _projectId,
180
- _coreContract,
181
- _maxInvocations,
182
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
183
- );
184
- emit ProjectMaxInvocationsLimitUpdated(
185
- _projectId,
186
- _coreContract,
187
- _maxInvocations
188
- );
189
145
  }
190
146
 
191
147
  /**
192
- * @notice Updates this minter's price per token of project `_projectId`
148
+ * @notice Updates this minter's price per token of project `projectId`
193
149
  * to be '_pricePerTokenInWei`, in Wei.
194
150
  * @dev Note that it is intentionally supported here that the configured
195
151
  * price may be explicitly set to `0`.
196
- * @param _projectId Project ID to set the price per token for.
197
- * @param _coreContract Core contract address for the given project.
198
- * @param _pricePerTokenInWei Price per token to set for the project, in Wei.
152
+ * @param projectId Project ID to set the price per token for.
153
+ * @param coreContract Core contract address for the given project.
154
+ * @param pricePerTokenInWei Price per token to set for the project, in Wei.
199
155
  */
200
156
  function updatePricePerTokenInWei(
201
- uint256 _projectId,
202
- address _coreContract,
203
- uint248 _pricePerTokenInWei
157
+ uint256 projectId,
158
+ address coreContract,
159
+ uint248 pricePerTokenInWei
204
160
  ) external {
205
161
  AuthLib.onlyArtist({
206
- _projectId: _projectId,
207
- _coreContract: _coreContract,
208
- _sender: msg.sender
162
+ projectId: projectId,
163
+ coreContract: coreContract,
164
+ sender: msg.sender
165
+ });
166
+ SetPriceLib.updatePricePerToken({
167
+ projectId: projectId,
168
+ coreContract: coreContract,
169
+ pricePerToken: pricePerTokenInWei
209
170
  });
210
- SetPriceLib.SetPriceProjectConfig
211
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
212
- _coreContract
213
- ][_projectId];
214
- SetPriceLib.updatePricePerTokenInWei(
215
- _pricePerTokenInWei,
216
- _setPriceProjectConfig
217
- );
218
- emit PricePerTokenInWeiUpdated(
219
- _projectId,
220
- _coreContract,
221
- _pricePerTokenInWei
222
- );
223
171
 
224
172
  // for convenience, sync local max invocations to the core contract if
225
173
  // and only if max invocations have not already been synced.
226
174
  // @dev do not sync if max invocations have already been synced, as
227
175
  // local max invocations could have been manually set to be
228
176
  // intentionally less than the core contract's max invocations.
229
- MaxInvocationsLib.MaxInvocationsProjectConfig
230
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
231
- _coreContract
232
- ][_projectId];
233
177
  // @dev if local maxInvocations and maxHasBeenInvoked are both
234
178
  // initial values, we know they have not been populated on this minter
235
179
  if (
236
- MaxInvocationsLib.maxInvocationsIsUnconfigured(
237
- _maxInvocationsProjectConfig
238
- )
180
+ MaxInvocationsLib.maxInvocationsIsUnconfigured({
181
+ projectId: projectId,
182
+ coreContract: coreContract
183
+ })
239
184
  ) {
240
- syncProjectMaxInvocationsToCore(_projectId, _coreContract);
185
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
186
+ projectId: projectId,
187
+ coreContract: coreContract
188
+ });
241
189
  }
242
190
  }
243
191
 
244
192
  /**
245
- * @notice Update the Merkle root for project `_projectId` on core contract `_coreContract`.
246
- * @param _projectId Project ID to be updated.
247
- * @param _coreContract Core contract address for the given project.
248
- * @param _root root of Merkle tree defining addresses allowed to mint
249
- * on project `_projectId`.
193
+ * @notice Update the Merkle root for project `projectId` on core contract `coreContract`.
194
+ * @param projectId Project ID to be updated.
195
+ * @param coreContract Core contract address for the given project.
196
+ * @param root root of Merkle tree defining addresses allowed to mint
197
+ * on project `projectId`.
250
198
  */
251
199
  function updateMerkleRoot(
252
- uint256 _projectId,
253
- address _coreContract,
254
- bytes32 _root
200
+ uint256 projectId,
201
+ address coreContract,
202
+ bytes32 root
255
203
  ) external {
256
204
  AuthLib.onlyArtist({
257
- _projectId: _projectId,
258
- _coreContract: _coreContract,
259
- _sender: msg.sender
205
+ projectId: projectId,
206
+ coreContract: coreContract,
207
+ sender: msg.sender
208
+ });
209
+ MerkleLib.updateMerkleRoot({
210
+ projectId: projectId,
211
+ coreContract: coreContract,
212
+ root: root
260
213
  });
261
- require(_root != bytes32(0), "Root must be provided");
262
- MerkleLib.updateMerkleRoot(
263
- _merkleProjectConfigMapping[_coreContract][_projectId],
264
- _root
265
- );
266
- emit ConfigValueSet(
267
- _projectId,
268
- _coreContract,
269
- MerkleLib.CONFIG_MERKLE_ROOT,
270
- _root
271
- );
272
214
  }
273
215
 
274
216
  /**
275
217
  * @notice Sets maximum allowed invocations per allowlisted address for
276
- * project `_project` to `limit`. If `limit` is set to 0, allowlisted
218
+ * project `project` to `limit`. If `limit` is set to 0, allowlisted
277
219
  * addresses will be able to mint as many times as desired, until the
278
220
  * project reaches its maximum invocations.
279
221
  * Default is a value of 1 if never configured by artist.
280
- * @param _projectId Project ID to toggle the mint limit.
281
- * @param _coreContract Core contract address for the given project.
282
- * @param _maxInvocationsPerAddress Maximum allowed invocations per
222
+ * @param projectId Project ID to toggle the mint limit.
223
+ * @param coreContract Core contract address for the given project.
224
+ * @param maxInvocationsPerAddress Maximum allowed invocations per
283
225
  * allowlisted address.
284
226
  * @dev default value stated above must be updated if the value of
285
227
  * CONFIG_USE_MAX_INVOCATIONS_PER_ADDRESS_OVERRIDE is changed.
286
228
  */
287
229
  function setProjectInvocationsPerAddress(
288
- uint256 _projectId,
289
- address _coreContract,
290
- uint24 _maxInvocationsPerAddress
230
+ uint256 projectId,
231
+ address coreContract,
232
+ uint24 maxInvocationsPerAddress
291
233
  ) external {
292
234
  AuthLib.onlyArtist({
293
- _projectId: _projectId,
294
- _coreContract: _coreContract,
295
- _sender: msg.sender
235
+ projectId: projectId,
236
+ coreContract: coreContract,
237
+ sender: msg.sender
238
+ });
239
+ MerkleLib.setProjectInvocationsPerAddress({
240
+ projectId: projectId,
241
+ coreContract: coreContract,
242
+ maxInvocationsPerAddress: maxInvocationsPerAddress
296
243
  });
297
- MerkleLib.setProjectInvocationsPerAddress(
298
- _merkleProjectConfigMapping[_coreContract][_projectId],
299
- _maxInvocationsPerAddress
300
- );
301
- emit ConfigValueSet(
302
- _projectId,
303
- _coreContract,
304
- MerkleLib.CONFIG_USE_MAX_INVOCATIONS_PER_ADDRESS_OVERRIDE,
305
- true
306
- );
307
- emit ConfigValueSet(
308
- _projectId,
309
- _coreContract,
310
- MerkleLib.CONFIG_MAX_INVOCATIONS_OVERRIDE,
311
- uint256(_maxInvocationsPerAddress)
312
- );
313
244
  }
314
245
 
315
246
  /**
316
- * @notice Purchases a token from project `_projectId`.
317
- * @param _projectId Project ID to mint a token on.
318
- * @param _coreContract Core contract address for the given project.
319
- * @param _proof Merkle proof for the given project.
247
+ * @notice Purchases a token from project `projectId`.
248
+ * @param projectId Project ID to mint a token on.
249
+ * @param coreContract Core contract address for the given project.
250
+ * @param proof Merkle proof for the given project.
320
251
  * @return tokenId Token ID of minted token
321
252
  */
322
253
  function purchase(
323
- uint256 _projectId,
324
- address _coreContract,
325
- bytes32[] calldata _proof
254
+ uint256 projectId,
255
+ address coreContract,
256
+ bytes32[] calldata proof
326
257
  ) external payable returns (uint256 tokenId) {
327
- tokenId = purchaseTo(
328
- msg.sender,
329
- _projectId,
330
- _coreContract,
331
- _proof,
332
- address(0)
333
- );
258
+ tokenId = purchaseTo({
259
+ to: msg.sender,
260
+ projectId: projectId,
261
+ coreContract: coreContract,
262
+ proof: proof,
263
+ vault: address(0)
264
+ });
334
265
  return tokenId;
335
266
  }
336
267
 
337
268
  /**
338
- * @notice Purchases a token from project `_projectId` and sets
339
- * the token's owner to `_to`.
340
- * @param _to Address to be the new token's owner.
341
- * @param _projectId Project ID to mint a token on.
342
- * @param _coreContract Contract address of the core contract.
343
- * @param _proof Merkle proof for the given project.
269
+ * @notice Purchases a token from project `projectId` and sets
270
+ * the token's owner to `to`.
271
+ * @param to Address to be the new token's owner.
272
+ * @param projectId Project ID to mint a token on.
273
+ * @param coreContract Contract address of the core contract.
274
+ * @param proof Merkle proof for the given project.
344
275
  * @return tokenId Token ID of minted token
345
276
  */
346
277
  function purchaseTo(
347
- address _to,
348
- uint256 _projectId,
349
- address _coreContract,
350
- bytes32[] calldata _proof
278
+ address to,
279
+ uint256 projectId,
280
+ address coreContract,
281
+ bytes32[] calldata proof
351
282
  ) external payable returns (uint256 tokenId) {
352
- return purchaseTo(_to, _projectId, _coreContract, _proof, address(0));
283
+ return
284
+ purchaseTo({
285
+ to: to,
286
+ projectId: projectId,
287
+ coreContract: coreContract,
288
+ proof: proof,
289
+ vault: address(0)
290
+ });
353
291
  }
354
292
 
355
293
  // public getter functions
356
294
  /**
357
295
  * @notice Gets the maximum invocations project configuration.
358
- * @param _projectId The ID of the project whose data needs to be fetched.
359
- * @param _coreContract The address of the core contract.
296
+ * @param projectId The ID of the project whose data needs to be fetched.
297
+ * @param coreContract The address of the core contract.
360
298
  * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
361
299
  * configuration data.
362
300
  */
363
301
  function maxInvocationsProjectConfig(
364
- uint256 _projectId,
365
- address _coreContract
302
+ uint256 projectId,
303
+ address coreContract
366
304
  )
367
305
  external
368
306
  view
369
307
  returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
370
308
  {
371
- return _maxInvocationsProjectConfigMapping[_coreContract][_projectId];
309
+ return
310
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
311
+ projectId: projectId,
312
+ coreContract: coreContract
313
+ });
372
314
  }
373
315
 
374
316
  /**
375
317
  * @notice Gets the set price project configuration.
376
- * @param _projectId The ID of the project whose data needs to be fetched.
377
- * @param _coreContract The address of the core contract.
318
+ * @param projectId The ID of the project whose data needs to be fetched.
319
+ * @param coreContract The address of the core contract.
378
320
  * @return SetPriceProjectConfig struct with the fixed price project
379
321
  * configuration data.
380
322
  */
381
323
  function setPriceProjectConfig(
382
- uint256 _projectId,
383
- address _coreContract
324
+ uint256 projectId,
325
+ address coreContract
384
326
  ) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
385
- return _setPriceProjectConfigMapping[_coreContract][_projectId];
327
+ return
328
+ SetPriceLib.getSetPriceProjectConfig({
329
+ projectId: projectId,
330
+ coreContract: coreContract
331
+ });
386
332
  }
387
333
 
388
334
  /**
389
335
  * @notice Retrieves the Merkle project configuration for a given contract and project.
390
336
  * @dev This function fetches the Merkle project configuration from the
391
337
  * merkleProjectConfigMapping using the provided core contract address and project ID.
392
- * @param _projectId The ID of the project.
393
- * @param _coreContract The address of the core contract.
338
+ * @param projectId The ID of the project.
339
+ * @param coreContract The address of the core contract.
394
340
  * @return MerkleLib.MerkleProjectConfig The Merkle project configuration.
395
341
  */
396
342
  function merkleProjectConfig(
397
- uint256 _projectId,
398
- address _coreContract
343
+ uint256 projectId,
344
+ address coreContract
399
345
  ) external view returns (bool, uint24, bytes32) {
400
- MerkleLib.MerkleProjectConfig
401
- storage _merkleProjectConfig = _merkleProjectConfigMapping[
402
- _coreContract
403
- ][_projectId];
346
+ MerkleLib.MerkleProjectConfig storage merkleProjectConfig_ = MerkleLib
347
+ .getMerkleProjectConfig({
348
+ projectId: projectId,
349
+ coreContract: coreContract
350
+ });
404
351
  return (
405
- _merkleProjectConfig.useMaxInvocationsPerAddressOverride,
406
- _merkleProjectConfig.maxInvocationsPerAddressOverride,
407
- _merkleProjectConfig.merkleRoot
352
+ merkleProjectConfig_.useMaxInvocationsPerAddressOverride,
353
+ merkleProjectConfig_.maxInvocationsPerAddressOverride,
354
+ merkleProjectConfig_.merkleRoot
408
355
  );
409
356
  }
410
357
 
@@ -412,44 +359,44 @@ contract MinterSetPriceMerkleV5 is
412
359
  * @notice Retrieves the mint invocation count for a specific project and purchaser.
413
360
  * @dev This function retrieves the number of times a purchaser has minted
414
361
  * in a specific project from the projectUserMintInvocationsMapping.
415
- * @param _projectId The ID of the project.
416
- * @param _coreContract The address of the core contract.
417
- * @param _purchaser The address of the purchaser.
362
+ * @param projectId The ID of the project.
363
+ * @param coreContract The address of the core contract.
364
+ * @param purchaser The address of the purchaser.
418
365
  * @return uint256 The number of times the purchaser has minted in the given project.
419
366
  */
420
367
  function projectUserMintInvocations(
421
- uint256 _projectId,
422
- address _coreContract,
423
- address _purchaser
368
+ uint256 projectId,
369
+ address coreContract,
370
+ address purchaser
424
371
  ) external view returns (uint256) {
425
- MerkleLib.MerkleProjectConfig
426
- storage _merkleProjectConfig = _merkleProjectConfigMapping[
427
- _coreContract
428
- ][_projectId];
429
- return _merkleProjectConfig.userMintInvocations[_purchaser];
372
+ return
373
+ MerkleLib.projectUserMintInvocations({
374
+ projectId: projectId,
375
+ coreContract: coreContract,
376
+ purchaser: purchaser
377
+ });
430
378
  }
431
379
 
432
380
  /**
433
- * @notice Checks if the specified `_coreContract` is a valid engine contract.
434
- * @dev This function retrieves the cached value of `_isEngine` from
381
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
382
+ * @dev This function retrieves the cached value of `isEngine` from
435
383
  * the `isEngineCache` mapping. If the cached value is already set, it
436
- * returns the cached value. Otherwise, it calls the `getV3CoreIsEngine`
437
- * function from the `SplitFundsLib` library to check if `_coreContract`
384
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
385
+ * function from the `SplitFundsLib` library to check if `coreContract`
438
386
  * is a valid engine contract.
439
- * @dev This function will revert if the provided `_coreContract` is not
387
+ * @dev This function will revert if the provided `coreContract` is not
440
388
  * a valid Engine or V3 Flagship contract.
441
- * @param _coreContract The address of the contract to check.
442
- * @return bool indicating if `_coreContract` is a valid engine contract.
389
+ * @param coreContract The address of the contract to check.
390
+ * @return bool indicating if `coreContract` is a valid engine contract.
443
391
  */
444
- function isEngineView(address _coreContract) external view returns (bool) {
445
- SplitFundsLib.IsEngineCache storage isEngineCache = _isEngineCaches[
446
- _coreContract
447
- ];
392
+ function isEngineView(address coreContract) external view returns (bool) {
393
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
394
+ .getIsEngineCacheConfig(coreContract);
448
395
  if (isEngineCache.isCached) {
449
396
  return isEngineCache.isEngine;
450
397
  } else {
451
- // @dev this calls the non-modifying variant of getV3CoreIsEngine
452
- return SplitFundsLib.getV3CoreIsEngineView(_coreContract);
398
+ // @dev this calls the non-state-modifying variant of isEngine
399
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
453
400
  }
454
401
  }
455
402
 
@@ -464,17 +411,18 @@ contract MinterSetPriceMerkleV5 is
464
411
  * possible because the V3 core contract only allows maximum invocations
465
412
  * to be reduced, not increased. Based on this rationale, we intentionally
466
413
  * do not do input validation in this method as to whether or not the input
467
- * @param `_projectId` is an existing project ID.
468
- * @param `_coreContract` is an existing core contract address.
414
+ * @param projectId is an existing project ID.
415
+ * @param coreContract is an existing core contract address.
469
416
  */
470
417
  function projectMaxHasBeenInvoked(
471
- uint256 _projectId,
472
- address _coreContract
418
+ uint256 projectId,
419
+ address coreContract
473
420
  ) external view returns (bool) {
474
421
  return
475
- MaxInvocationsLib.getMaxHasBeenInvoked(
476
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
477
- );
422
+ MaxInvocationsLib.getMaxHasBeenInvoked({
423
+ projectId: projectId,
424
+ coreContract: coreContract
425
+ });
478
426
  }
479
427
 
480
428
  /**
@@ -493,26 +441,27 @@ contract MinterSetPriceMerkleV5 is
493
441
  * increased. When this happens, the minter will enable minting, allowing
494
442
  * the core contract to enforce the max invocations check. Based on this
495
443
  * rationale, we intentionally do not do input validation in this method as
496
- * to whether or not the input `_projectId` is an existing project ID.
497
- * @param `_projectId` is an existing project ID.
498
- * @param `_coreContract` is an existing core contract address.
444
+ * to whether or not the input `projectId` is an existing project ID.
445
+ * @param projectId is an existing project ID.
446
+ * @param coreContract is an existing core contract address.
499
447
  */
500
448
  function projectMaxInvocations(
501
- uint256 _projectId,
502
- address _coreContract
449
+ uint256 projectId,
450
+ address coreContract
503
451
  ) external view returns (uint256) {
504
452
  return
505
- MaxInvocationsLib.getMaxInvocations(
506
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
507
- );
453
+ MaxInvocationsLib.getMaxInvocations({
454
+ projectId: projectId,
455
+ coreContract: coreContract
456
+ });
508
457
  }
509
458
 
510
459
  /**
511
460
  * @notice Gets if price of token is configured, price of minting a
512
- * token on project `_projectId`, and currency symbol and address to be
461
+ * token on project `projectId`, and currency symbol and address to be
513
462
  * used as payment.
514
- * @param _projectId Project ID to get price information for
515
- * @param _coreContract Contract address of the core contract
463
+ * @param projectId Project ID to get price information for
464
+ * @param coreContract Contract address of the core contract
516
465
  * @return isConfigured true only if token price has been configured on
517
466
  * this minter
518
467
  * @return tokenPriceInWei current price of token on this minter - invalid
@@ -523,8 +472,8 @@ contract MinterSetPriceMerkleV5 is
523
472
  * this minter. This minter always returns null address, reserved for ether
524
473
  */
525
474
  function getPriceInfo(
526
- uint256 _projectId,
527
- address _coreContract
475
+ uint256 projectId,
476
+ address coreContract
528
477
  )
529
478
  external
530
479
  view
@@ -536,11 +485,13 @@ contract MinterSetPriceMerkleV5 is
536
485
  )
537
486
  {
538
487
  SetPriceLib.SetPriceProjectConfig
539
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
540
- _coreContract
541
- ][_projectId];
542
- isConfigured = _setPriceProjectConfig.priceIsConfigured;
543
- tokenPriceInWei = _setPriceProjectConfig.pricePerTokenInWei;
488
+ storage setPriceProjectConfig_ = SetPriceLib
489
+ .getSetPriceProjectConfig({
490
+ projectId: projectId,
491
+ coreContract: coreContract
492
+ });
493
+ isConfigured = setPriceProjectConfig_.priceIsConfigured;
494
+ tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
544
495
  currencySymbol = "ETH";
545
496
  currencyAddress = address(0);
546
497
  }
@@ -551,26 +502,26 @@ contract MinterSetPriceMerkleV5 is
551
502
  * addresses are only limited by the project's maximum invocations, and a
552
503
  * dummy value of zero is returned for `mintInvocationsRemaining`.
553
504
  * If `projectLimitsMintInvocationsPerAddress` is true, the quantity of
554
- * remaining mint invocations for address `_address` is returned as
505
+ * remaining mint invocations for address `address` is returned as
555
506
  * `mintInvocationsRemaining`.
556
507
  * Note that mint invocations per address can be changed at any time by the
557
508
  * artist of a project.
558
509
  * Also note that all mint invocations are limited by a project's maximum
559
510
  * invocations as defined on the core contract. This function may return
560
511
  * a value greater than the project's remaining invocations.
561
- * @param _projectId Project ID to get remaining invocations for.
562
- * @param _coreContract Contract address of the core contract.
563
- * @param _address Wallet address to get remaining invocations for.
512
+ * @param projectId Project ID to get remaining invocations for.
513
+ * @param coreContract Contract address of the core contract.
514
+ * @param address_ Wallet address to get remaining invocations for.
564
515
  * @return projectLimitsMintInvocationsPerAddress true if project limits
565
516
  * mint invocations per address, false if project does not limit mint
566
517
  * invocations per address.
567
518
  * @return mintInvocationsRemaining quantity of remaining mint invocations
568
- * for wallet at `_address`.
519
+ * for wallet at `address`.
569
520
  */
570
521
  function projectRemainingInvocationsForAddress(
571
- uint256 _projectId,
572
- address _coreContract,
573
- address _address
522
+ uint256 projectId,
523
+ address coreContract,
524
+ address address_
574
525
  )
575
526
  external
576
527
  view
@@ -579,15 +530,12 @@ contract MinterSetPriceMerkleV5 is
579
530
  uint256 mintInvocationsRemaining
580
531
  )
581
532
  {
582
- MerkleLib.MerkleProjectConfig
583
- storage _merkleProjectConfig = _merkleProjectConfigMapping[
584
- _coreContract
585
- ][_projectId];
586
533
  return
587
- MerkleLib.projectRemainingInvocationsForAddress(
588
- _merkleProjectConfig,
589
- _address
590
- );
534
+ MerkleLib.projectRemainingInvocationsForAddress({
535
+ projectId: projectId,
536
+ coreContract: coreContract,
537
+ address_: address_
538
+ });
591
539
  }
592
540
 
593
541
  /**
@@ -598,203 +546,167 @@ contract MinterSetPriceMerkleV5 is
598
546
  * This value can be changed at any time by the artist.
599
547
  * @dev default value stated above must be updated if the value of
600
548
  * CONFIG_USE_MAX_INVOCATIONS_PER_ADDRESS_OVERRIDE is changed.
601
- * @param _projectId Project ID to get maximum invocations per address for.
602
- * @param _coreContract Contract address of the core contract.
549
+ * @param projectId Project ID to get maximum invocations per address for.
550
+ * @param coreContract Contract address of the core contract.
603
551
  * @return Maximum number of invocations per address for project.
604
552
  */
605
553
  function projectMaxInvocationsPerAddress(
606
- uint256 _projectId,
607
- address _coreContract
554
+ uint256 projectId,
555
+ address coreContract
608
556
  ) external view returns (uint256) {
609
- MerkleLib.MerkleProjectConfig
610
- storage _projectConfig = _merkleProjectConfigMapping[_coreContract][
611
- _projectId
612
- ];
613
- return MerkleLib.projectMaxInvocationsPerAddress(_projectConfig);
557
+ return
558
+ MerkleLib.projectMaxInvocationsPerAddress({
559
+ projectId: projectId,
560
+ coreContract: coreContract
561
+ });
614
562
  }
615
563
 
616
564
  /**
617
565
  * @notice Processes a proof for an address.
618
- * @param _proof The proof to process.
619
- * @param _address The address to process the proof for.
566
+ * @param proof The proof to process.
567
+ * @param address_ The address to process the proof for.
620
568
  * @return The resulting hash from processing the proof.
621
569
  */
622
570
  function processProofForAddress(
623
- bytes32[] calldata _proof,
624
- address _address
571
+ bytes32[] calldata proof,
572
+ address address_
625
573
  ) external pure returns (bytes32) {
626
- return MerkleLib.processProofForAddress(_proof, _address);
574
+ return
575
+ MerkleLib.processProofForAddress({
576
+ proof: proof,
577
+ address_: address_
578
+ });
627
579
  }
628
580
 
629
581
  /**
630
582
  * @notice Returns hashed address (to be used as merkle tree leaf).
631
583
  * Included as a public function to enable users to calculate their hashed
632
584
  * address in Solidity when generating proofs off-chain.
633
- * @param _address address to be hashed
585
+ * @param address_ address to be hashed
634
586
  * @return bytes32 hashed address, via keccak256 (using encodePacked)
635
587
  */
636
- function hashAddress(address _address) external pure returns (bytes32) {
637
- return MerkleLib.hashAddress(_address);
588
+ function hashAddress(address address_) external pure returns (bytes32) {
589
+ return MerkleLib.hashAddress(address_);
638
590
  }
639
591
 
640
592
  /**
641
- * @notice Syncs local maximum invocations of project `_projectId` based on
593
+ * @notice Syncs local maximum invocations of project `projectId` based on
642
594
  * the value currently defined in the core contract.
643
- * @param _projectId Project ID to set the maximum invocations for.
644
- * @param _coreContract Core contract address for the given project.
595
+ * @param projectId Project ID to set the maximum invocations for.
596
+ * @param coreContract Core contract address for the given project.
645
597
  * @dev this enables gas reduction after maxInvocations have been reached -
646
598
  * core contracts shall still enforce a maxInvocation check during mint.
647
599
  */
648
600
  function syncProjectMaxInvocationsToCore(
649
- uint256 _projectId,
650
- address _coreContract
601
+ uint256 projectId,
602
+ address coreContract
651
603
  ) public {
652
604
  AuthLib.onlyArtist({
653
- _projectId: _projectId,
654
- _coreContract: _coreContract,
655
- _sender: msg.sender
605
+ projectId: projectId,
606
+ coreContract: coreContract,
607
+ sender: msg.sender
656
608
  });
657
609
 
658
- uint256 maxInvocations = MaxInvocationsLib
659
- .syncProjectMaxInvocationsToCore(
660
- _projectId,
661
- _coreContract,
662
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
663
- );
664
- emit ProjectMaxInvocationsLimitUpdated(
665
- _projectId,
666
- _coreContract,
667
- maxInvocations
668
- );
610
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
611
+ projectId: projectId,
612
+ coreContract: coreContract
613
+ });
669
614
  }
670
615
 
671
616
  /**
672
- * @notice Purchases a token from project `_projectId` and sets
673
- * the token's owner to `_to`.
674
- * @param _to Address to be the new token's owner.
675
- * @param _projectId Project ID to mint a token on.
676
- * @param _coreContract Core contract address for the given project.
677
- * @param _proof Merkle proof for the given project.
678
- * @param _vault Vault being purchased on behalf of. Acceptable to be
617
+ * @notice Purchases a token from project `projectId` and sets
618
+ * the token's owner to `to`.
619
+ * @param to Address to be the new token's owner.
620
+ * @param projectId Project ID to mint a token on.
621
+ * @param coreContract Core contract address for the given project.
622
+ * @param proof Merkle proof for the given project.
623
+ * @param vault Vault being purchased on behalf of. Acceptable to be
679
624
  * `address(0)` if no vault.
680
625
  * @return tokenId Token ID of minted token
681
626
  */
682
627
  function purchaseTo(
683
- address _to,
684
- uint256 _projectId,
685
- address _coreContract,
686
- bytes32[] calldata _proof,
687
- address _vault // acceptable to be `address(0)` if no vault
628
+ address to,
629
+ uint256 projectId,
630
+ address coreContract,
631
+ bytes32[] calldata proof,
632
+ address vault // acceptable to be `address(0)` if no vault
688
633
  ) public payable nonReentrant returns (uint256 tokenId) {
689
634
  // CHECKS
690
- SetPriceLib.SetPriceProjectConfig
691
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
692
- _coreContract
693
- ][_projectId];
694
- MaxInvocationsLib.MaxInvocationsProjectConfig
695
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
696
- _coreContract
697
- ][_projectId];
698
- MerkleLib.MerkleProjectConfig
699
- storage _merkleProjectConfig = _merkleProjectConfigMapping[
700
- _coreContract
701
- ][_projectId];
702
-
635
+ // pre-mint MaxInvocationsLib checks
703
636
  // Note that `maxHasBeenInvoked` is only checked here to reduce gas
704
637
  // consumption after a project has been fully minted.
705
- // `_maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
638
+ // `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
706
639
  // gas consumption, but if not in sync with the core contract's value,
707
640
  // the core contract also enforces its own max invocation check during
708
641
  // minting.
709
- require(
710
- !_maxInvocationsProjectConfig.maxHasBeenInvoked,
711
- "Max invocations reached"
712
- );
713
-
714
- // require artist to have configured price of token on this minter
715
- require(
716
- _setPriceProjectConfig.priceIsConfigured,
717
- "Price not configured"
718
- );
642
+ MaxInvocationsLib.preMintChecks({
643
+ projectId: projectId,
644
+ coreContract: coreContract
645
+ });
719
646
 
720
- // load price of token into memory
721
- uint256 pricePerTokenInWei = _setPriceProjectConfig.pricePerTokenInWei;
647
+ // pre-mint checks for set price lib, and get price per token in wei
648
+ // @dev price per token is loaded into memory here for gas efficiency
649
+ uint256 pricePerTokenInWei = SetPriceLib.preMintChecksAndGetPrice({
650
+ projectId: projectId,
651
+ coreContract: coreContract
652
+ });
722
653
 
723
654
  require(msg.value >= pricePerTokenInWei, "Min value to mint req.");
724
655
 
725
656
  // NOTE: delegate-vault handling **begins here**.
726
657
 
727
658
  // handle that the vault may be either the `msg.sender` in the case
728
- // that there is not a true vault, or may be `_vault` if one is
659
+ // that there is not a true vault, or may be `vault` if one is
729
660
  // provided explicitly (and it is valid).
730
- address vault = msg.sender;
731
- if (_vault != address(0)) {
661
+ address vault_ = msg.sender;
662
+ if (vault != address(0)) {
732
663
  // If a vault is provided, it must be valid, otherwise throw rather
733
664
  // than optimistically-minting with original `msg.sender`.
734
665
  // Note, we do not check `checkDelegateForAll` as well, as it is known
735
666
  // to be implicitly checked by calling `checkDelegateForContract`.
736
- bool isValidDelegee = delegationRegistryContract
737
- .checkDelegateForContract(
738
- msg.sender, // delegate
739
- _vault, // vault
740
- _coreContract // contract
741
- );
667
+ bool isValidDelegee = _delegationRegistryContract
668
+ .checkDelegateForContract({
669
+ delegate: msg.sender,
670
+ vault: vault,
671
+ contract_: coreContract
672
+ });
742
673
  require(isValidDelegee, "Invalid delegate-vault pairing");
743
- vault = _vault;
674
+ vault_ = vault;
744
675
  }
745
676
 
746
- // require valid Merkle proof
747
- require(
748
- MerkleLib.verifyAddress(
749
- _merkleProjectConfig.merkleRoot,
750
- _proof,
751
- vault
752
- ),
753
- "Invalid Merkle proof"
754
- );
755
-
756
- // limit mints per address by project
757
- uint256 _maxProjectInvocationsPerAddress = MerkleLib
758
- .projectMaxInvocationsPerAddress(_merkleProjectConfig);
759
-
760
- // note that mint limits index off of the `vault` (when applicable)
761
- require(
762
- _merkleProjectConfig.userMintInvocations[vault] <
763
- _maxProjectInvocationsPerAddress ||
764
- _maxProjectInvocationsPerAddress == 0,
765
- "Max invocations reached"
766
- );
677
+ // pre-mint MerkleLib checks
678
+ MerkleLib.preMintChecks({
679
+ projectId: projectId,
680
+ coreContract: coreContract,
681
+ proof: proof,
682
+ vault: vault_
683
+ });
767
684
 
768
685
  // EFFECTS
769
- // increment user's invocations for this project
770
- unchecked {
771
- // this will never overflow since user's invocations on a project
772
- // are limited by the project's max invocations
773
- _merkleProjectConfig.userMintInvocations[vault]++;
774
- }
686
+ // mint effects for MerkleLib
687
+ MerkleLib.mintEffects({
688
+ projectId: projectId,
689
+ coreContract: coreContract,
690
+ vault: vault_
691
+ });
775
692
 
776
- tokenId = minterFilter.mint_joo(
777
- _to,
778
- _projectId,
779
- _coreContract,
780
- msg.sender
781
- );
693
+ tokenId = _minterFilter.mint_joo({
694
+ to: to,
695
+ projectId: projectId,
696
+ coreContract: coreContract,
697
+ sender: vault_
698
+ });
782
699
 
783
- MaxInvocationsLib.validatePurchaseEffectsInvocations(
784
- tokenId,
785
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
786
- );
700
+ MaxInvocationsLib.validateMintEffectsInvocations({
701
+ tokenId: tokenId,
702
+ coreContract: coreContract
703
+ });
787
704
 
788
705
  // INTERACTIONS
789
- bool isEngine = SplitFundsLib.isEngine(
790
- _coreContract,
791
- _isEngineCaches[_coreContract]
792
- );
793
- SplitFundsLib.splitFundsETH({
794
- _projectId: _projectId,
795
- _pricePerTokenInWei: pricePerTokenInWei,
796
- _coreContract: _coreContract,
797
- _isEngine: isEngine
706
+ SplitFundsLib.splitFundsETHRefundSender({
707
+ projectId: projectId,
708
+ pricePerTokenInWei: pricePerTokenInWei,
709
+ coreContract: coreContract
798
710
  });
799
711
 
800
712
  return tokenId;