@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
@@ -0,0 +1,1205 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ // @dev fixed to specific solidity version for clarity and for more clear
5
+ // source code verification purposes.
6
+ pragma solidity 0.8.22;
7
+
8
+ import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
9
+ import {ISharedMinterRAMV0} from "../../interfaces/v0.8.x/ISharedMinterRAMV0.sol";
10
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
11
+
12
+ import {ABHelpers} from "../../libs/v0.8.x/ABHelpers.sol";
13
+ import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
14
+ import {RAMLib} from "../../libs/v0.8.x/minter-libs/RAMLib.sol";
15
+ import {SplitFundsLib} from "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
16
+ import {MaxInvocationsLib} from "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
17
+
18
+ import {ReentrancyGuard} from "@openzeppelin-4.7/contracts/security/ReentrancyGuard.sol";
19
+ import {SafeCast} from "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
20
+
21
+ /**
22
+ * @title Filtered Minter contract that allows tokens to be minted with ETH.
23
+ * Pricing is achieved using a fully on-chain ranked auction mechanism.
24
+ * This is designed to be used with GenArt721CoreContractV3 flagship or
25
+ * engine contracts.
26
+ * @author Art Blocks Inc.
27
+ * @notice Bid Front-Running:
28
+ * Collectors can front-run bids, potentially causing bid transactions to
29
+ * revert. The minter attempts to handle this in a simple and transparent
30
+ * manner, but some transactions reverting, especially during highly
31
+ * competitive auctions, is unavoidable, and best remedied by resubmitting a
32
+ * new bid transaction with a higher value.
33
+ * @notice Privileged Roles and Ownership:
34
+ * This contract is designed to be managed, with limited powers.
35
+ * Privileged roles and abilities are controlled by the core contract's Admin
36
+ * ACL contract a project's artist, and auction winners. The Admin ACL and
37
+ * project's artist roles hold extensive power and can modify minter details.
38
+ * Care must be taken to ensure that the admin ACL contract and artist
39
+ * addresses are secure behind a multi-sig or other access control mechanism.
40
+ *
41
+ * Additional admin and artist privileged roles may be described on other
42
+ * contracts that this minter integrates with.
43
+ * @notice Fallback and Error States:
44
+ * This minter implements protections for collectors and artists and admin with
45
+ * the intention of preventing any single party from being able to deny
46
+ * revenue or minting rights to another party, for any time longer than
47
+ * 72 hours. All funds are held non-custodially by the smart contract until
48
+ * all tokens are minted or bids are refunded, after which they may be
49
+ * distributed to the artist and admin. All settlements are non-custodial and
50
+ * may be claimed by the winning bidder at any time after an auction ends.
51
+ * ----------------------------------------------------------------------------
52
+ * @notice Project-Minter STATE, FLAG, and ERROR Summary
53
+ * Note: STATEs are mutually exclusive and are in-order, State C potentially skipped
54
+ * -------------
55
+ * STATE A: Pre-Auction
56
+ * abilities:
57
+ * - (artist) configure project max invocations
58
+ * - (artist) configure project auction
59
+ * -------------
60
+ * STATE B: Live-Auction
61
+ * abilities:
62
+ * - (minter active) create bid
63
+ * - (minter active) top-up bid
64
+ * - (admin) emergency increase auction end time by up to 72 hr (in cases of frontend downtime, etc.)
65
+ * - (artist)(not in extra time)(no previous admin extension) reduce auction length
66
+ * -------------
67
+ * STATE C: Post-Auction, Admin-Artist Mint Period (if applicable)
68
+ * abilities:
69
+ * - (admin | artist) auto-mint tokens to winners
70
+ * - (winner) collect settlement
71
+ * - (ERROR E1)(admin) auto-refund winning bids that cannot receive tokens due to max invocations error
72
+ * note: State C is skipped if auction was not a sellout
73
+ * -------------
74
+ * STATE D: Post-Auction, Open Mint Period
75
+ * abilities:
76
+ * - (winner | admin | artist) directly mint tokens to winners, any order
77
+ * - (winner) collect settlement
78
+ * - (FLAG F1) purchase remaining tokens for auction min price (base price), like fixed price minter
79
+ * - (ERROR E1)(winner | admin | artist) directly refund bids due to max invocations error state, any order
80
+ * -------------
81
+ * STATE E: Post-Auction, all bids handled
82
+ * note: "all bids handled" guarantees not in ERROR E1
83
+ * - (artist | admin) collect revenues
84
+ * - (FLAG F1) purchase remaining tokens for auction min price (base price), like fixed price minter
85
+ * -------------
86
+ * FLAGS
87
+ * F1: tokens owed < invocations available
88
+ * occurs when an auction ends before selling out, so tokens are available to be purchased
89
+ * note: also occurs during Pre and Live auction, so FLAG F1 can occur with STATE A, B, but should not enable purchases
90
+ * -------------
91
+ * ERRORS
92
+ * E1: tokens owed > invocations available
93
+ * occurs when tokens minted on different minter or core max invocations were reduced after auction bidding began.
94
+ * indicates operational error occurred.
95
+ * resolution: when winning bids have refunded to sufficiently reduce tokens owed == invocations available.
96
+ * note: error state does not affect minimum winning bid price, and therefore does not affect settlement amount due to any
97
+ * winning bids.
98
+ * ----------------------------------------------------------------------------
99
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
100
+ * Core Registry to assign this minter, this minter does not enforce that a
101
+ * project is registered when configured or queried. This is primarily for gas
102
+ * optimization purposes. It is, therefore, possible that fake projects may be
103
+ * configured on this minter, but bids will not be able to be placed due to
104
+ * checks performed by this minter's Minter Filter.
105
+ *
106
+ * @dev Note that while this minter makes use of `block.timestamp` and it is
107
+ * technically possible that this value is manipulated by block producers, such
108
+ * manipulation will not have material impact on the ability for collectors to
109
+ * place a bid before auction end time. Minimum limits are set on time
110
+ * intervals such that this manipulation would not have a material impact on
111
+ * the auction process.
112
+ */
113
+ contract MinterRAMV0 is ReentrancyGuard, ISharedMinterV0, ISharedMinterRAMV0 {
114
+ using SafeCast for uint256;
115
+
116
+ /// @notice Minter filter address this minter interacts with
117
+ address public immutable minterFilterAddress;
118
+
119
+ /// @notice Minter filter this minter may interact with.
120
+ IMinterFilterV1 private immutable _minterFilter;
121
+
122
+ /// @notice minterType for this minter
123
+ string public constant minterType = "MinterRAMV0";
124
+
125
+ /// @notice minter version for this minter
126
+ string public constant minterVersion = "v0.0.0";
127
+
128
+ /// @notice Minimum auction duration
129
+ uint256 public constant MIN_AUCTION_DURATION_SECONDS = 60 * 10; // 10 minutes
130
+
131
+ /** @notice Gas limit for refunding ETH to bidders
132
+ * configurable by admin, default to 30,000
133
+ * max uint24 ~= 16 million gas, more than enough for a refund
134
+ * @dev SENDALL fallback is used to refund ETH if this limit is exceeded
135
+ */
136
+ uint24 internal _minterRefundGasLimit = 30_000;
137
+
138
+ /**
139
+ * @notice Initializes contract to be a shared, filtered minter for
140
+ * minter filter `minterFilter`
141
+ * @param minterFilter Minter filter for which this will be a minter
142
+ */
143
+ constructor(address minterFilter) ReentrancyGuard() {
144
+ minterFilterAddress = minterFilter;
145
+ _minterFilter = IMinterFilterV1(minterFilter);
146
+ // emit events indicating default minter configuration values
147
+ emit RAMLib.MinAuctionDurationSecondsUpdated({
148
+ minAuctionDurationSeconds: MIN_AUCTION_DURATION_SECONDS
149
+ });
150
+ emit RAMLib.MinterRefundGasLimitUpdated({
151
+ refundGasLimit: _minterRefundGasLimit
152
+ });
153
+ emit RAMLib.AuctionBufferTimeParamsUpdated({
154
+ auctionBufferSeconds: RAMLib.AUCTION_BUFFER_SECONDS,
155
+ maxAuctionExtraSeconds: RAMLib.MAX_AUCTION_EXTRA_SECONDS
156
+ });
157
+ emit RAMLib.NumSlotsUpdated({numSlots: RAMLib.NUM_SLOTS});
158
+ }
159
+
160
+ /**
161
+ * @notice Sets the gas limit during ETH refunds when a collector is
162
+ * outbid. This value should be set to a value that is high enough to
163
+ * ensure that refunds are successful for commonly used wallets, but low
164
+ * enough to avoid excessive abuse of refund gas allowance during a new
165
+ * bid.
166
+ * @dev max gas limit is ~16M, which is considered well over a future-safe
167
+ * upper bound.
168
+ * @param minterRefundGasLimit Gas limit to set for refunds. Must be
169
+ * between 7,000 and max uint24 (~16M).
170
+ */
171
+ function updateRefundGasLimit(uint24 minterRefundGasLimit) external {
172
+ // CHECKS
173
+ AuthLib.onlyMinterFilterAdminACL({
174
+ minterFilterAddress: minterFilterAddress,
175
+ sender: msg.sender,
176
+ contract_: address(this),
177
+ selector: this.updateRefundGasLimit.selector
178
+ });
179
+ // @dev max gas limit implicitly checked by using uint24 input arg
180
+ // @dev min gas limit is based on rounding up current cost to send ETH
181
+ // to a Gnosis Safe wallet, which accesses cold address and emits event
182
+ require(minterRefundGasLimit >= 7_000, "Only gte 7_000");
183
+ // EFFECTS
184
+ _minterRefundGasLimit = minterRefundGasLimit;
185
+ emit RAMLib.MinterRefundGasLimitUpdated(minterRefundGasLimit);
186
+ }
187
+
188
+ /**
189
+ * @notice Contract-Admin only function to update the requirements on if a
190
+ * post-auction admin-artist-only mint period is required or banned, for
191
+ * and-on configured projects.
192
+ * @param coreContract core contract to set the configuration for.
193
+ * @param adminMintingConstraint enum indicating if the minter should
194
+ * require an admin-artist-only mint period after the auction ends or not.
195
+ */
196
+ function setContractConfig(
197
+ address coreContract,
198
+ RAMLib.AdminMintingConstraint adminMintingConstraint
199
+ ) external {
200
+ // CHECKS
201
+ AuthLib.onlyCoreAdminACL({
202
+ coreContract: coreContract,
203
+ sender: msg.sender,
204
+ contract_: address(this),
205
+ selector: this.setContractConfig.selector
206
+ });
207
+ // EFFECTS
208
+ RAMLib.setContractConfig({
209
+ coreContract: coreContract,
210
+ adminMintingConstraint: adminMintingConstraint
211
+ });
212
+ }
213
+
214
+ /**
215
+ * @notice Contract-Admin only function to add emergency auction hours to
216
+ * auction of project `projectId` on core contract `coreContract`.
217
+ * Protects against unexpected frontend downtime, etc.
218
+ * Reverts if called by anyone other than a contract admin.
219
+ * Reverts if project is not in a Live Auction.
220
+ * Reverts if auction is already in extra time.
221
+ * Reverts if adding more than the maximum number of emergency hours.
222
+ * @param projectId Project ID to add emergency auction hours to.
223
+ * @param coreContract Core contract address for the given project.
224
+ * @param emergencyHoursToAdd Number of emergency hours to add to the
225
+ * project's auction.
226
+ */
227
+ function adminAddEmergencyAuctionHours(
228
+ uint256 projectId,
229
+ address coreContract,
230
+ uint8 emergencyHoursToAdd
231
+ ) external nonReentrant {
232
+ // CHECKS
233
+ AuthLib.onlyCoreAdminACL({
234
+ coreContract: coreContract,
235
+ sender: msg.sender,
236
+ contract_: address(this),
237
+ selector: this.adminAddEmergencyAuctionHours.selector
238
+ });
239
+ // EFFECTS
240
+ RAMLib.adminAddEmergencyAuctionHours({
241
+ projectId: projectId,
242
+ coreContract: coreContract,
243
+ emergencyHoursToAdd: emergencyHoursToAdd
244
+ });
245
+ }
246
+
247
+ /**
248
+ * @notice Manually sets the local maximum invocations of project `projectId`
249
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
250
+ * than or equal to the value of project `project_id`'s maximum invocations that is
251
+ * set on the core contract.
252
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
253
+ * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
254
+ * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
255
+ * @param projectId Project ID to set the maximum invocations for.
256
+ * @param coreContract Core contract address for the given project.
257
+ * @param maxInvocations Maximum invocations to set for the project.
258
+ */
259
+ function manuallyLimitProjectMaxInvocations(
260
+ uint256 projectId,
261
+ address coreContract,
262
+ uint24 maxInvocations
263
+ ) external {
264
+ // CHECKS
265
+ AuthLib.onlyArtist({
266
+ projectId: projectId,
267
+ coreContract: coreContract,
268
+ sender: msg.sender
269
+ });
270
+ // only project minter state A (Pre-Auction)
271
+ RAMLib.ProjectMinterStates currentState = RAMLib.getProjectMinterState({
272
+ projectId: projectId,
273
+ coreContract: coreContract
274
+ });
275
+ require(
276
+ currentState == RAMLib.ProjectMinterStates.PreAuction,
277
+ "Only pre-auction"
278
+ );
279
+ // EFFECTS
280
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
281
+ projectId: projectId,
282
+ coreContract: coreContract,
283
+ maxInvocations: maxInvocations
284
+ });
285
+ // also update number of tokens in auction
286
+ RAMLib.refreshNumTokensInAuction({
287
+ projectId: projectId,
288
+ coreContract: coreContract
289
+ });
290
+ }
291
+
292
+ /**
293
+ * @notice Sets auction details for project `projectId`.
294
+ * @param projectId Project ID to set auction details for.
295
+ * @param coreContract Core contract address for the given project.
296
+ * @param auctionTimestampStart Timestamp at which to start the auction.
297
+ * @param basePrice Resting price of the auction, in Wei.
298
+ * @param allowExtraTime Boolean indicating if extra time is allowed for
299
+ * the auction, when valid bids are placed near the end of the auction.
300
+ * @param adminArtistOnlyMintPeriodIfSellout Boolean indicating if an
301
+ * admin-artist-only mint period should be enforced if the auction sells
302
+ * out.
303
+ * @dev Note that a basePrice of `0` will cause the transaction to revert.
304
+ */
305
+ function setAuctionDetails(
306
+ uint256 projectId,
307
+ address coreContract,
308
+ uint40 auctionTimestampStart,
309
+ uint40 auctionTimestampEnd,
310
+ uint256 basePrice,
311
+ bool allowExtraTime,
312
+ bool adminArtistOnlyMintPeriodIfSellout
313
+ ) external nonReentrant {
314
+ AuthLib.onlyArtist({
315
+ projectId: projectId,
316
+ coreContract: coreContract,
317
+ sender: msg.sender
318
+ });
319
+ // CHECKS
320
+ // check min auction duration
321
+ // @dev underflow checked automatically in solidity 0.8
322
+ require(
323
+ auctionTimestampEnd - auctionTimestampStart >=
324
+ MIN_AUCTION_DURATION_SECONDS,
325
+ "Auction too short"
326
+ );
327
+ // EFFECTS
328
+ // @dev project minter state checked in setAuctionDetails
329
+ RAMLib.setAuctionDetails({
330
+ projectId: projectId,
331
+ coreContract: coreContract,
332
+ auctionTimestampStart: auctionTimestampStart,
333
+ auctionTimestampEnd: auctionTimestampEnd,
334
+ basePrice: basePrice.toUint88(),
335
+ allowExtraTime: allowExtraTime,
336
+ adminArtistOnlyMintPeriodIfSellout: adminArtistOnlyMintPeriodIfSellout
337
+ });
338
+ }
339
+
340
+ /**
341
+ * @notice Reduces the auction length for project `projectId` on core
342
+ * contract `coreContract` to `auctionTimestampEnd`.
343
+ * Only allowed to be called during a live auction, and protects against
344
+ * the case of an accidental excessively long auction, which locks funds.
345
+ * Reverts if called by anyone other than the project's artist.
346
+ * Reverts if project is not in a Live Auction.
347
+ * Reverts if auction is not being reduced in length.
348
+ * Reverts if in extra time.
349
+ * Reverts if `auctionTimestampEnd` results in auction that is not at least
350
+ * `MIN_AUCTION_DURATION_SECONDS` in duration.
351
+ * Reverts if admin previously applied a time extension.
352
+ * @param projectId Project ID to reduce the auction length for.
353
+ * @param coreContract Core contract address for the given project.
354
+ * @param auctionTimestampEnd New timestamp at which to end the auction.
355
+ */
356
+ function reduceAuctionLength(
357
+ uint256 projectId,
358
+ address coreContract,
359
+ uint40 auctionTimestampEnd
360
+ ) external nonReentrant {
361
+ AuthLib.onlyArtist({
362
+ projectId: projectId,
363
+ coreContract: coreContract,
364
+ sender: msg.sender
365
+ });
366
+ RAMLib.reduceAuctionLength({
367
+ projectId: projectId,
368
+ coreContract: coreContract,
369
+ auctionTimestampEnd: auctionTimestampEnd,
370
+ minimumAuctionDurationSeconds: MIN_AUCTION_DURATION_SECONDS
371
+ });
372
+ }
373
+
374
+ /**
375
+ * @notice Places a bid for project `projectId` on core contract
376
+ * `coreContract`.
377
+ * Reverts if minter is not the active minter for projectId on minter
378
+ * filter.
379
+ * Reverts if project is not in a Live Auction.
380
+ * Reverts if msg.value is not equal to slot value.
381
+ * In order to successfully place the bid, the token bid must be:
382
+ * - greater than or equal to a project's minimum bid price if maximum
383
+ * number of bids has not been reached
384
+ * - sufficiently greater than the current minimum bid if maximum number
385
+ * of bids has been reached
386
+ * If the bid is unsuccessful, the transaction will revert.
387
+ * If the bid is successful, but outbid by another bid before the auction
388
+ * ends, the funds will be noncustodially returned to the bidder's address,
389
+ * `msg.sender`. A fallback method of sending funds back to the bidder via
390
+ * SELFDESTRUCT (SENDALL) prevents denial of service attacks, even if the
391
+ * original bidder reverts or runs out of gas during receive or fallback.
392
+ * ------------------------------------------------------------------------
393
+ * WARNING: bidders must be prepared to handle the case where their bid is
394
+ * outbid and their funds are returned to the original `msg.sender` address
395
+ * via SELFDESTRUCT (SENDALL).
396
+ * ------------------------------------------------------------------------
397
+ * @param projectId projectId being bid on.
398
+ * @param coreContract Core contract address for the given project.
399
+ * @param slotIndex Slot index to create the bid for.
400
+ * @dev nonReentrant modifier is used to prevent reentrancy attacks, e.g.
401
+ * an an auto-bidder that would be able to automically outbid a user's
402
+ * new bid via a reentrant call to createBid.
403
+ */
404
+ function createBid(
405
+ uint256 projectId,
406
+ address coreContract,
407
+ uint16 slotIndex
408
+ ) external payable nonReentrant {
409
+ // CHECKS
410
+ // minter must be set for project on MinterFilter
411
+ require(
412
+ _minterFilter.getMinterForProject({
413
+ projectId: projectId,
414
+ coreContract: coreContract
415
+ }) == address(this),
416
+ "Minter not active"
417
+ );
418
+ // @dev bid value is checked against slot value in placeBid
419
+ // @dev project state is checked in placeBid
420
+
421
+ // EFFECTS
422
+ RAMLib.placeBid({
423
+ projectId: projectId,
424
+ coreContract: coreContract,
425
+ slotIndex: slotIndex,
426
+ bidder: msg.sender,
427
+ bidValue: msg.value,
428
+ minterRefundGasLimit: _minterRefundGasLimit
429
+ });
430
+ }
431
+
432
+ /**
433
+ * @notice Top up bid for project `projectId` on core contract
434
+ * `coreContract` for bid `bidId` to new slot index `newSlotIndex`.
435
+ * Reverts if Bid ID has been kicked out of the auction or does not exist.
436
+ * Reverts if msg.sender is not the bidder of the bid.
437
+ * Reverts if minter is not the active minter for projectId on minter
438
+ * filter.
439
+ * Reverts if project is not in a Live Auction.
440
+ * Reverts if msg.value is not equal to difference in bid values between
441
+ * new and old slots.
442
+ * Reverts if new slot index is not greater than or equal to the current
443
+ * slot index.
444
+ * @param projectId Project ID to top up bid for.
445
+ * @param coreContract Core contract address for the given project.
446
+ * @param bidId ID of bid to top up.
447
+ * @param newSlotIndex New slot index to move bid to.
448
+ */
449
+ function topUpBid(
450
+ uint256 projectId,
451
+ address coreContract,
452
+ uint32 bidId,
453
+ uint16 newSlotIndex
454
+ ) external payable nonReentrant {
455
+ // CHECKS
456
+ // minter must be set for project on MinterFilter
457
+ require(
458
+ _minterFilter.getMinterForProject({
459
+ projectId: projectId,
460
+ coreContract: coreContract
461
+ }) == address(this),
462
+ "Minter not active"
463
+ );
464
+ // @dev additional bid value is checked against slot value in topUpBid
465
+ // @dev project state is checked in topUpBid
466
+
467
+ // EFFECTS
468
+ RAMLib.topUpBid({
469
+ projectId: projectId,
470
+ coreContract: coreContract,
471
+ bidId: bidId,
472
+ newSlotIndex: newSlotIndex,
473
+ bidder: msg.sender,
474
+ addedValue: msg.value
475
+ });
476
+ }
477
+
478
+ /**
479
+ * @notice Purchases token for project `projectId` on core contract
480
+ * `coreContract` for auction that has ended, but not yet been sold out.
481
+ * @param projectId Project ID to purchase token for.
482
+ * @param coreContract Core contract address for the given project.
483
+ * @return tokenId Token ID of minted token
484
+ */
485
+ function purchase(
486
+ uint256 projectId,
487
+ address coreContract
488
+ ) external payable nonReentrant returns (uint256 tokenId) {
489
+ // @dev checks performed in RAMLib purchaseTo function
490
+ tokenId = RAMLib.purchaseTo({
491
+ to: msg.sender,
492
+ projectId: projectId,
493
+ coreContract: coreContract,
494
+ minterFilter: _minterFilter
495
+ });
496
+ }
497
+
498
+ /**
499
+ * @notice Purchases token for project `projectId` on core contract
500
+ * `coreContract` for auction that has ended, but not yet been sold out,
501
+ * and sets the token's owner to `to`.
502
+ * @param to Address to be the new token's owner.
503
+ * @param projectId Project ID to purchase token for.
504
+ * @param coreContract Core contract address for the given project.
505
+ * @return tokenId Token ID of minted token
506
+ */
507
+ function purchaseTo(
508
+ address to,
509
+ uint256 projectId,
510
+ address coreContract
511
+ ) external payable nonReentrant returns (uint256 tokenId) {
512
+ // @dev checks performed in RAMLib purchaseTo function
513
+ tokenId = RAMLib.purchaseTo({
514
+ to: to,
515
+ projectId: projectId,
516
+ coreContract: coreContract,
517
+ minterFilter: _minterFilter
518
+ });
519
+ }
520
+
521
+ /**
522
+ * @notice Collects settlement for project `projectId` on core contract
523
+ * `coreContract` for all bids in `bidIds`,
524
+ * which must be aligned by index.
525
+ * Reverts if msg.sender is not the bidder for all bids.
526
+ * Reverts if project is not in a post-auction state.
527
+ * Reverts if one or more bids has already been settled.
528
+ * Reverts if invalid bid is found.
529
+ * @param projectId Project ID of bid to collect settlement for
530
+ * @param coreContract Core contract address for the given project.
531
+ * @param bidIds IDs of bids to collect settlements for
532
+ */
533
+ function collectSettlements(
534
+ uint256 projectId,
535
+ address coreContract,
536
+ uint32[] calldata bidIds
537
+ ) external nonReentrant {
538
+ // CHECKS
539
+ // @dev project state is checked in collectSettlements
540
+ // @dev length of slotIndices and bidIndicesInSlot must be equal is
541
+ // checked in collectSettlements
542
+ // EFFECTS
543
+ RAMLib.collectSettlements({
544
+ projectId: projectId,
545
+ coreContract: coreContract,
546
+ bidIds: bidIds,
547
+ bidder: msg.sender,
548
+ minterRefundGasLimit: _minterRefundGasLimit
549
+ });
550
+ }
551
+
552
+ /**
553
+ * @notice Contract-Admin or Artist only function to mint tokens to winners
554
+ * of project `projectId` on core contract `coreContract`.
555
+ * Automatically mints tokens to most-winning bids, in order from highest
556
+ * and earliest bid to lowest and latest bid.
557
+ * Settles bids as tokens are minted, if not already settled.
558
+ * Reverts if project is not in a post-auction state, admin-artist-only
559
+ * mint period (i.e. State C), with tokens available.
560
+ * Reverts if msg.sender is not a contract admin or artist.
561
+ * Reverts if number of tokens to mint is greater than the number of
562
+ * tokens available to be minted.
563
+ * @param projectId Project ID to mint tokens on.
564
+ * @param coreContract Core contract address for the given project.
565
+ * @param numTokensToMint Number of tokens to mint in this transaction.
566
+ */
567
+ function adminArtistAutoMintTokensToWinners(
568
+ uint256 projectId,
569
+ address coreContract,
570
+ uint24 numTokensToMint
571
+ ) external nonReentrant {
572
+ // CHECKS
573
+ AuthLib.onlyCoreAdminACLOrArtist({
574
+ projectId: projectId,
575
+ coreContract: coreContract,
576
+ sender: msg.sender,
577
+ contract_: address(this),
578
+ selector: this.adminArtistAutoMintTokensToWinners.selector
579
+ });
580
+ // EFFECTS/INTERACTIONS
581
+ RAMLib.adminArtistAutoMintTokensToWinners({
582
+ projectId: projectId,
583
+ coreContract: coreContract,
584
+ numTokensToMint: numTokensToMint,
585
+ minterFilter: _minterFilter,
586
+ minterRefundGasLimit: _minterRefundGasLimit
587
+ });
588
+ }
589
+
590
+ /**
591
+ * @notice Directly mint tokens to winners of project `projectId` on core
592
+ * contract `coreContract`.
593
+ * Does not guarantee an optimal ordering or handling of E1 state like
594
+ * `adminAutoRefundWinners` does while in State C.
595
+ * Admin or Artist may mint to any winning bids.
596
+ * Provides protection for Admin and Artist because they may mint tokens
597
+ * to winners to prevent denial of revenue claiming.
598
+ * Skips over bids that have already been minted or refunded (front-running
599
+ * protection).
600
+ * Reverts if project is not in a post-auction state,
601
+ * post-admin-artist-only mint period (i.e. State D), with tokens available
602
+ * Reverts if msg.sender is not a contract admin or artist.
603
+ * @param projectId Project ID to mint tokens on.
604
+ * @param coreContract Core contract address for the given project.
605
+ * @param bidIds IDs of bids to mint tokens for
606
+ */
607
+ function adminArtistDirectMintTokensToWinners(
608
+ uint256 projectId,
609
+ address coreContract,
610
+ uint32[] calldata bidIds
611
+ ) external nonReentrant {
612
+ // CHECKS
613
+ AuthLib.onlyCoreAdminACLOrArtist({
614
+ projectId: projectId,
615
+ coreContract: coreContract,
616
+ sender: msg.sender,
617
+ contract_: address(this),
618
+ selector: this.adminArtistDirectMintTokensToWinners.selector
619
+ });
620
+ // EFFECTS/INTERACTIONS
621
+ RAMLib.directMintTokensToWinners({
622
+ projectId: projectId,
623
+ coreContract: coreContract,
624
+ bidIds: bidIds,
625
+ requireSenderIsBidder: false, // not required when called by admin or artist
626
+ minterFilter: _minterFilter,
627
+ minterRefundGasLimit: _minterRefundGasLimit
628
+ });
629
+ }
630
+
631
+ /**
632
+ * @notice Directly mint tokens of winner of project `projectId` on core
633
+ * contract `coreContract`.
634
+ * Does not guarantee an optimal ordering or handling of E1 state like
635
+ * `adminAutoRefundWinners` does while in State C.
636
+ * Only winning collector may call and mint tokens to themselves.
637
+ * Provides protection for collectors because they may mint their tokens
638
+ * directly.
639
+ * Skips over bids that have already been minted or refunded (front-running
640
+ * protection)
641
+ * Reverts if project is not in a post-auction state,
642
+ * post-admin-artist-only mint period (i.e. State D), with tokens available
643
+ * Reverts if msg.sender is not the winning bidder for all specified bids.
644
+ * @param projectId Project ID to mint tokens on.
645
+ * @param coreContract Core contract address for the given project.
646
+ * @param bidIds IDs of bids to mint tokens for
647
+ */
648
+ function winnerDirectMintTokens(
649
+ uint256 projectId,
650
+ address coreContract,
651
+ uint32[] calldata bidIds
652
+ ) external nonReentrant {
653
+ // CHECKS
654
+ // @dev all checks performed in library function
655
+ // EFFECTS/INTERACTIONS
656
+ RAMLib.directMintTokensToWinners({
657
+ projectId: projectId,
658
+ coreContract: coreContract,
659
+ bidIds: bidIds,
660
+ requireSenderIsBidder: true, // only allow winning bidder to call
661
+ minterFilter: _minterFilter,
662
+ minterRefundGasLimit: _minterRefundGasLimit
663
+ });
664
+ }
665
+
666
+ /**
667
+ * @notice Directly refund bids for project `projectId` on core
668
+ * contract `coreContract` to resolve error state E1.
669
+ * Does not guarantee an optimal ordering or handling of E1 state like
670
+ * `adminAutoMintTokensToWinners` does while in State C.
671
+ * Admin or Artist may refund to any bids.
672
+ * Provides protection for Admin and Artist because they may refund to
673
+ * resolve E1 state to prevent denial of revenue claiming.
674
+ * Skips over bids that have already been minted or refunded (front-running
675
+ * protection).
676
+ * Reverts if project is not in a post-auction state,
677
+ * post-admin-artist-only mint period (i.e. State D).
678
+ * Reverts if project is not in error state E1.
679
+ * Reverts if length of bids to refund exceeds the number of bids that need
680
+ * to be refunded to resolve the error state E1.
681
+ * Reverts if bid does not exist at bidId.
682
+ * Reverts if msg.sender is not a contract admin or artist.
683
+ * @param projectId Project ID to refund bid values on.
684
+ * @param coreContract Core contract address for the given project.
685
+ * @param bidIds IDs of bids to refund bid values for
686
+ */
687
+ function adminArtistDirectRefundWinners(
688
+ uint256 projectId,
689
+ address coreContract,
690
+ uint32[] calldata bidIds
691
+ ) external nonReentrant {
692
+ // CHECKS
693
+ AuthLib.onlyCoreAdminACLOrArtist({
694
+ projectId: projectId,
695
+ coreContract: coreContract,
696
+ sender: msg.sender,
697
+ contract_: address(this),
698
+ selector: this.adminArtistDirectRefundWinners.selector
699
+ });
700
+ // EFFECTS/INTERACTIONS
701
+ RAMLib.directRefundBidsToResolveE1({
702
+ projectId: projectId,
703
+ coreContract: coreContract,
704
+ bidIds: bidIds,
705
+ requireSenderIsBidder: false, // not required when called by admin or artist
706
+ minterRefundGasLimit: _minterRefundGasLimit
707
+ });
708
+ }
709
+
710
+ /**
711
+ * @notice Directly refund bids for project `projectId` on core
712
+ * contract `coreContract` to resolve error state E1.
713
+ * Does not guarantee an optimal ordering or handling of E1 state like
714
+ * `adminAutoMintTokensToWinners` does while in State C.
715
+ * Only winning collector may call and refund to themselves.
716
+ * Provides protection for collectors because they may refund their tokens
717
+ * directly if in E1 state and they are no longer able to mint their
718
+ * token(s) (prevent holding of funds).
719
+ * Skips over bids that have already been minted or refunded (front-running
720
+ * protection).
721
+ * Reverts if project is not in a post-auction state,
722
+ * post-admin-artist-only mint period (i.e. State D).
723
+ * Reverts if project is not in error state E1.
724
+ * Reverts if length of bids to refund exceeds the number of bids that need
725
+ * to be refunded to resolve the error state E1.
726
+ * Reverts if msg.sender is not the winning bidder for all specified bids.
727
+ * @param projectId Project ID to refund bid values on.
728
+ * @param coreContract Core contract address for the given project.
729
+ * @param bidIds IDs of bids to refund bid values for
730
+ */
731
+ function winnerDirectRefund(
732
+ uint256 projectId,
733
+ address coreContract,
734
+ uint32[] calldata bidIds
735
+ ) external nonReentrant {
736
+ // CHECKS
737
+ // @dev all checks performed in library function
738
+ // EFFECTS/INTERACTIONS
739
+ RAMLib.directRefundBidsToResolveE1({
740
+ projectId: projectId,
741
+ coreContract: coreContract,
742
+ bidIds: bidIds,
743
+ requireSenderIsBidder: true, // only allow winning bidder to call
744
+ minterRefundGasLimit: _minterRefundGasLimit
745
+ });
746
+ }
747
+
748
+ /**
749
+ * @notice Function to automatically refund the lowest winning bids for
750
+ * project `projectId` on core contract `coreContract` to resolve error
751
+ * state E1.
752
+ * Reverts if not called by a contract admin.
753
+ * Reverts if project is not in post-auction state C.
754
+ * Reverts if project is not in error state E1.
755
+ * Reverts if numBidsToRefund exceeds the number of bids that need to be
756
+ * refunded to resolve the error state E1.
757
+ * @dev Admin-only requirement is not for security, but is to enable Admin
758
+ * to be aware that an error state has been encountered while in post-
759
+ * auction state C.
760
+ * @param projectId Project ID to refunds bids for.
761
+ * @param coreContract Core contract address for the given project.
762
+ * @param numBidsToRefund Number of bids to refund in this call.
763
+ */
764
+ function adminAutoRefundWinners(
765
+ uint256 projectId,
766
+ address coreContract,
767
+ uint24 numBidsToRefund
768
+ ) external nonReentrant {
769
+ // CHECKS
770
+ AuthLib.onlyCoreAdminACL({
771
+ coreContract: coreContract,
772
+ sender: msg.sender,
773
+ contract_: address(this),
774
+ selector: this.adminAutoRefundWinners.selector
775
+ });
776
+ // EFFECTS/INTERACTIONS
777
+ RAMLib.autoRefundBidsToResolveE1({
778
+ projectId: projectId,
779
+ coreContract: coreContract,
780
+ numBidsToRefund: numBidsToRefund,
781
+ minterRefundGasLimit: _minterRefundGasLimit
782
+ });
783
+ }
784
+
785
+ /**
786
+ * @notice This withdraws project revenues for project `projectId` on core
787
+ * contract `coreContract` to the artist and admin, only after all bids
788
+ * have been minted+settled or refunded.
789
+ * Note that the conditions described are the equivalent of project minter
790
+ * State E.
791
+ * @param projectId Project ID to withdraw revenues for.
792
+ * @param coreContract Core contract address for the given project.
793
+ */
794
+ function withdrawArtistAndAdminRevenues(
795
+ uint256 projectId,
796
+ address coreContract
797
+ ) external nonReentrant {
798
+ // CHECKS
799
+ AuthLib.onlyCoreAdminACLOrArtist({
800
+ projectId: projectId,
801
+ coreContract: coreContract,
802
+ sender: msg.sender,
803
+ contract_: address(this),
804
+ selector: this.withdrawArtistAndAdminRevenues.selector
805
+ });
806
+ // EFFECTS/INTERACTIONS
807
+ RAMLib.withdrawArtistAndAdminRevenues({
808
+ projectId: projectId,
809
+ coreContract: coreContract
810
+ });
811
+ }
812
+
813
+ /**
814
+ * @notice Returns if project minter is in ERROR state E1, and the number
815
+ * of bids that need to be refunded to resolve the error.
816
+ * E1: Tokens owed > invocations available
817
+ * Occurs when: tokens are minted on different minter after auction begins,
818
+ * or when core contract max invocations are reduced after auction begins.
819
+ * Resolution: Admin must refund the lowest bids after auction ends.
820
+ * @param projectId Project Id to query
821
+ * @param coreContract Core contract address to query
822
+ * @return isError True if in error state, false otherwise
823
+ * @return numBidsToRefund Number of bids to refund to resolve error, 0 if
824
+ * not in error state
825
+ */
826
+ function getIsErrorE1(
827
+ uint256 projectId,
828
+ address coreContract
829
+ ) external view returns (bool isError, uint256 numBidsToRefund) {
830
+ (isError, numBidsToRefund, ) = RAMLib.isErrorE1FlagF1({
831
+ projectId: projectId,
832
+ coreContract: coreContract
833
+ });
834
+ }
835
+
836
+ /**
837
+ * @notice View function to return the current minter-level configuration
838
+ * details. Some or all of these values may be defined as constants for
839
+ * this minter.
840
+ * @return minAuctionDurationSeconds Minimum auction duration in seconds
841
+ * @return auctionBufferSeconds Auction buffer time in seconds
842
+ * @return maxAuctionExtraSeconds Maximum extra time in seconds
843
+ * @return maxAuctionAdminEmergencyExtensionHours Maximum emergency
844
+ * extension hours for admin
845
+ * @return adminArtistOnlyMintTimeSeconds Admin-artist-only mint time in
846
+ * seconds
847
+ * @return minterRefundGasLimit Gas limit for refunding ETH
848
+ */
849
+ function minterConfigurationDetails()
850
+ external
851
+ view
852
+ returns (
853
+ uint256 minAuctionDurationSeconds,
854
+ uint256 auctionBufferSeconds,
855
+ uint256 maxAuctionExtraSeconds,
856
+ uint256 maxAuctionAdminEmergencyExtensionHours,
857
+ uint256 adminArtistOnlyMintTimeSeconds,
858
+ uint24 minterRefundGasLimit
859
+ )
860
+ {
861
+ minAuctionDurationSeconds = MIN_AUCTION_DURATION_SECONDS;
862
+ auctionBufferSeconds = RAMLib.AUCTION_BUFFER_SECONDS;
863
+ maxAuctionExtraSeconds = RAMLib.MAX_AUCTION_EXTRA_SECONDS;
864
+ maxAuctionAdminEmergencyExtensionHours = RAMLib
865
+ .MAX_AUCTION_ADMIN_EMERGENCY_EXTENSION_HOURS;
866
+ adminArtistOnlyMintTimeSeconds = RAMLib
867
+ .ADMIN_ARTIST_ONLY_MINT_TIME_SECONDS;
868
+ minterRefundGasLimit = _minterRefundGasLimit;
869
+ }
870
+
871
+ /**
872
+ * @notice Gets the admin minting constraint configuration details for a core contract as configured by a
873
+ * contract admin, for this minter.
874
+ * @param coreContract The address of the core contract.
875
+ * @return RAMLib.AdminMintingConstraint enum value.
876
+ */
877
+ function contractConfigurationDetails(
878
+ address coreContract
879
+ ) external view returns (RAMLib.AdminMintingConstraint) {
880
+ return RAMLib.getRAMAdminMintingConstraintValue(coreContract);
881
+ }
882
+
883
+ /**
884
+ * @notice Gets the maximum invocations project configuration.
885
+ * @dev RAMLib shims in logic to properly return maxHasBeenInvoked based
886
+ * on project state, bid state, and core contract state.
887
+ * @param projectId The ID of the project whose data needs to be fetched.
888
+ * @param coreContract The address of the core contract.
889
+ * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
890
+ * configuration data.
891
+ */
892
+ function maxInvocationsProjectConfig(
893
+ uint256 projectId,
894
+ address coreContract
895
+ )
896
+ external
897
+ view
898
+ returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
899
+ {
900
+ // RAM minter does not update maxHasBeenInvoked, so we ask the RAMLib
901
+ // for this state, and it shims in an appropriate maxHasBeenInvoked
902
+ // value based on the state of the auction, unminted bids, core
903
+ // contract invocations, and minter max invocations
904
+ return
905
+ RAMLib.getMaxInvocationsProjectConfig({
906
+ projectId: projectId,
907
+ coreContract: coreContract
908
+ });
909
+ }
910
+
911
+ /**
912
+ * @notice Returns the auction details for project `projectId` on core
913
+ * contract `coreContract`.
914
+ * @param projectId is an existing project ID.
915
+ * @param coreContract is an existing core contract address.
916
+ * @return auctionTimestampStart is the timestamp at which the auction
917
+ * starts.
918
+ * @return auctionTimestampEnd is the timestamp at which the auction ends.
919
+ * @return basePrice is the resting price of the auction, in Wei.
920
+ * @return numTokensInAuction is the number of tokens in the auction.
921
+ * @return numBids is the number of bids in the auction.
922
+ * @return numBidsMintedTokens is the number of bids that have been minted
923
+ * into tokens.
924
+ * @return numBidsErrorRefunded is the number of bids that have been
925
+ * refunded due to an error state.
926
+ * @return minBidSlotIndex is the index of the slot with the minimum bid
927
+ * value.
928
+ * @return allowExtraTime is a bool indicating if the auction is allowed to
929
+ * have extra time.
930
+ * @return adminArtistOnlyMintPeriodIfSellout is a bool indicating if an
931
+ * admin-artist-only mint period is required if the auction sells out.
932
+ * @return revenuesCollected is a bool indicating if the auction revenues
933
+ * have been collected.
934
+ * @return projectMinterState is the current state of the project minter.
935
+ * @dev projectMinterState is a RAMLib.ProjectMinterStates enum value.
936
+ */
937
+ function getAuctionDetails(
938
+ uint256 projectId,
939
+ address coreContract
940
+ )
941
+ external
942
+ view
943
+ returns (
944
+ uint256 auctionTimestampStart,
945
+ uint256 auctionTimestampEnd,
946
+ uint256 basePrice,
947
+ uint256 numTokensInAuction,
948
+ uint256 numBids,
949
+ uint256 numBidsMintedTokens,
950
+ uint256 numBidsErrorRefunded,
951
+ uint256 minBidSlotIndex,
952
+ bool allowExtraTime,
953
+ bool adminArtistOnlyMintPeriodIfSellout,
954
+ bool revenuesCollected,
955
+ RAMLib.ProjectMinterStates projectMinterState
956
+ )
957
+ {
958
+ return
959
+ RAMLib.getAuctionDetails({
960
+ projectId: projectId,
961
+ coreContract: coreContract
962
+ });
963
+ }
964
+
965
+ /**
966
+ * @notice Returns if project has reached maximum number of invocations for
967
+ * a given project and core contract, properly accounting for the auction
968
+ * state, unminted bids, core contract invocations, and minter max
969
+ * invocations when determining maxHasBeenInvoked
970
+ * @param projectId is an existing project ID.
971
+ * @param coreContract is an existing core contract address.
972
+ */
973
+ function projectMaxHasBeenInvoked(
974
+ uint256 projectId,
975
+ address coreContract
976
+ ) external view returns (bool) {
977
+ return
978
+ RAMLib.getMaxHasBeenInvoked({
979
+ projectId: projectId,
980
+ coreContract: coreContract
981
+ });
982
+ }
983
+
984
+ /**
985
+ * @notice projectId => project's maximum number of invocations.
986
+ * Optionally synced with core contract value, for gas optimization.
987
+ * Note that this returns a local cache of the core contract's
988
+ * state, and may be out of sync with the core contract. This is
989
+ * intentional, as it only enables gas optimization of mints after a
990
+ * project's maximum invocations has been reached.
991
+ * @dev A number greater than the core contract's project max invocations
992
+ * will only result in a gas cost increase, since the core contract will
993
+ * still enforce a maxInvocation check during minting. A number less than
994
+ * the core contract's project max invocations is only possible when the
995
+ * project's max invocations have not been synced on this minter, since the
996
+ * V3 core contract only allows maximum invocations to be reduced, not
997
+ * increased. When this happens, the minter will enable minting, allowing
998
+ * the core contract to enforce the max invocations check. Based on this
999
+ * rationale, we intentionally do not do input validation in this method as
1000
+ * to whether or not the input `projectId` is an existing project ID.
1001
+ * @param projectId is an existing project ID.
1002
+ * @param coreContract is an existing core contract address.
1003
+ */
1004
+ function projectMaxInvocations(
1005
+ uint256 projectId,
1006
+ address coreContract
1007
+ ) external view returns (uint256) {
1008
+ return
1009
+ MaxInvocationsLib.getMaxInvocations({
1010
+ projectId: projectId,
1011
+ coreContract: coreContract
1012
+ });
1013
+ }
1014
+
1015
+ /**
1016
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
1017
+ * @dev This function retrieves the cached value of `isEngine` from
1018
+ * the `isEngineCache` mapping. If the cached value is already set, it
1019
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
1020
+ * function from the `SplitFundsLib` library to check if `coreContract`
1021
+ * is a valid engine contract.
1022
+ * @dev This function will revert if the provided `coreContract` is not
1023
+ * a valid Engine or V3 Flagship contract.
1024
+ * @param coreContract The address of the contract to check.
1025
+ * @return True if `coreContract` is a valid engine contract.
1026
+ */
1027
+ function isEngineView(address coreContract) external view returns (bool) {
1028
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
1029
+ .getIsEngineCacheConfig(coreContract);
1030
+ if (isEngineCache.isCached) {
1031
+ return isEngineCache.isEngine;
1032
+ } else {
1033
+ // @dev this calls the non-state-modifying variant of isEngine
1034
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
1035
+ }
1036
+ }
1037
+
1038
+ /**
1039
+ * @notice Gets minimum bid value to participate in an
1040
+ * auction for project `projectId` on core contract `coreContract`.
1041
+ * If an auction is not configured, `isConfigured` will be false, and a
1042
+ * dummy price of zero is assigned to `tokenPriceInWei`.
1043
+ * If an auction is configured but still in a pre-auction state,
1044
+ * `isConfigured` will be true, and `tokenPriceInWei` will be the minimum
1045
+ * initial bid price for the next token auction.
1046
+ * If there is an active auction, `isConfigured` will be true, and
1047
+ * `tokenPriceInWei` will be the current minimum bid's value + min bid
1048
+ * increment due to the minter's increment percentage, rounded up to next
1049
+ * slot's bid value.
1050
+ * If there is an auction that has ended (no longer accepting bids), but
1051
+ * the project is configured, `isConfigured` will be true, and
1052
+ * `tokenPriceInWei` will be either the sellout price or the reserve price
1053
+ * of the auction if it did not sell out during its auction.
1054
+ * Also returns currency symbol and address to be being used as payment,
1055
+ * which for this minter is ETH only.
1056
+ * @param projectId Project ID to get price information for.
1057
+ * @param coreContract Core contract to get price information for.
1058
+ * @return isConfigured true only if project auctions are configured.
1059
+ * @return tokenPriceInWei price in wei to become a bidder on a
1060
+ * token auction.
1061
+ * @return currencySymbol currency symbol for purchases of project on this
1062
+ * minter. This minter always returns "ETH"
1063
+ * @return currencyAddress currency address for purchases of project on
1064
+ * this minter. This minter always returns null address, reserved for ether
1065
+ */
1066
+ function getPriceInfo(
1067
+ uint256 projectId,
1068
+ address coreContract
1069
+ )
1070
+ external
1071
+ view
1072
+ returns (
1073
+ bool isConfigured,
1074
+ uint256 tokenPriceInWei,
1075
+ string memory currencySymbol,
1076
+ address currencyAddress
1077
+ )
1078
+ {
1079
+ (isConfigured, tokenPriceInWei) = RAMLib.getPriceInfo({
1080
+ projectId: projectId,
1081
+ coreContract: coreContract
1082
+ });
1083
+ // currency is always ETH
1084
+ currencySymbol = "ETH";
1085
+ currencyAddress = address(0);
1086
+ }
1087
+
1088
+ /**
1089
+ * @notice Gets minimum next bid value in Wei and slot index for project `projectId`
1090
+ * on core contract `coreContract`.
1091
+ * If in a pre-auction state, reverts if unconfigured, otherwise returns
1092
+ * the minimum initial bid price for the upcoming auction.
1093
+ * If in an active auction, returns the minimum next bid's value and slot
1094
+ * index.
1095
+ * If in a post-auction state, reverts if auction was a sellout, otherwise
1096
+ * returns the auction's reserve price and slot index 0 (because tokens may
1097
+ * still be purchasable at the reserve price).
1098
+ * @param projectId Project ID to get the minimum next bid value for
1099
+ * @param coreContract Core contract address for the given project
1100
+ * @return minNextBidValueInWei minimum next bid value in Wei
1101
+ * @return minNextBidSlotIndex slot index of the minimum next bid
1102
+ */
1103
+ function getMinimumNextBid(
1104
+ uint256 projectId,
1105
+ address coreContract
1106
+ )
1107
+ external
1108
+ view
1109
+ returns (uint256 minNextBidValueInWei, uint256 minNextBidSlotIndex)
1110
+ {
1111
+ (minNextBidValueInWei, minNextBidSlotIndex) = RAMLib.getMinimumNextBid({
1112
+ projectId: projectId,
1113
+ coreContract: coreContract
1114
+ });
1115
+ }
1116
+
1117
+ /**
1118
+ * @notice Returns the value of the lowest bid in the project's auction,
1119
+ * in Wei.
1120
+ * Reverts if no bids exist in the auction.
1121
+ * @param projectId Project ID to get the lowest bid value for
1122
+ * @param coreContract Core contract address for the given project
1123
+ * @return minBidValue Value of the lowest bid in the auction, in Wei
1124
+ */
1125
+ function getLowestBidValue(
1126
+ uint256 projectId,
1127
+ address coreContract
1128
+ ) external view returns (uint256) {
1129
+ (, uint16 minBidSlotIndex) = RAMLib.getLowestBid({
1130
+ projectId: projectId,
1131
+ coreContract: coreContract
1132
+ });
1133
+ // translate slot index to bid value
1134
+ uint88 projectBasePrice = RAMLib
1135
+ .getRAMProjectConfig({
1136
+ projectId: projectId,
1137
+ coreContract: coreContract
1138
+ })
1139
+ .basePrice;
1140
+ return
1141
+ RAMLib.slotIndexToBidValue({
1142
+ basePrice: projectBasePrice,
1143
+ slotIndex: minBidSlotIndex
1144
+ });
1145
+ }
1146
+
1147
+ /**
1148
+ * @notice Convenience view function that returns the bid value associated
1149
+ * with a given slot index for the specified project's auction, in Wei.
1150
+ * Reverts if the slot index is out of range (greater than 511).
1151
+ * @param projectId Project ID to get the bid value for
1152
+ * @param coreContract Core contract address for the given project
1153
+ * @param slotIndex Slot index to get the bid value for
1154
+ */
1155
+ function slotIndexToBidValue(
1156
+ uint256 projectId,
1157
+ address coreContract,
1158
+ uint16 slotIndex
1159
+ ) external view returns (uint256) {
1160
+ uint88 projectBasePrice = RAMLib
1161
+ .getRAMProjectConfig({
1162
+ projectId: projectId,
1163
+ coreContract: coreContract
1164
+ })
1165
+ .basePrice;
1166
+ // @dev does not check if project configured to reduce bytecode size
1167
+ return
1168
+ RAMLib.slotIndexToBidValue({
1169
+ basePrice: projectBasePrice,
1170
+ slotIndex: slotIndex
1171
+ });
1172
+ }
1173
+
1174
+ /**
1175
+ * @notice Returns balance of project `projectId` on core contract
1176
+ * `coreContract` on this minter contract.
1177
+ * @dev project balance is a failsafe backstop used to ensure that funds
1178
+ * from one project may never affect funds from another project on this
1179
+ * shared minter contract.
1180
+ * @param projectId Project ID to get the balance for
1181
+ * @param coreContract Core contract address for the given project
1182
+ */
1183
+ function getProjectBalance(
1184
+ uint256 projectId,
1185
+ address coreContract
1186
+ ) external view returns (uint256) {
1187
+ return
1188
+ RAMLib.getProjectBalance({
1189
+ projectId: projectId,
1190
+ coreContract: coreContract
1191
+ });
1192
+ }
1193
+
1194
+ /**
1195
+ * @notice Exists for interface conformance only.
1196
+ * Use manuallyLimitProjectMaxInvocations to set the maximum invocations
1197
+ * for a project instead.
1198
+ */
1199
+ function syncProjectMaxInvocationsToCore(
1200
+ uint256 /*projectId*/,
1201
+ address /*coreContract*/
1202
+ ) public pure {
1203
+ revert("Action not supported");
1204
+ }
1205
+ }