@artblocks/contracts 1.3.2 → 1.4.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/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/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/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/configure-hooks/{abstractPMPConfigureHook.sol → AbstractPMPConfigureHook.sol} +1 -1
- package/contracts/web3call/configure-hooks/PMPConfigureLockHook.sol +107 -0
- package/package.json +39 -24
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity ^0.8.0;
|
|
5
|
+
|
|
6
|
+
import {ITransferHook} from "../../../interfaces/v0.8.x/ITransferHook.sol";
|
|
7
|
+
|
|
8
|
+
import {ERC165} from "@openzeppelin-5.0/contracts/utils/introspection/ERC165.sol";
|
|
9
|
+
import {IERC165} from "@openzeppelin-5.0/contracts/interfaces/IERC165.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @title Abstract transfer hook
|
|
13
|
+
* @author Art Blocks Inc.
|
|
14
|
+
* @notice Inherit this to implement `ITransferHook` with ERC-165. Child
|
|
15
|
+
* contracts implement `_onTokenTransfer` instead of `onTokenTransfer`.
|
|
16
|
+
* ----------------------------------------------------------------------------
|
|
17
|
+
* This contract enforces that `coreContract` is the caller, so children may
|
|
18
|
+
* safely treat the `coreContract` argument as trusted-as-caller. It does NOT,
|
|
19
|
+
* and cannot, know which cores a given hook is willing to serve.
|
|
20
|
+
* ----------------------------------------------------------------------------
|
|
21
|
+
* WARNING: Children MUST still verify that `coreContract` is a core they
|
|
22
|
+
* expect. Without that check, any deployed contract can invoke this hook with
|
|
23
|
+
* arbitrary `tokenId`, `from`, `to`, and `operator` values by calling it from
|
|
24
|
+
* its own address.
|
|
25
|
+
*/
|
|
26
|
+
abstract contract AbstractTransferHook is ITransferHook, ERC165 {
|
|
27
|
+
/**
|
|
28
|
+
* @notice Thrown when `onTokenTransfer` is called by an address other than
|
|
29
|
+
* the `coreContract` it was passed.
|
|
30
|
+
* @param caller The address that called `onTokenTransfer`.
|
|
31
|
+
* @param coreContract The `coreContract` argument that was passed.
|
|
32
|
+
*/
|
|
33
|
+
error TransferHookCallerNotCoreContract(
|
|
34
|
+
address caller,
|
|
35
|
+
address coreContract
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @notice Execution logic to be executed after a token's ownership updates.
|
|
40
|
+
* @dev Called after the ERC-721 ownership write. On mint, called after the
|
|
41
|
+
* token hash seed is assigned. Reverting aborts the mint or transfer.
|
|
42
|
+
* @dev Intentionally not `virtual`: the caller check below is a security
|
|
43
|
+
* invariant of this base contract, and children override `_onTokenTransfer`
|
|
44
|
+
* so they cannot remove it by accident.
|
|
45
|
+
*/
|
|
46
|
+
function onTokenTransfer(
|
|
47
|
+
address coreContract,
|
|
48
|
+
uint256 tokenId,
|
|
49
|
+
address from,
|
|
50
|
+
address to,
|
|
51
|
+
address operator
|
|
52
|
+
) external {
|
|
53
|
+
// @dev a conforming core always passes its own address, so this only
|
|
54
|
+
// rejects callers that are spoofing another contract's identity
|
|
55
|
+
if (msg.sender != coreContract) {
|
|
56
|
+
revert TransferHookCallerNotCoreContract({
|
|
57
|
+
caller: msg.sender,
|
|
58
|
+
coreContract: coreContract
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
_onTokenTransfer({
|
|
62
|
+
coreContract: coreContract,
|
|
63
|
+
tokenId: tokenId,
|
|
64
|
+
from: from,
|
|
65
|
+
to: to,
|
|
66
|
+
operator: operator
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @notice Hook implementation, called only after `coreContract` has been
|
|
72
|
+
* verified to be `msg.sender`.
|
|
73
|
+
* @dev Implementations MUST still verify that `coreContract` is a core
|
|
74
|
+
* this hook is intended to serve.
|
|
75
|
+
* @param coreContract The core contract that performed the ownership
|
|
76
|
+
* update. Guaranteed equal to `msg.sender`.
|
|
77
|
+
* @param tokenId The token whose ownership changed.
|
|
78
|
+
* @param from Previous owner. `address(0)` on mint.
|
|
79
|
+
* @param to New owner.
|
|
80
|
+
* @param operator Transfer operator, or the mint's initiating address.
|
|
81
|
+
*/
|
|
82
|
+
function _onTokenTransfer(
|
|
83
|
+
address coreContract,
|
|
84
|
+
uint256 tokenId,
|
|
85
|
+
address from,
|
|
86
|
+
address to,
|
|
87
|
+
address operator
|
|
88
|
+
) internal virtual;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @notice Indicates support for `ITransferHook` (`0x6344b0e2`), which V3
|
|
92
|
+
* cores require before a hook may be configured.
|
|
93
|
+
*/
|
|
94
|
+
function supportsInterface(
|
|
95
|
+
bytes4 interfaceId
|
|
96
|
+
) public view virtual override(ERC165, IERC165) returns (bool) {
|
|
97
|
+
return
|
|
98
|
+
interfaceId == type(ITransferHook).interfaceId ||
|
|
99
|
+
super.supportsInterface(interfaceId);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
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 "./AbstractTransferHook.sol";
|
|
9
|
+
|
|
10
|
+
import {IOwnerHistoryTransferHook} from "../../../interfaces/v0.8.x/IOwnerHistoryTransferHook.sol";
|
|
11
|
+
import {ITransferHook} from "../../../interfaces/v0.8.x/ITransferHook.sol";
|
|
12
|
+
import {IGenArt721CoreContractV3_Engine} from "../../../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol";
|
|
13
|
+
|
|
14
|
+
import {IERC165} from "@openzeppelin-5.0/contracts/interfaces/IERC165.sol";
|
|
15
|
+
|
|
16
|
+
import {ABHelpers} from "../../../libs/v0.8.x/ABHelpers.sol";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @title On-chain owner history transfer hook
|
|
20
|
+
* @author Art Blocks Inc.
|
|
21
|
+
* @notice Reference `ITransferHook` implementation. Records the full chain of
|
|
22
|
+
* owners a token has had, on chain and readable by other contracts — including
|
|
23
|
+
* by an artwork's own script through the on-chain generator.
|
|
24
|
+
* ----------------------------------------------------------------------------
|
|
25
|
+
* A single deployment serves every project, on every v3.3+ Engine core on the
|
|
26
|
+
* network, that configures this address as its transfer hook. There is no
|
|
27
|
+
* owner, no allowlist and nothing to configure: an artist points their project
|
|
28
|
+
* at this address with `configureProjectTransferHook`, and may make that
|
|
29
|
+
* permanent with `lockProjectTransferHook`.
|
|
30
|
+
* ----------------------------------------------------------------------------
|
|
31
|
+
* GAS. Recording ownership on chain is not free, and the artist is choosing
|
|
32
|
+
* this cost on behalf of everyone who will ever transfer one of their tokens.
|
|
33
|
+
* Measured against an otherwise identical project with no hook, on a v3.3
|
|
34
|
+
* Engine core:
|
|
35
|
+
*
|
|
36
|
+
* - a transfer costs about 48,400 gas more — 62,748 becomes 111,181, so
|
|
37
|
+
* roughly a 77% increase. Most of it is unavoidable: ~22,000 for the new
|
|
38
|
+
* storage slot holding the owner, and ~17,000 for the core's own reentrancy
|
|
39
|
+
* flag, which any hook pays.
|
|
40
|
+
* - a mint costs about 88,800 gas more, because the first ownership change a
|
|
41
|
+
* token sees writes both the anchor entry and the new owner.
|
|
42
|
+
*
|
|
43
|
+
* An owner is 20 bytes and a storage slot is 32, so ~22,000 gas per owner is
|
|
44
|
+
* the floor for holding this on chain; the packed timestamp rides along free.
|
|
45
|
+
* A project that only needs provenance for off-chain consumers should index
|
|
46
|
+
* the core's own `Transfer` events instead and configure no hook at all — this
|
|
47
|
+
* hook writes storage because it is meant to be read by other contracts,
|
|
48
|
+
* including an artwork's own script through the on-chain generator.
|
|
49
|
+
* ----------------------------------------------------------------------------
|
|
50
|
+
* COMPLETENESS. The chain is only complete from mint if this hook was
|
|
51
|
+
* configured before the token was minted. A hook configured mid-life starts at
|
|
52
|
+
* the owner it first observes; `isTrackedFromMint` reports which case a token
|
|
53
|
+
* is in. If a project's hook is later cleared, recording simply stops — the
|
|
54
|
+
* records already written stay readable.
|
|
55
|
+
* ----------------------------------------------------------------------------
|
|
56
|
+
* SAFETY. A reverting hook aborts the transfer that invoked it, so a hook that
|
|
57
|
+
* can revert can make a token permanently non-transferable. This one writes
|
|
58
|
+
* storage and cannot revert on a transfer of a project that has it configured:
|
|
59
|
+
* the only revert path is the configuration check below, which is true by
|
|
60
|
+
* construction whenever the core actually dispatches to this address.
|
|
61
|
+
*/
|
|
62
|
+
contract OwnerHistoryTransferHook is
|
|
63
|
+
AbstractTransferHook,
|
|
64
|
+
IOwnerHistoryTransferHook
|
|
65
|
+
{
|
|
66
|
+
/**
|
|
67
|
+
* @notice Ownership chain per token, oldest first, keyed by core contract.
|
|
68
|
+
* @dev Keying by `coreContract` is what makes a single shared deployment
|
|
69
|
+
* safe: `AbstractTransferHook` guarantees `coreContract == msg.sender`, so
|
|
70
|
+
* a contract impersonating a core can only ever write beneath its own
|
|
71
|
+
* address, where nothing reads. The configuration check in
|
|
72
|
+
* `_onTokenTransfer` is a second, independent guard.
|
|
73
|
+
*/
|
|
74
|
+
mapping(address coreContract => mapping(uint256 tokenId => OwnerRecord[]))
|
|
75
|
+
private _ownerHistory;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @notice Record an ownership change.
|
|
79
|
+
* @dev Called by the core after the ERC-721 ownership write, and on mint
|
|
80
|
+
* after the token hash seed is assigned, so a hook reading `tokenIdToHash`
|
|
81
|
+
* sees the final value.
|
|
82
|
+
* @param coreContract Core that performed the ownership update. Guaranteed
|
|
83
|
+
* by `AbstractTransferHook` to equal `msg.sender`.
|
|
84
|
+
* @param tokenId Token whose ownership changed.
|
|
85
|
+
* @param from Previous owner; `address(0)` on mint.
|
|
86
|
+
* @param to New owner.
|
|
87
|
+
*/
|
|
88
|
+
function _onTokenTransfer(
|
|
89
|
+
address coreContract,
|
|
90
|
+
uint256 tokenId,
|
|
91
|
+
address from,
|
|
92
|
+
address to,
|
|
93
|
+
address /* operator */
|
|
94
|
+
) internal override {
|
|
95
|
+
_onlyConfiguredForProject({
|
|
96
|
+
coreContract: coreContract,
|
|
97
|
+
projectId: ABHelpers.tokenIdToProjectId(tokenId)
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// @dev ERC-721 permits `transferFrom(a, a, id)`. Ownership did not
|
|
101
|
+
// change, so recording it would put the same owner in the chain twice.
|
|
102
|
+
if (from == to) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
OwnerRecord[] storage records = _ownerHistory[coreContract][tokenId];
|
|
107
|
+
if (records.length == 0) {
|
|
108
|
+
// Anchor the chain with the owner that preceded the first change
|
|
109
|
+
// this hook saw. That is `address(0)` when the hook was configured
|
|
110
|
+
// before the mint, which is what `isTrackedFromMint` reads.
|
|
111
|
+
_push({
|
|
112
|
+
records: records,
|
|
113
|
+
coreContract: coreContract,
|
|
114
|
+
tokenId: tokenId,
|
|
115
|
+
owner: from
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
_push({
|
|
119
|
+
records: records,
|
|
120
|
+
coreContract: coreContract,
|
|
121
|
+
tokenId: tokenId,
|
|
122
|
+
owner: to
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @inheritdoc IOwnerHistoryTransferHook
|
|
128
|
+
*/
|
|
129
|
+
function ownerHistory(
|
|
130
|
+
address coreContract,
|
|
131
|
+
uint256 tokenId
|
|
132
|
+
) external view returns (OwnerRecord[] memory records) {
|
|
133
|
+
return _ownerHistory[coreContract][tokenId];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @inheritdoc IOwnerHistoryTransferHook
|
|
138
|
+
*/
|
|
139
|
+
function ownerHistorySlice(
|
|
140
|
+
address coreContract,
|
|
141
|
+
uint256 tokenId,
|
|
142
|
+
uint256 start,
|
|
143
|
+
uint256 count
|
|
144
|
+
) external view returns (OwnerRecord[] memory records) {
|
|
145
|
+
OwnerRecord[] storage stored = _ownerHistory[coreContract][tokenId];
|
|
146
|
+
uint256 length = stored.length;
|
|
147
|
+
if (start >= length) {
|
|
148
|
+
return new OwnerRecord[](0);
|
|
149
|
+
}
|
|
150
|
+
uint256 remaining = length - start;
|
|
151
|
+
uint256 resultLength = count < remaining ? count : remaining;
|
|
152
|
+
records = new OwnerRecord[](resultLength);
|
|
153
|
+
for (uint256 i = 0; i < resultLength; ) {
|
|
154
|
+
records[i] = stored[start + i];
|
|
155
|
+
unchecked {
|
|
156
|
+
++i;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @inheritdoc IOwnerHistoryTransferHook
|
|
163
|
+
*/
|
|
164
|
+
function ownerHistoryLength(
|
|
165
|
+
address coreContract,
|
|
166
|
+
uint256 tokenId
|
|
167
|
+
) external view returns (uint256) {
|
|
168
|
+
return _ownerHistory[coreContract][tokenId].length;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @inheritdoc IOwnerHistoryTransferHook
|
|
173
|
+
*/
|
|
174
|
+
function previousOwners(
|
|
175
|
+
address coreContract,
|
|
176
|
+
uint256 tokenId
|
|
177
|
+
) external view returns (address[] memory owners) {
|
|
178
|
+
OwnerRecord[] storage stored = _ownerHistory[coreContract][tokenId];
|
|
179
|
+
uint256 length = stored.length;
|
|
180
|
+
// @dev the anchor is `address(0)` for a token tracked from its mint,
|
|
181
|
+
// which is not an owner; for a token first seen mid-life it is the real
|
|
182
|
+
// owner at that moment, and belongs in the result
|
|
183
|
+
uint256 start = (length > 0 && stored[0].owner == address(0)) ? 1 : 0;
|
|
184
|
+
// @dev the final record is the current owner, not a previous one
|
|
185
|
+
if (length < start + 2) {
|
|
186
|
+
return new address[](0);
|
|
187
|
+
}
|
|
188
|
+
uint256 resultLength = length - start - 1;
|
|
189
|
+
owners = new address[](resultLength);
|
|
190
|
+
for (uint256 i = 0; i < resultLength; ) {
|
|
191
|
+
owners[i] = stored[start + i].owner;
|
|
192
|
+
unchecked {
|
|
193
|
+
++i;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @inheritdoc IOwnerHistoryTransferHook
|
|
200
|
+
*/
|
|
201
|
+
function lastRecordedOwner(
|
|
202
|
+
address coreContract,
|
|
203
|
+
uint256 tokenId
|
|
204
|
+
) external view returns (address owner) {
|
|
205
|
+
OwnerRecord[] storage stored = _ownerHistory[coreContract][tokenId];
|
|
206
|
+
uint256 length = stored.length;
|
|
207
|
+
if (length == 0) {
|
|
208
|
+
return address(0);
|
|
209
|
+
}
|
|
210
|
+
return stored[length - 1].owner;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @inheritdoc IOwnerHistoryTransferHook
|
|
215
|
+
*/
|
|
216
|
+
function isTrackedFromMint(
|
|
217
|
+
address coreContract,
|
|
218
|
+
uint256 tokenId
|
|
219
|
+
) external view returns (bool) {
|
|
220
|
+
OwnerRecord[] storage stored = _ownerHistory[coreContract][tokenId];
|
|
221
|
+
// @dev the anchor record holds the owner before the first observed
|
|
222
|
+
// change, which is `address(0)` only for a mint
|
|
223
|
+
return stored.length > 0 && stored[0].owner == address(0);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @notice Append one record and emit it.
|
|
228
|
+
*/
|
|
229
|
+
function _push(
|
|
230
|
+
OwnerRecord[] storage records,
|
|
231
|
+
address coreContract,
|
|
232
|
+
uint256 tokenId,
|
|
233
|
+
address owner
|
|
234
|
+
) private {
|
|
235
|
+
// @dev uint96 seconds is not a practical bound; no cast check needed
|
|
236
|
+
uint96 timestamp = uint96(block.timestamp);
|
|
237
|
+
records.push(OwnerRecord({owner: owner, timestamp: timestamp}));
|
|
238
|
+
emit OwnerRecorded({
|
|
239
|
+
coreContract: coreContract,
|
|
240
|
+
tokenId: tokenId,
|
|
241
|
+
owner: owner,
|
|
242
|
+
index: records.length - 1,
|
|
243
|
+
timestamp: timestamp
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @notice Revert unless `coreContract` has this hook configured for
|
|
249
|
+
* `projectId`.
|
|
250
|
+
* @dev This is the `ITransferHook` requirement that an implementation
|
|
251
|
+
* verify which cores it serves, answered without any configuration of its
|
|
252
|
+
* own: the set of cores this hook serves is exactly the set that points at
|
|
253
|
+
* it. A contract impersonating a core could answer this call dishonestly,
|
|
254
|
+
* which is why it is a second guard rather than the only one — the storage
|
|
255
|
+
* keyed by `coreContract` already confines such a caller to its own
|
|
256
|
+
* namespace.
|
|
257
|
+
*/
|
|
258
|
+
function _onlyConfiguredForProject(
|
|
259
|
+
address coreContract,
|
|
260
|
+
uint256 projectId
|
|
261
|
+
) private view {
|
|
262
|
+
(address configuredHook, ) = IGenArt721CoreContractV3_Engine(
|
|
263
|
+
coreContract
|
|
264
|
+
).projectTransferHookConfig(projectId);
|
|
265
|
+
if (configuredHook != address(this)) {
|
|
266
|
+
revert HookNotConfiguredForProject({
|
|
267
|
+
coreContract: coreContract,
|
|
268
|
+
projectId: projectId,
|
|
269
|
+
configuredHook: configuredHook
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @notice Indicates support for `ITransferHook`, which v3.3 cores require
|
|
276
|
+
* before a hook may be configured.
|
|
277
|
+
*/
|
|
278
|
+
function supportsInterface(
|
|
279
|
+
bytes4 interfaceId
|
|
280
|
+
)
|
|
281
|
+
public
|
|
282
|
+
view
|
|
283
|
+
virtual
|
|
284
|
+
override(AbstractTransferHook, IERC165)
|
|
285
|
+
returns (bool)
|
|
286
|
+
{
|
|
287
|
+
return
|
|
288
|
+
interfaceId == type(IOwnerHistoryTransferHook).interfaceId ||
|
|
289
|
+
super.supportsInterface(interfaceId);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
@@ -821,17 +821,16 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
821
821
|
HTMLTag memory htmlTag
|
|
822
822
|
) internal view {
|
|
823
823
|
// Get script count and preferred CDN for the dependency.
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
) = dependencyRegistry.getDependencyDetails(dependencyNameAndVersion);
|
|
824
|
+
string memory preferredCDN;
|
|
825
|
+
uint24 scriptCount;
|
|
826
|
+
// @dev block scope to limit stack usage
|
|
827
|
+
{
|
|
828
|
+
IDependencyRegistryV0.DependencyDetails
|
|
829
|
+
memory dependencyDetails = dependencyRegistry
|
|
830
|
+
.getDependencyDetailsV2(dependencyNameAndVersion);
|
|
831
|
+
preferredCDN = dependencyDetails.preferredCDN;
|
|
832
|
+
scriptCount = dependencyDetails.scriptCount;
|
|
833
|
+
}
|
|
835
834
|
|
|
836
835
|
// If no scripts on-chain, load the script from the preferred CDN.
|
|
837
836
|
if (scriptCount == 0) {
|
|
@@ -873,6 +872,21 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
873
872
|
.getDependencyNameAndVersionForProject(coreContract, projectId)
|
|
874
873
|
.stringToBytes32();
|
|
875
874
|
|
|
875
|
+
// @dev All rendering directives are prescribed by the dependency registry, so that
|
|
876
|
+
// supporting a new kind of dependency is an admin configuration change rather than a
|
|
877
|
+
// contract upgrade.
|
|
878
|
+
IDependencyRegistryV0.DependencyDetails
|
|
879
|
+
memory dependencyDetails = dependencyRegistry
|
|
880
|
+
.getDependencyDetailsV2(dependencyNameAndVersion);
|
|
881
|
+
|
|
882
|
+
// @dev A raw HTML dependency stores a complete HTML document as its project script
|
|
883
|
+
// rather than a JavaScript program. Such a document must be injected verbatim -
|
|
884
|
+
// wrapping it in a script tag both breaks HTML parsing (the document's own
|
|
885
|
+
// "</script>" terminates the wrapper early) and is semantically wrong, since markup
|
|
886
|
+
// inside a script tag is never rendered.
|
|
887
|
+
bool isRawHtmlDep = dependencyDetails.projectScriptTagType ==
|
|
888
|
+
IDependencyRegistryV0.ProjectScriptTagType.RawHtml;
|
|
889
|
+
|
|
876
890
|
// Create head tags
|
|
877
891
|
// pre-fetch data to properly allocate memory for HTML tags
|
|
878
892
|
(
|
|
@@ -885,14 +899,18 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
885
899
|
// @dev memoize length for efficiency
|
|
886
900
|
uint256 dependencyRegistryAssetNamesAndVersionsLength = dependencyRegistryAssetNameAndVersions
|
|
887
901
|
.length;
|
|
888
|
-
// @dev length is
|
|
902
|
+
// @dev length is 3 (style, tokenData, import map) + number of external asset dependencies
|
|
889
903
|
HTMLTag[] memory headTags = new HTMLTag[](
|
|
890
|
-
|
|
904
|
+
3 + dependencyRegistryAssetNamesAndVersionsLength
|
|
891
905
|
);
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
906
|
+
// @dev The default style reset is omitted for raw HTML documents, which supply
|
|
907
|
+
// their own document-level styling. This matches Art Blocks' hosted generator.
|
|
908
|
+
if (!isRawHtmlDep) {
|
|
909
|
+
headTags[0].tagOpen = "<style>";
|
|
910
|
+
headTags[0]
|
|
911
|
+
.tagContent = "html{height:100%}body{min-height:100%;margin:0;padding:0}canvas{padding:0;margin:auto;display:block;position:absolute;top:0;bottom:0;left:0;right:0}";
|
|
912
|
+
headTags[0].tagClose = "</style>";
|
|
913
|
+
}
|
|
896
914
|
|
|
897
915
|
// @dev decode any base64 encoded flex data in the browser while parsing the json
|
|
898
916
|
headTags[1].tagContent = abi.encodePacked(
|
|
@@ -901,6 +919,17 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
901
919
|
'`, (key, value) => key === "data" && value !== null ? value.startsWith("#web3call#") ? Object.entries(JSON.parse(atob(value.slice(10)))).reduce((acc, [k, v]) => ((acc[atob(k)] = atob(v)), acc), {}) : atob(value) : value);'
|
|
902
920
|
);
|
|
903
921
|
headTags[1].tagType = HTMLTagType.script;
|
|
922
|
+
|
|
923
|
+
// @dev An ES module dependency cannot be loaded with a plain script tag, and project
|
|
924
|
+
// scripts import it by bare specifier (e.g. `import * as THREE from "three"`). An
|
|
925
|
+
// import map maps that specifier to the dependency's URL, and must appear in the head
|
|
926
|
+
// before any module is loaded.
|
|
927
|
+
_populateImportMapHtmlTag({
|
|
928
|
+
dependencyNameAndVersion: dependencyNameAndVersion,
|
|
929
|
+
dependencyDetails: dependencyDetails,
|
|
930
|
+
htmlTag: headTags[2]
|
|
931
|
+
});
|
|
932
|
+
|
|
904
933
|
for (
|
|
905
934
|
uint256 i = 0;
|
|
906
935
|
i < dependencyRegistryAssetNamesAndVersionsLength;
|
|
@@ -914,7 +943,7 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
914
943
|
// populate head tags with dependency registry scripts
|
|
915
944
|
_populateDependencyScriptHtmlTag(
|
|
916
945
|
dependencyRegistryAssetNameAndVersions[i],
|
|
917
|
-
headTags[
|
|
946
|
+
headTags[3 + i]
|
|
918
947
|
);
|
|
919
948
|
}
|
|
920
949
|
|
|
@@ -922,7 +951,15 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
922
951
|
HTMLTag[] memory bodyTags = new HTMLTag[](4);
|
|
923
952
|
|
|
924
953
|
// Dependency script tag
|
|
925
|
-
|
|
954
|
+
// @dev A module dependency is reached through the import map emitted in the head, so
|
|
955
|
+
// emitting a script tag for it here would load the module as a classic script and
|
|
956
|
+
// raise a syntax error on its `export` statements.
|
|
957
|
+
if (!dependencyDetails.loadAsModule) {
|
|
958
|
+
_populateDependencyScriptHtmlTag(
|
|
959
|
+
dependencyNameAndVersion,
|
|
960
|
+
bodyTags[0]
|
|
961
|
+
);
|
|
962
|
+
}
|
|
926
963
|
|
|
927
964
|
// @dev We expect all of our dependencies to be added gzip'd and base64 encoded
|
|
928
965
|
// so we need to include this so we can gunzip them in the browser.
|
|
@@ -935,22 +972,18 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
935
972
|
);
|
|
936
973
|
|
|
937
974
|
HTMLTag memory canvasTag = _createCanvasTagIfNeeded(
|
|
938
|
-
dependencyNameAndVersion
|
|
975
|
+
dependencyNameAndVersion,
|
|
976
|
+
dependencyDetails.canvasTagType
|
|
939
977
|
);
|
|
940
978
|
|
|
941
|
-
bool isProcessingDep = dependencyNameAndVersion ==
|
|
942
|
-
bytes32("processing-js@1.4.6");
|
|
943
|
-
|
|
944
979
|
bytes memory projectScript = _getProjectScriptBytes(
|
|
945
980
|
coreContract,
|
|
946
981
|
projectId
|
|
947
982
|
);
|
|
948
983
|
|
|
949
984
|
HTMLTag memory projectScriptTag = HTMLTag({
|
|
950
|
-
tagOpen:
|
|
951
|
-
|
|
952
|
-
: bytes("<script>"),
|
|
953
|
-
tagClose: bytes("</script>"),
|
|
985
|
+
tagOpen: _getProjectScriptTagOpen(dependencyDetails),
|
|
986
|
+
tagClose: isRawHtmlDep ? bytes("") : bytes("</script>"),
|
|
954
987
|
tagType: HTMLTagType.useTagOpenAndClose,
|
|
955
988
|
name: "",
|
|
956
989
|
contractAddress: address(0),
|
|
@@ -958,12 +991,15 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
958
991
|
tagContent: projectScript
|
|
959
992
|
});
|
|
960
993
|
|
|
961
|
-
if (
|
|
994
|
+
if (
|
|
995
|
+
dependencyDetails.canvasTagType ==
|
|
996
|
+
IDependencyRegistryV0.CanvasTagType.CanvasAfterProjectScript
|
|
997
|
+
) {
|
|
962
998
|
bodyTags[2] = projectScriptTag;
|
|
963
999
|
bodyTags[3] = canvasTag;
|
|
964
1000
|
} else {
|
|
965
|
-
bodyTags[3] = projectScriptTag;
|
|
966
1001
|
bodyTags[2] = canvasTag;
|
|
1002
|
+
bodyTags[3] = projectScriptTag;
|
|
967
1003
|
}
|
|
968
1004
|
|
|
969
1005
|
HTMLRequest memory htmlRequest;
|
|
@@ -1021,8 +1057,10 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
1021
1057
|
return true;
|
|
1022
1058
|
}
|
|
1023
1059
|
// query and return result of dependency registry for on-chain status
|
|
1024
|
-
|
|
1025
|
-
|
|
1060
|
+
return
|
|
1061
|
+
dependencyRegistry
|
|
1062
|
+
.getDependencyDetailsV2(dependencyNameAndVersion)
|
|
1063
|
+
.availableOnChain;
|
|
1026
1064
|
}
|
|
1027
1065
|
|
|
1028
1066
|
/**
|
|
@@ -1067,13 +1105,13 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
1067
1105
|
}
|
|
1068
1106
|
|
|
1069
1107
|
/**
|
|
1070
|
-
* @dev Helper function to
|
|
1071
|
-
* @
|
|
1108
|
+
* @dev Helper function to extract the dependency name preceding the "@" separator.
|
|
1109
|
+
* @param dependencyNameAndVersion Dependency identifier of the form "name@version".
|
|
1110
|
+
* @return The dependency name, e.g. "three" for "three@0.167.0".
|
|
1072
1111
|
*/
|
|
1073
|
-
function
|
|
1112
|
+
function _getDependencyName(
|
|
1074
1113
|
bytes32 dependencyNameAndVersion
|
|
1075
|
-
) internal pure returns (
|
|
1076
|
-
// Extract dependency name before @ symbol
|
|
1114
|
+
) internal pure returns (bytes memory) {
|
|
1077
1115
|
uint atSignIndex;
|
|
1078
1116
|
for (uint i = 0; i < dependencyNameAndVersion.length; i++) {
|
|
1079
1117
|
if (dependencyNameAndVersion[i] == "@") {
|
|
@@ -1086,22 +1124,82 @@ contract GenArt721GeneratorV0 is Initializable, IGenArt721GeneratorV0 {
|
|
|
1086
1124
|
for (uint i = 0; i < atSignIndex; i++) {
|
|
1087
1125
|
nameBeforeAt[i] = dependencyNameAndVersion[i];
|
|
1088
1126
|
}
|
|
1089
|
-
|
|
1127
|
+
return nameBeforeAt;
|
|
1128
|
+
}
|
|
1090
1129
|
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1130
|
+
/**
|
|
1131
|
+
* @dev Helper function to build the opening tag wrapping a project's script.
|
|
1132
|
+
* @param dependencyDetails Details of the project's dependency, prescribing how the
|
|
1133
|
+
* project script must be injected.
|
|
1134
|
+
* @return The opening tag, or an empty value when the script is raw HTML.
|
|
1135
|
+
*/
|
|
1136
|
+
function _getProjectScriptTagOpen(
|
|
1137
|
+
IDependencyRegistryV0.DependencyDetails memory dependencyDetails
|
|
1138
|
+
) internal pure returns (bytes memory) {
|
|
1139
|
+
IDependencyRegistryV0.ProjectScriptTagType tagType = dependencyDetails
|
|
1140
|
+
.projectScriptTagType;
|
|
1141
|
+
if (tagType == IDependencyRegistryV0.ProjectScriptTagType.RawHtml) {
|
|
1142
|
+
return bytes("");
|
|
1143
|
+
}
|
|
1144
|
+
if (tagType == IDependencyRegistryV0.ProjectScriptTagType.Module) {
|
|
1145
|
+
return bytes('<script type="module">');
|
|
1146
|
+
}
|
|
1147
|
+
if (tagType == IDependencyRegistryV0.ProjectScriptTagType.SpecialType) {
|
|
1148
|
+
return
|
|
1149
|
+
abi.encodePacked(
|
|
1150
|
+
"<script type='",
|
|
1151
|
+
dependencyDetails.projectScriptSpecialType,
|
|
1152
|
+
"'>"
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
return bytes("<script>");
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* @dev Helper function to populate an import map tag, which maps a module dependency's
|
|
1160
|
+
* bare specifier (its name) to the URL the module is served from. Left empty for
|
|
1161
|
+
* dependencies that are not loaded as modules.
|
|
1162
|
+
* @param dependencyNameAndVersion Dependency identifier of the form "name@version".
|
|
1163
|
+
* @param dependencyDetails Details of the dependency.
|
|
1164
|
+
* @param htmlTag The HTMLTag to populate.
|
|
1165
|
+
*/
|
|
1166
|
+
function _populateImportMapHtmlTag(
|
|
1167
|
+
bytes32 dependencyNameAndVersion,
|
|
1168
|
+
IDependencyRegistryV0.DependencyDetails memory dependencyDetails,
|
|
1169
|
+
HTMLTag memory htmlTag
|
|
1170
|
+
) internal pure {
|
|
1171
|
+
if (!dependencyDetails.loadAsModule) {
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
htmlTag.tagType = HTMLTagType.useTagOpenAndClose;
|
|
1176
|
+
htmlTag.tagOpen = abi.encodePacked(
|
|
1177
|
+
'<script type="importmap">{"imports":{"',
|
|
1178
|
+
_getDependencyName(dependencyNameAndVersion),
|
|
1179
|
+
'":"',
|
|
1180
|
+
dependencyDetails.preferredCDN,
|
|
1181
|
+
'"}}'
|
|
1182
|
+
);
|
|
1183
|
+
htmlTag.tagClose = bytes("</script>");
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
/**
|
|
1187
|
+
* @dev Helper function to get a canvas tag or an empty tag, per the dependency's
|
|
1188
|
+
* registry-prescribed canvas requirement.
|
|
1189
|
+
* @param dependencyNameAndVersion Dependency identifier, used to name the canvas element.
|
|
1190
|
+
* @param canvasTagType Whether a canvas is required.
|
|
1191
|
+
* @return The canvas tag or an empty tag.
|
|
1192
|
+
*/
|
|
1193
|
+
function _createCanvasTagIfNeeded(
|
|
1194
|
+
bytes32 dependencyNameAndVersion,
|
|
1195
|
+
IDependencyRegistryV0.CanvasTagType canvasTagType
|
|
1196
|
+
) internal pure returns (HTMLTag memory) {
|
|
1197
|
+
if (canvasTagType != IDependencyRegistryV0.CanvasTagType.NoCanvasTag) {
|
|
1100
1198
|
return
|
|
1101
1199
|
HTMLTag({
|
|
1102
1200
|
tagOpen: abi.encodePacked(
|
|
1103
1201
|
"<canvas id='",
|
|
1104
|
-
|
|
1202
|
+
_getDependencyName(dependencyNameAndVersion),
|
|
1105
1203
|
"-canvas'>"
|
|
1106
1204
|
),
|
|
1107
1205
|
tagClose: bytes("</canvas>"),
|