@artblocks/contracts 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/README.md +75 -7
  2. package/artifacts/contracts/AdminACLV0.sol/AdminACLV0.json +2 -2
  3. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  4. package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +273 -155
  5. package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +2047 -0
  6. package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +2021 -0
  7. package/artifacts/contracts/{minter-suite → archive/minter-suite}/Minters/MinterBase_v0_1_1.sol/MinterBase.json +1 -1
  8. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
  9. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
  10. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExp}/MinterDAExpV4.sol/MinterDAExpV4.json +3 -3
  11. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  12. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
  13. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +3 -3
  14. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
  15. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
  16. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDALin}/MinterDALinV4.sol/MinterDALinV4.json +3 -3
  17. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
  18. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
  19. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
  20. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterHolder}/MinterHolderV4.sol/MinterHolderV4.json +3 -3
  21. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
  22. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
  23. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
  24. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
  25. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterMerkle}/MinterMerkleV5.sol/MinterMerkleV5.json +3 -3
  26. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +31 -63
  27. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol/MinterPolyptychV0.json +3 -3
  28. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSEA}/MinterSEAV0.sol/MinterSEAV0.json +3 -3
  29. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  30. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  31. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPrice}/MinterSetPriceV4.sol/MinterSetPriceV4.json +3 -3
  32. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol/MinterSetPriceERC20V0.json +65 -2
  33. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol/MinterSetPriceERC20V1.json +65 -2
  34. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  35. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  36. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +807 -0
  37. package/artifacts/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol/GenArt721MinterBurner_PBAB.json +65 -2
  38. package/artifacts/contracts/engine/V2/GenArt721Minter_PBAB.sol/GenArt721Minter_PBAB.json +65 -2
  39. package/artifacts/contracts/engine/V3/EngineFactoryV0.sol/EngineFactoryV0.json +606 -0
  40. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +567 -206
  41. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +787 -224
  42. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +38 -8
  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 +38 -8
  45. package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +36 -68
  46. package/artifacts/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol/IAdminACLV0_Extended.json +140 -0
  47. package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol/IBytecodeStorageReaderV2.json +130 -0
  48. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +58 -45
  49. package/artifacts/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol/IEngineFactoryV0.json +283 -0
  50. package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol/IFilteredMinterDAExpSettlementV0.json +12 -12
  51. package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +12 -12
  52. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +30 -62
  53. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +30 -62
  54. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +170 -104
  55. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +170 -104
  56. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +1028 -0
  57. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +741 -0
  58. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol/IGenArt721CoreContractV3_ProjectFinance.json +87 -0
  59. package/artifacts/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol/IGenArt721Minter_PBAB.json +279 -0
  60. package/artifacts/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
  61. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +18 -0
  62. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol/ISharedMinterRAMV0.json +62 -0
  63. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol/ISharedMinterRequired.json +37 -0
  64. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +1 -1
  65. package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol/ISplitAtomicFactoryV0.json +170 -0
  66. package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol/ISplitAtomicV0.json +126 -0
  67. package/artifacts/contracts/interfaces/v0.8.x/ISplitProviderV0.sol/ISplitProviderV0.json +98 -0
  68. package/artifacts/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol/ISplitFactoryV2.json +123 -0
  69. package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
  70. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeMock.sol/GnosisSafeMock.json +2 -2
  71. package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeProxyFactoryMock.sol/GnosisSafeProxyFactoryMock.json +2 -2
  72. package/artifacts/contracts/libs/integration-refs/gnosis-safe/MultiSendMock.sol/MultiSendMock.json +2 -2
  73. package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +2 -2
  74. package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
  75. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  76. package/artifacts/contracts/libs/v0.8.x/BitMap.sol/BitMaps256.json +10 -0
  77. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV0.sol/BytecodeStorage.json +2 -2
  78. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageReader.json +2 -2
  79. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageWriter.json +2 -2
  80. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageReader.json +214 -0
  81. package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageWriter.json +10 -0
  82. package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
  83. package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +10 -0
  84. package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +2 -2
  85. package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol/ERC721_PackedHashSeedV1.json +444 -0
  86. package/artifacts/contracts/libs/v0.8.x/PackedBools.sol/PackedBools.json +10 -0
  87. package/artifacts/contracts/libs/v0.8.x/SSTORE2.sol/SSTORE2.json +2 -2
  88. package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +208 -0
  89. package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +2 -2
  90. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +2 -2
  91. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +2 -2
  92. package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +2 -2
  93. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
  94. package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +2 -2
  95. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  96. package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +398 -0
  97. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +2 -2
  98. package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +2 -2
  99. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +2 -2
  100. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +2 -2
  101. package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +2 -2
  102. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  103. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +2 -2
  104. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +2 -2
  105. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +2 -2
  106. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +2 -2
  107. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +2 -2
  108. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +2 -2
  109. package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +1374 -0
  110. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +7 -7
  111. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +2 -2
  112. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +2 -2
  113. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +2 -2
  114. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +2 -2
  115. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +2 -2
  116. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
  117. package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +417 -0
  118. package/artifacts/contracts/mock/BytecodeV2LibCallsMock.sol/BytecodeV2LibCallsMock.json +154 -0
  119. package/artifacts/contracts/mock/BytecodeV2TextCR_DMock.sol/BytecodeV2TextCR_DMock.json +428 -0
  120. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  121. package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +2 -2
  122. package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +24 -0
  123. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
  124. package/artifacts/contracts/mock/Mock0xSplitsV2PullFactory.sol/Mock0xSplitsV2PullFactory.json +149 -0
  125. package/artifacts/contracts/mock/Mock0xSplitsV2Splitter.sol/Mock0xSplitsV2Splitter.json +99 -0
  126. package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +20 -2
  127. package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +20 -2
  128. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
  129. package/artifacts/contracts/mock/ReentrancyGenArt721MinterMock.sol/ReentrancyGenArt721MinterMock.json +100 -0
  130. package/artifacts/contracts/mock/ReentrancyHolderMock.sol/ReentrancyHolderMock.json +2 -2
  131. package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +2 -2
  132. package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
  133. package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +2 -2
  134. package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
  135. package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +2 -2
  136. package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +2 -2
  137. package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +2 -2
  138. package/artifacts/contracts/mock/ReentrancySplitterMocks.sol/ReentrancySplitterDrainETHMock.json +54 -0
  139. package/artifacts/contracts/mock/ReentrancySplitterMocks.sol/ReentrancySplitterSendETHMock.json +54 -0
  140. package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
  141. package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
  142. package/artifacts/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +2 -2
  143. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +2 -2
  144. package/artifacts/contracts/split/SplitAtomicFactoryV0.sol/SplitAtomicFactoryV0.json +203 -0
  145. package/artifacts/contracts/split/SplitAtomicV0.sol/SplitAtomicV0.json +168 -0
  146. package/artifacts/contracts/split/split-provider/SplitProviderV0.sol/SplitProviderV0.json +141 -0
  147. package/contracts/AdminACLV0.sol +6 -2
  148. package/contracts/AdminACLV1.sol +2 -2
  149. package/contracts/DependencyRegistryV0.sol +687 -408
  150. package/contracts/{GenArt721CoreV3.sol → archive/GenArt721CoreV3.sol} +56 -20
  151. package/contracts/{explorations → archive}/GenArt721CoreV3_Explorations.sol +49 -13
  152. package/contracts/{minter-suite → archive/minter-suite}/Minters/MinterBase_v0_1_1.sol +4 -4
  153. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExp}/MinterDAExpV4.sol +4 -4
  154. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +4 -4
  155. package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +5 -5
  156. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV2.sol +8 -8
  157. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDALin}/MinterDALinV4.sol +4 -4
  158. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterHolder}/MinterHolderV4.sol +5 -5
  159. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterMerkle}/MinterMerkleV5.sol +5 -5
  160. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol +7 -7
  161. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSEA}/MinterSEAV0.sol +13 -13
  162. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPrice}/MinterSetPriceV4.sol +4 -4
  163. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol +82 -10
  164. package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol +82 -10
  165. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPriceERC20}/MinterSetPriceERC20V4.sol +88 -21
  166. package/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol +81 -22
  167. package/contracts/engine/V2/GenArt721Minter_PBAB.sol +80 -22
  168. package/contracts/engine/V3/EngineFactoryV0.sol +419 -0
  169. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +894 -488
  170. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +1054 -650
  171. package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +3 -3
  172. package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +1 -1
  173. package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +2 -2
  174. package/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol +20 -0
  175. package/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol +23 -0
  176. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +47 -45
  177. package/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol +124 -0
  178. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol +1 -3
  179. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol +1 -3
  180. package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpV1.sol +1 -3
  181. package/contracts/interfaces/v0.8.x/IFilteredMinterDALinV1.sol +1 -3
  182. package/contracts/interfaces/v0.8.x/IFilteredMinterHolderV2.sol +1 -3
  183. package/contracts/interfaces/v0.8.x/IFilteredMinterMerkleV2.sol +1 -3
  184. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +115 -11
  185. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +84 -8
  186. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol +26 -8
  187. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol +141 -0
  188. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol +78 -0
  189. package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol +47 -0
  190. package/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol +91 -0
  191. package/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol +1 -3
  192. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +19 -0
  193. package/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol +23 -0
  194. package/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol +20 -0
  195. package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +1 -4
  196. package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +12 -6
  197. package/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol +81 -0
  198. package/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol +72 -0
  199. package/contracts/interfaces/v0.8.x/ISplitProviderV0.sol +49 -0
  200. package/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol +62 -0
  201. package/contracts/libs/v0.8.x/ABHelpers.sol +18 -4
  202. package/contracts/libs/v0.8.x/BitMap.sol +112 -0
  203. package/contracts/libs/v0.8.x/BytecodeStorageV2.sol +593 -0
  204. package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +90 -0
  205. package/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol +591 -0
  206. package/contracts/libs/v0.8.x/PackedBools.sol +42 -0
  207. package/contracts/libs/v0.8.x/V3FlexLib.sol +591 -0
  208. package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +10 -12
  209. package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +4 -9
  210. package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +44 -44
  211. package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +64 -63
  212. package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +14 -10
  213. package/contracts/libs/v0.8.x/minter-libs/RAMLib.sol +2927 -0
  214. package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +60 -62
  215. package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +4 -8
  216. package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +92 -89
  217. package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +21 -15
  218. package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +5 -4
  219. package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +16 -10
  220. package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +2 -2
  221. package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +19 -15
  222. package/contracts/minter-suite/Minters/MinterDAExpV5.sol +2 -2
  223. package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +2 -2
  224. package/contracts/minter-suite/Minters/MinterDALinV5.sol +2 -2
  225. package/contracts/minter-suite/Minters/MinterRAMV0.sol +1205 -0
  226. package/contracts/minter-suite/Minters/MinterSEAV1.sol +21 -32
  227. package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +17 -8
  228. package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +2 -2
  229. package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +2 -2
  230. package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +23 -9
  231. package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +2 -2
  232. package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +2 -2
  233. package/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol +446 -0
  234. package/contracts/mock/BytecodeV2LibCallsMock.sol +128 -0
  235. package/contracts/mock/BytecodeV2TextCR_DMock.sol +316 -0
  236. package/contracts/mock/ForceSendMock.sol +22 -0
  237. package/contracts/mock/Mock0xSplitsV2PullFactory.sol +75 -0
  238. package/contracts/mock/Mock0xSplitsV2Splitter.sol +47 -0
  239. package/contracts/mock/MockAdminACLV0.sol +21 -0
  240. package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +21 -0
  241. package/contracts/mock/ReentrancyGenArt721MinterMock.sol +47 -0
  242. package/contracts/mock/ReentrancySplitterMocks.sol +67 -0
  243. package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
  244. package/contracts/randomizer/shared/SharedRandomizerV0.sol +1 -1
  245. package/contracts/split/SplitAtomicFactoryV0.sol +121 -0
  246. package/contracts/split/SplitAtomicV0.sol +265 -0
  247. package/contracts/split/split-provider/SplitProviderV0.sol +201 -0
  248. package/package.json +62 -34
  249. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +0 -1965
  250. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +0 -1939
  251. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +0 -768
  252. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +0 -208
  253. package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol/GenArt721RoyaltyOverride_PBAB.json +0 -301
  254. package/contracts/archive/readme.md +0 -16
  255. package/contracts/engine/README.md +0 -21
  256. package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +0 -168
  257. package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +0 -221
