@artblocks/contracts 1.2.0 → 1.3.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 (219) hide show
  1. package/README.md +22 -38
  2. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  3. package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol/BytecodeStorageReaderContractV2.json +201 -0
  4. package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol/BytecodeStorageReaderContractV2_Web3Call.json +201 -0
  5. package/artifacts/contracts/BytecodeStorageReaders/UniversalBytecodeStorageReader.sol/UniversalBytecodeStorageReader.json +154 -0
  6. package/artifacts/contracts/BytecodeStorageV2Writer.sol/BytecodeStorageV2Writer.json +87 -0
  7. package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +174 -55
  8. package/artifacts/contracts/GenArt721CoreV3_Curated.sol/GenArt721CoreV3_Curated.json +2493 -0
  9. package/artifacts/contracts/OwnedCreate2FactoryV0.sol/OwnedCreate2FactoryV0.json +311 -0
  10. package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +15 -2
  11. package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +15 -2
  12. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
  13. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
  14. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
  15. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  16. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
  17. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
  18. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
  19. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
  20. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV4.sol/MinterDALinV4.json +2 -2
  21. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
  22. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
  23. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
  24. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV4.sol/MinterHolderV4.json +2 -2
  25. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
  26. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
  27. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
  28. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
  29. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
  30. package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +37 -0
  31. package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
  32. package/artifacts/contracts/archive/minter-suite/Minters/MinterSEA/MinterSEAV0.sol/MinterSEAV0.json +2 -2
  33. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  34. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  35. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
  36. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  37. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  38. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
  39. package/artifacts/contracts/engine/V3/EngineFactoryV0.sol/EngineFactoryV0.json +20 -2
  40. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +48 -12
  41. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +76 -40
  42. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +15 -2
  43. package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +2 -2
  44. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +15 -2
  45. package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +37 -0
  46. package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +2 -2
  47. package/artifacts/contracts/generator/AddressChunks.sol/AddressChunks.json +10 -0
  48. package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/GenArt721GeneratorV0.json +333 -0
  49. package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/ILegacyGenArt721CoreV2_PBAB_Flex.json +47 -0
  50. package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +7 -7
  51. package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol/IBytecodeStorageReaderV2.json +7 -7
  52. package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReader_Base.sol/IBytecodeStorageReader_Base.json +30 -0
  53. package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +13 -0
  54. package/artifacts/contracts/interfaces/v0.8.x/IDelegateRegistry.sol/IDelegateRegistry.json +820 -0
  55. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +183 -0
  56. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +37 -0
  57. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +37 -0
  58. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +42 -0
  59. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +42 -0
  60. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +37 -0
  61. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +37 -0
  62. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV0.sol/IGenArt721CoreProjectScriptV0.json +59 -0
  63. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV1.sol/IGenArt721CoreProjectScriptV1.json +64 -0
  64. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV0.sol/IGenArt721CoreTokenHashProviderV0.json +30 -0
  65. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV1.sol/IGenArt721CoreTokenHashProviderV1.json +30 -0
  66. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721GeneratorV0.sol/IGenArt721GeneratorV0.json +63 -0
  67. package/artifacts/contracts/interfaces/v0.8.x/IOwnedCreate2FactoryV0.sol/IOwnedCreate2FactoryV0.json +74 -0
  68. package/artifacts/contracts/interfaces/v0.8.x/IPMPAugmentHook.sol/IPMPAugmentHook.json +83 -0
  69. package/artifacts/contracts/interfaces/v0.8.x/IPMPConfigureHook.sol/IPMPConfigureHook.json +80 -0
  70. package/artifacts/contracts/interfaces/v0.8.x/IPMPV0.sol/IPMPV0.json +402 -0
  71. package/artifacts/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol/ISeaDropShimForContract.json +37 -0
  72. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMinPriceV0.sol/ISharedMinterMinPriceV0.json +37 -0
  73. package/artifacts/contracts/interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol/IUniversalBytecodeStorageReader.json +69 -0
  74. package/artifacts/contracts/interfaces/v0.8.x/IWeb3Call.sol/IWeb3Call.json +47 -0
  75. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ERC721SeaDropStructsErrorsAndEvents.sol/ERC721SeaDropStructsErrorsAndEvents.json +43 -0
  76. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/INonFungibleSeaDropToken.sol/INonFungibleSeaDropToken.json +715 -0
  77. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDrop.sol/ISeaDrop.json +1571 -0
  78. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDropTokenContractMetadata.sol/ISeaDropTokenContractMetadata.json +345 -0
  79. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropErrorsAndEvents.sol/SeaDropErrorsAndEvents.json +717 -0
  80. package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegateRegistry.sol/DelegateRegistry.json +846 -0
  81. package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryHashes.sol/RegistryHashes.json +10 -0
  82. package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryOps.sol/RegistryOps.json +10 -0
  83. package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryStorage.sol/RegistryStorage.json +10 -0
  84. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  85. package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
  86. package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +2 -2
  87. package/artifacts/contracts/libs/v0.8.x/ImmutableStringArray.sol/ImmutableStringArray.json +10 -0
  88. package/artifacts/contracts/libs/v0.8.x/JsonStatic.sol/JsonStatic.json +10 -0
  89. package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +9 -22
  90. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
  91. package/artifacts/contracts/libs/v0.8.x/minter-libs/MinPriceLib.sol/MinPriceLib.json +24 -0
  92. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  93. package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +2 -2
  94. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +2 -2
  95. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +2 -2
  96. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +2 -2
  97. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  98. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +2 -2
  99. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +2 -2
  100. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +2 -2
  101. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +2 -2
  102. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +2 -2
  103. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +2 -2
  104. package/artifacts/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol/MinterMinPriceMerkleV0.json +664 -0
  105. package/artifacts/contracts/minter-suite/Minters/MinterMinPriceV0.sol/MinterMinPriceV0.json +387 -0
  106. package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +2 -2
  107. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +2 -2
  108. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +2 -2
  109. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +2 -2
  110. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +2 -2
  111. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +2 -2
  112. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +2 -2
  113. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
  114. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +2 -2
  115. package/artifacts/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol/SeaDropXArtBlocksShim.json +1206 -0
  116. package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +2 -2
  117. package/artifacts/contracts/mock/BytecodeV2LibCallsMock.sol/BytecodeV2LibCallsMock.json +2 -2
  118. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  119. package/artifacts/contracts/mock/ERC20MockAltDecimals.sol/ERC20MockAltDecimals.json +318 -0
  120. package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +2 -2
  121. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
  122. package/artifacts/contracts/mock/ImmutableStringArrayMock.sol/ImmutableStringArrayMock.json +69 -0
  123. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
  124. package/artifacts/contracts/mock/MockFileStore.sol/MockFileStore.json +35 -0
  125. package/artifacts/contracts/mock/MockPMPAugmentHook.sol/MockPMPAugmentHook.json +214 -0
  126. package/artifacts/contracts/mock/MockPMPConfigureHook.sol/MockPMPConfigureHook.json +236 -0
  127. package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
  128. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  129. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
  130. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
  131. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +2 -2
  132. package/artifacts/contracts/web3call/PMPV0.sol/PMPV0.json +629 -0
  133. package/artifacts/contracts/web3call/Web3Call.sol/Web3Call.json +66 -0
  134. package/artifacts/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol/AbstractPMPAugmentHook.json +83 -0
  135. package/artifacts/contracts/web3call/augment-hooks/InjectBaseGasFee.sol/InjectBaseGasFee.json +83 -0
  136. package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/IUniswapV2Pair.json +60 -0
  137. package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/InjectChromieSquiggleFloorPrice.json +107 -0
  138. package/artifacts/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol/InjectIsNounsDaoMember.json +96 -0
  139. package/artifacts/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol/InjectIsProjectFullyMinted.json +83 -0
  140. package/artifacts/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol/InjectPolyptychTokenHash.json +141 -0
  141. package/artifacts/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol/InjectTokenHashSeed.json +99 -0
  142. package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwner.sol/InjectTokenOwner.json +99 -0
  143. package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol/InjectTokenOwnerEthBalance.json +83 -0
  144. package/artifacts/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol/InjectUSDCTotalSupply.json +107 -0
  145. package/artifacts/contracts/web3call/configure-hooks/abstractPMPConfigureHook.sol/AbstractPMPConfigureHook.json +80 -0
  146. package/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol +103 -0
  147. package/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol +128 -0
  148. package/contracts/BytecodeStorageReaders/UniversalBytecodeStorageReader.sol +70 -0
  149. package/contracts/BytecodeStorageV2Writer.sol +69 -0
  150. package/contracts/DependencyRegistryV0.sol +296 -88
  151. package/contracts/GenArt721CoreV3_Curated.sol +133 -0
  152. package/contracts/OwnedCreate2FactoryV0.sol +173 -0
  153. package/contracts/engine/V3/EngineFactoryV0.sol +10 -2
  154. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +139 -70
  155. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +148 -72
  156. package/contracts/generator/AddressChunks.sol +106 -0
  157. package/contracts/generator/GenArt721GeneratorV0.sol +1163 -0
  158. package/contracts/generator/scripty-support/Scripty.sol +5 -0
  159. package/contracts/interfaces/v0.8.x/IBytecodeStorageReader.sol +34 -36
  160. package/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol +5 -3
  161. package/contracts/interfaces/v0.8.x/IBytecodeStorageReader_Base.sol +20 -0
  162. package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +5 -0
  163. package/contracts/interfaces/v0.8.x/IDelegateRegistry.sol +318 -0
  164. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +96 -0
  165. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +13 -2
  166. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +3 -1
  167. package/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV0.sol +22 -0
  168. package/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV1.sol +23 -0
  169. package/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV0.sol +11 -0
  170. package/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV1.sol +9 -0
  171. package/contracts/interfaces/v0.8.x/IGenArt721GeneratorV0.sol +14 -0
  172. package/contracts/interfaces/v0.8.x/IOwnedCreate2FactoryV0.sol +40 -0
  173. package/contracts/interfaces/v0.8.x/IPMPAugmentHook.sol +31 -0
  174. package/contracts/interfaces/v0.8.x/IPMPConfigureHook.sol +25 -0
  175. package/contracts/interfaces/v0.8.x/IPMPV0.sol +224 -0
  176. package/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol +19 -0
  177. package/contracts/interfaces/v0.8.x/ISharedMinterMinPriceV0.sol +22 -0
  178. package/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol +10 -4
  179. package/contracts/interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol +33 -0
  180. package/contracts/interfaces/v0.8.x/IWeb3Call.sol +28 -0
  181. package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ERC721SeaDropStructsErrorsAndEvents.sol +58 -0
  182. package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/INonFungibleSeaDropToken.sol +186 -0
  183. package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDrop.sol +337 -0
  184. package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDropTokenContractMetadata.sol +152 -0
  185. package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropErrorsAndEvents.sol +320 -0
  186. package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropStructs.sol +146 -0
  187. package/contracts/libs/integration-refs/delegation-registry/DelegateRegistry.sol +753 -0
  188. package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryHashes.sol +359 -0
  189. package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryOps.sol +31 -0
  190. package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryStorage.sol +87 -0
  191. package/contracts/libs/v0.8.x/Bytes32Strings.sol +20 -0
  192. package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +14 -3
  193. package/contracts/libs/v0.8.x/ImmutableStringArray.sol +289 -0
  194. package/contracts/libs/v0.8.x/JsonStatic.sol +373 -0
  195. package/contracts/libs/v0.8.x/V3FlexLib.sol +16 -4
  196. package/contracts/libs/v0.8.x/minter-libs/MinPriceLib.sol +64 -0
  197. package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +107 -0
  198. package/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol +765 -0
  199. package/contracts/minter-suite/Minters/MinterMinPriceV0.sol +462 -0
  200. package/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol +869 -0
  201. package/contracts/mock/ERC20MockAltDecimals.sol +31 -0
  202. package/contracts/mock/ImmutableStringArrayMock.sol +47 -0
  203. package/contracts/mock/MockFileStore.sol +22 -0
  204. package/contracts/mock/MockPMPAugmentHook.sol +170 -0
  205. package/contracts/mock/MockPMPConfigureHook.sol +78 -0
  206. package/contracts/web3call/PMPV0.sol +1125 -0
  207. package/contracts/web3call/Web3Call.sol +25 -0
  208. package/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol +46 -0
  209. package/contracts/web3call/augment-hooks/InjectBaseGasFee.sol +57 -0
  210. package/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol +103 -0
  211. package/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol +66 -0
  212. package/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol +73 -0
  213. package/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol +88 -0
  214. package/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol +62 -0
  215. package/contracts/web3call/augment-hooks/InjectTokenOwner.sol +60 -0
  216. package/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol +61 -0
  217. package/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol +69 -0
  218. package/contracts/web3call/configure-hooks/abstractPMPConfigureHook.sol +41 -0
  219. package/package.json +23 -21
