@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,31 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.0;
|
|
4
|
+
|
|
5
|
+
import "@openzeppelin-4.5/contracts/token/ERC20/ERC20.sol";
|
|
6
|
+
|
|
7
|
+
contract ERC20MockAltDecimals is ERC20 {
|
|
8
|
+
// add a banned address to enable testing of unsuccessful transfers
|
|
9
|
+
address public bannedReceiver;
|
|
10
|
+
|
|
11
|
+
constructor(uint256 initialSupply) ERC20("Mock Token", "MOCK") {
|
|
12
|
+
_mint(msg.sender, initialSupply);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function updateBannedAddress(address account) external {
|
|
16
|
+
bannedReceiver = account;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function decimals() public view virtual override returns (uint8) {
|
|
20
|
+
return 6;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _afterTokenTransfer(
|
|
24
|
+
address from,
|
|
25
|
+
address to,
|
|
26
|
+
uint256 amount
|
|
27
|
+
) internal override {
|
|
28
|
+
require(to != bannedReceiver, "ERC20Mock: transfer to banned address");
|
|
29
|
+
super._afterTokenTransfer(from, to, amount);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {ImmutableStringArray} from "../libs/v0.8.x/ImmutableStringArray.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title ImmutableStringArrayMock
|
|
8
|
+
* @notice Mock contract for testing ImmutableStringArray library functionality
|
|
9
|
+
*/
|
|
10
|
+
contract ImmutableStringArrayMock {
|
|
11
|
+
using ImmutableStringArray for ImmutableStringArray.StringArray;
|
|
12
|
+
|
|
13
|
+
ImmutableStringArray.StringArray private stringArray;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @notice Store an array of strings
|
|
17
|
+
* @param strings The array of strings to store
|
|
18
|
+
*/
|
|
19
|
+
function store(string[] memory strings) external {
|
|
20
|
+
stringArray.store(strings);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @notice Get the length of the stored array
|
|
25
|
+
* @return The number of strings stored
|
|
26
|
+
*/
|
|
27
|
+
function length() external view returns (uint256) {
|
|
28
|
+
return stringArray.length();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @notice Get a string at a specific index
|
|
33
|
+
* @param index The index to retrieve
|
|
34
|
+
* @return The string at the given index
|
|
35
|
+
*/
|
|
36
|
+
function get(uint256 index) external view returns (string memory) {
|
|
37
|
+
return stringArray.get(index);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @notice Get all stored strings
|
|
42
|
+
* @return An array containing all stored strings
|
|
43
|
+
*/
|
|
44
|
+
function getAll() external view returns (string[] memory) {
|
|
45
|
+
return stringArray.getAll();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import {IScriptyContractStorage} from "scripty.sol/contracts/scripty/interfaces/IScriptyContractStorage.sol";
|
|
5
|
+
|
|
6
|
+
contract MockFileStore is IScriptyContractStorage {
|
|
7
|
+
string constant GUNZIP_SCRIPT_NAME = "gunzipScripts-0.0.1.js";
|
|
8
|
+
|
|
9
|
+
function getContent(
|
|
10
|
+
string calldata name,
|
|
11
|
+
bytes memory
|
|
12
|
+
) external pure returns (bytes memory script) {
|
|
13
|
+
if (
|
|
14
|
+
keccak256(abi.encodePacked(name)) ==
|
|
15
|
+
keccak256(abi.encodePacked(GUNZIP_SCRIPT_NAME))
|
|
16
|
+
) {
|
|
17
|
+
return
|
|
18
|
+
"InVzZSBzdHJpY3QiOygoKT0+e3ZhciB2PVVpbnQ4QXJyYXksQT1VaW50MTZBcnJheSxfPVVpbnQzMkFycmF5LHJyPW5ldyB2KFswLDAsMCwwLDAsMCwwLDAsMSwxLDEsMSwyLDIsMiwyLDMsMywzLDMsNCw0LDQsNCw1LDUsNSw1LDAsMCwwLDBdKSxucj1uZXcgdihbMCwwLDAsMCwxLDEsMiwyLDMsMyw0LDQsNSw1LDYsNiw3LDcsOCw4LDksOSwxMCwxMCwxMSwxMSwxMiwxMiwxMywxMywwLDBdKSxscj1uZXcgdihbMTYsMTcsMTgsMCw4LDcsOSw2LDEwLDUsMTEsNCwxMiwzLDEzLDIsMTQsMSwxNV0pLHRyPWZ1bmN0aW9uKHIsbil7Zm9yKHZhciB0PW5ldyBBKDMxKSxlPTA7ZTwzMTsrK2UpdFtlXT1uKz0xPDxyW2UtMV07Zm9yKHZhciBhPW5ldyBfKHRbMzBdKSxlPTE7ZTwzMDsrK2UpZm9yKHZhciB1PXRbZV07dTx0W2UrMV07Kyt1KWFbdV09dS10W2VdPDw1fGU7cmV0dXJuW3QsYV19LGVyPXRyKHJyLDIpLGlyPWVyWzBdLGNyPWVyWzFdO2lyWzI4XT0yNTgsY3JbMjU4XT0yODt2YXIgYXI9dHIobnIsMCkscHI9YXJbMF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name);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
import "../interfaces/v0.8.x/IPMPAugmentHook.sol";
|
|
5
|
+
import "../interfaces/v0.8.x/IWeb3Call.sol";
|
|
6
|
+
import "@openzeppelin-5.0/contracts/utils/introspection/ERC165.sol";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title Mock PMP Augment Hook
|
|
10
|
+
* @notice Mock implementation of IPMPAugmentHook for testing purposes
|
|
11
|
+
*/
|
|
12
|
+
contract MockPMPAugmentHook is IPMPAugmentHook, ERC165 {
|
|
13
|
+
// Event to track when the hook is called
|
|
14
|
+
event TokenPMPAugmented(
|
|
15
|
+
address indexed coreContract,
|
|
16
|
+
uint256 indexed tokenId,
|
|
17
|
+
uint256 paramCount
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// Return behavior settings
|
|
21
|
+
bool public shouldAddParam = false;
|
|
22
|
+
bool public shouldModifyParams = false;
|
|
23
|
+
bool public shouldRevert = false;
|
|
24
|
+
|
|
25
|
+
// Parameters for augmentation
|
|
26
|
+
string public augmentKey = "augmentedParam";
|
|
27
|
+
string public augmentValue = "augmentedValue";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @notice Configure the hook behavior
|
|
31
|
+
* @param _shouldAddParam Whether the hook should add a parameter
|
|
32
|
+
* @param _shouldModifyParams Whether the hook should modify existing parameters
|
|
33
|
+
* @param _shouldRevert Whether the hook should revert
|
|
34
|
+
*/
|
|
35
|
+
function setHookBehavior(
|
|
36
|
+
bool _shouldAddParam,
|
|
37
|
+
bool _shouldModifyParams,
|
|
38
|
+
bool _shouldRevert
|
|
39
|
+
) external {
|
|
40
|
+
shouldAddParam = _shouldAddParam;
|
|
41
|
+
shouldModifyParams = _shouldModifyParams;
|
|
42
|
+
shouldRevert = _shouldRevert;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @notice Set the augmentation values
|
|
47
|
+
* @param _augmentKey The key for the augmented parameter
|
|
48
|
+
* @param _augmentValue The value for the augmented parameter
|
|
49
|
+
*/
|
|
50
|
+
function setAugmentValues(
|
|
51
|
+
string memory _augmentKey,
|
|
52
|
+
string memory _augmentValue
|
|
53
|
+
) external {
|
|
54
|
+
augmentKey = _augmentKey;
|
|
55
|
+
augmentValue = _augmentValue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @notice Implement the hook method that gets called during token PMP reads
|
|
60
|
+
* @param tokenParams The original token parameters
|
|
61
|
+
* @return The augmented token parameters
|
|
62
|
+
*/
|
|
63
|
+
function onTokenPMPReadAugmentation(
|
|
64
|
+
address /* coreContract */,
|
|
65
|
+
uint256 /* tokenId */,
|
|
66
|
+
IWeb3Call.TokenParam[] calldata tokenParams
|
|
67
|
+
) external view override returns (IWeb3Call.TokenParam[] memory) {
|
|
68
|
+
// Since this is a view function, we can't emit events or modify state
|
|
69
|
+
// Tests will need to call the hook and then separately call simulateCall
|
|
70
|
+
|
|
71
|
+
// Optionally revert to test error handling
|
|
72
|
+
if (shouldRevert) {
|
|
73
|
+
revert("MockPMPAugmentHook: Intentional revert");
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// If we shouldn't modify, just return the original
|
|
77
|
+
if (!shouldAddParam && !shouldModifyParams) {
|
|
78
|
+
IWeb3Call.TokenParam[] memory result_ = new IWeb3Call.TokenParam[](
|
|
79
|
+
tokenParams.length
|
|
80
|
+
);
|
|
81
|
+
for (uint256 i = 0; i < tokenParams.length; i++) {
|
|
82
|
+
result_[i] = tokenParams[i];
|
|
83
|
+
}
|
|
84
|
+
return result_;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Handle parameter modification
|
|
88
|
+
if (shouldModifyParams && tokenParams.length > 0) {
|
|
89
|
+
// Create a copy to modify
|
|
90
|
+
IWeb3Call.TokenParam[]
|
|
91
|
+
memory modifiedParams = new IWeb3Call.TokenParam[](
|
|
92
|
+
tokenParams.length
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
// Copy all parameters
|
|
96
|
+
for (uint256 i = 0; i < tokenParams.length; i++) {
|
|
97
|
+
modifiedParams[i] = tokenParams[i];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Modify first parameter
|
|
101
|
+
if (tokenParams.length > 0) {
|
|
102
|
+
modifiedParams[0].value = string(
|
|
103
|
+
abi.encodePacked("modified_", tokenParams[0].value)
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Handle parameter addition if needed
|
|
108
|
+
if (shouldAddParam) {
|
|
109
|
+
// Create new array with one additional element
|
|
110
|
+
IWeb3Call.TokenParam[]
|
|
111
|
+
memory augmentedParams = new IWeb3Call.TokenParam[](
|
|
112
|
+
modifiedParams.length + 1
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Copy existing modified parameters
|
|
116
|
+
for (uint256 i = 0; i < modifiedParams.length; i++) {
|
|
117
|
+
augmentedParams[i] = modifiedParams[i];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Add new parameter
|
|
121
|
+
augmentedParams[modifiedParams.length] = IWeb3Call.TokenParam({
|
|
122
|
+
key: augmentKey,
|
|
123
|
+
value: augmentValue
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return augmentedParams;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return modifiedParams;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Handle parameter addition only
|
|
133
|
+
if (shouldAddParam) {
|
|
134
|
+
// Create new array with one additional element
|
|
135
|
+
IWeb3Call.TokenParam[]
|
|
136
|
+
memory augmentedParams = new IWeb3Call.TokenParam[](
|
|
137
|
+
tokenParams.length + 1
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
// Copy existing parameters
|
|
141
|
+
for (uint256 i = 0; i < tokenParams.length; i++) {
|
|
142
|
+
augmentedParams[i] = tokenParams[i];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Add new parameter
|
|
146
|
+
augmentedParams[tokenParams.length] = IWeb3Call.TokenParam({
|
|
147
|
+
key: augmentKey,
|
|
148
|
+
value: augmentValue
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
return augmentedParams;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// This should never be reached due to the if checks above
|
|
155
|
+
revert("MockPMPAugmentHook: Unexpected behavior");
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @notice Implement ERC165 interface detection
|
|
160
|
+
* @param interfaceId The interface ID to check
|
|
161
|
+
* @return True if the interface is supported
|
|
162
|
+
*/
|
|
163
|
+
function supportsInterface(
|
|
164
|
+
bytes4 interfaceId
|
|
165
|
+
) public view override(ERC165, IERC165) returns (bool) {
|
|
166
|
+
return
|
|
167
|
+
interfaceId == type(IPMPAugmentHook).interfaceId ||
|
|
168
|
+
super.supportsInterface(interfaceId);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
import "../interfaces/v0.8.x/IPMPConfigureHook.sol";
|
|
5
|
+
import {IPMPV0} from "../interfaces/v0.8.x/IPMPV0.sol";
|
|
6
|
+
import "@openzeppelin-5.0/contracts/utils/introspection/ERC165.sol";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title Mock PMP Configure Hook
|
|
10
|
+
* @notice Mock implementation of IPMPConfigureHook for testing purposes
|
|
11
|
+
*/
|
|
12
|
+
contract MockPMPConfigureHook is IPMPConfigureHook, ERC165 {
|
|
13
|
+
// Event to track when the hook is called
|
|
14
|
+
event TokenPMPConfigured(
|
|
15
|
+
address indexed coreContract,
|
|
16
|
+
uint256 indexed tokenId,
|
|
17
|
+
IPMPV0.PMPInput pmpInput
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// Track last interaction for testing purposes
|
|
21
|
+
address public lastCoreContract;
|
|
22
|
+
uint256 public lastTokenId;
|
|
23
|
+
string public lastPmpKey;
|
|
24
|
+
bytes32 public lastConfiguredValue;
|
|
25
|
+
string public lastConfiguredValueString;
|
|
26
|
+
bool public lastConfiguringArtistString;
|
|
27
|
+
|
|
28
|
+
// Support flag - can be set to simulate failure scenarios
|
|
29
|
+
bool public shouldRevert = false;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @notice Sets whether the hook should revert on calls
|
|
33
|
+
* @param _shouldRevert True if the hook should revert when called
|
|
34
|
+
*/
|
|
35
|
+
function setShouldRevert(bool _shouldRevert) external {
|
|
36
|
+
shouldRevert = _shouldRevert;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @notice Implement the hook method that gets called after token PMP configuration
|
|
41
|
+
* @param coreContract The address of the core contract
|
|
42
|
+
* @param tokenId The token ID that was configured
|
|
43
|
+
* @param pmpInput The PMP input that was used for configuration
|
|
44
|
+
*/
|
|
45
|
+
function onTokenPMPConfigure(
|
|
46
|
+
address coreContract,
|
|
47
|
+
uint256 tokenId,
|
|
48
|
+
IPMPV0.PMPInput memory pmpInput
|
|
49
|
+
) external override {
|
|
50
|
+
// Store the information for testing
|
|
51
|
+
lastCoreContract = coreContract;
|
|
52
|
+
lastTokenId = tokenId;
|
|
53
|
+
lastPmpKey = pmpInput.key;
|
|
54
|
+
lastConfiguredValue = pmpInput.configuredValue;
|
|
55
|
+
lastConfiguredValueString = pmpInput.configuredValueString;
|
|
56
|
+
lastConfiguringArtistString = pmpInput.configuringArtistString;
|
|
57
|
+
|
|
58
|
+
emit TokenPMPConfigured(coreContract, tokenId, pmpInput);
|
|
59
|
+
|
|
60
|
+
// Optionally revert to test error handling
|
|
61
|
+
if (shouldRevert) {
|
|
62
|
+
revert("MockPMPConfigureHook: Intentional revert");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @notice Implement ERC165 interface detection
|
|
68
|
+
* @param interfaceId The interface ID to check
|
|
69
|
+
* @return True if the interface is supported
|
|
70
|
+
*/
|
|
71
|
+
function supportsInterface(
|
|
72
|
+
bytes4 interfaceId
|
|
73
|
+
) public view override(ERC165, IERC165) returns (bool) {
|
|
74
|
+
return
|
|
75
|
+
interfaceId == type(IPMPConfigureHook).interfaceId ||
|
|
76
|
+
super.supportsInterface(interfaceId);
|
|
77
|
+
}
|
|
78
|
+
}
|