@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,22 +1,23 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
+ // @dev fixed to specific solidity version for clarity and for more clear
5
+ // source code verification purposes.
4
6
  pragma solidity 0.8.19;
5
7
 
6
- import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
7
- import "../../interfaces/v0.8.x/ISharedMinterSEAV0.sol";
8
- import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
8
+ import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
9
+ import {ISharedMinterSEAV0} from "../../interfaces/v0.8.x/ISharedMinterSEAV0.sol";
10
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
9
11
 
10
- import "../../libs/v0.8.x/ABHelpers.sol";
11
- import "../../libs/v0.8.x/AuthLib.sol";
12
- import "../../libs/v0.8.x/minter-libs/SEALib.sol";
13
- import "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
14
- import "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
12
+ import {ABHelpers} from "../../libs/v0.8.x/ABHelpers.sol";
13
+ import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
14
+ import {SEALib} from "../../libs/v0.8.x/minter-libs/SEALib.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";
15
17
 
16
- import "@openzeppelin-4.7/contracts/token/ERC721/IERC721.sol";
17
- import "@openzeppelin-4.7/contracts/security/ReentrancyGuard.sol";
18
- import "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
19
- import "@openzeppelin-4.7/contracts/utils/math/Math.sol";
18
+ import {ReentrancyGuard} from "@openzeppelin-4.7/contracts/security/ReentrancyGuard.sol";
19
+ import {SafeCast} from "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
20
+ import {Math} from "@openzeppelin-4.7/contracts/utils/math/Math.sol";
20
21
 
21
22
  /**
22
23
  * @title Filtered Minter contract that allows tokens to be minted with ETH.
@@ -90,6 +91,13 @@ import "@openzeppelin-4.7/contracts/utils/math/Math.sol";
90
91
  * ----------------------------------------------------------------------------
91
92
  * Additional admin and artist privileged roles may be described on other
92
93
  * contracts that this minter integrates with.
94
+ * ----------------------------------------------------------------------------
95
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
96
+ * Core Registry to assign this minter, this minter does not enforce that a
97
+ * project is registered when configured or queried. This is primarily for gas
98
+ * optimization purposes. It is, therefore, possible that fake projects may be
99
+ * configured on this minter, but they will not be able to mint tokens due to
100
+ * checks performed by this minter's Minter Filter.
93
101
  *
94
102
  * @dev Note that while this minter makes use of `block.timestamp` and it is
95
103
  * technically possible that this value is manipulated by block producers, such
@@ -102,73 +110,39 @@ import "@openzeppelin-4.7/contracts/utils/math/Math.sol";
102
110
  contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
103
111
  using SafeCast for uint256;
104
112
 
105
- /// Minter filter address this minter interacts with
113
+ /// @notice Minter filter address this minter interacts with
106
114
  address public immutable minterFilterAddress;
107
115
 
108
- /// Minter filter this minter may interact with.
109
- IMinterFilterV1 private immutable minterFilter;
116
+ /// @notice Minter filter this minter may interact with.
117
+ IMinterFilterV1 private immutable _minterFilter;
110
118
 
111
- /// minterType for this minter
119
+ /// @notice minterType for this minter
112
120
  string public constant minterType = "MinterSEAV1";
113
121
 
114
- /// minter version for this minter
122
+ /// @notice minter version for this minter
115
123
  string public constant minterVersion = "v1.0.0";
116
124
 
125
+ /// @notice Minimum auction duration
117
126
  uint256 public constant MIN_AUCTION_DURATION_SECONDS = 60; // seconds
118
127
 
119
128
  // minter-wide, AdminACL-configurable parameters, where AdminACL is the
120
129
  // admin of this minter's MinterFilter.
121
130
  // ----------------------------------------
122
- // minimum time remaining in auction after a new bid is placed
123
- // configureable by admin, default to 120 seconds
124
- // max uint32 ~= 4.3e9 sec ~= 136 years
125
- // @dev used when determining the buffer time for any new bid on the
126
- // minter, across all projects
127
- uint32 minterTimeBufferSeconds = 120;
128
- // gas limit for refunding ETH to bidders
129
- // configurable by admin, default to 30,000
130
- // max uint24 ~= 16 million gas, more than enough for a refund
131
- // @dev SENDALL fallback is used to refund ETH if this limit is exceeded
132
- uint24 minterRefundGasLimit = 30_000;
133
-
134
- // storage mappings for project and contract configs
135
- // @dev base minter project config is not used on this minter, therefore no
136
- // mapping is declared here to ProjectConfig structs
137
-
138
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
139
- // STATE VARIABLES FOR SplitFundsLib begin here
140
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
141
-
142
- // contractAddress => IsEngineCache
143
- mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
144
-
145
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
146
- // STATE VARIABLES FOR SplitFundsLib end here
147
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
148
-
149
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
150
- // STATE VARIABLES FOR MaxInvocationsLib begin here
151
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
152
-
153
- // contractAddress => projectId => max invocations specific project config
154
- mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
155
- private _maxInvocationsProjectConfigMapping;
156
-
157
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
158
- // STATE VARIABLES FOR MaxInvocationsLib end here
159
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
160
131
 
161
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
162
- // STATE VARIABLES FOR SEALib begin here
163
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
164
-
165
- // contractAddress => projectId => SEA project config
166
- mapping(address => mapping(uint256 => SEALib.SEAProjectConfig))
167
- private _SEAProjectConfigs;
132
+ /** @notice minimum time remaining in auction after a new bid is placed
133
+ * configureable by admin, default to 120 seconds
134
+ * max uint32 ~= 4.3e9 sec ~= 136 years
135
+ * @dev used when determining the buffer time for any new bid on the
136
+ * minter, across all projects
137
+ */
138
+ uint32 internal _minterTimeBufferSeconds = 120;
168
139
 
169
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
170
- // STATE VARIABLES FOR SEALib end here
171
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
140
+ /** @notice Gas limit for refunding ETH to bidders
141
+ * configurable by admin, default to 30,000
142
+ * max uint24 ~= 16 million gas, more than enough for a refund
143
+ * @dev SENDALL fallback is used to refund ETH if this limit is exceeded
144
+ */
145
+ uint24 internal _minterRefundGasLimit = 30_000;
172
146
 
173
147
  // MODIFIERS
174
148
  // @dev contract uses modifier-like internal functions instead of modifiers
@@ -182,56 +156,56 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
182
156
 
183
157
  /**
184
158
  * @notice Initializes contract to be a shared, filtered minter for
185
- * minter filter `_minterFilter`
186
- * @param _minterFilter Minter filter for which this will be a minter
159
+ * minter filter `minterFilter`
160
+ * @param minterFilter Minter filter for which this will be a minter
187
161
  */