@@ -10,12 +10,13 @@ import {IGenArt721CoreContractV3_ProjectFinance} from "../../interfaces/v0.8.x/I
10
10
  import "../../interfaces/v0.8.x/IGenArt721CoreContractExposesHashSeed.sol";
11
11
  import "../../interfaces/v0.8.x/IDependencyRegistryCompatibleV0.sol";
12
12
  import {ISplitProviderV0} from "../../interfaces/v0.8.x/ISplitProviderV0.sol";
13
+ import {IBytecodeStorageReader_Base} from "../../interfaces/v0.8.x/IBytecodeStorageReader_Base.sol";
13
14
 
14
15
  import "@openzeppelin-5.0/contracts/utils/Strings.sol";
15
16
  import "@openzeppelin-5.0/contracts/access/Ownable.sol";
16
17
  import {IERC2981} from "@openzeppelin-5.0/contracts/interfaces/IERC2981.sol";
17
18
  import "../../libs/v0.8.x/ERC721_PackedHashSeedV1.sol";
18
- import "../../libs/v0.8.x/BytecodeStorageV2.sol";
19
+ import {BytecodeStorageWriter, BytecodeStorageReader} from "../../libs/v0.8.x/BytecodeStorageV2.sol";
19
20
  import {V3FlexLib} from "../../libs/v0.8.x/V3FlexLib.sol";
