@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,160 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
import {AbstractTransferHook} from "../engine/V3/transfer-hooks/AbstractTransferHook.sol";
|
|
5
|
+
import {IGenArt721CoreContractV3_Base} from "../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
|
|
6
|
+
import {IGenArt721CoreContractV3_Engine} from "../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol";
|
|
7
|
+
|
|
8
|
+
import {IERC721} from "@openzeppelin-5.0/contracts/token/ERC721/IERC721.sol";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @title Mock transfer hook for testing V3 Engine transfer hooks.
|
|
12
|
+
* @notice Records hook inputs, optionally reverts, and can attempt reentrancy
|
|
13
|
+
* into transfer / mint / configure / lock on the calling core.
|
|
14
|
+
* @dev Intentionally does NOT restrict which cores it will serve, so a single
|
|
15
|
+
* instance can be used across the Engine and Engine Flex test suites.
|
|
16
|
+
* Production hooks must restrict `coreContract`.
|
|
17
|
+
*/
|
|
18
|
+
contract MockTransferHook is AbstractTransferHook {
|
|
19
|
+
event TokenTransferred(
|
|
20
|
+
address indexed coreContract,
|
|
21
|
+
uint256 indexed tokenId,
|
|
22
|
+
address from,
|
|
23
|
+
address to,
|
|
24
|
+
address operator
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
address public lastCoreContract;
|
|
28
|
+
uint256 public lastTokenId;
|
|
29
|
+
address public lastFrom;
|
|
30
|
+
address public lastTo;
|
|
31
|
+
address public lastOperator;
|
|
32
|
+
bytes32 public lastTokenHash;
|
|
33
|
+
uint256 public callCount;
|
|
34
|
+
|
|
35
|
+
bool public shouldRevert;
|
|
36
|
+
bool public reenterTransfer;
|
|
37
|
+
bool public reenterConfigure;
|
|
38
|
+
bool public reenterLock;
|
|
39
|
+
address public reenterTransferTo;
|
|
40
|
+
|
|
41
|
+
/// when set, reentrant transfer targets an explicit token rather than the
|
|
42
|
+
/// token this hook was invoked for (used to test cross-project blocking)
|
|
43
|
+
bool public reenterCustomToken;
|
|
44
|
+
address public reenterCustomFrom;
|
|
45
|
+
uint256 public reenterCustomTokenId;
|
|
46
|
+
|
|
47
|
+
/// when set, the hook attempts to purchase through a minter, which
|
|
48
|
+
/// reenters the core's mint path
|
|
49
|
+
bool public reenterPurchase;
|
|
50
|
+
address public reenterPurchaseMinter;
|
|
51
|
+
uint256 public reenterPurchaseProjectId;
|
|
52
|
+
|
|
53
|
+
function setShouldRevert(bool _shouldRevert) external {
|
|
54
|
+
shouldRevert = _shouldRevert;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function setReenterTransfer(
|
|
58
|
+
bool _reenterTransfer,
|
|
59
|
+
address _reenterTransferTo
|
|
60
|
+
) external {
|
|
61
|
+
reenterTransfer = _reenterTransfer;
|
|
62
|
+
reenterTransferTo = _reenterTransferTo;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function setReenterCustomToken(
|
|
66
|
+
bool _reenterCustomToken,
|
|
67
|
+
address _reenterCustomFrom,
|
|
68
|
+
uint256 _reenterCustomTokenId
|
|
69
|
+
) external {
|
|
70
|
+
reenterCustomToken = _reenterCustomToken;
|
|
71
|
+
reenterCustomFrom = _reenterCustomFrom;
|
|
72
|
+
reenterCustomTokenId = _reenterCustomTokenId;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function setReenterPurchase(
|
|
76
|
+
bool _reenterPurchase,
|
|
77
|
+
address _minter,
|
|
78
|
+
uint256 _projectId
|
|
79
|
+
) external {
|
|
80
|
+
reenterPurchase = _reenterPurchase;
|
|
81
|
+
reenterPurchaseMinter = _minter;
|
|
82
|
+
reenterPurchaseProjectId = _projectId;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function setReenterConfigure(bool _reenterConfigure) external {
|
|
86
|
+
reenterConfigure = _reenterConfigure;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function setReenterLock(bool _reenterLock) external {
|
|
90
|
+
reenterLock = _reenterLock;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function _onTokenTransfer(
|
|
94
|
+
address coreContract,
|
|
95
|
+
uint256 tokenId,
|
|
96
|
+
address from,
|
|
97
|
+
address to,
|
|
98
|
+
address operator
|
|
99
|
+
) internal override {
|
|
100
|
+
lastCoreContract = coreContract;
|
|
101
|
+
lastTokenId = tokenId;
|
|
102
|
+
lastFrom = from;
|
|
103
|
+
lastTo = to;
|
|
104
|
+
lastOperator = operator;
|
|
105
|
+
lastTokenHash = IGenArt721CoreContractV3_Base(coreContract)
|
|
106
|
+
.tokenIdToHash(tokenId);
|
|
107
|
+
unchecked {
|
|
108
|
+
callCount++;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
emit TokenTransferred(coreContract, tokenId, from, to, operator);
|
|
112
|
+
|
|
113
|
+
if (shouldRevert) {
|
|
114
|
+
revert("MockTransferHook: Intentional revert");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (reenterTransfer) {
|
|
118
|
+
if (reenterCustomToken) {
|
|
119
|
+
IERC721(coreContract).transferFrom(
|
|
120
|
+
reenterCustomFrom,
|
|
121
|
+
reenterTransferTo,
|
|
122
|
+
reenterCustomTokenId
|
|
123
|
+
);
|
|
124
|
+
} else {
|
|
125
|
+
IERC721(coreContract).transferFrom(
|
|
126
|
+
to,
|
|
127
|
+
reenterTransferTo,
|
|
128
|
+
tokenId
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (reenterPurchase) {
|
|
134
|
+
// @dev bubble the revert reason so the core's custom error is
|
|
135
|
+
// observable by the test, rather than being swallowed here
|
|
136
|
+
(bool success, bytes memory returnData) = reenterPurchaseMinter
|
|
137
|
+
.call(
|
|
138
|
+
abi.encodeWithSignature(
|
|
139
|
+
"purchase(uint256)",
|
|
140
|
+
reenterPurchaseProjectId
|
|
141
|
+
)
|
|
142
|
+
);
|
|
143
|
+
if (!success) {
|
|
144
|
+
assembly {
|
|
145
|
+
revert(add(returnData, 32), mload(returnData))
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (reenterConfigure) {
|
|
151
|
+
IGenArt721CoreContractV3_Engine(coreContract)
|
|
152
|
+
.configureProjectTransferHook(tokenId / 1_000_000, address(0));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (reenterLock) {
|
|
156
|
+
IGenArt721CoreContractV3_Engine(coreContract)
|
|
157
|
+
.lockProjectTransferHook(tokenId / 1_000_000, address(this));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
import {ITransferHook} from "../interfaces/v0.8.x/ITransferHook.sol";
|
|
5
|
+
|
|
6
|
+
import {IERC721} from "@openzeppelin-5.0/contracts/token/ERC721/IERC721.sol";
|
|
7
|
+
import {IERC721Receiver} from "@openzeppelin-5.0/contracts/token/ERC721/IERC721Receiver.sol";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @title Mock ERC-721 receiver that forwards the token it receives.
|
|
11
|
+
* @notice Used to verify that a V3 core releases its transfer hook reentrancy
|
|
12
|
+
* guard before invoking `onERC721Received`, so that escrow/wrapper contracts
|
|
13
|
+
* which forward on receipt continue to work.
|
|
14
|
+
*/
|
|
15
|
+
contract MockForwardingERC721Receiver is IERC721Receiver {
|
|
16
|
+
address public forwardTo;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param _forwardTo Address to forward received tokens to. If
|
|
20
|
+
* `address(0)`, received tokens are kept.
|
|
21
|
+
*/
|
|
22
|
+
function setForwardTo(address _forwardTo) external {
|
|
23
|
+
forwardTo = _forwardTo;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function onERC721Received(
|
|
27
|
+
address /* operator */,
|
|
28
|
+
address /* from */,
|
|
29
|
+
uint256 tokenId,
|
|
30
|
+
bytes calldata /* data */
|
|
31
|
+
) external returns (bytes4) {
|
|
32
|
+
if (forwardTo != address(0)) {
|
|
33
|
+
// @dev msg.sender is the core contract performing the safe transfer
|
|
34
|
+
IERC721(msg.sender).transferFrom(address(this), forwardTo, tokenId);
|
|
35
|
+
}
|
|
36
|
+
return IERC721Receiver.onERC721Received.selector;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @title Mock batch transferrer.
|
|
42
|
+
* @notice Performs multiple sequential (not nested) transfers in a single
|
|
43
|
+
* transaction. Used to verify that the transfer hook reentrancy guard is
|
|
44
|
+
* per-call rather than per-transaction, so marketplace batch flows are
|
|
45
|
+
* unaffected.
|
|
46
|
+
*/
|
|
47
|
+
contract MockBatchTransferrer {
|
|
48
|
+
function batchTransfer(
|
|
49
|
+
address coreContract,
|
|
50
|
+
address from,
|
|
51
|
+
address to,
|
|
52
|
+
uint256[] calldata tokenIds
|
|
53
|
+
) external {
|
|
54
|
+
uint256 length = tokenIds.length;
|
|
55
|
+
for (uint256 i; i < length; i++) {
|
|
56
|
+
IERC721(coreContract).transferFrom(from, to, tokenIds[i]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @title Mock core that invokes a transfer hook with arbitrary inputs.
|
|
63
|
+
* @notice Covers the one caller `AbstractTransferHook` cannot reject: a
|
|
64
|
+
* contract that passes its own address as `coreContract`. Its answer to
|
|
65
|
+
* `projectTransferHookConfig` is settable, so both a caller that has not
|
|
66
|
+
* configured the hook and one that claims it has can be simulated.
|
|
67
|
+
*/
|
|
68
|
+
contract MockSpoofingCore {
|
|
69
|
+
address public configuredHook;
|
|
70
|
+
|
|
71
|
+
function setConfiguredHook(address hook) external {
|
|
72
|
+
configuredHook = hook;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function projectTransferHookConfig(
|
|
76
|
+
uint256 /* projectId */
|
|
77
|
+
) external view returns (address hook, bool locked) {
|
|
78
|
+
return (configuredHook, false);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function callHook(
|
|
82
|
+
address hook,
|
|
83
|
+
uint256 tokenId,
|
|
84
|
+
address from,
|
|
85
|
+
address to,
|
|
86
|
+
address operator
|
|
87
|
+
) external {
|
|
88
|
+
ITransferHook(hook).onTokenTransfer({
|
|
89
|
+
coreContract: address(this),
|
|
90
|
+
tokenId: tokenId,
|
|
91
|
+
from: from,
|
|
92
|
+
to: to,
|
|
93
|
+
operator: operator
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.0;
|
|
4
|
+
|
|
5
|
+
interface IBatchMinter {
|
|
6
|
+
function purchaseMultiple(
|
|
7
|
+
uint256 projectId,
|
|
8
|
+
address coreContract,
|
|
9
|
+
uint24 quantity
|
|
10
|
+
) external payable returns (uint256[] memory tokenIds);
|
|
11
|
+
|
|
12
|
+
function purchase(
|
|
13
|
+
uint256 projectId,
|
|
14
|
+
address coreContract
|
|
15
|
+
) external payable returns (uint256 tokenId);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
contract ReentrancyBatchMockShared {
|
|
19
|
+
uint256 public currentProjectId;
|
|
20
|
+
address public currentCoreContract;
|
|
21
|
+
address public currentMinter;
|
|
22
|
+
uint256 public currentPriceToPay;
|
|
23
|
+
bool public shouldReenter;
|
|
24
|
+
|
|
25
|
+
function attackBatch(
|
|
26
|
+
address _minterContractAddress,
|
|
27
|
+
uint256 _projectId,
|
|
28
|
+
address _coreContract,
|
|
29
|
+
uint24 _quantity,
|
|
30
|
+
uint256 _priceToPay
|
|
31
|
+
) external payable {
|
|
32
|
+
currentProjectId = _projectId;
|
|
33
|
+
currentCoreContract = _coreContract;
|
|
34
|
+
currentMinter = _minterContractAddress;
|
|
35
|
+
currentPriceToPay = _priceToPay;
|
|
36
|
+
shouldReenter = true;
|
|
37
|
+
IBatchMinter(_minterContractAddress).purchaseMultiple{value: msg.value}(
|
|
38
|
+
_projectId,
|
|
39
|
+
_coreContract,
|
|
40
|
+
_quantity
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
receive() external payable {
|
|
45
|
+
if (shouldReenter) {
|
|
46
|
+
shouldReenter = false;
|
|
47
|
+
IBatchMinter(currentMinter).purchase{value: currentPriceToPay}(
|
|
48
|
+
currentProjectId,
|
|
49
|
+
currentCoreContract
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
import {RelayExecutor} from "../relay/RelayExecutor.sol";
|
|
5
|
+
import {RelayExecutorPartialReverts} from "../relay/RelayExecutorPartialReverts.sol";
|
|
6
|
+
|
|
7
|
+
/// @dev Helper that wraps RelayExecutor so tests can invoke execute() as
|
|
8
|
+
/// msg.sender == address(this), mimicking the EIP-7702 delegation model
|
|
9
|
+
/// where the EOA calls its own delegated code.
|
|
10
|
+
contract RelayExecutorTestHelper is RelayExecutor {
|
|
11
|
+
/// @dev Calls execute on this contract from itself so that
|
|
12
|
+
/// msg.sender == address(this) and the base ERC7821 auth passes.
|
|
13
|
+
function selfExecute(bytes32 mode, bytes calldata executionData) external {
|
|
14
|
+
this.execute(mode, executionData);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/// @dev Simple target contract for testing batch calls.
|
|
19
|
+
contract MockTarget {
|
|
20
|
+
uint256 public value;
|
|
21
|
+
address public lastCaller;
|
|
22
|
+
|
|
23
|
+
event Called(uint256 val);
|
|
24
|
+
|
|
25
|
+
function setValue(uint256 val) external payable {
|
|
26
|
+
value = val;
|
|
27
|
+
lastCaller = msg.sender;
|
|
28
|
+
emit Called(val);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function alwaysReverts() external pure {
|
|
32
|
+
revert("MockTarget: forced revert");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
receive() external payable {}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// @dev Helper that wraps RelayExecutorPartialReverts so tests can invoke
|
|
39
|
+
/// execute() as msg.sender == address(this).
|
|
40
|
+
contract RelayExecutorPartialRevertsTestHelper is RelayExecutorPartialReverts {
|
|
41
|
+
function selfExecute(bytes32 mode, bytes calldata executionData) external {
|
|
42
|
+
this.execute(mode, executionData);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
import {ERC7821} from "solady/src/accounts/ERC7821.sol";
|
|
5
|
+
import {ECDSA} from "solady/src/utils/ECDSA.sol";
|
|
6
|
+
|
|
7
|
+
/// @title RelayExecutor
|
|
8
|
+
/// @notice EIP-7702 delegation target for batched EVM call execution with
|
|
9
|
+
/// per-bundle log delimiting. Extends Solady ERC7821 with a
|
|
10
|
+
/// BundleExecuted event emitted after each sub-batch completes,
|
|
11
|
+
/// enabling reliable log attribution by the relay.
|
|
12
|
+
/// @dev Deploy deterministically via CREATE2 for same address on all chains.
|
|
13
|
+
/// Stateless, no storage, no initialization, no upgrade concerns.
|
|
14
|
+
///
|
|
15
|
+
/// Relay encoding uses the ERC-7821 batch-of-batches mode: each queue
|
|
16
|
+
/// item becomes its own sub-batch. The base _executeBatchOfBatches loops
|
|
17
|
+
/// through sub-batches calling execute() per sub-batch, which flows
|
|
18
|
+
/// through our _execute(Call[]) override and emits BundleExecuted.
|
|
19
|
+
///
|
|
20
|
+
/// Receipt log layout for a batch with 3 bundles:
|
|
21
|
+
/// [logA, logB, BundleExecuted, logC, logD, BundleExecuted, logF, BundleExecuted]
|
|
22
|
+
/// └── bundle 0 ──────────────┘ └── bundle 1 ─────────────┘ └── bundle 2 ────┘
|
|
23
|
+
contract RelayExecutor is ERC7821 {
|
|
24
|
+
/// @notice Emitted after each bundle (sub-batch) completes successfully.
|
|
25
|
+
/// The relay slices receipt logs between consecutive BundleExecuted
|
|
26
|
+
/// events to attribute logs to the originating queue item.
|
|
27
|
+
event BundleExecuted();
|
|
28
|
+
|
|
29
|
+
/// @notice ERC-1271 signature validation. Performs ecrecover against the
|
|
30
|
+
/// EOA address (address(this) under EIP-7702 delegation).
|
|
31
|
+
/// Required because some contracts skip ecrecover when the signer has code.
|
|
32
|
+
function isValidSignature(
|
|
33
|
+
bytes32 hash,
|
|
34
|
+
bytes calldata signature
|
|
35
|
+
) public view virtual returns (bytes4 result) {
|
|
36
|
+
bool success = ECDSA.recoverCalldata(hash, signature) == address(this);
|
|
37
|
+
/// @solidity memory-safe-assembly
|
|
38
|
+
assembly {
|
|
39
|
+
// success ? bytes4(keccak256("isValidSignature(bytes32,bytes)")) : 0xffffffff
|
|
40
|
+
result := shl(224, or(0x1626ba7e, sub(0, iszero(success))))
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// @notice Execute all calls in a bundle, then emit BundleExecuted.
|
|
45
|
+
function _execute(
|
|
46
|
+
Call[] calldata calls,
|
|
47
|
+
bytes32 extraData
|
|
48
|
+
) internal override {
|
|
49
|
+
unchecked {
|
|
50
|
+
uint256 n = calls.length;
|
|
51
|
+
for (uint256 i; i < n; ++i) {
|
|
52
|
+
(address to, uint256 value, bytes calldata data) = _get(
|
|
53
|
+
calls,
|
|
54
|
+
i
|
|
55
|
+
);
|
|
56
|
+
_execute(to, value, data, extraData);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
emit BundleExecuted();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.22;
|
|
3
|
+
|
|
4
|
+
import {RelayExecutor} from "./RelayExecutor.sol";
|
|
5
|
+
|
|
6
|
+
/// @title RelayExecutorPartialReverts
|
|
7
|
+
/// @notice Variant of RelayExecutor where each bundle in a batch-of-batches
|
|
8
|
+
/// executes independently. A failing bundle reverts only its own state
|
|
9
|
+
/// changes; all other bundles continue executing.
|
|
10
|
+
/// @dev Overrides _executeBatchOfBatches to wrap each sub-batch execute() in a
|
|
11
|
+
/// try/catch, creating an isolated EVM call frame per bundle.
|
|
12
|
+
///
|
|
13
|
+
/// Successful bundles emit BundleExecuted (inherited from RelayExecutor).
|
|
14
|
+
/// Failed bundles emit BundleFailed with the revert reason from the
|
|
15
|
+
/// parent frame — the failed bundle's state changes and logs are rolled
|
|
16
|
+
/// back by the EVM.
|
|
17
|
+
///
|
|
18
|
+
/// Receipt log layout for a batch with 3 bundles (bundle 1 fails):
|
|
19
|
+
/// [logA, logB, BundleExecuted, BundleFailed, logF, BundleExecuted]
|
|
20
|
+
/// └── bundle 0 ──────────────┘ └─ bundle 1 ┘ └── bundle 2 ────┘
|
|
21
|
+
contract RelayExecutorPartialReverts is RelayExecutor {
|
|
22
|
+
/// @notice Emitted when a bundle fails. Serves as a delimiter for the
|
|
23
|
+
/// failed bundle (no inner logs since its state was reverted).
|
|
24
|
+
/// @param bundleIndex Index of the failed bundle within the batch.
|
|
25
|
+
/// @param reason ABI-encoded revert reason from the failed sub-call.
|
|
26
|
+
event BundleFailed(uint256 bundleIndex, bytes reason);
|
|
27
|
+
|
|
28
|
+
/// @dev Overrides ERC7821._executeBatchOfBatches to isolate each sub-batch
|
|
29
|
+
/// in its own call frame via try/catch on an external self-call.
|
|
30
|
+
/// The self-call sets msg.sender = address(this) in the child frame,
|
|
31
|
+
/// so we must enforce auth here to prevent unauthorized callers from
|
|
32
|
+
/// bypassing the check that normally happens inside _execute.
|
|
33
|
+
function _executeBatchOfBatches(
|
|
34
|
+
bytes32 mode,
|
|
35
|
+
bytes calldata executionData
|
|
36
|
+
) internal override {
|
|
37
|
+
require(msg.sender == address(this));
|
|
38
|
+
// Convert mode from batch-of-batches (0x78210002) to single-batch
|
|
39
|
+
// with opData support (0x78210001), same as the base implementation.
|
|
40
|
+
mode ^= bytes32(uint256(3 << (22 * 8)));
|
|
41
|
+
(uint256 n, uint256 o, uint256 e) = (0, 0, 0);
|
|
42
|
+
/// @solidity memory-safe-assembly
|
|
43
|
+
assembly {
|
|
44
|
+
let j := calldataload(executionData.offset)
|
|
45
|
+
let t := add(executionData.offset, j)
|
|
46
|
+
n := calldataload(t)
|
|
47
|
+
o := add(0x20, t)
|
|
48
|
+
e := add(executionData.offset, executionData.length)
|
|
49
|
+
if or(
|
|
50
|
+
shr(64, j),
|
|
51
|
+
or(lt(executionData.length, 0x20), gt(add(o, shl(5, n)), e))
|
|
52
|
+
) {
|
|
53
|
+
mstore(0x00, 0x3995943b) // `BatchOfBatchesDecodingError()`.
|
|
54
|
+
revert(0x1c, 0x04)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
unchecked {
|
|
58
|
+
for (uint256 i; i != n; ++i) {
|
|
59
|
+
bytes calldata batch;
|
|
60
|
+
/// @solidity memory-safe-assembly
|
|
61
|
+
assembly {
|
|
62
|
+
let j := calldataload(add(o, shl(5, i)))
|
|
63
|
+
let t := add(o, j)
|
|
64
|
+
batch.offset := add(t, 0x20)
|
|
65
|
+
batch.length := calldataload(t)
|
|
66
|
+
if or(shr(64, j), gt(add(batch.offset, batch.length), e)) {
|
|
67
|
+
mstore(0x00, 0x3995943b) // `BatchOfBatchesDecodingError()`.
|
|
68
|
+
revert(0x1c, 0x04)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// External self-call creates an isolated call frame.
|
|
72
|
+
// msg.sender == address(this) satisfies the base ERC7821 auth.
|
|
73
|
+
try this.execute(mode, batch) {} catch (bytes memory reason) {
|
|
74
|
+
emit BundleFailed(i, reason);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity 0.8.22;
|
|
5
|
+
|
|
6
|
+
import {ABHelpers} from "../libs/v0.8.x/ABHelpers.sol";
|
|
7
|
+
import {IArtblocksRoyaltyOverride} from "../interfaces/v0.8.x/IArtblocksRoyaltyOverride.sol";
|
|
8
|
+
|
|
9
|
+
import {Ownable} from "@openzeppelin-5.0/contracts/access/Ownable.sol";
|
|
10
|
+
import {ERC165, IERC165} from "@openzeppelin-5.0/contracts/utils/introspection/ERC165.sol";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title GenArt721RoyaltyOverrideSplits
|
|
14
|
+
* @author Art Blocks Inc.
|
|
15
|
+
* @notice Royalty Registry override contract that maps each
|
|
16
|
+
* (core contract, project) pair to a royalty configuration consisting of
|
|
17
|
+
* a splitter address and a BPS value. All configuration is managed by a
|
|
18
|
+
* single owner.
|
|
19
|
+
*/
|
|
20
|
+
contract GenArt721RoyaltyOverrideSplits is
|
|
21
|
+
ERC165,
|
|
22
|
+
IArtblocksRoyaltyOverride,
|
|
23
|
+
Ownable
|
|
24
|
+
{
|
|
25
|
+
using ABHelpers for uint256;
|
|
26
|
+
|
|
27
|
+
uint16 public constant MAX_BPS = 10000;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @notice Royalty configuration for a single project.
|
|
31
|
+
* @dev Packed into a single storage slot (20 + 2 = 22 bytes).
|
|
32
|
+
* @param splitter Address of the royalty splitter contract.
|
|
33
|
+
* @param bps Royalty basis points (0–10000).
|
|
34
|
+
*/
|
|
35
|
+
struct RoyaltyConfig {
|
|
36
|
+
address splitter;
|
|
37
|
+
uint16 bps;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @notice Royalty configuration for a project has been updated.
|
|
42
|
+
* @dev A splitter of address(0) with bps of 0 indicates the project
|
|
43
|
+
* has been unconfigured.
|
|
44
|
+
*/
|
|
45
|
+
event RoyaltyConfigUpdated(
|
|
46
|
+
address indexed coreContract,
|
|
47
|
+
uint256 indexed projectId,
|
|
48
|
+
address splitter,
|
|
49
|
+
uint16 bps
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
/// core contract => project ID => royalty configuration
|
|
53
|
+
mapping(address coreContract => mapping(uint256 projectId => RoyaltyConfig config))
|
|
54
|
+
public royaltyConfigs;
|
|
55
|
+
|
|
56
|
+
constructor(address owner_) Ownable(owner_) {}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @notice Sets the royalty configuration for a given core contract and
|
|
60
|
+
* project.
|
|
61
|
+
* @param coreContract Core contract address.
|
|
62
|
+
* @param projectId Project ID on the core contract.
|
|
63
|
+
* @param splitter Address of the royalty splitter contract. Must not be
|
|
64
|
+
* the zero address.
|
|
65
|
+
* @param bps Royalty basis points (0–10000).
|
|
66
|
+
*/
|
|
67
|
+
function setRoyaltyConfig(
|
|
68
|
+
address coreContract,
|
|
69
|
+
uint256 projectId,
|
|
70
|
+
address splitter,
|
|
71
|
+
uint16 bps
|
|
72
|
+
) external onlyOwner {
|
|
73
|
+
require(splitter != address(0), "Must not be zero address");
|
|
74
|
+
require(bps <= MAX_BPS, "Exceeds max BPS");
|
|
75
|
+
royaltyConfigs[coreContract][projectId] = RoyaltyConfig(splitter, bps);
|
|
76
|
+
emit RoyaltyConfigUpdated(coreContract, projectId, splitter, bps);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @notice Removes the royalty configuration for a given core contract and
|
|
81
|
+
* project.
|
|
82
|
+
* @param coreContract Core contract address.
|
|
83
|
+
* @param projectId Project ID on the core contract.
|
|
84
|
+
*/
|
|
85
|
+
function removeRoyaltyConfig(
|
|
86
|
+
address coreContract,
|
|
87
|
+
uint256 projectId
|
|
88
|
+
) external onlyOwner {
|
|
89
|
+
delete royaltyConfigs[coreContract][projectId];
|
|
90
|
+
emit RoyaltyConfigUpdated(coreContract, projectId, address(0), 0);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @notice Gets royalties for token `tokenId` on contract `tokenAddress`.
|
|
95
|
+
* Returns the configured splitter as the sole recipient with the
|
|
96
|
+
* configured BPS. Reverts if no splitter is configured, causing the
|
|
97
|
+
* Royalty Registry to fall through to other lookup methods.
|
|
98
|
+
* @param tokenAddress Token contract to be queried.
|
|
99
|
+
* @param tokenId Token ID to be queried.
|
|
100
|
+
* @return recipients_ Single-element array with the splitter address.
|
|
101
|
+
* @return bps Single-element array with the configured BPS value.
|
|
102
|
+
*/
|
|
103
|
+
function getRoyalties(
|
|
104
|
+
address tokenAddress,
|
|
105
|
+
uint256 tokenId
|
|
106
|
+
)
|
|
107
|
+
external
|
|
108
|
+
view
|
|
109
|
+
returns (address payable[] memory recipients_, uint256[] memory bps)
|
|
110
|
+
{
|
|
111
|
+
uint256 projectId = tokenId.tokenIdToProjectId();
|
|
112
|
+
RoyaltyConfig storage config = royaltyConfigs[tokenAddress][projectId];
|
|
113
|
+
require(config.splitter != address(0), "No royalty configured");
|
|
114
|
+
recipients_ = new address payable[](1);
|
|
115
|
+
bps = new uint256[](1);
|
|
116
|
+
recipients_[0] = payable(config.splitter);
|
|
117
|
+
bps[0] = config.bps;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @dev See {IERC165-supportsInterface}.
|
|
122
|
+
*/
|
|
123
|
+
function supportsInterface(
|
|
124
|
+
bytes4 interfaceId
|
|
125
|
+
) public view override(ERC165, IERC165) returns (bool) {
|
|
126
|
+
return
|
|
127
|
+
interfaceId == type(IArtblocksRoyaltyOverride).interfaceId ||
|
|
128
|
+
super.supportsInterface(interfaceId);
|
|
129
|
+
}
|
|
130
|
+
}
|