@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,11 +1,14 @@
|
|
|
1
1
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
2
|
// Created By: Art Blocks Inc.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
pragma solidity ^0.8.0;
|
|
5
5
|
|
|
6
|
-
import "
|
|
6
|
+
import {IGenArt721CoreContractV3_Base} from "../../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {ABHelpers} from "../ABHelpers.sol";
|
|
9
|
+
|
|
10
|
+
import {Math} from "@openzeppelin-4.7/contracts/utils/math/Math.sol";
|
|
11
|
+
import {SafeCast} from "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* @title Art Blocks Max Invocations Library
|
|
@@ -19,6 +22,26 @@ pragma solidity ^0.8.0;
|
|
|
19
22
|
*/
|
|
20
23
|
|
|
21
24
|
library MaxInvocationsLib {
|
|
25
|
+
using SafeCast for uint256;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @notice Local max invocations for project `projectId`, tied to core contract `coreContractAddress`,
|
|
29
|
+
* updated to `maxInvocations`.
|
|
30
|
+
* @param projectId The id of the project.
|
|
31
|
+
* @param coreContract The address of the core contract.
|
|
32
|
+
* @param maxInvocations The new max invocations limit.
|
|
33
|
+
*/
|
|
34
|
+
event ProjectMaxInvocationsLimitUpdated(
|
|
35
|
+
uint256 indexed projectId,
|
|
36
|
+
address indexed coreContract,
|
|
37
|
+
uint256 maxInvocations
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
// position of Max Invocations Lib storage, using a diamond storage pattern
|
|
41
|
+
// for this library
|
|
42
|
+
bytes32 constant MAX_INVOCATIONS_LIB_STORAGE_POSITION =
|
|
43
|
+
keccak256("maxinvocationslib.storage");
|
|
44
|
+
|
|
22
45
|
uint256 internal constant ONE_MILLION = 1_000_000;
|
|
23
46
|
|
|
24
47
|
/**
|
|
@@ -29,66 +52,93 @@ library MaxInvocationsLib {
|
|
|
29
52
|
uint24 maxInvocations;
|
|
30
53
|
}
|
|
31
54
|
|
|
55
|
+
// Diamond storage pattern is used in this library
|
|
56
|
+
struct MaxInvocationsLibStorage {
|
|
57
|
+
mapping(address coreContract => mapping(uint256 projectId => MaxInvocationsProjectConfig)) maxInvocationsProjectConfigs;
|
|
58
|
+
}
|
|
59
|
+
|
|
32
60
|
/**
|
|
33
61
|
* @notice Syncs project's max invocations to core contract value.
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
36
|
-
* @param maxInvocationsProjectConfig Data structure that holds max invocations project configuration.
|
|
37
|
-
* @return uint256 the updated max invocations.
|
|
62
|
+
* @param projectId The id of the project.
|
|
63
|
+
* @param coreContract The address of the core contract.
|
|
38
64
|
*/
|
|
39
65
|
function syncProjectMaxInvocationsToCore(
|
|
40
|
-
uint256
|
|
41
|
-
address
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
uint256 projectId,
|
|
67
|
+
address coreContract
|
|
68
|
+
) internal {
|
|
69
|
+
(
|
|
70
|
+
uint256 coreInvocations,
|
|
71
|
+
uint256 coreMaxInvocations
|
|
72
|
+
) = coreContractInvocationData({
|
|
73
|
+
projectId: projectId,
|
|
74
|
+
coreContract: coreContract
|
|
75
|
+
});
|
|
49
76
|
// update storage with results
|
|
50
|
-
|
|
77
|
+
MaxInvocationsProjectConfig
|
|
78
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
79
|
+
projectId: projectId,
|
|
80
|
+
coreContract: coreContract
|
|
81
|
+
});
|
|
82
|
+
// @dev only bugged core would return > 1e6 invocations, but safe-cast
|
|
83
|
+
// for additional overflow safety
|
|
84
|
+
maxInvocationsProjectConfig.maxInvocations = coreMaxInvocations
|
|
85
|
+
.toUint24();
|
|
51
86
|
|
|
52
87
|
// We need to ensure maxHasBeenInvoked is correctly set after manually syncing the
|
|
53
88
|
// local maxInvocations value with the core contract's maxInvocations value.
|
|
54
|
-
// This synced value of maxInvocations from the core contract will always be greater
|
|
55
|
-
// than or equal to the previous value of maxInvocations stored locally.
|
|
56
89
|
maxInvocationsProjectConfig.maxHasBeenInvoked =
|
|
57
|
-
|
|
58
|
-
|
|
90
|
+
coreInvocations == coreMaxInvocations;
|
|
91
|
+
|
|
92
|
+
emit ProjectMaxInvocationsLimitUpdated({
|
|
93
|
+
projectId: projectId,
|
|
94
|
+
coreContract: coreContract,
|
|
95
|
+
maxInvocations: coreMaxInvocations
|
|
96
|
+
});
|
|
59
97
|
}
|
|
60
98
|
|
|
61
99
|
/**
|
|
62
100
|
* @notice Manually limits project's max invocations.
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param maxInvocationsProjectConfig Data structure that holds max invocations project configuration.
|
|
101
|
+
* @param projectId The id of the project.
|
|
102
|
+
* @param coreContract The address of the core contract.
|
|
103
|
+
* @param maxInvocations The new max invocations limit.
|
|
67
104
|
*/
|
|
68
105
|
function manuallyLimitProjectMaxInvocations(
|
|
69
|
-
uint256
|
|
70
|
-
address
|
|
71
|
-
uint24
|
|
72
|
-
MaxInvocationsProjectConfig storage maxInvocationsProjectConfig
|
|
106
|
+
uint256 projectId,
|
|
107
|
+
address coreContract,
|
|
108
|
+
uint24 maxInvocations
|
|
73
109
|
) internal {
|
|
74
110
|
// CHECKS
|
|
75
111
|
(
|
|
76
112
|
uint256 coreInvocations,
|
|
77
113
|
uint256 coreMaxInvocations
|
|
78
|
-
) = coreContractInvocationData(
|
|
114
|
+
) = coreContractInvocationData({
|
|
115
|
+
projectId: projectId,
|
|
116
|
+
coreContract: coreContract
|
|
117
|
+
});
|
|
79
118
|
require(
|
|
80
|
-
|
|
119
|
+
maxInvocations <= coreMaxInvocations,
|
|
81
120
|
"Invalid max invocations"
|
|
82
121
|
);
|
|
83
|
-
require(
|
|
122
|
+
require(maxInvocations >= coreInvocations, "Invalid max invocations");
|
|
84
123
|
|
|
85
124
|
// EFFECTS
|
|
125
|
+
MaxInvocationsProjectConfig
|
|
126
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
127
|
+
projectId: projectId,
|
|
128
|
+
coreContract: coreContract
|
|
129
|
+
});
|
|
86
130
|
// update storage with results
|
|
87
|
-
maxInvocationsProjectConfig.maxInvocations = uint24(
|
|
131
|
+
maxInvocationsProjectConfig.maxInvocations = uint24(maxInvocations);
|
|
88
132
|
// We need to ensure maxHasBeenInvoked is correctly set after manually setting the
|
|
89
133
|
// local maxInvocations value.
|
|
90
134
|
maxInvocationsProjectConfig.maxHasBeenInvoked =
|
|
91
|
-
coreInvocations ==
|
|
135
|
+
coreInvocations == maxInvocations;
|
|
136
|
+
|
|
137
|
+
emit ProjectMaxInvocationsLimitUpdated({
|
|
138
|
+
projectId: projectId,
|
|
139
|
+
coreContract: coreContract,
|
|
140
|
+
maxInvocations: maxInvocations
|
|
141
|
+
});
|
|
92
142
|
}
|
|
93
143
|
|
|
94
144
|
/**
|
|
@@ -98,107 +148,122 @@ library MaxInvocationsLib {
|
|
|
98
148
|
* @dev This function checks that the token invocation is less than or
|
|
99
149
|
* equal to the local max invocations, and also updates the local
|
|
100
150
|
* maxHasBeenInvoked value.
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* invocations project configuration.
|
|
151
|
+
* @param tokenId The id of the token.
|
|
152
|
+
* @param coreContract The address of the core contract.
|
|
104
153
|
*/
|
|
105
|
-
function
|
|
106
|
-
uint256
|
|
107
|
-
|
|
154
|
+
function validateMintEffectsInvocations(
|
|
155
|
+
uint256 tokenId,
|
|
156
|
+
address coreContract
|
|
108
157
|
) internal {
|
|
158
|
+
uint256 projectId = ABHelpers.tokenIdToProjectId(tokenId);
|
|
159
|
+
MaxInvocationsProjectConfig
|
|
160
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
161
|
+
projectId: projectId,
|
|
162
|
+
coreContract: coreContract
|
|
163
|
+
});
|
|
109
164
|
// invocation is token number plus one, and will never overflow due to
|
|
110
|
-
// limit of 1e6 invocations per project.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (tokenInvocation == localMaxInvocations) {
|
|
129
|
-
maxInvocationsProjectConfig.maxHasBeenInvoked = true;
|
|
130
|
-
}
|
|
165
|
+
// limit of 1e6 invocations per project.
|
|
166
|
+
uint256 tokenInvocation = ABHelpers.tokenIdToTokenInvocation(tokenId);
|
|
167
|
+
uint256 localMaxInvocations = maxInvocationsProjectConfig
|
|
168
|
+
.maxInvocations;
|
|
169
|
+
// handle the case where the token invocation == minter local max
|
|
170
|
+
// invocations occurred on a different minter, and we have a stale
|
|
171
|
+
// local maxHasBeenInvoked value returning a false negative.
|
|
172
|
+
// @dev this is a CHECK after EFFECTS, so security was considered
|
|
173
|
+
// in detail here.
|
|
174
|
+
require(
|
|
175
|
+
tokenInvocation <= localMaxInvocations,
|
|
176
|
+
"Max invocations reached"
|
|
177
|
+
);
|
|
178
|
+
// in typical case, update the local maxHasBeenInvoked value
|
|
179
|
+
// to true if the token invocation == minter local max invocations
|
|
180
|
+
// (enables gas efficient reverts after sellout)
|
|
181
|
+
if (tokenInvocation == localMaxInvocations) {
|
|
182
|
+
maxInvocationsProjectConfig.maxHasBeenInvoked = true;
|
|
131
183
|
}
|
|
132
184
|
}
|
|
133
185
|
|
|
134
186
|
/**
|
|
135
|
-
*
|
|
187
|
+
* @notice Checks that the max invocations have not been reached for a
|
|
188
|
+
* given project. This only checks the minter's local max invocations, and
|
|
189
|
+
* does not consider the core contract's max invocations.
|
|
190
|
+
* The function reverts if the max invocations have been reached.
|
|
191
|
+
* @param projectId The id of the project.
|
|
192
|
+
* @param coreContract The address of the core contract.
|
|
193
|
+
*/
|
|
194
|
+
function preMintChecks(
|
|
195
|
+
uint256 projectId,
|
|
196
|
+
address coreContract
|
|
197
|
+
) internal view {
|
|
198
|
+
// check that max invocations have not been reached
|
|
199
|
+
MaxInvocationsProjectConfig
|
|
200
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
201
|
+
projectId: projectId,
|
|
202
|
+
coreContract: coreContract
|
|
203
|
+
});
|
|
204
|
+
require(
|
|
205
|
+
!maxInvocationsProjectConfig.maxHasBeenInvoked,
|
|
206
|
+
"Max invocations reached"
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* @notice Helper function to check if max invocations has not been initialized.
|
|
136
212
|
* Returns true if not initialized, false if initialized.
|
|
137
|
-
* @param
|
|
138
|
-
*
|
|
139
|
-
* @return bool
|
|
213
|
+
* @param projectId The id of the project.
|
|
214
|
+
* @param coreContract The address of the core contract.
|
|
140
215
|
* @dev We know a project's max invocations have never been initialized if
|
|
141
216
|
* both max invocations and maxHasBeenInvoked are still initial values.
|
|
142
217
|
* This is because if maxInvocations were ever set to zero,
|
|
143
218
|
* maxHasBeenInvoked would be set to true.
|
|
144
219
|
*/
|
|
145
220
|
function maxInvocationsIsUnconfigured(
|
|
146
|
-
|
|
221
|
+
uint256 projectId,
|
|
222
|
+
address coreContract
|
|
147
223
|
) internal view returns (bool) {
|
|
224
|
+
MaxInvocationsProjectConfig
|
|
225
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
226
|
+
projectId: projectId,
|
|
227
|
+
coreContract: coreContract
|
|
228
|
+
});
|
|
148
229
|
return
|
|
149
|
-
|
|
150
|
-
!
|
|
230
|
+
maxInvocationsProjectConfig.maxInvocations == 0 &&
|
|
231
|
+
!maxInvocationsProjectConfig.maxHasBeenInvoked;
|
|
151
232
|
}
|
|
152
233
|
|
|
153
234
|
/**
|
|
154
|
-
*
|
|
235
|
+
* @notice Function returns if invocations remain available for a given project.
|
|
155
236
|
* This function calls the core contract to get the most up-to-date
|
|
156
237
|
* invocation data (which may be useful to avoid reverts during mint).
|
|
157
238
|
* This function considers core contract max invocations, and minter local
|
|
158
239
|
* max invocations, and returns a response based on the most limiting
|
|
159
240
|
* max invocations value.
|
|
160
|
-
* @param
|
|
161
|
-
*
|
|
162
|
-
* @param _projectId The id of the project.
|
|
163
|
-
* @param _coreContract The address of the core contract.
|
|
241
|
+
* @param projectId The id of the project.
|
|
242
|
+
* @param coreContract The address of the core contract.
|
|
164
243
|
*/
|
|
165
|
-
function
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
address _coreContract
|
|
244
|
+
function invocationsRemainOnCore(
|
|
245
|
+
uint256 projectId,
|
|
246
|
+
address coreContract
|
|
169
247
|
) internal view returns (bool) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
_projectId,
|
|
176
|
-
_coreContract
|
|
177
|
-
);
|
|
178
|
-
// load minter-local max invocations into memory
|
|
179
|
-
uint256 localMaxInvocations = _maxInvocationsProjectConfig
|
|
180
|
-
.maxInvocations;
|
|
181
|
-
// invocations remain available if the core contract has not reached
|
|
182
|
-
// the most limiting max invocations, either on minter or core contract
|
|
183
|
-
uint256 limitingMaxInvocations = Math.min(
|
|
184
|
-
coreMaxInvocations,
|
|
185
|
-
localMaxInvocations
|
|
186
|
-
);
|
|
187
|
-
return coreInvocations < limitingMaxInvocations;
|
|
248
|
+
return
|
|
249
|
+
getInvocationsAvailable({
|
|
250
|
+
projectId: projectId,
|
|
251
|
+
coreContract: coreContract
|
|
252
|
+
}) != 0;
|
|
188
253
|
}
|
|
189
254
|
|
|
190
255
|
/**
|
|
191
|
-
* Pulls core contract invocation data for a given project.
|
|
256
|
+
* @notice Pulls core contract invocation data for a given project.
|
|
192
257
|
* @dev This function calls the core contract to get the invocation data
|
|
193
|
-
* @param
|
|
194
|
-
* @param
|
|
258
|
+
* @param projectId The id of the project.
|
|
259
|
+
* @param coreContract The address of the core contract.
|
|
195
260
|
* @return coreInvocations The number of invocations for the project.
|
|
196
261
|
* @return coreMaxInvocations The max invocations for the project, as
|
|
197
262
|
* defined on the core contract.
|
|
198
263
|
*/
|
|
199
264
|
function coreContractInvocationData(
|
|
200
|
-
uint256
|
|
201
|
-
address
|
|
265
|
+
uint256 projectId,
|
|
266
|
+
address coreContract
|
|
202
267
|
)
|
|
203
268
|
internal
|
|
204
269
|
view
|
|
@@ -211,67 +276,105 @@ library MaxInvocationsLib {
|
|
|
211
276
|
,
|
|
212
277
|
,
|
|
213
278
|
|
|
214
|
-
) = IGenArt721CoreContractV3_Base(
|
|
215
|
-
|
|
279
|
+
) = IGenArt721CoreContractV3_Base(coreContract).projectStateData(
|
|
280
|
+
projectId
|
|
216
281
|
);
|
|
217
282
|
}
|
|
218
283
|
|
|
219
284
|
/**
|
|
220
|
-
*
|
|
221
|
-
* @param
|
|
285
|
+
* @notice Function returns the max invocations for a given project.
|
|
286
|
+
* @param projectId The id of the project.
|
|
287
|
+
* @param coreContract The address of the core contract.
|
|
222
288
|
* to be queried.
|
|
223
289
|
*/
|
|
224
290
|
function getMaxInvocations(
|
|
225
|
-
|
|
291
|
+
uint256 projectId,
|
|
292
|
+
address coreContract
|
|
226
293
|
) internal view returns (uint256) {
|
|
227
|
-
|
|
294
|
+
MaxInvocationsProjectConfig
|
|
295
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
296
|
+
projectId: projectId,
|
|
297
|
+
coreContract: coreContract
|
|
298
|
+
});
|
|
299
|
+
return maxInvocationsProjectConfig.maxInvocations;
|
|
228
300
|
}
|
|
229
301
|
|
|
230
302
|
/**
|
|
231
|
-
*
|
|
232
|
-
* @param
|
|
303
|
+
* @notice Function returns if max has been invoked for a given project.
|
|
304
|
+
* @param projectId The id of the project.
|
|
305
|
+
* @param coreContract The address of the core contract.
|
|
233
306
|
* to be queried.
|
|
234
307
|
*/
|
|
235
308
|
function getMaxHasBeenInvoked(
|
|
236
|
-
|
|
309
|
+
uint256 projectId,
|
|
310
|
+
address coreContract
|
|
237
311
|
) internal view returns (bool) {
|
|
238
|
-
|
|
312
|
+
MaxInvocationsProjectConfig
|
|
313
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
314
|
+
projectId: projectId,
|
|
315
|
+
coreContract: coreContract
|
|
316
|
+
});
|
|
317
|
+
return maxInvocationsProjectConfig.maxHasBeenInvoked;
|
|
239
318
|
}
|
|
240
319
|
|
|
241
320
|
/**
|
|
242
|
-
*
|
|
243
|
-
* Function is
|
|
321
|
+
* @notice Function returns if a project has reached its max invocations.
|
|
322
|
+
* Function is labelled as "safe" because it checks the core contract's
|
|
244
323
|
* invocations and max invocations. If the local max invocations is greater
|
|
245
324
|
* than the core contract's max invocations, it will defer to the core
|
|
246
325
|
* contract's max invocations (since those are the limiting factor).
|
|
247
|
-
* @param
|
|
248
|
-
* @param
|
|
249
|
-
* @param _maxInvocationsProjectConfig MaxInvocationsProjectConfig struct
|
|
326
|
+
* @param projectId The id of the project.
|
|
327
|
+
* @param coreContract The address of the core contract.
|
|
250
328
|
*/
|
|
251
329
|
function projectMaxHasBeenInvokedSafe(
|
|
252
|
-
uint256
|
|
253
|
-
address
|
|
254
|
-
MaxInvocationsProjectConfig storage _maxInvocationsProjectConfig
|
|
330
|
+
uint256 projectId,
|
|
331
|
+
address coreContract
|
|
255
332
|
) internal view returns (bool) {
|
|
333
|
+
return
|
|
334
|
+
getInvocationsAvailable({
|
|
335
|
+
projectId: projectId,
|
|
336
|
+
coreContract: coreContract
|
|
337
|
+
}) == 0;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* @notice Function returns the number of invocations available for a given
|
|
342
|
+
* project. Function checks the core contract's invocations and minter's max
|
|
343
|
+
* invocations, ensuring that the most limiting value is used, even if the
|
|
344
|
+
* local minter max invocations is stale.
|
|
345
|
+
* @param projectId The id of the project.
|
|
346
|
+
* @param coreContract The address of the core contract.
|
|
347
|
+
* @return Number of invocations available for the project.
|
|
348
|
+
*/
|
|
349
|
+
function getInvocationsAvailable(
|
|
350
|
+
uint256 projectId,
|
|
351
|
+
address coreContract
|
|
352
|
+
) internal view returns (uint256) {
|
|
256
353
|
// get max invocations from core contract
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
354
|
+
(
|
|
355
|
+
uint256 coreInvocations,
|
|
356
|
+
uint256 coreMaxInvocations
|
|
357
|
+
) = coreContractInvocationData({
|
|
358
|
+
projectId: projectId,
|
|
359
|
+
coreContract: coreContract
|
|
360
|
+
});
|
|
361
|
+
MaxInvocationsProjectConfig
|
|
362
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
363
|
+
projectId: projectId,
|
|
364
|
+
coreContract: coreContract
|
|
365
|
+
});
|
|
366
|
+
uint256 limitingMaxInvocations = Math.min(
|
|
367
|
+
coreMaxInvocations,
|
|
368
|
+
maxInvocationsProjectConfig.maxInvocations // local max invocations
|
|
369
|
+
);
|
|
370
|
+
// if core invocations are greater than the limiting max invocations,
|
|
371
|
+
// return 0 since no invocations remain
|
|
372
|
+
if (coreInvocations >= limitingMaxInvocations) {
|
|
373
|
+
return 0;
|
|
271
374
|
}
|
|
272
|
-
//
|
|
273
|
-
//
|
|
274
|
-
return
|
|
375
|
+
// otherwise, return the number of invocations remaining
|
|
376
|
+
// @dev will not undeflow due to previous check
|
|
377
|
+
return limitingMaxInvocations - coreInvocations;
|
|
275
378
|
}
|
|
276
379
|
|
|
277
380
|
/**
|
|
@@ -292,30 +395,36 @@ library MaxInvocationsLib {
|
|
|
292
395
|
* be more restrictive than the core contract.
|
|
293
396
|
* @dev assumes core contract's max invocations may only be reduced, which
|
|
294
397
|
* is the case for all V3 core contracts
|
|
398
|
+
* @param projectId The id of the project.
|
|
399
|
+
* @param coreContract The address of the core contract.
|
|
295
400
|
*/
|
|
296
401
|
function refreshMaxInvocations(
|
|
297
|
-
uint256
|
|
298
|
-
address
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
402
|
+
uint256 projectId,
|
|
403
|
+
address coreContract
|
|
404
|
+
) internal {
|
|
405
|
+
MaxInvocationsProjectConfig
|
|
406
|
+
storage maxInvocationsProjectConfig = getMaxInvocationsProjectConfig({
|
|
407
|
+
projectId: projectId,
|
|
408
|
+
coreContract: coreContract
|
|
409
|
+
});
|
|
410
|
+
if (maxInvocationsIsUnconfigured(projectId, coreContract)) {
|
|
302
411
|
// populate the minter max invocation state to equal the values on
|
|
303
412
|
// the core contract (least restrictive state)
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
);
|
|
309
|
-
// return true to indicate max invocation state update
|
|
310
|
-
maxInvocationsUpdated = true;
|
|
413
|
+
syncProjectMaxInvocationsToCore({
|
|
414
|
+
projectId: projectId,
|
|
415
|
+
coreContract: coreContract
|
|
416
|
+
});
|
|
311
417
|
} else {
|
|
312
418
|
// if local max invocations were already populated, validate the local state
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
419
|
+
(
|
|
420
|
+
uint256 coreInvocations,
|
|
421
|
+
uint256 coreMaxInvocations
|
|
422
|
+
) = coreContractInvocationData({
|
|
423
|
+
projectId: projectId,
|
|
424
|
+
coreContract: coreContract
|
|
425
|
+
});
|
|
317
426
|
|
|
318
|
-
uint256 localMaxInvocations =
|
|
427
|
+
uint256 localMaxInvocations = maxInvocationsProjectConfig
|
|
319
428
|
.maxInvocations;
|
|
320
429
|
if (localMaxInvocations > coreMaxInvocations) {
|
|
321
430
|
// if local max invocations are greater than core max invocations, make
|
|
@@ -324,25 +433,57 @@ library MaxInvocationsLib {
|
|
|
324
433
|
// have been reduced since the minter's max invocations were last
|
|
325
434
|
// updated
|
|
326
435
|
// set local max invocations to core contract's max invocations
|
|
327
|
-
|
|
436
|
+
maxInvocationsProjectConfig.maxInvocations = uint24(
|
|
328
437
|
coreMaxInvocations
|
|
329
438
|
);
|
|
330
439
|
// update the minter's `maxHasBeenInvoked` state
|
|
331
|
-
|
|
440
|
+
maxInvocationsProjectConfig
|
|
332
441
|
.maxHasBeenInvoked = (coreMaxInvocations ==
|
|
333
442
|
coreInvocations);
|
|
334
|
-
|
|
335
|
-
|
|
443
|
+
emit ProjectMaxInvocationsLimitUpdated({
|
|
444
|
+
projectId: projectId,
|
|
445
|
+
coreContract: coreContract,
|
|
446
|
+
maxInvocations: coreMaxInvocations
|
|
447
|
+
});
|
|
336
448
|
} else if (coreInvocations >= localMaxInvocations) {
|
|
337
449
|
// core invocations are greater than this minter's max
|
|
338
450
|
// invocations, indicating that minting must have occurred on
|
|
339
451
|
// another minter. update the minter's `maxHasBeenInvoked` to
|
|
340
452
|
// true to prevent any false negatives on
|
|
341
453
|
// `getMaxHasBeenInvoked'
|
|
342
|
-
|
|
343
|
-
// @dev do not
|
|
454
|
+
maxInvocationsProjectConfig.maxHasBeenInvoked = true;
|
|
455
|
+
// @dev do not emit event, because we did not change the value
|
|
344
456
|
// of minter-local max invocations
|
|
345
457
|
}
|
|
346
458
|
}
|
|
347
459
|
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* @notice Loads the MaxInvocationsProjectConfig for a given project and core
|
|
463
|
+
* contract.
|
|
464
|
+
* @param projectId Project Id to get config for
|
|
465
|
+
* @param coreContract Core contract address to get config for
|
|
466
|
+
*/
|
|
467
|
+
function getMaxInvocationsProjectConfig(
|
|
468
|
+
uint256 projectId,
|
|
469
|
+
address coreContract
|
|
470
|
+
) internal view returns (MaxInvocationsProjectConfig storage) {
|
|
471
|
+
return s().maxInvocationsProjectConfigs[coreContract][projectId];
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @notice Return the storage struct for reading and writing. This library
|
|
476
|
+
* uses a diamond storage pattern when managing storage.
|
|
477
|
+
* @return storageStruct The MaxInvocationsLibStorage struct.
|
|
478
|
+
*/
|
|
479
|
+
function s()
|
|
480
|
+
internal
|
|
481
|
+
pure
|
|
482
|
+
returns (MaxInvocationsLibStorage storage storageStruct)
|
|
483
|
+
{
|
|
484
|
+
bytes32 position = MAX_INVOCATIONS_LIB_STORAGE_POSITION;
|
|
485
|
+
assembly ("memory-safe") {
|
|
486
|
+
storageStruct.slot := position
|
|
487
|
+
}
|
|
488
|
+
}
|
|
348
489
|
}
|