@artblocks/contracts 1.1.0 → 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 (257) 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 +273 -155
  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/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +3 -3
  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 +567 -206
  41. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +787 -224
  42. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +38 -8
  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 +38 -8
  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/interfaces/v0.8.x/IAdminACLV0_Extended.sol/IAdminACLV0_Extended.json +140 -0
  47. package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol/IBytecodeStorageReaderV2.json +130 -0
  48. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +58 -45
  49. package/artifacts/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol/IEngineFactoryV0.json +283 -0
  50. package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol/IFilteredMinterDAExpSettlementV0.json +12 -12
  51. package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +12 -12
  52. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +30 -62
  53. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +30 -62
  54. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +170 -104
  55. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +170 -104
  56. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +1028 -0
  57. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +741 -0
  58. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol/IGenArt721CoreContractV3_ProjectFinance.json +87 -0
  59. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol/IGenArt721Minter_PBAB.json +279 -0
  60. package/artifacts/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
  61. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +18 -0
  62. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol/ISharedMinterRAMV0.json +62 -0
  63. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol/ISharedMinterRequired.json +37 -0
  64. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +1 -1
  65. package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol/ISplitAtomicFactoryV0.json +170 -0
  66. package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol/ISplitAtomicV0.json +126 -0
  67. package/artifacts/contracts/interfaces/v0.8.x/ISplitProviderV0.sol/ISplitProviderV0.json +98 -0
  68. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol/ISplitFactoryV2.json +123 -0
  69. package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
  70. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeMock.sol/GnosisSafeMock.json +2 -2
  71. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeProxyFactoryMock.sol/GnosisSafeProxyFactoryMock.json +2 -2
  72. package/artifacts/contracts/libs/integration-refs/gnosis-safe/MultiSendMock.sol/MultiSendMock.json +2 -2
  73. package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +2 -2
  74. package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
  75. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  76. package/artifacts/contracts/libs/v0.8.x/BitMap.sol/BitMaps256.json +10 -0
  77. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV0.sol/BytecodeStorage.json +2 -2
  78. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageReader.json +2 -2
  79. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageWriter.json +2 -2
  80. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageReader.json +214 -0
  81. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageWriter.json +10 -0
  82. package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
  83. package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +10 -0
  84. package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +2 -2
  85. package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol/ERC721_PackedHashSeedV1.json +444 -0
  86. package/artifacts/contracts/libs/v0.8.x/PackedBools.sol/PackedBools.json +10 -0
  87. package/artifacts/contracts/libs/v0.8.x/SSTORE2.sol/SSTORE2.json +2 -2
  88. package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +208 -0
  89. package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +2 -2
  90. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +2 -2
  91. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +2 -2
  92. package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +2 -2
  93. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
  94. package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +2 -2
  95. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  96. package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +398 -0
  97. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +2 -2
  98. package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +2 -2
  99. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +2 -2
  100. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +2 -2
  101. package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +2 -2
  102. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  103. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +2 -2
  104. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +2 -2
  105. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +2 -2
  106. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +2 -2
  107. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +2 -2
  108. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +2 -2
  109. package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +1374 -0
  110. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +7 -7
  111. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +2 -2
  112. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +2 -2
  113. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +2 -2
  114. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +2 -2
  115. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +2 -2
  116. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
  117. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +417 -0
  118. package/artifacts/contracts/mock/BytecodeV2LibCallsMock.sol/BytecodeV2LibCallsMock.json +154 -0
  119. package/artifacts/contracts/mock/BytecodeV2TextCR_DMock.sol/BytecodeV2TextCR_DMock.json +428 -0
  120. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  121. package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +2 -2
  122. package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +24 -0
  123. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
  124. package/artifacts/contracts/mock/Mock0xSplitsV2PullFactory.sol/Mock0xSplitsV2PullFactory.json +149 -0
  125. package/artifacts/contracts/mock/Mock0xSplitsV2Splitter.sol/Mock0xSplitsV2Splitter.json +99 -0
  126. package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +20 -2
  127. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +20 -2
  128. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  129. package/artifacts/contracts/mock/ReentrancyGenArt721MinterMock.sol/ReentrancyGenArt721MinterMock.json +100 -0
  130. package/artifacts/contracts/mock/ReentrancyHolderMock.sol/ReentrancyHolderMock.json +2 -2
  131. package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +2 -2
  132. package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
  133. package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +2 -2
  134. package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
  135. package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +2 -2
  136. package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +2 -2
  137. package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +2 -2
  138. package/artifacts/contracts/mock/ReentrancySplitterMocks.sol/ReentrancySplitterDrainETHMock.json +54 -0
  139. package/artifacts/contracts/mock/ReentrancySplitterMocks.sol/ReentrancySplitterSendETHMock.json +54 -0
  140. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
  141. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
  142. package/artifacts/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +2 -2
  143. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +2 -2
  144. package/artifacts/contracts/split/SplitAtomicFactoryV0.sol/SplitAtomicFactoryV0.json +203 -0
  145. package/artifacts/contracts/split/SplitAtomicV0.sol/SplitAtomicV0.json +168 -0
  146. package/artifacts/contracts/split/split-provider/SplitProviderV0.sol/SplitProviderV0.json +141 -0
  147. package/contracts/AdminACLV0.sol +6 -2
  148. package/contracts/AdminACLV1.sol +2 -2
  149. package/contracts/DependencyRegistryV0.sol +687 -408
  150. package/contracts/{GenArt721CoreV3.sol → archive/GenArt721CoreV3.sol} +56 -20
  151. package/contracts/{explorations → archive}/GenArt721CoreV3_Explorations.sol +49 -13
  152. package/contracts/{minter-suite → archive/minter-suite}/Minters/MinterBase_v0_1_1.sol +4 -4
  153. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExp}/MinterDAExpV4.sol +4 -4
  154. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +4 -4
  155. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +5 -5
  156. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV2.sol +8 -8
  157. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDALin}/MinterDALinV4.sol +4 -4
  158. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterHolder}/MinterHolderV4.sol +5 -5
  159. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterMerkle}/MinterMerkleV5.sol +5 -5
  160. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol +7 -7
  161. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSEA}/MinterSEAV0.sol +13 -13
  162. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPrice}/MinterSetPriceV4.sol +4 -4
  163. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol +82 -10
  164. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol +82 -10
  165. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPriceERC20}/MinterSetPriceERC20V4.sol +88 -21
  166. package/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol +81 -22
  167. package/contracts/engine/V2/GenArt721Minter_PBAB.sol +80 -22
  168. package/contracts/engine/V3/EngineFactoryV0.sol +419 -0
  169. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +894 -488
  170. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +1054 -650
  171. package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +3 -3
  172. package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +1 -1
  173. package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +2 -2
  174. package/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol +20 -0
  175. package/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol +23 -0
  176. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +47 -45
  177. package/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol +124 -0
  178. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol +1 -3
  179. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol +1 -3
  180. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpV1.sol +1 -3
  181. package/contracts/interfaces/v0.8.x/IFilteredMinterDALinV1.sol +1 -3
  182. package/contracts/interfaces/v0.8.x/IFilteredMinterHolderV2.sol +1 -3
  183. package/contracts/interfaces/v0.8.x/IFilteredMinterMerkleV2.sol +1 -3
  184. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +115 -11
  185. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +84 -8
  186. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol +26 -8
  187. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol +141 -0
  188. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol +78 -0
  189. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol +47 -0
  190. package/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol +91 -0
  191. package/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol +1 -3
  192. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +19 -0
  193. package/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol +23 -0
  194. package/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol +20 -0
  195. package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +1 -4
  196. package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +12 -6
  197. package/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol +81 -0
  198. package/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol +72 -0
  199. package/contracts/interfaces/v0.8.x/ISplitProviderV0.sol +49 -0
  200. package/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol +62 -0
  201. package/contracts/libs/v0.8.x/ABHelpers.sol +18 -4
  202. package/contracts/libs/v0.8.x/BitMap.sol +112 -0
  203. package/contracts/libs/v0.8.x/BytecodeStorageV2.sol +593 -0
  204. package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +90 -0
  205. package/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol +591 -0
  206. package/contracts/libs/v0.8.x/PackedBools.sol +42 -0
  207. package/contracts/libs/v0.8.x/V3FlexLib.sol +591 -0
  208. package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +10 -12
  209. package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +4 -9
  210. package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +44 -44
  211. package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +64 -63
  212. package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +14 -10
  213. package/contracts/libs/v0.8.x/minter-libs/RAMLib.sol +2927 -0
  214. package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +60 -62
  215. package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +4 -8
  216. package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +92 -89
  217. package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +21 -15
  218. package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +5 -4
  219. package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +16 -10
  220. package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +2 -2
  221. package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +19 -15
  222. package/contracts/minter-suite/Minters/MinterDAExpV5.sol +2 -2
  223. package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +2 -2
  224. package/contracts/minter-suite/Minters/MinterDALinV5.sol +2 -2
  225. package/contracts/minter-suite/Minters/MinterRAMV0.sol +1205 -0
  226. package/contracts/minter-suite/Minters/MinterSEAV1.sol +21 -32
  227. package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +17 -8
  228. package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +2 -2
  229. package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +2 -2
  230. package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +23 -9
  231. package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +2 -2
  232. package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +2 -2
  233. package/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol +446 -0
  234. package/contracts/mock/BytecodeV2LibCallsMock.sol +128 -0
  235. package/contracts/mock/BytecodeV2TextCR_DMock.sol +316 -0
  236. package/contracts/mock/ForceSendMock.sol +22 -0
  237. package/contracts/mock/Mock0xSplitsV2PullFactory.sol +75 -0
  238. package/contracts/mock/Mock0xSplitsV2Splitter.sol +47 -0
  239. package/contracts/mock/MockAdminACLV0.sol +21 -0
  240. package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +21 -0
  241. package/contracts/mock/ReentrancyGenArt721MinterMock.sol +47 -0
  242. package/contracts/mock/ReentrancySplitterMocks.sol +67 -0
  243. package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
  244. package/contracts/randomizer/shared/SharedRandomizerV0.sol +1 -1
  245. package/contracts/split/SplitAtomicFactoryV0.sol +121 -0
  246. package/contracts/split/SplitAtomicV0.sol +265 -0
  247. package/contracts/split/split-provider/SplitProviderV0.sol +201 -0
  248. package/package.json +62 -34
  249. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +0 -1965
  250. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +0 -1939
  251. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +0 -768
  252. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +0 -208
  253. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol/GenArt721RoyaltyOverride_PBAB.json +0 -301
  254. package/contracts/archive/readme.md +0 -16
  255. package/contracts/engine/README.md +0 -21
  256. package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +0 -168
  257. package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +0 -221