188
- constructor(address _minterFilter) ReentrancyGuard() {
189
- minterFilterAddress = _minterFilter;
190
- minterFilter = IMinterFilterV1(_minterFilter);
162
+ constructor(address minterFilter) ReentrancyGuard() {
163
+ minterFilterAddress = minterFilter;
164
+ _minterFilter = IMinterFilterV1(minterFilter);
191
165
  // emit events indicating default minter configuration values
192
- emit MinAuctionDurationSecondsUpdated(MIN_AUCTION_DURATION_SECONDS);
193
- emit MinterTimeBufferUpdated(minterTimeBufferSeconds);
194
- emit MinterRefundGasLimitUpdated(minterRefundGasLimit);
166
+ emit SEALib.MinAuctionDurationSecondsUpdated(
167
+ MIN_AUCTION_DURATION_SECONDS
168
+ );
169
+ emit SEALib.MinterTimeBufferUpdated(_minterTimeBufferSeconds);
170
+ emit SEALib.MinterRefundGasLimitUpdated(_minterRefundGasLimit);
195
171
  }
196
172
 
197
173
  /**
198
- * @notice Manually sets the local maximum invocations of project `_projectId`
199
- * with the provided `_maxInvocations`, checking that `_maxInvocations` is less
200
- * than or equal to the value of project `_project_id`'s maximum invocations that is
174
+ * @notice Manually sets the local maximum invocations of project `projectId`
175
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
176
+ * than or equal to the value of project `project_id`'s maximum invocations that is
201
177
  * set on the core contract.
202
- * @dev Note that a `_maxInvocations` of 0 can only be set if the current `invocations`
178
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
203
179
  * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
204
180
  * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
205
- * @param _projectId Project ID to set the maximum invocations for.
206
- * @param _coreContract Core contract address for the given project.
207
- * @param _maxInvocations Maximum invocations to set for the project.
181
+ * @param projectId Project ID to set the maximum invocations for.
182
+ * @param coreContract Core contract address for the given project.
183
+ * @param maxInvocations Maximum invocations to set for the project.
208
184
  */
209
185
  function manuallyLimitProjectMaxInvocations(
210
- uint256 _projectId,
211
- address _coreContract,
212
- uint24 _maxInvocations
186
+ uint256 projectId,
187
+ address coreContract,
188
+ uint24 maxInvocations
213
189
  ) external {
214
190
  AuthLib.onlyArtist({
215
- _projectId: _projectId,
216
- _coreContract: _coreContract,
217
- _sender: msg.sender
191
+ projectId: projectId,
192
+ coreContract: coreContract,
193
+ sender: msg.sender
194
+ });
195
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
196
+ projectId: projectId,
197
+ coreContract: coreContract,
198
+ maxInvocations: maxInvocations
218
199
  });
219
- MaxInvocationsLib.manuallyLimitProjectMaxInvocations(
220
- _projectId,
221
- _coreContract,
222
- _maxInvocations,
223
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
224
- );
225
- emit ProjectMaxInvocationsLimitUpdated(
226
- _projectId,
227
- _coreContract,
228
- _maxInvocations
229
- );
230
200
 
231
201
  // @dev the following is unique behavior to this minter
232
202
  // for convenience, try to mint and assign a token to the project's
233
203
  // next slot
234
- _tryMintTokenToNextSlot(_projectId, _coreContract);
204
+ SEALib.tryMintTokenToNextSlot({
205
+ projectId: projectId,
206
+ coreContract: coreContract,
207
+ minterFilter: _minterFilter
208
+ });
235
209
  }
236
210
 
237
211
  /**
@@ -239,22 +213,22 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
239
213
  * the minimum amount of time that must pass between the final bid and the
240
214
  * the end of an auction. Auctions are extended if a new bid is placed
241
215
  * within this time buffer of the auction end time.
242
- * @param _minterTimeBufferSeconds Time buffer in seconds.
216
+ * @param minterTimeBufferSeconds Time buffer in seconds.
243
217
  */
244
218
  function updateMinterTimeBufferSeconds(
245
- uint32 _minterTimeBufferSeconds
219
+ uint32 minterTimeBufferSeconds
246
220
  ) external {
247
221
  // CHECKS
248
- _onlyNonZero(_minterTimeBufferSeconds);
222
+ _onlyNonZero(minterTimeBufferSeconds);
249
223
  AuthLib.onlyMinterFilterAdminACL({
250
- _minterFilterAddress: minterFilterAddress,
251
- _sender: msg.sender,
252
- _contract: address(this),
253
- _selector: this.updateMinterTimeBufferSeconds.selector
224
+ minterFilterAddress: minterFilterAddress,
225
+ sender: msg.sender,
226
+ contract_: address(this),
227
+ selector: this.updateMinterTimeBufferSeconds.selector
254
228
  });
255
229
  // EFFECTS
256
- minterTimeBufferSeconds = _minterTimeBufferSeconds;
257
- emit MinterTimeBufferUpdated(_minterTimeBufferSeconds);
230
+ _minterTimeBufferSeconds = minterTimeBufferSeconds;
231
+ emit SEALib.MinterTimeBufferUpdated(minterTimeBufferSeconds);
258
232
  }
259
233
 
260
234
  /**
@@ -265,120 +239,99 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
265
239
  * bid.
266
240
  * @dev max gas limit is ~16M, which is considered well over a future-safe
267
241
  * upper bound.
268
- * @param _minterRefundGasLimit Gas limit to set for refunds. Must be
242
+ * @param minterRefundGasLimit Gas limit to set for refunds. Must be
269
243
  * between 7,000 and max uint24 (~16M).
270
244
  */
271
- function updateRefundGasLimit(uint24 _minterRefundGasLimit) external {
245
+ function updateRefundGasLimit(uint24 minterRefundGasLimit) external {
272
246
  // CHECKS
273
247
  AuthLib.onlyMinterFilterAdminACL({
274
- _minterFilterAddress: minterFilterAddress,
275
- _sender: msg.sender,
276
- _contract: address(this),
277
- _selector: this.updateRefundGasLimit.selector
248
+ minterFilterAddress: minterFilterAddress,
249
+ sender: msg.sender,
250
+ contract_: address(this),
251
+ selector: this.updateRefundGasLimit.selector
278
252
  });
279
- // @dev max gas limit implicitly checked by using uint16 input arg
253
+ // @dev max gas limit implicitly checked by using uint24 input arg
280
254
  // @dev min gas limit is based on rounding up current cost to send ETH
281
255
  // to a Gnosis Safe wallet, which accesses cold address and emits event
282
- require(_minterRefundGasLimit >= 7_000, "Only gte 7_000");
256
+ require(minterRefundGasLimit >= 7_000, "Only gte 7_000");
283
257
  // EFFECTS
284
- minterRefundGasLimit = _minterRefundGasLimit;
285
- emit MinterRefundGasLimitUpdated(_minterRefundGasLimit);
258
+ _minterRefundGasLimit = minterRefundGasLimit;
259
+ emit SEALib.MinterRefundGasLimitUpdated(minterRefundGasLimit);
286
260
  }
287
261
 
288
262
  /**
289
- * @notice Sets auction details for project `_projectId`.
263
+ * @notice Sets auction details for project `projectId`.
290
264
  * If project does not have a "next token" assigned, this function attempts
291
265
  * to mint a token and assign it to the project's next token slot.
292
- * @param _projectId Project ID to set future auction details for.
293
- * @param _coreContract Core contract address for the given project.
294
- * @param _timestampStart Timestamp after which new auctions may be
266
+ * @param projectId Project ID to set future auction details for.
267
+ * @param coreContract Core contract address for the given project.
268
+ * @param timestampStart Timestamp after which new auctions may be
295
269
  * started. Note that this is not the timestamp of the auction start, but
296
270
  * rather the timestamp after which a auction may be started. Also note
297
271
  * that the passed value here must either be in the future, or `0` (which
298
272
  * indicates that auctions are immediately startable).
299
- * @param _auctionDurationSeconds Duration of new auctions, in seconds,
273
+ * @param auctionDurationSeconds Duration of new auctions, in seconds,
300
274
  * before any extensions due to bids being placed inside buffer period near
301
275
  * the end of an auction.
302
- * @param _basePrice reserve price (minimum starting bid price), in wei.
276
+ * @param basePrice reserve price (minimum starting bid price), in wei.
303
277
  * Must be greater than 0, but may be as low as 1 wei.
304
- * @param _minBidIncrementPercentage Minimum percentage amount that a new
278
+ * @param minBidIncrementPercentage Minimum percentage amount that a new
305
279
  * bid must be over the previous bid. Must be greater than 0, and may be as
306
280
  * high as 255. Recommended value is 5%. Values represent whole
307
281
  * percentages, so a value of 5 represents 5%.
308
- * @dev `_basePrice` of zero not allowed to prevent accidental
282
+ * @dev `basePrice` of zero not allowed to prevent accidental
309
283
  * misconfiguration of auctions
310
284
  */
311
285
  function configureFutureAuctions(
312
- uint256 _projectId,
313
- address _coreContract,
314
- uint256 _timestampStart,
315
- uint256 _auctionDurationSeconds,
316
- uint256 _basePrice,
317
- uint8 _minBidIncrementPercentage
286
+ uint256 projectId,
287
+ address coreContract,
288
+ uint256 timestampStart,
289
+ uint256 auctionDurationSeconds,
290
+ uint256 basePrice,
291
+ uint8 minBidIncrementPercentage
318
292
  ) external {
319
293
  // CHECKS
320
- _onlyNonZero(_basePrice);
321
- _onlyNonZero(_minBidIncrementPercentage);
294
+ // @dev non-zero basePrice and minBidIncrementPercentage are checked in
295
+ // SEALib.configureFutureAuctions, therefore not redundantly checked
296
+ // here
322
297
  AuthLib.onlyArtist({
323
- _projectId: _projectId,
324
- _coreContract: _coreContract,
325
- _sender: msg.sender
298
+ projectId: projectId,
299
+ coreContract: coreContract,
300
+ sender: msg.sender
326
301
  });
327
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
328
- _coreContract
329
- ][_projectId];
330
- MaxInvocationsLib.MaxInvocationsProjectConfig
331
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
332
- _coreContract
333
- ][_projectId];
334
302
  require(
335
- _timestampStart == 0 || block.timestamp < _timestampStart,
336
- "Only future start times or 0"
337
- );
338
- require(
339
- _auctionDurationSeconds >= MIN_AUCTION_DURATION_SECONDS,
303
+ auctionDurationSeconds >= MIN_AUCTION_DURATION_SECONDS,
340
304
  "Auction duration below minimum"
341
305
  );
