@artblocks/contracts 1.0.4 → 1.2.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 +75 -7
- 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 +336 -131
- package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +2047 -0
- package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +2021 -0
- package/artifacts/contracts/{minter-suite → archive/minter-suite}/Minters/MinterBase_v0_1_1.sol/MinterBase.json +1 -1
- 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/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExp}/MinterDAExpV4.sol/MinterDAExpV4.json +3 -3
- 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 +1109 -0
- 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/{minter-suite/Minters → archive/minter-suite/Minters/MinterDALin}/MinterDALinV4.sol/MinterDALinV4.json +3 -3
- 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/{minter-suite/Minters → archive/minter-suite/Minters/MinterHolder}/MinterHolderV4.sol/MinterHolderV4.json +3 -3
- 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/{minter-suite/Minters → archive/minter-suite/Minters/MinterMerkle}/MinterMerkleV5.sol/MinterMerkleV5.json +3 -3
- package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +31 -63
- package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol/MinterPolyptychV0.json +3 -3
- package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSEA}/MinterSEAV0.sol/MinterSEAV0.json +3 -3
- 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/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPrice}/MinterSetPriceV4.sol/MinterSetPriceV4.json +3 -3
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol/MinterSetPriceERC20V0.json +65 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol/MinterSetPriceERC20V1.json +65 -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 +807 -0
- package/artifacts/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol/GenArt721MinterBurner_PBAB.json +65 -2
- package/artifacts/contracts/engine/V2/GenArt721Minter_PBAB.sol/GenArt721Minter_PBAB.json +65 -2
- package/artifacts/contracts/engine/V3/EngineFactoryV0.sol/EngineFactoryV0.json +606 -0
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +565 -209
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +785 -227
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +40 -15
- 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 +40 -15
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +36 -68
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
- package/artifacts/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol/IAdminACLV0_Extended.json +140 -0
- package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol/IBytecodeStorageReaderV2.json +130 -0
- package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +6 -6
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +71 -39
- package/artifacts/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol/IEngineFactoryV0.json +283 -0
- package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol/IFilteredMinterDAExpSettlementV0.json +12 -12
- package/artifacts/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +12 -12
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +30 -62
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +30 -62
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +170 -104
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +170 -104
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +1028 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +741 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol/IGenArt721CoreContractV3_ProjectFinance.json +87 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol/IGenArt721Minter_PBAB.json +279 -0
- package/artifacts/contracts/interfaces/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +22 -22
- package/artifacts/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +26 -101
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +2 -21
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +15 -90
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +10 -36
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol/ISharedMinterRAMV0.json +62 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol/ISharedMinterRequired.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +4 -236
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +5 -5
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +7 -423
- package/artifacts/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +17 -17
- package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol/ISplitAtomicFactoryV0.json +170 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol/ISplitAtomicV0.json +126 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISplitProviderV0.sol/ISplitProviderV0.json +98 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol/ISplitFactoryV2.json +123 -0
- package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
- package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeMock.sol/GnosisSafeMock.json +2 -2
- package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeProxyFactoryMock.sol/GnosisSafeProxyFactoryMock.json +2 -2
- package/artifacts/contracts/libs/integration-refs/gnosis-safe/MultiSendMock.sol/MultiSendMock.json +2 -2
- package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/BitMap.sol/BitMaps256.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV0.sol/BytecodeStorage.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageReader.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageWriter.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageReader.json +214 -0
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV2.sol/BytecodeStorageWriter.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol/DependencyRegistryStorageLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol/ERC721_PackedHashSeedV1.json +444 -0
- package/artifacts/contracts/libs/v0.8.x/PackedBools.sol/PackedBools.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/SSTORE2.sol/SSTORE2.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/V3FlexLib.sol/V3FlexLib.json +208 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +60 -3
- 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 +60 -3
- 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 +29 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +30 -3
- 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 +398 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +254 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +48 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +41 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +35 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +79 -3
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +41 -41
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +67 -594
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +1374 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +56 -722
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +58 -454
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +61 -552
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +55 -497
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +110 -571
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +69 -560
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +28 -444
- package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +417 -0
- package/artifacts/contracts/mock/BytecodeV2LibCallsMock.sol/BytecodeV2LibCallsMock.json +154 -0
- package/artifacts/contracts/mock/BytecodeV2TextCR_DMock.sol/BytecodeV2TextCR_DMock.json +428 -0
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +2 -2
- package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +24 -0
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -9
- package/artifacts/contracts/mock/Mock0xSplitsV2PullFactory.sol/Mock0xSplitsV2PullFactory.json +149 -0
- package/artifacts/contracts/mock/Mock0xSplitsV2Splitter.sol/Mock0xSplitsV2Splitter.json +99 -0
- package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +20 -2
- package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +20 -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/ReentrancyGenArt721MinterMock.sol/ReentrancyGenArt721MinterMock.json +100 -0
- 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/ReentrancySplitterMocks.sol/ReentrancySplitterDrainETHMock.json +54 -0
- package/artifacts/contracts/mock/ReentrancySplitterMocks.sol/ReentrancySplitterSendETHMock.json +54 -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/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +2 -2
- package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +19 -19
- package/artifacts/contracts/split/SplitAtomicFactoryV0.sol/SplitAtomicFactoryV0.json +203 -0
- package/artifacts/contracts/split/SplitAtomicV0.sol/SplitAtomicV0.json +168 -0
- package/artifacts/contracts/split/split-provider/SplitProviderV0.sol/SplitProviderV0.json +141 -0
- package/contracts/AdminACLV0.sol +6 -2
- package/contracts/AdminACLV1.sol +2 -2
- package/contracts/DependencyRegistryV0.sol +737 -390
- package/contracts/{GenArt721CoreV3.sol → archive/GenArt721CoreV3.sol} +56 -20
- package/contracts/{explorations → archive}/GenArt721CoreV3_Explorations.sol +49 -13
- package/contracts/{minter-suite → archive/minter-suite}/Minters/MinterBase_v0_1_1.sol +4 -4
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExp}/MinterDAExpV4.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +5 -5
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV2.sol +9 -62
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDALin}/MinterDALinV4.sol +4 -4
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterHolder}/MinterHolderV4.sol +5 -5
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterMerkle}/MinterMerkleV5.sol +5 -5
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterPolyptych}/MinterPolyptychV0.sol +7 -7
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSEA}/MinterSEAV0.sol +13 -13
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPrice}/MinterSetPriceV4.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol +82 -10
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol +82 -10
- package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterSetPriceERC20}/MinterSetPriceERC20V4.sol +88 -21
- package/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol +81 -22
- package/contracts/engine/V2/GenArt721Minter_PBAB.sol +80 -22
- package/contracts/engine/V3/EngineFactoryV0.sol +419 -0
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +893 -493
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +1053 -655
- package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +7 -13
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +5 -11
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +2 -2
- package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
- package/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol +20 -0
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol +23 -0
- package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +6 -8
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +48 -43
- package/contracts/interfaces/v0.8.x/IEngineFactoryV0.sol +124 -0
- package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV0.sol +1 -3
- package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpSettlementV1.sol +1 -3
- package/contracts/interfaces/v0.8.x/IFilteredMinterDAExpV1.sol +1 -3
- package/contracts/interfaces/v0.8.x/IFilteredMinterDALinV1.sol +1 -3
- package/contracts/interfaces/v0.8.x/IFilteredMinterHolderV2.sol +1 -3
- package/contracts/interfaces/v0.8.x/IFilteredMinterMerkleV2.sol +1 -3
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol +115 -11
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +84 -8
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol +26 -8
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol +141 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol +78 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol +47 -0
- package/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol +91 -0
- package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +25 -25
- package/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol +1 -3
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +30 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +1 -14
- package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +1 -15
- package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +2 -8
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +15 -43
- package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +10 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol +23 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol +20 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +1 -67
- package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +5 -5
- package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +18 -160
- package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +37 -37
- package/contracts/interfaces/v0.8.x/ISplitAtomicFactoryV0.sol +81 -0
- package/contracts/interfaces/v0.8.x/ISplitAtomicV0.sol +72 -0
- package/contracts/interfaces/v0.8.x/ISplitProviderV0.sol +49 -0
- package/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol +62 -0
- package/contracts/libs/v0.8.x/ABHelpers.sol +31 -17
- package/contracts/libs/v0.8.x/AuthLib.sol +101 -102
- package/contracts/libs/v0.8.x/BitMap.sol +112 -0
- package/contracts/libs/v0.8.x/BytecodeStorageV2.sol +593 -0
- package/contracts/libs/v0.8.x/Bytes32Strings.sol +5 -5
- package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +90 -0
- package/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol +591 -0
- package/contracts/libs/v0.8.x/PackedBools.sol +42 -0
- package/contracts/libs/v0.8.x/V3FlexLib.sol +591 -0
- package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +162 -39
- package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
- package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +139 -37
- package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
- package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +299 -158
- package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +268 -55
- package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +138 -58
- package/contracts/libs/v0.8.x/minter-libs/RAMLib.sol +2927 -0
- package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +796 -123
- package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +131 -13
- package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +607 -224
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +494 -330
- package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +217 -78
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +358 -309
- package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +391 -491
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +396 -632
- package/contracts/minter-suite/Minters/MinterDAExpV5.sol +212 -273
- package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +393 -488
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +220 -277
- package/contracts/minter-suite/Minters/MinterRAMV0.sol +1205 -0
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +329 -677
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +287 -303
- package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +355 -446
- package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +328 -416
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +552 -622
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +429 -553
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +180 -227
- package/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol +446 -0
- package/contracts/mock/BytecodeV2LibCallsMock.sol +128 -0
- package/contracts/mock/BytecodeV2TextCR_DMock.sol +316 -0
- package/contracts/mock/ForceSendMock.sol +22 -0
- package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +3 -10
- package/contracts/mock/Mock0xSplitsV2PullFactory.sol +75 -0
- package/contracts/mock/Mock0xSplitsV2Splitter.sol +47 -0
- package/contracts/mock/MockAdminACLV0.sol +21 -0
- package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +21 -0
- package/contracts/mock/ReentrancyGenArt721MinterMock.sol +47 -0
- package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
- package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
- package/contracts/mock/ReentrancyMockShared.sol +48 -0
- package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
- package/contracts/mock/ReentrancySplitterMocks.sol +67 -0
- package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +79 -71
- package/contracts/split/SplitAtomicFactoryV0.sol +121 -0
- package/contracts/split/SplitAtomicV0.sol +265 -0
- package/contracts/split/split-provider/SplitProviderV0.sol +201 -0
- package/package.json +79 -45
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +0 -1965
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +0 -1939
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +0 -1127
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +0 -768
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +0 -208
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol/GenArt721RoyaltyOverride_PBAB.json +0 -301
- package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +0 -168
- package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +0 -221
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
2
|
// Created By: Art Blocks Inc.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "../../interfaces/v0.8.x/ISharedMinterHolderV0.sol";
|
|
8
|
-
import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
4
|
+
// @dev fixed to specific solidity version for clarity and for more clear
|
|
5
|
+
// source code verification purposes.
|
|
6
|
+
pragma solidity 0.8.19;
|
|
9
7
|
|
|
10
|
-
import "../../
|
|
11
|
-
import "../../
|
|
12
|
-
import "../../
|
|
13
|
-
import "../../
|
|
14
|
-
import "../../
|
|
15
|
-
import "../../libs/v0.8.x/minter-libs/PolyptychLib.sol";
|
|
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";
|
|
16
13
|
|
|
17
|
-
import "
|
|
18
|
-
import "
|
|
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";
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
|
|
22
|
+
import {EnumerableSet} from "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.sol";
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* @title Shared, filtered Minter contract that allows tokens to be minted with
|
|
@@ -72,11 +74,18 @@ pragma solidity 0.8.19;
|
|
|
72
74
|
* Token-level delegations are configured by the vault owner, and contract-
|
|
73
75
|
* level delegations must be configured for the core token contract as returned
|
|
74
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.
|
|
75
84
|
*/
|
|
76
85
|
contract MinterSetPricePolyptychERC20V5 is
|
|
77
86
|
ReentrancyGuard,
|
|
78
87
|
ISharedMinterV0,
|
|
79
|
-
|
|
88
|
+
ISharedMinterHolderERC20V0
|
|
80
89
|
{
|
|
81
90
|
// add Enumerable Set methods
|
|
82
91
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
@@ -85,13 +94,13 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
85
94
|
address public immutable minterFilterAddress;
|
|
86
95
|
|
|
87
96
|
/// Minter filter this minter may interact with.
|
|
88
|
-
IMinterFilterV1 private immutable
|
|
97
|
+
IMinterFilterV1 private immutable _minterFilter;
|
|
89
98
|
|
|
90
99
|
/// Delegation registry address
|
|
91
100
|
address public immutable delegationRegistryAddress;
|
|
92
101
|
|
|
93
102
|
/// Delegation registry address
|
|
94
|
-
IDelegationRegistry private immutable
|
|
103
|
+
IDelegationRegistry private immutable _delegationRegistryContract;
|
|
95
104
|
|
|
96
105
|
/// minterType for this minter
|
|
97
106
|
string public constant minterType = "MinterSetPricePolyptychERC20V5";
|
|
@@ -99,73 +108,7 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
99
108
|
/// minter version for this minter
|
|
100
109
|
string public constant minterVersion = "v5.0.0";
|
|
101
110
|
|
|
102
|
-
uint256 constant ONE_MILLION = 1_000_000;
|
|
103
|
-
|
|
104
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
105
|
-
// STATE VARIABLES FOR SetPriceLib begin here
|
|
106
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
107
|
-
|
|
108
|
-
/// contractAddress => projectId => set price project config
|
|
109
|
-
mapping(address => mapping(uint256 => SetPriceLib.SetPriceProjectConfig))
|
|
110
|
-
private _setPriceProjectConfigMapping;
|
|
111
|
-
|
|
112
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
113
|
-
// STATE VARIABLES FOR SetPriceLib end here
|
|
114
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
115
|
-
|
|
116
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
117
|
-
// STATE VARIABLES FOR SplitFundsLib begin here
|
|
118
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
119
|
-
|
|
120
|
-
// contractAddress => IsEngineCache
|
|
121
|
-
mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
|
|
122
|
-
|
|
123
|
-
// contractAddress => projectId => SplitFundsProjectConfig
|
|
124
|
-
mapping(address => mapping(uint256 => SplitFundsLib.SplitFundsProjectConfig))
|
|
125
|
-
private _splitFundsProjectConfigs;
|
|
126
|
-
|
|
127
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
128
|
-
// STATE VARIABLES FOR SplitFundsLib end here
|
|
129
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
130
|
-
|
|
131
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
132
|
-
// STATE VARIABLES FOR MaxInvocationsLib begin here
|
|
133
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
134
|
-
|
|
135
|
-
// contractAddress => projectId => max invocations specific project config
|
|
136
|
-
mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
|
|
137
|
-
private _maxInvocationsProjectConfigMapping;
|
|
138
|
-
|
|
139
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
140
|
-
// STATE VARIABLES FOR MaxInvocationsLib end here
|
|
141
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
142
|
-
|
|
143
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
144
|
-
// STATE VARIABLES FOR PolyptychLib begin here
|
|
145
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
146
|
-
|
|
147
|
-
// contractAddress => projectId => polyptych project config
|
|
148
|
-
mapping(address => mapping(uint256 => PolyptychLib.PolyptychProjectConfig))
|
|
149
|
-
private _polyptychProjectConfigs;
|
|
150
|
-
|
|
151
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
152
|
-
// STATE VARIABLES FOR PolyptychLib end here
|
|
153
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
154
|
-
|
|
155
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
156
|
-
// STATE VARIABLES FOR TokenHolderLib begin here
|
|
157
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* coreContract => projectId => ownedNFTAddress => ownedNFTProjectIds => bool
|
|
161
|
-
* projects whose holders are allowed to purchase a token on `projectId`
|
|
162
|
-
*/
|
|
163
|
-
mapping(address => mapping(uint256 => TokenHolderLib.HolderProjectConfig))
|
|
164
|
-
private _allowedProjectHoldersMapping;
|
|
165
|
-
|
|
166
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
167
|
-
// STATE VARIABLES FOR TokenHolderLib end here
|
|
168
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
111
|
+
uint256 internal constant ONE_MILLION = 1_000_000;
|
|
169
112
|
|
|
170
113
|
// MODIFIERS
|
|
171
114
|
// @dev contract uses modifier-like internal functions instead of modifiers
|
|
@@ -174,498 +117,484 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
174
117
|
|
|
175
118
|
/**
|
|
176
119
|
* @notice Initializes contract to be a Filtered Minter for
|
|
177
|
-
* `
|
|
178
|
-
* @param
|
|
120
|
+
* `minterFilter` minter filter.
|
|
121
|
+
* @param minterFilter Minter filter for which this will be a
|
|
179
122
|
* filtered minter.
|
|
180
|
-
* @param
|
|
123
|
+
* @param delegationRegistryAddress_ Delegation registry contract address.
|
|
181
124
|
*/
|
|
182
125
|
constructor(
|
|
183
|
-
address
|
|
184
|
-
address
|
|
126
|
+
address minterFilter,
|
|
127
|
+
address delegationRegistryAddress_
|
|
185
128
|
) ReentrancyGuard() {
|
|
186
|
-
minterFilterAddress =
|
|
187
|
-
|
|
129
|
+
minterFilterAddress = minterFilter;
|
|
130
|
+
_minterFilter = IMinterFilterV1(minterFilter);
|
|
188
131
|
|
|
189
|
-
delegationRegistryAddress =
|
|
190
|
-
|
|
191
|
-
|
|
132
|
+
delegationRegistryAddress = delegationRegistryAddress_;
|
|
133
|
+
_delegationRegistryContract = IDelegationRegistry(
|
|
134
|
+
delegationRegistryAddress_
|
|
135
|
+
);
|
|
136
|
+
emit TokenHolderLib.DelegationRegistryUpdated(
|
|
137
|
+
delegationRegistryAddress_
|
|
192
138
|
);
|
|
193
|
-
emit DelegationRegistryUpdated(_delegationRegistryAddress);
|
|
194
139
|
}
|
|
195
140
|
|
|
196
141
|
/**
|
|
197
|
-
* @notice Manually sets the local maximum invocations of project `
|
|
198
|
-
* with the provided `
|
|
199
|
-
* than or equal to the value of project `
|
|
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
|
|
200
145
|
* set on the core contract.
|
|
201
|
-
* @dev Note that a `
|
|
146
|
+
* @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
|
|
202
147
|
* value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
|
|
203
148
|
* this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
|
|
204
|
-
* @param
|
|
205
|
-
* @param
|
|
206
|
-
* @param
|
|
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.
|
|
207
152
|
*/
|
|
208
153
|
function manuallyLimitProjectMaxInvocations(
|
|
209
|
-
uint256
|
|
210
|
-
address
|
|
211
|
-
uint24
|
|
154
|
+
uint256 projectId,
|
|
155
|
+
address coreContract,
|
|
156
|
+
uint24 maxInvocations
|
|
212
157
|
) external {
|
|
213
158
|
AuthLib.onlyArtist({
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
159
|
+
projectId: projectId,
|
|
160
|
+
coreContract: coreContract,
|
|
161
|
+
sender: msg.sender
|
|
162
|
+
});
|
|
163
|
+
MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
|
|
164
|
+
projectId: projectId,
|
|
165
|
+
coreContract: coreContract,
|
|
166
|
+
maxInvocations: maxInvocations
|
|
217
167
|
});
|
|
218
|
-
MaxInvocationsLib.manuallyLimitProjectMaxInvocations(
|
|
219
|
-
_projectId,
|
|
220
|
-
_coreContract,
|
|
221
|
-
_maxInvocations,
|
|
222
|
-
_maxInvocationsProjectConfigMapping[_coreContract][_projectId]
|
|
223
|
-
);
|
|
224
|
-
emit ProjectMaxInvocationsLimitUpdated(
|
|
225
|
-
_projectId,
|
|
226
|
-
_coreContract,
|
|
227
|
-
_maxInvocations
|
|
228
|
-
);
|
|
229
168
|
}
|
|
230
169
|
|
|
231
170
|
/**
|
|
232
|
-
* @notice Updates this minter's price per token of project `
|
|
233
|
-
* to be
|
|
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 in base units.
|
|
175
|
+
* @dev Note that it is intentionally supported here that the configured
|
|
176
|
+
* price may be explicitly set to `0`.
|
|
234
177
|
* @dev Note that it is intentionally supported here that the configured
|
|
235
178
|
* price may be explicitly set to `0`.
|
|
236
|
-
* @param
|
|
237
|
-
* @param
|
|
238
|
-
* @param
|
|
179
|
+
* @param projectId Project ID to set the price per token for.
|
|
180
|
+
* @param coreContract Core contract address for the given project.
|
|
181
|
+
* @param pricePerTokenInWei Price per token to set for the project.
|
|
182
|
+
* Represents the ERC20 token price in base units. For example, if the
|
|
183
|
+
* ERC20 token has 6 decimals, an input value of `1_000_000` would
|
|
184
|
+
* represent a price of `1.000000` tokens.
|
|
239
185
|
*/
|
|
240
186
|
function updatePricePerTokenInWei(
|
|
241
|
-
uint256
|
|
242
|
-
address
|
|
243
|
-
uint248
|
|
187
|
+
uint256 projectId,
|
|
188
|
+
address coreContract,
|
|
189
|
+
uint248 pricePerTokenInWei
|
|
244
190
|
) external {
|
|
245
191
|
AuthLib.onlyArtist({
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
192
|
+
projectId: projectId,
|
|
193
|
+
coreContract: coreContract,
|
|
194
|
+
sender: msg.sender
|
|
195
|
+
});
|
|
196
|
+
SetPriceLib.updatePricePerToken({
|
|
197
|
+
projectId: projectId,
|
|
198
|
+
coreContract: coreContract,
|
|
199
|
+
pricePerToken: pricePerTokenInWei
|
|
249
200
|
});
|
|
250
|
-
SetPriceLib.SetPriceProjectConfig
|
|
251
|
-
storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
|
|
252
|
-
_coreContract
|
|
253
|
-
][_projectId];
|
|
254
|
-
SetPriceLib.updatePricePerTokenInWei(
|
|
255
|
-
_pricePerTokenInWei,
|
|
256
|
-
_setPriceProjectConfig
|
|
257
|
-
);
|
|
258
|
-
emit PricePerTokenInWeiUpdated(
|
|
259
|
-
_projectId,
|
|
260
|
-
_coreContract,
|
|
261
|
-
_pricePerTokenInWei
|
|
262
|
-
);
|
|
263
201
|
|
|
264
202
|
// for convenience, sync local max invocations to the core contract if
|
|
265
203
|
// and only if max invocations have not already been synced.
|
|
266
204
|
// @dev do not sync if max invocations have already been synced, as
|
|
267
205
|
// local max invocations could have been manually set to be
|
|
268
206
|
// intentionally less than the core contract's max invocations.
|
|
269
|
-
MaxInvocationsLib.MaxInvocationsProjectConfig
|
|
270
|
-
storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
|
|
271
|
-
_coreContract
|
|
272
|
-
][_projectId];
|
|
273
207
|
// @dev if local maxInvocations and maxHasBeenInvoked are both
|
|
274
208
|
// initial values, we know they have not been populated on this minter
|
|
275
209
|
if (
|
|
276
|
-
MaxInvocationsLib.maxInvocationsIsUnconfigured(
|
|
277
|
-
|
|
278
|
-
|
|
210
|
+
MaxInvocationsLib.maxInvocationsIsUnconfigured({
|
|
211
|
+
projectId: projectId,
|
|
212
|
+
coreContract: coreContract
|
|
213
|
+
})
|
|
279
214
|
) {
|
|
280
|
-
syncProjectMaxInvocationsToCore(
|
|
215
|
+
MaxInvocationsLib.syncProjectMaxInvocationsToCore({
|
|
216
|
+
projectId: projectId,
|
|
217
|
+
coreContract: coreContract
|
|
218
|
+
});
|
|
281
219
|
}
|
|
282
220
|
}
|
|
283
221
|
|
|
284
222
|
/**
|
|
285
|
-
* @notice Updates payment currency of project `
|
|
286
|
-
* contract `
|
|
287
|
-
* `
|
|
223
|
+
* @notice Updates payment currency of project `projectId` on core
|
|
224
|
+
* contract `coreContract` to be `currencySymbol` at address
|
|
225
|
+
* `currencyAddress`.
|
|
288
226
|
* Only supports ERC20 tokens - for ETH minting, use a different minter.
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
* @
|
|
227
|
+
* Resets price to be unconfigured if currency was previously configured,
|
|
228
|
+
* as a safeguard against accidentally setting a price in one currency
|
|
229
|
+
* and then changing the currency but not the price.
|
|
230
|
+
* @dev nonReentrant because no reentrant use cases, and to eliminate an
|
|
231
|
+
* entire branch of reentrancy attack vectors.
|
|
232
|
+
* @param projectId Project ID to update.
|
|
233
|
+
* @param coreContract Core contract address for the given project.
|
|
234
|
+
* @param currencySymbol Currency symbol.
|
|
235
|
+
* @param currencyAddress Currency address.
|
|
293
236
|
*/
|
|
294
237
|
function updateProjectCurrencyInfo(
|
|
295
|
-
uint256
|
|
296
|
-
address
|
|
297
|
-
string memory
|
|
298
|
-
address
|
|
238
|
+
uint256 projectId,
|
|
239
|
+
address coreContract,
|
|
240
|
+
string memory currencySymbol,
|
|
241
|
+
address currencyAddress
|
|
299
242
|
) external nonReentrant {
|
|
300
243
|
AuthLib.onlyArtist({
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
});
|
|
305
|
-
SplitFundsLib.SplitFundsProjectConfig
|
|
306
|
-
storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
|
|
307
|
-
_coreContract
|
|
308
|
-
][_projectId];
|
|
309
|
-
SplitFundsLib.updateProjectCurrencyInfoERC20({
|
|
310
|
-
_splitFundsProjectConfig: _splitFundsProjectConfig,
|
|
311
|
-
_currencySymbol: _currencySymbol,
|
|
312
|
-
_currencyAddress: _currencyAddress
|
|
313
|
-
});
|
|
314
|
-
emit ProjectCurrencyInfoUpdated({
|
|
315
|
-
_projectId: _projectId,
|
|
316
|
-
_coreContract: _coreContract,
|
|
317
|
-
_currencyAddress: _currencyAddress,
|
|
318
|
-
_currencySymbol: _currencySymbol
|
|
244
|
+
projectId: projectId,
|
|
245
|
+
coreContract: coreContract,
|
|
246
|
+
sender: msg.sender
|
|
319
247
|
});
|
|
248
|
+
bool recommendPriceReset = SplitFundsLib
|
|
249
|
+
.updateProjectCurrencyInfoERC20({
|
|
250
|
+
projectId: projectId,
|
|
251
|
+
coreContract: coreContract,
|
|
252
|
+
currencySymbol: currencySymbol,
|
|
253
|
+
currencyAddress: currencyAddress
|
|
254
|
+
});
|
|
255
|
+
if (recommendPriceReset) {
|
|
256
|
+
SetPriceLib.resetPricePerToken({
|
|
257
|
+
projectId: projectId,
|
|
258
|
+
coreContract: coreContract
|
|
259
|
+
});
|
|
260
|
+
}
|
|
320
261
|
}
|
|
321
262
|
|
|
322
263
|
/**
|
|
323
|
-
* @notice Allows holders of NFTs at addresses `
|
|
324
|
-
* project IDs `
|
|
325
|
-
* `
|
|
326
|
-
* e.g. Allows holders of project `
|
|
327
|
-
* contract `
|
|
264
|
+
* @notice Allows holders of NFTs at addresses `ownedNFTAddresses`,
|
|
265
|
+
* project IDs `ownedNFTProjectIds` to mint on project `projectId`.
|
|
266
|
+
* `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
|
|
267
|
+
* e.g. Allows holders of project `ownedNFTProjectIds[0]` on token
|
|
268
|
+
* contract `ownedNFTAddresses[0]` to mint `projectId`.
|
|
328
269
|
* WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
|
|
329
270
|
* due to assumptions about tokenId and projectId relationships.
|
|
330
|
-
* @param
|
|
331
|
-
* @param
|
|
332
|
-
* @param
|
|
333
|
-
* allowlisted. Indexes must align with `
|
|
334
|
-
* @param
|
|
335
|
-
* holders shall be allowlisted to mint project `
|
|
336
|
-
* align with `
|
|
271
|
+
* @param projectId Project ID to enable minting on.
|
|
272
|
+
* @param coreContract Core contract address for the given project.
|
|
273
|
+
* @param ownedNFTAddresses NFT core addresses of projects to be
|
|
274
|
+
* allowlisted. Indexes must align with `ownedNFTProjectIds`.
|
|
275
|
+
* @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
|
|
276
|
+
* holders shall be allowlisted to mint project `projectId`. Indexes must
|
|
277
|
+
* align with `ownedNFTAddresses`.
|
|
337
278
|
*/
|
|
338
279
|
function allowHoldersOfProjects(
|
|
339
|
-
uint256
|
|
340
|
-
address
|
|
341
|
-
address[]
|
|
342
|
-
uint256[]
|
|
280
|
+
uint256 projectId,
|
|
281
|
+
address coreContract,
|
|
282
|
+
address[] calldata ownedNFTAddresses,
|
|
283
|
+
uint256[] calldata ownedNFTProjectIds
|
|
343
284
|
) external {
|
|
344
285
|
AuthLib.onlyArtist({
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
286
|
+
projectId: projectId,
|
|
287
|
+
coreContract: coreContract,
|
|
288
|
+
sender: msg.sender
|
|
348
289
|
});
|
|
349
290
|
TokenHolderLib.allowHoldersOfProjects({
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
_ownedNFTProjectIds: _ownedNFTProjectIds
|
|
291
|
+
projectId: projectId,
|
|
292
|
+
coreContract: coreContract,
|
|
293
|
+
ownedNFTAddresses: ownedNFTAddresses,
|
|
294
|
+
ownedNFTProjectIds: ownedNFTProjectIds
|
|
355
295
|
});
|
|
356
|
-
|
|
357
|
-
// emit approve event
|
|
358
|
-
emit AllowedHoldersOfProjects(
|
|
359
|
-
_projectId,
|
|
360
|
-
_coreContract,
|
|
361
|
-
_ownedNFTAddresses,
|
|
362
|
-
_ownedNFTProjectIds
|
|
363
|
-
);
|
|
364
296
|
}
|
|
365
297
|
|
|
366
298
|
/**
|
|
367
|
-
* @notice Removes holders of NFTs at addresses `
|
|
368
|
-
* project IDs `
|
|
299
|
+
* @notice Removes holders of NFTs at addresses `ownedNFTAddresses`,
|
|
300
|
+
* project IDs `ownedNFTProjectIds` to mint on project `projectId`. If
|
|
369
301
|
* other projects owned by a holder are still allowed to mint, holder will
|
|
370
302
|
* maintain ability to purchase.
|
|
371
|
-
* `
|
|
372
|
-
* e.g. Removes holders of project `
|
|
373
|
-
* contract `
|
|
374
|
-
* @param
|
|
375
|
-
* @param
|
|
376
|
-
* @param
|
|
377
|
-
* from allowlist. Indexes must align with `
|
|
378
|
-
* @param
|
|
379
|
-
* holders will be removed from allowlist to mint project `
|
|
380
|
-
* Indexes must align with `
|
|
303
|
+
* `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
|
|
304
|
+
* e.g. Removes holders of project `ownedNFTProjectIds[0]` on token
|
|
305
|
+
* contract `ownedNFTAddresses[0]` from mint allowlist of `projectId`.
|
|
306
|
+
* @param projectId Project ID to enable minting on.
|
|
307
|
+
* @param coreContract Core contract address for the given project.
|
|
308
|
+
* @param ownedNFTAddresses NFT core addresses of projects to be removed
|
|
309
|
+
* from allowlist. Indexes must align with `ownedNFTProjectIds`.
|
|
310
|
+
* @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
|
|
311
|
+
* holders will be removed from allowlist to mint project `projectId`.
|
|
312
|
+
* Indexes must align with `ownedNFTAddresses`.
|
|
381
313
|
*/
|
|
382
314
|
function removeHoldersOfProjects(
|
|
383
|
-
uint256
|
|
384
|
-
address
|
|
385
|
-
address[]
|
|
386
|
-
uint256[]
|
|
315
|
+
uint256 projectId,
|
|
316
|
+
address coreContract,
|
|
317
|
+
address[] calldata ownedNFTAddresses,
|
|
318
|
+
uint256[] calldata ownedNFTProjectIds
|
|
387
319
|
) external {
|
|
388
320
|
AuthLib.onlyArtist({
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
321
|
+
projectId: projectId,
|
|
322
|
+
coreContract: coreContract,
|
|
323
|
+
sender: msg.sender
|
|
392
324
|
});
|
|
393
325
|
// require same length arrays
|
|
394
326
|
TokenHolderLib.removeHoldersOfProjects({
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
_ownedNFTProjectIds: _ownedNFTProjectIds
|
|
327
|
+
projectId: projectId,
|
|
328
|
+
coreContract: coreContract,
|
|
329
|
+
ownedNFTAddresses: ownedNFTAddresses,
|
|
330
|
+
ownedNFTProjectIds: ownedNFTProjectIds
|
|
400
331
|
});
|
|
401
|
-
// emit removed event
|
|
402
|
-
emit RemovedHoldersOfProjects(
|
|
403
|
-
_projectId,
|
|
404
|
-
_coreContract,
|
|
405
|
-
_ownedNFTAddresses,
|
|
406
|
-
_ownedNFTProjectIds
|
|
407
|
-
);
|
|
408
332
|
}
|
|
409
333
|
|
|
410
334
|
/**
|
|
411
|
-
* @notice Allows holders of NFTs at addresses `
|
|
412
|
-
* project IDs `
|
|
413
|
-
* Also removes holders of NFTs at addresses `
|
|
414
|
-
* project IDs `
|
|
415
|
-
* `
|
|
416
|
-
* `
|
|
417
|
-
* `
|
|
418
|
-
* e.g. Allows holders of project `
|
|
419
|
-
* contract `
|
|
420
|
-
* `
|
|
421
|
-
* `
|
|
335
|
+
* @notice Allows holders of NFTs at addresses `ownedNFTAddressesAdd`,
|
|
336
|
+
* project IDs `ownedNFTProjectIdsAdd` to mint on project `projectId`.
|
|
337
|
+
* Also removes holders of NFTs at addresses `ownedNFTAddressesRemove`,
|
|
338
|
+
* project IDs `ownedNFTProjectIdsRemove` from minting on project
|
|
339
|
+
* `projectId`.
|
|
340
|
+
* `ownedNFTAddressesAdd` assumed to be aligned with
|
|
341
|
+
* `ownedNFTProjectIdsAdd`.
|
|
342
|
+
* e.g. Allows holders of project `ownedNFTProjectIdsAdd[0]` on token
|
|
343
|
+
* contract `ownedNFTAddressesAdd[0]` to mint `projectId`.
|
|
344
|
+
* `ownedNFTAddressesRemove` also assumed to be aligned with
|
|
345
|
+
* `ownedNFTProjectIdsRemove`.
|
|
422
346
|
* WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
|
|
423
347
|
* due to assumptions about tokenId and projectId relationships.
|
|
424
|
-
* @param
|
|
425
|
-
* @param
|
|
426
|
-
* @param
|
|
427
|
-
* allowlisted. Indexes must align with `
|
|
428
|
-
* @param
|
|
429
|
-
* whose holders shall be allowlisted to mint project `
|
|
430
|
-
* must align with `
|
|
431
|
-
* @param
|
|
348
|
+
* @param projectId Project ID to enable minting on.
|
|
349
|
+
* @param coreContract Core contract address for the given project.
|
|
350
|
+
* @param ownedNFTAddressesAdd NFT core addresses of projects to be
|
|
351
|
+
* allowlisted. Indexes must align with `ownedNFTProjectIdsAdd`.
|
|
352
|
+
* @param ownedNFTProjectIdsAdd Project IDs on `ownedNFTAddressesAdd`
|
|
353
|
+
* whose holders shall be allowlisted to mint project `projectId`. Indexes
|
|
354
|
+
* must align with `ownedNFTAddressesAdd`.
|
|
355
|
+
* @param ownedNFTAddressesRemove NFT core addresses of projects to be
|
|
432
356
|
* removed from allowlist. Indexes must align with
|
|
433
|
-
* `
|
|
434
|
-
* @param
|
|
435
|
-
* `
|
|
436
|
-
* to mint project `
|
|
437
|
-
* `
|
|
357
|
+
* `ownedNFTProjectIdsRemove`.
|
|
358
|
+
* @param ownedNFTProjectIdsRemove Project IDs on
|
|
359
|
+
* `ownedNFTAddressesRemove` whose holders will be removed from allowlist
|
|
360
|
+
* to mint project `projectId`. Indexes must align with
|
|
361
|
+
* `ownedNFTAddressesRemove`.
|
|
438
362
|
* @dev if a project is included in both add and remove arrays, it will be
|
|
439
363
|
* removed.
|
|
440
364
|
*/
|
|
441
365
|
function allowAndRemoveHoldersOfProjects(
|
|
442
|
-
uint256
|
|
443
|
-
address
|
|
444
|
-
address[]
|
|
445
|
-
uint256[]
|
|
446
|
-
address[]
|
|
447
|
-
uint256[]
|
|
366
|
+
uint256 projectId,
|
|
367
|
+
address coreContract,
|
|
368
|
+
address[] calldata ownedNFTAddressesAdd,
|
|
369
|
+
uint256[] calldata ownedNFTProjectIdsAdd,
|
|
370
|
+
address[] calldata ownedNFTAddressesRemove,
|
|
371
|
+
uint256[] calldata ownedNFTProjectIdsRemove
|
|
448
372
|
) external {
|
|
449
373
|
AuthLib.onlyArtist({
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
374
|
+
projectId: projectId,
|
|
375
|
+
coreContract: coreContract,
|
|
376
|
+
sender: msg.sender
|
|
453
377
|
});
|
|
454
378
|
TokenHolderLib.allowAndRemoveHoldersOfProjects({
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
_ownedNFTProjectIdsRemove: _ownedNFTProjectIdsRemove
|
|
379
|
+
projectId: projectId,
|
|
380
|
+
coreContract: coreContract,
|
|
381
|
+
ownedNFTAddressesAdd: ownedNFTAddressesAdd,
|
|
382
|
+
ownedNFTProjectIdsAdd: ownedNFTProjectIdsAdd,
|
|
383
|
+
ownedNFTAddressesRemove: ownedNFTAddressesRemove,
|
|
384
|
+
ownedNFTProjectIdsRemove: ownedNFTProjectIdsRemove
|
|
462
385
|
});
|
|
463
|
-
|
|
464
|
-
// emit events
|
|
465
|
-
emit AllowedHoldersOfProjects(
|
|
466
|
-
_projectId,
|
|
467
|
-
_coreContract,
|
|
468
|
-
_ownedNFTAddressesAdd,
|
|
469
|
-
_ownedNFTProjectIdsAdd
|
|
470
|
-
);
|
|
471
|
-
emit RemovedHoldersOfProjects(
|
|
472
|
-
_projectId,
|
|
473
|
-
_coreContract,
|
|
474
|
-
_ownedNFTAddressesRemove,
|
|
475
|
-
_ownedNFTProjectIdsRemove
|
|
476
|
-
);
|
|
477
386
|
}
|
|
478
387
|
|
|
479
388
|
/**
|
|
480
389
|
* @notice Allows the artist to increment the minter to the next polyptych panel
|
|
481
|
-
* @param
|
|
482
|
-
* @param
|
|
390
|
+
* @param projectId Project ID to increment to its next polyptych panel
|
|
391
|
+
* @param coreContract Core contract address for the given project.
|
|
483
392
|
*/
|
|
484
393
|
function incrementPolyptychProjectPanelId(
|
|
485
|
-
uint256
|
|
486
|
-
address
|
|
394
|
+
uint256 projectId,
|
|
395
|
+
address coreContract
|
|
487
396
|
) public {
|
|
488
397
|
AuthLib.onlyArtist({
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
398
|
+
projectId: projectId,
|
|
399
|
+
coreContract: coreContract,
|
|
400
|
+
sender: msg.sender
|
|
401
|
+
});
|
|
402
|
+
PolyptychLib.incrementPolyptychProjectPanelId({
|
|
403
|
+
projectId: projectId,
|
|
404
|
+
coreContract: coreContract
|
|
492
405
|
});
|
|
493
|
-
PolyptychLib.PolyptychProjectConfig
|
|
494
|
-
storage _polyptychProjectConfig = _polyptychProjectConfigs[
|
|
495
|
-
_coreContract
|
|
496
|
-
][_projectId];
|
|
497
|
-
PolyptychLib.incrementPolyptychProjectPanelId(_polyptychProjectConfig);
|
|
498
|
-
// index the update
|
|
499
|
-
emit ConfigValueSet(
|
|
500
|
-
_projectId,
|
|
501
|
-
_coreContract,
|
|
502
|
-
PolyptychLib.POLYPTYCH_PANEL_ID,
|
|
503
|
-
_polyptychProjectConfig.polyptychPanelId
|
|
504
|
-
);
|
|
505
406
|
}
|
|
506
407
|
|
|
507
408
|
/**
|
|
508
|
-
* @notice Purchases a token from project `
|
|
509
|
-
* `
|
|
510
|
-
* token ID `
|
|
511
|
-
* @param
|
|
512
|
-
* @param
|
|
513
|
-
* @param
|
|
409
|
+
* @notice Purchases a token from project `projectId` on core contract
|
|
410
|
+
* `coreContract` using an owned NFT at address `ownedNFTAddress` and
|
|
411
|
+
* token ID `ownedNFTTokenId` as the parent token.
|
|
412
|
+
* @param projectId Project ID to mint a token on.
|
|
413
|
+
* @param coreContract Core contract address for the given project.
|
|
414
|
+
* @param maxPricePerToken Maximum price of token being allowed by the
|
|
415
|
+
* purchaser, in base units. For example, if the ERC20 token has 6
|
|
416
|
+
* decimals, an input value of `1_000_000` would represent a maximum price
|
|
417
|
+
* of `1.000000` tokens.
|
|
418
|
+
* @param currencyAddress Currency address of token.
|
|
419
|
+
* @param ownedNFTAddress ERC-721 NFT address holding the project token
|
|
514
420
|
* owned by msg.sender being used as the parent token.
|
|
515
|
-
* @param
|
|
421
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender to be
|
|
516
422
|
* used as the parent token.
|
|
517
423
|
* @return tokenId Token ID of minted token
|
|
518
424
|
*/
|
|
519
425
|
function purchase(
|
|
520
|
-
uint256
|
|
521
|
-
address
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
426
|
+
uint256 projectId,
|
|
427
|
+
address coreContract,
|
|
428
|
+
uint256 maxPricePerToken,
|
|
429
|
+
address currencyAddress,
|
|
430
|
+
address ownedNFTAddress,
|
|
431
|
+
uint256 ownedNFTTokenId
|
|
432
|
+
) external returns (uint256 tokenId) {
|
|
433
|
+
tokenId = purchaseTo({
|
|
434
|
+
to: msg.sender,
|
|
435
|
+
projectId: projectId,
|
|
436
|
+
coreContract: coreContract,
|
|
437
|
+
maxPricePerToken: maxPricePerToken,
|
|
438
|
+
currencyAddress: currencyAddress,
|
|
439
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
440
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
441
|
+
vault: address(0)
|
|
442
|
+
});
|
|
533
443
|
return tokenId;
|
|
534
444
|
}
|
|
535
445
|
|
|
536
446
|
/**
|
|
537
|
-
* @notice Purchases a token from project `
|
|
538
|
-
* `
|
|
539
|
-
* token ID `
|
|
540
|
-
* Sets the token's owner to `
|
|
541
|
-
* @param
|
|
542
|
-
* @param
|
|
543
|
-
* @param
|
|
544
|
-
* @param
|
|
447
|
+
* @notice Purchases a token from project `projectId` on core contract
|
|
448
|
+
* `coreContract` using an owned NFT at address `ownedNFTAddress` and
|
|
449
|
+
* token ID `ownedNFTTokenId` as the parent token.
|
|
450
|
+
* Sets the token's owner to `to`.
|
|
451
|
+
* @param to Address to be the new token's owner.
|
|
452
|
+
* @param projectId Project ID to mint a token on.
|
|
453
|
+
* @param coreContract Core contract address for the given project.
|
|
454
|
+
* @param maxPricePerToken Maximum price of token being allowed by the
|
|
455
|
+
* purchaser, in base units. For example, if the ERC20 token has 6
|
|
456
|
+
* decimals, an input value of `1_000_000` would represent a maximum price
|
|
457
|
+
* of `1.000000` tokens.
|
|
458
|
+
* @param currencyAddress Currency address of token.
|
|
459
|
+
* @param ownedNFTAddress ERC-721 NFT holding the project token owned by
|
|
545
460
|
* msg.sender being used as the parent token.
|
|
546
|
-
* @param
|
|
461
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
|
|
547
462
|
* as the parent token.
|
|
548
463
|
* @return tokenId Token ID of minted token
|
|
549
464
|
*/
|
|
550
465
|
function purchaseTo(
|
|
551
|
-
address
|
|
552
|
-
uint256
|
|
553
|
-
address
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
466
|
+
address to,
|
|
467
|
+
uint256 projectId,
|
|
468
|
+
address coreContract,
|
|
469
|
+
uint256 maxPricePerToken,
|
|
470
|
+
address currencyAddress,
|
|
471
|
+
address ownedNFTAddress,
|
|
472
|
+
uint256 ownedNFTTokenId
|
|
473
|
+
) external returns (uint256 tokenId) {
|
|
557
474
|
return
|
|
558
|
-
purchaseTo(
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
475
|
+
purchaseTo({
|
|
476
|
+
to: to,
|
|
477
|
+
projectId: projectId,
|
|
478
|
+
coreContract: coreContract,
|
|
479
|
+
maxPricePerToken: maxPricePerToken,
|
|
480
|
+
currencyAddress: currencyAddress,
|
|
481
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
482
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
483
|
+
vault: address(0)
|
|
484
|
+
});
|
|
566
485
|
}
|
|
567
486
|
|
|
568
487
|
// public getter functions
|
|
569
488
|
/**
|
|
570
489
|
* @notice Gets the maximum invocations project configuration.
|
|
571
|
-
* @param
|
|
572
|
-
* @param
|
|
490
|
+
* @param projectId The ID of the project whose data needs to be fetched.
|
|
491
|
+
* @param coreContract The address of the core contract.
|
|
573
492
|
* @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
|
|
574
493
|
* configuration data.
|
|
575
494
|
*/
|
|
576
495
|
function maxInvocationsProjectConfig(
|
|
577
|
-
uint256
|
|
578
|
-
address
|
|
496
|
+
uint256 projectId,
|
|
497
|
+
address coreContract
|
|
579
498
|
)
|
|
580
499
|
external
|
|
581
500
|
view
|
|
582
501
|
returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
|
|
583
502
|
{
|
|
584
|
-
return
|
|
503
|
+
return
|
|
504
|
+
MaxInvocationsLib.getMaxInvocationsProjectConfig({
|
|
505
|
+
projectId: projectId,
|
|
506
|
+
coreContract: coreContract
|
|
507
|
+
});
|
|
585
508
|
}
|
|
586
509
|
|
|
587
510
|
/**
|
|
588
511
|
* @notice Gets the set price project configuration.
|
|
589
|
-
* @param
|
|
590
|
-
* @param
|
|
512
|
+
* @param projectId The ID of the project whose data needs to be fetched.
|
|
513
|
+
* @param coreContract The address of the core contract.
|
|
591
514
|
* @return SetPriceProjectConfig struct with the fixed price project
|
|
592
515
|
* configuration data.
|
|
593
516
|
*/
|
|
594
517
|
function setPriceProjectConfig(
|
|
595
|
-
uint256
|
|
596
|
-
address
|
|
518
|
+
uint256 projectId,
|
|
519
|
+
address coreContract
|
|
597
520
|
) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
|
|
598
|
-
return
|
|
521
|
+
return
|
|
522
|
+
SetPriceLib.getSetPriceProjectConfig({
|
|
523
|
+
projectId: projectId,
|
|
524
|
+
coreContract: coreContract
|
|
525
|
+
});
|
|
599
526
|
}
|
|
600
527
|
|
|
601
528
|
/**
|
|
602
529
|
* @notice Checks if a specific NFT owner is allowed in a given project.
|
|
603
530
|
* @dev This function retrieves the allowance status of an NFT owner
|
|
604
531
|
* within a specific project from the allowedProjectHoldersMapping.
|
|
605
|
-
* @param
|
|
606
|
-
* @param
|
|
607
|
-
* @param
|
|
608
|
-
* @param
|
|
532
|
+
* @param projectId The ID of the project to check.
|
|
533
|
+
* @param coreContract Core contract address for the given project.
|
|
534
|
+
* @param ownedNFTAddress The address of the owned NFT contract.
|
|
535
|
+
* @param ownedNFTProjectId The ID of the owned NFT project.
|
|
609
536
|
* @return bool True if the NFT owner is allowed in the given project, False otherwise.
|
|
610
537
|
*/
|
|
611
538
|
function allowedProjectHolders(
|
|
612
|
-
uint256
|
|
613
|
-
address
|
|
614
|
-
address
|
|
615
|
-
uint256
|
|
539
|
+
uint256 projectId,
|
|
540
|
+
address coreContract,
|
|
541
|
+
address ownedNFTAddress,
|
|
542
|
+
uint256 ownedNFTProjectId
|
|
616
543
|
) external view returns (bool) {
|
|
617
544
|
return
|
|
618
|
-
|
|
619
|
-
.
|
|
545
|
+
TokenHolderLib
|
|
546
|
+
.getHolderProjectConfig({
|
|
547
|
+
projectId: projectId,
|
|
548
|
+
coreContract: coreContract
|
|
549
|
+
})
|
|
550
|
+
.allowedProjectHolders[ownedNFTAddress][ownedNFTProjectId];
|
|
620
551
|
}
|
|
621
552
|
|
|
622
553
|
/**
|
|
623
|
-
* @notice Returns if token is an allowlisted NFT for project `
|
|
624
|
-
* @param
|
|
625
|
-
* @param
|
|
626
|
-
* @param
|
|
627
|
-
* @param
|
|
554
|
+
* @notice Returns if token is an allowlisted NFT for project `projectId`.
|
|
555
|
+
* @param projectId Project ID to be checked.
|
|
556
|
+
* @param coreContract Core contract address for the given project.
|
|
557
|
+
* @param ownedNFTAddress ERC-721 NFT token address to be checked.
|
|
558
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID to be checked.
|
|
628
559
|
* @return bool Token is allowlisted
|
|
629
560
|
* @dev does not check if token has been used to purchase
|
|
630
561
|
* @dev assumes project ID can be derived from tokenId / 1_000_000
|
|
631
562
|
*/
|
|
632
563
|
function isAllowlistedNFT(
|
|
633
|
-
uint256
|
|
634
|
-
address
|
|
635
|
-
address
|
|
636
|
-
uint256
|
|
564
|
+
uint256 projectId,
|
|
565
|
+
address coreContract,
|
|
566
|
+
address ownedNFTAddress,
|
|
567
|
+
uint256 ownedNFTTokenId
|
|
637
568
|
) external view returns (bool) {
|
|
638
569
|
return
|
|
639
570
|
TokenHolderLib.isAllowlistedNFT({
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
_ownedNFTTokenId: _ownedNFTTokenId
|
|
571
|
+
projectId: projectId,
|
|
572
|
+
coreContract: coreContract,
|
|
573
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
574
|
+
ownedNFTTokenId: ownedNFTTokenId
|
|
645
575
|
});
|
|
646
576
|
}
|
|
647
577
|
|
|
648
578
|
/**
|
|
649
|
-
* @notice Checks if the specified `
|
|
650
|
-
* @dev This function retrieves the cached value of `
|
|
579
|
+
* @notice Checks if the specified `coreContract` is a valid engine contract.
|
|
580
|
+
* @dev This function retrieves the cached value of `isEngine` from
|
|
651
581
|
* the `isEngineCache` mapping. If the cached value is already set, it
|
|
652
|
-
* returns the cached value. Otherwise, it calls the `
|
|
653
|
-
* function from the `SplitFundsLib` library to check if `
|
|
582
|
+
* returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
|
|
583
|
+
* function from the `SplitFundsLib` library to check if `coreContract`
|
|
654
584
|
* is a valid engine contract.
|
|
655
|
-
* @dev This function will revert if the provided `
|
|
585
|
+
* @dev This function will revert if the provided `coreContract` is not
|
|
656
586
|
* a valid Engine or V3 Flagship contract.
|
|
657
|
-
* @param
|
|
658
|
-
* @return bool indicating if `
|
|
587
|
+
* @param coreContract The address of the contract to check.
|
|
588
|
+
* @return bool indicating if `coreContract` is a valid engine contract.
|
|
659
589
|
*/
|
|
660
|
-
function isEngineView(address
|
|
661
|
-
SplitFundsLib.IsEngineCache storage isEngineCache =
|
|
662
|
-
|
|
663
|
-
];
|
|
590
|
+
function isEngineView(address coreContract) external view returns (bool) {
|
|
591
|
+
SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
|
|
592
|
+
.getIsEngineCacheConfig(coreContract);
|
|
664
593
|
if (isEngineCache.isCached) {
|
|
665
594
|
return isEngineCache.isEngine;
|
|
666
595
|
} else {
|
|
667
|
-
// @dev this calls the non-modifying variant of
|
|
668
|
-
return SplitFundsLib.getV3CoreIsEngineView(
|
|
596
|
+
// @dev this calls the non-state-modifying variant of isEngine
|
|
597
|
+
return SplitFundsLib.getV3CoreIsEngineView(coreContract);
|
|
669
598
|
}
|
|
670
599
|
}
|
|
671
600
|
|
|
@@ -680,17 +609,18 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
680
609
|
* possible because the V3 core contract only allows maximum invocations
|
|
681
610
|
* to be reduced, not increased. Based on this rationale, we intentionally
|
|
682
611
|
* do not do input validation in this method as to whether or not the input
|
|
683
|
-
* @param
|
|
684
|
-
* @param
|
|
612
|
+
* @param projectId is an existing project ID.
|
|
613
|
+
* @param coreContract is an existing core contract address.
|
|
685
614
|
*/
|
|
686
615
|
function projectMaxHasBeenInvoked(
|
|
687
|
-
uint256
|
|
688
|
-
address
|
|
616
|
+
uint256 projectId,
|
|
617
|
+
address coreContract
|
|
689
618
|
) external view returns (bool) {
|
|
690
619
|
return
|
|
691
|
-
MaxInvocationsLib.getMaxHasBeenInvoked(
|
|
692
|
-
|
|
693
|
-
|
|
620
|
+
MaxInvocationsLib.getMaxHasBeenInvoked({
|
|
621
|
+
projectId: projectId,
|
|
622
|
+
coreContract: coreContract
|
|
623
|
+
});
|
|
694
624
|
}
|
|
695
625
|
|
|
696
626
|
/**
|
|
@@ -709,79 +639,84 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
709
639
|
* increased. When this happens, the minter will enable minting, allowing
|
|
710
640
|
* the core contract to enforce the max invocations check. Based on this
|
|
711
641
|
* rationale, we intentionally do not do input validation in this method as
|
|
712
|
-
* to whether or not the input `
|
|
713
|
-
* @param
|
|
714
|
-
* @param
|
|
642
|
+
* to whether or not the input `projectId` is an existing project ID.
|
|
643
|
+
* @param projectId is an existing project ID.
|
|
644
|
+
* @param coreContract is an existing core contract address.
|
|
715
645
|
*/
|
|
716
646
|
function projectMaxInvocations(
|
|
717
|
-
uint256
|
|
718
|
-
address
|
|
647
|
+
uint256 projectId,
|
|
648
|
+
address coreContract
|
|
719
649
|
) external view returns (uint256) {
|
|
720
650
|
return
|
|
721
|
-
MaxInvocationsLib.getMaxInvocations(
|
|
722
|
-
|
|
723
|
-
|
|
651
|
+
MaxInvocationsLib.getMaxInvocations({
|
|
652
|
+
projectId: projectId,
|
|
653
|
+
coreContract: coreContract
|
|
654
|
+
});
|
|
724
655
|
}
|
|
725
656
|
|
|
726
657
|
/**
|
|
727
658
|
* @notice Gets your balance of the ERC20 token currently set
|
|
728
|
-
* as the payment currency for project `
|
|
729
|
-
* contract `
|
|
730
|
-
* @param
|
|
731
|
-
* @param
|
|
659
|
+
* as the payment currency for project `projectId` in the core
|
|
660
|
+
* contract `coreContract`.
|
|
661
|
+
* @param projectId Project ID to be queried.
|
|
662
|
+
* @param coreContract The address of the core contract.
|
|
732
663
|
* @return balance Balance of ERC20
|
|
733
664
|
*/
|
|
734
665
|
function getYourBalanceOfProjectERC20(
|
|
735
|
-
uint256
|
|
736
|
-
address
|
|
666
|
+
uint256 projectId,
|
|
667
|
+
address coreContract
|
|
737
668
|
) external view returns (uint256 balance) {
|
|
738
|
-
SplitFundsLib.
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
][_projectId];
|
|
742
|
-
balance = SplitFundsLib.getERC20Balance(
|
|
743
|
-
_splitFundsProjectConfig.currencyAddress,
|
|
744
|
-
msg.sender
|
|
669
|
+
(address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20(
|
|
670
|
+
projectId,
|
|
671
|
+
coreContract
|
|
745
672
|
);
|
|
673
|
+
balance = SplitFundsLib.getERC20Balance({
|
|
674
|
+
currencyAddress: currencyAddress,
|
|
675
|
+
walletAddress: msg.sender
|
|
676
|
+
});
|
|
746
677
|
return balance;
|
|
747
678
|
}
|
|
748
679
|
|
|
749
680
|
/**
|
|
750
681
|
* @notice Gets your allowance for this minter of the ERC20
|
|
751
682
|
* token currently set as the payment currency for project
|
|
752
|
-
* `
|
|
753
|
-
* @param
|
|
754
|
-
* @param
|
|
683
|
+
* `projectId`.
|
|
684
|
+
* @param projectId Project ID to be queried.
|
|
685
|
+
* @param coreContract The address of the core contract.
|
|
755
686
|
* @return remaining Remaining allowance of ERC20
|
|
756
687
|
*/
|
|
757
688
|
function checkYourAllowanceOfProjectERC20(
|
|
758
|
-
uint256
|
|
759
|
-
address
|
|
689
|
+
uint256 projectId,
|
|
690
|
+
address coreContract
|
|
760
691
|
) external view returns (uint256 remaining) {
|
|
761
|
-
SplitFundsLib.
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
692
|
+
(address currencyAddress, ) = SplitFundsLib.getCurrencyInfoERC20({
|
|
693
|
+
projectId: projectId,
|
|
694
|
+
coreContract: coreContract
|
|
695
|
+
});
|
|
765
696
|
remaining = SplitFundsLib.getERC20Allowance({
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
697
|
+
currencyAddress: currencyAddress,
|
|
698
|
+
walletAddress: msg.sender,
|
|
699
|
+
spenderAddress: address(this)
|
|
769
700
|
});
|
|
770
701
|
return remaining;
|
|
771
702
|
}
|
|
772
703
|
|
|
773
704
|
/**
|
|
774
705
|
* @notice Gets if price of token is configured, price of minting a
|
|
775
|
-
* token on project `
|
|
706
|
+
* token on project `projectId`, and currency symbol and address to be
|
|
776
707
|
* used as payment.
|
|
777
708
|
* `isConfigured` is only true if a price has been configured, and an ERC20
|
|
778
709
|
* token has been configured.
|
|
779
|
-
* @param
|
|
780
|
-
* @param
|
|
710
|
+
* @param projectId Project ID to get price information for
|
|
711
|
+
* @param coreContract Contract address of the core contract
|
|
781
712
|
* @return isConfigured true only if token price has been configured on
|
|
782
713
|
* this minter and an ERC20 token has been configured
|
|
783
714
|
* @return tokenPriceInWei current price of token on this minter - invalid
|
|
784
|
-
* if price has not yet been configured
|
|
715
|
+
* if price has not yet been configured. Note that "in wei" is a misnomer
|
|
716
|
+
* for ERC20 tokens, but is used here for ABI consistency with the ETH
|
|
717
|
+
* minters. The value returned represents the price per token in base units.
|
|
718
|
+
* For example, if the ERC20 token has 6 decimals, an input value of
|
|
719
|
+
* `1_000_000` would represent a price of `1.000000` tokens.
|
|
785
720
|
* @return currencySymbol currency symbol for purchases of project on this
|
|
786
721
|
* minter. "UNCONFIG" if not yet configured. Note that currency symbol is
|
|
787
722
|
* defined by the artist, and is not necessarily the same as the ERC20
|
|
@@ -790,8 +725,8 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
790
725
|
* this minter. Null address if not yet configured.
|
|
791
726
|
*/
|
|
792
727
|
function getPriceInfo(
|
|
793
|
-
uint256
|
|
794
|
-
address
|
|
728
|
+
uint256 projectId,
|
|
729
|
+
address coreContract
|
|
795
730
|
)
|
|
796
731
|
external
|
|
797
732
|
view
|
|
@@ -803,164 +738,173 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
803
738
|
)
|
|
804
739
|
{
|
|
805
740
|
SetPriceLib.SetPriceProjectConfig
|
|
806
|
-
storage
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
741
|
+
storage setPriceProjectConfig_ = SetPriceLib
|
|
742
|
+
.getSetPriceProjectConfig({
|
|
743
|
+
projectId: projectId,
|
|
744
|
+
coreContract: coreContract
|
|
745
|
+
});
|
|
746
|
+
tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
|
|
810
747
|
// get currency info from SplitFundsLib
|
|
811
|
-
SplitFundsLib.
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
(currencyAddress, currencySymbol) = SplitFundsLib.getCurrencyInfoERC20(
|
|
816
|
-
_splitFundsProjectConfig
|
|
817
|
-
);
|
|
748
|
+
(currencyAddress, currencySymbol) = SplitFundsLib.getCurrencyInfoERC20({
|
|
749
|
+
projectId: projectId,
|
|
750
|
+
coreContract: coreContract
|
|
751
|
+
});
|
|
818
752
|
// report if price and ERC20 token are configured
|
|
819
753
|
// @dev currencyAddress is non-zero if an ERC20 token is configured
|
|
820
754
|
isConfigured =
|
|
821
|
-
|
|
755
|
+
setPriceProjectConfig_.priceIsConfigured &&
|
|
822
756
|
currencyAddress != address(0);
|
|
823
757
|
}
|
|
824
758
|
|
|
825
759
|
/**
|
|
826
760
|
* Gets the current polyptych panel ID for the given project.
|
|
827
|
-
* @param
|
|
828
|
-
* @param
|
|
761
|
+
* @param projectId Project ID to be queried
|
|
762
|
+
* @param coreContract Contract address of the core contract
|
|
829
763
|
* @return uint256 representing the current polyptych panel ID for the
|
|
830
764
|
* given project
|
|
831
765
|
*/
|
|
832
766
|
function getCurrentPolyptychPanelId(
|
|
833
|
-
uint256
|
|
834
|
-
address
|
|
767
|
+
uint256 projectId,
|
|
768
|
+
address coreContract
|
|
835
769
|
) external view returns (uint256) {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
770
|
+
return
|
|
771
|
+
PolyptychLib.getPolyptychPanelId({
|
|
772
|
+
projectId: projectId,
|
|
773
|
+
coreContract: coreContract
|
|
774
|
+
});
|
|
841
775
|
}
|
|
842
776
|
|
|
843
777
|
/**
|
|
844
778
|
* Gets if the hash seed for the given project has been used on a given
|
|
845
779
|
* polyptych panel id. The current polyptych panel ID for a given project
|
|
846
780
|
* can be queried via the view function `getCurrentPolyptychPanelId`.
|
|
847
|
-
* @param
|
|
848
|
-
* @param
|
|
849
|
-
* @param
|
|
850
|
-
* @param
|
|
781
|
+
* @param projectId Project ID to be queried
|
|
782
|
+
* @param coreContract Contract address of the core contract
|
|
783
|
+
* @param panelId Panel ID to be queried
|
|
784
|
+
* @param hashSeed Hash seed to be queried
|
|
851
785
|
* @return bool representing if the hash seed has been used on the given
|
|
852
786
|
* polyptych panel ID
|
|
853
787
|
*/
|
|
854
788
|
function getPolyptychPanelHashSeedIsMinted(
|
|
855
|
-
uint256
|
|
856
|
-
address
|
|
857
|
-
uint256
|
|
858
|
-
bytes12
|
|
789
|
+
uint256 projectId,
|
|
790
|
+
address coreContract,
|
|
791
|
+
uint256 panelId,
|
|
792
|
+
bytes12 hashSeed
|
|
859
793
|
) external view returns (bool) {
|
|
860
|
-
PolyptychLib.PolyptychProjectConfig
|
|
861
|
-
storage _polyptychProjectConfig = _polyptychProjectConfigs[
|
|
862
|
-
_coreContract
|
|
863
|
-
][_projectId];
|
|
864
794
|
return
|
|
865
|
-
PolyptychLib.getPolyptychPanelHashSeedIsMinted(
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
795
|
+
PolyptychLib.getPolyptychPanelHashSeedIsMinted({
|
|
796
|
+
projectId: projectId,
|
|
797
|
+
coreContract: coreContract,
|
|
798
|
+
panelId: panelId,
|
|
799
|
+
hashSeed: hashSeed
|
|
800
|
+
});
|
|
870
801
|
}
|
|
871
802
|
|
|
872
803
|
/**
|
|
873
|
-
* @notice Syncs local maximum invocations of project `
|
|
804
|
+
* @notice Syncs local maximum invocations of project `projectId` based on
|
|
874
805
|
* the value currently defined in the core contract.
|
|
875
|
-
* @param
|
|
876
|
-
* @param
|
|
806
|
+
* @param projectId Project ID to set the maximum invocations for.
|
|
807
|
+
* @param coreContract Core contract address for the given project.
|
|
877
808
|
* @dev this enables gas reduction after maxInvocations have been reached -
|
|
878
809
|
* core contracts shall still enforce a maxInvocation check during mint.
|
|
879
810
|
*/
|
|
880
811
|
function syncProjectMaxInvocationsToCore(
|
|
881
|
-
uint256
|
|
882
|
-
address
|
|
812
|
+
uint256 projectId,
|
|
813
|
+
address coreContract
|
|
883
814
|
) public {
|
|
884
815
|
AuthLib.onlyArtist({
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
816
|
+
projectId: projectId,
|
|
817
|
+
coreContract: coreContract,
|
|
818
|
+
sender: msg.sender
|
|
888
819
|
});
|
|
889
820
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
_maxInvocationsProjectConfigMapping[_coreContract][_projectId]
|
|
895
|
-
);
|
|
896
|
-
emit ProjectMaxInvocationsLimitUpdated(
|
|
897
|
-
_projectId,
|
|
898
|
-
_coreContract,
|
|
899
|
-
maxInvocations
|
|
900
|
-
);
|
|
821
|
+
MaxInvocationsLib.syncProjectMaxInvocationsToCore({
|
|
822
|
+
projectId: projectId,
|
|
823
|
+
coreContract: coreContract
|
|
824
|
+
});
|
|
901
825
|
}
|
|
902
826
|
|
|
903
827
|
/**
|
|
904
|
-
* @notice Purchases a token from project `
|
|
905
|
-
* `
|
|
906
|
-
* token ID `
|
|
907
|
-
* Sets the token's owner to `
|
|
908
|
-
* Parent token must be owned by `msg.sender`, or `
|
|
909
|
-
* is a valid delegate for `
|
|
910
|
-
* @param
|
|
911
|
-
* @param
|
|
912
|
-
* @param
|
|
913
|
-
* @param
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
* `
|
|
828
|
+
* @notice Purchases a token from project `projectId` on core contract
|
|
829
|
+
* `coreContract` using an owned NFT at address `ownedNFTAddress` and
|
|
830
|
+
* token ID `ownedNFTTokenId` as the parent token.
|
|
831
|
+
* Sets the token's owner to `to`.
|
|
832
|
+
* Parent token must be owned by `msg.sender`, or `vault` if `msg.sender`
|
|
833
|
+
* is a valid delegate for `vault`.
|
|
834
|
+
* @param to Address to be the new token's owner.
|
|
835
|
+
* @param projectId Project ID to mint a token on.
|
|
836
|
+
* @param coreContract Core contract address for the given project.
|
|
837
|
+
* @param maxPricePerToken Maximum price of token being allowed by the
|
|
838
|
+
* purchaser, in base units. For example, if the ERC20 token has 6
|
|
839
|
+
* decimals, an input value of `1_000_000` would represent a maximum price
|
|
840
|
+
* of `1.000000` tokens.
|
|
841
|
+
* @param currencyAddress Currency address of token.
|
|
842
|
+
* @param ownedNFTAddress ERC-721 NFT holding the project token owned by
|
|
843
|
+
* msg.sender or `vault` being used as the parent token.
|
|
844
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender or
|
|
845
|
+
* `vault` being used as the parent token.
|
|
917
846
|
* @return tokenId Token ID of minted token
|
|
918
847
|
*/
|
|
919
848
|
function purchaseTo(
|
|
920
|
-
address
|
|
921
|
-
uint256
|
|
922
|
-
address
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
address
|
|
926
|
-
|
|
849
|
+
address to,
|
|
850
|
+
uint256 projectId,
|
|
851
|
+
address coreContract,
|
|
852
|
+
uint256 maxPricePerToken,
|
|
853
|
+
address currencyAddress,
|
|
854
|
+
address ownedNFTAddress,
|
|
855
|
+
uint256 ownedNFTTokenId,
|
|
856
|
+
address vault
|
|
857
|
+
) public nonReentrant returns (uint256 tokenId) {
|
|
927
858
|
// CHECKS
|
|
928
|
-
|
|
929
|
-
storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
|
|
930
|
-
_coreContract
|
|
931
|
-
][_projectId];
|
|
932
|
-
MaxInvocationsLib.MaxInvocationsProjectConfig
|
|
933
|
-
storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
|
|
934
|
-
_coreContract
|
|
935
|
-
][_projectId];
|
|
936
|
-
|
|
859
|
+
// pre-mint MaxInvocationsLib checks
|
|
937
860
|
// Note that `maxHasBeenInvoked` is only checked here to reduce gas
|
|
938
861
|
// consumption after a project has been fully minted.
|
|
939
|
-
// `
|
|
862
|
+
// `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
|
|
940
863
|
// gas consumption, but if not in sync with the core contract's value,
|
|
941
864
|
// the core contract also enforces its own max invocation check during
|
|
942
865
|
// minting.
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
);
|
|
866
|
+
MaxInvocationsLib.preMintChecks({
|
|
867
|
+
projectId: projectId,
|
|
868
|
+
coreContract: coreContract
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
// pre-mint checks for set price lib, and get price per token
|
|
872
|
+
// @dev price per token is loaded into memory here for gas efficiency
|
|
873
|
+
uint256 pricePerToken = SetPriceLib.preMintChecksAndGetPrice({
|
|
874
|
+
projectId: projectId,
|
|
875
|
+
coreContract: coreContract
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
// @dev block scope to avoid stack too deep error
|
|
879
|
+
{
|
|
880
|
+
// get the currency address configured on the project
|
|
881
|
+
// @dev revert occurs during payment split if ERC20 token is not
|
|
882
|
+
// configured (i.e. address(0)), so check is not performed here
|
|
883
|
+
(address configuredCurrencyAddress, ) = SplitFundsLib
|
|
884
|
+
.getCurrencyInfoERC20({
|
|
885
|
+
projectId: projectId,
|
|
886
|
+
coreContract: coreContract
|
|
887
|
+
});
|
|
888
|
+
// validate that the currency address and symbols matches the project configured currency
|
|
889
|
+
require(
|
|
890
|
+
currencyAddress == configuredCurrencyAddress,
|
|
891
|
+
"Currency addresses must match"
|
|
892
|
+
);
|
|
893
|
+
}
|
|
947
894
|
|
|
948
|
-
//
|
|
895
|
+
// validate that the specified maximum price is greater than or equal to the price per token
|
|
949
896
|
require(
|
|
950
|
-
|
|
951
|
-
"
|
|
897
|
+
maxPricePerToken >= pricePerToken,
|
|
898
|
+
"Only max price gte token price"
|
|
952
899
|
);
|
|
953
|
-
// @dev revert occurs during payment split if ERC20 token is not
|
|
954
|
-
// configured (i.e. address(0)), so check is not performed here
|
|
955
900
|
|
|
956
901
|
// require token used to claim to be in set of allowlisted NFTs
|
|
957
902
|
require(
|
|
958
903
|
TokenHolderLib.isAllowlistedNFT({
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
_ownedNFTTokenId: _ownedNFTTokenId
|
|
904
|
+
projectId: projectId,
|
|
905
|
+
coreContract: coreContract,
|
|
906
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
907
|
+
ownedNFTTokenId: ownedNFTTokenId
|
|
964
908
|
}),
|
|
965
909
|
"Only allowlisted NFTs"
|
|
966
910
|
);
|
|
@@ -968,90 +912,86 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
968
912
|
// NOTE: delegate-vault handling **begins here**.
|
|
969
913
|
|
|
970
914
|
// handle that the vault may be either the `msg.sender` in the case
|
|
971
|
-
// that there is not a true vault, or may be `
|
|
915
|
+
// that there is not a true vault, or may be `vault` if one is
|
|
972
916
|
// provided explicitly (and it is valid).
|
|
973
|
-
address
|
|
974
|
-
if (
|
|
917
|
+
address vault_ = msg.sender;
|
|
918
|
+
if (vault != address(0)) {
|
|
975
919
|
// If a vault is provided, it must be valid, otherwise throw rather
|
|
976
920
|
// than optimistically-minting with original `msg.sender`.
|
|
977
921
|
// Note, we do not check `checkDelegateForAll` or `checkDelegateForContract` as well,
|
|
978
922
|
// as they are known to be implicitly checked by calling `checkDelegateForToken`.
|
|
979
|
-
bool isValidVault =
|
|
980
|
-
.checkDelegateForToken(
|
|
981
|
-
msg.sender,
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
);
|
|
923
|
+
bool isValidVault = _delegationRegistryContract
|
|
924
|
+
.checkDelegateForToken({
|
|
925
|
+
delegate: msg.sender,
|
|
926
|
+
vault: vault,
|
|
927
|
+
contract_: coreContract,
|
|
928
|
+
tokenId: ownedNFTTokenId
|
|
929
|
+
});
|
|
986
930
|
require(isValidVault, "Invalid delegate-vault pairing");
|
|
987
|
-
|
|
931
|
+
vault_ = vault;
|
|
988
932
|
}
|
|
989
933
|
|
|
990
934
|
// we need the new token ID in advance of the randomizer setting a token hash
|
|
991
935
|
IGenArt721CoreContractV3_Base genArtCoreContract = IGenArt721CoreContractV3_Base(
|
|
992
|
-
|
|
936
|
+
coreContract
|
|
993
937
|
);
|
|
994
|
-
(uint256
|
|
995
|
-
|
|
938
|
+
(uint256 invocations, , , , , ) = genArtCoreContract.projectStateData(
|
|
939
|
+
projectId
|
|
996
940
|
);
|
|
997
941
|
|
|
998
942
|
// EFFECTS
|
|
999
943
|
|
|
1000
944
|
// we need to store the new token ID before it is minted so the randomizer can query it
|
|
1001
|
-
// block scope to avoid stack too deep error
|
|
945
|
+
// @dev block scope to avoid stack too deep error
|
|
1002
946
|
{
|
|
1003
|
-
bytes12
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
);
|
|
947
|
+
bytes12 targetHashSeed = PolyptychLib.getTokenHashSeed({
|
|
948
|
+
coreContract: ownedNFTAddress,
|
|
949
|
+
tokenId: ownedNFTTokenId
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
PolyptychLib.validatePolyptychEffects({
|
|
953
|
+
projectId: projectId,
|
|
954
|
+
coreContract: coreContract,
|
|
955
|
+
tokenHashSeed: targetHashSeed
|
|
956
|
+
});
|
|
1007
957
|
|
|
1008
|
-
// block scope to avoid stack too deep error
|
|
958
|
+
// @dev block scope to avoid stack too deep error
|
|
1009
959
|
{
|
|
1010
|
-
|
|
1011
|
-
PolyptychLib.
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
_polyptychProjectConfig,
|
|
1017
|
-
_targetHashSeed
|
|
1018
|
-
);
|
|
960
|
+
uint256 newTokenId = (projectId * ONE_MILLION) + invocations;
|
|
961
|
+
PolyptychLib.setPolyptychHashSeed({
|
|
962
|
+
coreContract: coreContract,
|
|
963
|
+
tokenId: newTokenId, // new token ID
|
|
964
|
+
hashSeed: targetHashSeed
|
|
965
|
+
});
|
|
1019
966
|
}
|
|
1020
967
|
|
|
1021
|
-
uint256 _newTokenId = (_projectId * ONE_MILLION) + _invocations;
|
|
1022
|
-
PolyptychLib.setPolyptychHashSeed({
|
|
1023
|
-
_coreContract: _coreContract,
|
|
1024
|
-
_tokenId: _newTokenId, // new token ID
|
|
1025
|
-
_hashSeed: _targetHashSeed
|
|
1026
|
-
});
|
|
1027
|
-
|
|
1028
968
|
// once mint() is called, the polyptych randomizer will either:
|
|
1029
969
|
// 1) assign a random token hash
|
|
1030
970
|
// 2) if configured, obtain the token hash from the `polyptychSeedHashes` mapping
|
|
1031
|
-
tokenId =
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
);
|
|
971
|
+
tokenId = _minterFilter.mint_joo({
|
|
972
|
+
to: to,
|
|
973
|
+
projectId: projectId,
|
|
974
|
+
coreContract: coreContract,
|
|
975
|
+
sender: vault_
|
|
976
|
+
});
|
|
1037
977
|
|
|
1038
978
|
// NOTE: delegate-vault handling **ends here**.
|
|
1039
979
|
|
|
1040
980
|
// redundant check against reentrancy
|
|
1041
981
|
PolyptychLib.validateAssignedHashSeed({
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
982
|
+
coreContract: coreContract,
|
|
983
|
+
tokenId: tokenId,
|
|
984
|
+
targetHashSeed: targetHashSeed
|
|
1045
985
|
});
|
|
1046
986
|
}
|
|
1047
987
|
|
|
1048
|
-
MaxInvocationsLib.
|
|
1049
|
-
tokenId,
|
|
1050
|
-
|
|
1051
|
-
);
|
|
988
|
+
MaxInvocationsLib.validateMintEffectsInvocations({
|
|
989
|
+
tokenId: tokenId,
|
|
990
|
+
coreContract: coreContract
|
|
991
|
+
});
|
|
1052
992
|
|
|
1053
993
|
// INTERACTIONS
|
|
1054
|
-
// block scope to avoid stack too deep error
|
|
994
|
+
// @dev block scope to avoid stack too deep error
|
|
1055
995
|
{
|
|
1056
996
|
// require proper ownership of NFT used to redeem
|
|
1057
997
|
/**
|
|
@@ -1061,34 +1001,24 @@ contract MinterSetPricePolyptychERC20V5 is
|
|
|
1061
1001
|
* function is non-reentrant, so this is extra cautious.
|
|
1062
1002
|
*/
|
|
1063
1003
|
// @dev if the artist is the sender, then the NFT must be owned by the
|
|
1064
|
-
// recipient, otherwise the NFT must be owned by the
|
|
1004
|
+
// recipient, otherwise the NFT must be owned by the vault_
|
|
1065
1005
|
address _artist = genArtCoreContract.projectIdToArtistAddress(
|
|
1066
|
-
|
|
1006
|
+
projectId
|
|
1067
1007
|
);
|
|
1068
|
-
address targetOwner = (msg.sender == _artist) ?
|
|
1008
|
+
address targetOwner = (msg.sender == _artist) ? to : vault_;
|
|
1069
1009
|
TokenHolderLib.validateNFTOwnership({
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1010
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
1011
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
1012
|
+
targetOwner: targetOwner
|
|
1073
1013
|
});
|
|
1074
1014
|
}
|
|
1075
1015
|
|
|
1076
1016
|
// split funds
|
|
1077
|
-
bool isEngine = SplitFundsLib.isEngine(
|
|
1078
|
-
_coreContract,
|
|
1079
|
-
_isEngineCaches[_coreContract]
|
|
1080
|
-
);
|
|
1081
1017
|
// process payment in ERC20
|
|
1082
|
-
SplitFundsLib.SplitFundsProjectConfig
|
|
1083
|
-
storage _splitFundsProjectConfig = _splitFundsProjectConfigs[
|
|
1084
|
-
_coreContract
|
|
1085
|
-
][_projectId];
|
|
1086
1018
|
SplitFundsLib.splitFundsERC20({
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
_coreContract: _coreContract,
|
|
1091
|
-
_isEngine: isEngine
|
|
1019
|
+
projectId: projectId,
|
|
1020
|
+
pricePerToken: pricePerToken,
|
|
1021
|
+
coreContract: coreContract
|
|
1092
1022
|
});
|
|
1093
1023
|
|
|
1094
1024
|
return tokenId;
|