@artblocks/contracts 1.0.1 → 1.0.3

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 (199) hide show
  1. package/README.md +67 -154
  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 +22 -4
  5. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +42 -5
  6. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
  7. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
  8. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  9. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
  10. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
  11. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
  12. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
  13. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
  14. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
  15. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
  16. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
  17. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
  18. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
  19. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  20. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  21. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  22. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  23. package/artifacts/contracts/engine/{GenArt721CoreV2_ENGINE_FLEX.sol → V2/GenArt721CoreV2_ENGINE_FLEX.sol}/GenArt721CoreV2_ENGINE_FLEX.json +3 -3
  24. package/artifacts/contracts/engine/{GenArt721CoreV2_PBAB.sol → V2/GenArt721CoreV2_PBAB.sol}/GenArt721CoreV2_PBAB.json +3 -3
  25. package/artifacts/contracts/engine/{GenArt721CoreV2_PRTNR.sol → V2/GenArt721CoreV2_PRTNR.sol}/GenArt721CoreV2_PRTNR.json +3 -3
  26. package/artifacts/contracts/engine/{GenArt721MinterBurner_PBAB.sol → V2/GenArt721MinterBurner_PBAB.sol}/GenArt721MinterBurner_PBAB.json +3 -3
  27. package/artifacts/contracts/engine/{GenArt721MinterDAExp_PBAB.sol → V2/GenArt721MinterDAExp_PBAB.sol}/GenArt721MinterDAExp_PBAB.json +3 -3
  28. package/artifacts/contracts/engine/{GenArt721Minter_PBAB.sol → V2/GenArt721Minter_PBAB.sol}/GenArt721Minter_PBAB.json +3 -3
  29. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +1960 -0
  30. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +2247 -0
  31. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +2247 -0
  32. package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +401 -0
  33. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +2281 -0
  34. package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol/IAdminACLV0_PROHIBITION.json +359 -0
  35. package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +1094 -0
  36. package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +242 -0
  37. package/artifacts/contracts/engine-registry/EngineRegistryV0.sol/EngineRegistryV0.json +2 -2
  38. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +41 -4
  39. package/artifacts/contracts/interfaces/0.8.x/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +111 -0
  40. package/artifacts/contracts/interfaces/0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +172 -0
  41. package/artifacts/contracts/interfaces/0.8.x/IFilteredMinterSEAV0.sol/IFilteredMinterSEAV0.json +1034 -0
  42. package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractExposesHashSeed.sol/IGenArt721CoreContractExposesHashSeed.json +30 -0
  43. package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +162 -0
  44. package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +162 -0
  45. package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +137 -13
  46. package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +1060 -0
  47. package/artifacts/contracts/interfaces/0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +429 -0
  48. package/artifacts/contracts/interfaces/0.8.x/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +30 -0
  49. package/artifacts/contracts/interfaces/0.8.x/IRandomizer_V3CoreBase.sol/IRandomizer_V3CoreBase.json +24 -0
  50. package/artifacts/contracts/interfaces/0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +207 -0
  51. package/artifacts/contracts/interfaces/0.8.x/IWETH.sol/IWETH.json +55 -0
  52. package/artifacts/contracts/libs/0.8.x/{BytecodeStorage.sol → BytecodeStorageV0.sol}/BytecodeStorage.json +3 -3
  53. package/artifacts/contracts/libs/0.8.x/BytecodeStorageV1.sol/BytecodeStorageReader.json +163 -0
  54. package/artifacts/contracts/libs/0.8.x/BytecodeStorageV1.sol/BytecodeStorageWriter.json +10 -0
  55. package/artifacts/contracts/libs/0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
  56. package/artifacts/contracts/libs/0.8.x/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +2 -2
  57. package/artifacts/contracts/libs/0.8.x/SSTORE2.sol/SSTORE2.json +10 -0
  58. package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
  59. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeMock.sol/GnosisSafeMock.json +2 -2
  60. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeProxyFactoryMock.sol/GnosisSafeProxyFactoryMock.json +2 -2
  61. package/artifacts/contracts/libs/integration-refs/gnosis-safe/MultiSendMock.sol/MultiSendMock.json +2 -2
  62. package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +295 -0
  63. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  64. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +692 -0
  65. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
  66. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
  67. package/artifacts/contracts/minter-suite/Minters/MinterDALinV4.sol/MinterDALinV4.json +2 -2
  68. package/artifacts/contracts/minter-suite/Minters/MinterHolderV4.sol/MinterHolderV4.json +2 -2
  69. package/artifacts/contracts/minter-suite/Minters/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
  70. package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +104 -124
  71. package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
  72. package/artifacts/contracts/minter-suite/Minters/MinterSEAV0.sol/MinterSEAV0.json +1289 -0
  73. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
  74. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
  75. package/artifacts/contracts/mock/{BytecodeTextCR_DMock.sol/BytecodeTextCR_DMock.json → BytecodeV0TextCR_DMock.sol/BytecodeV0TextCR_DMock.json} +4 -4
  76. package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +135 -0
  77. package/artifacts/contracts/mock/BytecodeV1TextCR_DMock.sol/BytecodeV1TextCR_DMock.json +301 -0
  78. package/artifacts/contracts/mock/DeadReceiverBidderMock.sol/DeadReceiverBidderMock.json +33 -0
  79. package/artifacts/contracts/mock/DeadReceiverMock.sol/DeadReceiverMock.json +2 -2
  80. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +114 -0
  81. package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +2 -2
  82. package/artifacts/contracts/mock/GasLimitReceiverBidderMock.sol/GasLimitReceiverBidderMock.json +46 -0
  83. package/artifacts/contracts/mock/GasLimitReceiverMock.sol/GasLimitReceiverMock.json +28 -0
  84. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +22 -4
  85. package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +2 -2
  86. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +440 -0
  87. package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +39 -0
  88. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  89. package/artifacts/contracts/mock/ReentrancyHolderMock.sol/ReentrancyHolderMock.json +2 -2
  90. package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
  91. package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
  92. package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +51 -0
  93. package/artifacts/contracts/mock/SSTORE2Mock.sol/SSTORE2Mock.json +118 -0
  94. package/artifacts/contracts/{BasicRandomizer.sol → randomizer/deprecated/BasicRandomizer.sol}/BasicRandomizer.json +3 -3
  95. package/artifacts/contracts/randomizer/deprecated/BasicRandomizerBase_v0_0_0.sol/RandomizerBase.json +10 -0
  96. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +229 -0
  97. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +102 -0
  98. package/artifacts/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +30 -0
  99. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +231 -0
  100. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +2 -2
  101. package/contracts/AdminACLV0.sol +1 -1
  102. package/contracts/AdminACLV1.sol +1 -1
  103. package/contracts/DependencyRegistryV0.sol +89 -141
  104. package/contracts/GenArt721CoreV3.sol +160 -204
  105. package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol +1 -1
  106. package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol +1 -1
  107. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +1 -1
  108. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +1 -1
  109. package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol +1 -1
  110. package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol +1 -1
  111. package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol +1 -1
  112. package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol +1 -1
  113. package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol +1 -1
  114. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol +1 -1
  115. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol +1 -1
  116. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol +1 -1
  117. package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol +1 -1
  118. package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol +1 -1
  119. package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol +1 -1
  120. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol +1 -1
  121. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol +1 -1
  122. package/contracts/engine/{GenArt721CoreV2_ENGINE_FLEX.sol → V2/GenArt721CoreV2_ENGINE_FLEX.sol} +2 -2
  123. package/contracts/engine/{GenArt721CoreV2_PBAB.sol → V2/GenArt721CoreV2_PBAB.sol} +2 -2
  124. package/contracts/engine/{GenArt721CoreV2_PRTNR.sol → V2/GenArt721CoreV2_PRTNR.sol} +3 -3
  125. package/contracts/engine/{GenArt721MinterBurner_PBAB.sol → V2/GenArt721MinterBurner_PBAB.sol} +2 -2
  126. package/contracts/engine/{GenArt721MinterDAExp_PBAB.sol → V2/GenArt721MinterDAExp_PBAB.sol} +2 -2
  127. package/contracts/engine/{GenArt721Minter_PBAB.sol → V2/GenArt721Minter_PBAB.sol} +2 -2
  128. package/contracts/{GenArt721CoreV3_Engine.sol → engine/V3/GenArt721CoreV3_Engine.sol} +163 -216
  129. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +2283 -0
  130. package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +2293 -0
  131. package/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol +281 -0
  132. package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +2354 -0
  133. package/contracts/engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol +123 -0
  134. package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +29 -0
  135. package/contracts/engine-registry/CoreRegistryV1.sol +254 -0
  136. package/contracts/engine-registry/EngineRegistryV0.sol +1 -1
  137. package/contracts/explorations/GenArt721CoreV3_Explorations.sol +164 -190
  138. package/contracts/interfaces/0.8.x/IBytecodeStorageReader.sol +62 -0
  139. package/contracts/interfaces/0.8.x/ICoreRegistryV1.sol +27 -0
  140. package/contracts/interfaces/0.8.x/IDelegationRegistry.sol +1 -1
  141. package/contracts/interfaces/0.8.x/IDependencyRegistryCompatibleV0.sol +1 -1
  142. package/contracts/interfaces/0.8.x/IDependencyRegistryV0.sol +1 -1
  143. package/contracts/interfaces/0.8.x/IEngineRegistryV0.sol +1 -1
  144. package/contracts/interfaces/0.8.x/IFilteredMinterSEAV0.sol +164 -0
  145. package/contracts/interfaces/0.8.x/IGenArt721CoreContractExposesHashSeed.sol +11 -0
  146. package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol +42 -0
  147. package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine.sol +0 -8
  148. package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol +132 -0
  149. package/contracts/interfaces/0.8.x/IMinterFilterV1.sol +158 -0
  150. package/contracts/interfaces/0.8.x/IPseudorandomAtomic.sol +16 -0
  151. package/contracts/interfaces/0.8.x/IRandomizerPolyptychV0.sol +1 -1
  152. package/contracts/interfaces/0.8.x/IRandomizerV2.sol +2 -5
  153. package/contracts/interfaces/0.8.x/IRandomizer_V3CoreBase.sol +10 -0
  154. package/contracts/interfaces/0.8.x/ISharedRandomizerV0.sol +105 -0
  155. package/contracts/interfaces/0.8.x/IWETH.sol +11 -0
  156. package/contracts/libs/0.8.x/BytecodeStorageV1.sol +399 -0
  157. package/contracts/libs/0.8.x/SSTORE2.sol +109 -0
  158. package/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol +1 -1
  159. package/contracts/libs/integration-refs/weth9/weth9.sol +765 -0
  160. package/contracts/minter-suite/MinterFilter/MinterFilterV1.sol +36 -48
  161. package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +756 -0
  162. package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +27 -35
  163. package/contracts/minter-suite/Minters/MinterDAExpV4.sol +17 -22
  164. package/contracts/minter-suite/Minters/MinterDALinV4.sol +16 -18
  165. package/contracts/minter-suite/Minters/MinterHolderV4.sol +20 -20
  166. package/contracts/minter-suite/Minters/MinterMerkleV5.sol +14 -16
  167. package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +37 -36
  168. package/contracts/minter-suite/Minters/MinterSEAV0.sol +1273 -0
  169. package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +12 -12
  170. package/contracts/minter-suite/Minters/MinterSetPriceV4.sol +10 -11
  171. package/contracts/mock/{BytecodeTextCR_DMock.sol → BytecodeV0TextCR_DMock.sol} +5 -5
  172. package/contracts/mock/BytecodeV1LibCallsMock.sol +114 -0
  173. package/contracts/mock/BytecodeV1TextCR_DMock.sol +233 -0
  174. package/contracts/mock/DeadReceiverBidderMock.sol +23 -0
  175. package/contracts/mock/DeadReceiverMock.sol +1 -1
  176. package/contracts/mock/DummySharedMinter.sol +75 -0
  177. package/contracts/mock/GasLimitReceiverBidderMock.sol +23 -0
  178. package/contracts/mock/GasLimitReceiverMock.sol +19 -0
  179. package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +14 -27
  180. package/contracts/mock/MockAdminACLV0.sol +1 -1
  181. package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +207 -0
  182. package/contracts/mock/OriginRegisterMock.sol +27 -0
  183. package/contracts/mock/RandomizerV2_NoAssignMock.sol +3 -12
  184. package/contracts/mock/ReentrancySEAMock.sol +36 -0
  185. package/contracts/mock/SSTORE2Mock.sol +93 -0
  186. package/contracts/{BasicRandomizer.sol → randomizer/deprecated/BasicRandomizer.sol} +1 -1
  187. package/contracts/randomizer/deprecated/BasicRandomizerBase_v0_0_0.sol +23 -0
  188. package/contracts/{BasicPolyptychRandomizerV0.sol → randomizer/deprecated/PolyptychRandomizerV0.sol} +20 -29
  189. package/contracts/{BasicRandomizerV2.sol → randomizer/deprecated/RandomizerV2.sol} +6 -14
  190. package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +30 -0
  191. package/contracts/randomizer/shared/SharedRandomizerV0.sol +245 -0
  192. package/package.json +36 -30
  193. package/.env.example +0 -10
  194. package/artifacts/contracts/BasicPolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +0 -229
  195. package/artifacts/contracts/BasicRandomizerV2.sol/BasicRandomizerV2.json +0 -102
  196. package/artifacts/contracts/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +0 -1942
  197. package/artifacts/contracts/engine-registry/future/EngineRegistryV1.sol/EngineRegistryV1.json +0 -109
  198. package/contracts/engine-registry/future/EngineRegistryV1.sol +0 -86
  199. /package/contracts/libs/0.8.x/{BytecodeStorage.sol → BytecodeStorageV0.sol} +0 -0
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
- pragma solidity 0.8.17;
2
+ pragma solidity 0.8.19;
3
3
 