@@ -13,6 +13,7 @@ import "@openzeppelin-4.8/contracts-upgradeable/access/OwnableUpgradeable.sol";
13
13
  import "@openzeppelin-4.8/contracts-upgradeable/proxy/utils/Initializable.sol";
14
14
  import "@openzeppelin-4.5/contracts/utils/math/SafeCast.sol";
15
15
 
16
+ import "./libs/v0.8.x/DependencyRegistryStorageLib.sol";
16
17
  import "./libs/v0.8.x/BytecodeStorageV1.sol";
17
18
  import "./libs/v0.8.x/Bytes32Strings.sol";
18
19
 
@@ -21,7 +22,7 @@ import "./libs/v0.8.x/Bytes32Strings.sol";
21
22
  * @author Art Blocks Inc.
22
23
  * @notice Privileged Roles and Ownership:
23
24
  * Permissions managed by ACL contract. If/when we ever call
24
- * renounceOwnership() this will becom a frozen, immutable registry
25
+ * renounceOwnership() this will become a frozen, immutable registry
25
26
  * as no upgrades will be possible.
26
27
  * This contract is intended to be an auxiliary reference registry
27
28
  * to our non-upgradeable and immutable ERC-721 conforming core contracts,
@@ -42,157 +43,152 @@ contract DependencyRegistryV0 is
42
43
 
43
44
  uint8 constant AT_CHARACTER_CODE = uint8(bytes1("@")); // 0x40
44
45
 