@@ -231,19 +231,46 @@ contract MinterSetPriceERC20V0 is ReentrancyGuard, IFilteredMinterV0 {
231
231
  }
232
232
 
233
233
  /**
234
- * @notice Purchases a token from project `_projectId`.
234
+ * @notice Purchases a token from project `_projectId` with ETH.
235
235
  * @param _projectId Project ID to mint a token on.
236
236
  * @return tokenId Token ID of minted token
237
237
  */
238
238
  function purchase(
239
239
  uint256 _projectId
240
240
  ) external payable returns (uint256 tokenId) {
241
- tokenId = purchaseTo(msg.sender, _projectId);
241
+ // pass max price as msg.value, currency address as ETH
242
+ tokenId = purchaseTo({
243
+ _to: msg.sender,
244
+ _projectId: _projectId,
245
+ _maxPricePerToken: msg.value,
246
+ _currencyAddress: address(0)
247
+ });
242
248
  return tokenId;
243
249
  }
244
250
 
245
251
  /**
246
- * @notice Purchases a token from project `_projectId` and sets
252
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token.
253
+ * @param _projectId Project ID to mint a token on.
254
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places.
255
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
256
+ * @return tokenId Token ID of minted token
257
+ */
258
+ function purchase(
259
+ uint256 _projectId,
260
+ uint256 _maxPricePerToken,
261
+ address _currencyAddress
262
+ ) external payable returns (uint256 tokenId) {
263
+ tokenId = purchaseTo({
264
+ _to: msg.sender,
265
+ _projectId: _projectId,
266
+ _maxPricePerToken: _maxPricePerToken,
267
+ _currencyAddress: _currencyAddress
268
+ });
269
+ return tokenId;
270
+ }
271
+
272
+ /**
273
+ * @notice Purchases a token from project `_projectId` with ETH and sets
247
274
  * the token's owner to `_to`.
248
275
  * @param _to Address to be the new token's owner.
249
276
  * @param _projectId Project ID to mint a token on.
@@ -252,6 +279,31 @@ contract MinterSetPriceERC20V0 is ReentrancyGuard, IFilteredMinterV0 {
252
279
  function purchaseTo(
253
280
  address _to,
254
281
  uint256 _projectId
282
+ ) public payable returns (uint256 tokenId) {
283
+ // pass max price as msg.value, currency address as ETH
284
+ return
285
+ purchaseTo({
286
+ _to: _to,
287
+ _projectId: _projectId,
288
+ _maxPricePerToken: msg.value,
289
+ _currencyAddress: address(0)
290
+ });
291
+ }
292
+
293
+ /**
294
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token and sets
295
+ * the token's owner to `_to`.
296
+ * @param _to Address to be the new token's owner.
297
+ * @param _projectId Project ID to mint a token on.
298
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places. Required if currency is ERC20.
299
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
300
+ * @return tokenId Token ID of minted token
301
+ */
302
+ function purchaseTo(
303
+ address _to,
304
+ uint256 _projectId,
305
+ uint256 _maxPricePerToken,
306
+ address _currencyAddress
255
307
  ) public payable nonReentrant returns (uint256 tokenId) {
256
308
  // CHECKS
257
309
  require(
@@ -265,6 +317,22 @@ contract MinterSetPriceERC20V0 is ReentrancyGuard, IFilteredMinterV0 {
265
317
  "Price not configured"
266
318
  );
267
319
 
320
+ uint256 pricePerTokenInWei = projectIdToPricePerTokenInWei[_projectId];
321
+ address configuredCurrencyAddress = projectIdToCurrencyAddress[
322
+ _projectId
323
+ ];
324
+
325
+ // validate that the currency address matches the project configured currency
326
+ require(
327
+ _currencyAddress == configuredCurrencyAddress,
328
+ "Currency addresses must match"
329
+ );
330
+
331
+ // if configured currency is ETH validate that msg.value is the same as max price per token
332
+ if (configuredCurrencyAddress == address(0)) {
333
+ require(msg.value == _maxPricePerToken, "inconsistent msg.value");
334
+ }
335
+
268
336
  // if contract filter is off, allow calls from another contract
269
337
  if (!contractMintable[_projectId]) {
270
338
  require(msg.sender == tx.origin, "No Contract Buys");
@@ -300,28 +368,32 @@ contract MinterSetPriceERC20V0 is ReentrancyGuard, IFilteredMinterV0 {
300
368
  }
301
369
 
302
370
  // INTERACTIONS
303
- if (projectIdToCurrencyAddress[_projectId] != address(0)) {
371
+ if (configuredCurrencyAddress != address(0)) {
372
+ // validate that the specified maximum price is greater than or equal to the price per token
373
+ require(
374
+ _maxPricePerToken >= pricePerTokenInWei,
375
+ "Only max price gte token price"
376
+ );
304
377
  require(
305
378
  msg.value == 0,
306
379
  "this project accepts a different currency and cannot accept ETH"
307
380
  );
308
381
  require(
309
- IERC20(projectIdToCurrencyAddress[_projectId]).allowance(
382
+ IERC20(configuredCurrencyAddress).allowance(
310
383
  msg.sender,
311
384
  address(this)
312
- ) >= projectIdToPricePerTokenInWei[_projectId],
385
+ ) >= pricePerTokenInWei,
313
386
  "Insufficient Funds Approved for TX"
314
387
  );
315
388
  require(
316
- IERC20(projectIdToCurrencyAddress[_projectId]).balanceOf(
317
- msg.sender
318
- ) >= projectIdToPricePerTokenInWei[_projectId],
389
+ IERC20(configuredCurrencyAddress).balanceOf(msg.sender) >=
390
+ pricePerTokenInWei,
319
391
  "Insufficient balance."
320
392
  );
321
393
  _splitFundsERC20(_projectId);
322
394
  } else {
323
395
  require(
324
- msg.value >= projectIdToPricePerTokenInWei[_projectId],
396
+ msg.value >= pricePerTokenInWei,
325
397
  "Must send minimum value to mint!"
326
398
  );
327
399
  _splitFundsETH(_projectId);
@@ -193,19 +193,46 @@ contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
193
193
  }
194
194
 
195
195
  /**
196
- * @notice Purchases a token from project `_projectId`.
196
+ * @notice Purchases a token from project `_projectId` with ETH.
197
197
  * @param _projectId Project ID to mint a token on.
198
198
  * @return tokenId Token ID of minted token
199
199
  */
200
200
  function purchase(
201
201
  uint256 _projectId
202
202
  ) external payable returns (uint256 tokenId) {
203
- tokenId = purchaseTo(msg.sender, _projectId);
203
+ // pass max price as msg.value, currency address as ETH
204
+ tokenId = purchaseTo({
205
+ _to: msg.sender,
206
+ _projectId: _projectId,
207
+ _maxPricePerToken: msg.value,
208
+ _currencyAddress: address(0)
209
+ });
204
210
  return tokenId;
205
211
  }
206
212
 
207
213
  /**
208
- * @notice Purchases a token from project `_projectId` and sets
214
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token.
215
+ * @param _projectId Project ID to mint a token on.
216
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places.
217
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
218
+ * @return tokenId Token ID of minted token
219
+ */
220
+ function purchase(
221
+ uint256 _projectId,
222
+ uint256 _maxPricePerToken,
223
+ address _currencyAddress
224
+ ) external payable returns (uint256 tokenId) {
225
+ tokenId = purchaseTo({
226
+ _to: msg.sender,
227
+ _projectId: _projectId,
228
+ _maxPricePerToken: _maxPricePerToken,
229
+ _currencyAddress: _currencyAddress
230
+ });
231
+ return tokenId;
232
+ }
233
+
234
+ /**
235
+ * @notice Purchases a token from project `_projectId` with ETH and sets
209
236
  * the token's owner to `_to`.
210
237
  * @param _to Address to be the new token's owner.
211
238
  * @param _projectId Project ID to mint a token on.
@@ -214,6 +241,31 @@ contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
214
241
  function purchaseTo(
215
242
  address _to,
216
243
  uint256 _projectId
244
+ ) public payable returns (uint256 tokenId) {
245
+ // pass max price as msg.value, currency address as ETH
246
+ return
247
+ purchaseTo({
248
+ _to: _to,
249
+ _projectId: _projectId,
250
+ _maxPricePerToken: msg.value,
251
+ _currencyAddress: address(0)
252
+ });
253
+ }
254
+
255
+ /**
256
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token and sets
257
+ * the token's owner to `_to`.
258
+ * @param _to Address to be the new token's owner.
259
+ * @param _projectId Project ID to mint a token on.
260
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places. Required if currency is ERC20.
261
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
262
+ * @return tokenId Token ID of minted token
263
+ */
264
+ function purchaseTo(
265
+ address _to,
266
+ uint256 _projectId,
267
+ uint256 _maxPricePerToken,
268
+ address _currencyAddress
217
269
  ) public payable nonReentrant returns (uint256 tokenId) {
218
270
  // CHECKS
219
271
  require(
@@ -227,6 +279,22 @@ contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
227
279
  "Price not configured"
228
280
  );
229
281
 
282
+ uint256 pricePerTokenInWei = projectIdToPricePerTokenInWei[_projectId];
283
+ address configuredCurrencyAddress = projectIdToCurrencyAddress[
284
+ _projectId
285
+ ];
286
+
287
+ // validate that the currency address matches the project configured currency
288
+ require(
289
+ _currencyAddress == configuredCurrencyAddress,
290
+ "Currency addresses must match"
291
+ );
292
+
293
+ // if configured currency is ETH validate that msg.value is the same as max price per token
294
+ if (configuredCurrencyAddress == address(0)) {
295
+ require(msg.value == _maxPricePerToken, "inconsistent msg.value");
296
+ }
297
+
230
298
  // EFFECTS
231
299
  tokenId = minterFilter.mint(_to, _projectId, msg.sender);
232
300
  // what if projectMaxInvocations[_projectId] is 0 (default value)?
@@ -241,28 +309,32 @@ contract MinterSetPriceERC20V1 is ReentrancyGuard, IFilteredMinterV0 {
241
309
  }
242
310
 
243
311
  // INTERACTIONS
244
- if (projectIdToCurrencyAddress[_projectId] != address(0)) {
312
+ if (configuredCurrencyAddress != address(0)) {
313
+ // validate that the specified maximum price is greater than or equal to the price per token
314
+ require(
315
+ _maxPricePerToken >= pricePerTokenInWei,
316
+ "Only max price gte token price"
317
+ );
245
318
  require(
246
319
  msg.value == 0,
247
320
  "this project accepts a different currency and cannot accept ETH"
248
321
  );
249
322
  require(
250
- IERC20(projectIdToCurrencyAddress[_projectId]).allowance(
323
+ IERC20(configuredCurrencyAddress).allowance(
251
324
  msg.sender,
252
325
  address(this)
253
- ) >= projectIdToPricePerTokenInWei[_projectId],
326
+ ) >= pricePerTokenInWei,
254
327
  "Insufficient Funds Approved for TX"
255
328
  );
256
329
  require(
257
- IERC20(projectIdToCurrencyAddress[_projectId]).balanceOf(
258
- msg.sender
259
- ) >= projectIdToPricePerTokenInWei[_projectId],
330
+ IERC20(configuredCurrencyAddress).balanceOf(msg.sender) >=
331
+ pricePerTokenInWei,
260
332
  "Insufficient balance."
261
333
  );
262
334
  _splitFundsERC20(_projectId);
263
335
  } else {
264
336
  require(
265
- msg.value >= projectIdToPricePerTokenInWei[_projectId],
337
+ msg.value >= pricePerTokenInWei,
266
338
  "Must send minimum value to mint!"
267
339
  );
268
340
  _splitFundsETH(_projectId);
@@ -1,12 +1,12 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
- import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
5
- import "../../interfaces/v0.8.x/IGenArt721CoreContractV3.sol";
6
- import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol";
7
- import "../../interfaces/v0.8.x/IMinterFilterV0.sol";
8
- import "../../interfaces/v0.8.x/IFilteredMinterV2.sol";
9
- import "./MinterBase_v0_1_1.sol";
4
+ import "../../../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
5
+ import "../../../../interfaces/v0.8.x/IGenArt721CoreContractV3.sol";
6
+ import "../../../../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol";
7
+ import "../../../../interfaces/v0.8.x/IMinterFilterV0.sol";
8
+ import "../../../../interfaces/v0.8.x/IFilteredMinterV2.sol";
9
+ import "../MinterBase_v0_1_1.sol";
10
10
 
11
11
  import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
12
12
 
@@ -320,14 +320,41 @@ contract MinterSetPriceERC20V4 is
320
320
  }
321
321
 
322
322
  /**
323
- * @notice Purchases a token from project `_projectId`.
323
+ * @notice Purchases a token from project `_projectId` with ETH.
324
324
  * @param _projectId Project ID to mint a token on.
325
325
  * @return tokenId Token ID of minted token
326
326
  */
327
327
  function purchase(
328
328
  uint256 _projectId
329
329
  ) external payable returns (uint256 tokenId) {
330
- tokenId = purchaseTo_do6(msg.sender, _projectId);
330
+ // pass max price as msg.value, currency address as ETH
331
+ tokenId = purchaseTo({
332
+ _to: msg.sender,
333
+ _projectId: _projectId,
334
+ _maxPricePerToken: msg.value,
335
+ _currencyAddress: address(0)
336
+ });
337
+ return tokenId;
338
+ }
339
+
340
+ /**
341
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token.
342
+ * @param _projectId Project ID to mint a token on.
343
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places.
344
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
345
+ * @return tokenId Token ID of minted token
346
+ */
347
+ function purchase(
348
+ uint256 _projectId,
349
+ uint256 _maxPricePerToken,
350
+ address _currencyAddress
351
+ ) external payable returns (uint256 tokenId) {
352
+ tokenId = purchaseTo({
353
+ _to: msg.sender,
354
+ _projectId: _projectId,
355
+ _maxPricePerToken: _maxPricePerToken,
356
+ _currencyAddress: _currencyAddress
357
+ });
331
358
  return tokenId;
332
359
  }
333
360
 
@@ -337,12 +364,18 @@ contract MinterSetPriceERC20V4 is
337
364
  function purchase_H4M(
338
365
  uint256 _projectId
339
366
  ) external payable returns (uint256 tokenId) {
340
- tokenId = purchaseTo_do6(msg.sender, _projectId);
367
+ // pass max price as msg.value, currency address as ETH
368
+ tokenId = purchaseTo({
369
+ _to: msg.sender,
370
+ _projectId: _projectId,
371
+ _maxPricePerToken: msg.value,
372
+ _currencyAddress: address(0)
373
+ });
341
374
  return tokenId;
342
375
  }
343
376
 
344
377
  /**
345
- * @notice Purchases a token from project `_projectId` and sets
378
+ * @notice Purchases a token from project `_projectId` with ETH and sets
346
379
  * the token's owner to `_to`.
347
380
  * @param _to Address to be the new token's owner.
348
381
  * @param _projectId Project ID to mint a token on.
@@ -352,15 +385,30 @@ contract MinterSetPriceERC20V4 is
352
385
  address _to,
353
386
  uint256 _projectId
354
387
  ) external payable returns (uint256 tokenId) {
355
- return purchaseTo_do6(_to, _projectId);
388
+ // pass max price as msg.value, currency address as ETH
389
+ return
390
+ purchaseTo({
391
+ _to: _to,
392
+ _projectId: _projectId,
393
+ _maxPricePerToken: msg.value,
394
+ _currencyAddress: address(0)
395
+ });
356
396
  }
357
397
 
358
398
  /**
359
- * @notice gas-optimized version of purchaseTo(address, uint256).
399
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token and sets
400
+ * the token's owner to `_to`.
401
+ * @param _to Address to be the new token's owner.
402
+ * @param _projectId Project ID to mint a token on.
403
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places. Required if currency is ERC20.
404
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
405
+ * @return tokenId Token ID of minted token
360
406
  */
361
- function purchaseTo_do6(
407
+ function purchaseTo(
362
408
  address _to,
363
- uint256 _projectId
409
+ uint256 _projectId,
410
+ uint256 _maxPricePerToken,
411
+ address _currencyAddress
364
412
  ) public payable nonReentrant returns (uint256 tokenId) {
365
413
  // CHECKS
366
414
  ProjectConfig storage _projectConfig = projectConfig[_projectId];
@@ -379,6 +427,20 @@ contract MinterSetPriceERC20V4 is
379
427
  // require artist to have configured price of token on this minter
380
428
  require(_projectConfig.priceIsConfigured, "Price not configured");
381
429
 
430
+ uint256 pricePerTokenInWei = _projectConfig.pricePerTokenInWei;
431
+ address configuredCurrencyAddress = _projectConfig.currencyAddress;
432
+
433
+ // validate that the currency address matches the project configured currency
434
+ require(
435
+ _currencyAddress == configuredCurrencyAddress,
436
+ "Currency addresses must match"
437
+ );
438
+
439
+ // if configured currency is ETH validate that msg.value is the same as max price per token
440
+ if (configuredCurrencyAddress == address(0)) {
441
+ require(msg.value == _maxPricePerToken, "inconsistent msg.value");
442
+ }
443
+
382
444
  // EFFECTS
383
445
  tokenId = minterFilter.mint(_to, _projectId, msg.sender);
384
446
 
@@ -406,27 +468,32 @@ contract MinterSetPriceERC20V4 is
406
468
  }
407
469
 
408
470
  // INTERACTIONS
409
- uint256 pricePerTokenInWei = _projectConfig.pricePerTokenInWei;
410
- address _currencyAddress = _projectConfig.currencyAddress;
411
- if (_currencyAddress != address(0)) {
471
+ if (configuredCurrencyAddress != address(0)) {
472
+ // validate that the specified maximum price is greater than or equal to the price per token
473
+ require(
474
+ _maxPricePerToken >= pricePerTokenInWei,
475
+ "Only max price gte token price"
476
+ );
412
477
  require(
413
478
  msg.value == 0,
414
479
  "this project accepts a different currency and cannot accept ETH"
415
480
  );
416
481
  require(
417
- IERC20(_currencyAddress).allowance(msg.sender, address(this)) >=
418
- pricePerTokenInWei,
482
+ IERC20(configuredCurrencyAddress).allowance(
483
+ msg.sender,
484
+ address(this)
485
+ ) >= pricePerTokenInWei,
419
486
  "Insufficient Funds Approved for TX"
420
487
  );
421
488
  require(
422
- IERC20(_currencyAddress).balanceOf(msg.sender) >=
489
+ IERC20(configuredCurrencyAddress).balanceOf(msg.sender) >=
423
490
  pricePerTokenInWei,
424
491
  "Insufficient balance."
425
492
  );
426
493
  splitFundsERC20(
427
494
  _projectId,
428
495
  pricePerTokenInWei,
429
- _currencyAddress,
496
+ configuredCurrencyAddress,
430
497
  genArt721CoreAddress
431
498
  );
432
499
  } else {
@@ -215,18 +215,46 @@ contract GenArt721MinterBurner_PBAB is ReentrancyGuard {
215
215
  }
216
216
 
217
217
  /**
218
- * @notice Purchases a token from project `_projectId`.
218
+ * @notice Purchases a token from project `_projectId` with ETH.
219
219
  * @param _projectId Project ID to mint a token on.
220
220
  * @return _tokenId Token ID of minted token
221
221
  */
222
222
  function purchase(
223
223
  uint256 _projectId
224
224
  ) public payable returns (uint256 _tokenId) {
225
- return purchaseTo(msg.sender, _projectId);
225
+ // pass max price as msg.value, currency address as ETH
226
+ return
227
+ purchaseTo({
228
+ _to: msg.sender,
229
+ _projectId: _projectId,
230
+ _maxPricePerToken: msg.value,
231
+ _currencyAddress: address(0)
232
+ });
226
233
  }
227
234
 
228
235
  /**
229
- * @notice Purchases a token from project `_projectId` and sets
236
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token.
237
+ * @param _projectId Project ID to mint a token on.
238
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places.
239
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
240
+ * @return _tokenId Token ID of minted token
241
+ */
242
+ function purchase(
243
+ uint256 _projectId,
244
+ uint256 _maxPricePerToken,
245
+ address _currencyAddress
246
+ ) public payable returns (uint256 _tokenId) {
247
+ return
248
+ purchaseTo({
249
+ _to: msg.sender,
250
+ _projectId: _projectId,
251
+ _maxPricePerToken: _maxPricePerToken,
252
+ _currencyAddress: _currencyAddress
253
+ });
254
+ }
255
+
256
+ /**
257
+ * @notice Purchases a token from project `_projectId` with ETH and sets
230
258
  * the token's owner to `_to`.
231
259
  * @param _to Address to be the new token's owner.
232
260
  * @param _projectId Project ID to mint a token on.
@@ -235,6 +263,31 @@ contract GenArt721MinterBurner_PBAB is ReentrancyGuard {
235
263
  function purchaseTo(
236
264
  address _to,
237
265
  uint256 _projectId
266
+ ) public payable returns (uint256 _tokenId) {
267
+ // pass max price as msg.value, currency address as ETH
268
+ return
269
+ purchaseTo({
270
+ _to: _to,
271
+ _projectId: _projectId,
272
+ _maxPricePerToken: msg.value,
273
+ _currencyAddress: address(0)
274
+ });
275
+ }
276
+
277
+ /**
278
+ * @notice Purchases a token from project `_projectId` with ETH or any ERC-20 token and sets
279
+ * the token's owner to `_to`.
280
+ * @param _to Address to be the new token's owner.
281
+ * @param _projectId Project ID to mint a token on.
282
+ * @param _maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places. Required if currency is ERC20.
283
+ * @param _currencyAddress Currency address of token. `address(0)` if minting with ETH.
284
+ * @return _tokenId Token ID of minted token
285
+ */
286
+ function purchaseTo(
287
+ address _to,
288
+ uint256 _projectId,
289
+ uint256 _maxPricePerToken,
290
+ address _currencyAddress
238
291
  ) public payable nonReentrant returns (uint256 _tokenId) {
239
292
  // CHECKS
240
293
  require(
@@ -246,6 +299,21 @@ contract GenArt721MinterBurner_PBAB is ReentrancyGuard {
246
299
  require(msg.sender == tx.origin, "No Contract Buys");
247
300
  }
248
301
 
302
+ uint256 pricePerTokenInWei = genArtCoreContract
303
+ .projectIdToPricePerTokenInWei(_projectId);
304
+ address configuredCurrencyAddress = genArtCoreContract
305
+ .projectIdToCurrencyAddress(_projectId);
306
+ // validate that the currency address matches the project configured currency
307
+ require(
308
+ _currencyAddress == configuredCurrencyAddress,
309
+ "Currency addresses must match"
310
+ );
311
+
312
+ // if configured currency is ETH validate that msg.value is the same as max price per token
313
+ if (configuredCurrencyAddress == address(0)) {
314
+ require(msg.value == _maxPricePerToken, "inconsistent msg.value");
315
+ }
316
+
249
317
  // limit mints per address by project
250
318
  if (projectMintLimit[_projectId] > 0) {
251
319
  require(
@@ -283,13 +351,13 @@ contract GenArt721MinterBurner_PBAB is ReentrancyGuard {
283
351
  }
284
352
 
285
353
  // validate and split funds
286
- if (
287
- keccak256(
288
- abi.encodePacked(
289
- genArtCoreContract.projectIdToCurrencySymbol(_projectId)
290
- )
291
- ) != keccak256(abi.encodePacked("ETH"))
292
- ) {
354
+ if (configuredCurrencyAddress != address(0)) {
355
+ // validate that the specified maximum price is greater than or equal to the price per token
356
+ require(
357
+ _maxPricePerToken >= pricePerTokenInWei,
358
+ "Only max price gte token price"
359
+ );
360
+
293
361
  require(
294
362
  msg.value == 0,
295
363
  "this project accepts a different currency and cannot accept ETH"
@@ -297,28 +365,19 @@ contract GenArt721MinterBurner_PBAB is ReentrancyGuard {
297
365
  require(
298
366
  IERC20(
299
367
  genArtCoreContract.projectIdToCurrencyAddress(_projectId)
300
- ).allowance(msg.sender, address(this)) >=
301
- genArtCoreContract.projectIdToPricePerTokenInWei(
302
- _projectId
303
- ),
368
+ ).allowance(msg.sender, address(this)) >= pricePerTokenInWei,
304
369
  "Insufficient Funds Approved for TX"
305
370
  );
306
371
  require(
307
372
  IERC20(
308
373
  genArtCoreContract.projectIdToCurrencyAddress(_projectId)
309
- ).balanceOf(msg.sender) >=
310
- genArtCoreContract.projectIdToPricePerTokenInWei(
311
- _projectId
312
- ),
374
+ ).balanceOf(msg.sender) >= pricePerTokenInWei,
313
375
  "Insufficient balance."
314
376
  );
315
377
  _splitFundsERC20(_projectId);
316
378
  } else {
317
379
  require(
318
- msg.value >=
319
- genArtCoreContract.projectIdToPricePerTokenInWei(
320
- _projectId
321
- ),
380
+ msg.value >= pricePerTokenInWei,
322
381
  "Must send minimum value to mint!"
323
382
  );
324
383
  _splitFundsETH(_projectId);