4
4
  // Created By: Art Blocks Inc.
5
5
 
@@ -13,7 +13,7 @@ import "../interfaces/0.8.x/IManifold.sol";
13
13
  import "@openzeppelin-4.7/contracts/utils/Strings.sol";
14
14
  import "@openzeppelin-4.7/contracts/access/Ownable.sol";
15
15
  import "../libs/0.8.x/ERC721_PackedHashSeed.sol";
16
- import "../libs/0.8.x/BytecodeStorage.sol";
16
+ import "../libs/0.8.x/BytecodeStorageV1.sol";
17
17
  import "../libs/0.8.x/Bytes32Strings.sol";
18
18
 
19
19
  /**
@@ -30,8 +30,7 @@ contract GenArt721CoreV3_Engine_IncorrectCoreType is
30
30
  IManifold
31
31
  // INTERFACE CONFORMANCE INTENTIONALLY OMITTED TO ENABLE MOCKING BUGGED CONTRACT
32
32
  {
33
- using BytecodeStorage for string;
34
- using BytecodeStorage for address;
33
+ using BytecodeStorageWriter for string;
35
34
  using Bytes32Strings for bytes32;
36
35
  using Strings for uint256;
37
36
  using Strings for address;
@@ -1115,16 +1114,6 @@ contract GenArt721CoreV3_Engine_IncorrectCoreType is
1115
1114
  {
1116
1115
  Project storage project = projects[_projectId];
1117
1116
  require(_scriptId < project.scriptCount, "scriptId out of range");
1118
- // purge old contract bytecode contract from the blockchain state
1119
- // note: Although this does reduce usage of Ethereum state, it does not
1120
- // reduce the gas costs of removal transactions. We believe this is the
1121
- // best behavior at the time of writing, and do not expect this to
1122
- // result in any breaking changes in the future. All current proposals
1123
- // to change the self-destruct opcode are backwards compatible, but may
1124
- // result in not removing the bytecode from the blockchain state. This
1125
- // implementation is compatible with that architecture, as it does not
1126
- // rely on the bytecode being removed from the blockchain state.
1127
- project.scriptBytecodeAddresses[_scriptId].purgeBytecode();
1128
1117
  // store script in contract bytecode, replacing reference address from
1129
1118
  // the contract that no longer exists with the newly created one
1130
1119
  project.scriptBytecodeAddresses[_scriptId] = _script.writeToBytecode();
@@ -1144,18 +1133,6 @@ contract GenArt721CoreV3_Engine_IncorrectCoreType is
1144
1133
  {
1145
1134
  Project storage project = projects[_projectId];
1146
1135
  require(project.scriptCount > 0, "there are no scripts to remove");
1147
- // purge old contract bytecode contract from the blockchain state
1148
- // note: Although this does reduce usage of Ethereum state, it does not
1149
- // reduce the gas costs of removal transactions. We believe this is the
1150
- // best behavior at the time of writing, and do not expect this to
1151
- // result in any breaking changes in the future. All current proposals
1152
- // to change the self-destruct opcode are backwards compatible, but may
1153
- // result in not removing the bytecode from the blockchain state. This
1154
- // implementation is compatible with that architecture, as it does not
1155
- // rely on the bytecode being removed from the blockchain state.
1156
- project
1157
- .scriptBytecodeAddresses[project.scriptCount - 1]
1158
- .purgeBytecode();
1159
1136
  // delete reference to contract address that no longer exists
1160
1137
  delete project.scriptBytecodeAddresses[project.scriptCount - 1];
1161
1138
  unchecked {
@@ -1580,7 +1557,7 @@ contract GenArt721CoreV3_Engine_IncorrectCoreType is
1580
1557
  if (_index >= project.scriptCount) {
1581
1558
  return "";
1582
1559
  }
1583
- return project.scriptBytecodeAddresses[_index].readFromBytecode();
1560
+ return _readFromBytecode(project.scriptBytecodeAddresses[_index]);
1584
1561
  }
1585
1562
 
1586
1563
  /**
@@ -1976,4 +1953,14 @@ contract GenArt721CoreV3_Engine_IncorrectCoreType is
1976
1953
  (block.timestamp - projectCompletedTimestamp <
1977
1954
  FOUR_WEEKS_IN_SECONDS);
1978
1955
  }
1956
+
1957
+ /**
1958
+ * Helper for calling `BytecodeStorageReader` external library reader method,
1959
+ * added for bytecode size reduction purposes.
1960
+ */
1961
+ function _readFromBytecode(
1962
+ address _address
1963
+ ) internal view returns (string memory) {
1964
+ return BytecodeStorageReader.readFromBytecode(_address);
1965
+ }
1979
1966
  }
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
 
