@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,493 @@
|
|
|
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.19;
|
|
7
|
+
|
|
8
|
+
import {ISharedMinterSimplePurchaseV0} from "../../interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol";
|
|
9
|
+
import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
|
|
10
|
+
import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
11
|
+
|
|
12
|
+
import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
|
|
13
|
+
import {SplitFundsLib} from "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
|
|
14
|
+
import {MaxInvocationsLib} from "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
|
|
15
|
+
import {SetPriceLib} from "../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
|
|
16
|
+
|
|
17
|
+
import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @title Shared, filtered Minter contract that allows tokens to be minted with
|
|
21
|
+
* ETH at or above a configured minimum price ("pay what you want" with a floor).
|
|
22
|
+
* This is designed to be used with GenArt721CoreContractV3 flagship or
|
|
23
|
+
* engine contracts.
|
|
24
|
+
* @author Art Blocks Inc.
|
|
25
|
+
* @notice Privileged Roles and Ownership:
|
|
26
|
+
* This contract is designed to be managed, with limited powers.
|
|
27
|
+
* Privileged roles and abilities are controlled by the project's artist, which
|
|
28
|
+
* can be modified by the core contract's Admin ACL contract. Both of these
|
|
29
|
+
* roles hold extensive power and can modify minter details.
|
|
30
|
+
* Care must be taken to ensure that the admin ACL contract and artist
|
|
31
|
+
* addresses are secure behind a multi-sig or other access control mechanism.
|
|
32
|
+
* ----------------------------------------------------------------------------
|
|
33
|
+
* The following functions are restricted to a project's artist:
|
|
34
|
+
* - updatePricePerTokenInWei (sets minimum price)
|
|
35
|
+
* - syncProjectMaxInvocationsToCore
|
|
36
|
+
* - manuallyLimitProjectMaxInvocations
|
|
37
|
+
* ----------------------------------------------------------------------------
|
|
38
|
+
* Additional admin and artist privileged roles may be described on other
|
|
39
|
+
* contracts that this minter integrates with.
|
|
40
|
+
* ----------------------------------------------------------------------------
|
|
41
|
+
* @notice Caution: While Engine projects must be registered on the Art Blocks
|
|
42
|
+
* Core Registry to assign this minter, this minter does not enforce that a
|
|
43
|
+
* project is registered when configured or queried. This is primarily for gas
|
|
44
|
+
* optimization purposes. It is, therefore, possible that fake projects may be
|
|
45
|
+
* configured on this minter, but they will not be able to mint tokens due to
|
|
46
|
+
* checks performed by this minter's Minter Filter.
|
|
47
|
+
* ----------------------------------------------------------------------------
|
|
48
|
+
* @notice Pricing Mechanism:
|
|
49
|
+
* This minter accepts payments at or above a configured minimum price per token,
|
|
50
|
+
* up to a maximum of 20x the minimum price (to prevent fat-finger errors).
|
|
51
|
+
* The minimum configurable price is 0.015 ETH (MIN_PRICE_PER_TOKEN).
|
|
52
|
+
* The full amount sent (msg.value) is accepted and split among stakeholders
|
|
53
|
+
* according to the configured revenue splits - no refund is issued for amounts
|
|
54
|
+
* above the minimum price.
|
|
55
|
+
* ----------------------------------------------------------------------------
|
|
56
|
+
* @notice Price Recording:
|
|
57
|
+
* This minter records the actual price paid for each token, which can be
|
|
58
|
+
* retrieved via the `getTokenPricePaid` view function.
|
|
59
|
+
*/
|
|
60
|
+
contract MinterSlidingScaleV0 is
|
|
61
|
+
ReentrancyGuard,
|
|
62
|
+
ISharedMinterSimplePurchaseV0,
|
|
63
|
+
ISharedMinterV0
|
|
64
|
+
{
|
|
65
|
+
/// Minter filter address this minter interacts with
|
|
66
|
+
address public immutable minterFilterAddress;
|
|
67
|
+
|
|
68
|
+
/// Minter filter this minter may interact with.
|
|
69
|
+
IMinterFilterV1 private immutable _minterFilter;
|
|
70
|
+
|
|
71
|
+
/// minterType for this minter
|
|
72
|
+
string public constant minterType = "MinterSlidingScaleV0";
|
|
73
|
+
|
|
74
|
+
/// minter version for this minter
|
|
75
|
+
string public constant minterVersion = "v0.0.0";
|
|
76
|
+
|
|
77
|
+
/// @notice Maximum price multiplier relative to the minimum price.
|
|
78
|
+
/// @dev Payments are capped at MAX_PRICE_MULTIPLIER * minPrice to prevent
|
|
79
|
+
/// fat-finger errors.
|
|
80
|
+
uint256 public constant MAX_PRICE_MULTIPLIER = 20;
|
|
81
|
+
|
|
82
|
+
/// @notice Minimum allowed price per token in Wei (0.015 ETH).
|
|
83
|
+
/// @dev Artists cannot configure a price below this value.
|
|
84
|
+
uint256 public constant MIN_PRICE_PER_TOKEN = 0.015 ether;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @notice Emitted when a token is minted, recording the price paid.
|
|
88
|
+
* @param coreContract Core contract address for the token
|
|
89
|
+
* @param tokenId Token ID that was minted
|
|
90
|
+
* @param pricePaid Price paid for the token in Wei
|
|
91
|
+
*/
|
|
92
|
+
event TokenPricePaid(
|
|
93
|
+
address indexed coreContract,
|
|
94
|
+
uint256 indexed tokenId,
|
|
95
|
+
uint256 pricePaid
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
/// @notice Mapping of core contract => tokenId => price paid in Wei
|
|
99
|
+
mapping(address coreContract => mapping(uint256 tokenId => uint256 pricePaid))
|
|
100
|
+
private _tokenPricePaid;
|
|
101
|
+
|
|
102
|
+
// MODIFIERS
|
|
103
|
+
// @dev contract uses modifier-like internal functions instead of modifiers
|
|
104
|
+
// to reduce contract bytecode size
|
|
105
|
+
// @dev contract uses AuthLib for some modifier-like functions
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @notice Initializes contract to be a Filtered Minter for
|
|
109
|
+
* `minterFilter` minter filter.
|
|
110
|
+
* @param minterFilter Minter filter for which this will be a
|
|
111
|
+
* filtered minter.
|
|
112
|
+
*/
|
|
113
|
+
constructor(address minterFilter) ReentrancyGuard() {
|
|
114
|
+
minterFilterAddress = minterFilter;
|
|
115
|
+
_minterFilter = IMinterFilterV1(minterFilter);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @notice Manually sets the local maximum invocations of project `projectId`
|
|
120
|
+
* with the provided `maxInvocations`, checking that `maxInvocations` is less
|
|
121
|
+
* than or equal to the value of project `project_id`'s maximum invocations that is
|
|
122
|
+
* set on the core contract.
|
|
123
|
+
* @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
|
|
124
|
+
* value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
|
|
125
|
+
* this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
|
|
126
|
+
* @param projectId Project ID to set the maximum invocations for.
|
|
127
|
+
* @param coreContract Core contract address for the given project.
|
|
128
|
+
* @param maxInvocations Maximum invocations to set for the project.
|
|
129
|
+
*/
|
|
130
|
+
function manuallyLimitProjectMaxInvocations(
|
|
131
|
+
uint256 projectId,
|
|
132
|
+
address coreContract,
|
|
133
|
+
uint24 maxInvocations
|
|
134
|
+
) external {
|
|
135
|
+
AuthLib.onlyArtist({
|
|
136
|
+
projectId: projectId,
|
|
137
|
+
coreContract: coreContract,
|
|
138
|
+
sender: msg.sender
|
|
139
|
+
});
|
|
140
|
+
MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
|
|
141
|
+
projectId: projectId,
|
|
142
|
+
coreContract: coreContract,
|
|
143
|
+
maxInvocations: maxInvocations
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @notice Updates this minter's minimum price per token of project `projectId`
|
|
149
|
+
* to be '_pricePerTokenInWei`, in Wei.
|
|
150
|
+
* @dev The configured minimum price must be >= MIN_PRICE_PER_TOKEN (0.015 ETH).
|
|
151
|
+
* @dev Purchasers may send any amount >= this minimum price, up to 20x the
|
|
152
|
+
* minimum price.
|
|
153
|
+
* @param projectId Project ID to set the minimum price per token for.
|
|
154
|
+
* @param coreContract Core contract address for the given project.
|
|
155
|
+
* @param pricePerTokenInWei Minimum price per token to set for the project, in Wei.
|
|
156
|
+
* Must be >= MIN_PRICE_PER_TOKEN.
|
|
157
|
+
*/
|
|
158
|
+
function updatePricePerTokenInWei(
|
|
159
|
+
uint256 projectId,
|
|
160
|
+
address coreContract,
|
|
161
|
+
uint248 pricePerTokenInWei
|
|
162
|
+
) external {
|
|
163
|
+
AuthLib.onlyArtist({
|
|
164
|
+
projectId: projectId,
|
|
165
|
+
coreContract: coreContract,
|
|
166
|
+
sender: msg.sender
|
|
167
|
+
});
|
|
168
|
+
require(
|
|
169
|
+
pricePerTokenInWei >= MIN_PRICE_PER_TOKEN,
|
|
170
|
+
"Price lt min allowed price"
|
|
171
|
+
);
|
|
172
|
+
SetPriceLib.updatePricePerToken({
|
|
173
|
+
projectId: projectId,
|
|
174
|
+
coreContract: coreContract,
|
|
175
|
+
pricePerToken: pricePerTokenInWei
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
// for convenience, sync local max invocations to the core contract if
|
|
179
|
+
// and only if max invocations have not already been synced.
|
|
180
|
+
// @dev do not sync if max invocations have already been synced, as
|
|
181
|
+
// local max invocations could have been manually set to be
|
|
182
|
+
// intentionally less than the core contract's max invocations.
|
|
183
|
+
// @dev if local maxInvocations and maxHasBeenInvoked are both
|
|
184
|
+
// initial values, we know they have not been populated on this minter
|
|
185
|
+
if (
|
|
186
|
+
MaxInvocationsLib.maxInvocationsIsUnconfigured({
|
|
187
|
+
projectId: projectId,
|
|
188
|
+
coreContract: coreContract
|
|
189
|
+
})
|
|
190
|
+
) {
|
|
191
|
+
MaxInvocationsLib.syncProjectMaxInvocationsToCore({
|
|
192
|
+
projectId: projectId,
|
|
193
|
+
coreContract: coreContract
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* @notice Purchases a token from project `projectId`.
|
|
200
|
+
* @param projectId Project ID to mint a token on.
|
|
201
|
+
* @param coreContract Core contract address for the given project.
|
|
202
|
+
* @return tokenId Token ID of minted token
|
|
203
|
+
*/
|
|
204
|
+
function purchase(
|
|
205
|
+
uint256 projectId,
|
|
206
|
+
address coreContract
|
|
207
|
+
) external payable returns (uint256 tokenId) {
|
|
208
|
+
tokenId = purchaseTo({
|
|
209
|
+
to: msg.sender,
|
|
210
|
+
projectId: projectId,
|
|
211
|
+
coreContract: coreContract
|
|
212
|
+
});
|
|
213
|
+
return tokenId;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// public getter functions
|
|
217
|
+
/**
|
|
218
|
+
* @notice Gets the maximum invocations project configuration.
|
|
219
|
+
* @param projectId The ID of the project whose data needs to be fetched.
|
|
220
|
+
* @param coreContract The address of the core contract.
|
|
221
|
+
* @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
|
|
222
|
+
* configuration data.
|
|
223
|
+
*/
|
|
224
|
+
function maxInvocationsProjectConfig(
|
|
225
|
+
uint256 projectId,
|
|
226
|
+
address coreContract
|
|
227
|
+
)
|
|
228
|
+
external
|
|
229
|
+
view
|
|
230
|
+
returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
|
|
231
|
+
{
|
|
232
|
+
return
|
|
233
|
+
MaxInvocationsLib.getMaxInvocationsProjectConfig({
|
|
234
|
+
projectId: projectId,
|
|
235
|
+
coreContract: coreContract
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @notice Gets the set price project configuration.
|
|
241
|
+
* @param projectId The ID of the project whose data needs to be fetched.
|
|
242
|
+
* @param coreContract The address of the core contract.
|
|
243
|
+
* @return SetPriceProjectConfig struct with the fixed price project
|
|
244
|
+
* configuration data.
|
|
245
|
+
*/
|
|
246
|
+
function setPriceProjectConfig(
|
|
247
|
+
uint256 projectId,
|
|
248
|
+
address coreContract
|
|
249
|
+
) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
|
|
250
|
+
return
|
|
251
|
+
SetPriceLib.getSetPriceProjectConfig({
|
|
252
|
+
projectId: projectId,
|
|
253
|
+
coreContract: coreContract
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @notice Checks if the specified `coreContract` is a valid engine contract.
|
|
259
|
+
* @dev This function retrieves the cached value of `isEngine` from
|
|
260
|
+
* the `isEngineCache` mapping. If the cached value is already set, it
|
|
261
|
+
* returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
|
|
262
|
+
* function from the `SplitFundsLib` library to check if `coreContract`
|
|
263
|
+
* is a valid engine contract.
|
|
264
|
+
* @dev This function will revert if the provided `coreContract` is not
|
|
265
|
+
* a valid Engine or V3 Flagship contract.
|
|
266
|
+
* @param coreContract The address of the contract to check.
|
|
267
|
+
* @return bool indicating if `coreContract` is a valid engine contract.
|
|
268
|
+
*/
|
|
269
|
+
function isEngineView(address coreContract) external view returns (bool) {
|
|
270
|
+
SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
|
|
271
|
+
.getIsEngineCacheConfig(coreContract);
|
|
272
|
+
if (isEngineCache.isCached) {
|
|
273
|
+
return isEngineCache.isEngine;
|
|
274
|
+
} else {
|
|
275
|
+
// @dev this calls the non-state-modifying variant of isEngine
|
|
276
|
+
return SplitFundsLib.getV3CoreIsEngineView(coreContract);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* @notice projectId => has project reached its maximum number of
|
|
282
|
+
* invocations? Note that this returns a local cache of the core contract's
|
|
283
|
+
* state, and may be out of sync with the core contract. This is
|
|
284
|
+
* intentional, as it only enables gas optimization of mints after a
|
|
285
|
+
* project's maximum invocations has been reached. A false negative will
|
|
286
|
+
* only result in a gas cost increase, since the core contract will still
|
|
287
|
+
* enforce a maxInvocation check during minting. A false positive is not
|
|
288
|
+
* possible because the V3 core contract only allows maximum invocations
|
|
289
|
+
* to be reduced, not increased. Based on this rationale, we intentionally
|
|
290
|
+
* do not do input validation in this method as to whether or not the input
|
|
291
|
+
* @param projectId is an existing project ID.
|
|
292
|
+
* @param coreContract is an existing core contract address.
|
|
293
|
+
*/
|
|
294
|
+
function projectMaxHasBeenInvoked(
|
|
295
|
+
uint256 projectId,
|
|
296
|
+
address coreContract
|
|
297
|
+
) external view returns (bool) {
|
|
298
|
+
return
|
|
299
|
+
MaxInvocationsLib.getMaxHasBeenInvoked({
|
|
300
|
+
projectId: projectId,
|
|
301
|
+
coreContract: coreContract
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @notice projectId => project's maximum number of invocations.
|
|
307
|
+
* Optionally synced with core contract value, for gas optimization.
|
|
308
|
+
* Note that this returns a local cache of the core contract's
|
|
309
|
+
* state, and may be out of sync with the core contract. This is
|
|
310
|
+
* intentional, as it only enables gas optimization of mints after a
|
|
311
|
+
* project's maximum invocations has been reached.
|
|
312
|
+
* @dev A number greater than the core contract's project max invocations
|
|
313
|
+
* will only result in a gas cost increase, since the core contract will
|
|
314
|
+
* still enforce a maxInvocation check during minting. A number less than
|
|
315
|
+
* the core contract's project max invocations is only possible when the
|
|
316
|
+
* project's max invocations have not been synced on this minter, since the
|
|
317
|
+
* V3 core contract only allows maximum invocations to be reduced, not
|
|
318
|
+
* increased. When this happens, the minter will enable minting, allowing
|
|
319
|
+
* the core contract to enforce the max invocations check. Based on this
|
|
320
|
+
* rationale, we intentionally do not do input validation in this method as
|
|
321
|
+
* to whether or not the input `projectId` is an existing project ID.
|
|
322
|
+
* @param projectId is an existing project ID.
|
|
323
|
+
* @param coreContract is an existing core contract address.
|
|
324
|
+
*/
|
|
325
|
+
function projectMaxInvocations(
|
|
326
|
+
uint256 projectId,
|
|
327
|
+
address coreContract
|
|
328
|
+
) external view returns (uint256) {
|
|
329
|
+
return
|
|
330
|
+
MaxInvocationsLib.getMaxInvocations({
|
|
331
|
+
projectId: projectId,
|
|
332
|
+
coreContract: coreContract
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* @notice Gets if minimum price of token is configured, minimum price for minting a
|
|
338
|
+
* token on project `projectId`, and currency symbol and address to be
|
|
339
|
+
* used as payment. Note that purchasers may send amounts >= the minimum price,
|
|
340
|
+
* up to 20x the minimum price.
|
|
341
|
+
* @param projectId Project ID to get price information for
|
|
342
|
+
* @param coreContract Contract address of the core contract
|
|
343
|
+
* @return isConfigured true only if minimum token price has been configured on
|
|
344
|
+
* this minter
|
|
345
|
+
* @return tokenPriceInWei current minimum price of token on this minter - invalid
|
|
346
|
+
* if price has not yet been configured. Purchasers may send amounts between this
|
|
347
|
+
* value and 20x this value.
|
|
348
|
+
* @return currencySymbol currency symbol for purchases of project on this
|
|
349
|
+
* minter. This minter always returns "ETH"
|
|
350
|
+
* @return currencyAddress currency address for purchases of project on
|
|
351
|
+
* this minter. This minter always returns null address, reserved for ether
|
|
352
|
+
*/
|
|
353
|
+
function getPriceInfo(
|
|
354
|
+
uint256 projectId,
|
|
355
|
+
address coreContract
|
|
356
|
+
)
|
|
357
|
+
external
|
|
358
|
+
view
|
|
359
|
+
returns (
|
|
360
|
+
bool isConfigured,
|
|
361
|
+
uint256 tokenPriceInWei,
|
|
362
|
+
string memory currencySymbol,
|
|
363
|
+
address currencyAddress
|
|
364
|
+
)
|
|
365
|
+
{
|
|
366
|
+
SetPriceLib.SetPriceProjectConfig
|
|
367
|
+
storage setPriceProjectConfig_ = SetPriceLib
|
|
368
|
+
.getSetPriceProjectConfig({
|
|
369
|
+
projectId: projectId,
|
|
370
|
+
coreContract: coreContract
|
|
371
|
+
});
|
|
372
|
+
isConfigured = setPriceProjectConfig_.priceIsConfigured;
|
|
373
|
+
tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
|
|
374
|
+
currencySymbol = "ETH";
|
|
375
|
+
currencyAddress = address(0);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* @notice Gets the price paid for a specific token.
|
|
380
|
+
* @dev Returns 0 if the token was not minted via this minter or if
|
|
381
|
+
* the token does not exist. This function does not validate that the
|
|
382
|
+
* token was minted via this minter.
|
|
383
|
+
* @param coreContract Core contract address for the token
|
|
384
|
+
* @param tokenId Token ID to get the price paid for
|
|
385
|
+
* @return pricePaidInWei Price paid for the token in Wei, or 0 if not
|
|
386
|
+
* minted via this minter
|
|
387
|
+
*/
|
|
388
|
+
function getTokenPricePaid(
|
|
389
|
+
address coreContract,
|
|
390
|
+
uint256 tokenId
|
|
391
|
+
) external view returns (uint256 pricePaidInWei) {
|
|
392
|
+
return _tokenPricePaid[coreContract][tokenId];
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @notice Syncs local maximum invocations of project `projectId` based on
|
|
397
|
+
* the value currently defined in the core contract.
|
|
398
|
+
* @param projectId Project ID to set the maximum invocations for.
|
|
399
|
+
* @param coreContract Core contract address for the given project.
|
|
400
|
+
* @dev this enables gas reduction after maxInvocations have been reached -
|
|
401
|
+
* core contracts shall still enforce a maxInvocation check during mint.
|
|
402
|
+
*/
|
|
403
|
+
function syncProjectMaxInvocationsToCore(
|
|
404
|
+
uint256 projectId,
|
|
405
|
+
address coreContract
|
|
406
|
+
) public {
|
|
407
|
+
AuthLib.onlyArtist({
|
|
408
|
+
projectId: projectId,
|
|
409
|
+
coreContract: coreContract,
|
|
410
|
+
sender: msg.sender
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
MaxInvocationsLib.syncProjectMaxInvocationsToCore({
|
|
414
|
+
projectId: projectId,
|
|
415
|
+
coreContract: coreContract
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* @notice Purchases a token from project `projectId` and sets
|
|
421
|
+
* the token's owner to `to`.
|
|
422
|
+
* @dev Payment must be >= minimum price and <= 20x minimum price.
|
|
423
|
+
* @param to Address to be the new token's owner.
|
|
424
|
+
* @param projectId Project ID to mint a token on.
|
|
425
|
+
* @param coreContract Core contract address for the given project.
|
|
426
|
+
* @return tokenId Token ID of minted token
|
|
427
|
+
*/
|
|
428
|
+
function purchaseTo(
|
|
429
|
+
address to,
|
|
430
|
+
uint256 projectId,
|
|
431
|
+
address coreContract
|
|
432
|
+
) public payable nonReentrant returns (uint256 tokenId) {
|
|
433
|
+
// CHECKS
|
|
434
|
+
// pre-mint MaxInvocationsLib checks
|
|
435
|
+
// Note that `maxHasBeenInvoked` is only checked here to reduce gas
|
|
436
|
+
// consumption after a project has been fully minted.
|
|
437
|
+
// `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
|
|
438
|
+
// gas consumption, but if not in sync with the core contract's value,
|
|
439
|
+
// the core contract also enforces its own max invocation check during
|
|
440
|
+
// minting.
|
|
441
|
+
MaxInvocationsLib.preMintChecks({
|
|
442
|
+
projectId: projectId,
|
|
443
|
+
coreContract: coreContract
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
// pre-mint checks for set price lib, and get minimum price per token in wei
|
|
447
|
+
// @dev minimum price per token is loaded into memory here for gas efficiency
|
|
448
|
+
uint256 minPricePerTokenInWei = SetPriceLib.preMintChecksAndGetPrice({
|
|
449
|
+
projectId: projectId,
|
|
450
|
+
coreContract: coreContract
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
require(
|
|
454
|
+
msg.value >= minPricePerTokenInWei,
|
|
455
|
+
"Must send value gte minimum price"
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
require(
|
|
459
|
+
msg.value <= minPricePerTokenInWei * MAX_PRICE_MULTIPLIER,
|
|
460
|
+
"Only pay up to 20x min price"
|
|
461
|
+
);
|
|
462
|
+
|
|
463
|
+
// EFFECTS
|
|
464
|
+
tokenId = _minterFilter.mint_joo({
|
|
465
|
+
to: to,
|
|
466
|
+
projectId: projectId,
|
|
467
|
+
coreContract: coreContract,
|
|
468
|
+
sender: msg.sender
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
MaxInvocationsLib.validateMintEffectsInvocations({
|
|
472
|
+
tokenId: tokenId,
|
|
473
|
+
coreContract: coreContract
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
// Record the price paid for this token
|
|
477
|
+
_tokenPricePaid[coreContract][tokenId] = msg.value;
|
|
478
|
+
emit TokenPricePaid({
|
|
479
|
+
coreContract: coreContract,
|
|
480
|
+
tokenId: tokenId,
|
|
481
|
+
pricePaid: msg.value
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
// INTERACTIONS
|
|
485
|
+
SplitFundsLib.splitRevenuesETHNoRefund({
|
|
486
|
+
projectId: projectId,
|
|
487
|
+
valueInWei: msg.value,
|
|
488
|
+
coreContract: coreContract
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
return tokenId;
|
|
492
|
+
}
|
|
493
|
+
}
|