@artblocks/contracts 1.0.3 → 1.1.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 +32 -25
- package/artifacts/contracts/AdminACLV0.sol/AdminACLV0.json +2 -2
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +212 -17
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +6 -6
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV0.sol/MinterDAExpV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV1.sol/MinterDAExpV1.json +2 -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/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/MinterDALin/MinterDALinV0.sol/MinterDALinV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV1.sol/MinterDALinV1.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/MinterHolder/MinterHolderV0.sol/MinterHolderV0.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/MinterMerkle/MinterMerkleV0.sol/MinterMerkleV0.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/MinterSetPrice/MinterSetPriceV0.sol/MinterSetPriceV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV1.sol/MinterSetPriceV1.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/MinterSetPriceERC20/MinterSetPriceERC20V0.sol/MinterSetPriceERC20V0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol/MinterSetPriceERC20V1.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/engine/V2/GenArt721CoreV2_ENGINE_FLEX.sol/GenArt721CoreV2_ENGINE_FLEX.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721CoreV2_PBAB.sol/GenArt721CoreV2_PBAB.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721CoreV2_PRTNR.sol/GenArt721CoreV2_PRTNR.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol/GenArt721MinterBurner_PBAB.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721MinterDAExp_PBAB.sol/GenArt721MinterDAExp_PBAB.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721Minter_PBAB.sol/GenArt721Minter_PBAB.json +2 -2
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +6 -11
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +6 -11
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +6 -11
- 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 +6 -11
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
- package/artifacts/contracts/engine-registry/EngineRegistryV0.sol/EngineRegistryV0.json +2 -2
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +6 -6
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IBonusContract.sol/IBonusContract.json +1 -1
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreContractV1.sol/IGenArt721CoreContractV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreV2_PBAB.sol/IGenArt721CoreV2_PBAB.json +1 -1
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IRandomizer.sol/IRandomizer.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IAdminACLV0.sol/IAdminACLV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IArtblocksRoyaltyOverride.sol/IArtblocksRoyaltyOverride.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IBonusContract.sol/IBonusContract.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/ICoreRegistryV1.sol/ICoreRegistryV1.json +7 -7
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDelegationRegistry.sol/IDelegationRegistry.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryCompatibleV0.sol/IDependencyRegistryCompatibleV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +22 -3
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IEngineRegistryV0.sol/IEngineRegistryV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV0.sol/IFilteredMinterDAExpSettlementV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlement_Mixin.sol/IFilteredMinterDAExpSettlement_Mixin.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV0.sol/IFilteredMinterDAExpV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV1.sol/IFilteredMinterDAExpV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV0.sol/IFilteredMinterDALinV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV1.sol/IFilteredMinterDALinV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV0.sol/IFilteredMinterHolderV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV1.sol/IFilteredMinterHolderV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV2.sol/IFilteredMinterHolderV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV0.sol/IFilteredMinterMerkleV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV1.sol/IFilteredMinterMerkleV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV2.sol/IFilteredMinterMerkleV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterSEAV0.sol/IFilteredMinterSEAV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV0.sol/IFilteredMinterV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV1.sol/IFilteredMinterV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV2.sol/IFilteredMinterV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractExposesHashSeed.sol/IGenArt721CoreContractExposesHashSeed.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV1.sol/IGenArt721CoreContractV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +1 -1
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3WithSharedRandomizer.sol/IGenArt721CoreContractV3WithSharedRandomizer.json +24 -0
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreV2_PBAB.sol/IGenArt721CoreV2_PBAB.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IManifold.sol/IManifold.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterBaseV0.sol/IMinterBaseV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV0.sol/IMinterFilterV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV1.sol/IMinterFilterV1.json +104 -19
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPICoreV0.sol/IMintingAPICoreV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPIMinterV0.sol/IMintingAPIMinterV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer.sol/IRandomizer.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerPolyptychV0.sol/IRandomizerPolyptychV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerV2.sol/IRandomizerV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer_V3CoreBase.sol/IRandomizer_V3CoreBase.json +1 -1
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +114 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +50 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +128 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +97 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +29 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +64 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +117 -0
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +52 -36
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IWETH.sol/IWETH.json +1 -1
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Address.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Counters.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/CustomERC721Metadata.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/ERC721.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/ERC721Enumerable.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/GenArt721CoreV1.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/SafeMath.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Strings.json +2 -2
- package/artifacts/contracts/legacy/GenArt721LegacyMinter.sol/GenArt721LegacyMinter.json +2 -2
- package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/CustomERC721Metadata.sol/CustomERC721Metadata.json +3 -3
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/IERC20.sol/IERC20.json +1 -1
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/SafeMath.sol/SafeMath.json +3 -3
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/Strings.sol/Strings.json +3 -3
- package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +10 -0
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV0.sol/BytecodeStorage.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol/BytecodeStorageReader.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol/BytecodeStorageWriter.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/Bytes32Strings.sol/Bytes32Strings.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/SSTORE2.sol/SSTORE2.json +3 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +67 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +67 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +36 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +37 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +261 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +55 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +48 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +42 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +86 -0
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV0.sol/MinterFilterV0.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 +96 -40
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +662 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -20
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +619 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +418 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +662 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV4.sol/MinterDALinV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +418 -0
- package/artifacts/contracts/minter-suite/Minters/MinterHolderV4.sol/MinterHolderV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV0.sol/MinterSEAV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +659 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +452 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +600 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +633 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +782 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +676 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +356 -0
- package/artifacts/contracts/mock/BytecodeV0TextCR_DMock.sol/BytecodeV0TextCR_DMock.json +2 -2
- package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +2 -2
- package/artifacts/contracts/mock/BytecodeV1TextCR_DMock.sol/BytecodeV1TextCR_DMock.json +4 -4
- package/artifacts/contracts/mock/DeadReceiverBidderMock.sol/DeadReceiverBidderMock.json +25 -2
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +28 -2
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +6 -11
- package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +2 -2
- package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
- package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
- package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyHolderMock.sol/ReentrancyHolderMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
- package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
- package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
- package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
- package/artifacts/contracts/mock/SSTORE2Mock.sol/SSTORE2Mock.json +2 -2
- package/artifacts/contracts/randomizer/deprecated/BasicRandomizer.sol/BasicRandomizer.json +2 -2
- 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/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +2 -2
- package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +58 -42
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +2 -2
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol/GenArt721RoyaltyOverride_PBAB.json +2 -2
- package/contracts/AdminACLV0.sol +1 -1
- package/contracts/AdminACLV1.sol +1 -1
- package/contracts/DependencyRegistryV0.sol +300 -123
- package/contracts/GenArt721CoreV3.sol +27 -12
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol +3 -3
- package/contracts/archive/readme.md +16 -0
- package/contracts/engine/README.md +21 -0
- package/contracts/engine/V2/GenArt721CoreV2_ENGINE_FLEX.sol +2 -2
- package/contracts/engine/V2/GenArt721CoreV2_PBAB.sol +2 -2
- package/contracts/engine/V2/GenArt721CoreV2_PRTNR.sol +3 -3
- package/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol +2 -2
- package/contracts/engine/V2/GenArt721MinterDAExp_PBAB.sol +1 -1
- package/contracts/engine/V2/GenArt721Minter_PBAB.sol +2 -2
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +31 -22
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +31 -22
- package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +12 -18
- package/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol +1 -1
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +23 -24
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol +1 -1
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +1 -1
- package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
- package/contracts/engine-registry/EngineRegistryV0.sol +1 -1
- package/contracts/explorations/GenArt721CoreV3_Explorations.sol +27 -12
- package/contracts/interfaces/{0.8.x → v0.8.x}/ICoreRegistryV1.sol +6 -8
- package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryV0.sol +5 -2
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3WithSharedRandomizer.sol +23 -0
- package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV1.sol +45 -19
- package/contracts/interfaces/v0.8.x/IRandomizer_V3CoreBase.sol +23 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +28 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +12 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +12 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +13 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +41 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +34 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +15 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +28 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +43 -0
- package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +123 -0
- package/contracts/legacy/GenArt721CoreV1.sol +2 -2
- package/contracts/legacy/GenArt721LegacyMinter.sol +5 -5
- package/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol +1 -1
- package/contracts/libs/v0.8.x/ABHelpers.sol +55 -0
- package/contracts/libs/v0.8.x/AuthLib.sol +196 -0
- package/contracts/libs/{0.8.x → v0.8.x}/Bytes32Strings.sol +5 -5
- package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +250 -0
- package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
- package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +216 -0
- package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
- package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +488 -0
- package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +384 -0
- package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +240 -0
- package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +995 -0
- package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +166 -0
- package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +770 -0
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +741 -0
- package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +291 -0
- package/contracts/minter-suite/MinterFilter/MinterFilterV0.sol +3 -3
- package/contracts/minter-suite/MinterFilter/MinterFilterV1.sol +5 -5
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +414 -297
- package/contracts/minter-suite/Minters/MinterBase_v0_1_1.sol +4 -4
- package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +866 -0
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +4 -57
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +886 -0
- package/contracts/minter-suite/Minters/MinterDAExpV4.sol +3 -3
- package/contracts/minter-suite/Minters/MinterDAExpV5.sol +545 -0
- package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +857 -0
- package/contracts/minter-suite/Minters/MinterDALinV4.sol +3 -3
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +534 -0
- package/contracts/minter-suite/Minters/MinterHolderV4.sol +4 -4
- package/contracts/minter-suite/Minters/MinterMerkleV5.sol +4 -4
- package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +6 -6
- package/contracts/minter-suite/Minters/MinterSEAV0.sol +3 -3
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +853 -0
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +5 -5
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +545 -0
- package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +730 -0
- package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +714 -0
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +1012 -0
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +868 -0
- package/contracts/minter-suite/Minters/MinterSetPriceV4.sol +3 -3
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +414 -0
- package/contracts/mock/BytecodeV0TextCR_DMock.sol +1 -1
- package/contracts/mock/BytecodeV1LibCallsMock.sol +1 -1
- package/contracts/mock/BytecodeV1TextCR_DMock.sol +1 -1
- package/contracts/mock/DeadReceiverBidderMock.sol +15 -0
- package/contracts/mock/DummySharedMinter.sol +2 -2
- package/contracts/mock/ERC20Mock.sol +16 -0
- package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +11 -18
- package/contracts/mock/MockAdminACLV0.sol +1 -1
- package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +1 -1
- package/contracts/mock/OriginRegisterMock.sol +1 -1
- package/contracts/mock/ReentrancyHolderMock.sol +1 -1
- package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
- package/contracts/mock/ReentrancyMerkleMock.sol +1 -1
- package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
- package/contracts/mock/ReentrancyMock.sol +1 -1
- package/contracts/mock/ReentrancyMockShared.sol +48 -0
- package/contracts/mock/ReentrancySEAMock.sol +1 -1
- package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
- package/contracts/mock/SSTORE2Mock.sol +1 -1
- package/contracts/randomizer/deprecated/BasicRandomizer.sol +1 -1
- package/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol +2 -2
- package/contracts/randomizer/deprecated/RandomizerV2.sol +2 -2
- package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +134 -111
- package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +2 -2
- package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +2 -2
- package/package.json +57 -36
- package/LICENSE +0 -165
- package/contracts/interfaces/0.8.x/IRandomizer_V3CoreBase.sol +0 -10
- package/contracts/interfaces/0.8.x/ISharedRandomizerV0.sol +0 -105
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IBonusContract.sol +0 -0
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreContractV1.sol +0 -0
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreV2_PBAB.sol +0 -0
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IRandomizer.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IAdminACLV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IArtblocksRoyaltyOverride.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IBonusContract.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IBytecodeStorageReader.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IDelegationRegistry.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryCompatibleV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IEngineRegistryV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlement_Mixin.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterSEAV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractExposesHashSeed.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Base.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine_Flex.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreV2_PBAB.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IManifold.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterBaseV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPICoreV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPIMinterV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IPseudorandomAtomic.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerPolyptychV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IWETH.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/CustomERC721Metadata.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/IERC20.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/SafeMath.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/Strings.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV0.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/ERC721_PackedHashSeed.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/SSTORE2.sol +0 -0
|
@@ -0,0 +1,1012 @@
|
|
|
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 {IGenArt721CoreContractV3_Base} from "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
|
|
9
|
+
import {IDelegationRegistry} from "../../interfaces/v0.8.x/IDelegationRegistry.sol";
|
|
10
|
+
import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
|
|
11
|
+
import {ISharedMinterHolderERC20V0} from "../../interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol";
|
|
12
|
+
import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
13
|
+
|
|
14
|
+
import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
|
|
15
|
+
import {SplitFundsLib} from "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
|
|
16
|
+
import {MaxInvocationsLib} from "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
|
|
17
|
+
import {SetPriceLib} from "../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
|
|
18
|
+
import {TokenHolderLib} from "../../libs/v0.8.x/minter-libs/TokenHolderLib.sol";
|
|
19
|
+
import {PolyptychLib} from "../../libs/v0.8.x/minter-libs/PolyptychLib.sol";
|
|
20
|
+
|
|
21
|
+
import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
|
|
22
|
+
import {EnumerableSet} from "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.sol";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @title Shared, filtered Minter contract that allows tokens to be minted with
|
|
26
|
+
* an artist-configured ERC20 token when purchaser owns an allowlisted ERC-721
|
|
27
|
+
* NFT.
|
|
28
|
+
* This contract must be used with an accompanying shared randomizer contract
|
|
29
|
+
* that is configured to copy the token hash seed from the allowlisted token to
|
|
30
|
+
* a corresponding newly-minted token. This minter contract must be the allowed
|
|
31
|
+
* hash seed setter contract for the shared randomizer contract.
|
|
32
|
+
* The source token may only be used to mint one additional polyptych "panel" if the token
|
|
33
|
+
* has not yet been used to mint a panel with the currently configured panel ID. To add
|
|
34
|
+
* an additional panel to a project, the panel ID may be incremented for the project
|
|
35
|
+
* using the `incrementPolyptychProjectPanelId` function. Panel IDs for a project may only
|
|
36
|
+
* be incremented such that panels must be minted in the order of their panel ID. Tokens
|
|
37
|
+
* of the same project and panel ID may be minted in any order.
|
|
38
|
+
* This is designed to be used with IGenArt721CoreContractExposesHashSeed contracts with an
|
|
39
|
+
* active ISharedRandomizerV0 randomizer available for this minter to use.
|
|
40
|
+
* This minter requires both a properly configured core contract and shared
|
|
41
|
+
* randomizer in order to mint polyptych tokens.
|
|
42
|
+
* @author Art Blocks Inc.
|
|
43
|
+
* @notice Privileged Roles and Ownership:
|
|
44
|
+
* This contract is designed to be managed, with limited powers.
|
|
45
|
+
* Privileged roles and abilities are controlled by the project's artist, which
|
|
46
|
+
* can be modified by the core contract's Admin ACL contract. Both of these
|
|
47
|
+
* roles hold extensive power and can modify minter details.
|
|
48
|
+
* Care must be taken to ensure that the admin ACL contract and artist
|
|
49
|
+
* addresses are secure behind a multi-sig or other access control mechanism.
|
|
50
|
+
* ----------------------------------------------------------------------------
|
|
51
|
+
* The following functions are restricted to a project's artist:
|
|
52
|
+
* - updatePricePerTokenInWei
|
|
53
|
+
* - syncProjectMaxInvocationsToCore
|
|
54
|
+
* - manuallyLimitProjectMaxInvocations
|
|
55
|
+
* - updateProjectCurrencyInfo
|
|
56
|
+
* - allowHoldersOfProjects
|
|
57
|
+
* - removeHoldersOfProjects
|
|
58
|
+
* - allowAndRemoveHoldersOfProjects
|
|
59
|
+
* - incrementPolyptychProjectPanelId
|
|
60
|
+
* ----------------------------------------------------------------------------
|
|
61
|
+
* Additional admin and artist privileged roles may be described on other
|
|
62
|
+
* contracts that this minter integrates with.
|
|
63
|
+
* ----------------------------------------------------------------------------
|
|
64
|
+
* This contract allows vaults to configure token-level or wallet-level
|
|
65
|
+
* delegation of minting privileges. This allows a vault on an allowlist to
|
|
66
|
+
* delegate minting privileges to a wallet that is not on the allowlist,
|
|
67
|
+
* enabling the vault to remain air-gapped while still allowing minting. The
|
|
68
|
+
* delegation registry contract is responsible for managing these delegations,
|
|
69
|
+
* and is available at the address returned by the public immutable
|
|
70
|
+
* `delegationRegistryAddress`. At the time of writing, the delegation
|
|
71
|
+
* registry enables easy delegation configuring at https://delegate.cash/.
|
|
72
|
+
* Art Blocks does not guarentee the security of the delegation registry, and
|
|
73
|
+
* users should take care to ensure that the delegation registry is secure.
|
|
74
|
+
* Token-level delegations are configured by the vault owner, and contract-
|
|
75
|
+
* level delegations must be configured for the core token contract as returned
|
|
76
|
+
* by the public immutable variable `genArt721CoreAddress`.
|
|
77
|
+
* ----------------------------------------------------------------------------
|
|
78
|
+
* @notice Caution: While Engine projects must be registered on the Art Blocks
|
|
79
|
+
* Core Registry to assign this minter, this minter does not enforce that a
|
|
80
|
+
* project is registered when configured or queried. This is primarily for gas
|
|
81
|
+
* optimization purposes. It is, therefore, possible that fake projects may be
|
|
82
|
+
* configured on this minter, but they will not be able to mint tokens due to
|
|
83
|
+
* checks performed by this minter's Minter Filter.
|
|
84
|
+
*/
|
|
85
|
+
contract MinterSetPricePolyptychERC20V5 is
|
|
86
|
+
ReentrancyGuard,
|
|
87
|
+
ISharedMinterV0,
|
|
88
|
+
ISharedMinterHolderERC20V0
|
|
89
|
+
{
|
|
90
|
+
// add Enumerable Set methods
|
|
91
|
+
using EnumerableSet for EnumerableSet.AddressSet;
|
|
92
|
+
|
|
93
|
+
/// Minter filter address this minter interacts with
|
|
94
|
+
address public immutable minterFilterAddress;
|
|
95
|
+
|
|
96
|
+
/// Minter filter this minter may interact with.
|
|
97
|
+
IMinterFilterV1 private immutable _minterFilter;
|
|
98
|
+
|
|
99
|
+
/// Delegation registry address
|
|
100
|
+
address public immutable delegationRegistryAddress;
|
|
101
|
+
|
|
102
|
+
/// Delegation registry address
|
|
103
|
+
IDelegationRegistry private immutable _delegationRegistryContract;
|
|
104
|
+
|
|
105
|
+
/// minterType for this minter
|
|
106
|
+
string public constant minterType = "MinterSetPricePolyptychERC20V5";
|
|
107
|
+
|
|
108
|
+
/// minter version for this minter
|
|
109
|
+
string public constant minterVersion = "v5.0.0";
|
|
110
|
+
|
|
111
|
+
uint256 internal constant ONE_MILLION = 1_000_000;
|
|
112
|
+
|
|
113
|
+
// MODIFIERS
|
|
114
|
+
// @dev contract uses modifier-like internal functions instead of modifiers
|
|
115
|
+
// to reduce contract bytecode size
|
|
116
|
+
// @dev contract uses AuthLib for some modifier-like functions
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @notice Initializes contract to be a Filtered Minter for
|
|
120
|
+
* `minterFilter` minter filter.
|
|
121
|
+
* @param minterFilter Minter filter for which this will be a
|
|
122
|
+
* filtered minter.
|
|
123
|
+
* @param delegationRegistryAddress_ Delegation registry contract address.
|
|
124
|
+
*/
|
|
125
|
+
constructor(
|
|
126
|
+
address minterFilter,
|
|
127
|
+
address delegationRegistryAddress_
|
|
128
|
+
) ReentrancyGuard() {
|
|
129
|
+
minterFilterAddress = minterFilter;
|
|
130
|
+
_minterFilter = IMinterFilterV1(minterFilter);
|
|
131
|
+
|
|
132
|
+
delegationRegistryAddress = delegationRegistryAddress_;
|
|
133
|
+
_delegationRegistryContract = IDelegationRegistry(
|
|
134
|
+
delegationRegistryAddress_
|
|
135
|
+
);
|
|
136
|
+
emit TokenHolderLib.DelegationRegistryUpdated(
|
|
137
|
+
delegationRegistryAddress_
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @notice Manually sets the local maximum invocations of project `projectId`
|
|
143
|
+
* with the provided `maxInvocations`, checking that `maxInvocations` is less
|
|
144
|
+
* than or equal to the value of project `project_id`'s maximum invocations that is
|
|
145
|
+
* set on the core contract.
|
|
146
|
+
* @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
|
|
147
|
+
* value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
|
|
148
|
+
* this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
|
|
149
|
+
* @param projectId Project ID to set the maximum invocations for.
|
|
150
|
+
* @param coreContract Core contract address for the given project.
|
|
151
|
+
* @param maxInvocations Maximum invocations to set for the project.
|
|
152
|
+
*/
|
|
153
|
+
function manuallyLimitProjectMaxInvocations(
|
|
154
|
+
uint256 projectId,
|
|
155
|
+
address coreContract,
|
|
156
|
+
uint24 maxInvocations
|
|
157
|
+
) external {
|
|
158
|
+
AuthLib.onlyArtist({
|
|
159
|
+
projectId: projectId,
|
|
160
|
+
coreContract: coreContract,
|
|
161
|
+
sender: msg.sender
|
|
162
|
+
});
|
|
163
|
+
MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
|
|
164
|
+
projectId: projectId,
|
|
165
|
+
coreContract: coreContract,
|
|
166
|
+
maxInvocations: maxInvocations
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @notice Updates this minter's price per token of project `projectId`
|
|
172
|
+
* to be `pricePerTokenInWei`. Note that "in wei" is a misnomer on this
|
|
173
|
+
* ERC20 minter, but is used for consistency with the ETH minters. The
|
|
174
|
+
* price value represents the ERC20 token price without decimals.
|
|
175
|
+
* @dev Note that it is intentionally supported here that the configured
|
|
176
|
+
* price may be explicitly set to `0`.
|
|
177
|
+
* @param projectId Project ID to set the price per token for.
|
|
178
|
+
* @param coreContract Core contract address for the given project.
|
|
179
|
+
* @param pricePerTokenInWei Price per token to set for the project.
|
|
180
|
+
* Represents the ERC20 token price without decimals.
|
|
181
|
+
*/
|
|
182
|
+
function updatePricePerTokenInWei(
|
|
183
|
+
uint256 projectId,
|
|
184
|
+
address coreContract,
|
|
185
|
+
uint248 pricePerTokenInWei
|
|
186
|
+
) external {
|
|
187
|
+
AuthLib.onlyArtist({
|
|
188
|
+
projectId: projectId,
|
|
189
|
+
coreContract: coreContract,
|
|
190
|
+
sender: msg.sender
|
|
191
|
+
});
|
|
192
|
+
SetPriceLib.updatePricePerToken({
|
|
193
|
+
projectId: projectId,
|
|
194
|
+
coreContract: coreContract,
|
|
195
|
+
pricePerToken: pricePerTokenInWei
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// for convenience, sync local max invocations to the core contract if
|
|
199
|
+
// and only if max invocations have not already been synced.
|
|
200
|
+
// @dev do not sync if max invocations have already been synced, as
|
|
201
|
+
// local max invocations could have been manually set to be
|
|
202
|
+
// intentionally less than the core contract's max invocations.
|
|
203
|
+
// @dev if local maxInvocations and maxHasBeenInvoked are both
|
|
204
|
+
// initial values, we know they have not been populated on this minter
|
|
205
|
+
if (
|
|
206
|
+
MaxInvocationsLib.maxInvocationsIsUnconfigured({
|
|
207
|
+
projectId: projectId,
|
|
208
|
+
coreContract: coreContract
|
|
209
|
+
})
|
|
210
|
+
) {
|
|
211
|
+
syncProjectMaxInvocationsToCore({
|
|
212
|
+
projectId: projectId,
|
|
213
|
+
coreContract: coreContract
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @notice Updates payment currency of project `projectId` on core
|
|
220
|
+
* contract `coreContract` to be `currencySymbol` at address
|
|
221
|
+
* `currencyAddress`.
|
|
222
|
+
* Only supports ERC20 tokens - for ETH minting, use a different minter.
|
|
223
|
+
* Resets price to be unconfigured if currency was previously configured,
|
|
224
|
+
* as a safeguard against accidentally setting a price in one currency
|
|
225
|
+
* and then changing the currency but not the price.
|
|
226
|
+
* @dev nonReentrant because no reentrant use cases, and to eliminate an
|
|
227
|
+
* entire branch of reentrancy attack vectors.
|
|
228
|
+
* @param projectId Project ID to update.
|
|
229
|
+
* @param coreContract Core contract address for the given project.
|
|
230
|
+
* @param currencySymbol Currency symbol.
|
|
231
|
+
* @param currencyAddress Currency address.
|
|
232
|
+
*/
|
|
233
|
+
function updateProjectCurrencyInfo(
|
|
234
|
+
uint256 projectId,
|
|
235
|
+
address coreContract,
|
|
236
|
+
string memory currencySymbol,
|
|
237
|
+
address currencyAddress
|
|
238
|
+
) external nonReentrant {
|
|
239
|
+
AuthLib.onlyArtist({
|
|
240
|
+
projectId: projectId,
|
|
241
|
+
coreContract: coreContract,
|
|
242
|
+
sender: msg.sender
|
|
243
|
+
});
|
|
244
|
+
bool recommendPriceReset = SplitFundsLib
|
|
245
|
+
.updateProjectCurrencyInfoERC20({
|
|
246
|
+
projectId: projectId,
|
|
247
|
+
coreContract: coreContract,
|
|
248
|
+
currencySymbol: currencySymbol,
|
|
249
|
+
currencyAddress: currencyAddress
|
|
250
|
+
});
|
|
251
|
+
if (recommendPriceReset) {
|
|
252
|
+
SetPriceLib.resetPricePerToken({
|
|
253
|
+
projectId: projectId,
|
|
254
|
+
coreContract: coreContract
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @notice Allows holders of NFTs at addresses `ownedNFTAddresses`,
|
|
261
|
+
* project IDs `ownedNFTProjectIds` to mint on project `projectId`.
|
|
262
|
+
* `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
|
|
263
|
+
* e.g. Allows holders of project `ownedNFTProjectIds[0]` on token
|
|
264
|
+
* contract `ownedNFTAddresses[0]` to mint `projectId`.
|
|
265
|
+
* WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
|
|
266
|
+
* due to assumptions about tokenId and projectId relationships.
|
|
267
|
+
* @param projectId Project ID to enable minting on.
|
|
268
|
+
* @param coreContract Core contract address for the given project.
|
|
269
|
+
* @param ownedNFTAddresses NFT core addresses of projects to be
|
|
270
|
+
* allowlisted. Indexes must align with `ownedNFTProjectIds`.
|
|
271
|
+
* @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
|
|
272
|
+
* holders shall be allowlisted to mint project `projectId`. Indexes must
|
|
273
|
+
* align with `ownedNFTAddresses`.
|
|
274
|
+
*/
|
|
275
|
+
function allowHoldersOfProjects(
|
|
276
|
+
uint256 projectId,
|
|
277
|
+
address coreContract,
|
|
278
|
+
address[] calldata ownedNFTAddresses,
|
|
279
|
+
uint256[] calldata ownedNFTProjectIds
|
|
280
|
+
) external {
|
|
281
|
+
AuthLib.onlyArtist({
|
|
282
|
+
projectId: projectId,
|
|
283
|
+
coreContract: coreContract,
|
|
284
|
+
sender: msg.sender
|
|
285
|
+
});
|
|
286
|
+
TokenHolderLib.allowHoldersOfProjects({
|
|
287
|
+
projectId: projectId,
|
|
288
|
+
coreContract: coreContract,
|
|
289
|
+
ownedNFTAddresses: ownedNFTAddresses,
|
|
290
|
+
ownedNFTProjectIds: ownedNFTProjectIds
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @notice Removes holders of NFTs at addresses `ownedNFTAddresses`,
|
|
296
|
+
* project IDs `ownedNFTProjectIds` to mint on project `projectId`. If
|
|
297
|
+
* other projects owned by a holder are still allowed to mint, holder will
|
|
298
|
+
* maintain ability to purchase.
|
|
299
|
+
* `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
|
|
300
|
+
* e.g. Removes holders of project `ownedNFTProjectIds[0]` on token
|
|
301
|
+
* contract `ownedNFTAddresses[0]` from mint allowlist of `projectId`.
|
|
302
|
+
* @param projectId Project ID to enable minting on.
|
|
303
|
+
* @param coreContract Core contract address for the given project.
|
|
304
|
+
* @param ownedNFTAddresses NFT core addresses of projects to be removed
|
|
305
|
+
* from allowlist. Indexes must align with `ownedNFTProjectIds`.
|
|
306
|
+
* @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
|
|
307
|
+
* holders will be removed from allowlist to mint project `projectId`.
|
|
308
|
+
* Indexes must align with `ownedNFTAddresses`.
|
|
309
|
+
*/
|
|
310
|
+
function removeHoldersOfProjects(
|
|
311
|
+
uint256 projectId,
|
|
312
|
+
address coreContract,
|
|
313
|
+
address[] calldata ownedNFTAddresses,
|
|
314
|
+
uint256[] calldata ownedNFTProjectIds
|
|
315
|
+
) external {
|
|
316
|
+
AuthLib.onlyArtist({
|
|
317
|
+
projectId: projectId,
|
|
318
|
+
coreContract: coreContract,
|
|
319
|
+
sender: msg.sender
|
|
320
|
+
});
|
|
321
|
+
// require same length arrays
|
|
322
|
+
TokenHolderLib.removeHoldersOfProjects({
|
|
323
|
+
projectId: projectId,
|
|
324
|
+
coreContract: coreContract,
|
|
325
|
+
ownedNFTAddresses: ownedNFTAddresses,
|
|
326
|
+
ownedNFTProjectIds: ownedNFTProjectIds
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @notice Allows holders of NFTs at addresses `ownedNFTAddressesAdd`,
|
|
332
|
+
* project IDs `ownedNFTProjectIdsAdd` to mint on project `projectId`.
|
|
333
|
+
* Also removes holders of NFTs at addresses `ownedNFTAddressesRemove`,
|
|
334
|
+
* project IDs `ownedNFTProjectIdsRemove` from minting on project
|
|
335
|
+
* `projectId`.
|
|
336
|
+
* `ownedNFTAddressesAdd` assumed to be aligned with
|
|
337
|
+
* `ownedNFTProjectIdsAdd`.
|
|
338
|
+
* e.g. Allows holders of project `ownedNFTProjectIdsAdd[0]` on token
|
|
339
|
+
* contract `ownedNFTAddressesAdd[0]` to mint `projectId`.
|
|
340
|
+
* `ownedNFTAddressesRemove` also assumed to be aligned with
|
|
341
|
+
* `ownedNFTProjectIdsRemove`.
|
|
342
|
+
* WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
|
|
343
|
+
* due to assumptions about tokenId and projectId relationships.
|
|
344
|
+
* @param projectId Project ID to enable minting on.
|
|
345
|
+
* @param coreContract Core contract address for the given project.
|
|
346
|
+
* @param ownedNFTAddressesAdd NFT core addresses of projects to be
|
|
347
|
+
* allowlisted. Indexes must align with `ownedNFTProjectIdsAdd`.
|
|
348
|
+
* @param ownedNFTProjectIdsAdd Project IDs on `ownedNFTAddressesAdd`
|
|
349
|
+
* whose holders shall be allowlisted to mint project `projectId`. Indexes
|
|
350
|
+
* must align with `ownedNFTAddressesAdd`.
|
|
351
|
+
* @param ownedNFTAddressesRemove NFT core addresses of projects to be
|
|
352
|
+
* removed from allowlist. Indexes must align with
|
|
353
|
+
* `ownedNFTProjectIdsRemove`.
|
|
354
|
+
* @param ownedNFTProjectIdsRemove Project IDs on
|
|
355
|
+
* `ownedNFTAddressesRemove` whose holders will be removed from allowlist
|
|
356
|
+
* to mint project `projectId`. Indexes must align with
|
|
357
|
+
* `ownedNFTAddressesRemove`.
|
|
358
|
+
* @dev if a project is included in both add and remove arrays, it will be
|
|
359
|
+
* removed.
|
|
360
|
+
*/
|
|
361
|
+
function allowAndRemoveHoldersOfProjects(
|
|
362
|
+
uint256 projectId,
|
|
363
|
+
address coreContract,
|
|
364
|
+
address[] calldata ownedNFTAddressesAdd,
|
|
365
|
+
uint256[] calldata ownedNFTProjectIdsAdd,
|
|
366
|
+
address[] calldata ownedNFTAddressesRemove,
|
|
367
|
+
uint256[] calldata ownedNFTProjectIdsRemove
|
|
368
|
+
) external {
|
|
369
|
+
AuthLib.onlyArtist({
|
|
370
|
+
projectId: projectId,
|
|
371
|
+
coreContract: coreContract,
|
|
372
|
+
sender: msg.sender
|
|
373
|
+
});
|
|
374
|
+
TokenHolderLib.allowAndRemoveHoldersOfProjects({
|
|
375
|
+
projectId: projectId,
|
|
376
|
+
coreContract: coreContract,
|
|
377
|
+
ownedNFTAddressesAdd: ownedNFTAddressesAdd,
|
|
378
|
+
ownedNFTProjectIdsAdd: ownedNFTProjectIdsAdd,
|
|
379
|
+
ownedNFTAddressesRemove: ownedNFTAddressesRemove,
|
|
380
|
+
ownedNFTProjectIdsRemove: ownedNFTProjectIdsRemove
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* @notice Allows the artist to increment the minter to the next polyptych panel
|
|
386
|
+
* @param projectId Project ID to increment to its next polyptych panel
|
|
387
|
+
* @param coreContract Core contract address for the given project.
|
|
388
|
+
*/
|
|
389
|
+
function incrementPolyptychProjectPanelId(
|
|
390
|
+
uint256 projectId,
|
|
391
|
+
address coreContract
|
|
392
|
+
) public {
|
|
393
|
+
AuthLib.onlyArtist({
|
|
394
|
+
projectId: projectId,
|
|
395
|
+
coreContract: coreContract,
|
|
396
|
+
sender: msg.sender
|
|
397
|
+
});
|
|
398
|
+
PolyptychLib.incrementPolyptychProjectPanelId({
|
|
399
|
+
projectId: projectId,
|
|
400
|
+
coreContract: coreContract
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* @notice Purchases a token from project `projectId` on core contract
|
|
406
|
+
* `coreContract` using an owned NFT at address `ownedNFTAddress` and
|
|
407
|
+
* token ID `ownedNFTTokenId` as the parent token.
|
|
408
|
+
* @param projectId Project ID to mint a token on.
|
|
409
|
+
* @param coreContract Core contract address for the given project.
|
|
410
|
+
* @param maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places
|
|
411
|
+
* @param currencyAddress Currency address of token.
|
|
412
|
+
* @param ownedNFTAddress ERC-721 NFT address holding the project token
|
|
413
|
+
* owned by msg.sender being used as the parent token.
|
|
414
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender to be
|
|
415
|
+
* used as the parent token.
|
|
416
|
+
* @return tokenId Token ID of minted token
|
|
417
|
+
*/
|
|
418
|
+
function purchase(
|
|
419
|
+
uint256 projectId,
|
|
420
|
+
address coreContract,
|
|
421
|
+
uint256 maxPricePerToken,
|
|
422
|
+
address currencyAddress,
|
|
423
|
+
address ownedNFTAddress,
|
|
424
|
+
uint256 ownedNFTTokenId
|
|
425
|
+
) external returns (uint256 tokenId) {
|
|
426
|
+
tokenId = purchaseTo({
|
|
427
|
+
to: msg.sender,
|
|
428
|
+
projectId: projectId,
|
|
429
|
+
coreContract: coreContract,
|
|
430
|
+
maxPricePerToken: maxPricePerToken,
|
|
431
|
+
currencyAddress: currencyAddress,
|
|
432
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
433
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
434
|
+
vault: address(0)
|
|
435
|
+
});
|
|
436
|
+
return tokenId;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* @notice Purchases a token from project `projectId` on core contract
|
|
441
|
+
* `coreContract` using an owned NFT at address `ownedNFTAddress` and
|
|
442
|
+
* token ID `ownedNFTTokenId` as the parent token.
|
|
443
|
+
* Sets the token's owner to `to`.
|
|
444
|
+
* @param to Address to be the new token's owner.
|
|
445
|
+
* @param projectId Project ID to mint a token on.
|
|
446
|
+
* @param coreContract Core contract address for the given project.
|
|
447
|
+
* @param maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places
|
|
448
|
+
* @param currencyAddress Currency address of token.
|
|
449
|
+
* @param ownedNFTAddress ERC-721 NFT holding the project token owned by
|
|
450
|
+
* msg.sender being used as the parent token.
|
|
451
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
|
|
452
|
+
* as the parent token.
|
|
453
|
+
* @return tokenId Token ID of minted token
|
|
454
|
+
*/
|
|
455
|
+
function purchaseTo(
|
|
456
|
+
address to,
|
|
457
|
+
uint256 projectId,
|
|
458
|
+
address coreContract,
|
|
459
|
+
uint256 maxPricePerToken,
|
|
460
|
+
address currencyAddress,
|
|
461
|
+
address ownedNFTAddress,
|
|
462
|
+
uint256 ownedNFTTokenId
|
|
463
|
+
) external returns (uint256 tokenId) {
|
|
464
|
+
return
|
|
465
|
+
purchaseTo({
|
|
466
|
+
to: to,
|
|
467
|
+
projectId: projectId,
|
|
468
|
+
coreContract: coreContract,
|
|
469
|
+
maxPricePerToken: maxPricePerToken,
|
|
470
|
+
currencyAddress: currencyAddress,
|
|
471
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
472
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
473
|
+
vault: address(0)
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// public getter functions
|
|
478
|
+
/**
|
|
479
|
+
* @notice Gets the maximum invocations project configuration.
|
|
480
|
+
* @param projectId The ID of the project whose data needs to be fetched.
|
|
481
|
+
* @param coreContract The address of the core contract.
|
|
482
|
+
* @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
|
|
483
|
+
* configuration data.
|
|
484
|
+
*/
|
|
485
|
+
function maxInvocationsProjectConfig(
|
|
486
|
+
uint256 projectId,
|
|
487
|
+
address coreContract
|
|
488
|
+
)
|
|
489
|
+
external
|
|
490
|
+
view
|
|
491
|
+
returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
|
|
492
|
+
{
|
|
493
|
+
return
|
|
494
|
+
MaxInvocationsLib.getMaxInvocationsProjectConfig({
|
|
495
|
+
projectId: projectId,
|
|
496
|
+
coreContract: coreContract
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* @notice Gets the set price project configuration.
|
|
502
|
+
* @param projectId The ID of the project whose data needs to be fetched.
|
|
503
|
+
* @param coreContract The address of the core contract.
|
|
504
|
+
* @return SetPriceProjectConfig struct with the fixed price project
|
|
505
|
+
* configuration data.
|
|
506
|
+
*/
|
|
507
|
+
function setPriceProjectConfig(
|
|
508
|
+
uint256 projectId,
|
|
509
|
+
address coreContract
|
|
510
|
+
) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
|
|
511
|
+
return
|
|
512
|
+
SetPriceLib.getSetPriceProjectConfig({
|
|
513
|
+
projectId: projectId,
|
|
514
|
+
coreContract: coreContract
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* @notice Checks if a specific NFT owner is allowed in a given project.
|
|
520
|
+
* @dev This function retrieves the allowance status of an NFT owner
|
|
521
|
+
* within a specific project from the allowedProjectHoldersMapping.
|
|
522
|
+
* @param projectId The ID of the project to check.
|
|
523
|
+
* @param coreContract Core contract address for the given project.
|
|
524
|
+
* @param ownedNFTAddress The address of the owned NFT contract.
|
|
525
|
+
* @param ownedNFTProjectId The ID of the owned NFT project.
|
|
526
|
+
* @return bool True if the NFT owner is allowed in the given project, False otherwise.
|
|
527
|
+
*/
|
|
528
|
+
function allowedProjectHolders(
|
|
529
|
+
uint256 projectId,
|
|
530
|
+
address coreContract,
|
|
531
|
+
address ownedNFTAddress,
|
|
532
|
+
uint256 ownedNFTProjectId
|
|
533
|
+
) external view returns (bool) {
|
|
534
|
+
return
|
|
535
|
+
TokenHolderLib
|
|
536
|
+
.getHolderProjectConfig({
|
|
537
|
+
projectId: projectId,
|
|
538
|
+
coreContract: coreContract
|
|
539
|
+
})
|
|
540
|
+
.allowedProjectHolders[ownedNFTAddress][ownedNFTProjectId];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* @notice Returns if token is an allowlisted NFT for project `projectId`.
|
|
545
|
+
* @param projectId Project ID to be checked.
|
|
546
|
+
* @param coreContract Core contract address for the given project.
|
|
547
|
+
* @param ownedNFTAddress ERC-721 NFT token address to be checked.
|
|
548
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID to be checked.
|
|
549
|
+
* @return bool Token is allowlisted
|
|
550
|
+
* @dev does not check if token has been used to purchase
|
|
551
|
+
* @dev assumes project ID can be derived from tokenId / 1_000_000
|
|
552
|
+
*/
|
|
553
|
+
function isAllowlistedNFT(
|
|
554
|
+
uint256 projectId,
|
|
555
|
+
address coreContract,
|
|
556
|
+
address ownedNFTAddress,
|
|
557
|
+
uint256 ownedNFTTokenId
|
|
558
|
+
) external view returns (bool) {
|
|
559
|
+
return
|
|
560
|
+
TokenHolderLib.isAllowlistedNFT({
|
|
561
|
+
projectId: projectId,
|
|
562
|
+
coreContract: coreContract,
|
|
563
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
564
|
+
ownedNFTTokenId: ownedNFTTokenId
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* @notice Checks if the specified `coreContract` is a valid engine contract.
|
|
570
|
+
* @dev This function retrieves the cached value of `isEngine` from
|
|
571
|
+
* the `isEngineCache` mapping. If the cached value is already set, it
|
|
572
|
+
* returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
|
|
573
|
+
* function from the `SplitFundsLib` library to check if `coreContract`
|
|
574
|
+
* is a valid engine contract.
|
|
575
|
+
* @dev This function will revert if the provided `coreContract` is not
|
|
576
|
+
* a valid Engine or V3 Flagship contract.
|
|
577
|
+
* @param coreContract The address of the contract to check.
|
|
578
|
+
* @return bool indicating if `coreContract` is a valid engine contract.
|
|
579
|
+
*/
|
|
580
|
+
function isEngineView(address coreContract) external view returns (bool) {
|
|
581
|
+
SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
|
|
582
|
+
.getIsEngineCacheConfig(coreContract);
|
|
583
|
+
if (isEngineCache.isCached) {
|
|
584
|
+
return isEngineCache.isEngine;
|
|
585
|
+
} else {
|
|
586
|
+
// @dev this calls the non-state-modifying variant of isEngine
|
|
587
|
+
return SplitFundsLib.getV3CoreIsEngineView(coreContract);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* @notice projectId => has project reached its maximum number of
|
|
593
|
+
* invocations? Note that this returns a local cache of the core contract's
|
|
594
|
+
* state, and may be out of sync with the core contract. This is
|
|
595
|
+
* intentional, as it only enables gas optimization of mints after a
|
|
596
|
+
* project's maximum invocations has been reached. A false negative will
|
|
597
|
+
* only result in a gas cost increase, since the core contract will still
|
|
598
|
+
* enforce a maxInvocation check during minting. A false positive is not
|
|
599
|
+
* possible because the V3 core contract only allows maximum invocations
|
|
600
|
+
* to be reduced, not increased. Based on this rationale, we intentionally
|
|
601
|
+
* do not do input validation in this method as to whether or not the input
|
|
602
|
+
* @param projectId is an existing project ID.
|
|
603
|
+
* @param coreContract is an existing core contract address.
|
|
604
|
+
*/
|
|
605
|
+
function projectMaxHasBeenInvoked(
|
|
606
|
+
uint256 projectId,
|
|
607
|
+
address coreContract
|
|
608
|
+
) external view returns (bool) {
|
|
609
|
+
return
|
|
610
|
+
MaxInvocationsLib.getMaxHasBeenInvoked({
|
|
611
|
+
projectId: projectId,
|
|
612
|
+
coreContract: coreContract
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* @notice projectId => project's maximum number of invocations.
|
|
618
|
+
* Optionally synced with core contract value, for gas optimization.
|
|
619
|
+
* Note that this returns a local cache of the core contract's
|
|
620
|
+
* state, and may be out of sync with the core contract. This is
|
|
621
|
+
* intentional, as it only enables gas optimization of mints after a
|
|
622
|
+
* project's maximum invocations has been reached.
|
|
623
|
+
* @dev A number greater than the core contract's project max invocations
|
|
624
|
+
* will only result in a gas cost increase, since the core contract will
|
|
625
|
+
* still enforce a maxInvocation check during minting. A number less than
|
|
626
|
+
* the core contract's project max invocations is only possible when the
|
|
627
|
+
* project's max invocations have not been synced on this minter, since the
|
|
628
|
+
* V3 core contract only allows maximum invocations to be reduced, not
|
|
629
|
+
* increased. When this happens, the minter will enable minting, allowing
|
|
630
|
+
* the core contract to enforce the max invocations check. Based on this
|
|
631
|
+
* rationale, we intentionally do not do input validation in this method as
|
|
632
|
+
* to whether or not the input `projectId` is an existing project ID.
|
|
633
|
+
* @param projectId is an existing project ID.
|
|
634
|
+
* @param coreContract is an existing core contract address.
|
|
635
|
+
*/
|
|
636
|
+
function projectMaxInvocations(
|
|
637
|
+
uint256 projectId,
|
|
638
|
+
address coreContract
|
|
639
|
+
) external view returns (uint256) {
|
|
640
|
+
return
|
|
641
|
+
MaxInvocationsLib.getMaxInvocations({
|
|
642
|
+
projectId: projectId,
|
|
643
|
+
coreContract: coreContract
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* @notice Gets your balance of the ERC20 token currently set
|
|
649
|
+
* as the payment currency for project `projectId` in the core
|
|
650
|
+
* contract `coreContract`.
|
|
651
|
+
* @param projectId Project ID to be queried.
|
|
652
|
+
* @param coreContract The address of the core contract.
|
|
653
|
+
* @return balance Balance of ERC20
|
|
654
|
+
*/
|
|
655
|
+
function getYourBalanceOfProjectERC20(
|
|
656
|
+
uint256 projectId,
|
|
657
|
+
address coreContract
|
|
658
|
+
) external view returns (uint256 balance) {
|
|
659
|
+
(address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20(
|
|
660
|
+
projectId,
|
|
661
|
+
coreContract
|
|
662
|
+
);
|
|
663
|
+
balance = SplitFundsLib.getERC20Balance({
|
|
664
|
+
currencyAddress: currencyAddress,
|
|
665
|
+
walletAddress: msg.sender
|
|
666
|
+
});
|
|
667
|
+
return balance;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* @notice Gets your allowance for this minter of the ERC20
|
|
672
|
+
* token currently set as the payment currency for project
|
|
673
|
+
* `projectId`.
|
|
674
|
+
* @param projectId Project ID to be queried.
|
|
675
|
+
* @param coreContract The address of the core contract.
|
|
676
|
+
* @return remaining Remaining allowance of ERC20
|
|
677
|
+
*/
|
|
678
|
+
function checkYourAllowanceOfProjectERC20(
|
|
679
|
+
uint256 projectId,
|
|
680
|
+
address coreContract
|
|
681
|
+
) external view returns (uint256 remaining) {
|
|
682
|
+
(address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20({
|
|
683
|
+
projectId: projectId,
|
|
684
|
+
coreContract: coreContract
|
|
685
|
+
});
|
|
686
|
+
remaining = SplitFundsLib.getERC20Allowance({
|
|
687
|
+
currencyAddress: currencyAddress,
|
|
688
|
+
walletAddress: msg.sender,
|
|
689
|
+
spenderAddress: address(this)
|
|
690
|
+
});
|
|
691
|
+
return remaining;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* @notice Gets if price of token is configured, price of minting a
|
|
696
|
+
* token on project `projectId`, and currency symbol and address to be
|
|
697
|
+
* used as payment.
|
|
698
|
+
* `isConfigured` is only true if a price has been configured, and an ERC20
|
|
699
|
+
* token has been configured.
|
|
700
|
+
* @param projectId Project ID to get price information for
|
|
701
|
+
* @param coreContract Contract address of the core contract
|
|
702
|
+
* @return isConfigured true only if token price has been configured on
|
|
703
|
+
* this minter and an ERC20 token has been configured
|
|
704
|
+
* @return tokenPriceInWei current price of token on this minter - invalid
|
|
705
|
+
* if price has not yet been configured. Note that "in wei" is a misnomer
|
|
706
|
+
* for ERC20 tokens, but is used here for ABI consistency with the ETH
|
|
707
|
+
* minters. The value returned represents the price per token, with no
|
|
708
|
+
* decimals.
|
|
709
|
+
* @return currencySymbol currency symbol for purchases of project on this
|
|
710
|
+
* minter. "UNCONFIG" if not yet configured. Note that currency symbol is
|
|
711
|
+
* defined by the artist, and is not necessarily the same as the ERC20
|
|
712
|
+
* token symbol on-chain.
|
|
713
|
+
* @return currencyAddress currency address for purchases of project on
|
|
714
|
+
* this minter. Null address if not yet configured.
|
|
715
|
+
*/
|
|
716
|
+
function getPriceInfo(
|
|
717
|
+
uint256 projectId,
|
|
718
|
+
address coreContract
|
|
719
|
+
)
|
|
720
|
+
external
|
|
721
|
+
view
|
|
722
|
+
returns (
|
|
723
|
+
bool isConfigured,
|
|
724
|
+
uint256 tokenPriceInWei,
|
|
725
|
+
string memory currencySymbol,
|
|
726
|
+
address currencyAddress
|
|
727
|
+
)
|
|
728
|
+
{
|
|
729
|
+
SetPriceLib.SetPriceProjectConfig
|
|
730
|
+
storage setPriceProjectConfig_ = SetPriceLib
|
|
731
|
+
.getSetPriceProjectConfig({
|
|
732
|
+
projectId: projectId,
|
|
733
|
+
coreContract: coreContract
|
|
734
|
+
});
|
|
735
|
+
tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
|
|
736
|
+
// get currency info from SplitFundsLib
|
|
737
|
+
(currencyAddress, currencySymbol) = SplitFundsLib.getCurrencyInfoERC20({
|
|
738
|
+
projectId: projectId,
|
|
739
|
+
coreContract: coreContract
|
|
740
|
+
});
|
|
741
|
+
// report if price and ERC20 token are configured
|
|
742
|
+
// @dev currencyAddress is non-zero if an ERC20 token is configured
|
|
743
|
+
isConfigured =
|
|
744
|
+
setPriceProjectConfig_.priceIsConfigured &&
|
|
745
|
+
currencyAddress != address(0);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Gets the current polyptych panel ID for the given project.
|
|
750
|
+
* @param projectId Project ID to be queried
|
|
751
|
+
* @param coreContract Contract address of the core contract
|
|
752
|
+
* @return uint256 representing the current polyptych panel ID for the
|
|
753
|
+
* given project
|
|
754
|
+
*/
|
|
755
|
+
function getCurrentPolyptychPanelId(
|
|
756
|
+
uint256 projectId,
|
|
757
|
+
address coreContract
|
|
758
|
+
) external view returns (uint256) {
|
|
759
|
+
return
|
|
760
|
+
PolyptychLib.getPolyptychPanelId({
|
|
761
|
+
projectId: projectId,
|
|
762
|
+
coreContract: coreContract
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Gets if the hash seed for the given project has been used on a given
|
|
768
|
+
* polyptych panel id. The current polyptych panel ID for a given project
|
|
769
|
+
* can be queried via the view function `getCurrentPolyptychPanelId`.
|
|
770
|
+
* @param projectId Project ID to be queried
|
|
771
|
+
* @param coreContract Contract address of the core contract
|
|
772
|
+
* @param panelId Panel ID to be queried
|
|
773
|
+
* @param hashSeed Hash seed to be queried
|
|
774
|
+
* @return bool representing if the hash seed has been used on the given
|
|
775
|
+
* polyptych panel ID
|
|
776
|
+
*/
|
|
777
|
+
function getPolyptychPanelHashSeedIsMinted(
|
|
778
|
+
uint256 projectId,
|
|
779
|
+
address coreContract,
|
|
780
|
+
uint256 panelId,
|
|
781
|
+
bytes12 hashSeed
|
|
782
|
+
) external view returns (bool) {
|
|
783
|
+
return
|
|
784
|
+
PolyptychLib.getPolyptychPanelHashSeedIsMinted({
|
|
785
|
+
projectId: projectId,
|
|
786
|
+
coreContract: coreContract,
|
|
787
|
+
panelId: panelId,
|
|
788
|
+
hashSeed: hashSeed
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* @notice Syncs local maximum invocations of project `projectId` based on
|
|
794
|
+
* the value currently defined in the core contract.
|
|
795
|
+
* @param projectId Project ID to set the maximum invocations for.
|
|
796
|
+
* @param coreContract Core contract address for the given project.
|
|
797
|
+
* @dev this enables gas reduction after maxInvocations have been reached -
|
|
798
|
+
* core contracts shall still enforce a maxInvocation check during mint.
|
|
799
|
+
*/
|
|
800
|
+
function syncProjectMaxInvocationsToCore(
|
|
801
|
+
uint256 projectId,
|
|
802
|
+
address coreContract
|
|
803
|
+
) public {
|
|
804
|
+
AuthLib.onlyArtist({
|
|
805
|
+
projectId: projectId,
|
|
806
|
+
coreContract: coreContract,
|
|
807
|
+
sender: msg.sender
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
MaxInvocationsLib.syncProjectMaxInvocationsToCore({
|
|
811
|
+
projectId: projectId,
|
|
812
|
+
coreContract: coreContract
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* @notice Purchases a token from project `projectId` on core contract
|
|
818
|
+
* `coreContract` using an owned NFT at address `ownedNFTAddress` and
|
|
819
|
+
* token ID `ownedNFTTokenId` as the parent token.
|
|
820
|
+
* Sets the token's owner to `to`.
|
|
821
|
+
* Parent token must be owned by `msg.sender`, or `vault` if `msg.sender`
|
|
822
|
+
* is a valid delegate for `vault`.
|
|
823
|
+
* @param to Address to be the new token's owner.
|
|
824
|
+
* @param projectId Project ID to mint a token on.
|
|
825
|
+
* @param coreContract Core contract address for the given project.
|
|
826
|
+
* @param maxPricePerToken Maximum price of token being allowed by the purchaser, no decimal places
|
|
827
|
+
* @param currencyAddress Currency address of token.
|
|
828
|
+
* @param ownedNFTAddress ERC-721 NFT holding the project token owned by
|
|
829
|
+
* msg.sender or `vault` being used as the parent token.
|
|
830
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender or
|
|
831
|
+
* `vault` being used as the parent token.
|
|
832
|
+
* @return tokenId Token ID of minted token
|
|
833
|
+
*/
|
|
834
|
+
function purchaseTo(
|
|
835
|
+
address to,
|
|
836
|
+
uint256 projectId,
|
|
837
|
+
address coreContract,
|
|
838
|
+
uint256 maxPricePerToken,
|
|
839
|
+
address currencyAddress,
|
|
840
|
+
address ownedNFTAddress,
|
|
841
|
+
uint256 ownedNFTTokenId,
|
|
842
|
+
address vault
|
|
843
|
+
) public nonReentrant returns (uint256 tokenId) {
|
|
844
|
+
// CHECKS
|
|
845
|
+
// pre-mint MaxInvocationsLib checks
|
|
846
|
+
// Note that `maxHasBeenInvoked` is only checked here to reduce gas
|
|
847
|
+
// consumption after a project has been fully minted.
|
|
848
|
+
// `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
|
|
849
|
+
// gas consumption, but if not in sync with the core contract's value,
|
|
850
|
+
// the core contract also enforces its own max invocation check during
|
|
851
|
+
// minting.
|
|
852
|
+
MaxInvocationsLib.preMintChecks({
|
|
853
|
+
projectId: projectId,
|
|
854
|
+
coreContract: coreContract
|
|
855
|
+
});
|
|
856
|
+
|
|
857
|
+
// pre-mint checks for set price lib, and get price per token
|
|
858
|
+
// @dev price per token is loaded into memory here for gas efficiency
|
|
859
|
+
uint256 pricePerToken = SetPriceLib.preMintChecksAndGetPrice({
|
|
860
|
+
projectId: projectId,
|
|
861
|
+
coreContract: coreContract
|
|
862
|
+
});
|
|
863
|
+
|
|
864
|
+
// @dev block scope to avoid stack too deep error
|
|
865
|
+
{
|
|
866
|
+
// get the currency address configured on the project
|
|
867
|
+
// @dev revert occurs during payment split if ERC20 token is not
|
|
868
|
+
// configured (i.e. address(0)), so check is not performed here
|
|
869
|
+
(address configuredCurrencyAddress, ) = SplitFundsLib
|
|
870
|
+
.getCurrencyInfoERC20({
|
|
871
|
+
projectId: projectId,
|
|
872
|
+
coreContract: coreContract
|
|
873
|
+
});
|
|
874
|
+
// validate that the currency address and symbols matches the project configured currency
|
|
875
|
+
require(
|
|
876
|
+
currencyAddress == configuredCurrencyAddress,
|
|
877
|
+
"Currency addresses must match"
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
// validate that the specified maximum price is greater than or equal to the price per token
|
|
882
|
+
require(
|
|
883
|
+
maxPricePerToken >= pricePerToken,
|
|
884
|
+
"Only max price gte token price"
|
|
885
|
+
);
|
|
886
|
+
|
|
887
|
+
// require token used to claim to be in set of allowlisted NFTs
|
|
888
|
+
require(
|
|
889
|
+
TokenHolderLib.isAllowlistedNFT({
|
|
890
|
+
projectId: projectId,
|
|
891
|
+
coreContract: coreContract,
|
|
892
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
893
|
+
ownedNFTTokenId: ownedNFTTokenId
|
|
894
|
+
}),
|
|
895
|
+
"Only allowlisted NFTs"
|
|
896
|
+
);
|
|
897
|
+
|
|
898
|
+
// NOTE: delegate-vault handling **begins here**.
|
|
899
|
+
|
|
900
|
+
// handle that the vault may be either the `msg.sender` in the case
|
|
901
|
+
// that there is not a true vault, or may be `vault` if one is
|
|
902
|
+
// provided explicitly (and it is valid).
|
|
903
|
+
address vault_ = msg.sender;
|
|
904
|
+
if (vault != address(0)) {
|
|
905
|
+
// If a vault is provided, it must be valid, otherwise throw rather
|
|
906
|
+
// than optimistically-minting with original `msg.sender`.
|
|
907
|
+
// Note, we do not check `checkDelegateForAll` or `checkDelegateForContract` as well,
|
|
908
|
+
// as they are known to be implicitly checked by calling `checkDelegateForToken`.
|
|
909
|
+
bool isValidVault = _delegationRegistryContract
|
|
910
|
+
.checkDelegateForToken({
|
|
911
|
+
delegate: msg.sender,
|
|
912
|
+
vault: vault,
|
|
913
|
+
contract_: coreContract,
|
|
914
|
+
tokenId: ownedNFTTokenId
|
|
915
|
+
});
|
|
916
|
+
require(isValidVault, "Invalid delegate-vault pairing");
|
|
917
|
+
vault_ = vault;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
// we need the new token ID in advance of the randomizer setting a token hash
|
|
921
|
+
IGenArt721CoreContractV3_Base genArtCoreContract = IGenArt721CoreContractV3_Base(
|
|
922
|
+
coreContract
|
|
923
|
+
);
|
|
924
|
+
(uint256 invocations, , , , , ) = genArtCoreContract.projectStateData(
|
|
925
|
+
projectId
|
|
926
|
+
);
|
|
927
|
+
|
|
928
|
+
// EFFECTS
|
|
929
|
+
|
|
930
|
+
// we need to store the new token ID before it is minted so the randomizer can query it
|
|
931
|
+
// @dev block scope to avoid stack too deep error
|
|
932
|
+
{
|
|
933
|
+
bytes12 targetHashSeed = PolyptychLib.getTokenHashSeed({
|
|
934
|
+
coreContract: ownedNFTAddress,
|
|
935
|
+
tokenId: ownedNFTTokenId
|
|
936
|
+
});
|
|
937
|
+
|
|
938
|
+
PolyptychLib.validatePolyptychEffects({
|
|
939
|
+
projectId: projectId,
|
|
940
|
+
coreContract: coreContract,
|
|
941
|
+
tokenHashSeed: targetHashSeed
|
|
942
|
+
});
|
|
943
|
+
|
|
944
|
+
// @dev block scope to avoid stack too deep error
|
|
945
|
+
{
|
|
946
|
+
uint256 newTokenId = (projectId * ONE_MILLION) + invocations;
|
|
947
|
+
PolyptychLib.setPolyptychHashSeed({
|
|
948
|
+
coreContract: coreContract,
|
|
949
|
+
tokenId: newTokenId, // new token ID
|
|
950
|
+
hashSeed: targetHashSeed
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
// once mint() is called, the polyptych randomizer will either:
|
|
955
|
+
// 1) assign a random token hash
|
|
956
|
+
// 2) if configured, obtain the token hash from the `polyptychSeedHashes` mapping
|
|
957
|
+
tokenId = _minterFilter.mint_joo({
|
|
958
|
+
to: to,
|
|
959
|
+
projectId: projectId,
|
|
960
|
+
coreContract: coreContract,
|
|
961
|
+
sender: vault_
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
// NOTE: delegate-vault handling **ends here**.
|
|
965
|
+
|
|
966
|
+
// redundant check against reentrancy
|
|
967
|
+
PolyptychLib.validateAssignedHashSeed({
|
|
968
|
+
coreContract: coreContract,
|
|
969
|
+
tokenId: tokenId,
|
|
970
|
+
targetHashSeed: targetHashSeed
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
MaxInvocationsLib.validatePurchaseEffectsInvocations({
|
|
975
|
+
tokenId: tokenId,
|
|
976
|
+
coreContract: coreContract
|
|
977
|
+
});
|
|
978
|
+
|
|
979
|
+
// INTERACTIONS
|
|
980
|
+
// @dev block scope to avoid stack too deep error
|
|
981
|
+
{
|
|
982
|
+
// require proper ownership of NFT used to redeem
|
|
983
|
+
/**
|
|
984
|
+
* @dev Considered an interaction because calling ownerOf on an NFT
|
|
985
|
+
* contract. Plan is to only integrate with AB/PBAB NFTs on the minter, but
|
|
986
|
+
* in case other NFTs are registered, better to check here. Also,
|
|
987
|
+
* function is non-reentrant, so this is extra cautious.
|
|
988
|
+
*/
|
|
989
|
+
// @dev if the artist is the sender, then the NFT must be owned by the
|
|
990
|
+
// recipient, otherwise the NFT must be owned by the vault_
|
|
991
|
+
address _artist = genArtCoreContract.projectIdToArtistAddress(
|
|
992
|
+
projectId
|
|
993
|
+
);
|
|
994
|
+
address targetOwner = (msg.sender == _artist) ? to : vault_;
|
|
995
|
+
TokenHolderLib.validateNFTOwnership({
|
|
996
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
997
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
998
|
+
targetOwner: targetOwner
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
// split funds
|
|
1003
|
+
// process payment in ERC20
|
|
1004
|
+
SplitFundsLib.splitFundsERC20({
|
|
1005
|
+
projectId: projectId,
|
|
1006
|
+
pricePerToken: pricePerToken,
|
|
1007
|
+
coreContract: coreContract
|
|
1008
|
+
});
|
|
1009
|
+
|
|
1010
|
+
return tokenId;
|
|
1011
|
+
}
|
|
1012
|
+
}
|