342
- // EFFECTS
343
- _SEAProjectConfig.timestampStart = _timestampStart.toUint64();
344
- _SEAProjectConfig.auctionDurationSeconds = _auctionDurationSeconds
345
- .toUint32();
346
- _SEAProjectConfig.basePrice = _basePrice;
347
- _SEAProjectConfig
348
- .minBidIncrementPercentage = _minBidIncrementPercentage;
306
+ SEALib.configureFutureAuctions({
307
+ projectId: projectId,
308
+ coreContract: coreContract,
309
+ timestampStart: timestampStart,
310
+ auctionDurationSeconds: auctionDurationSeconds,
311
+ basePrice: basePrice,
312
+ minBidIncrementPercentage: minBidIncrementPercentage
313
+ });
349
314
 
350
- emit ConfiguredFutureAuctions({
351
- projectId: _projectId,
352
- coreContract: _coreContract,
353
- timestampStart: _timestampStart.toUint64(),
354
- auctionDurationSeconds: _auctionDurationSeconds.toUint32(),
355
- basePrice: _basePrice,
356
- minBidIncrementPercentage: _minBidIncrementPercentage
315
+ // for convenience, refresh max invocations to ensure they are
316
+ // populated and updated, without imposing any additional restrictions
317
+ // if already configured.
318
+ MaxInvocationsLib.refreshMaxInvocations({
319
+ projectId: projectId,
320
+ coreContract: coreContract
357
321
  });
358
322
 
359
- // for convenience, sync local max invocations to the core contract if
360
- // and only if max invocations have not already been synced.
361
- // @dev do not sync if max invocations have already been synced, as
362
- // local max invocations could have been manually set to be
363
- // intentionally less than the core contract's max invocations.
364
- // sync local max invocations if not initially populated
365
- if (
366
- MaxInvocationsLib.maxInvocationsIsUnconfigured(
367
- _maxInvocationsProjectConfig
368
- )
369
- ) {
370
- syncProjectMaxInvocationsToCore(_projectId, _coreContract);
371
- // @dev syncProjectMaxInvocationsToCore function calls
372
- // _tryMintTokenToNextSlot, so we do not call it here.
373
- } else {
374
- // for convenience, try to mint to next token slot
375
- _tryMintTokenToNextSlot(_projectId, _coreContract);
376
- }
323
+ // try to mint to the next token slot to ensure that the next token
324
+ // slot is populated, if possible
325
+ SEALib.tryMintTokenToNextSlot({
326
+ projectId: projectId,
327
+ coreContract: coreContract,
328
+ minterFilter: _minterFilter
329
+ });
377
330
  }
378
331
 
379
332
  /**
380
- * @notice Resets future auction configuration for project `_projectId` on
381
- * core contract `_coreContract`, zero-ing out all details having to do
333
+ * @notice Resets future auction configuration for project `projectId` on
334
+ * core contract `coreContract`, zero-ing out all details having to do
382
335
  * with future auction parameters.
383
336
  * This is not intended to be used in normal operation, but rather only in
384
337
  * case of the need to halt the creation of any future auctions.
@@ -386,36 +339,35 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
386
339
  * Does not affect any project next token details (i.e. if a next token is
387
340
  * assigned, it will remain assigned and held by the minter until auction
388
341
  * details are reconfigured).
389
- * @param _projectId Project ID to reset future auction configuration
342
+ * @param projectId Project ID to reset future auction configuration
390
343
  * details for.
391
- * @param _coreContract Core contract address for the given project.
344
+ * @param coreContract Core contract address for the given project.
392
345
  */
393
346
  function resetFutureAuctionDetails(
394
- uint256 _projectId,
395
- address _coreContract
347
+ uint256 projectId,
348
+ address coreContract
396
349
  ) external {
397
350
  AuthLib.onlyCoreAdminACLOrArtist({
398
- _projectId: _projectId,
399
- _coreContract: _coreContract,
400
- _sender: msg.sender,
401
- _contract: address(this),
402
- _selector: this.resetFutureAuctionDetails.selector
351
+ projectId: projectId,
352
+ coreContract: coreContract,
353
+ sender: msg.sender,
354
+ contract_: address(this),
355
+ selector: this.resetFutureAuctionDetails.selector
403
356
  });
404
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
405
- _coreContract
406
- ][_projectId];
407
357
  // reset to initial values
408
- SEALib.resetFutureAuctionDetails(_SEAProjectConfig);
358
+ SEALib.resetFutureAuctionDetails({
359
+ projectId: projectId,
360
+ coreContract: coreContract
361
+ });
409
362
  // @dev do not affect next token or max invocations
410
- emit ResetAuctionDetails(_projectId, _coreContract);
411
363
  }
412
364
 