20
21
  import "../../libs/v0.8.x/Bytes32Strings.sol";
21
22
 
@@ -49,6 +50,7 @@ import "../../libs/v0.8.x/Bytes32Strings.sol";
49
50
  * - forbidNewProjects (forever forbidding new projects)
50
51
  * - updateDefaultBaseURI (used to initialize new project base URIs)
51
52
  * - updateSplitProvider
53
+ * - updateBytecodeStorageReaderContract
52
54
  * - updateIPFSGateway
53
55
  * - updateArweaveGateway
54
56
  * ----------------------------------------------------------------------------
@@ -279,9 +281,9 @@ contract GenArt721CoreV3_Engine_Flex is
279
281
  bool public allowArtistProjectActivation;
280
282
 
281
283
  /// version & type of this core contract
282
- bytes32 constant CORE_VERSION = "v3.2.3";
284
+ bytes32 constant CORE_VERSION = "v3.2.5";
283
285
 
284
- function coreVersion() external pure returns (string memory) {
286
+ function coreVersion() external pure virtual returns (string memory) {
285
287
  return CORE_VERSION.toString();
286
288
  }
287
289
 
@@ -301,6 +303,9 @@ contract GenArt721CoreV3_Engine_Flex is
301
303
  // royalty split provider
302
304
  ISplitProviderV0 public splitProvider;
303
305
 
306
+ // bytecode storage reader contract; may be universal or specific version reader contract
307
+ IBytecodeStorageReader_Base public bytecodeStorageReaderContract;
308
+
304
309
  /**
305
310
  * @dev This constructor sets the owner to a non-functional address as a formality.
306
311
  * It is only ever ran on the implementation contract. The `Ownable` constructor is
@@ -409,77 +414,25 @@ contract GenArt721CoreV3_Engine_Flex is
409
414
  * function will be called atomically by the factory contract that deploys this
410
415
  * contract, after which it will be initialized and uncallable.
411
416
  * @param engineConfiguration EngineConfiguration to configure the contract with.
417
+ * note: parameter `engineConfiguration.newSuperAdminAddress` is not used or operated on in this contract.
412
418
  * @param adminACLContract_ Address of admin access control contract, to be
413
419
  * set as contract owner.
414
420
  * @param defaultBaseURIHost Base URI prefix to initialize default base URI with.
421
+ * @param bytecodeStorageReaderContract_ Address of the bytecode storage reader contract.
415
422
  */
416
423
  function initialize(
417
- EngineConfiguration calldata engineConfiguration,
424
+ EngineConfiguration memory engineConfiguration,
418
425
  address adminACLContract_,
419
- string memory defaultBaseURIHost
420
- ) external {
421
- // can only be initialized once
422
- if (_initialized) {
423
- revert GenArt721Error(ErrorCodes.ContractInitialized);
424
- }
425
- // immediately mark as initialized
426
- _initialized = true;
427
- // @dev assume renderProviderAddress, randomizer, and AdminACL non-zero
428
- // checks on platform provider addresses performed in _updateProviderSalesAddresses
429
- // initialize default sales revenue percentages and basis points
430
- _renderProviderPrimarySalesPercentage = 10;
431
- defaultRenderProviderSecondarySalesBPS = 250;
432
- _platformProviderPrimarySalesPercentage = engineConfiguration
433
- .nullPlatformProvider
434
- ? 0
435
- : 10;
436
- defaultPlatformProviderSecondarySalesBPS = engineConfiguration
437
- .nullPlatformProvider
438
- ? 0
439
- : 250;
440
-
441
- // set token name and token symbol
442
- ERC721_PackedHashSeedV1.initialize(
443
- engineConfiguration.tokenName,
444
- engineConfiguration.tokenSymbol
445
- );
446
- // update minter if populated
447
- if (engineConfiguration.minterFilterAddress != address(0)) {
448
- _updateMinterContract(engineConfiguration.minterFilterAddress);
449
- }
450
- _updateSplitProvider(engineConfiguration.splitProviderAddress);
451
- // setup immutable `autoApproveArtistSplitProposals` config
452
- autoApproveArtistSplitProposals = engineConfiguration
453
- .autoApproveArtistSplitProposals;
454
- // setup immutable `nullPlatformProvider` config
455
- nullPlatformProvider = engineConfiguration.nullPlatformProvider;
456
- // setup immutable `allowArtistProjectActivation` config
457
- allowArtistProjectActivation = engineConfiguration
458
- .allowArtistProjectActivation;
459
- // record contracts starting project ID
460
- // casting-up is safe
461
- startingProjectId = uint256(engineConfiguration.startingProjectId);
462
- // @dev nullPlatformProvider must be set before calling _updateProviderSalesAddresses
463
- _updateProviderSalesAddresses(
464
- engineConfiguration.renderProviderAddress,
465
- engineConfiguration.renderProviderAddress,
466
- engineConfiguration.platformProviderAddress,
467
- engineConfiguration.platformProviderAddress
468
- );
469
- _updateRandomizerAddress(engineConfiguration.randomizerContract);
470
- // set AdminACL management contract as owner
471
- _transferOwnership(adminACLContract_);
472
- // initialize default base URI
473
- _updateDefaultBaseURI(
474
- string.concat(defaultBaseURIHost, address(this).toHexString(), "/")
475
- );
476
- // initialize next project ID
477
- _nextProjectId = engineConfiguration.startingProjectId;
478
- emit PlatformUpdated(
479
- bytes32(uint256(PlatformUpdatedFields.FIELD_NEXT_PROJECT_ID))
480
- );
481
- // @dev This contract is registered on the core registry in a
482
- // subsequent call by the factory.
426
+ string memory defaultBaseURIHost,
427
+ address bytecodeStorageReaderContract_
428
+ ) external virtual {
429
+ // @dev internal function call so derived contracts have access to initialization logic
430
+ _initialize({
431
+ engineConfiguration: engineConfiguration,
432
+ adminACLContract_: adminACLContract_,
433
+ defaultBaseURIHost: defaultBaseURIHost,
434
+ bytecodeStorageReaderContract_: bytecodeStorageReaderContract_
435
+ });
483
436
  }
484
437
 
485
438
  /**
@@ -574,6 +527,8 @@ contract GenArt721CoreV3_Engine_Flex is
574
527
  * @notice Updates external asset dependency for project `_projectId` at
575
528
  * index `_index`, with data at BytecodeStorage-compatible address
576
529
  * `_assetAddress`.
530
+ * @dev This function may point to any BytecodeStorageReader-compatible
531
+ * on-chain asset, including a web3call contract.
577
532
  * @param _projectId Project to be updated.
578
533
  * @param _index Asset index.
579
534
  * @param _assetAddress Address of the on-chain asset.
@@ -671,6 +626,8 @@ contract GenArt721CoreV3_Engine_Flex is
671
626
  * @notice Adds an on-chain external asset dependency for project
672
627
  * `_projectId`, with data at BytecodeStorage-compatible address
673
628
  * `_assetAddress`.
629
+ * @dev This function may point to any BytecodeStorageReader-compatible
630
+ * on-chain asset, including a web3call contract.
674
631
  * @param _projectId Project to be updated.
675
632
  * @param _assetAddress Address of the BytecodeStorageReader-compatible on-chain asset.
676
633
  */
@@ -1034,6 +991,22 @@ contract GenArt721CoreV3_Engine_Flex is
1034
991
  _updateSplitProvider(_splitProviderAddress);
1035
992
  }
