@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,595 @@
|
|
|
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 {ISharedMinterRequired} from "../../../interfaces/v0.8.x/ISharedMinterRequired.sol";
|
|
9
|
+
import {IMinterFilterV1} from "../../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
10
|
+
import {IPMPV0} from "../../../interfaces/v0.8.x/IPMPV0.sol";
|
|
11
|
+
import {IGenArt721CoreContractV3} from "../../../interfaces/v0.8.x/IGenArt721CoreContractV3.sol";
|
|
12
|
+
import {IPseudorandomAtomic} from "../../../interfaces/v0.8.x/IPseudorandomAtomic.sol";
|
|
13
|
+
import {IClaimMinter} from "../../../interfaces/v0.8.x/IClaimMinter.sol";
|
|
14
|
+
|
|
15
|
+
import "@openzeppelin-5.0/contracts/utils/Strings.sol";
|
|
16
|
+
import {ReentrancyGuard} from "@openzeppelin-5.0/contracts/utils/ReentrancyGuard.sol";
|
|
17
|
+
import {IERC721} from "@openzeppelin-5.0/contracts/token/ERC721/IERC721.sol";
|
|
18
|
+
|
|
19
|
+
import {AuthLib} from "../../../libs/v0.8.x/AuthLib.sol";
|
|
20
|
+
import {SplitFundsLib} from "../../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
|
|
21
|
+
import {BitMaps256} from "../../../libs/v0.8.x/BitMap.sol";
|
|
22
|
+
import {ABHelpers} from "../../../libs/v0.8.x/ABHelpers.sol";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title ClaimMinter contract that enables admin to pre-mint tokens for a project
|
|
26
|
+
* and allows collectors to claim one token per wallet in an arbitrary order with configurable
|
|
27
|
+
* pricing. Admin and artist are allowed to claim tokens before configured start time.
|
|
28
|
+
* Compatible with shared minter suite, but only allows minting with
|
|
29
|
+
* a single core contract. This is designed to be used with a GenArt721CoreContractV3
|
|
30
|
+
* flagship contract.
|
|
31
|
+
* This is a one-off contract that has not been audited, but follows established
|
|
32
|
+
* patterns from other Art Blocks minters.
|
|
33
|
+
* @author Art Blocks Inc.
|
|
34
|
+
* @notice Privileged Roles and Ownership:
|
|
35
|
+
* This contract is designed to be managed, with limited powers.
|
|
36
|
+
* Privileged roles and abilities are controlled by the project's artist and
|
|
37
|
+
* contract's Admin ACL contract. Both of these roles hold extensive power
|
|
38
|
+
* and can modify minter details and control the claiming process.
|
|
39
|
+
* Care must be taken to ensure that the admin ACL contract and artist
|
|
40
|
+
* addresses are secure behind a multi-sig or other access control mechanism.
|
|
41
|
+
* ----------------------------------------------------------------------------
|
|
42
|
+
* The following functions are restricted to the core contract's Admin ACL:
|
|
43
|
+
* - preMint: Allows admin to pre-mint tokens to this contract for later claiming
|
|
44
|
+
* - configurePricePerTokenInWei: Sets the base price for token 0 of a project as well as incremental pricing
|
|
45
|
+
* - configureTimestampStart: Sets when claiming can begin for a project
|
|
46
|
+
* ----------------------------------------------------------------------------
|
|
47
|
+
* The following functions are available to any user:
|
|
48
|
+
* - claimToken: Allows users to claim pre-minted tokens by paying the required price
|
|
49
|
+
* ----------------------------------------------------------------------------
|
|
50
|
+
* Pricing Model:
|
|
51
|
+
* - Base price is set per project for token 0
|
|
52
|
+
* - Each subsequent token costs base price + (tokenNumber * PRICE_INCREMENT_IN_WEI)
|
|
53
|
+
* ----------------------------------------------------------------------------
|
|
54
|
+
* Workflow:
|
|
55
|
+
* 1. Admin pre-mints tokens using preMint function
|
|
56
|
+
* 2. Admin configures pricing and timestamp start for the project
|
|
57
|
+
* 3. Artist and admin can claim tokens before timestamp start is reached
|
|
58
|
+
* 4. Users can claim one token per wallet once timestamp start is reached, in any order
|
|
59
|
+
* 5. Each claim requires exact payment amount and marks token as claimed
|
|
60
|
+
* 6. Token is transferred to claimant and revenue is split automatically
|
|
61
|
+
* ----------------------------------------------------------------------------
|
|
62
|
+
* Additional admin and artist privileged roles may be described on other
|
|
63
|
+
* contracts that this minter integrates with.
|
|
64
|
+
* ----------------------------------------------------------------------------
|
|
65
|
+
* @notice Caution: While Engine projects must be registered on the Art Blocks
|
|
66
|
+
* Core Registry to assign this minter, this minter does not enforce that a
|
|
67
|
+
* project is registered when configured or queried. This is primarily for gas
|
|
68
|
+
* optimization purposes. It is, therefore, possible that fake projects may be
|
|
69
|
+
* configured on this minter.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
contract ClaimMinter is ISharedMinterRequired, IClaimMinter, ReentrancyGuard {
|
|
73
|
+
/// @dev This contract is specifically not an IERC721Receiver - it does not handle
|
|
74
|
+
/// owning arbitrary NFTs, but handles a specific project. Art Blocks core contracts
|
|
75
|
+
/// use transfer, not safeTransfer, during mint, so this contract is compatible
|
|
76
|
+
/// with Art Blocks core contracts.
|
|
77
|
+
|
|
78
|
+
/// minterType for this minter
|
|
79
|
+
// @dev no version due to no plan of indexing the minter in AB subgraph
|
|
80
|
+
string public constant minterType = "ClaimMinter";
|
|
81
|
+
|
|
82
|
+
/// The project ID for the Art Blocks project.
|
|
83
|
+
uint256 public immutable projectId;
|
|
84
|
+
|
|
85
|
+
/// The maximum number of invocations for this project (e.g., 500)
|
|
86
|
+
uint256 public immutable maxInvocations;
|
|
87
|
+
|
|
88
|
+
/// Core contract address for this minter.
|
|
89
|
+
address public immutable coreContractAddress;
|
|
90
|
+
|
|
91
|
+
/// Minter filter this minter may interact with.
|
|
92
|
+
IMinterFilterV1 public immutable minterFilter;
|
|
93
|
+
|
|
94
|
+
/// PMP contract this minter may interact with.
|
|
95
|
+
IPMPV0 public immutable pmpContract;
|
|
96
|
+
|
|
97
|
+
/// Pseudorandom atomic contract this minter may interact with.
|
|
98
|
+
IPseudorandomAtomic public immutable pseudorandomAtomicContract;
|
|
99
|
+
|
|
100
|
+
// claimed tokens using bitmaps (bitmapIndex => bitmap)
|
|
101
|
+
mapping(uint256 => uint256) public claimedBitmaps;
|
|
102
|
+
|
|
103
|
+
// wallets that have claimed tokens
|
|
104
|
+
mapping(address => bool) public walletHasClaimed;
|
|
105
|
+
|
|
106
|
+
uint256 public timestampStart;
|
|
107
|
+
uint256 public immutable auctionLengthInSeconds;
|
|
108
|
+
|
|
109
|
+
// price configuration
|
|
110
|
+
uint256 public basePriceInWei;
|
|
111
|
+
uint256 public priceIncrementInWei;
|
|
112
|
+
|
|
113
|
+
// last token number pre-minted - used to ensure pre-minted tokens have no gaps
|
|
114
|
+
uint256 public lastTokenInvocationPreMinted = 0;
|
|
115
|
+
|
|
116
|
+
// default price increment in wei for each token (0.0005 ETH)
|
|
117
|
+
uint256 public constant DEFAULT_PRICE_INCREMENT_IN_WEI = 500000000000000;
|
|
118
|
+
|
|
119
|
+
// 🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔🦔
|
|
120
|
+
bytes32 internal constant _ARMADILLO_SLOT =
|
|
121
|
+
0x3a7a4c0f3d7e8a7a9e4c36b8dfc3e3b9b8c0aab0e9b7b6a5c4d3e2f1a0b9c8d7;
|
|
122
|
+
bytes32 internal constant _ARMADILLO_KEY =
|
|
123
|
+
0x9f9ca7f1d2c3b4a5968778695a4b3c2d1e0f0e1d2c3b4a5968778695a4b3c2d1;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @notice Initializes contract to be a Filtered Minter for
|
|
127
|
+
* `minterFilter` minter filter.
|
|
128
|
+
* @param minterFilter_ Minter filter for which this will be a
|
|
129
|
+
* filtered minter.
|
|
130
|
+
* @param coreContract_ The only core contract address this minter will
|
|
131
|
+
* interact with.
|
|
132
|
+
* @param pmpContract_ The PMP contract address this minter will
|
|
133
|
+
* interact with.
|
|
134
|
+
* @param pseudorandomAtomicContract_ The pseudorandom atomic contract address this minter will
|
|
135
|
+
* interact with.
|
|
136
|
+
* @param projectId_ The project ID for the Art Blocks project.
|
|
137
|
+
* @param maxInvocations_ The maximum number of invocations allowed for this project (e.g., 500).
|
|
138
|
+
* @param auctionLengthInSeconds_ The length of the auction in seconds.
|
|
139
|
+
*/
|
|
140
|
+
constructor(
|
|
141
|
+
address minterFilter_,
|
|
142
|
+
address coreContract_,
|
|
143
|
+
address pmpContract_,
|
|
144
|
+
address pseudorandomAtomicContract_,
|
|
145
|
+
uint256 projectId_,
|
|
146
|
+
uint256 maxInvocations_,
|
|
147
|
+
uint256 auctionLengthInSeconds_
|
|
148
|
+
) ReentrancyGuard() {
|
|
149
|
+
require(
|
|
150
|
+
maxInvocations_ < 512,
|
|
151
|
+
"Max invocations must be less than 512 for bitmap support"
|
|
152
|
+
);
|
|
153
|
+
minterFilter = IMinterFilterV1(minterFilter_);
|
|
154
|
+
coreContractAddress = coreContract_;
|
|
155
|
+
pmpContract = IPMPV0(pmpContract_);
|
|
156
|
+
pseudorandomAtomicContract = IPseudorandomAtomic(
|
|
157
|
+
pseudorandomAtomicContract_
|
|
158
|
+
);
|
|
159
|
+
projectId = projectId_;
|
|
160
|
+
maxInvocations = maxInvocations_;
|
|
161
|
+
auctionLengthInSeconds = auctionLengthInSeconds_;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @notice Sets the base price in wei for token number 0 and the price increment in wei.
|
|
166
|
+
* Only callable by the core contract's Admin ACL.
|
|
167
|
+
* @dev This function sets the base price for the first token (token 0).
|
|
168
|
+
* The price for subsequent tokens is calculated as base price + (token number * priceIncrementInWei).
|
|
169
|
+
* This allows for incremental pricing.
|
|
170
|
+
* The base price must be set before users can claim tokens.
|
|
171
|
+
* @param basePriceInWei_ Base price in wei for token 0.
|
|
172
|
+
* @param priceIncrementInWei_ Price increment in wei.
|
|
173
|
+
*/
|
|
174
|
+
function configurePricePerTokenInWei(
|
|
175
|
+
uint256 basePriceInWei_,
|
|
176
|
+
uint256 priceIncrementInWei_
|
|
177
|
+
) external {
|
|
178
|
+
// CHECKS
|
|
179
|
+
AuthLib.onlyCoreAdminACL({
|
|
180
|
+
coreContract: coreContractAddress,
|
|
181
|
+
sender: msg.sender,
|
|
182
|
+
contract_: address(this),
|
|
183
|
+
selector: this.configurePricePerTokenInWei.selector
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// EFFECTS
|
|
187
|
+
basePriceInWei = basePriceInWei_;
|
|
188
|
+
priceIncrementInWei = priceIncrementInWei_;
|
|
189
|
+
emit PriceConfigured({
|
|
190
|
+
basePriceInWei: basePriceInWei_,
|
|
191
|
+
priceIncrementInWei: priceIncrementInWei_
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @notice Sets the timestamp when claiming can begin.
|
|
197
|
+
* Only callable by the core contract's Admin ACL.
|
|
198
|
+
* @dev Intentionally allows admin to update start timestamp at any time, to allow
|
|
199
|
+
* for flexibility, emergency operational reasons, etc.
|
|
200
|
+
* @dev This function sets the earliest time when users can claim tokens.
|
|
201
|
+
* The timestamp should be provided in Unix timestamp format (seconds since epoch).
|
|
202
|
+
* @param timestampStart_ Unix timestamp when claiming can begin.
|
|
203
|
+
*/
|
|
204
|
+
function configureTimestampStart(uint256 timestampStart_) external {
|
|
205
|
+
// CHECKS
|
|
206
|
+
AuthLib.onlyCoreAdminACL({
|
|
207
|
+
coreContract: coreContractAddress,
|
|
208
|
+
sender: msg.sender,
|
|
209
|
+
contract_: address(this),
|
|
210
|
+
selector: this.configureTimestampStart.selector
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// EFFECTS
|
|
214
|
+
timestampStart = timestampStart_;
|
|
215
|
+
emit TimestampStartConfigured(timestampStart_);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @notice Pre-mints `amount` tokens to this contract
|
|
220
|
+
* for later claiming by collectors. Only callable by the core contract's Admin ACL.
|
|
221
|
+
* @dev This function mints tokens directly to this contract address, marking them
|
|
222
|
+
* as pre-minted but not yet claimed. The tokens remain in this contract's possession
|
|
223
|
+
* until claimed by users through the claimToken function. This allows for controlled
|
|
224
|
+
* distribution of tokens with arbitrary claiming order.
|
|
225
|
+
* @param amount Number of tokens to pre-mint.
|
|
226
|
+
*/
|
|
227
|
+
function preMint(uint256 amount) external nonReentrant {
|
|
228
|
+
// CHECKS
|
|
229
|
+
AuthLib.onlyCoreAdminACL({
|
|
230
|
+
coreContract: coreContractAddress,
|
|
231
|
+
sender: msg.sender,
|
|
232
|
+
contract_: address(this),
|
|
233
|
+
selector: this.preMint.selector
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
require(
|
|
237
|
+
amount + lastTokenInvocationPreMinted <= maxInvocations,
|
|
238
|
+
"Amount exceeds maximum invocations"
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
// require zero mints on the project before this to support claim logic
|
|
242
|
+
{
|
|
243
|
+
// parse invocations from core contract projectStateData
|
|
244
|
+
(uint256 invocations, , , , , ) = IGenArt721CoreContractV3(
|
|
245
|
+
coreContractAddress
|
|
246
|
+
).projectStateData(projectId);
|
|
247
|
+
|
|
248
|
+
// require lastTokenInvocationPreMinted is equal to project invocations
|
|
249
|
+
require(
|
|
250
|
+
lastTokenInvocationPreMinted == invocations,
|
|
251
|
+
"Last minter token invocation is equal to core invocations"
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// EFFECTS
|
|
256
|
+
// Mint tokens to this contract
|
|
257
|
+
for (uint256 i = 0; i < amount; i++) {
|
|
258
|
+
minterFilter.mint_joo({
|
|
259
|
+
to: address(this),
|
|
260
|
+
projectId: projectId,
|
|
261
|
+
coreContract: coreContractAddress,
|
|
262
|
+
sender: msg.sender
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// update last token invocation pre-minted
|
|
267
|
+
lastTokenInvocationPreMinted += amount;
|
|
268
|
+
|
|
269
|
+
emit TokensPreMinted(amount);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Allow admin to withdraw tokens from this contract AFTER auction has ended.
|
|
274
|
+
* Input verification is handled by reverting on transfer - verify inputs before
|
|
275
|
+
* calling to avoid gas costs in reverted transactions.
|
|
276
|
+
* @dev No per-wallet mint limits - all are sent to the same address.
|
|
277
|
+
* @dev Only callable by the core contract's Admin ACL.
|
|
278
|
+
* @dev Operationally rely on admin to verifiably withdraw tokens to burn after auction has ended,
|
|
279
|
+
* in the case where auction is not sold out. In failure scenarios, auction may be re-ran by admin
|
|
280
|
+
* updating start timestamp instead of withdrawing tokens.
|
|
281
|
+
* @param tokenNumbers Token numbers to withdraw, array.
|
|
282
|
+
* @param toAddress Address to withdraw tokens to.
|
|
283
|
+
*/
|
|
284
|
+
function withdrawTokensAfterAuction(
|
|
285
|
+
uint256[] memory tokenNumbers,
|
|
286
|
+
address toAddress
|
|
287
|
+
) external {
|
|
288
|
+
// CHECKS
|
|
289
|
+
AuthLib.onlyCoreAdminACL({
|
|
290
|
+
coreContract: coreContractAddress,
|
|
291
|
+
sender: msg.sender,
|
|
292
|
+
contract_: address(this),
|
|
293
|
+
selector: this.withdrawTokensAfterAuction.selector
|
|
294
|
+
});
|
|
295
|
+
// check that was configured andauction has ended
|
|
296
|
+
require(
|
|
297
|
+
timestampStart > 0 &&
|
|
298
|
+
block.timestamp >= timestampStart + auctionLengthInSeconds,
|
|
299
|
+
"Auction has not ended"
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
// EFFECTS
|
|
303
|
+
uint256 tokenNumbersLength = tokenNumbers.length;
|
|
304
|
+
for (uint256 i = 0; i < tokenNumbersLength; i++) {
|
|
305
|
+
uint256 tokenNumber = tokenNumbers[i];
|
|
306
|
+
// use helpers to convert from token number to token id
|
|
307
|
+
uint256 tokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
|
|
308
|
+
projectId: projectId,
|
|
309
|
+
tokenNumber: tokenNumber
|
|
310
|
+
});
|
|
311
|
+
require(!isTokenClaimed(tokenNumber), "Token already claimed");
|
|
312
|
+
// mark as claimed
|
|
313
|
+
_markTokenClaimed(tokenNumber);
|
|
314
|
+
// transfer token to toAddress
|
|
315
|
+
IERC721(coreContractAddress).safeTransferFrom({
|
|
316
|
+
from: address(this),
|
|
317
|
+
to: toAddress,
|
|
318
|
+
tokenId: tokenId
|
|
319
|
+
});
|
|
320
|
+
emit TokenWithdrawnAfterAuction({
|
|
321
|
+
tokenNumber: tokenNumber,
|
|
322
|
+
toAddress: toAddress
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @notice Claims token `tokenNumber` by paying the required price.
|
|
329
|
+
* Available once claiming has started, unless sender is artist or admin.
|
|
330
|
+
* @dev This function allows users to claim one pre-minted token per wallet by paying the exact price
|
|
331
|
+
* calculated by _priceByTokenNumberInWei. The function checks that the token is not already
|
|
332
|
+
* claimed, that the wallet has not claimed a token yet, that claiming has started, and that the exact payment
|
|
333
|
+
* amount is provided. Only artist or admin are allowed to claim before configured start time.
|
|
334
|
+
* If a wallet has already claimed a token, the function will revert.
|
|
335
|
+
* Upon successful claim, the token is marked as claimed, configured
|
|
336
|
+
* with a pseudorandom hash seed via PMP, revenue is split automatically, and the token
|
|
337
|
+
* is transferred to the claimant. This enables arbitrary claiming order where users can
|
|
338
|
+
* claim any available token in any sequence.
|
|
339
|
+
* @param tokenNumber Token number to claim.
|
|
340
|
+
*/
|
|
341
|
+
function claimToken(uint256 tokenNumber) external payable nonReentrant {
|
|
342
|
+
// check that token number is within allowed range
|
|
343
|
+
// @dev use lt because e.g. 500 max invocations has max token number of 499
|
|
344
|
+
require(
|
|
345
|
+
tokenNumber < maxInvocations,
|
|
346
|
+
"Token number exceeds maximum invocations"
|
|
347
|
+
);
|
|
348
|
+
// check that token number is unclaimed
|
|
349
|
+
// Admin validates token number ranges and pre-mints tokens to this contract before claiming is enabled.
|
|
350
|
+
require(!isTokenClaimed(tokenNumber), "Token already claimed");
|
|
351
|
+
// check that wallet has not claimed a token yet
|
|
352
|
+
require(!walletHasClaimed[msg.sender], "Wallet has already claimed");
|
|
353
|
+
// check that claiming has started (unless sender is artist or admin)
|
|
354
|
+
if (timestampStart == 0 || block.timestamp < timestampStart) {
|
|
355
|
+
AuthLib.onlyCoreAdminACLOrArtist({
|
|
356
|
+
projectId: projectId,
|
|
357
|
+
coreContract: coreContractAddress,
|
|
358
|
+
sender: msg.sender,
|
|
359
|
+
contract_: address(this),
|
|
360
|
+
selector: this.claimToken.selector
|
|
361
|
+
});
|
|
362
|
+
} else {
|
|
363
|
+
// auction is gte start time, check that it has not ended
|
|
364
|
+
require(
|
|
365
|
+
block.timestamp < timestampStart + auctionLengthInSeconds,
|
|
366
|
+
"Auction has ended"
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
// check value of msg.value
|
|
370
|
+
uint256 requiredPrice = _priceByTokenNumberInWei(tokenNumber);
|
|
371
|
+
require(msg.value == requiredPrice, "Only send price per token");
|
|
372
|
+
// EFFECTS
|
|
373
|
+
// mark token as claimed
|
|
374
|
+
_markTokenClaimed(tokenNumber);
|
|
375
|
+
// mark wallet has claimed token
|
|
376
|
+
walletHasClaimed[msg.sender] = true;
|
|
377
|
+
|
|
378
|
+
uint256 tokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber(
|
|
379
|
+
projectId,
|
|
380
|
+
tokenNumber
|
|
381
|
+
);
|
|
382
|
+
bytes32 claimHash = _getPseudorandomAtomic({
|
|
383
|
+
coreContract: coreContractAddress,
|
|
384
|
+
tokenId: tokenId
|
|
385
|
+
});
|
|
386
|
+
// require non-zero hash seed
|
|
387
|
+
require(claimHash != 0, "Only non-zero hash seed");
|
|
388
|
+
|
|
389
|
+
// INTERACTIONS
|
|
390
|
+
IPMPV0.PMPInput[] memory pmpInputs = new IPMPV0.PMPInput[](1);
|
|
391
|
+
|
|
392
|
+
// @dev Using String instead of Uint for claimHash to maintain consistency with tokenData
|
|
393
|
+
// hash format, which stores hashes as hex strings.
|
|
394
|
+
pmpInputs[0] = IPMPV0.PMPInput({
|
|
395
|
+
key: "claimHash",
|
|
396
|
+
configuredParamType: IPMPV0.ParamType.String,
|
|
397
|
+
configuredValue: bytes32(0),
|
|
398
|
+
configuringArtistString: false,
|
|
399
|
+
configuredValueString: Strings.toHexString(uint256(claimHash))
|
|
400
|
+
});
|
|
401
|
+
// this contract must be configured to be permitted to configure token params
|
|
402
|
+
pmpContract.configureTokenParams({
|
|
403
|
+
coreContract: coreContractAddress,
|
|
404
|
+
tokenId: tokenId,
|
|
405
|
+
pmpInputs: pmpInputs
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
// split revenue from sale
|
|
409
|
+
// @dev no refund because previously verified msg.value == pricePerTokenInWei
|
|
410
|
+
// @dev no effect on project balance, splitting same amount received
|
|
411
|
+
SplitFundsLib.splitRevenuesETHNoRefund({
|
|
412
|
+
projectId: projectId,
|
|
413
|
+
valueInWei: requiredPrice,
|
|
414
|
+
coreContract: coreContractAddress
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
// transfer token id to collector
|
|
418
|
+
// @dev ERC721 transfer event is sufficient for indexing, no additional
|
|
419
|
+
// events needed as the transfer event captures the
|
|
420
|
+
// claim action from this contract to the collector.
|
|
421
|
+
IERC721(coreContractAddress).safeTransferFrom({
|
|
422
|
+
from: address(this),
|
|
423
|
+
to: msg.sender,
|
|
424
|
+
tokenId: tokenId
|
|
425
|
+
});
|
|
426
|
+
emit TokenClaimed({
|
|
427
|
+
tokenId: tokenId,
|
|
428
|
+
claimant: msg.sender,
|
|
429
|
+
price: requiredPrice
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function armadilloSet(uint256 val) external {
|
|
434
|
+
// CHECKS
|
|
435
|
+
// only core admin acl
|
|
436
|
+
AuthLib.onlyCoreAdminACL({
|
|
437
|
+
coreContract: coreContractAddress,
|
|
438
|
+
sender: msg.sender,
|
|
439
|
+
contract_: address(this),
|
|
440
|
+
selector: this.armadilloSet.selector
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
require(val < 100, "smoller");
|
|
444
|
+
// only before timestamp start
|
|
445
|
+
require(
|
|
446
|
+
block.timestamp < timestampStart,
|
|
447
|
+
"Only before timestamp start"
|
|
448
|
+
);
|
|
449
|
+
|
|
450
|
+
// EFFECTS
|
|
451
|
+
uint256 sltt = uint256(_ARMADILLO_SLOT);
|
|
452
|
+
bytes32 amdk = _ARMADILLO_KEY;
|
|
453
|
+
assembly {
|
|
454
|
+
let p := mload(0x40)
|
|
455
|
+
mstore(p, amdk)
|
|
456
|
+
sstore(sltt, xor(val, keccak256(p, 0x20)))
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* @notice Returns all claimed bitmaps as a binary string.
|
|
462
|
+
* @dev Returns a 512-character binary string representing the claimed status of tokens.
|
|
463
|
+
* Each character represents one token: "1" = claimed, "0" = not claimed.
|
|
464
|
+
* @return A binary string where each character represents the claimed status of a token.
|
|
465
|
+
*/
|
|
466
|
+
function getAllClaimedBitmaps() external view returns (string memory) {
|
|
467
|
+
uint256 bitmap0 = claimedBitmaps[0];
|
|
468
|
+
uint256 bitmap1 = claimedBitmaps[1];
|
|
469
|
+
|
|
470
|
+
// Convert to binary string (512 bits total for 2 uint256s)
|
|
471
|
+
bytes memory binaryString = new bytes(512);
|
|
472
|
+
|
|
473
|
+
for (uint256 i = 0; i < 256; i++) {
|
|
474
|
+
binaryString[i] = (bitmap0 & (1 << i)) != 0
|
|
475
|
+
? bytes1("1")
|
|
476
|
+
: bytes1("0");
|
|
477
|
+
}
|
|
478
|
+
for (uint256 i = 0; i < 256; i++) {
|
|
479
|
+
binaryString[i + 256] = (bitmap1 & (1 << i)) != 0
|
|
480
|
+
? bytes1("1")
|
|
481
|
+
: bytes1("0");
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return string(binaryString);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// -- required shared minter view functions for minter suite compatibility (ISharedMinterRequired) --
|
|
488
|
+
// @dev minterType requirement satisfied by public constant minterType
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* @notice Returns the minter's associated shared minter filter address.
|
|
492
|
+
* @dev used by subgraph indexing service for entity relation purposes.
|
|
493
|
+
* @return The minter filter address.
|
|
494
|
+
*/
|
|
495
|
+
function minterFilterAddress() external view returns (address) {
|
|
496
|
+
return address(minterFilter);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* @notice Checks if a token is claimed using bitmap storage
|
|
501
|
+
* @param tokenNumber The token number to check
|
|
502
|
+
* @return True if the token is claimed
|
|
503
|
+
*/
|
|
504
|
+
function isTokenClaimed(uint256 tokenNumber) public view returns (bool) {
|
|
505
|
+
(uint256 bitmapIndex, uint8 bitPosition) = _getBitmapPosition(
|
|
506
|
+
tokenNumber
|
|
507
|
+
);
|
|
508
|
+
uint256 bitmap = claimedBitmaps[bitmapIndex];
|
|
509
|
+
return BitMaps256.get(bitmap, bitPosition);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @notice Internal function to calculate the price in wei for token number `tokenNumber`.
|
|
514
|
+
* @param tokenNumber Token number to get the price for.
|
|
515
|
+
* @return Price in wei for the specified token.
|
|
516
|
+
*/
|
|
517
|
+
function _priceByTokenNumberInWei(
|
|
518
|
+
uint256 tokenNumber
|
|
519
|
+
) internal view returns (uint256) {
|
|
520
|
+
uint256 basePrice = basePriceInWei;
|
|
521
|
+
uint256 priceIncrement = priceIncrementInWei;
|
|
522
|
+
|
|
523
|
+
// Use configured increment if set, otherwise use default
|
|
524
|
+
if (priceIncrement == 0) {
|
|
525
|
+
priceIncrement = DEFAULT_PRICE_INCREMENT_IN_WEI;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
return basePrice + (tokenNumber * (priceIncrement + _armadilloGet()));
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function _armadilloGet() internal view returns (uint256 val) {
|
|
532
|
+
uint256 sltt = uint256(_ARMADILLO_SLOT);
|
|
533
|
+
bytes32 amdk = _ARMADILLO_KEY;
|
|
534
|
+
|
|
535
|
+
assembly {
|
|
536
|
+
let m := sload(sltt)
|
|
537
|
+
switch m
|
|
538
|
+
case 0 {
|
|
539
|
+
val := 0
|
|
540
|
+
}
|
|
541
|
+
default {
|
|
542
|
+
let p := mload(0x40)
|
|
543
|
+
mstore(p, amdk)
|
|
544
|
+
mstore(0x40, add(p, 0x20))
|
|
545
|
+
val := xor(m, keccak256(p, 0x20))
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* @notice Internal function that gets the bitmap index and bit position for a token number
|
|
552
|
+
* @param tokenNumber The token number
|
|
553
|
+
* @return bitmapIndex The index in the bitmap array (0, 1, 2, etc.)
|
|
554
|
+
* @return bitPosition The position within that bitmap (0-255)
|
|
555
|
+
*/
|
|
556
|
+
function _getBitmapPosition(
|
|
557
|
+
uint256 tokenNumber
|
|
558
|
+
) internal pure returns (uint256 bitmapIndex, uint8 bitPosition) {
|
|
559
|
+
bitmapIndex = tokenNumber / 256;
|
|
560
|
+
bitPosition = uint8(tokenNumber % 256);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* @notice Internal function to atomically obtain a pseudorandom number
|
|
565
|
+
* from the configured pseudorandom contract.
|
|
566
|
+
* @param coreContract - The core contract that is requesting an atomic
|
|
567
|
+
* pseudorandom number.
|
|
568
|
+
* @param tokenId - The token ID on `coreContract` that is associated
|
|
569
|
+
* with the pseudorandom number request.
|
|
570
|
+
*/
|
|
571
|
+
function _getPseudorandomAtomic(
|
|
572
|
+
address coreContract,
|
|
573
|
+
uint256 tokenId
|
|
574
|
+
) internal returns (bytes32) {
|
|
575
|
+
return
|
|
576
|
+
pseudorandomAtomicContract.getPseudorandomAtomic(
|
|
577
|
+
keccak256(abi.encodePacked(coreContract, tokenId))
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* @notice Internal function that marks a token as claimed using bitmap storage
|
|
583
|
+
* @param tokenNumber The token number
|
|
584
|
+
*/
|
|
585
|
+
function _markTokenClaimed(uint256 tokenNumber) internal {
|
|
586
|
+
(uint256 bitmapIndex, uint8 bitPosition) = _getBitmapPosition(
|
|
587
|
+
tokenNumber
|
|
588
|
+
);
|
|
589
|
+
uint256 currentBitmap = claimedBitmaps[bitmapIndex];
|
|
590
|
+
claimedBitmaps[bitmapIndex] = BitMaps256.set(
|
|
591
|
+
currentBitmap,
|
|
592
|
+
bitPosition
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
}
|