413
365
  /**
414
366
  * @notice Admin-only function that ejects a project's "next token" from
415
- * the minter and sends it to the input `_to` address.
367
+ * the minter and sends it to the input `to` address.
416
368
  * This function is only intended for use in the edge case where the minter
417
369
  * has a "next token" assigned to a project, but the project has been reset
418
- * via `resetAuctionDetails`, and the artist does not want an auction to be
370
+ * via `resetFutureAuctionDetails`, and the artist does not want an auction to be
419
371
  * started for the "next token". This function also protects against the
420
372
  * unforseen case where the minter is in an unexpected state where it has a
421
373
  * "next token" assigned to a project, but for some reason the project is
@@ -425,129 +377,109 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
425
377
  * no further tokens will be assigned to the project's "next token" slot,
426
378
  * unless the project is subsequently reconfigured via an artist call to
427
379
  * `configureFutureAuctions`.
428
- * @param _projectId Project ID to eject next token for.
429
- * @param _coreContract Core contract address for the given project.
430
- * @param _to Address to send the ejected token to.
380
+ * @param projectId Project ID to eject next token for.
381
+ * @param coreContract Core contract address for the given project.
382
+ * @param to Address to send the ejected token to.
431
383
  */
432
384
  function ejectNextTokenTo(
433
- uint256 _projectId,
434
- address _coreContract,
435
- address _to
385
+ uint256 projectId,
386
+ address coreContract,
387
+ address to
436
388
  ) external {
437
389
  AuthLib.onlyCoreAdminACL({
438
- _coreContract: _coreContract,
439
- _sender: msg.sender,
440
- _contract: address(this),
441
- _selector: this.ejectNextTokenTo.selector
442
- });
443
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
444
- _coreContract
445
- ][_projectId];
446
- // CHECKS
447
- // only if project is not configured (i.e. artist called
448
- // `resetAuctionDetails`)
449
- require(
450
- !SEALib.projectIsConfigured(_SEAProjectConfig),
451
- "Only unconfigured projects"
452
- );
453
- // only if project has a next token assigned
454
- require(
455
- _SEAProjectConfig.nextTokenNumberIsPopulated == true,
456
- "No next token"
457
- );
458
- // EFFECTS
459
- _SEAProjectConfig.nextTokenNumberIsPopulated = false;
460
- // INTERACTIONS
461
- // @dev overflow automatically handled by Sol ^0.8.0
462
- uint256 nextTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
463
- _projectId: _projectId,
464
- _tokenNumber: _SEAProjectConfig.nextTokenNumber
390
+ coreContract: coreContract,
391
+ sender: msg.sender,
392
+ contract_: address(this),
393
+ selector: this.ejectNextTokenTo.selector
465
394
  });
466
- IERC721(_coreContract).transferFrom({
467
- from: address(this),
468
- to: _to,
469
- tokenId: nextTokenId
395
+ SEALib.ejectNextTokenTo({
396
+ projectId: projectId,
397
+ coreContract: coreContract,
398
+ to: to
470
399
  });
471
- emit ProjectNextTokenEjected(_projectId, _coreContract);
472
400
  }
473
401
 
474
402
  /**
475
- * @notice Settles any complete auction for token `_settleTokenId` (if
403
+ * @notice Settles any complete auction for token `settleTokenId` (if
476
404
  * applicable), then attempts to create a bid for token
477
- * `_bidTokenId` with bid amount and bidder address equal to
405
+ * `bidTokenId` with bid amount and bidder address equal to
478
406
  * `msg.value` and `msg.sender`, respectively.
479
407
  * Intended to gracefully handle the case where a user is front-run by
480
408
  * one or more transactions to settle and/or initialize a new auction,
481
409
  * potentially still placing a bid on the auction for the token ID if the
482
410
  * bid value is sufficiently higher than the current highest bid.
483
- * Note that the use of `_bidTokenId` is to prevent the possibility of
411
+ * Note that the use of `bidTokenId` is to prevent the possibility of
484
412
  * transactions that are stuck in the pending pool for long periods of time
485
413
  * from unintentionally bidding on auctions for future tokens.
486
414
  * Note that calls to `settleAuction` and `createBid` are possible
487
415
  * to be called in separate transactions, but this function is provided for
488
416
  * convenience and executes both of those functions in a single
489
417
  * transaction, while handling front-running as gracefully as possible.
490
- * @param _settleTokenId Token ID to settle auction for.
491
- * @param _bidTokenId Token ID to bid on.
492
- * @param _coreContract Core contract address for the given project.
418
+ * @param settleTokenId Token ID to settle auction for.
419
+ * @param bidTokenId Token ID to bid on.
420
+ * @param coreContract Core contract address for the given project.
493
421
  * @dev this function is not non-reentrant, but the underlying calls are
494
422
  * to non-reentrant functions.
495
423
  */
496
424
  function settleAuctionAndCreateBid(
497
- uint256 _settleTokenId,
498
- uint256 _bidTokenId,
499
- address _coreContract
425
+ uint256 settleTokenId,
426
+ uint256 bidTokenId,
427
+ address coreContract
500
428
  ) external payable {
501
429
  // ensure tokens are in the same project
502
430
  require(
503
- ABHelpers.tokenIdToProjectId(_settleTokenId) ==
504
- ABHelpers.tokenIdToProjectId(_bidTokenId),
431
+ ABHelpers.tokenIdToProjectId(settleTokenId) ==
432
+ ABHelpers.tokenIdToProjectId(bidTokenId),
505
433
  "Only tokens in same project"
506
434
  );
507
435
  // settle completed auction, if applicable
508
- settleAuction(_settleTokenId, _coreContract);
436
+ settleAuction({tokenId: settleTokenId, coreContract: coreContract});
509
437
  // attempt to bid on next token
510
- createBid(_bidTokenId, _coreContract);
438
+ createBid({tokenId: bidTokenId, coreContract: coreContract});
511
439
  }
512
440
 
513
441
  /**
514
442
  * @notice View function to return the current minter-level configuration
515
443
  * details.
516
- * @return minAuctionDurationSeconds_ Minimum auction duration in seconds.
444
+ * @return minAuctionDurationSeconds Minimum auction duration in seconds.
517
445
  * Note that this value is a constant on this version of the minter.
518
- * @return minterTimeBufferSeconds_ Buffer time in seconds
519
- * @return minterRefundGasLimit_ Gas limit for refunding ETH
446
+ * @return minterTimeBufferSeconds Buffer time in seconds
447
+ * @return minterRefundGasLimit Gas limit for refunding ETH
520
448
  */
521
449
  function minterConfigurationDetails()
522
450
  external
523
451
  view
524
452
  returns (
525
- uint256 minAuctionDurationSeconds_,
526
- uint32 minterTimeBufferSeconds_,
527
- uint24 minterRefundGasLimit_
453
+ uint256 minAuctionDurationSeconds,
454
+ uint32 minterTimeBufferSeconds,
455
+ uint24 minterRefundGasLimit
528
456
  )
529
457
  {
530
- minAuctionDurationSeconds_ = MIN_AUCTION_DURATION_SECONDS;
531
- minterTimeBufferSeconds_ = minterTimeBufferSeconds;
532
- minterRefundGasLimit_ = minterRefundGasLimit;
458
+ minAuctionDurationSeconds = MIN_AUCTION_DURATION_SECONDS;
459
+ minterTimeBufferSeconds = _minterTimeBufferSeconds;
460
+ minterRefundGasLimit = _minterRefundGasLimit;
533
461
  }
534
462
 
535
463
  /**
536
464
  * @notice Gets the maximum invocations project configuration.
537
- * @param _projectId The ID of the project whose data needs to be fetched.
538
- * @param _coreContract The address of the core contract.
465
+ * @param projectId The ID of the project whose data needs to be fetched.
466
+ * @param coreContract The address of the core contract.
539
467
  * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
540
468
  * configuration data.
541
469
  */
542
470
  function maxInvocationsProjectConfig(
543
- uint256 _projectId,
544
- address _coreContract
471
+ uint256 projectId,
472
+ address coreContract
545
473
  )
546
474
  external
547
475
  view
548
476
  returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
549
477
  {
550
- return _maxInvocationsProjectConfigMapping[_coreContract][_projectId];
478
+ return
479
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
480
+ projectId: projectId,
481
+ coreContract: coreContract
482
+ });
551
483
  }