45
- /// admin ACL contract
46
- IAdminACLV0 public adminACLContract;
47
-
48
- struct Dependency {
49
- bytes32 licenseType;
50
- string preferredCDN;
51
- // mapping from additional CDN index to CDN URLr
52
- mapping(uint256 => string) additionalCDNs;
53
- string preferredRepository;
54
- // mapping from additional repository index to repository URL
55
- mapping(uint256 => string) additionalRepositories;
56
- string referenceWebsite;
57
- // mapping from script index to address storing script in bytecode
58
- mapping(uint256 => address) scriptBytecodeAddresses;
59
- uint24 additionalCDNCount;
60
- uint24 additionalRepositoryCount;
61
- uint24 scriptCount;
62
- }
63
-
64
- // dependency types, i.e. "type@version"
65
- EnumerableSet.Bytes32Set private _dependencyTypes;
66
- // mapping from dependencyTypes to Dependency, which stores the properties of each dependency
67
- mapping(bytes32 => Dependency) dependencyDetails;
68
- // source code license types, MIT, GPL, etc.
69
- EnumerableSet.Bytes32Set private _licenseTypes;
70
-
71
- // set of supported core ArtBlocks contracts
72
- EnumerableSet.AddressSet private _supportedCoreContracts;
73
- mapping(address => mapping(uint256 => bytes32)) projectDependencyTypeOverrides;
74
-
75
- function _onlyNonZeroAddress(address _address) internal pure {
76
- require(_address != address(0), "Must input non-zero address");
46
+ function _onlyNonZeroAddress(address address_) internal pure {
47
+ require(address_ != address(0), "Must input non-zero address");
77
48
  }
78
49
 
79
- function _onlyNonEmptyString(string memory _string) internal pure {
80
- require(bytes(_string).length != 0, "Must input non-empty string");
50
+ function _onlyNonEmptyString(string memory string_) internal pure {
51
+ require(bytes(string_).length != 0, "Must input non-empty string");
81
52
  }
82
53
 
83
- function _onlyAdminACL(bytes4 _selector) internal {
54
+ function _onlyAdminACL(bytes4 selector) internal {
84
55
  require(
85
- adminACLAllowed(msg.sender, address(this), _selector),
56
+ adminACLAllowed({
57
+ sender: msg.sender,
58
+ contract_: address(this),
59
+ selector: selector
60
+ }),
86
61
  "Only Admin ACL allowed"
87
62
  );
88
63
  }
89
64
 
90
65
  function _onlySupportedCoreContract(
91
- address _coreContractAddress
66
+ address coreContractAddress
92
67
  ) internal view {
93
68
  require(
94
- _supportedCoreContracts.contains(_coreContractAddress),
69
+ DependencyRegistryStorageLib.s().supportedCoreContracts.contains(
70
+ coreContractAddress
71
+ ),
95
72
  "Core contract not supported"
96
73
  );
97
74
  }
98
75
 
99
- function _onlyExistingDependencyType(
100
- bytes32 _dependencyType
76
+ function _onlyExistingDependency(
77
+ bytes32 dependencyNameAndVersion
101
78
  ) internal view {
102
79
  require(
103
- _dependencyTypes.contains(_dependencyType),
104
- "Dependency type does not exist"
80
+ DependencyRegistryStorageLib.s().dependencyNameVersionIds.contains(
81
+ dependencyNameAndVersion
82
+ ),
83
+ "Dependency does not exist"
105
84
  );
106
85
  }
107
86
 
108
- function _onlyInRangeIndex(uint256 _index, uint256 _length) internal pure {
109
- require(_index < _length, "Index out of range");
87
+ function _onlyInRangeIndex(uint256 index, uint256 length) internal pure {
88
+ require(index < length, "Index out of range");
110
89
  }
111
90
 
112
- function _onlyExistingLicenseType(bytes32 _licenseType) internal view {
91
+ function _onlyExistingLicenseType(bytes32 licenseType) internal view {
113
92
  require(
114
- _licenseTypes.contains(_licenseType),
93
+ DependencyRegistryStorageLib.s().licenseTypes.contains(licenseType),
115
94
  "License type does not exist"
116
95
  );
117
96
  }
118
97
 
119
98
  /**
120
99
  * @notice Initializes contract.
121
- * @param _adminACLContract Address of admin access control contract, to be
100
+ * @param adminACLContract_ Address of admin access control contract, to be
122
101
  * set as contract owner.
123
102
  */
124
- function initialize(address _adminACLContract) public initializer {
103
+ function initialize(address adminACLContract_) public initializer {
125
104
  __Ownable_init();
105
+
126
106
  // set AdminACL management contract as owner
127
- _transferOwnership(_adminACLContract);
107
+ _transferOwnership(adminACLContract_);
128
108
  }
129
109
 
130
110
  /**
131
111
  * @notice Adds a new license type that can be used by dependencies.
112
+ * @param licenseType License type to be added.
132
113
  */
133
- function addLicenseType(bytes32 _licenseType) external {
114
+ function addLicenseType(bytes32 licenseType) external {
134
115
  _onlyAdminACL(this.addLicenseType.selector);
135
- // @dev the add function returns false if set already contains value
136
- require(_licenseTypes.add(_licenseType), "License type already exists");
137
116
  require(
138
- _licenseType != bytes32(""),
117
+ licenseType != bytes32(""),
139
118
  "License type cannot be empty string"
140
119
  );
141
- emit LicenseTypeAdded(_licenseType);
120
+
121
+ // @dev the add function returns false if set already contains value
122
+ require(
123
+ DependencyRegistryStorageLib.s().licenseTypes.add(licenseType),
124
+ "License type already exists"
125
+ );
126
+ emit LicenseTypeAdded(licenseType);
142
127
  }
143
128
 
144
129
  /**
145
130
  * @notice Adds a new dependency.
146
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
147
- * @param _licenseType License type for dependency, must be a registered license type.
148
- * @param _preferredCDN Preferred CDN for dependency.
149
- * @param _preferredRepository Preferred repository for dependency.
131
+ * @param dependencyNameAndVersion A unique identifier for the dependency, composed of its name and version in the format "name@version".
132
+ * @param licenseType License type for dependency, must be a registered license type.
133
+ * @param preferredCDN Preferred CDN for dependency.
134
+ * @param preferredRepository Preferred repository for dependency.
150
135
  */
151
136
  function addDependency(
152
- bytes32 _dependencyType,
153
- bytes32 _licenseType,
154
- string memory _preferredCDN,
155
- string memory _preferredRepository,
156
- string memory _referenceWebsite
137
+ bytes32 dependencyNameAndVersion,
138
+ bytes32 licenseType,
139
+ string memory preferredCDN,
140
+ string memory preferredRepository,
141
+ string memory dependencyWebsite
157
142
  ) external {
158
143
  _onlyAdminACL(this.addDependency.selector);
159
- _onlyExistingLicenseType(_licenseType);
144
+ _onlyExistingLicenseType(licenseType);
160
145
  require(
161
- _dependencyType.containsExactCharacterQty(
146
+ dependencyNameAndVersion.containsExactCharacterQty(
162
147
  AT_CHARACTER_CODE,
163
148
  uint8(1)
164
149
  ),
165
150
  "must contain exactly one @"
166
151
  );
152
+
153
+ DependencyRegistryStorageLib.Storage
154
+ storage ds = DependencyRegistryStorageLib.s();
155
+
167
156
  require(
168
157
  // @dev the add function returns false if set already contains value
169
- _dependencyTypes.add(_dependencyType),
170
- "Dependency type already exists"
158
+ ds.dependencyNameVersionIds.add(dependencyNameAndVersion),
159
+ "Dependency already exists"
171
160
  );
172
161
 
173
- Dependency storage dependency = dependencyDetails[_dependencyType];
174
- dependency.licenseType = _licenseType;
175
- dependency.preferredCDN = _preferredCDN;
176
- dependency.preferredRepository = _preferredRepository;
177
- dependency.referenceWebsite = _referenceWebsite;
162
+ DependencyRegistryStorageLib.Dependency storage dependency = ds
163
+ .dependencyRecords[dependencyNameAndVersion];
164
+ dependency.licenseType = licenseType;
165
+ dependency.preferredCDN = preferredCDN;
166
+ dependency.preferredRepository = preferredRepository;
167
+ dependency.website = dependencyWebsite;
178
168
 
179
169
  emit DependencyAdded(
180
- _dependencyType,
181
- _licenseType,
182
- _preferredCDN,
183
- _preferredRepository,
184
- _referenceWebsite
170
+ dependencyNameAndVersion,
171
+ licenseType,
172
+ preferredCDN,
173
+ preferredRepository,
174
+ dependencyWebsite
185
175
  );
186
176
  }
187
177
 
188
178
  /**
189
179
  * @notice Removes a dependency.
190
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
180
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
191
181
  */
192
- function removeDependency(bytes32 _dependencyType) external {
182
+ function removeDependency(bytes32 dependencyNameAndVersion) external {
193
183
  _onlyAdminACL(this.removeDependency.selector);
194
- _onlyExistingDependencyType(_dependencyType);
195
- Dependency storage dependency = dependencyDetails[_dependencyType];
184
+ _onlyExistingDependency(dependencyNameAndVersion);
185
+
186
+ DependencyRegistryStorageLib.Storage
187
+ storage ds = DependencyRegistryStorageLib.s();
188
+
189
+ DependencyRegistryStorageLib.Dependency storage dependency = ds
190
+ .dependencyRecords[dependencyNameAndVersion];
191
+
196
192
  require(
197
193
  dependency.additionalCDNCount == 0 &&
198
194
  dependency.additionalRepositoryCount == 0 &&
@@ -200,115 +196,139 @@ contract DependencyRegistryV0 is
200
196
  "Cannot remove dependency with additional CDNs, repositories, or scripts"
201
197
  );
202
198
 
203
- _dependencyTypes.remove(_dependencyType);
204
- delete dependencyDetails[_dependencyType];
199
+ ds.dependencyNameVersionIds.remove(dependencyNameAndVersion);
200
+ // @dev all of the arrays in the dependency struct are required to be empty
201
+ // before this function can be called, so we don't need to delete them here
202
+ delete ds.dependencyRecords[dependencyNameAndVersion];
205
203
 
206
- emit DependencyRemoved(_dependencyType);
204
+ emit DependencyRemoved(dependencyNameAndVersion);
207
205
  }
208
206
 
209
207
  /**
210
- * @notice Adds a script to dependency `_dependencyType`, by way of
208
+ * @notice Adds a script to dependency `dependencyNameAndVersion`, by way of
211
209
  * providing a string to write to bytecode storage.
212
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
213
- * @param _script Script to be added. Required to be a non-empty string,
210
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
211
+ * @param script Script to be added. Required to be a non-empty string,
214
212
  * but no further validation is performed.
215
213
  */
216
214
  function addDependencyScript(
217
- bytes32 _dependencyType,
218
- string memory _script
215
+ bytes32 dependencyNameAndVersion,
216
+ string memory script
219
217
  ) external {
220
218
  _onlyAdminACL(this.addDependencyScript.selector);
221
- _onlyNonEmptyString(_script);
222
- _onlyExistingDependencyType(_dependencyType);
223
- Dependency storage dependency = dependencyDetails[_dependencyType];
219
+ _onlyNonEmptyString(script);
220
+ _onlyExistingDependency(dependencyNameAndVersion);
221
+
222
+ DependencyRegistryStorageLib.Dependency
223
+ storage dependency = DependencyRegistryStorageLib
224
+ .s()
225
+ .dependencyRecords[dependencyNameAndVersion];
224
226
  // store script in contract bytecode
225
- dependency.scriptBytecodeAddresses[dependency.scriptCount] = _script
227
+ dependency.scriptBytecodeAddresses[dependency.scriptCount] = script
226
228
  .writeToBytecode();
227
229
  dependency.scriptCount = dependency.scriptCount + 1;
228
230
 
229
- emit DependencyScriptUpdated(_dependencyType);
231
+ emit DependencyScriptUpdated(dependencyNameAndVersion);
230
232
  }
231
233
 
232
234
  /**
233
- * @notice Updates script for dependencyType `_dependencyType` at script `_index`,
235
+ * @notice Updates script for dependencyType `dependencyNameAndVersion` at script `index`,
234
236
  * by way of providing a string to write to bytecode storage.
235
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
236
- * @param _index The index of a given script, relative to the overall `scriptCount`.
237
- * @param _script The updated script value. Required to be a non-empty
237
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
238
+ * @param index The index of a given script, relative to the overall `scriptCount`.
239
+ * @param script The updated script value. Required to be a non-empty
238
240
  * string, but no further validation is performed.
239
241
  */
240
242
  function updateDependencyScript(
241
- bytes32 _dependencyType,
242
- uint256 _index,
243
- string memory _script
243
+ bytes32 dependencyNameAndVersion,
244
+ uint256 index,
245
+ string memory script
244
246
  ) external {
245
247
  _onlyAdminACL(this.updateDependencyScript.selector);
246
- _onlyNonEmptyString(_script);
247
- _onlyExistingDependencyType(_dependencyType);
248
- Dependency storage dependency = dependencyDetails[_dependencyType];
249
- _onlyInRangeIndex({_index: _index, _length: dependency.scriptCount});
248
+ _onlyNonEmptyString(script);
249
+ _onlyExistingDependency(dependencyNameAndVersion);
250
+
251
+ DependencyRegistryStorageLib.Dependency
252
+ storage dependency = DependencyRegistryStorageLib
253
+ .s()
254
+ .dependencyRecords[dependencyNameAndVersion];
255
+ _onlyInRangeIndex({index: index, length: dependency.scriptCount});
250
256
  // store script in contract bytecode, replacing reference address from
251
257
  // the contract that no longer exists with the newly created one
252
- dependency.scriptBytecodeAddresses[_index] = _script.writeToBytecode();
258
+ dependency.scriptBytecodeAddresses[index] = script.writeToBytecode();
253
259
 
254
- emit DependencyScriptUpdated(_dependencyType);
260
+ emit DependencyScriptUpdated(dependencyNameAndVersion);
255
261
  }
256
262
 
257
263
  /**
258
- * @notice Adds a script to dependency `_dependencyType`, by way of
264
+ * @notice Adds a script to dependency `dependencyNameAndVersion`, by way of
259
265
  * providing an already written chunk of bytecode storage.
260
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
261
- * @param _scriptPointer Address of script to be added. Required to be a non-zero address,
266
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
267
+ * @param scriptPointer Address of script to be added. Required to be a non-zero address,
262
268
  * but no further validation is performed.
263
269
  */
264
270
  function addDependencyScriptPointer(
265
- bytes32 _dependencyType,
266
- address _scriptPointer
271
+ bytes32 dependencyNameAndVersion,
272
+ address scriptPointer
267
273
  ) external {
268
274
  _onlyAdminACL(this.addDependencyScriptPointer.selector);
269
- _onlyNonZeroAddress(_scriptPointer);
270
- _onlyExistingDependencyType(_dependencyType);
271
- Dependency storage dependency = dependencyDetails[_dependencyType];
275
+ _onlyNonZeroAddress(scriptPointer);
276
+ _onlyExistingDependency(dependencyNameAndVersion);
277
+
278
+ DependencyRegistryStorageLib.Dependency
279
+ storage dependency = DependencyRegistryStorageLib
280
+ .s()
281
+ .dependencyRecords[dependencyNameAndVersion];
272
282
  // store script in contract bytecode
273
283
  dependency.scriptBytecodeAddresses[
274
284
  dependency.scriptCount
275
- ] = _scriptPointer;
285
+ ] = scriptPointer;
276
286
  dependency.scriptCount = dependency.scriptCount + 1;
277
287
 
278
- emit DependencyScriptUpdated(_dependencyType);
288
+ emit DependencyScriptUpdated(dependencyNameAndVersion);
279
289
  }
280
290
 
281
291
  /**
282
- * @notice Updates script for dependencyType `_dependencyType` at script `_index`,
292
+ * @notice Updates script for dependency id `dependencyNameAndVersion` at script `index`,
283
293
  * by way of providing an already written chunk of bytecode storage.
284
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
285
- * @param _index The index of a given script, relative to the overall `scriptCount`.
286
- * @param _scriptPointer The updated script pointer (address of bytecode storage).
294
+ * @param dependencyNameAndVersion Name of dependency (i.e. "name@version") used to identify dependency.
295
+ * @param index The index of a given script, relative to the overall `scriptCount`.
296
+ * @param scriptPointer The updated script pointer (address of bytecode storage).
287
297
  * Required to be a non-zero address, but no further validation is performed.
288
298
  */
289
299
  function updateDependencyScriptPointer(
290
- bytes32 _dependencyType,
291
- uint256 _index,
292
- address _scriptPointer
300
+ bytes32 dependencyNameAndVersion,
301
+ uint256 index,
302
+ address scriptPointer
293
303
  ) external {
294
304
  _onlyAdminACL(this.updateDependencyScriptPointer.selector);
295
- _onlyNonZeroAddress(_scriptPointer);
296
- _onlyExistingDependencyType(_dependencyType);
297
- Dependency storage dependency = dependencyDetails[_dependencyType];
298
- _onlyInRangeIndex({_index: _index, _length: dependency.scriptCount});
299
- dependency.scriptBytecodeAddresses[_index] = _scriptPointer;
305
+ _onlyNonZeroAddress(scriptPointer);
306
+ _onlyExistingDependency(dependencyNameAndVersion);
307
+
308
+ DependencyRegistryStorageLib.Dependency
309
+ storage dependency = DependencyRegistryStorageLib
310
+ .s()
311
+ .dependencyRecords[dependencyNameAndVersion];
312
+ _onlyInRangeIndex({index: index, length: dependency.scriptCount});
313
+ dependency.scriptBytecodeAddresses[index] = scriptPointer;
300
314
 
301
- emit DependencyScriptUpdated(_dependencyType);
315
+ emit DependencyScriptUpdated(dependencyNameAndVersion);
302
316
  }
303
317
 
304
318
  /**
305
- * @notice Removes last script from dependency `_dependencyType`.
306
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
319
+ * @notice Removes last script from dependency `dependencyNameAndVersion`.
320
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
307
321
  */
308
- function removeDependencyLastScript(bytes32 _dependencyType) external {
322
+ function removeDependencyLastScript(
323
+ bytes32 dependencyNameAndVersion
324
+ ) external {
309
325
  _onlyAdminACL(this.removeDependencyLastScript.selector);
310
- _onlyExistingDependencyType(_dependencyType);
311
- Dependency storage dependency = dependencyDetails[_dependencyType];
326
+ _onlyExistingDependency(dependencyNameAndVersion);
327
+
328
+ DependencyRegistryStorageLib.Dependency
329
+ storage dependency = DependencyRegistryStorageLib
330
+ .s()
331
+ .dependencyRecords[dependencyNameAndVersion];
312
332
  require(dependency.scriptCount > 0, "there are no scripts to remove");
313
333
  // delete reference to old storage contract address
314
334
  delete dependency.scriptBytecodeAddresses[dependency.scriptCount - 1];
@@ -316,365 +336,438 @@ contract DependencyRegistryV0 is
316
336
  dependency.scriptCount = dependency.scriptCount - 1;
317
337
  }
318
338
 
319
- emit DependencyScriptUpdated(_dependencyType);
339
+ emit DependencyScriptUpdated(dependencyNameAndVersion);
320
340
  }
321
341
 
322
342
  /**
323
- * @notice Updates preferred CDN for dependency `_dependencyType`.
324
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
325
- * @param _preferredCDN URL for preferred CDN.
343
+ * @notice Updates preferred CDN for dependency `dependencyNameAndVersion`.
344
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
345
+ * @param preferredCDN URL for preferred CDN.
326
346
  */
327
347
  function updateDependencyPreferredCDN(
328
- bytes32 _dependencyType,
329
- string memory _preferredCDN
348
+ bytes32 dependencyNameAndVersion,
349
+ string memory preferredCDN
330
350
  ) external {
331
351
  _onlyAdminACL(this.updateDependencyPreferredCDN.selector);
332
- _onlyExistingDependencyType(_dependencyType);
333
- dependencyDetails[_dependencyType].preferredCDN = _preferredCDN;
352
+ _onlyExistingDependency(dependencyNameAndVersion);
334
353
 
335
- emit DependencyPreferredCDNUpdated(_dependencyType, _preferredCDN);
354
+ DependencyRegistryStorageLib
355
+ .s()
356
+ .dependencyRecords[dependencyNameAndVersion]
357
+ .preferredCDN = preferredCDN;
358
+
359
+ emit DependencyPreferredCDNUpdated(
360
+ dependencyNameAndVersion,
361
+ preferredCDN
362
+ );
336
363
  }
337
364
 
338
365
  /**
339
- * @notice Updates preferred repository for dependency `_dependencyType`.
340
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
341
- * @param _preferredRepository URL for preferred repository.
366
+ * @notice Updates preferred repository for dependency `dependencyNameAndVersion`.
367
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
368
+ * @param preferredRepository URL for preferred repository.
342
369
  */
343
370
  function updateDependencyPreferredRepository(
344
- bytes32 _dependencyType,
345
- string memory _preferredRepository
371
+ bytes32 dependencyNameAndVersion,
372
+ string memory preferredRepository
346
373
  ) external {
347
374
  _onlyAdminACL(this.updateDependencyPreferredRepository.selector);
348
- _onlyExistingDependencyType(_dependencyType);
349
- dependencyDetails[_dependencyType]
350
- .preferredRepository = _preferredRepository;
375
+ _onlyExistingDependency(dependencyNameAndVersion);
376
+
377
+ DependencyRegistryStorageLib
378
+ .s()
379
+ .dependencyRecords[dependencyNameAndVersion]
380
+ .preferredRepository = preferredRepository;
351
381
 
352
382
  emit DependencyPreferredRepositoryUpdated(
353
- _dependencyType,
354
- _preferredRepository
383
+ dependencyNameAndVersion,
384
+ preferredRepository
355
385
  );
356
386
  }
357
387
 
358
388
  /**
359
- * @notice Updates project website for dependency `_dependencyType`.
360
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
361
- * @param _referenceWebsite URL for project website.
389
+ * @notice Updates project website for dependency `dependencyNameAndVersion`.
390
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
391
+ * @param dependencyWebsite URL for project website.
362
392
  */
363
- function updateDependencyReferenceWebsite(
364
- bytes32 _dependencyType,
365
- string memory _referenceWebsite
393
+ function updateDependencyWebsite(
394
+ bytes32 dependencyNameAndVersion,
395
+ string memory dependencyWebsite
366
396
  ) external {
367
- _onlyAdminACL(this.updateDependencyReferenceWebsite.selector);
368
- _onlyExistingDependencyType(_dependencyType);
369
- dependencyDetails[_dependencyType].referenceWebsite = _referenceWebsite;
397
+ _onlyAdminACL(this.updateDependencyWebsite.selector);
398
+ _onlyExistingDependency(dependencyNameAndVersion);
399
+
400
+ DependencyRegistryStorageLib
401
+ .s()
402
+ .dependencyRecords[dependencyNameAndVersion]
403
+ .website = dependencyWebsite;
370
404
 
371
- emit DependencyReferenceWebsiteUpdated(
372
- _dependencyType,
373
- _referenceWebsite
405
+ emit DependencyWebsiteUpdated(
406
+ dependencyNameAndVersion,
407
+ dependencyWebsite
374
408
  );
375
409
  }
376
410
 
377
411
  /**
378
- * @notice Adds a new CDN url to `_dependencyType`.
379
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
380
- * @param _additionalCDN CDN URL to be added. Required to be a non-empty string,
412
+ * @notice Adds a new CDN url to `dependencyNameAndVersion`.
413
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
414
+ * @param additionalCDN CDN URL to be added. Required to be a non-empty string,
381
415
  * but no further validation is performed.
382
416
  */
383
417
  function addDependencyAdditionalCDN(
384
- bytes32 _dependencyType,
385
- string memory _additionalCDN
418
+ bytes32 dependencyNameAndVersion,
419
+ string memory additionalCDN
386
420
  ) external {
387
421
  _onlyAdminACL(this.addDependencyAdditionalCDN.selector);
388
- _onlyNonEmptyString(_additionalCDN);
389
- _onlyExistingDependencyType(_dependencyType);
390
- Dependency storage dependency = dependencyDetails[_dependencyType];
422
+ _onlyNonEmptyString(additionalCDN);
423
+ _onlyExistingDependency(dependencyNameAndVersion);
424
+
425
+ DependencyRegistryStorageLib.Dependency
426
+ storage dependency = DependencyRegistryStorageLib
427
+ .s()
428
+ .dependencyRecords[dependencyNameAndVersion];
391
429
 
392
430
  uint256 additionalCDNCount = uint256(dependency.additionalCDNCount);
393
- dependency.additionalCDNs[additionalCDNCount] = _additionalCDN;
431
+ dependency.additionalCDNs[additionalCDNCount] = additionalCDN;
394
432
  dependency.additionalCDNCount = uint24(additionalCDNCount + 1);
395
433
 
396
434
  emit DependencyAdditionalCDNUpdated(
397
- _dependencyType,
398
- _additionalCDN,
435
+ dependencyNameAndVersion,
436
+ additionalCDN,
399
437
  additionalCDNCount
400
438
  );
401
439
  }
402
440
 
403
441
  /**
404
- * @notice Removes additional CDN for dependency `_dependencyId` at index `_index`.
442
+ * @notice Removes additional CDN for dependency `_dependencyId` at index `index`.
405
443
  * Removal is done by swapping the element to be removed with the last element in the array, then deleting this last element.
406
- * Assets with indices higher than `_index` can have their indices adjusted as a result of this operation.
407
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
408
- * @param _index The index of an additional CDN, relative to the overall `additionalCDNCount`.
444
+ * Assets with indices higher than `index` can have their indices adjusted as a result of this operation.
445
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
446
+ * @param index The index of an additional CDN, relative to the overall `additionalCDNCount`.
409
447
  */
410
448
  function removeDependencyAdditionalCDN(
411
- bytes32 _dependencyType,
412
- uint256 _index
449
+ bytes32 dependencyNameAndVersion,
450
+ uint256 index
413
451
  ) external {
414
452
  _onlyAdminACL(this.removeDependencyAdditionalCDN.selector);
415
- _onlyExistingDependencyType(_dependencyType);
416
- Dependency storage dependency = dependencyDetails[_dependencyType];
453
+ _onlyExistingDependency(dependencyNameAndVersion);
454
+
455
+ DependencyRegistryStorageLib.Dependency
456
+ storage dependency = DependencyRegistryStorageLib
457
+ .s()
458
+ .dependencyRecords[dependencyNameAndVersion];
417
459
 
418
460
  uint256 additionalCDNCount = dependency.additionalCDNCount;
419
- _onlyInRangeIndex({_index: _index, _length: additionalCDNCount});
461
+ _onlyInRangeIndex({index: index, length: additionalCDNCount});
420
462
 
421
463
  uint256 lastElementIndex = additionalCDNCount - 1;
422
464
 
423
- dependency.additionalCDNs[_index] = dependency.additionalCDNs[
465
+ dependency.additionalCDNs[index] = dependency.additionalCDNs[
424
466
  lastElementIndex
425
467
  ];
426
468
  delete dependency.additionalCDNs[lastElementIndex];
427
469
 
428
470
  dependency.additionalCDNCount = uint24(lastElementIndex);
429
471
 
430
- emit DependencyAdditionalCDNRemoved(_dependencyType, _index);
472
+ emit DependencyAdditionalCDNRemoved(dependencyNameAndVersion, index);
431
473
  }
432
474
 
433
475
  /**
434
- * @notice Updates additional CDN for dependency `_dependencyType` at `_index`.
435
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
436
- * @param _index The index of an additional CDN, relative to the overall `additionalCDNCount`.
437
- * @param _additionalCDN New CDN URL.
476
+ * @notice Updates additional CDN for dependency `dependencyNameAndVersion` at `index`.
477
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
478
+ * @param index The index of an additional CDN, relative to the overall `additionalCDNCount`.
479
+ * @param additionalCDN New CDN URL.
438
480
  */
439
481
  function updateDependencyAdditionalCDN(
440
- bytes32 _dependencyType,
441
- uint256 _index,
442
- string memory _additionalCDN
482
+ bytes32 dependencyNameAndVersion,
483
+ uint256 index,
484
+ string memory additionalCDN
443
485
  ) external {
444
486
  _onlyAdminACL(this.updateDependencyAdditionalCDN.selector);
445
- _onlyNonEmptyString(_additionalCDN);
446
- _onlyExistingDependencyType(_dependencyType);
447
- Dependency storage dependency = dependencyDetails[_dependencyType];
487
+ _onlyNonEmptyString(additionalCDN);
488
+ _onlyExistingDependency(dependencyNameAndVersion);
489
+
490
+ DependencyRegistryStorageLib.Dependency
491
+ storage dependency = DependencyRegistryStorageLib
492
+ .s()
493
+ .dependencyRecords[dependencyNameAndVersion];
448
494
  _onlyInRangeIndex({
449
- _index: _index,
450
- _length: dependency.additionalCDNCount
495
+ index: index,
496
+ length: dependency.additionalCDNCount
451
497
  });
452
498
 
453
- dependency.additionalCDNs[_index] = _additionalCDN;
499
+ dependency.additionalCDNs[index] = additionalCDN;
454
500
 
455
501
  emit DependencyAdditionalCDNUpdated(
456
- _dependencyType,
457
- _additionalCDN,
458
- _index
502
+ dependencyNameAndVersion,
503
+ additionalCDN,
504
+ index
459
505
  );
460
506
  }
461
507
 
462
508
  /**
463
- * @notice Adds a new repository URL to dependency `_dependencyType`.
464
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
465
- * @param _additionalRepository Repository URL to be added. Required to be a non-empty string,
509
+ * @notice Adds a new repository URL to dependency `dependencyNameAndVersion`.
510
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
511
+ * @param additionalRepository Repository URL to be added. Required to be a non-empty string,
466
512
  * but no further validation is performed.
467
513
  */
468
514
  function addDependencyAdditionalRepository(
469
- bytes32 _dependencyType,
470
- string memory _additionalRepository
515
+ bytes32 dependencyNameAndVersion,
516
+ string memory additionalRepository
471
517
  ) external {
472
518
  _onlyAdminACL(this.addDependencyAdditionalRepository.selector);
473
- _onlyNonEmptyString(_additionalRepository);
474
- _onlyExistingDependencyType(_dependencyType);
475
- Dependency storage dependency = dependencyDetails[_dependencyType];
519
+ _onlyNonEmptyString(additionalRepository);
520
+ _onlyExistingDependency(dependencyNameAndVersion);
521
+
522
+ DependencyRegistryStorageLib.Dependency
523
+ storage dependency = DependencyRegistryStorageLib
524
+ .s()
525
+ .dependencyRecords[dependencyNameAndVersion];
476
526
  uint256 additionalRepositoryCount = uint256(
477
527
  dependency.additionalRepositoryCount
478
528
  );
479
529
  dependency.additionalRepositories[
480
530
  additionalRepositoryCount
481
- ] = _additionalRepository;
531
+ ] = additionalRepository;
482
532
  dependency.additionalRepositoryCount = uint24(
483
533
  additionalRepositoryCount + 1
484
534
  );
485
535
 
486
536
  emit DependencyAdditionalRepositoryUpdated(
487
- _dependencyType,
488
- _additionalRepository,
537
+ dependencyNameAndVersion,
538
+ additionalRepository,
489
539
  additionalRepositoryCount
490
540
  );
491
541
  }
492
542
 
493
543
  /**
494
- * @notice Removes additional repository for depenency `_dependencyId` at index `_index`.
544
+ * @notice Removes additional repository for depenency `_dependencyId` at index `index`.
495
545
  * Removal is done by swapping the element to be removed with the last element in the array, then deleting this last element.
496
- * Assets with indices higher than `_index` can have their indices adjusted as a result of this operation.
497
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
498
- * @param _index The index of an additional repository, relative to the overall `additionalRepositoryCount`.
546
+ * Assets with indices higher than `index` can have their indices adjusted as a result of this operation.
547
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
548
+ * @param index The index of an additional repository, relative to the overall `additionalRepositoryCount`.
499
549
  */
500
550
  function removeDependencyAdditionalRepository(
501
- bytes32 _dependencyType,
502
- uint256 _index
551
+ bytes32 dependencyNameAndVersion,
552
+ uint256 index
503
553
  ) external {
504
554
  _onlyAdminACL(this.removeDependencyAdditionalRepository.selector);
505
- _onlyExistingDependencyType(_dependencyType);
506
- Dependency storage dependency = dependencyDetails[_dependencyType];
555
+ _onlyExistingDependency(dependencyNameAndVersion);
556
+
557
+ DependencyRegistryStorageLib.Storage
558
+ storage ds = DependencyRegistryStorageLib.s();
559
+
560
+ DependencyRegistryStorageLib.Dependency storage dependency = ds
561
+ .dependencyRecords[dependencyNameAndVersion];
507
562
  uint256 additionalRepositoryCount = dependency
508
563
  .additionalRepositoryCount;
509
- _onlyInRangeIndex({_index: _index, _length: additionalRepositoryCount});
564
+ _onlyInRangeIndex({index: index, length: additionalRepositoryCount});
510
565
 
511
566
  uint256 lastElementIndex = additionalRepositoryCount - 1;
512
567
 
513
- dependency.additionalRepositories[_index] = dependencyDetails[
514
- _dependencyType
515
- ].additionalRepositories[lastElementIndex];
568
+ dependency.additionalRepositories[index] = ds
569
+ .dependencyRecords[dependencyNameAndVersion]
570
+ .additionalRepositories[lastElementIndex];
516
571
  delete dependency.additionalRepositories[lastElementIndex];
517
572
 
518
573
  dependency.additionalRepositoryCount = uint24(lastElementIndex);
519
574
 
520
- emit DependencyAdditionalRepositoryRemoved(_dependencyType, _index);
575
+ emit DependencyAdditionalRepositoryRemoved(
576
+ dependencyNameAndVersion,
577
+ index
578
+ );
521
579
  }
522
580
 
523
581
  /**
524
- * @notice Updates additional repository for dependency `_dependencyType` at `_index`.
525
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
526
- * @param _index The index of an additional repository, relative to the overall `additionalRepositoryCount`.
527
- * @param _additionalRepository New Repository URL.
582
+ * @notice Updates additional repository for dependency `dependencyNameAndVersion` at `index`.
583
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
584
+ * @param index The index of an additional repository, relative to the overall `additionalRepositoryCount`.
585
+ * @param additionalRepository New Repository URL.
528
586
  */
529
587
  function updateDependencyAdditionalRepository(
530
- bytes32 _dependencyType,
531
- uint256 _index,
532
- string memory _additionalRepository
588
+ bytes32 dependencyNameAndVersion,
589
+ uint256 index,
590
+ string memory additionalRepository
533
591
  ) external {
534
592
  _onlyAdminACL(this.updateDependencyAdditionalRepository.selector);
535
- _onlyNonEmptyString(_additionalRepository);
536
- _onlyExistingDependencyType(_dependencyType);
537
- Dependency storage dependency = dependencyDetails[_dependencyType];
593
+ _onlyNonEmptyString(additionalRepository);
594
+ _onlyExistingDependency(dependencyNameAndVersion);
595
+
596
+ DependencyRegistryStorageLib.Dependency
597
+ storage dependency = DependencyRegistryStorageLib
598
+ .s()
599
+ .dependencyRecords[dependencyNameAndVersion];
538
600
  _onlyInRangeIndex({
539
- _index: _index,
540
- _length: dependency.additionalRepositoryCount
601
+ index: index,
602
+ length: dependency.additionalRepositoryCount
541
603
  });
542
604
 
543
- dependency.additionalRepositories[_index] = _additionalRepository;
605
+ dependency.additionalRepositories[index] = additionalRepository;
544
606
 
545
607
  emit DependencyAdditionalRepositoryUpdated(
546
- _dependencyType,
547
- _additionalRepository,
548
- _index
608
+ dependencyNameAndVersion,
609
+ additionalRepository,
610
+ index
549
611
  );
550
612
  }
551
613
 
552
614
  /**
553
615
  * @notice Adds a new core contract to the list of supported core contracts.
554
- * @param _contractAddress Address of the core contract to be added.
616
+ * @param contractAddress Address of the core contract to be added.
555
617
  */
556
- function addSupportedCoreContract(address _contractAddress) external {
618
+ function addSupportedCoreContract(address contractAddress) external {
557
619
  _onlyAdminACL(this.addSupportedCoreContract.selector);
558
- _onlyNonZeroAddress(_contractAddress);
620
+ _onlyNonZeroAddress(contractAddress);
621
+
559
622
  require(
560
623
  // @dev the add function returns false if set already contains value
561
- _supportedCoreContracts.add(_contractAddress),
624
+ DependencyRegistryStorageLib.s().supportedCoreContracts.add(
625
+ contractAddress
626
+ ),
562
627
  "Contract already supported"
563
628
  );
564
- emit SupportedCoreContractAdded(_contractAddress);
629
+ emit SupportedCoreContractAdded(contractAddress);
565
630
  }
566
631
 
567
632
  /**
568
633
  * @notice Removes a core contract from the list of supported core contracts.
569
- * @param _contractAddress Address of the core contract to be removed.
634
+ * @param contractAddress Address of the core contract to be removed.
570
635
  */
571
- function removeSupportedCoreContract(address _contractAddress) external {
636
+ function removeSupportedCoreContract(address contractAddress) external {
572
637
  _onlyAdminACL(this.removeSupportedCoreContract.selector);
573
638
  require(
574
639
  // @dev the remove function returns false if set does not contain value
575
- _supportedCoreContracts.remove(_contractAddress),
640
+ DependencyRegistryStorageLib.s().supportedCoreContracts.remove(
641
+ contractAddress
642
+ ),
576
643
  "Core contract already removed or not in set"
577
644
  );
578
- emit SupportedCoreContractRemoved(_contractAddress);
645
+ emit SupportedCoreContractRemoved(contractAddress);
579
646
  }
580
647
 
581
648
  /**
582
649
  * @notice Overrides the script type and version that
583
650
  * would be returned by the core contract (`_contractAddress`)
584
651
  * for a given project (`projectId`) with the given dependency
585
- * type (`_dependencyType`).
586
- * @param _contractAddress Core contract address.
587
- * @param _projectId Project to override script type and version for.
588
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
589
- */
590
- function addProjectDependencyTypeOverride(
591
- address _contractAddress,
592
- uint256 _projectId,
593
- bytes32 _dependencyType
652
+ * name and version (`dependencyNameAndVersion`).
653
+ * @param contractAddress Core contract address.
654
+ * @param projectId Project to override script type and version for.
655
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "type`@`version") used to identify dependency.
656
+ */
657
+ function addProjectDependencyOverride(
658
+ address contractAddress,
659
+ uint256 projectId,
660
+ bytes32 dependencyNameAndVersion
594
661
  ) external {
595
- _onlyAdminACL(this.addProjectDependencyTypeOverride.selector);
596
- _onlyExistingDependencyType(_dependencyType);
597
- _onlySupportedCoreContract(_contractAddress);
598
- projectDependencyTypeOverrides[_contractAddress][
599
- _projectId
600
- ] = _dependencyType;
601
-
602
- emit ProjectDependencyTypeOverrideAdded(
603
- _contractAddress,
604
- _projectId,
605
- _dependencyType
662
+ _onlyAdminACL(this.addProjectDependencyOverride.selector);
663
+ _onlyExistingDependency(dependencyNameAndVersion);
664
+ _onlySupportedCoreContract(contractAddress);
665
+
666
+ DependencyRegistryStorageLib.s().projectDependencyOverrides[
667
+ contractAddress
668
+ ][projectId] = dependencyNameAndVersion;
669
+
670
+ emit ProjectDependencyOverrideAdded(
671
+ contractAddress,
672
+ projectId,
673
+ dependencyNameAndVersion
606
674
  );
607
675
  }
608
676
 
609
677
  /**
610
678
  * @notice Removes the script type and version override for a given
611
679
  * project (`projectId`) on a given core contract (`_contractAddress`).
612
- * @param _contractAddress Core contract address.
613
- * @param _projectId Project to remove override for.
680
+ * @param contractAddress Core contract address.
681
+ * @param projectId Project to remove override for.
614
682
  */
615
- function removeProjectDependencyTypeOverride(
616
- address _contractAddress,
617
- uint256 _projectId
683
+ function removeProjectDependencyOverride(
684
+ address contractAddress,
685
+ uint256 projectId
618
686
  ) external {
619
- _onlyAdminACL(this.removeProjectDependencyTypeOverride.selector);
687
+ _onlyAdminACL(this.removeProjectDependencyOverride.selector);
688
+
689
+ DependencyRegistryStorageLib.Storage
690
+ storage ds = DependencyRegistryStorageLib.s();
691
+
620
692
  require(
621
- projectDependencyTypeOverrides[_contractAddress][_projectId] !=
693
+ ds.projectDependencyOverrides[contractAddress][projectId] !=
622
694
  bytes32(""),
623
695
  "No override set for project"
624
696
  );
625
697
 
626
- delete projectDependencyTypeOverrides[_contractAddress][_projectId];
698
+ delete ds.projectDependencyOverrides[contractAddress][projectId];
627
699
 
628
- emit ProjectDependencyTypeOverrideRemoved(_contractAddress, _projectId);
700
+ emit ProjectDependencyOverrideRemoved(contractAddress, projectId);
629
701
  }
630
702
 
631
703
  /**
632
- * @notice Returns a list of registered depenency types.
633
- * @return List of registered depenency types.
634
- * @dev This is only intended to be called outside of block
635
- * execution where there is no gas limit.
704
+ * @notice Returns an array of strings representing all registered dependencies in the contract.
705
+ * Each string is a combination of the dependency's name and version
706
+ * @dev This function is designed to be called outside of block execution where there is no gas limit,
707
+ * as it may consume a large amount of gas when there are many registered dependencies.
708
+ * @return A string array where each element is a registered dependency in the format "name@version".
636
709
  */
637
- function getDependencyTypes() external view returns (string[] memory) {
638
- uint256 numDependencyTypes = _dependencyTypes.length();
639
- string[] memory dependencyTypes = new string[](numDependencyTypes);
710
+ function getDependencyNamesAndVersions()
711
+ external
712
+ view
713
+ returns (string[] memory)
714
+ {
715
+ DependencyRegistryStorageLib.Storage
716
+ storage ds = DependencyRegistryStorageLib.s();
640
717
 
641
- for (uint256 i = 0; i < numDependencyTypes; i++) {
642
- dependencyTypes[i] = _dependencyTypes.at(i).toString();
718
+ uint256 numDependencies = ds.dependencyNameVersionIds.length();
719
+ string[] memory dependencyTypes = new string[](numDependencies);
720
+
721
+ for (uint256 i = 0; i < numDependencies; i++) {
722
+ dependencyTypes[i] = ds.dependencyNameVersionIds.at(i).toString();
643
723
  }
644
724
  return dependencyTypes;
645
725
  }
646
726
 
647
727
  /**
648
- * @notice Returns number of registered dependency types
728
+ * @notice Returns number of registered dependencies
649
729
  * @return Number of registered dependencies.
650
730
  */
651
- function getDependencyTypeCount() external view returns (uint256) {
652
- return _dependencyTypes.length();
731
+ function getDependencyCount() external view returns (uint256) {
732
+ return
733
+ DependencyRegistryStorageLib.s().dependencyNameVersionIds.length();
653
734
  }
654
735
 
655
736
  /**
656
- * @notice Returns registered depenedency type at index `_index`.
657
- * @return Registered dependency at `_index`, relative to the overall length of the dependency type set.
737
+ * @notice Returns registered depenedency name and version at index `index`.
738
+ * @return Registered dependency at `index`, relative to the overall length of the dependency type set.
658
739
  */
659
- function getDependencyType(
660
- uint256 _index
740
+ function getDependencyNameAndVersion(
741
+ uint256 index
661
742
  ) external view returns (string memory) {
662
- _onlyInRangeIndex({_index: _index, _length: _dependencyTypes.length()});
663
- return _dependencyTypes.at(_index).toString();
743
+ DependencyRegistryStorageLib.Storage
744
+ storage ds = DependencyRegistryStorageLib.s();
745
+
746
+ _onlyInRangeIndex({
747
+ index: index,
748
+ length: ds.dependencyNameVersionIds.length()
749
+ });
750
+ return ds.dependencyNameVersionIds.at(index).toString();
664
751
  }
665
752
 
666
753
  /**
667
- * @notice Returns number of registered license types
668
- * @return Number of registered license types.
754
+ * @notice Returns array of registered license types
755
+ * @return Array of registered license types.
669
756
  * @dev This is only intended to be called outside of block
670
757
  * execution where there is no gas limit.
671
758
  */
672
759
  function getLicenseTypes() external view returns (string[] memory) {
673
- uint256 numLicenseTypes = _licenseTypes.length();
760
+ DependencyRegistryStorageLib.Storage
761
+ storage ds = DependencyRegistryStorageLib.s();
762
+
763
+ uint256 numLicenseTypes = ds.licenseTypes.length();
674
764
  string[] memory licenseTypes = new string[](numLicenseTypes);
675
765
 
676
- for (uint256 i = 0; i < numLicenseTypes; i++) {
677
- licenseTypes[i] = _licenseTypes.at(i).toString();
766
+ for (uint256 i; i < numLicenseTypes; ) {
767
+ licenseTypes[i] = ds.licenseTypes.at(i).toString();
768
+ unchecked {
769
+ ++i;
770
+ }
678
771
  }
679
772
  return licenseTypes;
680
773
  }
@@ -684,61 +777,202 @@ contract DependencyRegistryV0 is
684
777
  * @return Number of registered license types.
685
778
  */
686
779
  function getLicenseTypeCount() external view returns (uint256) {
687
- return _licenseTypes.length();
780
+ return DependencyRegistryStorageLib.s().licenseTypes.length();
688
781
  }
689
782
 
690
783
  /**
691
- * @notice Returns registered license type at index `_index`.
692
- * @return Registered license type at `_index`, relative to the overall length of the license type set.
784
+ * @notice Returns registered license type at index `index`.
785
+ * @return Registered license type at `index`, relative to the overall length of the license type set.
693
786
  */
694
787
  function getLicenseType(
695
- uint256 _index
788
+ uint256 index
696
789
  ) external view returns (string memory) {
697
- _onlyInRangeIndex({_index: _index, _length: _licenseTypes.length()});
698
- return _licenseTypes.at(_index).toString();
790
+ DependencyRegistryStorageLib.Storage
791
+ storage ds = DependencyRegistryStorageLib.s();
792
+
793
+ _onlyInRangeIndex({index: index, length: ds.licenseTypes.length()});
794
+ return ds.licenseTypes.at(index).toString();
795
+ }
796
+
797
+ /**
798
+ * @notice Adds a full license text to license `licenseType`, by way of
799
+ * providing a string to write to bytecode storage.
800
+ * @param licenseType Name of license type (e.g. "MIT") used to identify license.
801
+ * @param text Text to be added. Required to be a non-empty string,
802
+ * but no further validation is performed.
803
+ */
804
+ function addLicenseText(bytes32 licenseType, string memory text) external {
805
+ _onlyAdminACL(this.addLicenseText.selector);
806
+ _onlyNonEmptyString(text);
807
+ _onlyExistingLicenseType(licenseType);
808
+
809
+ DependencyRegistryStorageLib.License
810
+ storage licenseEntry = DependencyRegistryStorageLib.s().allLicenses[
811
+ licenseType
812
+ ];
813
+ // store license chunk in contract bytecode
814
+ licenseEntry.licenseBytecodeAddresses[
815
+ licenseEntry.licenseChunkCount
816
+ ] = text.writeToBytecode();
817
+ licenseEntry.licenseChunkCount = licenseEntry.licenseChunkCount + 1;
818
+
819
+ emit LicenseTextUpdated(licenseType);
699
820
  }
700
821
 
701
822
  /**
702
- * @notice Returns details for a given depedency type `_dependencyType`.
703
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
704
- * @return typeAndVersion String representation of `_dependencyType`.
823
+ * @notice Updates the license text for license `licenseType` at index `_index`,
824
+ * by way of providing a string to write to bytecode storage.
825
+ * @param licenseType Name of license type (e.g. "MIT") used to identify license.
826
+ * @param index The index of a given license text chunk, relative to the overall `licenseChunkCount`.
827
+ * @param text The updated license text value. Required to be a non-empty
828
+ * string, but no further validation is performed.
829
+ */
830
+ function updateLicenseText(
831
+ bytes32 licenseType,
832
+ uint256 index,
833
+ string memory text
834
+ ) external {
835
+ _onlyAdminACL(this.updateLicenseText.selector);
836
+ _onlyNonEmptyString(text);
837
+ _onlyExistingLicenseType(licenseType);
838
+
839
+ DependencyRegistryStorageLib.License
840
+ storage licenseEntry = DependencyRegistryStorageLib.s().allLicenses[
841
+ licenseType
842
+ ];
843
+ _onlyInRangeIndex({
844
+ index: index,
845
+ length: licenseEntry.licenseChunkCount
846
+ });
847
+ // store license text chunk in contract bytecode, replacing reference address from
848
+ // the contract that is no longer referenced with the newly created one
849
+ licenseEntry.licenseBytecodeAddresses[index] = text.writeToBytecode();
850
+
851
+ emit LicenseTextUpdated(licenseType);
852
+ }
853
+
854
+ /**
855
+ * @notice Removes the last license text chunk from license `licenseType`.
856
+ * @param licenseType Name of license type (e.g. "MIT") used to identify license.
857
+ */
858
+ function removeLicenseLastText(bytes32 licenseType) external {
859
+ _onlyAdminACL(this.removeLicenseLastText.selector);
860
+ _onlyExistingLicenseType(licenseType);
861
+
862
+ DependencyRegistryStorageLib.License
863
+ storage licenseEntry = DependencyRegistryStorageLib.s().allLicenses[
864
+ licenseType
865
+ ];
866
+ uint24 licenseChunkCount = licenseEntry.licenseChunkCount;
867
+ require(licenseChunkCount > 0, "There is no license text to remove");
868
+ // delete reference to old storage contract address
869
+ delete licenseEntry.licenseBytecodeAddresses[licenseChunkCount - 1];
870
+ unchecked {
871
+ licenseEntry.licenseChunkCount = licenseChunkCount - 1;
872
+ }
873
+
874
+ emit LicenseTextUpdated(licenseType);
875
+ }
876
+
877
+ /**
878
+ * @notice Returns license text for license `licenseType` at script index `index`.
879
+ * @param licenseType Name of license type (e.g. "MIT") used to identify license.
880
+ * @param index The index of a given script, relative to the overall `licenseChunkCount`.
881
+ * @return A string containing the license text content at the given script chunk index for a given license.
882
+ * @dev This method attempts to introspectively determine which library version of
883
+ * `BytecodeStorage` was used to write the stored script string that is being
884
+ * read back, in order to use the proper read approach. If the version is
885
+ * non-determinate, a fall-back to reading using the assumption that the bytes
886
+ * were written with `SSTORE2` is used.
887
+ * Also note that in this `SSTORE2` fallback handling, the approach of casting bytes to string
888
+ * can cause failure (e.g. unexpected continuation byte).
889
+ */
890
+ function getLicenseText(
891
+ bytes32 licenseType,
892
+ uint256 index
893
+ ) external view returns (string memory) {
894
+ DependencyRegistryStorageLib.License
895
+ storage licenseEntry = DependencyRegistryStorageLib.s().allLicenses[
896
+ licenseType
897
+ ];
898
+ _onlyInRangeIndex({
899
+ index: index,
900
+ length: licenseEntry.licenseChunkCount
901
+ });
902
+
903
+ address licenseAddress = licenseEntry.licenseBytecodeAddresses[index];
904
+ bytes32 storageVersion = BytecodeStorageReader
905
+ .getLibraryVersionForBytecode(licenseAddress);
906
+ if (storageVersion == BytecodeStorageReader.UNKNOWN_VERSION_STRING) {
907
+ return
908
+ string(
909
+ BytecodeStorageReader.readBytesFromSSTORE2Bytecode(
910
+ licenseAddress
911
+ )
912
+ );
913
+ } else {
914
+ return BytecodeStorageReader.readFromBytecode(licenseAddress);
915
+ }
916
+ }
917
+
918
+ /**
919
+ * @notice Returns the count of license chunks for license `licenseType`.
920
+ * @param licenseType Name of license type (e.g. "MIT") used to identify dependency.
921
+ */
922
+ function getLicenseTextChunkCount(
923
+ bytes32 licenseType
924
+ ) external view returns (uint256) {
925
+ return
926
+ DependencyRegistryStorageLib
927
+ .s()
928
+ .allLicenses[licenseType]
929
+ .licenseChunkCount;
930
+ }
931
+
932
+ /**
933
+ * @notice Returns details for a given dependency type `dependencyNameAndVersion`.
934
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
935
+ * @return nameAndVersion String representation of `dependencyNameAndVersion`.
705
936
  * (e.g. "p5js(atSymbol)1.0.0")
706
937
  * @return licenseType License type for dependency
707
938
  * @return preferredCDN Preferred CDN URL for dependency
708
939
  * @return additionalCDNCount Count of additional CDN URLs for dependency
709
940
  * @return preferredRepository Preferred repository URL for dependency
710
941
  * @return additionalRepositoryCount Count of additional repository URLs for dependency
711
- * @return referenceWebsite Project website URL for dependency
942
+ * @return dependencyWebsite Project website URL for dependency
712
943
  * @return availableOnChain Whether dependency is available on chain
713
944
  * @return scriptCount Count of on-chain scripts for dependency
714
945
  */
715
946
  function getDependencyDetails(
716
- bytes32 _dependencyType
947
+ bytes32 dependencyNameAndVersion
717
948
  )
718
949
  external
719
950
  view
720
951
  returns (
721
- string memory typeAndVersion,
952
+ string memory nameAndVersion,
722
953
  string memory licenseType,
723
954
  string memory preferredCDN,
724
955
  uint24 additionalCDNCount,
725
956
  string memory preferredRepository,
726
957
  uint24 additionalRepositoryCount,
727
- string memory referenceWebsite,
958
+ string memory dependencyWebsite,
728
959
  bool availableOnChain,
729
960
  uint24 scriptCount
730
961
  )
731
962
  {
732
- Dependency storage dependency = dependencyDetails[_dependencyType];
963
+ DependencyRegistryStorageLib.Dependency
964
+ storage dependency = DependencyRegistryStorageLib
965
+ .s()
966
+ .dependencyRecords[dependencyNameAndVersion];
733
967
 
734
968
  return (
735
- _dependencyType.toString(),
969
+ dependencyNameAndVersion.toString(),
736
970
  dependency.licenseType.toString(),
737
971
  dependency.preferredCDN,
738
972
  dependency.additionalCDNCount,
739
973
  dependency.preferredRepository,
740
974
  dependency.additionalRepositoryCount,
741
- dependency.referenceWebsite,
975
+ dependency.website,
742
976
  dependency.scriptCount > 0,
743
977
  dependency.scriptCount
744
978
  );
@@ -749,23 +983,27 @@ contract DependencyRegistryV0 is
749
983
  * @return Number of supported core contracts.
750
984
  */
751
985
  function getSupportedCoreContractCount() external view returns (uint256) {
752
- return _supportedCoreContracts.length();
986
+ return DependencyRegistryStorageLib.s().supportedCoreContracts.length();
753
987
  }
754
988
 
755
989
  /**
756
- * @notice Returns the address of the supported core contract at index `_index`.
757
- * @param _index Index of the core contract to be returned, relative to the overall
990
+ * @notice Returns the address of the supported core contract at index `index`.
991
+ * @param index Index of the core contract to be returned, relative to the overall
758
992
  * list of supported core contracts.
759
993
  * @return address of the core contract.
760
994
  */
761
995
  function getSupportedCoreContract(
762
- uint256 _index
996
+ uint256 index
763
997
  ) external view returns (address) {
998
+ DependencyRegistryStorageLib.Storage
999
+ storage ds = DependencyRegistryStorageLib.s();
1000
+
764
1001
  _onlyInRangeIndex({
765
- _index: _index,
766
- _length: _supportedCoreContracts.length()
1002
+ index: index,
1003
+ length: ds.supportedCoreContracts.length()
767
1004
  });
768
- return _supportedCoreContracts.at(_index);
1005
+
1006
+ return ds.supportedCoreContracts.at(index);
769
1007
  }
770
1008
 
771
1009
  /**
@@ -776,7 +1014,10 @@ contract DependencyRegistryV0 is
776
1014
  function isSupportedCoreContract(
777
1015
  address coreContractAddress
778
1016
  ) external view returns (bool) {
779
- return _supportedCoreContracts.contains(coreContractAddress);
1017
+ return
1018
+ DependencyRegistryStorageLib.s().supportedCoreContracts.contains(
1019
+ coreContractAddress
1020
+ );
780
1021
  }
781
1022
 
782
1023
  /**
@@ -790,83 +1031,102 @@ contract DependencyRegistryV0 is
790
1031
  view
791
1032
  returns (address[] memory)
792
1033
  {
793
- uint256 supportedCoreContractCount = _supportedCoreContracts.length();
1034
+ DependencyRegistryStorageLib.Storage
1035
+ storage ds = DependencyRegistryStorageLib.s();
1036
+
1037
+ uint256 supportedCoreContractCount = ds.supportedCoreContracts.length();
794
1038
  address[] memory supportedCoreContracts = new address[](
795
1039
  supportedCoreContractCount
796
1040
  );
797
1041
 
798
- for (uint256 i = 0; i < supportedCoreContractCount; i++) {
799
- supportedCoreContracts[i] = _supportedCoreContracts.at(i);
1042
+ for (uint256 i; i < supportedCoreContractCount; ) {
1043
+ supportedCoreContracts[i] = ds.supportedCoreContracts.at(i);
1044
+ unchecked {
1045
+ ++i;
1046
+ }
800
1047
  }
801
1048
 
802
1049
  return supportedCoreContracts;
803
1050
  }
804
1051
 
805
1052
  /**
806
- * @notice Returns the additional CDN URL at index `_index` for dependency `_dependencyType`.
807
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
808
- * @param _index The index of an additional CDN, relative to the overall `additionalCDNCount`.
1053
+ * @notice Returns the additional CDN URL at index `index` for dependency `dependencyNameAndVersion`.
1054
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
1055
+ * @param index The index of an additional CDN, relative to the overall `additionalCDNCount`.
809
1056
  */
810
1057
  function getDependencyAdditionalCDN(
811
- bytes32 _dependencyType,
812
- uint256 _index
1058
+ bytes32 dependencyNameAndVersion,
1059
+ uint256 index
813
1060
  ) external view returns (string memory) {
814
- Dependency storage dependency = dependencyDetails[_dependencyType];
1061
+ DependencyRegistryStorageLib.Dependency
1062
+ storage dependency = DependencyRegistryStorageLib
1063
+ .s()
1064
+ .dependencyRecords[dependencyNameAndVersion];
815
1065
  _onlyInRangeIndex({
816
- _index: _index,
817
- _length: dependency.additionalCDNCount
1066
+ index: index,
1067
+ length: dependency.additionalCDNCount
818
1068
  });
819
- return dependency.additionalCDNs[_index];
1069
+ return dependency.additionalCDNs[index];
820
1070
  }
821
1071
 
822
1072
  /**
823
- * @notice Returns the additional repository URL at index `_index` for dependency `_dependencyType`.
824
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
825
- * @param _index The index of an additional repository, relative to the overall `additionalRepositoryCount`.
1073
+ * @notice Returns the additional repository URL at index `index` for dependency `dependencyNameAndVersion`.
1074
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
1075
+ * @param index The index of an additional repository, relative to the overall `additionalRepositoryCount`.
826
1076
  */
827
1077
  function getDependencyAdditionalRepository(
828
- bytes32 _dependencyType,
829
- uint256 _index
1078
+ bytes32 dependencyNameAndVersion,
1079
+ uint256 index
830
1080
  ) external view returns (string memory) {
831
- Dependency storage dependency = dependencyDetails[_dependencyType];
1081
+ DependencyRegistryStorageLib.Dependency
1082
+ storage dependency = DependencyRegistryStorageLib
1083
+ .s()
1084
+ .dependencyRecords[dependencyNameAndVersion];
832
1085
  _onlyInRangeIndex({
833
- _index: _index,
834
- _length: dependency.additionalRepositoryCount
1086
+ index: index,
1087
+ length: dependency.additionalRepositoryCount
835
1088
  });
836
- return dependency.additionalRepositories[_index];
1089
+ return dependency.additionalRepositories[index];
837
1090
  }
838
1091
 
839
1092
  /**
840
- * @notice Returns the count of scripts for dependency `_dependencyType`.
841
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
1093
+ * @notice Returns the count of scripts for dependency `dependencyNameAndVersion`.
1094
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
842
1095
  */
843
1096
  function getDependencyScriptCount(
844
- bytes32 _dependencyType
1097
+ bytes32 dependencyNameAndVersion
845
1098
  ) external view returns (uint256) {
846
- return dependencyDetails[_dependencyType].scriptCount;
1099
+ return
1100
+ DependencyRegistryStorageLib
1101
+ .s()
1102
+ .dependencyRecords[dependencyNameAndVersion]
1103
+ .scriptCount;
847
1104
  }
848
1105
 
849
1106
  /**
850
1107
  * @notice Returns address with bytecode containing script for
851
- * dependency `_dependencyTypes` at script index `_index`.
852
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
853
- * @param _index The index of a given script, relative to the overall `scriptCount`.
1108
+ * dependency `_dependencyTypes` at script index `index`.
1109
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
1110
+ * @param index The index of a given script, relative to the overall `scriptCount`.
854
1111
  * @return The address of the bytecode storage for the script at the given index, if it can be determined.
855
1112
  */
856
1113
  function getDependencyScriptBytecodeAddress(
857
- bytes32 _dependencyType,
858
- uint256 _index
1114
+ bytes32 dependencyNameAndVersion,
1115
+ uint256 index
859
1116
  ) external view returns (address) {
860
- Dependency storage dependency = dependencyDetails[_dependencyType];
861
- _onlyInRangeIndex({_index: _index, _length: dependency.scriptCount});
862
- return dependency.scriptBytecodeAddresses[_index];
1117
+ DependencyRegistryStorageLib.Dependency
1118
+ storage dependency = DependencyRegistryStorageLib
1119
+ .s()
1120
+ .dependencyRecords[dependencyNameAndVersion];
1121
+ _onlyInRangeIndex({index: index, length: dependency.scriptCount});
1122
+ return dependency.scriptBytecodeAddresses[index];
863
1123
  }
864
1124
 
865
1125
  /**
866
1126
  * @notice Returns the storage library version for
867
- * dependency `_dependencyTypes` at script index `_index`.
868
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
869
- * @param _index The index of a given script, relative to the overall `scriptCount`.
1127
+ * dependency `_dependencyTypes` at script index `index`.
1128
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
1129
+ * @param index The index of a given script, relative to the overall `scriptCount`.
870
1130
  * @return The storage library version for the script at the given index, if it can be determined.
871
1131
  * @dev Note that we only expect this to be determinable if the script was written using a version
872
1132
  * of the Art Blocks `BytecodeStorage` library, and in other cases the fallback will be the
@@ -875,23 +1135,24 @@ contract DependencyRegistryV0 is
875
1135
  * that can be fallback-read optimistically.
876
1136
  */
877
1137
  function getDependencyScriptBytecodeStorageVersion(
878
- bytes32 _dependencyType,
879
- uint256 _index
1138
+ bytes32 dependencyNameAndVersion,
1139
+ uint256 index
880
1140
  ) external view returns (bytes32) {
881
- Dependency storage dependency = dependencyDetails[_dependencyType];
882
- _onlyInRangeIndex({_index: _index, _length: dependency.scriptCount});
1141
+ DependencyRegistryStorageLib.Dependency
1142
+ storage dependency = DependencyRegistryStorageLib
1143
+ .s()
1144
+ .dependencyRecords[dependencyNameAndVersion];
1145
+ _onlyInRangeIndex({index: index, length: dependency.scriptCount});
883
1146
  return
884
1147
  BytecodeStorageReader.getLibraryVersionForBytecode(
885
- dependencyDetails[_dependencyType].scriptBytecodeAddresses[
886
- _index
887
- ]
1148
+ dependency.scriptBytecodeAddresses[index]
888
1149
  );
889
1150
  }
890
1151
 
891
1152
  /**
892
- * @notice Returns script for dependency `_dependencyType` at script index `_index`.
893
- * @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
894
- * @param _index The index of a given script, relative to the overall `scriptCount`.
1153
+ * @notice Returns script for dependency `dependencyNameAndVersion` at script index `index`.
1154
+ * @param dependencyNameAndVersion Name and version of dependency (i.e. "name@version") used to identify dependency.
1155
+ * @param index The index of a given script, relative to the overall `scriptCount`.
895
1156
  * @return A string containing the script content at the given script chunk index for a given dependency.
896
1157
  * @dev This method attempts to introspectively determine which library version of
897
1158
  * `BytecodeStorage` was used to write the stored script string that is being
@@ -902,13 +1163,16 @@ contract DependencyRegistryV0 is
902
1163
  * can cause failure (e.g. unexpected continuation byte).
903
1164
  */
904
1165
  function getDependencyScript(
905
- bytes32 _dependencyType,
906
- uint256 _index
1166
+ bytes32 dependencyNameAndVersion,
1167
+ uint256 index
907
1168
  ) external view returns (string memory) {
908
- Dependency storage dependency = dependencyDetails[_dependencyType];
909
- _onlyInRangeIndex({_index: _index, _length: dependency.scriptCount});
1169
+ DependencyRegistryStorageLib.Dependency
1170
+ storage dependency = DependencyRegistryStorageLib
1171
+ .s()
1172
+ .dependencyRecords[dependencyNameAndVersion];
1173
+ _onlyInRangeIndex({index: index, length: dependency.scriptCount});
910
1174
 
911
- address scriptAddress = dependency.scriptBytecodeAddresses[_index];
1175
+ address scriptAddress = dependency.scriptBytecodeAddresses[index];
912
1176
  bytes32 storageVersion = BytecodeStorageReader
913
1177
  .getLibraryVersionForBytecode(scriptAddress);
914
1178
 
@@ -925,30 +1189,31 @@ contract DependencyRegistryV0 is
925
1189
  }
926
1190
 
927
1191
  /**
928
- * @notice Returns the dependency type for a given project (`projectId`)
1192
+ * @notice Returns the dependency name and version for a given project (`projectId`)
929
1193
  * on a given core contract (`_contractAddress`). If no override is set,
930
1194
  * the core contract is called to retrieve the script type and version as
931
1195
  * dependency type. For any contract earlier than v3, that does not have
932
1196
  * an override set, this will revert.
933
- * @param _contractAddress Core contract address.
934
- * @param _projectId Project to return dependency type for.
935
- * @return dependencyType Identifier for the dependency (i.e. "type@version") used by project.
1197
+ * @param contractAddress Core contract address.
1198
+ * @param projectId Project to return dependency type for.
1199
+ * @return dependencyType Identifier for the dependency (i.e. "name@version") used by project.
936
1200
  */
937
- function getDependencyTypeForProject(
938
- address _contractAddress,
939
- uint256 _projectId
1201
+ function getDependencyNameAndVersionForProject(
1202
+ address contractAddress,
1203
+ uint256 projectId
940
1204
  ) external view returns (string memory) {
941
- _onlySupportedCoreContract(_contractAddress);
942
- bytes32 dependencyType = projectDependencyTypeOverrides[
943
- _contractAddress
944
- ][_projectId];
945
- if (dependencyType != bytes32(0)) {
946
- return dependencyType.toString();
1205
+ _onlySupportedCoreContract(contractAddress);
1206
+
1207
+ bytes32 dependencyNameAndVersion = DependencyRegistryStorageLib
1208
+ .s()
1209
+ .projectDependencyOverrides[contractAddress][projectId];
1210
+ if (dependencyNameAndVersion != bytes32(0)) {
1211
+ return dependencyNameAndVersion.toString();
947
1212
  }
948
1213
 
949
1214
  try
950
- IDependencyRegistryCompatibleV0(_contractAddress)
951
- .projectScriptDetails(_projectId)
1215
+ IDependencyRegistryCompatibleV0(contractAddress)
1216
+ .projectScriptDetails(projectId)
952
1217
  returns (string memory scriptTypeAndVersion, string memory, uint256) {
953
1218
  return scriptTypeAndVersion;
954
1219
  } catch {
@@ -964,13 +1229,13 @@ contract DependencyRegistryV0 is
964
1229
  * determined by this contract's current Admin ACL contract. Expected use
965
1230
  * cases include minter contracts checking if caller is allowed to call
966
1231
  * admin-gated functions on minter contracts.
967
- * @param _sender Address of the sender calling function with selector
968
- * `_selector` on contract `_contract`.
969
- * @param _contract Address of the contract being called by `_sender`.
970
- * @param _selector Function selector of the function being called by
971
- * `_sender`.
972
- * @return bool Whether `_sender` is allowed to call function with selector
973
- * `_selector` on contract `_contract`.
1232
+ * @param sender Address of the sender calling function with selector
1233
+ * `selector` on contract `contract_`.
1234
+ * @param contract_ Address of the contract being called by `sender`.
1235
+ * @param selector Function selector of the function being called by
1236
+ * `sender`.
1237
+ * @return bool Whether `sender` is allowed to call function with selector
1238
+ * `selector` on contract `contract_`.
974
1239
  * @dev assumes the Admin ACL contract is the owner of this contract, which
975
1240
  * is expected to always be true.
976
1241
  * @dev adminACLContract is expected to either be null address (if owner
@@ -978,13 +1243,17 @@ contract DependencyRegistryV0 is
978
1243
  * null address first to avoid revert when admin has renounced ownership.
979
1244
  */
980
1245
  function adminACLAllowed(
981
- address _sender,
982
- address _contract,
983
- bytes4 _selector
1246
+ address sender,
1247
+ address contract_,
1248
+ bytes4 selector
984
1249
  ) public returns (bool) {
985
1250
  return
986
1251
  owner() != address(0) &&
987
- adminACLContract.allowed(_sender, _contract, _selector);
1252
+ DependencyRegistryStorageLib.s().adminACLContract.allowed(
1253
+ sender,
1254
+ contract_,
1255
+ selector
1256
+ );
988
1257
  }
989
1258
 
990
1259
  /**
@@ -1003,6 +1272,14 @@ contract DependencyRegistryV0 is
1003
1272
  return OwnableUpgradeable.owner();
1004
1273
  }
1005
1274
 
1275
+ /**
1276
+ * @notice This function returns the address of the admin ACL contract.
1277
+ * @return address Address of the admin ACL contract.
1278
+ */
1279
+ function adminACLContract() public view returns (address) {
1280
+ return address(DependencyRegistryStorageLib.s().adminACLContract);
1281
+ }
1282
+
1006
1283
  /**
1007
1284
  * @notice Transfers ownership of the contract to a new account (`newOwner`).
1008
1285
  * Internal function without access restriction.
@@ -1013,6 +1290,8 @@ contract DependencyRegistryV0 is
1013
1290
  */
1014
1291
  function _transferOwnership(address newOwner) internal override {
1015
1292
  OwnableUpgradeable._transferOwnership(newOwner);
1016
- adminACLContract = IAdminACLV0(newOwner);
1293
+ DependencyRegistryStorageLib.s().adminACLContract = IAdminACLV0(
1294
+ newOwner
1295
+ );
1017
1296
  }
1018
1297
  }