@artblocks/contracts 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -38
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol/BytecodeStorageReaderContractV2.json +201 -0
- package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol/BytecodeStorageReaderContractV2_Web3Call.json +201 -0
- package/artifacts/contracts/BytecodeStorageReaders/UniversalBytecodeStorageReader.sol/UniversalBytecodeStorageReader.json +154 -0
- package/artifacts/contracts/BytecodeStorageV2Writer.sol/BytecodeStorageV2Writer.json +87 -0
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +174 -55
- package/artifacts/contracts/GenArt721CoreV3_Curated.sol/GenArt721CoreV3_Curated.json +2493 -0
- package/artifacts/contracts/OwnedCreate2FactoryV0.sol/OwnedCreate2FactoryV0.json +311 -0
- package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +15 -2
- package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +15 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV4.sol/MinterDALinV4.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV4.sol/MinterHolderV4.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +37 -0
- package/artifacts/contracts/archive/minter-suite/Minters/MinterPolyptych/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSEA/MinterSEAV0.sol/MinterSEAV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
- package/artifacts/contracts/engine/V3/EngineFactoryV0.sol/EngineFactoryV0.json +20 -2
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +48 -12
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +76 -40
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +15 -2
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +2 -2
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +15 -2
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +37 -0
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +2 -2
- package/artifacts/contracts/generator/AddressChunks.sol/AddressChunks.json +10 -0
- package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/GenArt721GeneratorV0.json +333 -0
- package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/ILegacyGenArt721CoreV2_PBAB_Flex.json +47 -0
- package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +7 -7
- package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol/IBytecodeStorageReaderV2.json +7 -7
- package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReader_Base.sol/IBytecodeStorageReader_Base.json +30 -0
- package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +13 -0
- package/artifacts/contracts/interfaces/v0.8.x/IDelegateRegistry.sol/IDelegateRegistry.json +820 -0
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +183 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +42 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +42 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV0.sol/IGenArt721CoreProjectScriptV0.json +59 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV1.sol/IGenArt721CoreProjectScriptV1.json +64 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV0.sol/IGenArt721CoreTokenHashProviderV0.json +30 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV1.sol/IGenArt721CoreTokenHashProviderV1.json +30 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721GeneratorV0.sol/IGenArt721GeneratorV0.json +63 -0
- package/artifacts/contracts/interfaces/v0.8.x/IOwnedCreate2FactoryV0.sol/IOwnedCreate2FactoryV0.json +74 -0
- package/artifacts/contracts/interfaces/v0.8.x/IPMPAugmentHook.sol/IPMPAugmentHook.json +83 -0
- package/artifacts/contracts/interfaces/v0.8.x/IPMPConfigureHook.sol/IPMPConfigureHook.json +80 -0
- package/artifacts/contracts/interfaces/v0.8.x/IPMPV0.sol/IPMPV0.json +402 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol/ISeaDropShimForContract.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMinPriceV0.sol/ISharedMinterMinPriceV0.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol/IUniversalBytecodeStorageReader.json +69 -0
- package/artifacts/contracts/interfaces/v0.8.x/IWeb3Call.sol/IWeb3Call.json +47 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ERC721SeaDropStructsErrorsAndEvents.sol/ERC721SeaDropStructsErrorsAndEvents.json +43 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/INonFungibleSeaDropToken.sol/INonFungibleSeaDropToken.json +715 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDrop.sol/ISeaDrop.json +1571 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDropTokenContractMetadata.sol/ISeaDropTokenContractMetadata.json +345 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropErrorsAndEvents.sol/SeaDropErrorsAndEvents.json +717 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegateRegistry.sol/DelegateRegistry.json +846 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryHashes.sol/RegistryHashes.json +10 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryOps.sol/RegistryOps.json +10 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/libraries/RegistryStorage.sol/RegistryStorage.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/ImmutableStringArray.sol/ImmutableStringArray.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/JsonStatic.sol/JsonStatic.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +9 -22
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MinPriceLib.sol/MinPriceLib.json +24 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol/MinterMinPriceMerkleV0.json +664 -0
- package/artifacts/contracts/minter-suite/Minters/MinterMinPriceV0.sol/MinterMinPriceV0.json +387 -0
- package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol/SeaDropXArtBlocksShim.json +1206 -0
- package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +2 -2
- package/artifacts/contracts/mock/BytecodeV2LibCallsMock.sol/BytecodeV2LibCallsMock.json +2 -2
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/ERC20MockAltDecimals.sol/ERC20MockAltDecimals.json +318 -0
- package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +2 -2
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
- package/artifacts/contracts/mock/ImmutableStringArrayMock.sol/ImmutableStringArrayMock.json +69 -0
- package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
- package/artifacts/contracts/mock/MockFileStore.sol/MockFileStore.json +35 -0
- package/artifacts/contracts/mock/MockPMPAugmentHook.sol/MockPMPAugmentHook.json +214 -0
- package/artifacts/contracts/mock/MockPMPConfigureHook.sol/MockPMPConfigureHook.json +236 -0
- package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
- package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
- package/artifacts/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +2 -2
- package/artifacts/contracts/randomizer/deprecated/RandomizerV2.sol/BasicRandomizerV2.json +2 -2
- package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +2 -2
- package/artifacts/contracts/web3call/PMPV0.sol/PMPV0.json +629 -0
- package/artifacts/contracts/web3call/Web3Call.sol/Web3Call.json +66 -0
- package/artifacts/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol/AbstractPMPAugmentHook.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBaseGasFee.sol/InjectBaseGasFee.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/IUniswapV2Pair.json +60 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/InjectChromieSquiggleFloorPrice.json +107 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol/InjectIsNounsDaoMember.json +96 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol/InjectIsProjectFullyMinted.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol/InjectPolyptychTokenHash.json +141 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol/InjectTokenHashSeed.json +99 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwner.sol/InjectTokenOwner.json +99 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol/InjectTokenOwnerEthBalance.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol/InjectUSDCTotalSupply.json +107 -0
- package/artifacts/contracts/web3call/configure-hooks/abstractPMPConfigureHook.sol/AbstractPMPConfigureHook.json +80 -0
- package/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol +103 -0
- package/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol +128 -0
- package/contracts/BytecodeStorageReaders/UniversalBytecodeStorageReader.sol +70 -0
- package/contracts/BytecodeStorageV2Writer.sol +69 -0
- package/contracts/DependencyRegistryV0.sol +296 -88
- package/contracts/GenArt721CoreV3_Curated.sol +133 -0
- package/contracts/OwnedCreate2FactoryV0.sol +173 -0
- package/contracts/engine/V3/EngineFactoryV0.sol +10 -2
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +139 -70
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +148 -72
- package/contracts/generator/AddressChunks.sol +106 -0
- package/contracts/generator/GenArt721GeneratorV0.sol +1163 -0
- package/contracts/generator/scripty-support/Scripty.sol +5 -0
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReader.sol +34 -36
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol +5 -3
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReader_Base.sol +20 -0
- package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +5 -0
- package/contracts/interfaces/v0.8.x/IDelegateRegistry.sol +318 -0
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +96 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +13 -2
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +3 -1
- package/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV0.sol +22 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV1.sol +23 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV0.sol +11 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV1.sol +9 -0
- package/contracts/interfaces/v0.8.x/IGenArt721GeneratorV0.sol +14 -0
- package/contracts/interfaces/v0.8.x/IOwnedCreate2FactoryV0.sol +40 -0
- package/contracts/interfaces/v0.8.x/IPMPAugmentHook.sol +31 -0
- package/contracts/interfaces/v0.8.x/IPMPConfigureHook.sol +25 -0
- package/contracts/interfaces/v0.8.x/IPMPV0.sol +224 -0
- package/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol +19 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterMinPriceV0.sol +22 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol +10 -4
- package/contracts/interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol +33 -0
- package/contracts/interfaces/v0.8.x/IWeb3Call.sol +28 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ERC721SeaDropStructsErrorsAndEvents.sol +58 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/INonFungibleSeaDropToken.sol +186 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDrop.sol +337 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDropTokenContractMetadata.sol +152 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropErrorsAndEvents.sol +320 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropStructs.sol +146 -0
- package/contracts/libs/integration-refs/delegation-registry/DelegateRegistry.sol +753 -0
- package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryHashes.sol +359 -0
- package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryOps.sol +31 -0
- package/contracts/libs/integration-refs/delegation-registry/libraries/RegistryStorage.sol +87 -0
- package/contracts/libs/v0.8.x/Bytes32Strings.sol +20 -0
- package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +14 -3
- package/contracts/libs/v0.8.x/ImmutableStringArray.sol +289 -0
- package/contracts/libs/v0.8.x/JsonStatic.sol +373 -0
- package/contracts/libs/v0.8.x/V3FlexLib.sol +16 -4
- package/contracts/libs/v0.8.x/minter-libs/MinPriceLib.sol +64 -0
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +107 -0
- package/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol +765 -0
- package/contracts/minter-suite/Minters/MinterMinPriceV0.sol +462 -0
- package/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol +869 -0
- package/contracts/mock/ERC20MockAltDecimals.sol +31 -0
- package/contracts/mock/ImmutableStringArrayMock.sol +47 -0
- package/contracts/mock/MockFileStore.sol +22 -0
- package/contracts/mock/MockPMPAugmentHook.sol +170 -0
- package/contracts/mock/MockPMPConfigureHook.sol +78 -0
- package/contracts/web3call/PMPV0.sol +1125 -0
- package/contracts/web3call/Web3Call.sol +25 -0
- package/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol +46 -0
- package/contracts/web3call/augment-hooks/InjectBaseGasFee.sol +57 -0
- package/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol +103 -0
- package/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol +66 -0
- package/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol +73 -0
- package/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol +88 -0
- package/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol +62 -0
- package/contracts/web3call/augment-hooks/InjectTokenOwner.sol +60 -0
- package/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol +61 -0
- package/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol +69 -0
- package/contracts/web3call/configure-hooks/abstractPMPConfigureHook.sol +41 -0
- package/package.json +23 -21
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "AbstractPMPConfigureHook",
|
|
4
|
+
"sourceName": "contracts/web3call/configure-hooks/abstractPMPConfigureHook.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "address",
|
|
10
|
+
"name": "coreContract",
|
|
11
|
+
"type": "address"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"internalType": "uint256",
|
|
15
|
+
"name": "tokenId",
|
|
16
|
+
"type": "uint256"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"components": [
|
|
20
|
+
{
|
|
21
|
+
"internalType": "string",
|
|
22
|
+
"name": "key",
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"internalType": "enum IPMPV0.ParamType",
|
|
27
|
+
"name": "configuredParamType",
|
|
28
|
+
"type": "uint8"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"internalType": "bytes32",
|
|
32
|
+
"name": "configuredValue",
|
|
33
|
+
"type": "bytes32"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"internalType": "bool",
|
|
37
|
+
"name": "configuringArtistString",
|
|
38
|
+
"type": "bool"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"internalType": "string",
|
|
42
|
+
"name": "configuredValueString",
|
|
43
|
+
"type": "string"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"internalType": "struct IPMPV0.PMPInput",
|
|
47
|
+
"name": "pmpInput",
|
|
48
|
+
"type": "tuple"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"name": "onTokenPMPConfigure",
|
|
52
|
+
"outputs": [],
|
|
53
|
+
"stateMutability": "nonpayable",
|
|
54
|
+
"type": "function"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"inputs": [
|
|
58
|
+
{
|
|
59
|
+
"internalType": "bytes4",
|
|
60
|
+
"name": "interfaceId",
|
|
61
|
+
"type": "bytes4"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"name": "supportsInterface",
|
|
65
|
+
"outputs": [
|
|
66
|
+
{
|
|
67
|
+
"internalType": "bool",
|
|
68
|
+
"name": "",
|
|
69
|
+
"type": "bool"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"stateMutability": "view",
|
|
73
|
+
"type": "function"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"bytecode": "0x",
|
|
77
|
+
"deployedBytecode": "0x",
|
|
78
|
+
"linkReferences": {},
|
|
79
|
+
"deployedLinkReferences": {}
|
|
80
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
// Created By: Art Blocks Inc.
|
|
5
|
+
|
|
6
|
+
import {IBytecodeStorageReaderV2} from "../interfaces/v0.8.x/IBytecodeStorageReaderV2.sol";
|
|
7
|
+
|
|
8
|
+
import {BytecodeStorageReader} from "../libs/v0.8.x/BytecodeStorageV2.sol";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @title Art Blocks Bytecode Storage Reader Contract V2
|
|
12
|
+
* @author Art Blocks Inc.
|
|
13
|
+
* @notice This contract is used to read the bytecode of a contract deployed by Art Blocks' BytecodeStorage library,
|
|
14
|
+
* for versions 0, 1, and 2 of the Art Blocks BytecodeStorage library.
|
|
15
|
+
* It is permissionless and can be used by anyone to read the bytecode of any contract deployed by Art Blocks.
|
|
16
|
+
* Future versions of BytecodeStorage will not be compatible with this reader.
|
|
17
|
+
* For a single location to read current and future versions of the Art Blocks BytecodeStorage library, see
|
|
18
|
+
* the UniversalBytecodeStorageReader contract, maintained by the Art Blocks team.
|
|
19
|
+
* Additional functionality is provided to read bytes data stored using the SSTORE2 library.
|
|
20
|
+
* This contract also provides an interface to read additional metadata stored by the Art Blocks BytecodeStorage
|
|
21
|
+
* library, such as the contract's version, deployer, and other metadata.
|
|
22
|
+
* @dev For simplicity and reduce code changes, this contract uses the BytecodeStorageReader external library to
|
|
23
|
+
* perform many operations. Future reader contract versions may choose to make the library internal to this contract to
|
|
24
|
+
* improve read operation performance.
|
|
25
|
+
*/
|
|
26
|
+
contract BytecodeStorageReaderContractV2 is IBytecodeStorageReaderV2 {
|
|
27
|
+
using BytecodeStorageReader for address;
|
|
28
|
+
|
|
29
|
+
string public constant VERSION = "BytecodeStorageReaderContractV2";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @notice Read a string from a data contract deployed via BytecodeStorage V2 or earlier.
|
|
33
|
+
* @param address_ address of contract deployed via BytecodeStorage to be read
|
|
34
|
+
* @return The string data stored at the specific address.
|
|
35
|
+
*/
|
|
36
|
+
function readFromBytecode(
|
|
37
|
+
address address_
|
|
38
|
+
) external view returns (string memory) {
|
|
39
|
+
return address_.readFromBytecode();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @notice Read a bytes array from the SSTORE2-formatted bytecode of a contract.
|
|
44
|
+
* Note that this function is only compatible with contracts that have been deployed using the popular SSTORE2
|
|
45
|
+
* library.
|
|
46
|
+
* @param address_ address of contract with SSTORE2-formatted bytecode to be read
|
|
47
|
+
* @return data The bytes data stored at the specific address.
|
|
48
|
+
*/
|
|
49
|
+
function readBytesFromSSTORE2Bytecode(
|
|
50
|
+
address address_
|
|
51
|
+
) external view returns (bytes memory) {
|
|
52
|
+
return address_.readBytesFromSSTORE2Bytecode();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @notice Read a bytes array from the a contract deployed via BytecodeStorage V2 or earlier.
|
|
57
|
+
* @param address_ address of contract with valid bytecode to be read
|
|
58
|
+
* @param offset offset to read from in contract bytecode, explicitly provided (not calculated)
|
|
59
|
+
* @return The bytes data stored at the specific address.
|
|
60
|
+
*/
|
|
61
|
+
function readBytesFromBytecode(
|
|
62
|
+
address address_,
|
|
63
|
+
uint256 offset
|
|
64
|
+
) external view returns (bytes memory) {
|
|
65
|
+
return address_.readBytesFromBytecode(offset);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//------ Metadata Functions ------//
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @notice Get address of deployer for given contract deployed via BytecodeStorage V2 or earlier.
|
|
72
|
+
* @param address_ address of deployed contract
|
|
73
|
+
* @return writerAddress address of deployer
|
|
74
|
+
*/
|
|
75
|
+
function getWriterAddressForBytecode(
|
|
76
|
+
address address_
|
|
77
|
+
) external view returns (address) {
|
|
78
|
+
return address_.getWriterAddressForBytecode();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @notice Get version for given contract deployed via BytecodeStorage V2 or earlier.
|
|
83
|
+
* @param address_ address of deployed contract
|
|
84
|
+
* @return version version of the contract
|
|
85
|
+
*/
|
|
86
|
+
function getLibraryVersionForBytecode(
|
|
87
|
+
address address_
|
|
88
|
+
) external view returns (bytes32) {
|
|
89
|
+
return address_.getLibraryVersionForBytecode();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @notice Get if data are stored in compressed format for given contract deployed via BytecodeStorage V2 or
|
|
94
|
+
* earlier.
|
|
95
|
+
* @param _address address of deployed contract
|
|
96
|
+
* @return isCompressed boolean indicating if the stored data are compressed
|
|
97
|
+
*/
|
|
98
|
+
function getIsCompressedForBytecode(
|
|
99
|
+
address _address
|
|
100
|
+
) external view returns (bool) {
|
|
101
|
+
return _address.getIsCompressedForBytecode();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
// Created By: Art Blocks Inc.
|
|
5
|
+
|
|
6
|
+
import {IBytecodeStorageReaderV2} from "../interfaces/v0.8.x/IBytecodeStorageReaderV2.sol";
|
|
7
|
+
import {IWeb3Call} from "../interfaces/v0.8.x/IWeb3Call.sol";
|
|
8
|
+
|
|
9
|
+
import {BytecodeStorageReader} from "../libs/v0.8.x/BytecodeStorageV2.sol";
|
|
10
|
+
|
|
11
|
+
import {ERC165Checker} from "@openzeppelin-5.0/contracts/utils/introspection/ERC165Checker.sol";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title Art Blocks Bytecode Storage Reader Contract V2 w/ Web3Call Support
|
|
15
|
+
* @author Art Blocks Inc.
|
|
16
|
+
* @notice This contract is used to read the bytecode of a contract deployed by Art Blocks' BytecodeStorage library,
|
|
17
|
+
* for versions 0, 1, and 2 of the Art Blocks BytecodeStorage library.
|
|
18
|
+
* It includes support for returning the special string "#web3call_contract#" when reading a non-bytecode storage
|
|
19
|
+
* contract that does indicate ERC165 support for the IWeb3Call interface, enabling backwards-compatibility with
|
|
20
|
+
* Web3Call-based projects on exiting Art Blocks contracts. This only affects the readFromBytecode function.
|
|
21
|
+
* It is permissionless and can be used by anyone to read the bytecode of any contract deployed by Art Blocks.
|
|
22
|
+
* Future versions of BytecodeStorage will not be compatible with this reader.
|
|
23
|
+
* For a single location to read current and future versions of the Art Blocks BytecodeStorage library, see
|
|
24
|
+
* the UniversalBytecodeStorageReader contract, maintained by the Art Blocks team.
|
|
25
|
+
* Additional functionality is provided to read bytes data stored using the SSTORE2 library.
|
|
26
|
+
* This contract also provides an interface to read additional metadata stored by the Art Blocks BytecodeStorage
|
|
27
|
+
* library, such as the contract's version, deployer, and other metadata.
|
|
28
|
+
* @dev For simplicity and reduce code changes, this contract uses the BytecodeStorageReader external library to
|
|
29
|
+
* perform many operations. Future reader contract versions may choose to make the library internal to this contract to
|
|
30
|
+
* improve read operation performance.
|
|
31
|
+
*/
|
|
32
|
+
contract BytecodeStorageReaderContractV2_Web3Call is IBytecodeStorageReaderV2 {
|
|
33
|
+
using BytecodeStorageReader for address;
|
|
34
|
+
|
|
35
|
+
string public constant VERSION = "BytecodeStorageReaderContractV2_Web3Call";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @notice Read a string from a data contract deployed via BytecodeStorage V2 or earlier.
|
|
39
|
+
* Also supports returning "#web3call_contract#" when the contract is not a
|
|
40
|
+
* BytecodeStorage contract, but does support the IWeb3Call interface.
|
|
41
|
+
* Reverts if the contract is not a BytecodeStorage contract and does not indicate
|
|
42
|
+
* ERC165 support for the IWeb3Call interface.
|
|
43
|
+
* @param address_ address of contract deployed via BytecodeStorage to be read
|
|
44
|
+
* @return The string data stored at the specific address.
|
|
45
|
+
*/
|
|
46
|
+
function readFromBytecode(
|
|
47
|
+
address address_
|
|
48
|
+
) external view returns (string memory) {
|
|
49
|
+
try address_.readFromBytecode() returns (string memory data) {
|
|
50
|
+
return data;
|
|
51
|
+
} catch {
|
|
52
|
+
if (
|
|
53
|
+
ERC165Checker.supportsInterface(
|
|
54
|
+
address_,
|
|
55
|
+
type(IWeb3Call).interfaceId
|
|
56
|
+
)
|
|
57
|
+
) {
|
|
58
|
+
return "#web3call_contract#";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// reading from bytecode failed, and does not indicate Web3Call support, so revert
|
|
62
|
+
revert(
|
|
63
|
+
"BytecodeStorageReaderContractV2_Web3Call: Failed to read from bytecode"
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @notice Read a bytes array from the SSTORE2-formatted bytecode of a contract.
|
|
69
|
+
* Note that this function is only compatible with contracts that have been deployed using the popular SSTORE2
|
|
70
|
+
* library.
|
|
71
|
+
* @param address_ address of contract with SSTORE2-formatted bytecode to be read
|
|
72
|
+
* @return data The bytes data stored at the specific address.
|
|
73
|
+
*/
|
|
74
|
+
function readBytesFromSSTORE2Bytecode(
|
|
75
|
+
address address_
|
|
76
|
+
) external view returns (bytes memory) {
|
|
77
|
+
return address_.readBytesFromSSTORE2Bytecode();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @notice Read a bytes array from the a contract deployed via BytecodeStorage V2 or earlier.
|
|
82
|
+
* @param address_ address of contract with valid bytecode to be read
|
|
83
|
+
* @param offset offset to read from in contract bytecode, explicitly provided (not calculated)
|
|
84
|
+
* @return The bytes data stored at the specific address.
|
|
85
|
+
*/
|
|
86
|
+
function readBytesFromBytecode(
|
|
87
|
+
address address_,
|
|
88
|
+
uint256 offset
|
|
89
|
+
) external view returns (bytes memory) {
|
|
90
|
+
return address_.readBytesFromBytecode(offset);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//------ Metadata Functions ------//
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @notice Get address of deployer for given contract deployed via BytecodeStorage V2 or earlier.
|
|
97
|
+
* @param address_ address of deployed contract
|
|
98
|
+
* @return writerAddress address of deployer
|
|
99
|
+
*/
|
|
100
|
+
function getWriterAddressForBytecode(
|
|
101
|
+
address address_
|
|
102
|
+
) external view returns (address) {
|
|
103
|
+
return address_.getWriterAddressForBytecode();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @notice Get version for given contract deployed via BytecodeStorage V2 or earlier.
|
|
108
|
+
* @param address_ address of deployed contract
|
|
109
|
+
* @return version version of the contract
|
|
110
|
+
*/
|
|
111
|
+
function getLibraryVersionForBytecode(
|
|
112
|
+
address address_
|
|
113
|
+
) external view returns (bytes32) {
|
|
114
|
+
return address_.getLibraryVersionForBytecode();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @notice Get if data are stored in compressed format for given contract deployed via BytecodeStorage V2 or
|
|
119
|
+
* earlier.
|
|
120
|
+
* @param _address address of deployed contract
|
|
121
|
+
* @return isCompressed boolean indicating if the stored data are compressed
|
|
122
|
+
*/
|
|
123
|
+
function getIsCompressedForBytecode(
|
|
124
|
+
address _address
|
|
125
|
+
) external view returns (bool) {
|
|
126
|
+
return _address.getIsCompressedForBytecode();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
// Created By: Art Blocks Inc.
|
|
5
|
+
|
|
6
|
+
import {IUniversalBytecodeStorageReader} from "../interfaces/v0.8.x/IUniversalBytecodeStorageReader.sol";
|
|
7
|
+
|
|
8
|
+
import {IBytecodeStorageReader_Base} from "../interfaces/v0.8.x/IBytecodeStorageReader_Base.sol";
|
|
9
|
+
|
|
10
|
+
import "@openzeppelin-5.0/contracts/access/Ownable.sol";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title Art Blocks Universal Bytecode Storage Reader
|
|
14
|
+
* @author Art Blocks Inc.
|
|
15
|
+
* @notice This contract is used to read the bytecode of a contract deployed by Art Blocks' BytecodeStorage library.
|
|
16
|
+
* It is designed to be owned and configurable by a Art Blocks secure multisig wallet, providing a single location
|
|
17
|
+
* to read on-chain data stored by the Art Blocks BytecodeStorage libarary. This contract is intended to be updated
|
|
18
|
+
* as new versions of the Art Blocks BytecodeStorage library are released, such that the Art Blocks community can
|
|
19
|
+
* continue to read the bytecode of all existing and future Art Blocks contracts in a single location.
|
|
20
|
+
* The exposed interface is simplified to only include the read string function.
|
|
21
|
+
* Additional functionality, such as alternate read methods or determining a contract's version, deployer, and other
|
|
22
|
+
* metadata, may be available on the active BytecodeStorageReader contract.
|
|
23
|
+
*/
|
|
24
|
+
contract UniversalBytecodeStorageReader is
|
|
25
|
+
Ownable,
|
|
26
|
+
IUniversalBytecodeStorageReader
|
|
27
|
+
{
|
|
28
|
+
/**
|
|
29
|
+
* @notice The active bytecode storage reader contract being used by this universal reader.
|
|
30
|
+
* Updateable by the owner of this contract.
|
|
31
|
+
* This contract is intended to be updated as new versions of the Art Blocks BytecodeStorage library are released.
|
|
32
|
+
* @dev To prevent a single point of failure, contracts may point directly to BytecodeStorageReader contracts
|
|
33
|
+
* instead of this universal reader.
|
|
34
|
+
*/
|
|
35
|
+
IBytecodeStorageReader_Base public activeBytecodeStorageReaderContract;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @notice Construct a new UniversalBytecodeStorageReader contract, owned by input owner address.
|
|
39
|
+
* @param owner_ The address that will be set as the owner of this contract.
|
|
40
|
+
*/
|
|
41
|
+
constructor(address owner_) Ownable(owner_) {}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @notice Update the active bytecode storage reader contract being used by this universal reader.
|
|
45
|
+
* @param newBytecodeStorageReaderContract The address of the new active bytecode storage reader contract.
|
|
46
|
+
*/
|
|
47
|
+
function updateBytecodeStorageReaderContract(
|
|
48
|
+
IBytecodeStorageReader_Base newBytecodeStorageReaderContract
|
|
49
|
+
) external onlyOwner {
|
|
50
|
+
activeBytecodeStorageReaderContract = newBytecodeStorageReaderContract;
|
|
51
|
+
emit ReaderUpdated({
|
|
52
|
+
activeReader: address(newBytecodeStorageReaderContract)
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @notice Read a string from a data contract deployed via BytecodeStorage.
|
|
58
|
+
* @dev may also support reading additional stored data formats in the future.
|
|
59
|
+
* @param address_ address of contract deployed via BytecodeStorage to be read
|
|
60
|
+
* @return The string data stored at the specific address.
|
|
61
|
+
*/
|
|
62
|
+
function readFromBytecode(
|
|
63
|
+
address address_
|
|
64
|
+
) external view returns (string memory) {
|
|
65
|
+
return
|
|
66
|
+
activeBytecodeStorageReaderContract.readFromBytecode({
|
|
67
|
+
address_: address_
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
// Created By: Art Blocks Inc.
|
|
5
|
+
import "./libs/v0.8.x/BytecodeStorageV2.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title Art Blocks Storage Writer
|
|
9
|
+
* @author Art Blocks Inc.
|
|
10
|
+
* @notice A simple contract that with a single function that uses
|
|
11
|
+
* the BytecodeStorageV1 library to write a string to bytecode storage.
|
|
12
|
+
*/
|
|
13
|
+
contract BytecodeStorageV2Writer {
|
|
14
|
+
using BytecodeStorageWriter for bytes;
|
|
15
|
+
using BytecodeStorageReader for string;
|
|
16
|
+
|
|
17
|
+
event StorageContractCreated(address indexed storageContract);
|
|
18
|
+
|
|
19
|
+
function _onlyNonEmptyString(string memory _string) internal pure {
|
|
20
|
+
if (bytes(_string).length == 0) {
|
|
21
|
+
revert("String must be non-empty");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @notice Write a string to bytecode storage.
|
|
27
|
+
* @param _string The string to write to bytecode storage.
|
|
28
|
+
* @dev This function emits an event with the address of the newly created
|
|
29
|
+
* storage contract.
|
|
30
|
+
*/
|
|
31
|
+
function writeStringToBytecodeStorage(string memory _string) public {
|
|
32
|
+
address storageContract = BytecodeStorageWriter.writeToBytecode(
|
|
33
|
+
_string
|
|
34
|
+
);
|
|
35
|
+
emit StorageContractCreated(storageContract);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @notice Write a pre-compressed string to bytecode storage. The string
|
|
40
|
+
* should be compressed using `getCompressed`. This function stores the string
|
|
41
|
+
* in a compressed format on-chain. For reads, the compressed string is
|
|
42
|
+
* decompressed on-chain, ensuring the original text is reconstructed without
|
|
43
|
+
* external dependencies.
|
|
44
|
+
* @param _compressedString Pre-compressed string to be stored.
|
|
45
|
+
* Required to be non-empty, but no further validation is performed.
|
|
46
|
+
* @dev This function emits an event with the address of the newly created
|
|
47
|
+
* storage contract.
|
|
48
|
+
*/
|
|
49
|
+
function writeCompressedStringToBytecodeStorage(
|
|
50
|
+
bytes memory _compressedString
|
|
51
|
+
) public {
|
|
52
|
+
address storageContract = BytecodeStorageWriter
|
|
53
|
+
.writeToBytecodeCompressed(_compressedString);
|
|
54
|
+
emit StorageContractCreated(storageContract);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @notice Returns the compressed form of a string in bytes using solady LibZip's flz compress algorithm.
|
|
59
|
+
* The bytes output from this function are intended to be used as input to `writeCompressedStringToBytecodeStorage`.
|
|
60
|
+
* @param _string String to be compressed. Required to be a non-empty string, but no further validaton is performed.
|
|
61
|
+
* @return bytes compressed bytes
|
|
62
|
+
*/
|
|
63
|
+
function getCompressed(
|
|
64
|
+
string memory _string
|
|
65
|
+
) external pure returns (bytes memory) {
|
|
66
|
+
_onlyNonEmptyString(_string);
|
|
67
|
+
return BytecodeStorageReader.getCompressed(_string);
|
|
68
|
+
}
|
|
69
|
+
}
|