552
484
 
553
485
  /**
@@ -561,17 +493,18 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
561
493
  * possible because the V3 core contract only allows maximum invocations
562
494
  * to be reduced, not increased. Based on this rationale, we intentionally
563
495
  * do not do input validation in this method as to whether or not the input
564
- * @param `_projectId` is an existing project ID.
565
- * @param `_coreContract` is an existing core contract address.
496
+ * @param projectId is an existing project ID.
497
+ * @param coreContract is an existing core contract address.
566
498
  */
567
499
  function projectMaxHasBeenInvoked(
568
- uint256 _projectId,
569
- address _coreContract
500
+ uint256 projectId,
501
+ address coreContract
570
502
  ) external view returns (bool) {
571
503
  return
572
- MaxInvocationsLib.getMaxHasBeenInvoked(
573
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
574
- );
504
+ MaxInvocationsLib.getMaxHasBeenInvoked({
505
+ projectId: projectId,
506
+ coreContract: coreContract
507
+ });
575
508
  }
576
509
 
577
510
  /**
@@ -590,41 +523,41 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
590
523
  * increased. When this happens, the minter will enable minting, allowing
591
524
  * the core contract to enforce the max invocations check. Based on this
592
525
  * rationale, we intentionally do not do input validation in this method as
593
- * to whether or not the input `_projectId` is an existing project ID.
594
- * @param `_projectId` is an existing project ID.
595
- * @param `_coreContract` is an existing core contract address.
526
+ * to whether or not the input `projectId` is an existing project ID.
527
+ * @param projectId is an existing project ID.
528
+ * @param coreContract is an existing core contract address.
596
529
  */
597
530
  function projectMaxInvocations(
598
- uint256 _projectId,
599
- address _coreContract
531
+ uint256 projectId,
532
+ address coreContract
600
533
  ) external view returns (uint256) {
601
534
  return
602
- MaxInvocationsLib.getMaxInvocations(
603
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
604
- );
535
+ MaxInvocationsLib.getMaxInvocations({
536
+ projectId: projectId,
537
+ coreContract: coreContract
538
+ });
605
539
  }
606
540
 
607
541
  /**
608
- * @notice Checks if the specified `_coreContract` is a valid engine contract.
609
- * @dev This function retrieves the cached value of `_isEngine` from
542
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
543
+ * @dev This function retrieves the cached value of `isEngine` from
610
544
  * the `isEngineCache` mapping. If the cached value is already set, it
611
- * returns the cached value. Otherwise, it calls the `getV3CoreIsEngine`
612
- * function from the `SplitFundsLib` library to check if `_coreContract`
545
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
546
+ * function from the `SplitFundsLib` library to check if `coreContract`
613
547
  * is a valid engine contract.
614
- * @dev This function will revert if the provided `_coreContract` is not
548
+ * @dev This function will revert if the provided `coreContract` is not
615
549
  * a valid Engine or V3 Flagship contract.
616
- * @param _coreContract The address of the contract to check.
617
- * @return bool indicating if `_coreContract` is a valid engine contract.
550
+ * @param coreContract The address of the contract to check.
551
+ * @return bool indicating if `coreContract` is a valid engine contract.
618
552
  */
619
- function isEngineView(address _coreContract) external view returns (bool) {
620
- SplitFundsLib.IsEngineCache storage isEngineCache = _isEngineCaches[
621
- _coreContract
622
- ];
553
+ function isEngineView(address coreContract) external view returns (bool) {
554
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
555
+ .getIsEngineCacheConfig(coreContract);
623
556
  if (isEngineCache.isCached) {
624
557
  return isEngineCache.isEngine;
625
558
  } else {
626
- // @dev this calls the non-modifying variant of getV3CoreIsEngine
627
- return SplitFundsLib.getV3CoreIsEngineView(_coreContract);
559
+ // @dev this calls the non-state-modifying variant of isEngine
560
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
628
561
  }
629
562
  }
630
563
 
@@ -632,36 +565,40 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
632
565
  * @notice projectId => SEA project configuration details.
633
566
  * Note that in the case of no auction being initialized for the project,
634
567
  * the returned `auction` will be the default struct.
635
- * @param _projectId The project ID
636
- * @param _coreContract The core contract address
637
- * @return _SEAProjectConfig The SEA project configuration details
568
+ * @param projectId The project ID
569
+ * @param coreContract The core contract address
570
+ * @return SEAProjectConfig_ The SEA project configuration details
638
571
  */
639
572
  function SEAProjectConfigurationDetails(
640
- uint256 _projectId,
641
- address _coreContract
642
- ) external view returns (SEALib.SEAProjectConfig memory _SEAProjectConfig) {
643
- _SEAProjectConfig = _SEAProjectConfigs[_coreContract][_projectId];
573
+ uint256 projectId,
574
+ address coreContract
575
+ ) external view returns (SEALib.SEAProjectConfig memory SEAProjectConfig_) {
576
+ SEAProjectConfig_ = SEALib.getSEAProjectConfig({
577
+ projectId: projectId,
578
+ coreContract: coreContract
579
+ });
644
580
  // clean up next token number to handle case where it is stale
645
- _SEAProjectConfig.nextTokenNumber = _SEAProjectConfig
581
+ SEAProjectConfig_.nextTokenNumber = SEAProjectConfig_
646
582
  .nextTokenNumberIsPopulated
647
- ? _SEAProjectConfig.nextTokenNumber
583
+ ? SEAProjectConfig_.nextTokenNumber
648
584
  : 0;
649
585
  }
650
586
 
651
587
  /**
652
588
  * @notice projectId => active auction details.
653
589
  * @dev reverts if no auction exists for the project.
654
- * @param _projectId The project ID
655
- * @param _coreContract The core contract address
590
+ * @param projectId The project ID
591
+ * @param coreContract The core contract address
656
592
  */
657
593
  function projectActiveAuctionDetails(
658
- uint256 _projectId,
659
- address _coreContract
594
+ uint256 projectId,
595
+ address coreContract
660
596
  ) external view returns (SEALib.Auction memory auction) {
661
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
662
- _coreContract
663
- ][_projectId];
664
- return SEALib.projectActiveAuctionDetails(_SEAProjectConfig);
597
+ return
598
+ SEALib.projectActiveAuctionDetails({
599
+ projectId: projectId,
600
+ coreContract: coreContract
601
+ });
665
602
  }
666
603
 
667
604
  /**
@@ -674,37 +611,39 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
674
611
  * target bid token ID to be passed in as an argument.
675
612
  * The function reverts if a project does not have an active auction and
676
613
  * the next expected token ID has not been populated.
677
- * @param _projectId The project ID being queried
678
- * @param _coreContract The core contract address
614
+ * @param projectId The project ID being queried
615
+ * @param coreContract The core contract address
679
616
  * @return The current token ID being auctioned, or the next token ID to be
680
617
  * auctioned if a new auction is ready to be created.
681
618
  */