1036
993
 
994
+ /**
995
+ * @notice Updates bytecode storage reader contract to `_bytecodeStorageReaderContract`.
996
+ * Reverts if `_bytecodeStorageReaderContract` is zero address.
997
+ * Updating the active Bytecode Storage Reader contract may affect the ability to read
998
+ * data related to existing projects. Care should be taken to ensure that the new
999
+ * contract is compatible with the existing project data.
1000
+ * @param _bytecodeStorageReaderContract New bytecode storage reader contract address.
1001
+ */
1002
+ function updateBytecodeStorageReaderContract(
1003
+ address _bytecodeStorageReaderContract
1004
+ ) external {
1005
+ _onlyAdminACL(this.updateBytecodeStorageReaderContract.selector);
1006
+ _onlyNonZeroAddress(_bytecodeStorageReaderContract);
1007
+ _updateBytecodeStorageReaderContract(_bytecodeStorageReaderContract);
1008
+ }
1009
+
1037
1010
  /**
1038
1011
  * @notice Toggles project `_projectId` as active/inactive.
1039
1012
  * @param _projectId Project ID to be toggled.
@@ -2122,6 +2095,7 @@ contract GenArt721CoreV3_Engine_Flex is
2122
2095
  string memory _script
2123
2096
  ) external pure returns (bytes memory) {
2124
2097
  _onlyNonEmptyString(_script);
2098
+ // @dev want a potentially version-specific compression algorithm, so use version-specific library here
2125
2099
  return BytecodeStorageReader.getCompressed(_script);
2126
2100
  }
2127
2101
 
@@ -2319,9 +2293,11 @@ contract GenArt721CoreV3_Engine_Flex is
2319
2293
 
2320
2294
  /**
2321
2295
  * @notice Returns external asset dependency for project `_projectId` at index `_index`.
2322
- * If the dependencyType is ONCHAIN, the `data` field will contain the extrated bytecode data and `cid`
2296
+ * If the dependencyType is ONCHAIN, the `data` field will contain the read BytecodeStorage data and `cid`
2323
2297
  * will be an empty string. Conversly, for any other dependencyType, the `data` field will be an empty string
2324
2298
  * and the `bytecodeAddress` will point to the zero address.
2299
+ * @dev If an ONCHAIN dependency is a web3call, the `data` field will be returned per the BytecodeStorageReader
2300
+ * contract's active spec, which at the time of this writing is the special string "#web3call_contract#".
2325
2301
  * If the dependencyType is ART_BLOCKS_DEPENDENCY_REGISTRY, the `cid` field will contain the string
2326
2302
  * representation of the dependencyNameAndVersion bytes32 value stored in the dependency registry (
2327
2303
  * at public address `artblocksDependencyRegistryAddress`)
@@ -2336,7 +2312,8 @@ contract GenArt721CoreV3_Engine_Flex is
2336
2312
  return
2337
2313
  V3FlexLib.projectExternalAssetDependencyByIndex({
2338
2314
  _projectId: _projectId,
2339
- _index: _index
2315
+ _index: _index,
2316
+ _bytecodeStorageReaderContract: bytecodeStorageReaderContract
2340
2317
  });
2341
2318
  }
2342
2319
 
@@ -2593,6 +2570,23 @@ contract GenArt721CoreV3_Engine_Flex is
2593
2570
  );
2594
2571
  }
2595
2572
 
2573
+ /**
2574
+ * @notice Update the bytecode storage reader contract address, and emit corresponding event.
2575
+ * @param _bytecodeStorageReaderContract New bytecode storage reader contract address.
2576
+ */
2577
+ function _updateBytecodeStorageReaderContract(
2578
+ address _bytecodeStorageReaderContract
2579
+ ) internal {
2580
+ bytecodeStorageReaderContract = IBytecodeStorageReader_Base(
2581
+ _bytecodeStorageReaderContract
2582
+ );
2583
+ emit PlatformUpdated(
2584
+ bytes32(
2585
+ uint256(PlatformUpdatedFields.FIELD_BYTECODE_STORAGE_READER)
2586
+ )
2587
+ );
2588
+ }
2589
+
2596
2590
  /**
2597
2591
  * @notice internal function to update a splitter contract for a project,
2598
2592
  * based on the project's financials in this contract's storage.
@@ -2663,6 +2657,88 @@ contract GenArt721CoreV3_Engine_Flex is
2663
2657
  );
2664
2658
  }
2665
2659
 
2660
+ /**
2661
+ * @notice Initializes the contract with the provided `engineConfiguration`.
2662
+ * This function should be called atomically, immediately after deployment.
2663
+ * Only callable once. Validation on `engineConfiguration` is performed by caller.
2664
+ * @param engineConfiguration EngineConfiguration to configure the contract with.
2665
+ * note: parameter `engineConfiguration.newSuperAdminAddress` is not used or operated on in this contract.
2666
+ * @param adminACLContract_ Address of admin access control contract, to be
2667
+ * set as contract owner.
2668
+ * @param defaultBaseURIHost Base URI prefix to initialize default base URI with.
2669
+ * @param bytecodeStorageReaderContract_ Address of bytecode storage reader contract.
2670
+ */
2671
+ function _initialize(
2672
+ EngineConfiguration memory engineConfiguration,
2673
+ address adminACLContract_,
2674
+ string memory defaultBaseURIHost,
2675
+ address bytecodeStorageReaderContract_
2676
+ ) internal {
2677
+ // can only be initialized once
2678
+ if (_initialized) {
2679
+ revert GenArt721Error(ErrorCodes.ContractInitialized);
2680
+ }
2681
+ // immediately mark as initialized
2682
+ _initialized = true;
2683
+ // @dev assume renderProviderAddress, randomizer, and AdminACL non-zero
2684
+ // checks on platform provider addresses performed in _updateProviderSalesAddresses
2685
+ // initialize default sales revenue percentages and basis points
2686
+ _renderProviderPrimarySalesPercentage = 10;
2687
+ defaultRenderProviderSecondarySalesBPS = 250;
2688
+ _platformProviderPrimarySalesPercentage = engineConfiguration
2689
+ .nullPlatformProvider
2690
+ ? 0
2691
+ : 10;
2692
+ defaultPlatformProviderSecondarySalesBPS = engineConfiguration
2693
+ .nullPlatformProvider
2694
+ ? 0
2695
+ : 250;
2696
+
2697
+ // set token name and token symbol
2698
+ ERC721_PackedHashSeedV1.initialize(
2699
+ engineConfiguration.tokenName,
2700
+ engineConfiguration.tokenSymbol
2701
+ );
2702
+ // update minter if populated
2703
+ if (engineConfiguration.minterFilterAddress != address(0)) {
2704
+ _updateMinterContract(engineConfiguration.minterFilterAddress);
2705
+ }
2706
+ _updateSplitProvider(engineConfiguration.splitProviderAddress);
2707
+ _updateBytecodeStorageReaderContract(bytecodeStorageReaderContract_);
2708
+ // setup immutable `autoApproveArtistSplitProposals` config
2709
+ autoApproveArtistSplitProposals = engineConfiguration
2710
+ .autoApproveArtistSplitProposals;
2711
+ // setup immutable `nullPlatformProvider` config
2712
+ nullPlatformProvider = engineConfiguration.nullPlatformProvider;
2713
+ // setup immutable `allowArtistProjectActivation` config
2714
+ allowArtistProjectActivation = engineConfiguration
2715
+ .allowArtistProjectActivation;
2716
+ // record contracts starting project ID
2717
+ // casting-up is safe
2718
+ startingProjectId = uint256(engineConfiguration.startingProjectId);
2719
+ // @dev nullPlatformProvider must be set before calling _updateProviderSalesAddresses
2720
+ _updateProviderSalesAddresses(
2721
+ engineConfiguration.renderProviderAddress,
2722
+ engineConfiguration.renderProviderAddress,
2723
+ engineConfiguration.platformProviderAddress,
2724
+ engineConfiguration.platformProviderAddress
2725
+ );
2726
+ _updateRandomizerAddress(engineConfiguration.randomizerContract);
2727
+ // set AdminACL management contract as owner
2728
+ _transferOwnership(adminACLContract_);
2729
+ // initialize default base URI
2730
+ _updateDefaultBaseURI(
2731
+ string.concat(defaultBaseURIHost, address(this).toHexString(), "/")
2732
+ );
2733
+ // initialize next project ID
2734
+ _nextProjectId = engineConfiguration.startingProjectId;
2735
+ emit PlatformUpdated(
2736
+ bytes32(uint256(PlatformUpdatedFields.FIELD_NEXT_PROJECT_ID))
2737
+ );
2738
+ // @dev This contract is registered on the core registry in a
2739
+ // subsequent call by the factory.
2740
+ }
2741
+
2666
2742
  /**
2667
2743
  * @notice Internal function that returns whether a project is unlocked.
2668
2744
  * Projects automatically lock four weeks after they are completed.
@@ -2685,12 +2761,12 @@ contract GenArt721CoreV3_Engine_Flex is
2685
2761
  }
2686
2762
 
2687
2763
  /**
2688
- * Helper for calling `BytecodeStorageReader` external library reader method,
2764
+ * @notice Helper for calling bytecodeStorageReaderContract reader method;
2689
2765
  * added for bytecode size reduction purposes.
2690
2766
  */