3
- pragma solidity 0.8.17;
3
+ pragma solidity 0.8.19;
4
4
 
5
5
  import "../interfaces/0.8.x/IAdminACLV0.sol";
6
6
  import "@openzeppelin-4.7/contracts/access/Ownable.sol";
@@ -0,0 +1,207 @@
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity ^0.8.19;
4
+
5
+ import "../engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol";
6
+ import "../interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
7
+ import "@openzeppelin-4.7/contracts/access/Ownable.sol";
8
+ import "@openzeppelin-4.7/contracts/utils/introspection/ERC165.sol";
9
+
10
+ /**
11
+ * @dev Mock contract for testing purposes.
12
+ * This contract has a single superAdmin that passes all ACL checks. All checks
13
+ * for any other address will return false.
14
+ * It also emits an event for all ACL checks, enabling our test suite to verify
15
+ * that the ACL was checked with the correct parameters.
16
+ * @dev this contract specifically does not broadcast conformance to IAdminACLV0
17
+ * for testing purposes.
18
+ */
19
+ contract MockAdminACLV0Events_PROHIBITION is IAdminACLV0_PROHIBITION, ERC165 {
20
+ // event used for testing purposes to diagnose what core contract is asking
21
+ // approval for.
22
+ event ACLCheck(address indexed sender, bytes4 indexed selector);
23
+
24
+ string public AdminACLType = "MockAdminACLV0Events_PROHIBITION";
25
+
26
+ // superAdmin is the only address that passes any and all ACL checks
27
+ address public superAdmin;
28
+
29
+ /// approvedCallers is a mapping of keccak256(contracts, selectors, account) -> approved to call.
30
+ /// It is used to determine if an account is approved to call a function on specific contracts.
31
+ mapping(bytes32 => bool) public contractSelectorApprovals;
32
+ /// contractArtistApprovals is a mapping of:
33
+ /// keccak256(contracts, artist) -> approved to call.
34
+ /// It is used to determine if an account is approved to call a functions for specific projects.
35
+ mapping(bytes32 => bool) public contractArtistApprovals;
36
+
37
+ constructor() {
38
+ superAdmin = msg.sender;
39
+ }
40
+
41
+ /**
42
+ * @dev Retrieve the address of the caller that is allowed to call a contract's function
43
+ */
44
+ function getContractSelectorApproval(
45
+ address _contract,
46
+ bytes4 _selector,
47
+ address _caller
48
+ ) external view returns (bool) {
49
+ return
50
+ contractSelectorApprovals[
51
+ hashSelectorApprovalKey(_contract, _selector, _caller)
52
+ ];
53
+ }
54
+
55
+ /**
56
+ * @dev Retrieve whether of the caller is allowed to call a functions for a project
57
+ */
58
+ function getContractArtistApproval(
59
+ address _contract,
60
+ address _caller
61
+ ) external view returns (bool) {
62
+ return
63
+ contractArtistApprovals[hashArtistApprovalKey(_contract, _caller)];
64
+ }
65
+
66
+ /**
67
+ * @dev Allows superAdmin to set a contract function caller.
68
+ */
69
+ function toggleContractSelectorApproval(
70
+ address _contract,
71
+ bytes4 _selector,
72
+ address _caller
73
+ ) external {
74
+ require(
75
+ allowed(
76
+ msg.sender,
77
+ address(this),
78
+ this.toggleContractSelectorApproval.selector
79
+ ),
80
+ "Only superAdmin or allowed caller"
81
+ );
82
+
83
+ bytes32 approvalHash = hashSelectorApprovalKey(
84
+ _contract,
85
+ _selector,
86
+ _caller
87
+ );
88
+ contractSelectorApprovals[approvalHash] = !contractSelectorApprovals[
89
+ approvalHash
90
+ ];
91
+ emit ContractSelectorApprovalUpdated(
92
+ _contract,
93
+ _selector,
94
+ _caller,
95
+ contractSelectorApprovals[approvalHash]
96
+ );
97
+ }
98
+
99
+ /**
100
+ * @dev Toggles verification for artists to call functions relating to their projects on a contract
101
+ */
102
+ function toggleContractArtistApproval(
103
+ address _contract,
104
+ address _artist
105
+ ) external {
106
+ require(
107
+ allowed(
108
+ msg.sender,
109
+ address(this),
110
+ this.toggleContractArtistApproval.selector
111
+ ),
112
+ "Only allowed caller"
113
+ );
114
+
115
+ bytes32 approvalHash = hashArtistApprovalKey(_contract, _artist);
116
+ contractSelectorApprovals[approvalHash] = !contractSelectorApprovals[
117
+ approvalHash
118
+ ];
119
+ emit ContractArtistApprovalUpdated(
120
+ _contract,
121
+ _artist,
122
+ contractArtistApprovals[approvalHash]
123
+ );
124
+ }
125
+
126
+ /**
127
+ * @dev Checks if sender `_sender` is allowed to call function with selector
128
+ * `_selector` on contract `_contract`. Returns true if sender is superAdmin.
129
+ * Also emits event for testing purposes.
130
+ */
131
+ function allowed(
132
+ address _sender,
133
+ address _contract,
134
+ bytes4 _selector
135
+ ) public returns (bool) {
136
+ emit ACLCheck(_sender, _selector);
137
+ return
138
+ superAdmin == _sender ||
139
+ contractSelectorApprovals[
140
+ hashSelectorApprovalKey(_contract, _selector, _sender)
141
+ ];
142
+ }
143
+
144
+ /**
145
+ * @dev Checks if sender `_sender` is allowed to call function (or functions for projects) with
146
+ * method `_selector` on `_contract`. Returns true if sender is superAdmin.
147
+ * @dev this function is public insteaad of internal so that the right to toggle approvals can also be delegated
148
+ */
149
+ function allowed(
150
+ address _sender,
151
+ address _contract,
152
+ bytes4 _selector,
153
+ uint256 _projectId
154
+ ) external returns (bool) {
155
+ emit ACLCheck(_sender, _selector);
156
+ IGenArt721CoreContractV3_Base coreV3 = IGenArt721CoreContractV3_Base(
157
+ _contract
158
+ );
159
+ return
160
+ allowed(_sender, _contract, _selector) ||
161
+ (contractArtistApprovals[
162
+ hashArtistApprovalKey(_contract, _sender)
163
+ ] && coreV3.projectIdToArtistAddress(_projectId) == _sender);
164
+ }
165
+
166
+ /**
167
+ * @dev Hash the contract address, selector, and caller address.
168
+ */
169
+ function hashSelectorApprovalKey(
170
+ address _contract,
171
+ bytes4 _selector,
172
+ address _caller
173
+ ) public pure returns (bytes32) {
174
+ return keccak256(abi.encodePacked(_contract, _selector, _caller));
175
+ }
176
+
177
+ /**
178
+ * @dev Hash the contract address and artist address.
179
+ */
180
+ function hashArtistApprovalKey(
181
+ address _contract,
182
+ address _artist
183
+ ) public pure returns (bytes32) {
184
+ return keccak256(abi.encodePacked(_contract, _artist));
185
+ }
186
+
187
+ /**
188
+ * @dev Allows superAdmin to call transferOwnership on other contract from
189
+ * this contract.
190
+ */
191
+ function transferOwnershipOn(
192
+ address _contract,
193
+ address _newAdminACL
194
+ ) external {
195
+ require(msg.sender == superAdmin, "Only superAdmin");
196
+ Ownable(_contract).transferOwnership(_newAdminACL);
197
+ }
198
+
199
+ /**
200
+ * @dev Allows superAdmin to call renounceOwnership on other contract from
201
+ * this contract.
202
+ */
203
+ function renounceOwnershipOn(address _contract) external {
204
+ require(msg.sender == superAdmin, "Only superAdmin");
205
+ Ownable(_contract).renounceOwnership();
206
+ }
207
+ }
@@ -0,0 +1,27 @@
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity 0.8.19;
4
+
5
+ import {ICoreRegistryV1} from "../interfaces/0.8.x/ICoreRegistryV1.sol";
6
+
7
+ /**
8
+ * @dev Mock contract for testing purposes.
9
+ * This contract hijacks a tx with origin of a core registry's owner, and
10
+ * attempts to register a contract with the registry.
11
+ * Note that mock could forward on additional requests to contracts that only
12
+ * register "themselves", and could be successfully registered.
13
+ */
14
+ contract OriginRegisterMock {
15
+ function registerOther(
16
+ address _registry,
17
+ address _contract,
18
+ bytes32 _coreVersion,
19
+ bytes32 _coreType
20
+ ) external {
21
+ ICoreRegistryV1(_registry).registerContract(
22
+ _contract,
23
+ _coreVersion,
24
+ _coreType
25
+ );
26
+ }
27
+ }
@@ -1,9 +1,9 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Creatd By: Art Blocks Inc.
3
3
 