682
619
  function getTokenToBid(
683
- uint256 _projectId,
684
- address _coreContract
620
+ uint256 projectId,
621
+ address coreContract
685
622
  ) external view returns (uint256) {
686
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
687
- _coreContract
688
- ][_projectId];
689
- return SEALib.getTokenToBid(_SEAProjectConfig, _projectId);
623
+ return
624
+ SEALib.getTokenToBid({
625
+ projectId: projectId,
626
+ coreContract: coreContract
627
+ });
690
628
  }
691
629
 
692
630
  /**
693
631
  * @notice View function that returns the next token ID to be auctioned
694
- * by this minter for project `_projectId`.
632
+ * by this minter for project `projectId`.
695
633
  * Reverts if the next token ID has not been populated for the project.
696
- * @param _projectId The project ID being queried
697
- * @param _coreContract The core contract address
634
+ * @param projectId The project ID being queried
635
+ * @param coreContract The core contract address
698
636
  * @return nextTokenId The next token ID to be auctioned by this minter
699
637
  */
700
638
  function getNextTokenId(
701
- uint256 _projectId,
702
- address _coreContract
639
+ uint256 projectId,
640
+ address coreContract
703
641
  ) external view returns (uint256 nextTokenId) {
704
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
705
- _coreContract
706
- ][_projectId];
707
- return SEALib.getNextTokenId(_SEAProjectConfig, _projectId);
642
+ return
643
+ SEALib.getNextTokenId({
644
+ projectId: projectId,
645
+ coreContract: coreContract
646
+ });
708
647
  }
709
648
 
710
649
  /**
@@ -722,8 +661,8 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
722
661
  * token auction.
723
662
  * Also returns currency symbol and address to be being used as payment,
724
663
  * which for this minter is ETH only.
725
- * @param _projectId Project ID to get price information for.
726
- * @param _coreContract Core contract to get price information for.
664
+ * @param projectId Project ID to get price information for.
665
+ * @param coreContract Core contract to get price information for.
727
666
  * @return isConfigured true only if project auctions are configured.
728
667
  * @return tokenPriceInWei price in wei to become the leading bidder on a
729
668
  * token auction.
@@ -733,8 +672,8 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
733
672
  * this minter. This minter always returns null address, reserved for ether
734
673
  */
735
674
  function getPriceInfo(
736
- uint256 _projectId,
737
- address _coreContract
675
+ uint256 projectId,
676
+ address coreContract
738
677
  )
739
678
  external
740
679
  view
@@ -745,55 +684,51 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
745
684
  address currencyAddress
746
685
  )
747
686
  {
748
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
749
- _coreContract
750
- ][_projectId];
751
- (isConfigured, tokenPriceInWei) = SEALib
752
- .getPriceInfoFromSEAProjectConfig(_SEAProjectConfig);
687
+ (isConfigured, tokenPriceInWei) = SEALib.getPriceInfo({
688
+ projectId: projectId,
689
+ coreContract: coreContract
690
+ });
753
691
  // currency is always ETH
754
692
  currencySymbol = "ETH";
755
693
  currencyAddress = address(0);
756
694
  }
757
695
 
758
696
  /**
759
- * @notice Syncs local maximum invocations of project `_projectId` based on
697
+ * @notice Syncs local maximum invocations of project `projectId` based on
760
698
  * the value currently defined in the core contract.
761
- * @param _projectId Project ID to set the maximum invocations for.
762
- * @param _coreContract Core contract address for the given project.
699
+ * @param projectId Project ID to set the maximum invocations for.
700
+ * @param coreContract Core contract address for the given project.
763
701
  * @dev this enables gas reduction after maxInvocations have been reached -
764
702
  * core contracts shall still enforce a maxInvocation check during mint.
765
703
  */
766
704
  function syncProjectMaxInvocationsToCore(
767
- uint256 _projectId,
768
- address _coreContract
705
+ uint256 projectId,
706
+ address coreContract
769
707
  ) public {
770
708
  AuthLib.onlyArtist({
771
- _projectId: _projectId,
772
- _coreContract: _coreContract,
773
- _sender: msg.sender
709
+ projectId: projectId,
710
+ coreContract: coreContract,
711
+ sender: msg.sender
774
712
  });
775
713
 
776
- uint256 maxInvocations = MaxInvocationsLib
777
- .syncProjectMaxInvocationsToCore(
778
- _projectId,
779
- _coreContract,
780
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
781
- );
782
- emit ProjectMaxInvocationsLimitUpdated(
783
- _projectId,
784
- _coreContract,
785
- maxInvocations
786
- );
714
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
715
+ projectId: projectId,
716
+ coreContract: coreContract
717
+ });
787
718
 
788
719
  // for convenience, try to mint and assign a token to the project's
789
720
  // next slot
790
- _tryMintTokenToNextSlot(_projectId, _coreContract);
721
+ SEALib.tryMintTokenToNextSlot({
722
+ projectId: projectId,
723
+ coreContract: coreContract,
724
+ minterFilter: _minterFilter
725
+ });
791
726
  }
792
727
 
793
728
  /**
794
729
  * @notice Emergency, Artist-only function that attempts to mint a new
795
- * token and set it as the the next token to be auctioned for project
796
- * `_projectId`.
730
+ * token and set it as the next token to be auctioned for project
731
+ * `projectId`.
797
732
  * Note: This function is only included for emergency, unforseen use cases,
798
733
  * and should not be used in normal operation. It is here only for
799
734
  * redundant protection against an unforseen edge case where the minter
@@ -806,105 +741,59 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
806
741
  * or minter
807
742
  * @dev This function is gated to only the project's artist to prevent
808
743
  * early minting of tokens by other users.
809
- * @param _projectId The project ID
810
- * @param _coreContract The core contract address for the given project.
744
+ * @param projectId The project ID
745
+ * @param coreContract The core contract address for the given project.
811
746
  */
812
747
  function tryPopulateNextToken(
813
- uint256 _projectId,
814
- address _coreContract
748
+ uint256 projectId,
749
+ address coreContract
815
750
  ) public nonReentrant {
816
751
  AuthLib.onlyArtist({
817
- _projectId: _projectId,
818
- _coreContract: _coreContract,
819
- _sender: msg.sender
752
+ projectId: projectId,
753
+ coreContract: coreContract,
754
+ sender: msg.sender
820
755
  });
821
756
  // CHECKS
822
757
  // revert if project is not configured on this minter
823
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
824
- _coreContract
825
- ][_projectId];
826
758
  require(
827
- SEALib.projectIsConfigured(_SEAProjectConfig),
759
+ SEALib.projectIsConfigured({
760
+ projectId: projectId,
761
+ coreContract: coreContract
762
+ }),
828
763
  "Project not configured"
829
764
  );
830
765
  // INTERACTIONS
831
766
  // attempt to mint new token to this minter contract, only if max
832
767
  // invocations has not been reached
833
- _tryMintTokenToNextSlot(_projectId, _coreContract);
768
+ SEALib.tryMintTokenToNextSlot({
769
+ projectId: projectId,
770
+ coreContract: coreContract,
771
+ minterFilter: _minterFilter
772
+ });
834
773
  }
835
774
 
836
775
  /**
837
- * @notice Settles a completed auction for `_tokenId`, if it exists and is
776
+ * @notice Settles a completed auction for `tokenId`, if it exists and is
838
777
  * not yet settled.
839
- * Returns early (does not modify state) if
840
- * - there is no initialized auction for the project
778
+ * Function returns early (does not modify state) if
841
779
  * - there is an auction that has already been settled for the project
842
780
  * - there is an auction for a different token ID on the project
843
781
  * (likely due to a front-run)
844
- * This function reverts if the auction for `_tokenId` exists, but has not
845
- * yet ended.
846
- * @param _tokenId Token ID to settle auction for.
847
- * @param _coreContract Core contract address for the given project.
782
+ * Function reverts if there is no initialized auction for the project, or
783
+ * if the auction for `tokenId` exists, but has not yet ended.
784
+ * @param tokenId Token ID to settle auction for.
785
+ * @param coreContract Core contract address for the given token.
848
786
  */
