@artblocks/contracts 1.3.2 → 1.5.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 +11 -10
- package/artifacts/contracts/AdminACLV0RoyaltyRegistry.sol/AdminACLV0RoyaltyRegistry.json +193 -0
- package/artifacts/contracts/AdminACLV0RoyaltyRegistry.sol/IRoyaltyRegistry.json +35 -0
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol/BytecodeStorageReaderContractV2.json +2 -2
- package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2_Web3Call.sol/BytecodeStorageReaderContractV2_Web3Call.json +2 -2
- package/artifacts/contracts/BytecodeStorageV2Writer.sol/BytecodeStorageV2Writer.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +210 -2
- package/artifacts/contracts/GenArt721CoreV3_Curated.sol/GenArt721CoreV3_Curated.json +235 -20
- package/artifacts/contracts/GenArt721CoreV3_Curated_Flex.sol/GenArt721CoreV3_Curated_Flex.json +3197 -0
- package/artifacts/contracts/GenArt721CoreV3_Explorations_Flex.sol/GenArt721CoreV3_Explorations_Flex.json +3192 -0
- package/artifacts/contracts/OwnedCreate2FactoryV0.sol/OwnedCreate2FactoryV0.json +2 -2
- package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +27 -2
- package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +27 -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 +25 -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 +28 -2
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +239 -20
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +267 -48
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +27 -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 +27 -2
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +25 -0
- package/artifacts/contracts/engine/V3/transfer-hooks/AbstractTransferHook.sol/AbstractTransferHook.json +79 -0
- package/artifacts/contracts/engine/V3/transfer-hooks/OwnerHistoryTransferHook.sol/OwnerHistoryTransferHook.json +315 -0
- package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/GenArt721GeneratorV0.json +2 -2
- package/artifacts/contracts/interfaces/v0.8.x/IClaimMinter.sol/IClaimMinter.json +189 -0
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +149 -0
- package/artifacts/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol/IEngineFactoryV0.json +26 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +25 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +25 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +123 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +123 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +25 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +25 -0
- package/artifacts/contracts/interfaces/v0.8.x/IMintTimeAndTransferCountHooks.sol/IMintTimeAndTransferCountHooks.json +356 -0
- package/artifacts/contracts/interfaces/v0.8.x/IOwnerHistoryTransferHook.sol/IOwnerHistoryTransferHook.json +299 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISRHooks.sol/ISRHooks.json +432 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol/ISeaDropShimForContract.json +0 -13
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterTieredAllowV0.sol/ISharedMinterTieredAllowV0.json +94 -0
- package/artifacts/contracts/interfaces/v0.8.x/ITransferHook.sol/ITransferHook.json +63 -0
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageReader.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageWriter.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/ENSLib.sol/ENSLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/ENSLib.sol/IUniversalResolver.json +45 -0
- package/artifacts/contracts/libs/v0.8.x/EnumerableSetUint16.sol/EnumerableSetUint16.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/FeistelWalkLib.sol/FeistelWalkLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/ImmutableUint16Array.sol/ImmutableUint16Array.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/V3EngineLib.sol/V3EngineLib.json +163 -0
- package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/V3TransferHookLib.sol/V3TransferHookLib.json +79 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/OnChainAllowlistLib.sol/OnChainAllowlistLib.json +10 -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 +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterMinPriceV0.sol/MinterMinPriceV0.json +2 -2
- 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/MinterSetPriceOnChainAllowV0.sol/MinterSetPriceOnChainAllowV0.json +522 -0
- 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/MinterSetPriceTieredAllowV1.sol/MinterSetPriceTieredAllowV1.json +715 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSlidingScaleV0.sol/MinterSlidingScaleV0.json +431 -0
- package/artifacts/contracts/minter-suite/Minters/one-off/ClaimMinter.sol/ClaimMinter.json +502 -0
- package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceTieredOnChainAllowV0.sol/MinterSetPriceTieredOnChainAllowV0.json +673 -0
- 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 +6 -19
- package/artifacts/contracts/mock/BytecodeV2TextCR_DMock.sol/BytecodeV2TextCR_DMock.json +2 -2
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/ENSLibMock.sol/ENSLibMock.json +30 -0
- package/artifacts/contracts/mock/EnumerableSetUint16Mock.sol/EnumerableSetUint16Mock.json +146 -0
- package/artifacts/contracts/mock/FeistelWalkLibMock.sol/FeistelWalkLibMock.json +142 -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/ImmutableUint16ArrayMock.sol/ImmutableUint16ArrayMock.json +89 -0
- package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
- package/artifacts/contracts/mock/MockGenArt721V3Core.sol/MockGenArt721V3Core.json +490 -0
- package/artifacts/contracts/mock/MockPMP.sol/MockPMP.json +523 -0
- package/artifacts/contracts/mock/MockTransferHook.sol/MockTransferHook.json +453 -0
- package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockBatchTransferrer.json +39 -0
- package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockForwardingERC721Receiver.json +71 -0
- package/artifacts/contracts/mock/MockTransferHookTestHelpers.sol/MockSpoofingCore.json +94 -0
- package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyBatchMockShared.sol/IBatchMinter.json +64 -0
- package/artifacts/contracts/mock/ReentrancyBatchMockShared.sol/ReentrancyBatchMockShared.json +113 -0
- package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/MockTarget.json +74 -0
- package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/RelayExecutorPartialRevertsTestHelper.json +138 -0
- package/artifacts/contracts/mock/RelayExecutorTestHelper.sol/RelayExecutorTestHelper.json +119 -0
- 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/relay/RelayExecutor.sol/RelayExecutor.json +101 -0
- package/artifacts/contracts/relay/RelayExecutorPartialReverts.sol/RelayExecutorPartialReverts.json +120 -0
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverrideSplits.sol/GenArt721RoyaltyOverrideSplits.json +263 -0
- package/artifacts/contracts/utils/MintMulticallUtil.sol/IMinterSetPriceV5.json +40 -0
- package/artifacts/contracts/utils/MintMulticallUtil.sol/MintMulticallUtil.json +163 -0
- package/artifacts/contracts/web3call/PMPV0.sol/PMPV0.json +2 -2
- package/artifacts/contracts/web3call/PMPV1.sol/PMPV1.json +648 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBaseGasFee.sol/InjectBaseGasFee.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeight.sol/InjectBlockHeight.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightAndArtistProjectOverrides.sol/InjectBlockHeightAndArtistProjectOverrides.json +226 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightAndNumOwnedProjectTokens.sol/InjectBlockHeightAndNumOwnedProjectTokens.json +182 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.sol/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.json +226 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBlockTimestamp.sol/InjectBlockTimestamp.json +83 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectBytesPerToken.sol/InjectBytesPerToken.json +358 -0
- package/artifacts/contracts/web3call/augment-hooks/InjectChromieSquiggleFloorPrice.sol/InjectChromieSquiggleFloorPrice.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectIsNounsDaoMember.sol/InjectIsNounsDaoMember.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol/InjectIsProjectFullyMinted.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectPolyptychTokenHash.sol/InjectPolyptychTokenHash.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol/InjectTokenHashSeed.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwner.sol/InjectTokenOwner.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol/InjectTokenOwnerEthBalance.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/InjectUSDCTotalSupply.sol/InjectUSDCTotalSupply.json +2 -2
- package/artifacts/contracts/web3call/augment-hooks/SRHooks.sol/SRHooks.json +899 -0
- package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/IGenArt721V0_Minimal.json +30 -0
- package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/IRelic.json +35 -0
- package/artifacts/contracts/web3call/combined-hooks/LiftHooks.sol/LiftHooks.json +256 -0
- package/artifacts/contracts/web3call/combined-hooks/MintTimeAndTransferCountHooks.sol/MintTimeAndTransferCountHooks.json +435 -0
- package/artifacts/contracts/web3call/configure-hooks/{abstractPMPConfigureHook.sol → AbstractPMPConfigureHook.sol}/AbstractPMPConfigureHook.json +1 -1
- package/artifacts/contracts/web3call/configure-hooks/PMPConfigureLockHook.sol/PMPConfigureLockHook.json +195 -0
- package/contracts/AdminACLV0RoyaltyRegistry.sol +142 -0
- package/contracts/DependencyRegistryV0.sol +143 -13
- package/contracts/GenArt721CoreV3_Curated.sol +1 -1
- package/contracts/GenArt721CoreV3_Curated_Flex.sol +173 -0
- package/contracts/GenArt721CoreV3_Explorations_Flex.sol +159 -0
- package/contracts/engine/V3/EngineFactoryV0.sol +20 -1
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +286 -299
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +292 -301
- package/contracts/engine/V3/transfer-hooks/AbstractTransferHook.sol +101 -0
- package/contracts/engine/V3/transfer-hooks/OwnerHistoryTransferHook.sol +291 -0
- package/contracts/generator/GenArt721GeneratorV0.sol +145 -47
- package/contracts/helpers/ERC1967ProxyImport.sol +5 -0
- package/contracts/interfaces/v0.8.x/IArtblocksRoyaltyOverride.sol +1 -1
- package/contracts/interfaces/v0.8.x/IClaimMinter.sol +70 -0
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +95 -0
- package/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol +15 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +21 -2
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +72 -0
- package/contracts/interfaces/v0.8.x/IMintTimeAndTransferCountHooks.sol +125 -0
- package/contracts/interfaces/v0.8.x/IOwnerHistoryTransferHook.sol +119 -0
- package/contracts/interfaces/v0.8.x/ISRHooks.sol +229 -0
- package/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol +0 -6
- package/contracts/interfaces/v0.8.x/ISharedMinterTieredAllowV0.sol +69 -0
- package/contracts/interfaces/v0.8.x/ITransferHook.sol +48 -0
- package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +12 -0
- package/contracts/libs/v0.8.x/ENSLib.sol +85 -0
- package/contracts/libs/v0.8.x/EnumerableSetUint16.sol +429 -0
- package/contracts/libs/v0.8.x/FeistelWalkLib.sol +221 -0
- package/contracts/libs/v0.8.x/ImmutableUint16Array.sol +201 -0
- package/contracts/libs/v0.8.x/V3EngineLib.sol +490 -0
- package/contracts/libs/v0.8.x/V3TransferHookLib.sol +251 -0
- package/contracts/libs/v0.8.x/minter-libs/OnChainAllowlistLib.sol +165 -0
- package/contracts/minter-suite/Minters/MinterSetPriceOnChainAllowV0.sol +632 -0
- package/contracts/minter-suite/Minters/MinterSetPriceTieredAllowV1.sol +871 -0
- package/contracts/minter-suite/Minters/MinterSlidingScaleV0.sol +493 -0
- package/contracts/minter-suite/Minters/one-off/ClaimMinter.sol +595 -0
- package/contracts/minter-suite/Minters/one-off/MinterSetPriceTieredOnChainAllowV0.sol +894 -0
- package/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol +59 -41
- package/contracts/mock/ENSLibMock.sol +25 -0
- package/contracts/mock/EnumerableSetUint16Mock.sol +88 -0
- package/contracts/mock/FeistelWalkLibMock.sol +81 -0
- package/contracts/mock/ImmutableUint16ArrayMock.sol +62 -0
- package/contracts/mock/MockGenArt721V3Core.sol +416 -0
- package/contracts/mock/MockPMP.sol +287 -0
- package/contracts/mock/MockTransferHook.sol +160 -0
- package/contracts/mock/MockTransferHookTestHelpers.sol +96 -0
- package/contracts/mock/ReentrancyBatchMockShared.sol +53 -0
- package/contracts/mock/RelayExecutorTestHelper.sol +44 -0
- package/contracts/relay/RelayExecutor.sol +61 -0
- package/contracts/relay/RelayExecutorPartialReverts.sol +79 -0
- package/contracts/royalty-registry/GenArt721RoyaltyOverrideSplits.sol +130 -0
- package/contracts/utils/MintMulticallUtil.sol +103 -0
- package/contracts/web3call/PMPV1.sol +1204 -0
- package/contracts/web3call/augment-hooks/AbstractPMPAugmentHook.sol +1 -1
- package/contracts/web3call/augment-hooks/InjectBaseGasFee.sol +1 -1
- package/contracts/web3call/augment-hooks/InjectBlockHeight.sol +57 -0
- package/contracts/web3call/augment-hooks/InjectBlockHeightAndArtistProjectOverrides.sol +310 -0
- package/contracts/web3call/augment-hooks/InjectBlockHeightAndNumOwnedProjectTokens.sol +141 -0
- package/contracts/web3call/augment-hooks/InjectBlockHeightProjectInvocationsAndArtistProjectOverrides.sol +326 -0
- package/contracts/web3call/augment-hooks/InjectBlockTimestamp.sol +57 -0
- package/contracts/web3call/augment-hooks/InjectBytesPerToken.sol +279 -0
- package/contracts/web3call/augment-hooks/InjectIsProjectFullyMinted.sol +1 -1
- package/contracts/web3call/augment-hooks/InjectTokenHashSeed.sol +1 -1
- package/contracts/web3call/augment-hooks/InjectTokenOwner.sol +1 -1
- package/contracts/web3call/augment-hooks/InjectTokenOwnerEthBalance.sol +1 -1
- package/contracts/web3call/augment-hooks/SRHooks.sol +1722 -0
- package/contracts/web3call/combined-hooks/LiftHooks.sol +304 -0
- package/contracts/web3call/combined-hooks/MintTimeAndTransferCountHooks.sol +483 -0
- package/contracts/web3call/configure-hooks/{abstractPMPConfigureHook.sol → AbstractPMPConfigureHook.sol} +1 -1
- package/contracts/web3call/configure-hooks/PMPConfigureLockHook.sol +107 -0
- package/package.json +40 -24
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
// @dev fixed to specific solidity version for clarity and for more clear
|
|
5
|
+
// source code verification purposes.
|
|
6
|
+
pragma solidity 0.8.22;
|
|
7
|
+
|
|
8
|
+
import {AbstractTransferHook} from "../../engine/V3/transfer-hooks/AbstractTransferHook.sol";
|
|
9
|
+
import {AbstractPMPAugmentHook} from "../augment-hooks/AbstractPMPAugmentHook.sol";
|
|
10
|
+
|
|
11
|
+
import {IMintTimeAndTransferCountHooks} from "../../interfaces/v0.8.x/IMintTimeAndTransferCountHooks.sol";
|
|
12
|
+
import {ITransferHook} from "../../interfaces/v0.8.x/ITransferHook.sol";
|
|
13
|
+
import {IPMPAugmentHook} from "../../interfaces/v0.8.x/IPMPAugmentHook.sol";
|
|
14
|
+
import {IPMPV0} from "../../interfaces/v0.8.x/IPMPV0.sol";
|
|
15
|
+
import {IGenArt721CoreContractV3_Engine} from "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol";
|
|
16
|
+
import {IWeb3Call} from "../../interfaces/v0.8.x/IWeb3Call.sol";
|
|
17
|
+
|
|
18
|
+
import {ABHelpers} from "../../libs/v0.8.x/ABHelpers.sol";
|
|
19
|
+
|
|
20
|
+
import {Strings} from "@openzeppelin-5.0/contracts/utils/Strings.sol";
|
|
21
|
+
import {IERC165} from "@openzeppelin-5.0/contracts/interfaces/IERC165.sol";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @title Mint-time and transfer-count combined hook
|
|
25
|
+
* @author Art Blocks Inc.
|
|
26
|
+
* @notice Reference combined hook. Records each token's mint timestamp and
|
|
27
|
+
* subsequent transfer count on chain, and injects those values — plus live
|
|
28
|
+
* seconds since mint — into the token's PostParams when they are read.
|
|
29
|
+
* Optionally writes `transferCount` as a real PMP so transfers emit
|
|
30
|
+
* `TokenParamsConfigured` and can trigger off-chain re-renders.
|
|
31
|
+
* ----------------------------------------------------------------------------
|
|
32
|
+
* A single deployment serves every project on the bound PMP, on every v3.3+
|
|
33
|
+
* Engine core on the network, that configures this address as its transfer
|
|
34
|
+
* hook. There is no owner and no allowlist. Constructor takes the PMP
|
|
35
|
+
* contract this hook is authorized to write to (`address(0)` to skip PMP
|
|
36
|
+
* writes). An artist points their project at this address as follows:
|
|
37
|
+
*
|
|
38
|
+
* 1. Core transfer hook, via `configureProjectTransferHook` on a v3.3+ Engine
|
|
39
|
+
* or Engine Flex core. This is what records mint time (`from == address(0)`)
|
|
40
|
+
* and increments transfer count. May be made permanent with
|
|
41
|
+
* `lockProjectTransferHook`.
|
|
42
|
+
* 2. PMP project param (optional, required for a populated `transferCount`
|
|
43
|
+
* PMP from mint and for transfer-triggered re-renders), via
|
|
44
|
+
* `configureProject` on the bound PMP. Configure a param with:
|
|
45
|
+
* - key: `transferCount`
|
|
46
|
+
* - `authOption`: `Address`
|
|
47
|
+
* - `authAddress`: this hook
|
|
48
|
+
* - `paramType`: `Uint256Range`
|
|
49
|
+
* - `minRange`: 0
|
|
50
|
+
* - `maxRange`: `type(uint256).max` (do not set a small max — a transfer
|
|
51
|
+
* that would exceed it will skip the PMP write rather than revert)
|
|
52
|
+
* - `pmpLockedAfterTimestamp`: 0 (do not lock this param). On PMPV1 a
|
|
53
|
+
* passed lock timestamp also freezes token values and later writes are
|
|
54
|
+
* skipped; PMPV0 only locks further project-config changes.
|
|
55
|
+
* Do **not** set this contract as `tokenPMPPostConfigHook`. An existing
|
|
56
|
+
* post-config hook on the project still runs on every `transferCount`
|
|
57
|
+
* write; if it reverts, the PMP write is skipped and the mint or transfer
|
|
58
|
+
* still succeeds.
|
|
59
|
+
* 3. PMP read-augmentation hook, via `configureProjectHooks` on the same PMP,
|
|
60
|
+
* passing this address as `tokenPMPReadAugmentationHook`. This injects
|
|
61
|
+
* `mintTimestamp`, live `secondsSinceMint`, and `transferCount` on read.
|
|
62
|
+
*
|
|
63
|
+
* Transfer-hook-only still records state, which other contracts (including an
|
|
64
|
+
* artwork script through the on-chain generator) can read via the view
|
|
65
|
+
* functions. Augment-hook-only injects zeros, because nothing was recorded.
|
|
66
|
+
* PMP Address-auth without the transfer hook never writes, because only this
|
|
67
|
+
* contract is authorized.
|
|
68
|
+
* ----------------------------------------------------------------------------
|
|
69
|
+
* POSTPARAMS. On each read this hook copies the input params, drops any
|
|
70
|
+
* existing entries whose keys collide with the keys below (this hook is the
|
|
71
|
+
* source of truth for them), and appends:
|
|
72
|
+
*
|
|
73
|
+
* - `mintTimestamp`: unix seconds of the mint block, as a decimal string.
|
|
74
|
+
* `"0"` if this hook did not observe the mint.
|
|
75
|
+
* - `secondsSinceMint`: `block.timestamp - mintTimestamp` at the time of the
|
|
76
|
+
* read, as a decimal string. `"0"` if the mint was not observed.
|
|
77
|
+
* - `transferCount`: ownership-changing transfers after mint, as a decimal
|
|
78
|
+
* string. Does not include the mint itself. `"0"` until a post-mint transfer
|
|
79
|
+
* is recorded.
|
|
80
|
+
*
|
|
81
|
+
* `secondsSinceMint` is computed at read time, so two reads of the same token
|
|
82
|
+
* in different blocks return different values. It is not stored as a PMP.
|
|
83
|
+
*
|
|
84
|
+
* `transferCount` is additionally written to the bound PMP at mint (`0`) and
|
|
85
|
+
* on each counted transfer when the project has configured that key with
|
|
86
|
+
* Address auth as described above. That write emits `TokenParamsConfigured`
|
|
87
|
+
* from the PMP contract, so the param is populated from the first render and
|
|
88
|
+
* later transfers can trigger off-chain re-renders. Do not also configure
|
|
89
|
+
* `mintTimestamp` or `secondsSinceMint` as project PMPs — they are
|
|
90
|
+
* inject-only.
|
|
91
|
+
* ----------------------------------------------------------------------------
|
|
92
|
+
* COMPLETENESS. Mint timestamp is only recorded if this hook was the project's
|
|
93
|
+
* transfer hook at mint. A hook configured mid-life starts counting transfers
|
|
94
|
+
* from the first ownership change it sees; `isTrackedFromMint` is false and
|
|
95
|
+
* `mintTimestamp` / `secondsSinceMint` stay `0`. Historical transfers from
|
|
96
|
+
* before configuration are not backfilled. If the project's transfer hook is
|
|
97
|
+
* later cleared, recording stops — values already written stay readable and
|
|
98
|
+
* the augment hook will keep injecting them.
|
|
99
|
+
* ----------------------------------------------------------------------------
|
|
100
|
+
* TRANSFER COUNT. Incremented for each ownership-changing transfer after mint.
|
|
101
|
+
* Not incremented for:
|
|
102
|
+
* - the mint itself (`from == address(0)`)
|
|
103
|
+
* - ERC-721 self-transfers (`from == to`), which do not change ownership
|
|
104
|
+
*
|
|
105
|
+
* Cores do not currently burn; a burn (`to == address(0)`) would count.
|
|
106
|
+
* ----------------------------------------------------------------------------
|
|
107
|
+
* GAS. State is one packed storage slot per token (`uint64` mint timestamp +
|
|
108
|
+
* `uint64` transfer count). Both sets of figures below are deltas against an
|
|
109
|
+
* otherwise identical project with no hook, on the same `GenArt721CoreV3_Engine`
|
|
110
|
+
* core, so they may be compared directly. Without a PMP write:
|
|
111
|
+
*
|
|
112
|
+
* - a mint costs about 40,500 gas more. Most of it is the new storage slot
|
|
113
|
+
* plus the core's reentrancy flag, which any hook pays.
|
|
114
|
+
* - a transfer costs about 28,100 gas more — an SSTORE update of the packed
|
|
115
|
+
* count, plus the same reentrancy flag.
|
|
116
|
+
*
|
|
117
|
+
* A successful PMP `configureTokenParams` write on mint or transfer is extra
|
|
118
|
+
* on top of that. With Address-auth `transferCount` writes enabled:
|
|
119
|
+
*
|
|
120
|
+
* - a mint costs about 92,700 gas more (about 52,200 for the PMP write)
|
|
121
|
+
* - a transfer costs about 78,300 gas more (about 50,200 for the PMP write)
|
|
122
|
+
*
|
|
123
|
+
* See the gas tests in `mint-time-and-transfer-count-hooks.test.ts` for the
|
|
124
|
+
* bounds that keep these figures honest.
|
|
125
|
+
* ----------------------------------------------------------------------------
|
|
126
|
+
* SAFETY. A reverting hook aborts the transfer that invoked it, so a hook that
|
|
127
|
+
* can revert can make a token permanently non-transferable. Local recording
|
|
128
|
+
* cannot revert on a transfer of a project that has this hook configured: the
|
|
129
|
+
* only revert path is the configuration check below, which is true by
|
|
130
|
+
* construction whenever the core actually dispatches to this address.
|
|
131
|
+
* The PMP write is `try`/`catch`'d — a missing, locked, or out-of-range
|
|
132
|
+
* `transferCount` param emits `TransferCountPMPSyncFailed` and does **not**
|
|
133
|
+
* revert the transfer. The augment path is `view` and returns zeros rather
|
|
134
|
+
* than reverting when a token has not been recorded.
|
|
135
|
+
*/
|
|
136
|
+
contract MintTimeAndTransferCountHooks is
|
|
137
|
+
AbstractTransferHook,
|
|
138
|
+
AbstractPMPAugmentHook,
|
|
139
|
+
IMintTimeAndTransferCountHooks
|
|
140
|
+
{
|
|
141
|
+
using Strings for uint256;
|
|
142
|
+
|
|
143
|
+
/// @notice PostParam key for the unix seconds of the mint block.
|
|
144
|
+
string public constant PARAM_KEY_MINT_TIMESTAMP = "mintTimestamp";
|
|
145
|
+
/// @notice PostParam key for live seconds since the recorded mint.
|
|
146
|
+
string public constant PARAM_KEY_SECONDS_SINCE_MINT = "secondsSinceMint";
|
|
147
|
+
/// @notice PostParam key for post-mint ownership-changing transfer count.
|
|
148
|
+
string public constant PARAM_KEY_TRANSFER_COUNT = "transferCount";
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @notice PMP contract this hook writes `transferCount` to.
|
|
152
|
+
* @dev `address(0)` skips PMP writes. One deployment per PMP instance.
|
|
153
|
+
*/
|
|
154
|
+
IPMPV0 public immutable pmp;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* @param pmp_ PMP contract this hook is authorized to write `transferCount`
|
|
158
|
+
* on. Pass `address(0)` to disable PMP writes (transfer-hook-only).
|
|
159
|
+
*/
|
|
160
|
+
constructor(address pmp_) {
|
|
161
|
+
pmp = IPMPV0(pmp_);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @notice Per-token state, keyed by core contract.
|
|
166
|
+
* @dev Keying by `coreContract` is what makes a single shared deployment
|
|
167
|
+
* safe: `AbstractTransferHook` guarantees `coreContract == msg.sender`, so
|
|
168
|
+
* a contract impersonating a core can only ever write beneath its own
|
|
169
|
+
* address, where nothing reads. The configuration check in
|
|
170
|
+
* `_onTokenTransfer` is a second, independent guard.
|
|
171
|
+
*/
|
|
172
|
+
mapping(address coreContract => mapping(uint256 tokenId => TokenTransferState))
|
|
173
|
+
private _state;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @notice Record a mint timestamp or increment transfer count.
|
|
177
|
+
* @dev Called by the core after the ERC-721 ownership write, and on mint
|
|
178
|
+
* after the token hash seed is assigned.
|
|
179
|
+
* @param coreContract Core that performed the ownership update. Guaranteed
|
|
180
|
+
* by `AbstractTransferHook` to equal `msg.sender`.
|
|
181
|
+
* @param tokenId Token whose ownership changed.
|
|
182
|
+
* @param from Previous owner; `address(0)` on mint.
|
|
183
|
+
* @param to New owner.
|
|
184
|
+
*/
|
|
185
|
+
function _onTokenTransfer(
|
|
186
|
+
address coreContract,
|
|
187
|
+
uint256 tokenId,
|
|
188
|
+
address from,
|
|
189
|
+
address to,
|
|
190
|
+
address /* operator */
|
|
191
|
+
) internal override {
|
|
192
|
+
_onlyConfiguredForProject({
|
|
193
|
+
coreContract: coreContract,
|
|
194
|
+
projectId: ABHelpers.tokenIdToProjectId(tokenId)
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// @dev ERC-721 permits `transferFrom(a, a, id)`. Ownership did not
|
|
198
|
+
// change, so counting it would inflate `transferCount`.
|
|
199
|
+
if (from == to) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
TokenTransferState storage state = _state[coreContract][tokenId];
|
|
204
|
+
|
|
205
|
+
if (from == address(0)) {
|
|
206
|
+
// mint: record timestamp once, do not count as a transfer, and
|
|
207
|
+
// write transferCount=0 so the PMP is populated from first render
|
|
208
|
+
if (state.mintTimestamp == 0) {
|
|
209
|
+
// @dev uint64 seconds is not a practical bound; no cast check
|
|
210
|
+
uint64 timestamp = uint64(block.timestamp);
|
|
211
|
+
state.mintTimestamp = timestamp;
|
|
212
|
+
emit MintTimestampRecorded({
|
|
213
|
+
coreContract: coreContract,
|
|
214
|
+
tokenId: tokenId,
|
|
215
|
+
timestamp: timestamp
|
|
216
|
+
});
|
|
217
|
+
_syncTransferCountToPMP({
|
|
218
|
+
coreContract: coreContract,
|
|
219
|
+
tokenId: tokenId,
|
|
220
|
+
newCount: 0
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
uint64 newCount = state.transferCount + 1;
|
|
227
|
+
state.transferCount = newCount;
|
|
228
|
+
emit TransferCounted({
|
|
229
|
+
coreContract: coreContract,
|
|
230
|
+
tokenId: tokenId,
|
|
231
|
+
transferCount: newCount,
|
|
232
|
+
from: from,
|
|
233
|
+
to: to
|
|
234
|
+
});
|
|
235
|
+
_syncTransferCountToPMP({
|
|
236
|
+
coreContract: coreContract,
|
|
237
|
+
tokenId: tokenId,
|
|
238
|
+
newCount: newCount
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* @notice Augment the token parameters for a given token.
|
|
244
|
+
* Copies the input params, drops any entries whose keys collide with this
|
|
245
|
+
* hook's reserved keys, and appends `mintTimestamp`, `secondsSinceMint`,
|
|
246
|
+
* and `transferCount` as decimal strings.
|
|
247
|
+
* @dev This hook is called when a token's PostParams are read.
|
|
248
|
+
* @dev This must return all desired tokenParams, not just additional data.
|
|
249
|
+
* @param coreContract The address of the core contract of the queried token.
|
|
250
|
+
* @param tokenId The tokenId of the queried token.
|
|
251
|
+
* @param tokenParams The token parameters for the queried token.
|
|
252
|
+
* @return augmentedTokenParams The augmented token parameters.
|
|
253
|
+
*/
|
|
254
|
+
function onTokenPMPReadAugmentation(
|
|
255
|
+
address coreContract,
|
|
256
|
+
uint256 tokenId,
|
|
257
|
+
IWeb3Call.TokenParam[] calldata tokenParams
|
|
258
|
+
)
|
|
259
|
+
external
|
|
260
|
+
view
|
|
261
|
+
override(AbstractPMPAugmentHook, IPMPAugmentHook)
|
|
262
|
+
returns (IWeb3Call.TokenParam[] memory augmentedTokenParams)
|
|
263
|
+
{
|
|
264
|
+
uint256 originalLength = tokenParams.length;
|
|
265
|
+
// at most originalLength kept entries + 3 injected keys
|
|
266
|
+
uint256 augmentedMaxLength = originalLength + 3;
|
|
267
|
+
augmentedTokenParams = new IWeb3Call.TokenParam[](augmentedMaxLength);
|
|
268
|
+
|
|
269
|
+
bytes32 hashedMintTimestamp = keccak256(
|
|
270
|
+
bytes(PARAM_KEY_MINT_TIMESTAMP)
|
|
271
|
+
);
|
|
272
|
+
bytes32 hashedSecondsSinceMint = keccak256(
|
|
273
|
+
bytes(PARAM_KEY_SECONDS_SINCE_MINT)
|
|
274
|
+
);
|
|
275
|
+
bytes32 hashedTransferCount = keccak256(
|
|
276
|
+
bytes(PARAM_KEY_TRANSFER_COUNT)
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
uint256 j;
|
|
280
|
+
for (uint256 i; i < originalLength; ) {
|
|
281
|
+
bytes32 hashedKey = keccak256(bytes(tokenParams[i].key));
|
|
282
|
+
if (
|
|
283
|
+
hashedKey != hashedMintTimestamp &&
|
|
284
|
+
hashedKey != hashedSecondsSinceMint &&
|
|
285
|
+
hashedKey != hashedTransferCount
|
|
286
|
+
) {
|
|
287
|
+
augmentedTokenParams[j] = tokenParams[i];
|
|
288
|
+
unchecked {
|
|
289
|
+
++j;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
unchecked {
|
|
293
|
+
++i;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
TokenTransferState memory state = _state[coreContract][tokenId];
|
|
298
|
+
uint256 recordedMintTimestamp = uint256(state.mintTimestamp);
|
|
299
|
+
uint256 elapsed = _secondsSinceMint({
|
|
300
|
+
recordedMintTimestamp: recordedMintTimestamp
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
augmentedTokenParams[j] = IWeb3Call.TokenParam({
|
|
304
|
+
key: PARAM_KEY_MINT_TIMESTAMP,
|
|
305
|
+
value: recordedMintTimestamp.toString()
|
|
306
|
+
});
|
|
307
|
+
unchecked {
|
|
308
|
+
++j;
|
|
309
|
+
}
|
|
310
|
+
augmentedTokenParams[j] = IWeb3Call.TokenParam({
|
|
311
|
+
key: PARAM_KEY_SECONDS_SINCE_MINT,
|
|
312
|
+
value: elapsed.toString()
|
|
313
|
+
});
|
|
314
|
+
unchecked {
|
|
315
|
+
++j;
|
|
316
|
+
}
|
|
317
|
+
augmentedTokenParams[j] = IWeb3Call.TokenParam({
|
|
318
|
+
key: PARAM_KEY_TRANSFER_COUNT,
|
|
319
|
+
value: uint256(state.transferCount).toString()
|
|
320
|
+
});
|
|
321
|
+
unchecked {
|
|
322
|
+
++j;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// shorten to the populated length (original minus stripped plus 3)
|
|
326
|
+
assembly {
|
|
327
|
+
mstore(augmentedTokenParams, j)
|
|
328
|
+
}
|
|
329
|
+
return augmentedTokenParams;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* @inheritdoc IMintTimeAndTransferCountHooks
|
|
334
|
+
*/
|
|
335
|
+
function tokenTransferState(
|
|
336
|
+
address coreContract,
|
|
337
|
+
uint256 tokenId
|
|
338
|
+
) external view returns (TokenTransferState memory state) {
|
|
339
|
+
return _state[coreContract][tokenId];
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* @inheritdoc IMintTimeAndTransferCountHooks
|
|
344
|
+
*/
|
|
345
|
+
function mintTimestamp(
|
|
346
|
+
address coreContract,
|
|
347
|
+
uint256 tokenId
|
|
348
|
+
) external view returns (uint256) {
|
|
349
|
+
return uint256(_state[coreContract][tokenId].mintTimestamp);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* @inheritdoc IMintTimeAndTransferCountHooks
|
|
354
|
+
*/
|
|
355
|
+
function transferCount(
|
|
356
|
+
address coreContract,
|
|
357
|
+
uint256 tokenId
|
|
358
|
+
) external view returns (uint256) {
|
|
359
|
+
return uint256(_state[coreContract][tokenId].transferCount);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @inheritdoc IMintTimeAndTransferCountHooks
|
|
364
|
+
*/
|
|
365
|
+
function secondsSinceMint(
|
|
366
|
+
address coreContract,
|
|
367
|
+
uint256 tokenId
|
|
368
|
+
) external view returns (uint256) {
|
|
369
|
+
return
|
|
370
|
+
_secondsSinceMint({
|
|
371
|
+
recordedMintTimestamp: uint256(
|
|
372
|
+
_state[coreContract][tokenId].mintTimestamp
|
|
373
|
+
)
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* @inheritdoc IMintTimeAndTransferCountHooks
|
|
379
|
+
*/
|
|
380
|
+
function isTrackedFromMint(
|
|
381
|
+
address coreContract,
|
|
382
|
+
uint256 tokenId
|
|
383
|
+
) external view returns (bool) {
|
|
384
|
+
return _state[coreContract][tokenId].mintTimestamp != 0;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @notice Write `transferCount` to the bound PMP as the Address-auth
|
|
389
|
+
* caller, including `0` at mint so the param exists before any transfer.
|
|
390
|
+
* Failures are swallowed so a misconfigured PMP cannot brick mints or
|
|
391
|
+
* transfers.
|
|
392
|
+
*/
|
|
393
|
+
function _syncTransferCountToPMP(
|
|
394
|
+
address coreContract,
|
|
395
|
+
uint256 tokenId,
|
|
396
|
+
uint64 newCount
|
|
397
|
+
) private {
|
|
398
|
+
if (address(pmp) == address(0)) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
IPMPV0.PMPInput[] memory pmpInputs = new IPMPV0.PMPInput[](1);
|
|
402
|
+
pmpInputs[0] = IPMPV0.PMPInput({
|
|
403
|
+
key: PARAM_KEY_TRANSFER_COUNT,
|
|
404
|
+
configuredParamType: IPMPV0.ParamType.Uint256Range,
|
|
405
|
+
configuredValue: bytes32(uint256(newCount)),
|
|
406
|
+
configuringArtistString: false,
|
|
407
|
+
configuredValueString: ""
|
|
408
|
+
});
|
|
409
|
+
try
|
|
410
|
+
pmp.configureTokenParams(coreContract, tokenId, pmpInputs)
|
|
411
|
+
{} catch {
|
|
412
|
+
emit TransferCountPMPSyncFailed({
|
|
413
|
+
coreContract: coreContract,
|
|
414
|
+
tokenId: tokenId,
|
|
415
|
+
transferCount: newCount
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @notice Live seconds since `recordedMintTimestamp`. `0` when the mint
|
|
422
|
+
* was not observed or `block.timestamp` is not after it.
|
|
423
|
+
*/
|
|
424
|
+
function _secondsSinceMint(
|
|
425
|
+
uint256 recordedMintTimestamp
|
|
426
|
+
) private view returns (uint256) {
|
|
427
|
+
if (
|
|
428
|
+
recordedMintTimestamp == 0 ||
|
|
429
|
+
block.timestamp < recordedMintTimestamp
|
|
430
|
+
) {
|
|
431
|
+
return 0;
|
|
432
|
+
}
|
|
433
|
+
return block.timestamp - recordedMintTimestamp;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* @notice Revert unless `coreContract` has this hook configured for
|
|
438
|
+
* `projectId`.
|
|
439
|
+
* @dev This is the `ITransferHook` requirement that an implementation
|
|
440
|
+
* verify which cores it serves, answered without any configuration of its
|
|
441
|
+
* own: the set of cores this hook serves is exactly the set that points at
|
|
442
|
+
* it. A contract impersonating a core could answer this call dishonestly,
|
|
443
|
+
* which is why it is a second guard rather than the only one — the storage
|
|
444
|
+
* keyed by `coreContract` already confines such a caller to its own
|
|
445
|
+
* namespace.
|
|
446
|
+
*/
|
|
447
|
+
function _onlyConfiguredForProject(
|
|
448
|
+
address coreContract,
|
|
449
|
+
uint256 projectId
|
|
450
|
+
) private view {
|
|
451
|
+
(address configuredHook, ) = IGenArt721CoreContractV3_Engine(
|
|
452
|
+
coreContract
|
|
453
|
+
).projectTransferHookConfig(projectId);
|
|
454
|
+
if (configuredHook != address(this)) {
|
|
455
|
+
revert HookNotConfiguredForProject({
|
|
456
|
+
coreContract: coreContract,
|
|
457
|
+
projectId: projectId,
|
|
458
|
+
configuredHook: configuredHook
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @notice Indicates support for `ITransferHook` (required by v3.3 cores)
|
|
465
|
+
* and `IPMPAugmentHook` (required by PMP before a read-augmentation hook
|
|
466
|
+
* may be configured).
|
|
467
|
+
*/
|
|
468
|
+
function supportsInterface(
|
|
469
|
+
bytes4 interfaceId
|
|
470
|
+
)
|
|
471
|
+
public
|
|
472
|
+
view
|
|
473
|
+
virtual
|
|
474
|
+
override(AbstractTransferHook, AbstractPMPAugmentHook, IERC165)
|
|
475
|
+
returns (bool)
|
|
476
|
+
{
|
|
477
|
+
return
|
|
478
|
+
interfaceId == type(IMintTimeAndTransferCountHooks).interfaceId ||
|
|
479
|
+
interfaceId == type(ITransferHook).interfaceId ||
|
|
480
|
+
interfaceId == type(IPMPAugmentHook).interfaceId ||
|
|
481
|
+
super.supportsInterface(interfaceId);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
@@ -33,7 +33,7 @@ abstract contract AbstractPMPConfigureHook is IPMPConfigureHook, ERC165 {
|
|
|
33
33
|
|
|
34
34
|
function supportsInterface(
|
|
35
35
|
bytes4 interfaceId
|
|
36
|
-
) public view override(ERC165, IERC165) returns (bool) {
|
|
36
|
+
) public view virtual override(ERC165, IERC165) returns (bool) {
|
|
37
37
|
return
|
|
38
38
|
interfaceId == type(IPMPConfigureHook).interfaceId ||
|
|
39
39
|
super.supportsInterface(interfaceId);
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity 0.8.22;
|
|
5
|
+
|
|
6
|
+
import {AbstractPMPConfigureHook} from "./AbstractPMPConfigureHook.sol";
|
|
7
|
+
|
|
8
|
+
import {IPMPV0} from "../../interfaces/v0.8.x/IPMPV0.sol";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @title PMPConfigureLockHook
|
|
12
|
+
* @author Art Blocks Inc.
|
|
13
|
+
* @notice A generic post-configuration hook that enforces per-parameter value locks on a
|
|
14
|
+
* PMPV0 project. For each configured key, an artist-chosen lock timestamp may be set; once
|
|
15
|
+
* that timestamp has passed, any attempt to configure that parameter's value on any token
|
|
16
|
+
* reverts, rolling back the collector's (or artist's) entire configureTokenParams()
|
|
17
|
+
* transaction.
|
|
18
|
+
*
|
|
19
|
+
* ── Why this exists ──────────────────────────────────────────────────────────
|
|
20
|
+
* PMPV0 interprets `pmpLockedAfterTimestamp` only as a *configuration* lock (it prevents
|
|
21
|
+
* the artist from re-configuring the parameter definition after the timestamp). It does NOT
|
|
22
|
+
* prevent token owners from continuing to write *values* after the timestamp. The Art Blocks
|
|
23
|
+
* Creator Dashboard advertises the Lock Date as cementing values permanently, so this hook
|
|
24
|
+
* patches the gap for existing PMPV0 projects by reverting value writes after the lock date.
|
|
25
|
+
* PMPV1 enforces this natively; this hook is intended for projects already deployed on PMPV0.
|
|
26
|
+
*
|
|
27
|
+
* ── Scope ────────────────────────────────────────────────────────────────────
|
|
28
|
+
* This hook is stateless after construction and has no side effects — it only reverts. It is
|
|
29
|
+
* intended to be registered for a single project via PMPV0.configureProjectHooks(). Keys not
|
|
30
|
+
* present in the lock table are always allowed (the hook is a no-op for them). A lock
|
|
31
|
+
* timestamp is matched to the same instant PMPV0 uses for its config lock: a value write is
|
|
32
|
+
* allowed while `block.timestamp < lockedAfter`, and reverts once `block.timestamp >=
|
|
33
|
+
* lockedAfter`. The lock timestamps supplied at construction should exactly match each key's
|
|
34
|
+
* `pmpLockedAfterTimestamp` in the project's PMPV0 configuration.
|
|
35
|
+
*
|
|
36
|
+
* ── Residual trust ───────────────────────────────────────────────────────────
|
|
37
|
+
* A hook-based lock only holds while this hook remains registered. PMPV0.configureProjectHooks()
|
|
38
|
+
* is not itself gated by `pmpLockedAfterTimestamp`, so the project artist could later unregister
|
|
39
|
+
* this hook and re-enable value writes. This is acceptable for the artist's own project but is
|
|
40
|
+
* a weaker guarantee than PMPV1's native value lock.
|
|
41
|
+
*/
|
|
42
|
+
contract PMPConfigureLockHook is AbstractPMPConfigureHook {
|
|
43
|
+
/// @notice Per-key lock timestamp. keccak256(bytes(key)) => unix timestamp after which
|
|
44
|
+
/// (inclusive) the key's value is locked. A value of 0 means the key is not locked by
|
|
45
|
+
/// this hook.
|
|
46
|
+
mapping(bytes32 keyHash => uint256 lockedAfterTimestamp) public lockedAfter;
|
|
47
|
+
|
|
48
|
+
/// @notice The keys locked by this hook, in construction order (for introspection).
|
|
49
|
+
string[] public lockedKeys;
|
|
50
|
+
|
|
51
|
+
error ParamLocked(string key, uint256 lockedAfterTimestamp);
|
|
52
|
+
error EmptyConfig();
|
|
53
|
+
error LengthMismatch();
|
|
54
|
+
error ZeroTimestamp(string key);
|
|
55
|
+
error DuplicateKey(string key);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @notice Constructor.
|
|
59
|
+
* @param keys The parameter keys to lock. Should match the project's PMPV0 param keys.
|
|
60
|
+
* @param timestamps The unix timestamp for each key, aligned by index, after which
|
|
61
|
+
* (inclusive) the key's value is locked. Each must be non-zero and should match the
|
|
62
|
+
* corresponding key's `pmpLockedAfterTimestamp` in the project's PMPV0 configuration.
|
|
63
|
+
*/
|
|
64
|
+
constructor(string[] memory keys, uint256[] memory timestamps) {
|
|
65
|
+
uint256 keysLength = keys.length;
|
|
66
|
+
if (keysLength == 0) revert EmptyConfig();
|
|
67
|
+
if (keysLength != timestamps.length) revert LengthMismatch();
|
|
68
|
+
for (uint256 i = 0; i < keysLength; i++) {
|
|
69
|
+
if (timestamps[i] == 0) revert ZeroTimestamp(keys[i]);
|
|
70
|
+
bytes32 keyHash = keccak256(bytes(keys[i]));
|
|
71
|
+
// @dev reject duplicate keys to avoid silent override of a lock timestamp
|
|
72
|
+
if (lockedAfter[keyHash] != 0) revert DuplicateKey(keys[i]);
|
|
73
|
+
lockedAfter[keyHash] = timestamps[i];
|
|
74
|
+
lockedKeys.push(keys[i]);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @notice Post-configuration hook executed by PMPV0 after a token's PMP is configured.
|
|
80
|
+
* Reverts if the configured key is locked and its lock timestamp has passed, which rolls
|
|
81
|
+
* back the entire configureTokenParams() transaction.
|
|
82
|
+
* @dev Stateless and side-effect free; safe to be called by any address.
|
|
83
|
+
* @param pmpInput The PMP input that was used to configure the token.
|
|
84
|
+
*/
|
|
85
|
+
function onTokenPMPConfigure(
|
|
86
|
+
address /* coreContract */,
|
|
87
|
+
uint256 /* tokenId */,
|
|
88
|
+
IPMPV0.PMPInput calldata pmpInput
|
|
89
|
+
) external view override {
|
|
90
|
+
uint256 lockedAfterTimestamp = lockedAfter[
|
|
91
|
+
keccak256(bytes(pmpInput.key))
|
|
92
|
+
];
|
|
93
|
+
// @dev keys not in the lock table (lockedAfterTimestamp == 0) are always allowed
|
|
94
|
+
if (
|
|
95
|
+
lockedAfterTimestamp != 0 && block.timestamp >= lockedAfterTimestamp
|
|
96
|
+
) {
|
|
97
|
+
revert ParamLocked(pmpInput.key, lockedAfterTimestamp);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @notice Returns the number of keys locked by this hook.
|
|
103
|
+
*/
|
|
104
|
+
function lockedKeysLength() external view returns (uint256) {
|
|
105
|
+
return lockedKeys.length;
|
|
106
|
+
}
|
|
107
|
+
}
|