@artblocks/contracts 1.0.3 → 1.1.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 (383) hide show
  1. package/README.md +32 -25
  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 +212 -17
  5. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +6 -6
  6. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV0.sol/MinterDAExpV0.json +2 -2
  7. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV1.sol/MinterDAExpV1.json +2 -2
  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/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  11. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
  12. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV0.sol/MinterDALinV0.json +2 -2
  13. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV1.sol/MinterDALinV1.json +2 -2
  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/archive/minter-suite/Minters/MinterHolder/MinterHolderV0.sol/MinterHolderV0.json +2 -2
  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/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV0.sol/MinterMerkleV0.json +2 -2
  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/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV0.sol/MinterSetPriceV0.json +2 -2
  26. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV1.sol/MinterSetPriceV1.json +2 -2
  27. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  28. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  29. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol/MinterSetPriceERC20V0.json +2 -2
  30. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol/MinterSetPriceERC20V1.json +2 -2
  31. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  32. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  33. package/artifacts/contracts/engine/V2/GenArt721CoreV2_ENGINE_FLEX.sol/GenArt721CoreV2_ENGINE_FLEX.json +2 -2
  34. package/artifacts/contracts/engine/V2/GenArt721CoreV2_PBAB.sol/GenArt721CoreV2_PBAB.json +2 -2
  35. package/artifacts/contracts/engine/V2/GenArt721CoreV2_PRTNR.sol/GenArt721CoreV2_PRTNR.json +2 -2
  36. package/artifacts/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol/GenArt721MinterBurner_PBAB.json +2 -2
  37. package/artifacts/contracts/engine/V2/GenArt721MinterDAExp_PBAB.sol/GenArt721MinterDAExp_PBAB.json +2 -2
  38. package/artifacts/contracts/engine/V2/GenArt721Minter_PBAB.sol/GenArt721Minter_PBAB.json +2 -2
  39. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +6 -11
  40. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +6 -11
  41. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +6 -11
  42. package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +2 -2
  43. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +6 -11
  44. package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
  45. package/artifacts/contracts/engine-registry/EngineRegistryV0.sol/EngineRegistryV0.json +2 -2
  46. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +6 -6
  47. package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IBonusContract.sol/IBonusContract.json +1 -1
  48. package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreContractV1.sol/IGenArt721CoreContractV1.json +1 -1
  49. package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreV2_PBAB.sol/IGenArt721CoreV2_PBAB.json +1 -1
  50. package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IRandomizer.sol/IRandomizer.json +1 -1
  51. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IAdminACLV0.sol/IAdminACLV0.json +1 -1
  52. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IArtblocksRoyaltyOverride.sol/IArtblocksRoyaltyOverride.json +1 -1
  53. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IBonusContract.sol/IBonusContract.json +1 -1
  54. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +1 -1
  55. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/ICoreRegistryV1.sol/ICoreRegistryV1.json +7 -7
  56. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDelegationRegistry.sol/IDelegationRegistry.json +1 -1
  57. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryCompatibleV0.sol/IDependencyRegistryCompatibleV0.json +1 -1
  58. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +22 -3
  59. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IEngineRegistryV0.sol/IEngineRegistryV0.json +1 -1
  60. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV0.sol/IFilteredMinterDAExpSettlementV0.json +1 -1
  61. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +1 -1
  62. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlement_Mixin.sol/IFilteredMinterDAExpSettlement_Mixin.json +1 -1
  63. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV0.sol/IFilteredMinterDAExpV0.json +1 -1
  64. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV1.sol/IFilteredMinterDAExpV1.json +1 -1
  65. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV0.sol/IFilteredMinterDALinV0.json +1 -1
  66. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV1.sol/IFilteredMinterDALinV1.json +1 -1
  67. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV0.sol/IFilteredMinterHolderV0.json +1 -1
  68. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV1.sol/IFilteredMinterHolderV1.json +1 -1
  69. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV2.sol/IFilteredMinterHolderV2.json +1 -1
  70. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV0.sol/IFilteredMinterMerkleV0.json +1 -1
  71. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV1.sol/IFilteredMinterMerkleV1.json +1 -1
  72. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV2.sol/IFilteredMinterMerkleV2.json +1 -1
  73. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterSEAV0.sol/IFilteredMinterSEAV0.json +1 -1
  74. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV0.sol/IFilteredMinterV0.json +1 -1
  75. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV1.sol/IFilteredMinterV1.json +1 -1
  76. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV2.sol/IFilteredMinterV2.json +1 -1
  77. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractExposesHashSeed.sol/IGenArt721CoreContractExposesHashSeed.json +1 -1
  78. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV1.sol/IGenArt721CoreContractV1.json +1 -1
  79. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +1 -1
  80. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3WithSharedRandomizer.sol/IGenArt721CoreContractV3WithSharedRandomizer.json +24 -0
  81. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +1 -1
  82. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +1 -1
  83. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +1 -1
  84. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreV2_PBAB.sol/IGenArt721CoreV2_PBAB.json +1 -1
  85. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IManifold.sol/IManifold.json +1 -1
  86. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterBaseV0.sol/IMinterBaseV0.json +1 -1
  87. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV0.sol/IMinterFilterV0.json +1 -1
  88. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV1.sol/IMinterFilterV1.json +104 -19
  89. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPICoreV0.sol/IMintingAPICoreV0.json +1 -1
  90. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPIMinterV0.sol/IMintingAPIMinterV0.json +1 -1
  91. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
  92. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer.sol/IRandomizer.json +1 -1
  93. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerPolyptychV0.sol/IRandomizerPolyptychV0.json +1 -1
  94. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerV2.sol/IRandomizerV2.json +1 -1
  95. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer_V3CoreBase.sol/IRandomizer_V3CoreBase.json +1 -1
  96. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +114 -0
  97. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +37 -0
  98. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +37 -0
  99. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +50 -0
  100. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
  101. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +128 -0
  102. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +97 -0
  103. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +29 -0
  104. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +64 -0
  105. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +117 -0
  106. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +52 -36
  107. package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IWETH.sol/IWETH.json +1 -1
  108. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Address.json +2 -2
  109. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Counters.json +2 -2
  110. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/CustomERC721Metadata.json +2 -2
  111. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/ERC721.json +2 -2
  112. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/ERC721Enumerable.json +2 -2
  113. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/GenArt721CoreV1.json +2 -2
  114. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/SafeMath.json +2 -2
  115. package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Strings.json +2 -2
  116. package/artifacts/contracts/legacy/GenArt721LegacyMinter.sol/GenArt721LegacyMinter.json +2 -2
  117. package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
  118. package/artifacts/contracts/libs/{0.5.x → v0.5.x}/CustomERC721Metadata.sol/CustomERC721Metadata.json +3 -3
  119. package/artifacts/contracts/libs/{0.5.x → v0.5.x}/IERC20.sol/IERC20.json +1 -1
  120. package/artifacts/contracts/libs/{0.5.x → v0.5.x}/SafeMath.sol/SafeMath.json +3 -3
  121. package/artifacts/contracts/libs/{0.5.x → v0.5.x}/Strings.sol/Strings.json +3 -3
  122. package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +10 -0
  123. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +10 -0
  124. package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV0.sol/BytecodeStorage.json +3 -3
  125. package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol/BytecodeStorageReader.json +3 -3
  126. package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol/BytecodeStorageWriter.json +3 -3
  127. package/artifacts/contracts/libs/{0.8.x → v0.8.x}/Bytes32Strings.sol/Bytes32Strings.json +3 -3
  128. package/artifacts/contracts/libs/{0.8.x → v0.8.x}/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +3 -3
  129. package/artifacts/contracts/libs/{0.8.x → v0.8.x}/SSTORE2.sol/SSTORE2.json +3 -3
  130. package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +67 -0
  131. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
  132. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +67 -0
  133. package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
  134. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +36 -0
  135. package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +37 -0
  136. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +10 -0
  137. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +261 -0
  138. package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +55 -0
  139. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +48 -0
  140. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +42 -0
  141. package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +86 -0
  142. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV0.sol/MinterFilterV0.json +2 -2
  143. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  144. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +96 -40
  145. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +662 -0
  146. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -20
  147. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +619 -0
  148. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
  149. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +418 -0
  150. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +662 -0
  151. package/artifacts/contracts/minter-suite/Minters/MinterDALinV4.sol/MinterDALinV4.json +2 -2
  152. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +418 -0
  153. package/artifacts/contracts/minter-suite/Minters/MinterHolderV4.sol/MinterHolderV4.json +2 -2
  154. package/artifacts/contracts/minter-suite/Minters/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
  155. package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
  156. package/artifacts/contracts/minter-suite/Minters/MinterSEAV0.sol/MinterSEAV0.json +2 -2
  157. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +659 -0
  158. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
  159. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +452 -0
  160. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +600 -0
  161. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +633 -0
  162. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +782 -0
  163. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +676 -0
  164. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
  165. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +356 -0
  166. package/artifacts/contracts/mock/BytecodeV0TextCR_DMock.sol/BytecodeV0TextCR_DMock.json +2 -2
  167. package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +2 -2
  168. package/artifacts/contracts/mock/BytecodeV1TextCR_DMock.sol/BytecodeV1TextCR_DMock.json +4 -4
  169. package/artifacts/contracts/mock/DeadReceiverBidderMock.sol/DeadReceiverBidderMock.json +25 -2
  170. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  171. package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +28 -2
  172. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +6 -11
  173. package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +2 -2
  174. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
  175. package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
  176. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  177. package/artifacts/contracts/mock/ReentrancyHolderMock.sol/ReentrancyHolderMock.json +2 -2
  178. package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
  179. package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
  180. package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
  181. package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
  182. package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
  183. package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +2 -2
  184. package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
  185. package/artifacts/contracts/mock/SSTORE2Mock.sol/SSTORE2Mock.json +2 -2
  186. package/artifacts/contracts/randomizer/deprecated/BasicRandomizer.sol/BasicRandomizer.json +2 -2
  187. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
  188. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
  189. package/artifacts/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +2 -2
  190. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +58 -42
  191. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +2 -2
  192. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol/GenArt721RoyaltyOverride_PBAB.json +2 -2
  193. package/contracts/AdminACLV0.sol +1 -1
  194. package/contracts/AdminACLV1.sol +1 -1
  195. package/contracts/DependencyRegistryV0.sol +300 -123
  196. package/contracts/GenArt721CoreV3.sol +27 -12
  197. package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV0.sol +3 -3
  198. package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV1.sol +3 -3
  199. package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol +3 -3
  200. package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol +3 -3
  201. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +3 -3
  202. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +3 -3
  203. package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV0.sol +3 -3
  204. package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV1.sol +3 -3
  205. package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol +3 -3
  206. package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol +3 -3
  207. package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV0.sol +3 -3
  208. package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol +3 -3
  209. package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol +4 -4
  210. package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol +4 -4
  211. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV0.sol +3 -3
  212. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol +3 -3
  213. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol +4 -4
  214. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol +4 -4
  215. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol +4 -4
  216. package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV0.sol +3 -3
  217. package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV1.sol +3 -3
  218. package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol +3 -3
  219. package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol +3 -3
  220. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol +3 -3
  221. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol +3 -3
  222. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol +3 -3
  223. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol +3 -3
  224. package/contracts/archive/readme.md +16 -0
  225. package/contracts/engine/README.md +21 -0
  226. package/contracts/engine/V2/GenArt721CoreV2_ENGINE_FLEX.sol +2 -2
  227. package/contracts/engine/V2/GenArt721CoreV2_PBAB.sol +2 -2
  228. package/contracts/engine/V2/GenArt721CoreV2_PRTNR.sol +3 -3
  229. package/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol +2 -2
  230. package/contracts/engine/V2/GenArt721MinterDAExp_PBAB.sol +1 -1
  231. package/contracts/engine/V2/GenArt721Minter_PBAB.sol +2 -2
  232. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +31 -22
  233. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +31 -22
  234. package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +12 -18
  235. package/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol +1 -1
  236. package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +23 -24
  237. package/contracts/engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol +1 -1
  238. package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +1 -1
  239. package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
  240. package/contracts/engine-registry/EngineRegistryV0.sol +1 -1
  241. package/contracts/explorations/GenArt721CoreV3_Explorations.sol +27 -12
  242. package/contracts/interfaces/{0.8.x → v0.8.x}/ICoreRegistryV1.sol +6 -8
  243. package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryV0.sol +5 -2
  244. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3WithSharedRandomizer.sol +23 -0
  245. package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV1.sol +45 -19
  246. package/contracts/interfaces/v0.8.x/IRandomizer_V3CoreBase.sol +23 -0
  247. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +28 -0
  248. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +12 -0
  249. package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +12 -0
  250. package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +13 -0
  251. package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
  252. package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +41 -0
  253. package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +34 -0
  254. package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +15 -0
  255. package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +28 -0
  256. package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +43 -0
  257. package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +123 -0
  258. package/contracts/legacy/GenArt721CoreV1.sol +2 -2
  259. package/contracts/legacy/GenArt721LegacyMinter.sol +5 -5
  260. package/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol +1 -1
  261. package/contracts/libs/v0.8.x/ABHelpers.sol +55 -0
  262. package/contracts/libs/v0.8.x/AuthLib.sol +196 -0
  263. package/contracts/libs/{0.8.x → v0.8.x}/Bytes32Strings.sol +5 -5
  264. package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +250 -0
  265. package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
  266. package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +216 -0
  267. package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
  268. package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +488 -0
  269. package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +384 -0
  270. package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +240 -0
  271. package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +995 -0
  272. package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +166 -0
  273. package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +770 -0
  274. package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +741 -0
  275. package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +291 -0
  276. package/contracts/minter-suite/MinterFilter/MinterFilterV0.sol +3 -3
  277. package/contracts/minter-suite/MinterFilter/MinterFilterV1.sol +5 -5
  278. package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +414 -297
  279. package/contracts/minter-suite/Minters/MinterBase_v0_1_1.sol +4 -4
  280. package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +866 -0
  281. package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +4 -57
  282. package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +886 -0
  283. package/contracts/minter-suite/Minters/MinterDAExpV4.sol +3 -3
  284. package/contracts/minter-suite/Minters/MinterDAExpV5.sol +545 -0
  285. package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +857 -0
  286. package/contracts/minter-suite/Minters/MinterDALinV4.sol +3 -3
  287. package/contracts/minter-suite/Minters/MinterDALinV5.sol +534 -0
  288. package/contracts/minter-suite/Minters/MinterHolderV4.sol +4 -4
  289. package/contracts/minter-suite/Minters/MinterMerkleV5.sol +4 -4
  290. package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +6 -6
  291. package/contracts/minter-suite/Minters/MinterSEAV0.sol +3 -3
  292. package/contracts/minter-suite/Minters/MinterSEAV1.sol +853 -0
  293. package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +5 -5
  294. package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +545 -0
  295. package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +730 -0
  296. package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +714 -0
  297. package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +1012 -0
  298. package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +868 -0
  299. package/contracts/minter-suite/Minters/MinterSetPriceV4.sol +3 -3
  300. package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +414 -0
  301. package/contracts/mock/BytecodeV0TextCR_DMock.sol +1 -1
  302. package/contracts/mock/BytecodeV1LibCallsMock.sol +1 -1
  303. package/contracts/mock/BytecodeV1TextCR_DMock.sol +1 -1
  304. package/contracts/mock/DeadReceiverBidderMock.sol +15 -0
  305. package/contracts/mock/DummySharedMinter.sol +2 -2
  306. package/contracts/mock/ERC20Mock.sol +16 -0
  307. package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +11 -18
  308. package/contracts/mock/MockAdminACLV0.sol +1 -1
  309. package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +1 -1
  310. package/contracts/mock/OriginRegisterMock.sol +1 -1
  311. package/contracts/mock/ReentrancyHolderMock.sol +1 -1
  312. package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
  313. package/contracts/mock/ReentrancyMerkleMock.sol +1 -1
  314. package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
  315. package/contracts/mock/ReentrancyMock.sol +1 -1
  316. package/contracts/mock/ReentrancyMockShared.sol +48 -0
  317. package/contracts/mock/ReentrancySEAMock.sol +1 -1
  318. package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
  319. package/contracts/mock/SSTORE2Mock.sol +1 -1
  320. package/contracts/randomizer/deprecated/BasicRandomizer.sol +1 -1
  321. package/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol +2 -2
  322. package/contracts/randomizer/deprecated/RandomizerV2.sol +2 -2
  323. package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
  324. package/contracts/randomizer/shared/SharedRandomizerV0.sol +134 -111
  325. package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +2 -2
  326. package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +2 -2
  327. package/package.json +57 -36
  328. package/LICENSE +0 -165
  329. package/contracts/interfaces/0.8.x/IRandomizer_V3CoreBase.sol +0 -10
  330. package/contracts/interfaces/0.8.x/ISharedRandomizerV0.sol +0 -105
  331. /package/contracts/interfaces/{0.5.x → v0.5.x}/IBonusContract.sol +0 -0
  332. /package/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreContractV1.sol +0 -0
  333. /package/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreV2_PBAB.sol +0 -0
  334. /package/contracts/interfaces/{0.5.x → v0.5.x}/IRandomizer.sol +0 -0
  335. /package/contracts/interfaces/{0.8.x → v0.8.x}/IAdminACLV0.sol +0 -0
  336. /package/contracts/interfaces/{0.8.x → v0.8.x}/IArtblocksRoyaltyOverride.sol +0 -0
  337. /package/contracts/interfaces/{0.8.x → v0.8.x}/IBonusContract.sol +0 -0
  338. /package/contracts/interfaces/{0.8.x → v0.8.x}/IBytecodeStorageReader.sol +0 -0
  339. /package/contracts/interfaces/{0.8.x → v0.8.x}/IDelegationRegistry.sol +0 -0
  340. /package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryCompatibleV0.sol +0 -0
  341. /package/contracts/interfaces/{0.8.x → v0.8.x}/IEngineRegistryV0.sol +0 -0
  342. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV0.sol +0 -0
  343. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV1.sol +0 -0
  344. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlement_Mixin.sol +0 -0
  345. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV0.sol +0 -0
  346. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV1.sol +0 -0
  347. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV0.sol +0 -0
  348. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV1.sol +0 -0
  349. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV0.sol +0 -0
  350. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV1.sol +0 -0
  351. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV2.sol +0 -0
  352. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV0.sol +0 -0
  353. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV1.sol +0 -0
  354. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV2.sol +0 -0
  355. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterSEAV0.sol +0 -0
  356. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV0.sol +0 -0
  357. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV1.sol +0 -0
  358. /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV2.sol +0 -0
  359. /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractExposesHashSeed.sol +0 -0
  360. /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV1.sol +0 -0
  361. /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3.sol +0 -0
  362. /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Base.sol +0 -0
  363. /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol +0 -0
  364. /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine_Flex.sol +0 -0
  365. /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreV2_PBAB.sol +0 -0
  366. /package/contracts/interfaces/{0.8.x → v0.8.x}/IManifold.sol +0 -0
  367. /package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterBaseV0.sol +0 -0
  368. /package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV0.sol +0 -0
  369. /package/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPICoreV0.sol +0 -0
  370. /package/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPIMinterV0.sol +0 -0
  371. /package/contracts/interfaces/{0.8.x → v0.8.x}/IPseudorandomAtomic.sol +0 -0
  372. /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer.sol +0 -0
  373. /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerPolyptychV0.sol +0 -0
  374. /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerV2.sol +0 -0
  375. /package/contracts/interfaces/{0.8.x → v0.8.x}/IWETH.sol +0 -0
  376. /package/contracts/libs/{0.5.x → v0.5.x}/CustomERC721Metadata.sol +0 -0
  377. /package/contracts/libs/{0.5.x → v0.5.x}/IERC20.sol +0 -0
  378. /package/contracts/libs/{0.5.x → v0.5.x}/SafeMath.sol +0 -0
  379. /package/contracts/libs/{0.5.x → v0.5.x}/Strings.sol +0 -0
  380. /package/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV0.sol +0 -0
  381. /package/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol +0 -0
  382. /package/contracts/libs/{0.8.x → v0.8.x}/ERC721_PackedHashSeed.sol +0 -0
  383. /package/contracts/libs/{0.8.x → v0.8.x}/SSTORE2.sol +0 -0