849
787
  function settleAuction(
850
- uint256 _tokenId,
851
- address _coreContract
788
+ uint256 tokenId,
789
+ address coreContract
852
790
  ) public nonReentrant {
853
- uint256 _projectId = ABHelpers.tokenIdToProjectId(_tokenId);
854
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
855
- _coreContract
856
- ][_projectId];
857
- SEALib.Auction storage _auction = _SEAProjectConfig.activeAuction;
858
- // load from storage to memory for gas efficiency
859
- address currentBidder = _auction.currentBidder;
860
- uint256 currentBid = _auction.currentBid;
861
- // CHECKS
862
- // @dev this check is not strictly necessary, but is included for
863
- // clear error messaging
864
- require(
865
- SEALib.auctionIsInitialized(_auction),
866
- "Auction not initialized"
867
- );
868
- if (_auction.settled || (_auction.tokenId != _tokenId)) {
869
- // auction already settled or is for a different token ID, so
870
- // return early and do not modify state
871
- return;
872
- }
873
- // @dev important that the following check is after the early return
874
- // block above to maintain desired behavior
875
- require(block.timestamp >= _auction.endTime, "Auction not yet ended");
876
- // EFFECTS
877
- _auction.settled = true;
878
- // INTERACTIONS
879
- // send token to the winning bidder
880
- IERC721(_coreContract).transferFrom({
881
- from: address(this),
882
- to: currentBidder,
883
- tokenId: _tokenId
884
- });
885
- // distribute revenues from auction
886
- bool isEngine = SplitFundsLib.isEngine(
887
- _coreContract,
888
- _isEngineCaches[_coreContract]
889
- );
890
- SplitFundsLib.splitRevenuesETH({
891
- _projectId: _projectId,
892
- _valueInWei: currentBid,
893
- _coreContract: _coreContract,
894
- _isEngine: isEngine
895
- });
896
-
897
- emit AuctionSettled({
898
- tokenId: _tokenId,
899
- coreContract: _coreContract,
900
- winner: currentBidder,
901
- price: currentBid
902
- });
791
+ SEALib.settleAuction({tokenId: tokenId, coreContract: coreContract});
903
792
  }
904
793
 
905
794
  /**
906
- * @notice Enters a bid for token `_tokenId`.
907
- * If an auction for token `_tokenId` does not exist, an auction will be
795
+ * @notice Enters a bid for token `tokenId`.
796
+ * If an auction for token `tokenId` does not exist, an auction will be
908
797
  * initialized as long as any existing auction for the project has been
909
798
  * settled.
910
799
  * In order to successfully place the bid, the token bid must be:
@@ -924,7 +813,7 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
924
813
  * outbid and their funds are returned to the original `msg.sender` address
925
814
  * via SELFDESTRUCT (SENDALL).
926
815
  * ------------------------------------------------------------------------
927
- * Note that the use of `_tokenId` is to prevent the possibility of
816
+ * Note that the use of `tokenId` is to prevent the possibility of
928
817
  * transactions that are stuck in the pending pool for long periods of time
929
818
  * from unintentionally bidding on auctions for future tokens.
930
819
  * If a new auction is initialized during this call, the project's next
@@ -932,259 +821,22 @@ contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
932
821
  * it for the next auction. If the project's next token cannot be minted
933
822
  * due to e.g. reaching the maximum invocations on the core contract or
934
823
  * minter, the project's next token will not be minted.
935
- * @param _tokenId Token ID being bid on.
936
- * @param _coreContract Core contract address for the given project.
824
+ * @param tokenId Token ID being bid on.
825
+ * @param coreContract Core contract address for the given project.
937
826
  * @dev nonReentrant modifier is used to prevent reentrancy attacks, e.g.
938
827
  * an an auto-bidder that would be able to atomically outbid a user's
939
828
  * new bid via a reentrant call to createBid.
940
829
  */