2691
2767
  function _readFromBytecode(
2692
2768
  address _address
2693
2769
  ) internal view returns (string memory) {
2694
- return BytecodeStorageReader.readFromBytecode(_address);
2770
+ return bytecodeStorageReaderContract.readFromBytecode(_address);
2695
2771
  }
2696
2772
  }
@@ -0,0 +1,106 @@
1
+ // Forked from https://github.com/intartnft/scripty.sol/blob/28cc612d7dc3a709f35c534c981bfc6bbfce4209/contracts/scripty/utils/AddressChunks.sol
2
+ // with adjustment to data offset for compatibility with Art Blocks BytecodeStorage.sol
3
+ // SPDX-License-Identifier: MIT
4
+ pragma solidity ^0.8.17;
5
+
6
+ library AddressChunks {
7
+ /**
8
+ * @notice Merge multiple chunks of contract code into a single bytes array.
9
+ * Offloads details of reading contract code to UniversalBytecodeStorageReader contract, but efficiently
10
+ * merges staticcall responses into a single bytes array using assembly.
11
+ * @dev This could become more gas efficient by implementing logic in the bytecode storage reader contracts
12
+ * here instead of moving large amounts of data through return data, but this implementation is much simpler
13
+ * and maintainable.
14
+ * @param chunks Array of contract addresses to merge
15
+ * @param universalReaderContract Address of the UniversalBytecodeStorageReader contract to use for reading
16
+ * stored bytecode (Art Blocks BytecodeStorage library)
17
+ * @return o_code Merged contract code
18
+ */
19
+ function mergeChunks(
20
+ address[] memory chunks,
21
+ address universalReaderContract
22
+ ) internal view returns (bytes memory o_code) {
23
+ unchecked {
24
+ assembly ("memory-safe") {
25
+ // part 1: provision memory for calldata to universal reader's readFromBytecode function
26
+ // 4 bytes for function selector, 32 bytes for address
27
+ let readerCalldata := mload(0x40)
28
+ mstore(readerCalldata, 0x75662f38) // function selector for readFromBytecode(address)
29
+ // calldata in memory will look like:
30
+ // 0000000000000000000000000000000000000000000000000000000075662f38
31
+ // 000000000000000000000000<-------------chunk-address------------>
32
+ // @dev do not populate address yet - do in call loop
33
+ // update free memory pointer two words ahead, past end reserved for calldata
34
+ mstore(0x40, add(readerCalldata, 0x40))
35
+ // update calldata to point to the start of the function selector
36
+ readerCalldata := add(readerCalldata, 28)
37
+
38
+ // part 2: reserve space 0x20 bytes representing the returned string length data for each call in loop
39
+ let returnDataStringLength := mload(0x40)
40
+ // update free memory pointer one word ahead, past end of returnDataStringLength
41
+ mstore(0x40, add(returnDataStringLength, 0x20))
42
+
43
+ // part 3: build o_code while looping through chunks
44
+ let len := mload(chunks)
45
+ let totalSize := 0x20
46
+ o_code := mload(0x40)
47
+
48
+ // loop through all chunk addresses
49
+ // - get address
50
+ // - get data size
51
+ // - get code and add to o_code
52
+ // - update total size
53
+ let targetChunk := 0
54
+ for {
55
+ let i := 0
56
+ } lt(i, len) {
57
+ i := add(i, 1)
58
+ } {
59
+ targetChunk := mload(add(chunks, add(0x20, mul(i, 0x20))))
60
+ // update calldata with targetChunk address
61
+ mstore(add(readerCalldata, 0x04), targetChunk) // offset by 4-byte function selector
62
+ // call the readFromBytecode(address) function of contract targetChunk and don't store the result
63
+ if iszero(
64
+ staticcall(
65
+ gas(), // forward all gas
66
+ universalReaderContract, // target address with the data stored as bytecode
67
+ readerCalldata, // start of calldata
68
+ 0x24, // calldata size is 0x04 (function selector) + 0x20 (abi-encoded address)
69
+ 0x00, // 0x00 (do not store return data)
70
+ 0x00 // 0x00 (do not store return data)
71
+ )
72
+ ) {
73
+ revert(0, 0) // call failed, revert
74
+ }
75
+
76
+ // store return data string length
77
+ returndatacopy(
78
+ returnDataStringLength,
79
+ 0x20, // start of return data's string length (ABI spec)
80
+ 0x20 // size of length data (ABI spec)
81
+ )
82
+
83
+ // store the return string data in memory starting at o_code + totalSize
84
+ // first 0x20 bytes of return data points to the location of the string data (ABI spec)
85
+ // second 0x20 bytes of return data is the length of the data (ABI spec)
86
+ // the actual string data contents begin at returndata + 0x40
87
+ let storedReturnSize := mload(returnDataStringLength)
88
+ returndatacopy(
89
+ add(o_code, totalSize), // offset by totalSize
90
+ 0x40, // skip the 0x40 bytes of length data at the start of the expected return data
91
+ storedReturnSize // return data size, as gathered above
92
+ )
93
+ totalSize := add(totalSize, storedReturnSize) // update total size
94
+ }
95
+
96
+ // update o_code length in memory
97
+ mstore(o_code, sub(totalSize, 0x20))
98
+ // new "memory end" including padding
99
+ mstore(
100
+ 0x40,
101
+ add(o_code, and(add(add(totalSize, 0x20), 0x1f), not(0x1f)))
102
+ )
103
+ }
104
+ }
105
+ }
106
+ }