@artblocks/contracts 1.1.0 → 1.2.1

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