4
- pragma solidity 0.8.17;
4
+ pragma solidity 0.8.19;
5
5
 
6
- import "../BasicRandomizerV2.sol";
6
+ import "../randomizer/deprecated/RandomizerV2.sol";
7
7
 
8
8
  /// @title RandomizerV2_NoAssignMock
9
9
  /// @notice WARNING - This is a mock contract. Do not use it in production.
@@ -20,16 +20,7 @@ contract RandomizerV2_NoAssignMock is BasicRandomizerV2 {
20
20
  // on the core contract. Used for test purposes only.
21
21
  // @dev WARNING - THIS IS NOT SECURE AND SHOULD NOT BE USED IN PRODUCTION.
22
22
  function actuallyAssignTokenHash(uint256 _tokenId) external {
23
- uint256 time = block.timestamp;
24
- bytes32 hash = keccak256(
25
- abi.encodePacked(
26
- _tokenId,
27
- block.number,
28
- blockhash(block.number - 1),
29
- time,
30
- (time % 200) + 1
31
- )
32
- );
23
+ bytes32 hash = _getPseudorandom(_tokenId);
33
24
  genArt721Core.setTokenHash_8PT(_tokenId, hash);
34
25
  }
35
26
 
@@ -0,0 +1,36 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ import "../interfaces/0.8.x/IFilteredMinterSEAV0.sol";
5
+
6
+ pragma solidity ^0.8.0;
7
+
8
+ contract ReentrancySEAAutoBidderMock {
9
+ uint256 public targetTokenId;
10
+
11
+ /**
12
+ @notice This function can be called to induce controlled reentrency attacks
13
+ on AB minter filter suite.
14
+ Note that _priceToPay should be > project price per token to induce refund,
15
+ making reentrency possible via fallback function.
16
+ */
17
+ function attack(
18
+ uint256 _targetTokenId,
19
+ address _minterContractAddress,
20
+ uint256 _initialBidValue
21
+ ) external payable {
22
+ targetTokenId = _targetTokenId;
23
+ IFilteredMinterSEAV0(_minterContractAddress).createBid{
24
+ value: _initialBidValue
25
+ }(_targetTokenId);
26
+ }
27
+
28
+ // receiver is called when minter sends refunded Ether to this contract, when outbid
29
+ receive() external payable {
30
+ // auto-rebid
31
+ uint256 newBidValue = (msg.value * 110) / 100;
32
+ IFilteredMinterSEAV0(msg.sender).createBid{value: newBidValue}(
33
+ targetTokenId
34
+ );
35
+ }
36
+ }
@@ -0,0 +1,93 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ pragma solidity 0.8.19;
3
+
4
+ // Created By: Art Blocks Inc.
5
+
6
+ import "../libs/0.8.x/SSTORE2.sol";
7
+
8
+ /**
9
+ * @title Art Blocks SSTORE2Mock.
10
+ * @author Art Blocks Inc.
11
+ * @notice This contract serves as a mock client of the SSTORE2 library
12
+ * to allow for more testing of this library in the context of
13
+ * backwards-compatible reads with the Art Blocks BytecodeStorage library
14
+ * @dev For the purposes of our backwards-compatibility testing, the two different
15
+ * variations of the SSTORE2 library are functionally equivalent, so we just test
16
+ * against the one that is more widely tracked on Github for simplicity, but the
17
+ * same tests could be run against the other variation of the library as well
18
+ * and would be expected to "just work" given both use the same data offset of
19
+ * a single 0x00 "stop byte".
20
+ */
21
+ contract SSTORE2Mock {
22
+ using SSTORE2 for bytes;
23
+ using SSTORE2 for address;
24
+
25
+ // monotonically increasing slot counter and associated slot-storage mapping
26
+ uint256 public nextTextSlotId = 0;
27
+ mapping(uint256 => address) public storedTextBytecodeAddresses;
28
+
29
+ // save deployer address to support basic ACL checks for non-read operations
30
+ address public deployerAddress;
31
+
32
+ modifier onlyDeployer() {
33
+ require(msg.sender == deployerAddress, "Only deployer");
34
+ _;
35
+ }
36
+
37
+ /**
38
+ * @notice Initializes contract.
39
+ */
40
+ constructor() {
41
+ deployerAddress = msg.sender;
42
+ }
43
+
44
+ /*//////////////////////////////////////////////////////////////
45
+ Create + Read
46
+ //////////////////////////////////////////////////////////////*/
47
+
48
+ /**
49
+ * @notice "Create": Adds a chunk of text to be stored to chain-state.
50
+ * @param _text Text to be created in chain-state.
51
+ * @return uint256 Slot that the written bytecode contract address was
52
+ * stored in.
53
+ * @dev Intentionally do not perform input validation, instead allowing
54
+ * the underlying BytecodeStorage lib to throw errors where applicable.
55
+ */
56
+ function createText(
57
+ string memory _text
58
+ ) external onlyDeployer returns (uint256) {
59
+ // store text in contract bytecode
60
+ storedTextBytecodeAddresses[nextTextSlotId] = bytes(_text).write();
61
+ // record written slot before incrementing
62
+ uint256 textSlotId = nextTextSlotId;
63
+ nextTextSlotId++;
64
+ return textSlotId;
65
+ }
66
+
67
+ /**
68
+ * @notice "Read": Reads chunk of text currently in the provided slot, from
69
+ * chain-state.
70
+ * @param _textSlotId Slot (associated with this contract) for which to
71
+ * read text content.
72
+ * @return string Content read from contract bytecode in the given slot.
73
+ * @dev Intentionally do not perform input validation, instead allowing
74
+ * the underlying BytecodeStorage lib to throw errors where applicable.
75
+ */
76
+ function readText(uint256 _textSlotId) public view returns (string memory) {
77
+ return string(storedTextBytecodeAddresses[_textSlotId].read());
78
+ }
79
+
80
+ /**
81
+ * @notice Allows additional read introspection, to read a chunk of text,
82
+ * from chain-state that lives at a given deployed address.
83
+ * @param _bytecodeAddress address from which to read text content.
84
+ * @return string Content read from contract bytecode at the given address.
85
+ * @dev Intentionally do not perform input validation, instead allowing
86
+ * the underlying BytecodeStorage lib to throw errors where applicable.
87
+ */
88
+ function readTextAtAddress(
89
+ address _bytecodeAddress
90
+ ) public view returns (string memory) {
91
+ return string(_bytecodeAddress.read());
92
+ }
93
+ }
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Creatd By: Art Blocks Inc.
3
3
 
4
- import "./interfaces/0.8.x/IRandomizer.sol";
4
+ import "../../interfaces/0.8.x/IRandomizer.sol";
5
5
 
6
6
  pragma solidity 0.8.9;
7
7
 
@@ -0,0 +1,23 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Creatd By: Art Blocks Inc.
3
+
4
+ pragma solidity 0.8.19;
5
+
6
+ abstract contract RandomizerBase {
7
+ // base class that returns
8
+ function _getPseudorandom(
9
+ uint256 _tokenId
10
+ ) internal virtual returns (bytes32) {
11
+ uint256 time = block.timestamp;
12
+ return
13
+ keccak256(
14
+ abi.encodePacked(
15
+ _tokenId,
16
+ block.number,
17
+ blockhash(block.number - 1),
18
+ time,
19
+ (time % 200) + 1
20
+ )
21
+ );
22
+ }
23
+ }
@@ -1,10 +1,11 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Creatd By: Art Blocks Inc.
3
3
 
4
- pragma solidity 0.8.17;
4
+ pragma solidity 0.8.19;
5
5
 
6
- import "./interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
7
- import "./interfaces/0.8.x/IRandomizerPolyptychV0.sol";
6
+ import "../../interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
7
+ import "../../interfaces/0.8.x/IRandomizerPolyptychV0.sol";
8
+ import "./BasicRandomizerBase_v0_0_0.sol";
8
9
 
9
10
  import "@openzeppelin-4.7/contracts/access/Ownable.sol";
10
11
 
@@ -23,7 +24,11 @@ import "@openzeppelin-4.7/contracts/access/Ownable.sol";
23
24
  * Once the contract is configured, it will enable newly-minted tokens to use a copy of the hash
24
25
  * seed from a previously-minted token.
25
26
  */
26
- contract BasicPolyptychRandomizerV0 is IRandomizerPolyptychV0, Ownable {
27
+ contract BasicPolyptychRandomizerV0 is
28
+ IRandomizerPolyptychV0,
29
+ RandomizerBase,
30
+ Ownable
31
+ {
27
32
  // The core contract that may interact with this randomizer contract.
28
33
  IGenArt721CoreContractV3_Base public genArt721Core;
29
34
 
@@ -46,26 +51,23 @@ contract BasicPolyptychRandomizerV0 is IRandomizerPolyptychV0, Ownable {
46
51
 
47
52
  // modifier to restrict access to only AdminACL allowed calls
48
53
  // @dev defers which ACL contract is used to the core contract
49
- modifier onlyCoreAdminACL(bytes4 _selector) {
54
+ function _onlyCoreAdminACL(bytes4 _selector) internal {
50
55
  require(
51
56
  genArt721Core.adminACLAllowed(msg.sender, address(this), _selector),
52
57
  "Only Core AdminACL allowed"
53
58
  );
54
- _;
55
59
  }
56
60
 
57
- modifier onlyArtist(uint256 _projectId) {
61
+ function _onlyArtist(uint256 _projectId) internal view {
58
62
  require(
59
63
  msg.sender == genArt721Core.projectIdToArtistAddress(_projectId),
60
64
  "Only Artist"
61
65
  );
62
- _;
63
66
  }
64
67
 
65
68
  // Allows the owner of the core contract to set the minter that is allowed to assign hash seeds
66
- function setHashSeedSetterContract(
67
- address _contractAddress
68
- ) external onlyCoreAdminACL(this.setHashSeedSetterContract.selector) {
69
+ function setHashSeedSetterContract(address _contractAddress) external {
70
+ _onlyCoreAdminACL(this.setHashSeedSetterContract.selector);
69
71
  hashSeedSetterContract = _contractAddress;
70
72
  emit HashSeedSetterUpdated(_contractAddress);
71
73
  }
@@ -74,9 +76,8 @@ contract BasicPolyptychRandomizerV0 is IRandomizerPolyptychV0, Ownable {
74
76
  * @notice Allows the owner of the core contract to configure a project as a polyptych
75
77
  * @param _projectId - The ID of the project that has a polyptych panel (second, third, etc.)
76
78
  */
77
- function toggleProjectIsPolyptych(
78
- uint256 _projectId
79
- ) external onlyArtist(_projectId) {
79
+ function toggleProjectIsPolyptych(uint256 _projectId) external {
80
+ _onlyArtist(_projectId);
80
81
  projectIsPolyptych[_projectId] = !projectIsPolyptych[_projectId];
81
82
  emit ProjectIsPolyptychUpdated(
82
83
  _projectId,
@@ -104,23 +105,13 @@ contract BasicPolyptychRandomizerV0 is IRandomizerPolyptychV0, Ownable {
104
105
  // will set a bytes32 hash for tokenId `_tokenId` on the core contract.
105
106
  function assignTokenHash(uint256 _tokenId) external virtual {
106
107
  require(msg.sender == address(genArt721Core), "Only core may call");
107
-
108
+ bytes32 hash;
108
109
  if (projectIsPolyptych[_tokenId / ONE_MILLION]) {
109
- bytes12 seededHash = polyptychHashSeeds[_tokenId];
110
- require(seededHash != 0, "Only non-zero hash seed");
111
- genArt721Core.setTokenHash_8PT(_tokenId, seededHash);
110
+ hash = polyptychHashSeeds[_tokenId];
112
111
  } else {
113
- uint256 time = block.timestamp;
114
- bytes32 hash = keccak256(
115
- abi.encodePacked(
116
- _tokenId,
117
- block.number,
118
- blockhash(block.number - 1),
119
- time,
120
- (time % 200) + 1
121
- )
122
- );
123
- genArt721Core.setTokenHash_8PT(_tokenId, hash);
112
+ hash = _getPseudorandom(_tokenId);
124
113
  }
114
+ require(hash != 0, "Only non-zero hash seed");
115
+ genArt721Core.setTokenHash_8PT(_tokenId, hash);
125
116
  }
126
117
  }
@@ -1,14 +1,15 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Creatd By: Art Blocks Inc.
3
3
 
4
- pragma solidity 0.8.17;
4
+ pragma solidity 0.8.19;
5
5
 
6
- import "./interfaces/0.8.x/IRandomizerV2.sol";
7
- import "./interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
6
+ import "../../interfaces/0.8.x/IRandomizerV2.sol";
7
+ import "../../interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
8
+ import "./BasicRandomizerBase_v0_0_0.sol";
8
9
 
9
10
  import "@openzeppelin-4.7/contracts/access/Ownable.sol";
10
11
 
11
- contract BasicRandomizerV2 is IRandomizerV2, Ownable {
12
+ contract BasicRandomizerV2 is IRandomizerV2, RandomizerBase, Ownable {
12
13
  // The core contract that may interact with this randomizer contract.
13
14
  IGenArt721CoreContractV3_Base public genArt721Core;
14
15
 
@@ -21,16 +22,7 @@ contract BasicRandomizerV2 is IRandomizerV2, Ownable {
21
22
  // will set a bytes32 hash for tokenId `_tokenId` on the core contract.
22
23
  function assignTokenHash(uint256 _tokenId) external virtual {
23
24
  require(msg.sender == address(genArt721Core), "Only core may call");
24
- uint256 time = block.timestamp;
25
- bytes32 hash = keccak256(
26
- abi.encodePacked(
27
- _tokenId,
28
- block.number,
29
- blockhash(block.number - 1),
30
- time,
31
- (time % 200) + 1
32
- )
33
- );
25
+ bytes32 hash = _getPseudorandom(_tokenId);
34
26
  genArt721Core.setTokenHash_8PT(_tokenId, hash);
35
27
  }
36
28
  }