941
830
  function createBid(
942
- uint256 _tokenId,
943
- address _coreContract
831
+ uint256 tokenId,
832
+ address coreContract
944
833
  ) public payable nonReentrant {
945
- uint256 _projectId = ABHelpers.tokenIdToProjectId(_tokenId);
946
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
947
- _coreContract
948
- ][_projectId];
949
- SEALib.Auction storage _auction = _SEAProjectConfig.activeAuction;
950
- // CHECKS
951
- // ProjectConfig storage _projectConfig = projectConfig[_projectId];
952
- // load from storage to memory for gas efficiency
953
- uint256 auctionEndTime = _auction.endTime;
954
- uint256 previousBid = _auction.currentBid;
955
-
956
- // if no auction exists, or current auction is already settled, attempt
957
- // to initialize a new auction for the input token ID and immediately
958
- // return
959
- if ((!SEALib.auctionIsInitialized(_auction)) || _auction.settled) {
960
- _initializeAuctionWithBid(_projectId, _coreContract, _tokenId);
961
- return;
962
- }
963
- // @dev this branch is guaranteed to have an initialized auction that
964
- // not settled, so no need to check for initialized or not settled
965
-
966
- // ensure bids for a specific token ID are only applied to the auction
967
- // for that token ID.
968
- require(
969
- _auction.tokenId == _tokenId,
970
- "Token ID does not match auction"
971
- );
972
-
973
- // ensure auction is not already ended
974
- require(auctionEndTime > block.timestamp, "Auction already ended");
975
-
976
- // require bid to be sufficiently greater than current highest bid
977
- // @dev no overflow enforced automatically by solidity ^0.8.0
978
- require(
979
- msg.value >= SEALib.getMinimumNextBid(_auction),
980
- "Bid is too low"
981
- );
982
-
983
- // EFFECTS
984
- // record previous highest bider for refunding
985
- address payable previousBidder = _auction.currentBidder;
986
-
987
- // update auction bid state
988
- SEALib.auctionUpdateBid({
989
- _auction: _auction,
990
- _timeBufferSeconds: minterTimeBufferSeconds,
991
- _bidAmount: msg.value,
992
- _bidder: payable(msg.sender)
993
- });
994
-
995
- // INTERACTIONS
996
- // refund previous highest bidder
997
- SplitFundsLib.forceSafeTransferETH({
998
- _to: previousBidder,
999
- _amount: previousBid,
1000
- _minterRefundGasLimit: minterRefundGasLimit
1001
- });
1002
-
1003
- emit AuctionBid({
1004
- tokenId: _tokenId,
1005
- coreContract: _coreContract,
1006
- bidder: msg.sender,
1007
- bidAmount: msg.value
1008
- });
1009
- }
1010
-
1011
- /**
1012
- * @dev Internal function to initialize an auction for the next token ID
1013
- * on project `_projectId` with a bid of `msg.value` from `msg.sender`.
1014
- * This function reverts in any of the following cases:
1015
- * - project is not configured on this minter
1016
- * - project is configured but has not yet reached its start time
1017
- * - project has a current active auction that is not settled
1018
- * - insufficient bid amount (msg.value < basePrice)
1019
- * - no next token has been minted for the project (artist may need to
1020
- * call `tryPopulateNextToken`)
1021
- * - `_targetTokenId` does not match the next token ID for the project
1022
- * After initializing a new auction, this function attempts to mint a new
1023
- * token and assign it to the project's next token slot, in preparation for
1024
- * a future token auction. However, if the project has reached its maximum
1025
- * invocations on either the core contract or minter, the next token slot
1026
- * for the project will remain empty.
1027
- * @dev This should be executed in a nonReentrant context to provide redundant
1028
- * protection against reentrancy.
1029
- */
1030
- function _initializeAuctionWithBid(
1031
- uint256 _projectId,
1032
- address _coreContract,
1033
- uint256 _targetTokenId
1034
- ) internal {
1035
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
1036
- _coreContract
1037
- ][_projectId];
1038
- SEALib.Auction storage _auction = _SEAProjectConfig.activeAuction;
1039
- // CHECKS
1040
- // ensure project auctions are configured
1041
- // @dev base price of zero indicates auctions are not configured
1042
- // because only base price of gt zero is allowed when configuring
1043
- require(
1044
- SEALib.projectIsConfigured(_SEAProjectConfig),
1045
- "Project not configured"
1046
- );
1047
- // only initialize new auctions if they meet the start time
1048
- // requirement
1049
- require(
1050
- block.timestamp >= _SEAProjectConfig.timestampStart,
1051
- "Only gte project start time"
1052
- );
1053
- // the following require statement is redundant based on how this
1054
- // internal function is called, but it is included for protection
1055
- // against future changes that could easily introduce a bug if this
1056
- // check is not present
1057
- // @dev no cover else branch of next line because unreachable
1058
- require(
1059
- (!SEALib.auctionIsInitialized(_auction)) || _auction.settled,
1060
- "Existing auction not settled"
1061
- );
1062
- // require valid bid value
1063
- require(
1064
- msg.value >= _SEAProjectConfig.basePrice,
1065
- "Insufficient initial bid"
1066
- );
1067
- // require next token number is populated
1068
- // @dev this should only be encountered if the project has reached
1069
- // its maximum invocations on either the core contract or minter
1070
- require(
1071
- _SEAProjectConfig.nextTokenNumberIsPopulated,
1072
- "No next token, check max invocations"
1073
- );
1074
- // require next token number is the target token ID
1075
- require(
1076
- _SEAProjectConfig.nextTokenNumber ==
1077
- ABHelpers.tokenIdToTokenNumber(_targetTokenId),
1078
- "Incorrect target token ID"
1079
- );
1080
-
1081
- // EFFECTS
1082
- // create new auction, overwriting previous auction if it exists
1083
- uint64 endTime = SEALib.overwriteProjectActiveAuction({
1084
- _SEAProjectConfig: _SEAProjectConfig,
1085
- _targetTokenId: _targetTokenId,
1086
- _bidAmount: msg.value,
1087
- _bidder: payable(msg.sender)
1088
- });
1089
- // mark next token number as not populated
1090
- // @dev intentionally not setting nextTokenNumber to zero to avoid
1091
- // unnecessary gas costs
1092
- _SEAProjectConfig.nextTokenNumberIsPopulated = false;
1093
-
1094
- // @dev we intentionally emit event here due to potential of early
1095
- // return in INTERACTIONS section
1096
- emit AuctionInitialized({
1097
- tokenId: _targetTokenId,
1098
- coreContract: _coreContract,
1099
- bidder: msg.sender,
1100
- bidAmount: msg.value,
1101
- endTime: endTime,
1102
- minBidIncrementPercentage: _SEAProjectConfig
1103
- .activeAuction
1104
- .minBidIncrementPercentage
1105
- });
1106
-
1107
- // INTERACTIONS
1108
- // attempt to mint new token to this minter contract, only if max
1109
- // invocations has not been reached
1110
- _tryMintTokenToNextSlot(_projectId, _coreContract);
1111
- }
1112
-
1113
- /**
1114
- * @notice Internal function that attempts to mint a new token to the next
1115
- * token slot for the project `_projectId`.
1116
- * This function returns early and does not modify state if
1117
- * - the project has reached its maximum invocations on either the core
1118
- * contract or minter
1119
- * - the project config's `nextTokenNumberIsPopulated` is already true
1120
- * @param _projectId The ID of the project to mint a new token for.
1121
- * @param _coreContract The core contract address
1122
- * @dev this calls mint with `msg.sender` as the sender, allowing artists
1123
- * to mint tokens to the next token slot for their project while a project
1124
- * is still paused. This happens when an artist is configuring their
1125
- * project's auction parameters or minter max invocations.
1126
- */
1127
- function _tryMintTokenToNextSlot(
1128
- uint256 _projectId,
1129
- address _coreContract
1130
- ) internal {
1131
- SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
1132
- _coreContract
1133
- ][_projectId];
1134
- MaxInvocationsLib.MaxInvocationsProjectConfig
1135
- storage _maxInvocationProjectConfig = _maxInvocationsProjectConfigMapping[
1136
- _coreContract
1137
- ][_projectId];
1138
- if (_SEAProjectConfig.nextTokenNumberIsPopulated) {
1139
- return;
1140
- }
1141
- // INTERACTIONS
1142
- // attempt to mint new token to this minter contract, only if max
1143
- // invocations has not been reached
1144
- // we require up-to-date invocation data to properly handle last token
1145
- // and avoid revert if relying on core to limit invocations, therefore
1146
- // use MaxInvocationsLib.invocationsRemain, which calls core contract
1147
- // to get latest invocation data
1148
- if (
1149
- !MaxInvocationsLib.invocationsRemain(
1150
- _maxInvocationProjectConfig,
1151
- _projectId,
1152
- _coreContract
1153
- )
1154
- ) {
1155
- // we have reached the max invocations, so we do not mint a new
1156
- // token as the "next token", and leave the next token number as
1157
- // not populated
1158
- return;
1159
- }
1160
- // @dev this is an effect after a trusted contract interaction
1161
- _SEAProjectConfig.nextTokenNumberIsPopulated = true;
1162
- // mint a new token to this project's "next token" slot
1163
- // @dev this is an interaction with a trusted contract
1164
- uint256 nextTokenId = minterFilter.mint_joo(
1165
- address(this),
1166
- _projectId,
1167
- _coreContract,
1168
- msg.sender
1169
- );
1170
- // update state to reflect new token number
1171
- // @dev state changes after trusted contract interaction
1172
- // @dev unchecked is safe because mod 1e6 is guaranteed to be less than
1173
- // max uint24
1174
- unchecked {
1175
- _SEAProjectConfig.nextTokenNumber = uint24(
1176
- ABHelpers.tokenIdToTokenNumber(nextTokenId)
1177
- );
1178
- }
1179
- // update local maxHasBeenInvoked value if necessary
1180
- MaxInvocationsLib.validatePurchaseEffectsInvocations({
1181
- _tokenId: nextTokenId,
1182
- maxInvocationsProjectConfig: _maxInvocationProjectConfig
1183
- });
1184
- emit ProjectNextTokenUpdated({
1185
- projectId: _projectId,
1186
- coreContract: _coreContract,
1187
- tokenId: nextTokenId
834
+ SEALib.createBid({
835
+ tokenId: tokenId,
836
+ coreContract: coreContract,
837
+ minterTimeBufferSeconds: _minterTimeBufferSeconds,
838
+ minterRefundGasLimit: _minterRefundGasLimit,
839
+ minterFilter: _minterFilter
1188
840
  });
1189
841
  }
1190
842
  }