@@ -0,0 +1,995 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ pragma solidity ^0.8.0;
5
+
6
+ import {IMinterFilterV1} from "../../../interfaces/v0.8.x/IMinterFilterV1.sol";
7
+
8
+ import {ABHelpers} from "../ABHelpers.sol";
9
+ import {SplitFundsLib} from "./SplitFundsLib.sol";
10
+ import {MaxInvocationsLib} from "./MaxInvocationsLib.sol";
11
+
12
+ import {IERC721} from "@openzeppelin-4.7/contracts/token/ERC721/IERC721.sol";
13
+ import {SafeCast} from "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
14
+
15
+ /**
16
+ * @title Art Blocks SEA Minter Library
17
+ * @notice This library is designed for the Art Blocks platform. It includes
18
+ * Structs and functions that help with serial English auction minters.
19
+ * @author Art Blocks Inc.
20
+ */
21
+
22
+ library SEALib {
23
+ using SafeCast for uint256;
24
+ /**
25
+ * @notice Minimum auction length, in seconds, was updated to be the
26
+ * provided value.
27
+ * @param minAuctionDurationSeconds Minimum auction length, in seconds
28
+ */
29
+ event MinAuctionDurationSecondsUpdated(uint256 minAuctionDurationSeconds);
30
+
31
+ /**
32
+ * @notice Admin-controlled time buffer updated
33
+ * @param minterTimeBufferSeconds Time buffer, in seconds
34
+ */
35
+ event MinterTimeBufferUpdated(uint32 minterTimeBufferSeconds);
36
+
37
+ /**
38
+ * @notice Admin-controlled refund gas limit updated
39
+ * @param refundGasLimit Gas limit to use when refunding the previous
40
+ * highest bidder, prior to using fallback force-send to refund
41
+ */
42
+ event MinterRefundGasLimitUpdated(uint24 refundGasLimit);
43
+
44
+ /**
45
+ * @notice Future auctions for project `projectId` on core contract
46
+ * `coreContract` configured.
47
+ * @param projectId Project Id configured
48
+ * @param coreContract Core contract address configured
49
+ * @param timestampStart Start timestamp after which future auctions may be
50
+ * started. If zero, auctions can start immediately.
51
+ * @param auctionDurationSeconds Duration of each new auction, before any
52
+ * extensions due to late bids
53
+ * @param basePrice Minimum bid price for the token auctions
54
+ * @param minBidIncrementPercentage Minimum bid increment percentage. Each
55
+ * subsequent bid must be at least this percentage greater than the
56
+ * previous bid. The value is expressed as a whole percentage, e.g. 5% is
57
+ * 5, 10% is 10, etc.
58
+ */
59
+ event ConfiguredFutureAuctions(
60
+ uint256 indexed projectId,
61
+ address indexed coreContract,
62
+ uint64 timestampStart,
63
+ uint32 auctionDurationSeconds,
64
+ uint256 basePrice,
65
+ uint8 minBidIncrementPercentage
66
+ );
67
+
68
+ /**
69
+ * @notice New token auction created, token created and sent to minter
70
+ * @param tokenId Token Id for which auction was created
71
+ * @param coreContract Core contract address for the given token
72
+ * @param bidder Bidder's address who initialized the auction
73
+ * @param bidAmount Bid amount
74
+ * @param endTime Auction end time
75
+ * @param minBidIncrementPercentage Minimum bid increment percentage. Each
76
+ * subsequent bid must be at least this percentage greater than the
77
+ * previous bid. The value is expressed as a whole percentage, e.g. 5% is
78
+ * 5, 10% is 10, etc.
79
+ */
80
+ event AuctionInitialized(
81
+ uint256 indexed tokenId,
82
+ address indexed coreContract,
83
+ address indexed bidder,
84
+ uint256 bidAmount,
85
+ uint64 endTime,
86
+ uint8 minBidIncrementPercentage
87
+ );
88
+
89
+ /**
90
+ * @notice Successful bid placed on token auction
91
+ * @param tokenId Token Id of auction bid on
92
+ * @param coreContract Core contract address for the given token
93
+ * @param bidder Bidder's address who placed the bid
94
+ * @param bidAmount Bid amount
95
+ */
96
+ event AuctionBid(
97
+ uint256 indexed tokenId,
98
+ address indexed coreContract,
99
+ address indexed bidder,
100
+ uint256 bidAmount
101
+ );
102
+
103
+ /**
104
+ * @notice Token auction was settled (token distributed to winner)
105
+ * @param tokenId Token Id of auction settled
106
+ * @param coreContract Core contract address for the given token
107
+ * @param winner Winner's address
108
+ * @param price Winning bid amount
109
+ */
110
+ event AuctionSettled(
111
+ uint256 indexed tokenId,
112
+ address indexed coreContract,
113
+ address indexed winner,
114
+ uint256 price
115
+ );
116
+
117
+ /**
118
+ * @notice Future auction details for project `projectId` reset
119
+ * @param projectId Project Id that was reset
120
+ * @param coreContract Core contract address that was reset
121
+ */
122
+ event ResetAuctionDetails(
123
+ uint256 indexed projectId,
124
+ address indexed coreContract
125
+ );
126
+
127
+ /**
128
+ * @notice Next token ID for project `projectId` updated
129
+ * @param projectId Project Id of next token updated
130
+ * @param coreContract Core contract address of next token updated
131
+ * @param tokenId Token Id of next token updated
132
+ */
133
+ event ProjectNextTokenUpdated(
134
+ uint256 indexed projectId,
135
+ address indexed coreContract,
136
+ uint256 tokenId
137
+ );
138
+
139
+ /**
140
+ * @notice Next token ID for project `projectId` ejected from the minter
141
+ * and is no longer populated
142
+ * @param projectId Project Id of next token ejected
143
+ * @param coreContract Core contract address of next token ejected
144
+ */
145
+ event ProjectNextTokenEjected(
146
+ uint256 indexed projectId,
147
+ address indexed coreContract
148
+ );
149
+
150
+ // position of SEA Lib storage, using a diamond storage pattern
151
+ // for this library
152
+ bytes32 constant SEA_LIB_STORAGE_POSITION = keccak256("sealib.storage");
153
+
154
+ uint256 constant ONE_MILLION = 1_000_000;
155
+
156
+ // project-specific parameters
157
+ struct SEAProjectConfig {
158
+ uint64 timestampStart;
159
+ // duration of each new auction, before any extensions due to late bids
160
+ // @dev for configured auctions, this will be gt 0, so it may be used
161
+ // to determine if an auction is configured
162
+ uint32 auctionDurationSeconds;
163
+ // minimum bid increment percentage. each subsequent bid must be at
164
+ // least this percentage greater than the previous bid. the value is
165
+ // expressed as a whole percentage, e.g. 5% is 5, 10% is 10, etc.
166
+ // @dev this is a project-level constraint, defined by the artist.
167
+ // recommended values are between 5 and 10 percent.
168
+ // max uint8 = 255, so max value is 255% (which is more than expected
169
+ // to be used)
170
+ uint8 minBidIncrementPercentage;
171
+ // next token number to be auctioned, owned by minter
172
+ // @dev store token number to enable storage packing, as token ID can
173
+ // be derived from this value in combination with project ID
174
+ // max uint24 ~= 1.6e7, > max possible project invocations of 1e6
175
+ uint24 nextTokenNumber;
176
+ // bool to indicate if next token number has been populated, or is
177
+ // still default value of 0
178
+ // @dev required to handle edge case where next token number is 0
179
+ bool nextTokenNumberIsPopulated;
180
+ // reserve price, i.e. minimum starting bid price, in wei
181
+ uint256 basePrice;
182
+ // active auction for project
183
+ Auction activeAuction;
184
+ }
185
+
186
+ /// Struct that defines a single token English auction
187
+ struct Auction {
188
+ // token number of NFT being auctioned
189
+ uint256 tokenId;
190
+ // The current highest bid amount (in wei)
191
+ uint256 currentBid;
192
+ // The address of the current highest bidder
193
+ // @dev if this is not the zero address, then the auction is
194
+ // considered initialized
195
+ address payable currentBidder;
196
+ // The time that the auction is scheduled to end
197
+ // max uint64 ~= 1.8e19 sec ~= 570 billion years
198
+ uint64 endTime;
199
+ // The minimum percentage increase required for the next bid
200
+ // value is copied from SEAProjectConfig, where it is also a uint8
201
+ uint8 minBidIncrementPercentage;
202
+ // Whether or not the auction has been settled
203
+ bool settled;
204
+ }
205
+
206
+ // Diamond storage pattern is used in this library
207
+ struct SEALibStorage {
208
+ mapping(address coreContract => mapping(uint256 projectId => SEAProjectConfig)) SEAProjectConfigs;
209
+ }
210
+
211
+ /**
212
+ * @notice Updates the SEAProjectConfig to clear the current settings for
213
+ * future auctions on the project. Values are reset to their default
214
+ * initial values.
215
+ * Current auction details are not cleared or affected.
216
+ * @param projectId Project ID to reset
217
+ * @param coreContract Core contract address to reset
218
+ */
219
+ function resetFutureAuctionDetails(
220
+ uint256 projectId,
221
+ address coreContract
222
+ ) internal {
223
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
224
+ projectId: projectId,
225
+ coreContract: coreContract
226
+ });
227
+ // reset future auction details
228
+ SEAProjectConfig_.auctionDurationSeconds = 0;
229
+ SEAProjectConfig_.minBidIncrementPercentage = 0;
230
+ SEAProjectConfig_.basePrice = 0;
231
+ SEAProjectConfig_.timestampStart = 0;
232
+
233
+ emit ResetAuctionDetails({
234
+ projectId: projectId,
235
+ coreContract: coreContract
236
+ });
237
+ }
238
+
239
+ /**
240
+ * @notice Configures future auctions for project `projectId` on core
241
+ * contract `coreContract`.
242
+ * Reverts if `timestampStart` is in the past and not zero.
243
+ * @param projectId Project ID to configure
244
+ * @param coreContract Core contract address to configure
245
+ * @param timestampStart Timestamp to start future auctions at. If zero,
246
+ * auctions can start immediately.
247
+ * @param auctionDurationSeconds Duration of each new auction, before any
248
+ * extensions due to late bids
249
+ * @param basePrice Minimum bid price for the token auctions
250
+ * @param minBidIncrementPercentage Minimum bid increment percentage. Each
251
+ * subsequent bid must be at least this percentage greater than the
252
+ * previous bid. The value is expressed as a whole percentage, e.g. 5% is
253
+ * 5, 10% is 10, etc.
254
+ */
255
+ function configureFutureAuctions(
256
+ uint256 projectId,
257
+ address coreContract,
258
+ uint256 timestampStart,
259
+ uint256 auctionDurationSeconds,
260
+ uint256 basePrice,
261
+ uint8 minBidIncrementPercentage
262
+ ) internal {
263
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
264
+ projectId: projectId,
265
+ coreContract: coreContract
266
+ });
267
+ require(
268
+ timestampStart == 0 || block.timestamp < timestampStart,
269
+ "Only future start times or 0"
270
+ );
271
+ // EFFECTS
272
+ SEAProjectConfig_.timestampStart = timestampStart.toUint64(); // @dev rely on this safe-cast check in event emit below
273
+ SEAProjectConfig_.auctionDurationSeconds = auctionDurationSeconds
274
+ .toUint32();
275
+ SEAProjectConfig_.basePrice = basePrice;
276
+ SEAProjectConfig_.minBidIncrementPercentage = minBidIncrementPercentage;
277
+
278
+ emit ConfiguredFutureAuctions({
279
+ projectId: projectId,
280
+ coreContract: coreContract,
281
+ timestampStart: uint64(timestampStart), // @dev safe-casting already previously checked
282
+ auctionDurationSeconds: auctionDurationSeconds.toUint32(),
283
+ basePrice: basePrice,
284
+ minBidIncrementPercentage: minBidIncrementPercentage
285
+ });
286
+ }
287
+
288
+ /**
289
+ * @notice Updates the bid state of an Auction.
290
+ * Note that the auction's end time is extended if the bid is placed within
291
+ * the last `timeBufferSeconds` of the auction.
292
+ * NOTE: This function does not check if the bid is valid. It is assumed
293
+ * that the bid has already been checked for validity by the caller.
294
+ * @param auction Auction to update
295
+ * @param timeBufferSeconds Time buffer to extend the auction to if the
296
+ * bid is placed within the last `timeBufferSeconds` of the auction.
297
+ * @param bidAmount bid amount
298
+ * @param bidder bidder's payable address
299
+ */
300
+ function auctionUpdateBid(
301
+ Auction storage auction,
302
+ uint256 timeBufferSeconds,
303
+ uint256 bidAmount,
304
+ address payable bidder
305
+ ) internal {
306
+ // update auction state
307
+ auction.currentBid = bidAmount;
308
+ auction.currentBidder = bidder;
309
+ uint256 minEndTime = block.timestamp + timeBufferSeconds;
310
+ if (auction.endTime < minEndTime) {
311
+ auction.endTime = minEndTime.toUint64();
312
+ }
313
+ }
314
+
315
+ /**
316
+ * @notice Ejects a project's "next token" from the minter and sends it to
317
+ * the input `to` address.
318
+ * This function is only intended for use in the edge case where the minter
319
+ * has a "next token" assigned to a project, but the project has been reset
320
+ * via `resetAuctionDetails`, and the artist does not want an auction to be
321
+ * started for the "next token". This function also protects against the
322
+ * unforseen case where the minter is in an unexpected state where it has a
323
+ * "next token" assigned to a project, but for some reason the project is
324
+ * unable to begin a new auction due to a bug.
325
+ * @param projectId The project ID being ejected
326
+ * @param coreContract The core contract address being ejected
327
+ * @param to The address to send the ejected token to
328
+ */
329
+ function ejectNextTokenTo(
330
+ uint256 projectId,
331
+ address coreContract,
332
+ address to
333
+ ) internal {
334
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
335
+ projectId: projectId,
336
+ coreContract: coreContract
337
+ });
338
+ // CHECKS
339
+ // only if project is not configured (i.e. artist called
340
+ // `resetAuctionDetails`)
341
+ require(
342
+ !projectIsConfigured({
343
+ projectId: projectId,
344
+ coreContract: coreContract
345
+ }),
346
+ "Only unconfigured projects"
347
+ );
348
+ // only if project has a next token assigned
349
+ require(
350
+ SEAProjectConfig_.nextTokenNumberIsPopulated == true,
351
+ "No next token"
352
+ );
353
+ // EFFECTS
354
+ SEAProjectConfig_.nextTokenNumberIsPopulated = false;
355
+ // INTERACTIONS
356
+ // @dev overflow automatically handled by Sol ^0.8.0
357
+ uint256 nextTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
358
+ projectId: projectId,
359
+ tokenNumber: SEAProjectConfig_.nextTokenNumber
360
+ });
361
+ IERC721(coreContract).transferFrom({
362
+ from: address(this),
363
+ to: to,
364
+ tokenId: nextTokenId
365
+ });
366
+ emit ProjectNextTokenEjected({
367
+ projectId: projectId,
368
+ coreContract: coreContract
369
+ });
370
+ }
371
+
372
+ /**
373
+ * @notice Settles a completed auction for `tokenId`, if it exists and is
374
+ * not yet settled.
375
+ * Returns early (does not modify state) if
376
+ * - there is no initialized auction for the project
377
+ * - there is an auction that has already been settled for the project
378
+ * - there is an auction for a different token ID on the project
379
+ * (likely due to a front-run)
380
+ * This function reverts if the auction for `tokenId` exists, but has not
381
+ * yet ended.
382
+ * @param tokenId Token ID to settle auction for.
383
+ * @param coreContract Core contract address for the given token.
384
+ */
385
+ function settleAuction(uint256 tokenId, address coreContract) internal {
386
+ uint256 projectId = ABHelpers.tokenIdToProjectId(tokenId);
387
+ SEAProjectConfig storage _SEAProjectConfig = getSEAProjectConfig({
388
+ projectId: projectId,
389
+ coreContract: coreContract
390
+ });
391
+ Auction storage auction = _SEAProjectConfig.activeAuction;
392
+ // load from storage to memory for gas efficiency
393
+ address currentBidder = auction.currentBidder;
394
+ uint256 currentBid = auction.currentBid;
395
+ // CHECKS
396
+ // @dev this check is not strictly necessary, but is included for
397
+ // clear error messaging
398
+ require(auctionIsInitialized(auction), "Auction not initialized");
399
+ if (auction.settled || (auction.tokenId != tokenId)) {
400
+ // auction already settled or is for a different token ID, so
401
+ // return early and do not modify state
402
+ return;
403
+ }
404
+ // @dev important that the following check is after the early return
405
+ // block above to maintain desired behavior
406
+ require(block.timestamp >= auction.endTime, "Auction not yet ended");
407
+ // EFFECTS
408
+ auction.settled = true;
409
+ // INTERACTIONS
410
+ // send token to the winning bidder
411
+ IERC721(coreContract).transferFrom({
412
+ from: address(this),
413
+ to: currentBidder,
414
+ tokenId: tokenId
415
+ });
416
+ // distribute revenues from auction
417
+ SplitFundsLib.splitRevenuesETHNoRefund({
418
+ projectId: projectId,
419
+ valueInWei: currentBid,
420
+ coreContract: coreContract
421
+ });
422
+
423
+ emit AuctionSettled({
424
+ tokenId: tokenId,
425
+ coreContract: coreContract,
426
+ winner: currentBidder,
427
+ price: currentBid
428
+ });
429
+ }
430
+
431
+ /**
432
+ * @notice Enters a bid for token `tokenId`.
433
+ * If an auction for token `tokenId` does not exist, an auction will be
434
+ * initialized as long as any existing auction for the project has been
435
+ * settled.
436
+ * In order to successfully place the bid, the token bid must be:
437
+ * - greater than or equal to a project's minimum bid price if a new
438
+ * auction is initialized
439
+ * - sufficiently greater than the current highest bid, according to the
440
+ * minter's bid increment percentage `minterMinBidIncrementPercentage`,
441
+ * if an auction for the token already exists
442
+ * If the bid is unsuccessful, the transaction will revert.
443
+ * If the bid is successful, but outbid by another bid before the auction
444
+ * ends, the funds will be noncustodially returned to the bidder's address,
445
+ * `msg.sender`. A fallback method of sending funds back to the bidder via
446
+ * SELFDESTRUCT (SENDALL) prevents denial of service attacks, even if the
447
+ * original bidder reverts or runs out of gas during receive or fallback.
448
+ * ------------------------------------------------------------------------
449
+ * WARNING: bidders must be prepared to handle the case where their bid is
450
+ * outbid and their funds are returned to the original `msg.sender` address
451
+ * via SELFDESTRUCT (SENDALL).
452
+ * ------------------------------------------------------------------------
453
+ * Note that the use of `tokenId` is to prevent the possibility of
454
+ * transactions that are stuck in the pending pool for long periods of time
455
+ * from unintentionally bidding on auctions for future tokens.
456
+ * If a new auction is initialized during this call, the project's next
457
+ * token will be attempted to be minted to this minter contract, preparing
458
+ * it for the next auction. If the project's next token cannot be minted
459
+ * due to e.g. reaching the maximum invocations on the core contract or
460
+ * minter, the project's next token will not be minted.
461
+ * @param tokenId Token ID being bid on.
462
+ * @param coreContract Core contract address for the given project.
463
+ * @param minterTimeBufferSeconds Time buffer to extend the auction to if
464
+ * the bid is placed within the last `minterTimeBufferSeconds` of the
465
+ * auction.
466
+ * @param minterRefundGasLimit Gas limit to use when refunding the previous
467
+ * highest bidder.
468
+ * @param minterFilter Minter filter to use when minting the next token for
469
+ * the project.
470
+ * @dev nonReentrant modifier is used to prevent reentrancy attacks, e.g.
471
+ * an an auto-bidder that would be able to atomically outbid a user's
472
+ * new bid via a reentrant call to createBid.
473
+ */
474
+ function createBid(
475
+ uint256 tokenId,
476
+ address coreContract,
477
+ uint256 minterTimeBufferSeconds,
478
+ uint256 minterRefundGasLimit,
479
+ IMinterFilterV1 minterFilter
480
+ ) internal {
481
+ uint256 projectId = ABHelpers.tokenIdToProjectId(tokenId);
482
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
483
+ projectId: projectId,
484
+ coreContract: coreContract
485
+ });
486
+ Auction storage auction = SEAProjectConfig_.activeAuction;
487
+ // CHECKS
488
+ // if no auction exists, or current auction is already settled, attempt
489
+ // to initialize a new auction for the input token ID and immediately
490
+ // return
491
+ if ((!auctionIsInitialized(auction)) || auction.settled) {
492
+ _initializeAuctionWithBid({
493
+ projectId: projectId,
494
+ coreContract: coreContract,
495
+ targetTokenId: tokenId,
496
+ minterFilter: minterFilter
497
+ });
498
+ return;
499
+ }
500
+ // @dev this branch is guaranteed to have an initialized auction that
501
+ // not settled, so no need to check for initialized or not settled
502
+
503
+ // ensure bids for a specific token ID are only applied to the auction
504
+ // for that token ID.
505
+ require(auction.tokenId == tokenId, "Token ID does not match auction");
506
+
507
+ // ensure auction is not already ended
508
+ require(auction.endTime > block.timestamp, "Auction already ended");
509
+
510
+ // require bid to be sufficiently greater than current highest bid
511
+ // @dev no overflow enforced automatically by solidity ^0.8.0
512
+ require(msg.value >= getMinimumNextBid(auction), "Bid is too low");
513
+
514
+ // EFFECTS
515
+ // record previous highest bidder and bid for refunding
516
+ address payable previousBidder = auction.currentBidder;
517
+ uint256 previousBid = auction.currentBid;
518
+
519
+ // update auction bid state
520
+ auctionUpdateBid({
521
+ auction: auction,
522
+ timeBufferSeconds: minterTimeBufferSeconds,
523
+ bidAmount: msg.value,
524
+ bidder: payable(msg.sender)
525
+ });
526
+
527
+ // INTERACTIONS
528
+ // refund previous highest bidder
529
+ SplitFundsLib.forceSafeTransferETH({
530
+ to: previousBidder,
531
+ amount: previousBid,
532
+ minterRefundGasLimit: minterRefundGasLimit
533
+ });
534
+
535
+ emit AuctionBid({
536
+ tokenId: tokenId,
537
+ coreContract: coreContract,
538
+ bidder: msg.sender,
539
+ bidAmount: msg.value
540
+ });
541
+ }
542
+
543
+ /**
544
+ * @notice Internal function that attempts to mint a new token to the next
545
+ * token slot for the project `projectId`.
546
+ * This function returns early and does not modify state if
547
+ * - the project has reached its maximum invocations on either the core
548
+ * contract or minter
549
+ * - the project config's `nextTokenNumberIsPopulated` is already true
550
+ * @param projectId The ID of the project to mint a new token for.
551
+ * @param coreContract The core contract address
552
+ * @param minterFilter The minter filter contract address
553
+ * @dev this calls mint with `msg.sender` as the sender, allowing artists
554
+ * to mint tokens to the next token slot for their project while a project
555
+ * is still paused. This happens when an artist is configuring their
556
+ * project's auction parameters or minter max invocations.
557
+ */
558
+ function tryMintTokenToNextSlot(
559
+ uint256 projectId,
560
+ address coreContract,
561
+ IMinterFilterV1 minterFilter
562
+ ) internal {
563
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
564
+ projectId: projectId,
565
+ coreContract: coreContract
566
+ });
567
+ if (SEAProjectConfig_.nextTokenNumberIsPopulated) {
568
+ return;
569
+ }
570
+ // INTERACTIONS
571
+ // attempt to mint new token to this minter contract, only if max
572
+ // invocations has not been reached
573
+ // we require up-to-date invocation data to properly handle last token
574
+ // and avoid revert if relying on core to limit invocations, therefore
575
+ // use MaxInvocationsLib.invocationsRemain, which calls core contract
576
+ // to get latest invocation data
577
+ if (
578
+ !MaxInvocationsLib.invocationsRemain({
579
+ projectId: projectId,
580
+ coreContract: coreContract
581
+ })
582
+ ) {
583
+ // we have reached the max invocations, so we do not mint a new
584
+ // token as the "next token", and leave the next token number as
585
+ // not populated
586
+ return;
587
+ }
588
+ // @dev this is an effect after a trusted contract interaction
589
+ SEAProjectConfig_.nextTokenNumberIsPopulated = true;
590
+ // mint a new token to this project's "next token" slot
591
+ // @dev this is an interaction with a trusted contract
592
+ uint256 nextTokenId = minterFilter.mint_joo({
593
+ to: address(this),
594
+ projectId: projectId,
595
+ coreContract: coreContract,
596
+ sender: msg.sender
597
+ });
598
+ // update state to reflect new token number
599
+ // @dev state changes after trusted contract interaction
600
+ // @dev unchecked is safe because mod 1e6 is guaranteed to be less than
601
+ // max uint24
602
+ unchecked {
603
+ SEAProjectConfig_.nextTokenNumber = uint24(
604
+ ABHelpers.tokenIdToTokenNumber(nextTokenId)
605
+ );
606
+ }
607
+ // update local maxHasBeenInvoked value if necessary
608
+ MaxInvocationsLib.validatePurchaseEffectsInvocations({
609
+ tokenId: nextTokenId,
610
+ coreContract: coreContract
611
+ });
612
+ emit ProjectNextTokenUpdated({
613
+ projectId: projectId,
614
+ coreContract: coreContract,
615
+ tokenId: nextTokenId
616
+ });
617
+ }
618
+
619
+ /**
620
+ * @notice Determines if a project is configured or not on this minter.
621
+ * Uses project config's `auctionDurationSeconds` to determine if project
622
+ * is configured, because `auctionDurationSeconds` is required to be
623
+ * non-zero when configured.
624
+ * @param projectId The project ID being queried
625
+ * @param coreContract The core contract address being queried
626
+ */
627
+ function projectIsConfigured(
628
+ uint256 projectId,
629
+ address coreContract
630
+ ) internal view returns (bool) {
631
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
632
+ projectId: projectId,
633
+ coreContract: coreContract
634
+ });
635
+ return SEAProjectConfig_.auctionDurationSeconds != 0;
636
+ }
637
+
638
+ /**
639
+ * @notice Determines if an auction is initialized.
640
+ * Uses auction's `currentBidder` address to determine if auction is
641
+ * initialized, because `currentBidder` is always non-zero after an auction
642
+ * has been initialized.
643
+ * @param auction The auction to check.
644
+ */
645
+ function auctionIsInitialized(
646
+ Auction storage auction
647
+ ) internal view returns (bool isInitialized) {
648
+ // auction is initialized if currentBidder is non-zero
649
+ return auction.currentBidder != address(0);
650
+ }
651
+
652
+ /**
653
+ * @notice Function returns bool representing if an auction is accepting bids above base
654
+ * price. It is accepting bids if it is initialized and has not reached its
655
+ * end time.
656
+ * @param auction The auction to check.
657
+ */
658
+ function auctionIsAcceptingIncreasingBids(
659
+ Auction storage auction
660
+ ) internal view returns (bool isAcceptingBids) {
661
+ // auction is accepting bids if it is initialized and has not reached
662
+ // its end time
663
+ isAcceptingBids = (auctionIsInitialized(auction) &&
664
+ block.timestamp < auction.endTime);
665
+ }
666
+
667
+ /**
668
+ * @notice SEAProjectConfig => active auction details.
669
+ * @dev reverts if no auction exists for the project.
670
+ * @param projectId The project ID being queried
671
+ * @param coreContract The core contract address being queried
672
+ */
673
+ function projectActiveAuctionDetails(
674
+ uint256 projectId,
675
+ address coreContract
676
+ ) internal view returns (Auction memory auction) {
677
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
678
+ projectId: projectId,
679
+ coreContract: coreContract
680
+ });
681
+ // load auction storage pointer to pass ref to utility function
682
+ Auction storage auction_ = SEAProjectConfig_.activeAuction;
683
+ // do not return uninitialized auctions (i.e. auctions that do not
684
+ // exist, where currentBidder is still the default value)
685
+ require(auctionIsInitialized(auction_), "No auction exists on project");
686
+ // load entire auction into memory to return
687
+ auction = SEAProjectConfig_.activeAuction;
688
+ }
689
+
690
+ /**
691
+ * @notice Convenience function that returns either the current token ID
692
+ * being auctioned, or the next expected token ID to be auction if no
693
+ * auction is currently initialized or if the current auction has concluded
694
+ * (block.timestamp > auction.endTime).
695
+ * This is intended to be useful for frontends or scripts that intend to
696
+ * call `createBid` or `settleAuctionAndCreateBid`, which requires a
697
+ * target bid token ID to be passed in as an argument.
698
+ * The function reverts if a project does not have an active auction and
699
+ * the next expected token ID has not been populated.
700
+ * @param projectId The project ID being queried
701
+ * @param coreContract The core contract address being queried
702
+ * @return The current token ID being auctioned, or the next token ID to be
703
+ * auctioned if a new auction is ready to be created.
704
+ */
705
+ function getTokenToBid(
706
+ uint256 projectId,
707
+ address coreContract
708
+ ) internal view returns (uint256) {
709
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
710
+ projectId: projectId,
711
+ coreContract: coreContract
712
+ });
713
+ Auction storage auction = SEAProjectConfig_.activeAuction;
714
+ // if project has an active token auction that is not settled, return
715
+ // that token ID
716
+ if (
717
+ auctionIsInitialized(auction) && (auction.endTime > block.timestamp)
718
+ ) {
719
+ return auction.tokenId;
720
+ }
721
+ // otherwise, return the next expected token ID to be auctioned.
722
+ return getNextTokenId(projectId, coreContract);
723
+ }
724
+
725
+ /**
726
+ * @notice View function that returns the next token ID to be auctioned
727
+ * by this minter for project `projectId`.
728
+ * Reverts if the next token ID has not been populated for the project.
729
+ * @param projectId The project ID being queried
730
+ * @param coreContract The core contract address being queried
731
+ */
732
+ function getNextTokenId(
733
+ uint256 projectId,
734
+ address coreContract
735
+ ) internal view returns (uint256 nextTokenId) {
736
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
737
+ projectId: projectId,
738
+ coreContract: coreContract
739
+ });
740
+ require(
741
+ SEAProjectConfig_.nextTokenNumberIsPopulated,
742
+ "Next token not populated"
743
+ );
744
+
745
+ // @dev overflow automatically checked in Solidity ^0.8.0
746
+ nextTokenId =
747
+ (projectId * ONE_MILLION) +
748
+ SEAProjectConfig_.nextTokenNumber;
749
+ }
750
+
751
+ /**
752
+ * @notice Gets price info to become the leading bidder on a token auction.
753
+ * If artist has not called `configureFutureAuctions` and there is no
754
+ * active token auction accepting bids, `isConfigured` will be false, and a
755
+ * dummy price of zero is assigned to `tokenPriceInWei`.
756
+ * If there is an active auction accepting bids, `isConfigured` will be
757
+ * true, and `tokenPriceInWei` will be the sum of the current bid value and
758
+ * the minimum bid increment due to the minter's
759
+ * `minterMinBidIncrementPercentage`.
760
+ * If there is an auction that has ended (no longer accepting bids), but
761
+ * the project is configured, `isConfigured` will be true, and
762
+ * `tokenPriceInWei` will be the minimum initial bid price for the next
763
+ * token auction.
764
+ * @param projectId Project ID to get price info for
765
+ * @param coreContract Core contract address to get price info for
766
+ * @return isConfigured true only if project auctions are configured.
767
+ * @return tokenPriceInWei price in wei to become the leading bidder on a
768
+ * token auction.
769
+ */
770
+ function getPriceInfo(
771
+ uint256 projectId,
772
+ address coreContract
773
+ ) internal view returns (bool isConfigured, uint256 tokenPriceInWei) {
774
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
775
+ projectId: projectId,
776
+ coreContract: coreContract
777
+ });
778
+ Auction storage auction = SEAProjectConfig_.activeAuction;
779
+ // base price of zero not allowed when configuring auctions, so use it
780
+ // as indicator of whether auctions are configured for the project
781
+ bool projectIsConfigured_ = projectIsConfigured({
782
+ projectId: projectId,
783
+ coreContract: coreContract
784
+ });
785
+ bool auctionIsAcceptingIncreasingBids_ = auctionIsAcceptingIncreasingBids(
786
+ auction
787
+ );
788
+ isConfigured =
789
+ projectIsConfigured_ ||
790
+ auctionIsAcceptingIncreasingBids_;
791
+ // only return non-zero price if auction is configured
792
+ if (isConfigured) {
793
+ if (auctionIsAcceptingIncreasingBids_) {
794
+ // return minimum next bid, given current bid
795
+ tokenPriceInWei = getMinimumNextBid(auction);
796
+ } else {
797
+ // return base (starting) price if if current auction is not
798
+ // accepting bids (i.e. the minimum initial bid price for the
799
+ // next token auction)
800
+ tokenPriceInWei = SEAProjectConfig_.basePrice;
801
+ }
802
+ }
803
+ // else leave tokenPriceInWei as default value of zero
804
+ // @dev values of `isConfigured` and `tokenPriceInWei` are returned
805
+ }
806
+
807
+ /**
808
+ * @notice Function returns the minimum next bid amount in a configured auction, given the
809
+ * current bid amount and the project's configured minimum bid increment
810
+ * percentage.
811
+ * @param auction Auction to query
812
+ */
813
+ function getMinimumNextBid(
814
+ Auction storage auction
815
+ ) internal view returns (uint256 minimumNextBid) {
816
+ // @dev unchecked due to 0 <= minBidIncrementPercentage <= 255, and
817
+ // currentBid is capped at supply of ETH, so no risk of overflow
818
+ unchecked {
819
+ return
820
+ (auction.currentBid *
821
+ (100 + auction.minBidIncrementPercentage)) / 100;
822
+ }
823
+ }
824
+
825
+ /**
826
+ * @dev Private function to initialize an auction for the next token ID
827
+ * on project `projectId` with a bid of `msg.value` from `msg.sender`.
828
+ * This function reverts in any of the following cases:
829
+ * - project is not configured on this minter
830
+ * - project is configured but has not yet reached its start time
831
+ * - project has a current active auction that is not settled
832
+ * - insufficient bid amount (msg.value < basePrice)
833
+ * - no next token has been minted for the project (artist may need to
834
+ * call `tryPopulateNextToken`)
835
+ * - `targetTokenId` does not match the next token ID for the project
836
+ * After initializing a new auction, this function attempts to mint a new
837
+ * token and assign it to the project's next token slot, in preparation for
838
+ * a future token auction. However, if the project has reached its maximum
839
+ * invocations on either the core contract or minter, the next token slot
840
+ * for the project will remain empty.
841
+ * @dev This should be executed in a nonReentrant context to provide redundant
842
+ * protection against reentrancy.
843
+ * @param projectId The project ID to initialize an auction for
844
+ * @param coreContract The core contract address to initialize an auction for
845
+ * @param targetTokenId The token ID to initialize an auction for
846
+ * @param minterFilter The minter filter contract address
847
+ */
848
+ function _initializeAuctionWithBid(
849
+ uint256 projectId,
850
+ address coreContract,
851
+ uint256 targetTokenId,
852
+ IMinterFilterV1 minterFilter
853
+ ) private {
854
+ SEAProjectConfig storage SEAProjectConfig_ = getSEAProjectConfig({
855
+ projectId: projectId,
856
+ coreContract: coreContract
857
+ });
858
+ Auction storage auction = SEAProjectConfig_.activeAuction;
859
+ // CHECKS
860
+ // ensure project auctions are configured
861
+ // @dev base price of zero indicates auctions are not configured
862
+ // because only base price of gt zero is allowed when configuring
863
+ require(
864
+ projectIsConfigured({
865
+ projectId: projectId,
866
+ coreContract: coreContract
867
+ }),
868
+ "Project not configured"
869
+ );
870
+ // only initialize new auctions if they meet the start time
871
+ // requirement
872
+ require(
873
+ block.timestamp >= SEAProjectConfig_.timestampStart,
874
+ "Only gte project start time"
875
+ );
876
+ // the following require statement is redundant based on how this
877
+ // internal function is called, but it is included for protection
878
+ // against future changes that could easily introduce a bug if this
879
+ // check is not present
880
+ // @dev no cover else branch of next line because unreachable
881
+ require(
882
+ (!auctionIsInitialized(auction)) || auction.settled,
883
+ "Existing auction not settled"
884
+ );
885
+ // require valid bid value
886
+ require(
887
+ msg.value >= SEAProjectConfig_.basePrice,
888
+ "Insufficient initial bid"
889
+ );
890
+ // require next token number is populated
891
+ // @dev this should only be encountered if the project has reached
892
+ // its maximum invocations on either the core contract or minter
893
+ require(
894
+ SEAProjectConfig_.nextTokenNumberIsPopulated,
895
+ "No next token, check max invocations"
896
+ );
897
+ // require next token number is the target token ID
898
+ require(
899
+ SEAProjectConfig_.nextTokenNumber ==
900
+ ABHelpers.tokenIdToTokenNumber(targetTokenId),
901
+ "Incorrect target token ID"
902
+ );
903
+
904
+ // EFFECTS
905
+ // create new auction, overwriting previous auction if it exists
906
+ uint64 endTime = overwriteProjectActiveAuction({
907
+ SEAProjectConfig_: SEAProjectConfig_,
908
+ targetTokenId: targetTokenId,
909
+ bidAmount: msg.value,
910
+ bidder: payable(msg.sender)
911
+ });
912
+ // mark next token number as not populated
913
+ // @dev intentionally not setting nextTokenNumber to zero to avoid
914
+ // unnecessary gas costs
915
+ SEAProjectConfig_.nextTokenNumberIsPopulated = false;
916
+
917
+ // @dev we intentionally emit event here due to potential of early
918
+ // return in INTERACTIONS section
919
+ emit AuctionInitialized({
920
+ tokenId: targetTokenId,
921
+ coreContract: coreContract,
922
+ bidder: msg.sender,
923
+ bidAmount: msg.value,
924
+ endTime: endTime,
925
+ minBidIncrementPercentage: SEAProjectConfig_
926
+ .activeAuction
927
+ .minBidIncrementPercentage
928
+ });
929
+
930
+ // INTERACTIONS
931
+ // attempt to mint new token to this minter contract, only if max
932
+ // invocations has not been reached
933
+ tryMintTokenToNextSlot({
934
+ projectId: projectId,
935
+ coreContract: coreContract,
936
+ minterFilter: minterFilter
937
+ });
938
+ }
939
+
940
+ /**
941
+ * @notice Function to overwrite the active auction for a project with a new auction.
942
+ * @dev This function is used to initialize a new auction. Care must be
943
+ * taken to ensure that the existing auction is fully complete and settled.
944
+ * @param SEAProjectConfig_ SEAProjectConfig to update
945
+ * @param targetTokenId token ID to create the auction for
946
+ * @param bidAmount initial bid amount
947
+ * @param bidder initial bidder's payable address
948
+ * @return endTime end time of the newly created auction
949
+ */
950
+ function overwriteProjectActiveAuction(
951
+ SEAProjectConfig storage SEAProjectConfig_,
952
+ uint256 targetTokenId,
953
+ uint256 bidAmount,
954
+ address payable bidder
955
+ ) private returns (uint64 endTime) {
956
+ // calculate auction end time
957
+ endTime = (block.timestamp + SEAProjectConfig_.auctionDurationSeconds)
958
+ .toUint64();
959
+ // set active auction on SEAProjectConfig
960
+ SEAProjectConfig_.activeAuction = Auction({
961
+ tokenId: targetTokenId,
962
+ currentBid: bidAmount,
963
+ currentBidder: bidder,
964
+ endTime: endTime,
965
+ minBidIncrementPercentage: SEAProjectConfig_
966
+ .minBidIncrementPercentage,
967
+ settled: false
968
+ });
969
+ }
970
+
971
+ /**
972
+ * Loads the SEAProjectConfig for a given project and core
973
+ * contract.
974
+ * @param projectId Project Id to get config for
975
+ * @param coreContract Core contract address to get config for
976
+ */
977
+ function getSEAProjectConfig(
978
+ uint256 projectId,
979
+ address coreContract
980
+ ) internal view returns (SEAProjectConfig storage) {
981
+ return s().SEAProjectConfigs[coreContract][projectId];
982
+ }
983
+
984
+ /**
985
+ * @notice Return the storage struct for reading and writing. This library
986
+ * uses a diamond storage pattern when managing storage.
987
+ * @return storageStruct The SEALibStorage struct.
988
+ */
989
+ function s() internal pure returns (SEALibStorage storage storageStruct) {
990
+ bytes32 position = SEA_LIB_STORAGE_POSITION;
991
+ assembly ("memory-safe") {
992
+ storageStruct.slot := position
993
+ }
994
+ }
995
+ }