@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,18 +1,22 @@
|
|
|
1
1
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
2
|
// Created By: Art Blocks Inc.
|
|
3
3
|
|
|
4
|
+
// @dev fixed to specific solidity version for clarity and for more clear
|
|
5
|
+
// source code verification purposes.
|
|
4
6
|
pragma solidity 0.8.19;
|
|
5
7
|
|
|
6
|
-
import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
7
|
-
import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
|
|
8
|
-
import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
|
|
9
|
-
import "../../interfaces/v0.8.x/ICoreRegistryV1.sol";
|
|
8
|
+
import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
9
|
+
import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
|
|
10
|
+
import {IGenArt721CoreContractV3_Base} from "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
|
|
11
|
+
import {ICoreRegistryV1} from "../../interfaces/v0.8.x/ICoreRegistryV1.sol";
|
|
12
|
+
import {IAdminACLV0} from "../../interfaces/v0.8.x/IAdminACLV0.sol";
|
|
10
13
|
|
|
11
|
-
import "../../libs/v0.8.x/Bytes32Strings.sol";
|
|
14
|
+
import {Bytes32Strings} from "../../libs/v0.8.x/Bytes32Strings.sol";
|
|
12
15
|
|
|
13
|
-
import "@openzeppelin-4.7/contracts/access/Ownable.sol";
|
|
14
|
-
import "@openzeppelin-4.7/contracts/utils/structs/EnumerableMap.sol";
|
|
15
|
-
import "@openzeppelin-4.7/contracts/utils/structs/EnumerableSet.sol";
|
|
16
|
+
import {Ownable} from "@openzeppelin-4.7/contracts/access/Ownable.sol";
|
|
17
|
+
import {EnumerableMap} from "@openzeppelin-4.7/contracts/utils/structs/EnumerableMap.sol";
|
|
18
|
+
import {EnumerableSet} from "@openzeppelin-4.7/contracts/utils/structs/EnumerableSet.sol";
|
|
19
|
+
import {Math} from "@openzeppelin-4.7/contracts/utils/math/Math.sol";
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* @title MinterFilterV2
|
|
@@ -36,7 +40,6 @@ import "@openzeppelin-4.7/contracts/utils/structs/EnumerableSet.sol";
|
|
|
36
40
|
* - updateCoreRegistry
|
|
37
41
|
* - approveMinterGlobally
|
|
38
42
|
* - revokeMinterGlobally
|
|
39
|
-
* - removeMintersForProjectsOnContracts
|
|
40
43
|
* ----------------------------------------------------------------------------
|
|
41
44
|
* The following functions are restricted as allowed by each core contract's
|
|
42
45
|
* Admin ACL contract:
|
|
@@ -53,26 +56,21 @@ import "@openzeppelin-4.7/contracts/utils/structs/EnumerableSet.sol";
|
|
|
53
56
|
* registries, and other contracts that may interact with this contract.
|
|
54
57
|
*/
|
|
55
58
|
contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
56
|
-
// add Enumerable Map methods
|
|
59
|
+
// add Enumerable Map, Enumerable Set methods
|
|
57
60
|
using EnumerableMap for EnumerableMap.UintToAddressMap;
|
|
58
61
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
59
62
|
// add Bytes32Strings methods
|
|
60
63
|
using Bytes32Strings for bytes32;
|
|
61
64
|
|
|
62
|
-
///
|
|
65
|
+
/// @notice Version of this minter filter contract
|
|
66
|
+
// @dev use function minterFilterVersion to get this as a string
|
|
63
67
|
bytes32 constant MINTER_FILTER_VERSION = "v2.0.0";
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
+
/// @notice Type of this minter filter contract
|
|
70
|
+
// @dev use function minterFilterType to get this as a string
|
|
69
71
|
bytes32 constant MINTER_FILTER_TYPE = "MinterFilterV2";
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
return MINTER_FILTER_TYPE.toString();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/// Admin ACL contract for this minter filter
|
|
73
|
+
/// @notice Admin ACL contract for this minter filter
|
|
76
74
|
IAdminACLV0 public adminACLContract;
|
|
77
75
|
|
|
78
76
|
/**
|
|
@@ -80,48 +78,53 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
80
78
|
*/
|
|
81
79
|
ICoreRegistryV1 public coreRegistry;
|
|
82
80
|
|
|
83
|
-
///
|
|
81
|
+
/// @notice Minter address => qty projects across all core contracts currently
|
|
84
82
|
/// using the minter
|
|
85
|
-
mapping(address => uint256)
|
|
83
|
+
mapping(address minterAddress => uint256 numProjects)
|
|
84
|
+
public numProjectsUsingMinter;
|
|
86
85
|
|
|
87
86
|
/**
|
|
88
|
-
* Enumerable Set of globally approved minters.
|
|
87
|
+
* @notice Enumerable Set of globally approved minters.
|
|
89
88
|
* This is a Set of addresses that are approved to mint on any
|
|
90
89
|
* project, for any core contract.
|
|
91
90
|
* @dev note that contract admins can extend a separate Set of minters for
|
|
92
91
|
* their core contract via the `approveMinterForContract` function.
|
|
93
92
|
*/
|
|
94
|
-
EnumerableSet.AddressSet private
|
|
93
|
+
EnumerableSet.AddressSet private _globallyApprovedMinters;
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
|
-
* Mapping of core contract addresses to Enumerable Sets of approved
|
|
96
|
+
* @notice Mapping of core contract addresses to Enumerable Sets of approved
|
|
98
97
|
* minters for that core contract.
|
|
99
98
|
* @dev note that contract admins can extend this Set for their core
|
|
100
99
|
* contract by via the `approveMinterForContract` function, and can remove
|
|
101
100
|
* minters from this Set via the `revokeMinterForContract` function.
|
|
102
101
|
*/
|
|
103
|
-
mapping(address => EnumerableSet.AddressSet)
|
|
104
|
-
private
|
|
102
|
+
mapping(address coreContract => EnumerableSet.AddressSet approvedMintersForContract)
|
|
103
|
+
private _contractApprovedMinters;
|
|
105
104
|
|
|
106
105
|
/**
|
|
107
|
-
* Mapping of core contract addresses to Enumerable Maps of project IDs to
|
|
106
|
+
* @notice Mapping of core contract addresses to Enumerable Maps of project IDs to
|
|
108
107
|
* minter addresses.
|
|
109
108
|
*/
|
|
110
|
-
mapping(address => EnumerableMap.UintToAddressMap)
|
|
109
|
+
mapping(address coreContract => EnumerableMap.UintToAddressMap projectIdToMinterAddress)
|
|
110
|
+
private _minterForProject;
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
/**
|
|
113
|
+
* @notice Function to validate an address is non-zero.
|
|
114
|
+
* @param address_ Address to validate
|
|
115
|
+
*/
|
|
116
|
+
function _onlyNonZeroAddress(address address_) internal pure {
|
|
117
|
+
require(address_ != address(0), "Only non-zero address");
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
/**
|
|
117
121
|
* @notice Function to restrict access to only AdminACL allowed calls
|
|
118
|
-
* on
|
|
119
|
-
* @
|
|
120
|
-
* @param _selector function selector to be checked
|
|
122
|
+
* on this minter filter's admin ACL contract.
|
|
123
|
+
* @param selector function selector to be checked
|
|
121
124
|
*/
|
|
122
|
-
function _onlyAdminACL(bytes4
|
|
125
|
+
function _onlyAdminACL(bytes4 selector) internal {
|
|
123
126
|
require(
|
|
124
|
-
adminACLAllowed(msg.sender, address(this),
|
|
127
|
+
adminACLAllowed(msg.sender, address(this), selector),
|
|
125
128
|
"Only Admin ACL allowed"
|
|
126
129
|
);
|
|
127
130
|
}
|
|
@@ -130,225 +133,253 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
130
133
|
* @notice Function to restrict access to only AdminACL allowed calls
|
|
131
134
|
* on a given core contract.
|
|
132
135
|
* @dev defers to the ACL contract used by the core contract
|
|
133
|
-
* @param
|
|
134
|
-
* @param
|
|
136
|
+
* @param coreContract core contract address
|
|
137
|
+
* @param selector function selector to be checked
|
|
135
138
|
*/
|
|
136
|
-
function _onlyCoreAdminACL(
|
|
137
|
-
address _coreContract,
|
|
138
|
-
bytes4 _selector
|
|
139
|
-
) internal {
|
|
139
|
+
function _onlyCoreAdminACL(address coreContract, bytes4 selector) internal {
|
|
140
140
|
require(
|
|
141
|
-
IGenArt721CoreContractV3_Base(
|
|
142
|
-
msg.sender,
|
|
143
|
-
address(this),
|
|
144
|
-
_selector
|
|
145
|
-
),
|
|
141
|
+
IGenArt721CoreContractV3_Base(coreContract).adminACLAllowed({
|
|
142
|
+
_sender: msg.sender,
|
|
143
|
+
_contract: address(this),
|
|
144
|
+
_selector: selector
|
|
145
|
+
}),
|
|
146
146
|
"Only Core AdminACL allowed"
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
/**
|
|
151
|
+
* @notice Function to restrict access to only core AdminACL or the project artist.
|
|
152
|
+
* @dev Defers to the ACL contract used by the core contract
|
|
153
|
+
* @param coreContract core contract address
|
|
154
|
+
* @param selector function selector to be checked
|
|
155
|
+
*/
|
|
151
156
|
function _onlyCoreAdminACLOrArtist(
|
|
152
|
-
uint256
|
|
153
|
-
address
|
|
154
|
-
bytes4
|
|
157
|
+
uint256 projectId,
|
|
158
|
+
address coreContract,
|
|
159
|
+
bytes4 selector
|
|
155
160
|
) internal {
|
|
156
161
|
IGenArt721CoreContractV3_Base genArtCoreContract_Base = IGenArt721CoreContractV3_Base(
|
|
157
|
-
|
|
162
|
+
coreContract
|
|
158
163
|
);
|
|
159
164
|
require(
|
|
160
165
|
(msg.sender ==
|
|
161
|
-
genArtCoreContract_Base.projectIdToArtistAddress(
|
|
166
|
+
genArtCoreContract_Base.projectIdToArtistAddress(projectId)) ||
|
|
162
167
|
(
|
|
163
|
-
genArtCoreContract_Base.adminACLAllowed(
|
|
164
|
-
msg.sender,
|
|
165
|
-
address(this),
|
|
166
|
-
_selector
|
|
167
|
-
)
|
|
168
|
+
genArtCoreContract_Base.adminACLAllowed({
|
|
169
|
+
_sender: msg.sender,
|
|
170
|
+
_contract: address(this),
|
|
171
|
+
_selector: selector
|
|
172
|
+
})
|
|
168
173
|
),
|
|
169
174
|
"Only Artist or Core Admin ACL"
|
|
170
175
|
);
|
|
171
176
|
}
|
|
172
177
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
/**
|
|
179
|
+
* @notice Function to restrict access to only core contracts registered with the
|
|
180
|
+
* currently configured core registry. This is used to prevent non-registered core
|
|
181
|
+
* contracts from being used with this minter filter.
|
|
182
|
+
* @param coreContract core contract address
|
|
183
|
+
*/
|
|
184
|
+
function _onlyRegisteredCoreContract(address coreContract) internal view {
|
|
177
185
|
// @dev use core registry to check if core contract is registered
|
|
178
186
|
require(
|
|
179
|
-
coreRegistry.isRegisteredContract(
|
|
187
|
+
coreRegistry.isRegisteredContract(coreContract),
|
|
180
188
|
"Only registered core contract"
|
|
181
189
|
);
|
|
182
190
|
}
|
|
183
191
|
|
|
184
|
-
|
|
192
|
+
/**
|
|
193
|
+
* @notice Function to restrict access to only valid project IDs.
|
|
194
|
+
* @param projectId Project ID to validate.
|
|
195
|
+
* @param coreContract core contract address
|
|
196
|
+
*/
|
|
185
197
|
function _onlyValidProjectId(
|
|
186
|
-
uint256
|
|
187
|
-
address
|
|
198
|
+
uint256 projectId,
|
|
199
|
+
address coreContract
|
|
188
200
|
) internal view {
|
|
189
201
|
IGenArt721CoreContractV3_Base genArtCoreContract = IGenArt721CoreContractV3_Base(
|
|
190
|
-
|
|
202
|
+
coreContract
|
|
191
203
|
);
|
|
192
204
|
require(
|
|
193
|
-
(
|
|
194
|
-
(
|
|
205
|
+
(projectId >= genArtCoreContract.startingProjectId()) &&
|
|
206
|
+
(projectId < genArtCoreContract.nextProjectId()),
|
|
195
207
|
"Only valid project ID"
|
|
196
208
|
);
|
|
197
209
|
}
|
|
198
210
|
|
|
199
|
-
|
|
211
|
+
/**
|
|
212
|
+
* @notice Function to check if minter is globally approved or approved for a core contract.
|
|
213
|
+
* @param coreContract core contract address
|
|
214
|
+
* @param minter Minter to validate.
|
|
215
|
+
*/
|
|
200
216
|
function _onlyApprovedMinter(
|
|
201
|
-
address
|
|
202
|
-
address
|
|
217
|
+
address coreContract,
|
|
218
|
+
address minter
|
|
203
219
|
) internal view {
|
|
204
220
|
require(
|
|
205
|
-
isApprovedMinterForContract(
|
|
221
|
+
isApprovedMinterForContract({
|
|
222
|
+
coreContract: coreContract,
|
|
223
|
+
minter: minter
|
|
224
|
+
}),
|
|
206
225
|
"Only approved minters"
|
|
207
226
|
);
|
|
208
227
|
}
|
|
209
228
|
|
|
210
229
|
/**
|
|
211
|
-
* @notice Initializes contract to be a Minter for `
|
|
212
|
-
* @param
|
|
230
|
+
* @notice Initializes contract to be a Minter for `genArt721Address`.
|
|
231
|
+
* @param adminACLContract_ Address of admin access control contract, to be
|
|
213
232
|
* set as contract owner.
|
|
214
|
-
* @param
|
|
233
|
+
* @param coreRegistry_ Address of core registry contract.
|
|
215
234
|
*/
|
|
216
|
-
constructor(address
|
|
235
|
+
constructor(address adminACLContract_, address coreRegistry_) {
|
|
217
236
|
// set AdminACL management contract as owner
|
|
218
|
-
_transferOwnership(
|
|
237
|
+
_transferOwnership(adminACLContract_);
|
|
219
238
|
// set core registry contract
|
|
220
|
-
_updateCoreRegistry(
|
|
239
|
+
_updateCoreRegistry(coreRegistry_);
|
|
221
240
|
emit Deployed();
|
|
222
241
|
}
|
|
223
242
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
243
|
+
/**
|
|
244
|
+
* @notice returns the version of this minter filter contract
|
|
245
|
+
*/
|
|
246
|
+
function minterFilterVersion() external pure returns (string memory) {
|
|
247
|
+
return MINTER_FILTER_VERSION.toString();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @notice returns the type of this minter filter contract
|
|
252
|
+
*/
|
|
253
|
+
function minterFilterType() external pure returns (string memory) {
|
|
254
|
+
return MINTER_FILTER_TYPE.toString();
|
|
228
255
|
}
|
|
229
256
|
|
|
230
257
|
/**
|
|
231
258
|
* @notice Updates the core registry contract to be used by this contract.
|
|
232
259
|
* Only callable as allowed by AdminACL of this contract.
|
|
233
|
-
* @param
|
|
260
|
+
* @param coreRegistry_ Address of the new core registry contract.
|
|
234
261
|
*/
|
|
235
|
-
function updateCoreRegistry(address
|
|
262
|
+
function updateCoreRegistry(address coreRegistry_) external {
|
|
236
263
|
_onlyAdminACL(this.updateCoreRegistry.selector);
|
|
237
|
-
_updateCoreRegistry(
|
|
264
|
+
_updateCoreRegistry(coreRegistry_);
|
|
238
265
|
}
|
|
239
266
|
|
|
240
267
|
/**
|
|
241
|
-
* @notice Globally approves minter `
|
|
268
|
+
* @notice Globally approves minter `minter` to be available for
|
|
242
269
|
* minting on any project, for any core contract.
|
|
243
270
|
* Only callable as allowed by AdminACL of this contract.
|
|
244
271
|
* @dev Reverts if minter is already globally approved, or does not
|
|
245
272
|
* implement minterType().
|
|
246
|
-
* @param
|
|
273
|
+
* @param minter Minter to be approved.
|
|
247
274
|
*/
|
|
248
|
-
function approveMinterGlobally(address
|
|
275
|
+
function approveMinterGlobally(address minter) external {
|
|
249
276
|
_onlyAdminACL(this.approveMinterGlobally.selector);
|
|
250
|
-
// @dev add()
|
|
277
|
+
// @dev add() return true if the value was added to the set
|
|
251
278
|
require(
|
|
252
|
-
|
|
279
|
+
_globallyApprovedMinters.add(minter),
|
|
253
280
|
"Minter already approved"
|
|
254
281
|
);
|
|
255
|
-
emit MinterApprovedGlobally(
|
|
256
|
-
|
|
257
|
-
ISharedMinterV0(
|
|
258
|
-
);
|
|
282
|
+
emit MinterApprovedGlobally({
|
|
283
|
+
minter: minter,
|
|
284
|
+
minterType: ISharedMinterV0(minter).minterType()
|
|
285
|
+
});
|
|
259
286
|
}
|
|
260
287
|
|
|
261
288
|
/**
|
|
262
|
-
* @notice Removes previously globally approved minter `
|
|
289
|
+
* @notice Removes previously globally approved minter `minter`
|
|
263
290
|
* from the list of globally approved minters.
|
|
264
291
|
* Only callable as allowed by AdminACL of this contract.
|
|
265
|
-
* Reverts if minter is not globally approved
|
|
266
|
-
* in use by any project.
|
|
292
|
+
* Reverts if minter is not globally approved.
|
|
267
293
|
* @dev intentionally do not check if minter is still in use by any
|
|
268
294
|
* project, meaning that any projects currently using the minter will
|
|
269
295
|
* continue to be able to use it. If existing projects should be forced
|
|
270
296
|
* to discontinue using a minter, the minter may be removed by the minter
|
|
271
|
-
* filter admin in bulk via the `
|
|
272
|
-
*
|
|
297
|
+
* filter admin in bulk via the `removeMintersForProjectsOnContract`
|
|
298
|
+
* function.
|
|
299
|
+
* @param minter Minter to remove.
|
|
273
300
|
*/
|
|
274
|
-
function revokeMinterGlobally(address
|
|
301
|
+
function revokeMinterGlobally(address minter) external {
|
|
275
302
|
_onlyAdminACL(this.revokeMinterGlobally.selector);
|
|
276
303
|
// @dev remove() returns true only if the value was already in the Set
|
|
277
304
|
require(
|
|
278
|
-
|
|
305
|
+
_globallyApprovedMinters.remove(minter),
|
|
279
306
|
"Only previously approved minter"
|
|
280
307
|
);
|
|
281
|
-
emit MinterRevokedGlobally(
|
|
308
|
+
emit MinterRevokedGlobally(minter);
|
|
282
309
|
}
|
|
283
310
|
|
|
284
311
|
/**
|
|
285
|
-
* @notice Approves minter `
|
|
286
|
-
* any project on core contarct `
|
|
287
|
-
* Only callable as allowed by AdminACL of core contract `
|
|
312
|
+
* @notice Approves minter `minter` to be available for minting on
|
|
313
|
+
* any project on core contarct `coreContract`.
|
|
314
|
+
* Only callable as allowed by AdminACL of core contract `coreContract`.
|
|
288
315
|
* Reverts if core contract is not registered, if minter is already
|
|
289
316
|
* approved for the contract, or if minter does not implement minterType().
|
|
290
|
-
* @param
|
|
291
|
-
* @param
|
|
317
|
+
* @param coreContract Core contract to approve minter for.
|
|
318
|
+
* @param minter Minter to be approved.
|
|
292
319
|
*/
|
|
293
320
|
function approveMinterForContract(
|
|
294
|
-
address
|
|
295
|
-
address
|
|
321
|
+
address coreContract,
|
|
322
|
+
address minter
|
|
296
323
|
) external {
|
|
297
|
-
_onlyRegisteredCoreContract(
|
|
298
|
-
_onlyCoreAdminACL(
|
|
299
|
-
|
|
300
|
-
this.approveMinterForContract.selector
|
|
301
|
-
);
|
|
302
|
-
// @dev add() returns true
|
|
324
|
+
_onlyRegisteredCoreContract(coreContract);
|
|
325
|
+
_onlyCoreAdminACL({
|
|
326
|
+
coreContract: coreContract,
|
|
327
|
+
selector: this.approveMinterForContract.selector
|
|
328
|
+
});
|
|
329
|
+
// @dev add() returns true if the value was added to the Set
|
|
303
330
|
require(
|
|
304
|
-
|
|
331
|
+
_contractApprovedMinters[coreContract].add(minter),
|
|
305
332
|
"Minter already approved"
|
|
306
333
|
);
|
|
307
334
|
emit MinterApprovedForContract({
|
|
308
|
-
coreContract:
|
|
309
|
-
minter:
|
|
310
|
-
minterType: ISharedMinterV0(
|
|
335
|
+
coreContract: coreContract,
|
|
336
|
+
minter: minter,
|
|
337
|
+
minterType: ISharedMinterV0(minter).minterType()
|
|
311
338
|
});
|
|
312
339
|
}
|
|
313
340
|
|
|
314
341
|
/**
|
|
315
|
-
* @notice Removes previously approved minter `
|
|
316
|
-
* list of approved minters on core contract `
|
|
317
|
-
* Only callable as allowed by AdminACL of core contract `
|
|
342
|
+
* @notice Removes previously approved minter `minter` from the
|
|
343
|
+
* list of approved minters on core contract `coreContract`.
|
|
344
|
+
* Only callable as allowed by AdminACL of core contract `coreContract`.
|
|
318
345
|
* Reverts if core contract is not registered, or if minter is not approved
|
|
319
346
|
* on contract.
|
|
320
347
|
* @dev intentionally does not check if minter is still in use by any
|
|
321
348
|
* project, meaning that any projects currently using the minter will
|
|
322
349
|
* continue to be able to use it. If existing projects should be forced
|
|
323
350
|
* to discontinue using a minter, the minter may be removed by the contract
|
|
324
|
-
* admin in bulk via the `
|
|
325
|
-
* @param
|
|
351
|
+
* admin in bulk via the `removeMintersForProjectsOnContract` function.
|
|
352
|
+
* @param coreContract Core contract to remove minter from.
|
|
353
|
+
* @param minter Minter to remove.
|
|
326
354
|
*/
|
|
327
355
|
function revokeMinterForContract(
|
|
328
|
-
address
|
|
329
|
-
address
|
|
356
|
+
address coreContract,
|
|
357
|
+
address minter
|
|
330
358
|
) external {
|
|
331
|
-
_onlyRegisteredCoreContract(
|
|
332
|
-
_onlyCoreAdminACL(
|
|
359
|
+
_onlyRegisteredCoreContract(coreContract);
|
|
360
|
+
_onlyCoreAdminACL({
|
|
361
|
+
coreContract: coreContract,
|
|
362
|
+
selector: this.revokeMinterForContract.selector
|
|
363
|
+
});
|
|
333
364
|
// @dev intentionally do not check if minter is still in use by any
|
|
334
365
|
// project, since it is possible that a different contract's project is
|
|
335
366
|
// using the minter
|
|
336
367
|
// @dev remove() returns true only if the value was already in the Set
|
|
337
368
|
require(
|
|
338
|
-
|
|
369
|
+
_contractApprovedMinters[coreContract].remove(minter),
|
|
339
370
|
"Only previously approved minter"
|
|
340
371
|
);
|
|
341
372
|
emit MinterRevokedForContract({
|
|
342
|
-
coreContract:
|
|
343
|
-
minter:
|
|
373
|
+
coreContract: coreContract,
|
|
374
|
+
minter: minter
|
|
344
375
|
});
|
|
345
376
|
}
|
|
346
377
|
|
|
347
378
|
/**
|
|
348
|
-
* @notice Sets minter for project `
|
|
349
|
-
* to minter `
|
|
379
|
+
* @notice Sets minter for project `projectId` on contract `coreContract`
|
|
380
|
+
* to minter `minter`.
|
|
350
381
|
* Only callable by the project's artist or as allowed by AdminACL of
|
|
351
|
-
* core contract `
|
|
382
|
+
* core contract `coreContract`.
|
|
352
383
|
* Reverts if:
|
|
353
384
|
* - core contract is not registered
|
|
354
385
|
* - minter is not approved globally on this minter filter or for the
|
|
@@ -357,91 +388,98 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
357
388
|
* - function is called by an address other than the project's artist
|
|
358
389
|
* or a sender allowed by the core contract's admin ACL
|
|
359
390
|
* - minter does not implement minterType()
|
|
360
|
-
* @param
|
|
361
|
-
* @param
|
|
362
|
-
* @param
|
|
391
|
+
* @param projectId Project ID to set minter for.
|
|
392
|
+
* @param coreContract Core contract of project.
|
|
393
|
+
* @param minter Minter to be the project's minter.
|
|
363
394
|
*/
|
|
364
395
|
function setMinterForProject(
|
|
365
|
-
uint256
|
|
366
|
-
address
|
|
367
|
-
address
|
|
396
|
+
uint256 projectId,
|
|
397
|
+
address coreContract,
|
|
398
|
+
address minter
|
|
368
399
|
) external {
|
|
369
400
|
/// CHECKS
|
|
370
|
-
_onlyRegisteredCoreContract(
|
|
371
|
-
_onlyCoreAdminACLOrArtist(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
this.setMinterForProject.selector
|
|
375
|
-
);
|
|
376
|
-
_onlyApprovedMinter(
|
|
377
|
-
_onlyValidProjectId(
|
|
401
|
+
_onlyRegisteredCoreContract(coreContract);
|
|
402
|
+
_onlyCoreAdminACLOrArtist({
|
|
403
|
+
projectId: projectId,
|
|
404
|
+
coreContract: coreContract,
|
|
405
|
+
selector: this.setMinterForProject.selector
|
|
406
|
+
});
|
|
407
|
+
_onlyApprovedMinter({coreContract: coreContract, minter: minter});
|
|
408
|
+
_onlyValidProjectId({projectId: projectId, coreContract: coreContract});
|
|
378
409
|
/// EFFECTS
|
|
379
410
|
// decrement number of projects using a previous minter
|
|
380
|
-
(bool hasPreviousMinter, address previousMinter) =
|
|
381
|
-
|
|
382
|
-
].tryGet(
|
|
411
|
+
(bool hasPreviousMinter, address previousMinter) = _minterForProject[
|
|
412
|
+
coreContract
|
|
413
|
+
].tryGet(projectId);
|
|
383
414
|
if (hasPreviousMinter) {
|
|
384
415
|
numProjectsUsingMinter[previousMinter]--;
|
|
385
416
|
}
|
|
386
417
|
// assign new minter
|
|
387
|
-
numProjectsUsingMinter[
|
|
388
|
-
|
|
418
|
+
numProjectsUsingMinter[minter]++;
|
|
419
|
+
_minterForProject[coreContract].set(projectId, minter);
|
|
389
420
|
emit ProjectMinterRegistered({
|
|
390
|
-
projectId:
|
|
391
|
-
coreContract:
|
|
392
|
-
minter:
|
|
393
|
-
minterType: ISharedMinterV0(
|
|
421
|
+
projectId: projectId,
|
|
422
|
+
coreContract: coreContract,
|
|
423
|
+
minter: minter,
|
|
424
|
+
minterType: ISharedMinterV0(minter).minterType()
|
|
394
425
|
});
|
|
395
426
|
}
|
|
396
427
|
|
|
397
428
|
/**
|
|
398
|
-
* @notice Updates project `
|
|
429
|
+
* @notice Updates project `projectId` on contract `coreContract` to have
|
|
399
430
|
* no configured minter.
|
|
400
431
|
* Only callable by the project's artist or as allowed by AdminACL of
|
|
401
|
-
* core contract `
|
|
432
|
+
* core contract `coreContract`.
|
|
402
433
|
* Reverts if:
|
|
403
434
|
* - core contract is not registered
|
|
404
435
|
* - project does not already have a minter assigned
|
|
405
436
|
* - function is called by an address other than the project's artist
|
|
406
437
|
* or a sender allowed by the core contract's admin ACL
|
|
407
|
-
* @param
|
|
408
|
-
* @param
|
|
438
|
+
* @param projectId Project ID to remove minter for.
|
|
439
|
+
* @param coreContract Core contract of project.
|
|
409
440
|
* @dev requires project to have an assigned minter
|
|
410
441
|
*/
|
|
411
442
|
function removeMinterForProject(
|
|
412
|
-
uint256
|
|
413
|
-
address
|
|
443
|
+
uint256 projectId,
|
|
444
|
+
address coreContract
|
|
414
445
|
) external {
|
|
415
|
-
_onlyRegisteredCoreContract(
|
|
416
|
-
_onlyCoreAdminACLOrArtist(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
this.removeMinterForProject.selector
|
|
420
|
-
);
|
|
446
|
+
_onlyRegisteredCoreContract(coreContract);
|
|
447
|
+
_onlyCoreAdminACLOrArtist({
|
|
448
|
+
projectId: projectId,
|
|
449
|
+
coreContract: coreContract,
|
|
450
|
+
selector: this.removeMinterForProject.selector
|
|
451
|
+
});
|
|
421
452
|
// @dev this will revert if project does not have a minter
|
|
422
|
-
_removeMinterForProject(
|
|
453
|
+
_removeMinterForProject({
|
|
454
|
+
projectId: projectId,
|
|
455
|
+
coreContract: coreContract
|
|
456
|
+
});
|
|
423
457
|
}
|
|
424
458
|
|
|
425
459
|
/**
|
|
426
460
|
* @notice Updates an array of project IDs to have no configured minter.
|
|
427
|
-
* Only callable as allowed by AdminACL of core contract `
|
|
461
|
+
* Only callable as allowed by AdminACL of core contract `coreContract`.
|
|
428
462
|
* Reverts if the core contract is not registered, or if any project does
|
|
429
463
|
* not already have a minter assigned.
|
|
430
|
-
* @param
|
|
464
|
+
* @param projectIds Array of project IDs to remove minters for.
|
|
465
|
+
* @param coreContract Core contract of projects.
|
|
431
466
|
* @dev caution with respect to single tx gas limits
|
|
432
467
|
*/
|
|
433
468
|
function removeMintersForProjectsOnContract(
|
|
434
|
-
uint256[] calldata
|
|
435
|
-
address
|
|
469
|
+
uint256[] calldata projectIds,
|
|
470
|
+
address coreContract
|
|
436
471
|
) external {
|
|
437
|
-
_onlyRegisteredCoreContract(
|
|
438
|
-
_onlyCoreAdminACL(
|
|
439
|
-
|
|
440
|
-
this.removeMintersForProjectsOnContract.selector
|
|
441
|
-
);
|
|
442
|
-
uint256 numProjects =
|
|
472
|
+
_onlyRegisteredCoreContract(coreContract);
|
|
473
|
+
_onlyCoreAdminACL({
|
|
474
|
+
coreContract: coreContract,
|
|
475
|
+
selector: this.removeMintersForProjectsOnContract.selector
|
|
476
|
+
});
|
|
477
|
+
uint256 numProjects = projectIds.length;
|
|
443
478
|
for (uint256 i; i < numProjects; ) {
|
|
444
|
-
_removeMinterForProject(
|
|
479
|
+
_removeMinterForProject({
|
|
480
|
+
projectId: projectIds[i],
|
|
481
|
+
coreContract: coreContract
|
|
482
|
+
});
|
|
445
483
|
unchecked {
|
|
446
484
|
++i;
|
|
447
485
|
}
|
|
@@ -449,12 +487,12 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
449
487
|
}
|
|
450
488
|
|
|
451
489
|
/**
|
|
452
|
-
* @notice Mint a token from project `
|
|
453
|
-
* `
|
|
454
|
-
* @param
|
|
455
|
-
* @param
|
|
456
|
-
* @param
|
|
457
|
-
* @param
|
|
490
|
+
* @notice Mint a token from project `projectId` on contract
|
|
491
|
+
* `coreContract` to `to`, originally purchased by `sender`.
|
|
492
|
+
* @param to The new token's owner.
|
|
493
|
+
* @param projectId Project ID to mint a new token on.
|
|
494
|
+
* @param sender Address purchasing a new token.
|
|
495
|
+
* @param coreContract Core contract of project.
|
|
458
496
|
* @return tokenId Token ID of minted token
|
|
459
497
|
* @dev reverts w/nonexistent key error when project has no assigned minter
|
|
460
498
|
* @dev does not check if core contract is registered, for gas efficiency
|
|
@@ -465,32 +503,32 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
465
503
|
* @dev function name is optimized for gas.
|
|
466
504
|
*/
|
|
467
505
|
function mint_joo(
|
|
468
|
-
address
|
|
469
|
-
uint256
|
|
470
|
-
address
|
|
471
|
-
address
|
|
506
|
+
address to,
|
|
507
|
+
uint256 projectId,
|
|
508
|
+
address coreContract,
|
|
509
|
+
address sender
|
|
472
510
|
) external returns (uint256 tokenId) {
|
|
473
511
|
// CHECKS
|
|
474
512
|
// minter is the project's minter
|
|
475
513
|
require(
|
|
476
|
-
msg.sender ==
|
|
514
|
+
msg.sender == _minterForProject[coreContract].get(projectId),
|
|
477
515
|
"Only assigned minter"
|
|
478
516
|
);
|
|
479
517
|
// INTERACTIONS
|
|
480
|
-
tokenId = IGenArt721CoreContractV3_Base(
|
|
481
|
-
_to,
|
|
482
|
-
_projectId,
|
|
483
|
-
|
|
484
|
-
);
|
|
518
|
+
tokenId = IGenArt721CoreContractV3_Base(coreContract).mint_Ecf({
|
|
519
|
+
_to: to,
|
|
520
|
+
_projectId: projectId,
|
|
521
|
+
_by: sender
|
|
522
|
+
});
|
|
485
523
|
return tokenId;
|
|
486
524
|
}
|
|
487
525
|
|
|
488
526
|
/**
|
|
489
|
-
* @notice Gets the assigned minter for project `
|
|
490
|
-
* contract `
|
|
527
|
+
* @notice Gets the assigned minter for project `projectId` on core
|
|
528
|
+
* contract `coreContract`.
|
|
491
529
|
* Reverts if project does not have an assigned minter.
|
|
492
|
-
* @param
|
|
493
|
-
* @param
|
|
530
|
+
* @param projectId Project ID to query.
|
|
531
|
+
* @param coreContract Core contract of project.
|
|
494
532
|
* @return address Minter address assigned to project
|
|
495
533
|
* @dev requires project to have an assigned minter
|
|
496
534
|
* @dev this function intentionally does not check that the core contract
|
|
@@ -498,21 +536,22 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
498
536
|
* project was assigned a minter
|
|
499
537
|
*/
|
|
500
538
|
function getMinterForProject(
|
|
501
|
-
uint256
|
|
502
|
-
address
|
|
539
|
+
uint256 projectId,
|
|
540
|
+
address coreContract
|
|
503
541
|
) external view returns (address) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
542
|
+
// @dev use tryGet to control revert message if no minter assigned
|
|
543
|
+
(bool hasMinter, address currentMinter) = _minterForProject[
|
|
544
|
+
coreContract
|
|
545
|
+
].tryGet(projectId);
|
|
507
546
|
require(hasMinter, "No minter assigned");
|
|
508
547
|
return currentMinter;
|
|
509
548
|
}
|
|
510
549
|
|
|
511
550
|
/**
|
|
512
|
-
* @notice Queries if project `
|
|
551
|
+
* @notice Queries if project `projectId` on core contract `coreContract`
|
|
513
552
|
* has an assigned minter.
|
|
514
|
-
* @param
|
|
515
|
-
* @param
|
|
553
|
+
* @param projectId Project ID to query.
|
|
554
|
+
* @param coreContract Core contract of project.
|
|
516
555
|
* @return bool true if project has an assigned minter, else false
|
|
517
556
|
* @dev requires project to have an assigned minter
|
|
518
557
|
* @dev this function intentionally does not check that the core contract
|
|
@@ -520,35 +559,35 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
520
559
|
* project was assigned a minter
|
|
521
560
|
*/
|
|
522
561
|
function projectHasMinter(
|
|
523
|
-
uint256
|
|
524
|
-
address
|
|
562
|
+
uint256 projectId,
|
|
563
|
+
address coreContract
|
|
525
564
|
) external view returns (bool) {
|
|
526
|
-
(bool hasMinter, ) =
|
|
565
|
+
(bool hasMinter, ) = _minterForProject[coreContract].tryGet(projectId);
|
|
527
566
|
return hasMinter;
|
|
528
567
|
}
|
|
529
568
|
|
|
530
569
|
/**
|
|
531
570
|
* @notice Gets quantity of projects on a given core contract that have
|
|
532
571
|
* assigned minters.
|
|
533
|
-
* @param
|
|
572
|
+
* @param coreContract Core contract to query.
|
|
534
573
|
* @return uint256 quantity of projects that have assigned minters
|
|
535
574
|
* @dev this function intentionally does not check that the core contract
|
|
536
575
|
* is registered, since it must have been registered at the time the
|
|
537
576
|
* project was assigned a minter
|
|
538
577
|
*/
|
|
539
578
|
function getNumProjectsOnContractWithMinters(
|
|
540
|
-
address
|
|
579
|
+
address coreContract
|
|
541
580
|
) external view returns (uint256) {
|
|
542
|
-
return
|
|
581
|
+
return _minterForProject[coreContract].length();
|
|
543
582
|
}
|
|
544
583
|
|
|
545
584
|
/**
|
|
546
|
-
* @notice Get project ID and minter address at index `
|
|
585
|
+
* @notice Get project ID and minter address at index `index` of
|
|
547
586
|
* enumerable map.
|
|
548
|
-
* @param
|
|
549
|
-
* @param
|
|
550
|
-
* @return projectId project ID at index `
|
|
551
|
-
* @return minterAddress minter address for project at index `
|
|
587
|
+
* @param coreContract Core contract to query.
|
|
588
|
+
* @param index enumerable map index to query.
|
|
589
|
+
* @return projectId project ID at index `index`
|
|
590
|
+
* @return minterAddress minter address for project at index `index`
|
|
552
591
|
* @return minterType minter type of minter at minterAddress
|
|
553
592
|
* @dev index must be < quantity of projects that have assigned minters,
|
|
554
593
|
* otherwise reverts
|
|
@@ -558,8 +597,8 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
558
597
|
* project was assigned a minter
|
|
559
598
|
*/
|
|
560
599
|
function getProjectAndMinterInfoOnContractAt(
|
|
561
|
-
address
|
|
562
|
-
uint256
|
|
600
|
+
address coreContract,
|
|
601
|
+
uint256 index
|
|
563
602
|
)
|
|
564
603
|
external
|
|
565
604
|
view
|
|
@@ -570,65 +609,65 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
570
609
|
)
|
|
571
610
|
{
|
|
572
611
|
// @dev at() reverts if index is out of bounds
|
|
573
|
-
(projectId, minterAddress) =
|
|
612
|
+
(projectId, minterAddress) = _minterForProject[coreContract].at(index);
|
|
574
613
|
minterType = ISharedMinterV0(minterAddress).minterType();
|
|
575
|
-
return (projectId, minterAddress, minterType);
|
|
576
614
|
}
|
|
577
615
|
|
|
578
616
|
/**
|
|
579
617
|
* @notice View that returns if a core contract is registered with the
|
|
580
618
|
* core registry, allowing this minter filter to service it.
|
|
581
|
-
* @param
|
|
619
|
+
* @param coreContract core contract address to be checked
|
|
582
620
|
* @return bool true if core contract is registered, else false
|
|
583
621
|
*/
|
|
584
622
|
function isRegisteredCoreContract(
|
|
585
|
-
address
|
|
623
|
+
address coreContract
|
|
586
624
|
) external view override returns (bool) {
|
|
587
|
-
return coreRegistry.isRegisteredContract(
|
|
625
|
+
return coreRegistry.isRegisteredContract(coreContract);
|
|
588
626
|
}
|
|
589
627
|
|
|
590
628
|
/**
|
|
591
|
-
* @notice Gets all projects on core contract `
|
|
592
|
-
* using minter `
|
|
629
|
+
* @notice Gets all projects on core contract `coreContract` that are
|
|
630
|
+
* using minter `minter`.
|
|
593
631
|
* Warning: Unbounded gas limit. This function is gas-intensive and should
|
|
594
632
|
* only be used for off-chain queries. Alternatively, the subgraph indexing
|
|
595
633
|
* layer may be used to query these values.
|
|
596
|
-
* @param
|
|
597
|
-
* @param
|
|
634
|
+
* @param coreContract core contract to query
|
|
635
|
+
* @param minter minter to query
|
|
598
636
|
*/
|
|
599
637
|
function getProjectsOnContractUsingMinter(
|
|
600
|
-
address
|
|
601
|
-
address
|
|
638
|
+
address coreContract,
|
|
639
|
+
address minter
|
|
602
640
|
) external view returns (uint256[] memory projectIds) {
|
|
641
|
+
EnumerableMap.UintToAddressMap storage minterMap = _minterForProject[
|
|
642
|
+
coreContract
|
|
643
|
+
];
|
|
603
644
|
// initialize arrays with maximum potential length
|
|
604
|
-
// @dev use num projects using minter across all contracts
|
|
605
|
-
//
|
|
606
|
-
|
|
645
|
+
// @dev use lesser of num projects using minter across all contracts
|
|
646
|
+
// and number of projects on the contract with minters assigned, since
|
|
647
|
+
// both values represent an upper bound on the number of projects that
|
|
648
|
+
// could be using the minter on the contract
|
|
649
|
+
uint256 maxNumProjects = Math.min(
|
|
650
|
+
numProjectsUsingMinter[minter],
|
|
651
|
+
minterMap.length()
|
|
652
|
+
);
|
|
607
653
|
projectIds = new uint256[](maxNumProjects);
|
|
608
654
|
// iterate over all projects on contract, adding to array if using
|
|
609
|
-
// `
|
|
610
|
-
EnumerableMap.UintToAddressMap storage minterMap = minterForProject[
|
|
611
|
-
_coreContract
|
|
612
|
-
];
|
|
655
|
+
// `minter`
|
|
613
656
|
uint256 numProjects = minterMap.length();
|
|
614
657
|
uint256 numProjectsOnContractUsingMinter;
|
|
615
658
|
for (uint256 i; i < numProjects; ) {
|
|
616
|
-
(uint256 projectId, address
|
|
617
|
-
if (minter == _minter) {
|
|
618
|
-
projectIds[numProjectsOnContractUsingMinter++] = projectId;
|
|
619
|
-
}
|
|
659
|
+
(uint256 projectId, address minter_) = minterMap.at(i);
|
|
620
660
|
unchecked {
|
|
661
|
+
if (minter_ == minter) {
|
|
662
|
+
projectIds[numProjectsOnContractUsingMinter++] = projectId;
|
|
663
|
+
}
|
|
621
664
|
++i;
|
|
622
665
|
}
|
|
623
666
|
}
|
|
624
667
|
// trim array if necessary
|
|
625
668
|
if (maxNumProjects > numProjectsOnContractUsingMinter) {
|
|
626
|
-
assembly {
|
|
627
|
-
|
|
628
|
-
maxNumProjects,
|
|
629
|
-
numProjectsOnContractUsingMinter
|
|
630
|
-
)
|
|
631
|
-
mstore(projectIds, sub(mload(projectIds), decrease))
|
|
669
|
+
assembly ("memory-safe") {
|
|
670
|
+
mstore(projectIds, numProjectsOnContractUsingMinter)
|
|
632
671
|
}
|
|
633
672
|
}
|
|
634
673
|
return projectIds;
|
|
@@ -651,11 +690,11 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
651
690
|
returns (MinterWithType[] memory mintersWithTypes)
|
|
652
691
|
{
|
|
653
692
|
// initialize arrays with appropriate length
|
|
654
|
-
uint256 numMinters =
|
|
693
|
+
uint256 numMinters = _globallyApprovedMinters.length();
|
|
655
694
|
mintersWithTypes = new MinterWithType[](numMinters);
|
|
656
695
|
// iterate over all globally approved minters, adding to array
|
|
657
696
|
for (uint256 i; i < numMinters; ) {
|
|
658
|
-
address minterAddress =
|
|
697
|
+
address minterAddress = _globallyApprovedMinters.at(i);
|
|
659
698
|
// @dev we know minterType() does not revert, because it was called
|
|
660
699
|
// when globally approving the minter
|
|
661
700
|
string memory minterType = ISharedMinterV0(minterAddress)
|
|
@@ -676,24 +715,24 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
676
715
|
* address and minter type.
|
|
677
716
|
* This function has unbounded gas, and should only be used for off-chain
|
|
678
717
|
* queries.
|
|
679
|
-
* @param
|
|
718
|
+
* @param coreContract Core contract to query.
|
|
680
719
|
* @return mintersWithTypes Array of MinterWithType structs, which contain
|
|
681
720
|
* the minter address and minter type.
|
|
682
721
|
*/
|
|
683
722
|
function getAllContractApprovedMinters(
|
|
684
|
-
address
|
|
723
|
+
address coreContract
|
|
685
724
|
) external view returns (MinterWithType[] memory mintersWithTypes) {
|
|
686
725
|
// initialize arrays with appropriate length
|
|
687
726
|
EnumerableSet.AddressSet
|
|
688
|
-
storage
|
|
689
|
-
|
|
727
|
+
storage contractApprovedMinters = _contractApprovedMinters[
|
|
728
|
+
coreContract
|
|
690
729
|
];
|
|
691
|
-
uint256 numMinters =
|
|
730
|
+
uint256 numMinters = contractApprovedMinters.length();
|
|
692
731
|
mintersWithTypes = new MinterWithType[](numMinters);
|
|
693
732
|
// iterate over all minters approved for a given contract, adding to
|
|
694
733
|
// array
|
|
695
734
|
for (uint256 i; i < numMinters; ) {
|
|
696
|
-
address minterAddress =
|
|
735
|
+
address minterAddress = contractApprovedMinters.at(i);
|
|
697
736
|
// @dev we know minterType() does not revert, because it was called
|
|
698
737
|
// when approving the minter for a contract
|
|
699
738
|
string memory minterType = ISharedMinterV0(minterAddress)
|
|
@@ -709,58 +748,61 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
709
748
|
}
|
|
710
749
|
|
|
711
750
|
/**
|
|
712
|
-
* @notice Convenience function that returns whether `
|
|
713
|
-
* to call function with selector `
|
|
751
|
+
* @notice Convenience function that returns whether `sender` is allowed
|
|
752
|
+
* to call function with selector `selector` on contract `contract`, as
|
|
714
753
|
* determined by this contract's current Admin ACL contract. Expected use
|
|
715
754
|
* cases include minter contracts checking if caller is allowed to call
|
|
716
755
|
* admin-gated functions on minter contracts.
|
|
717
|
-
* @param
|
|
718
|
-
* `
|
|
719
|
-
* @param
|
|
720
|
-
* @param
|
|
721
|
-
* `
|
|
722
|
-
* @return bool Whether `
|
|
723
|
-
* `
|
|
756
|
+
* @param sender Address of the sender calling function with selector
|
|
757
|
+
* `selector` on contract `contract`.
|
|
758
|
+
* @param contract_ Address of the contract being called by `sender`.
|
|
759
|
+
* @param selector Function selector of the function being called by
|
|
760
|
+
* `sender`.
|
|
761
|
+
* @return bool Whether `sender` is allowed to call function with selector
|
|
762
|
+
* `selector` on contract `contract`.
|
|
724
763
|
* @dev assumes the Admin ACL contract is the owner of this contract, which
|
|
725
764
|
* is expected to always be true.
|
|
726
|
-
* @dev adminACLContract is expected to
|
|
727
|
-
*
|
|
728
|
-
*
|
|
765
|
+
* @dev adminACLContract is expected to not be null address (owner cannot
|
|
766
|
+
* renounce ownership on this contract), and conform to IAdminACLV0
|
|
767
|
+
* interface.
|
|
729
768
|
*/
|
|
730
769
|
function adminACLAllowed(
|
|
731
|
-
address
|
|
732
|
-
address
|
|
733
|
-
bytes4
|
|
770
|
+
address sender,
|
|
771
|
+
address contract_,
|
|
772
|
+
bytes4 selector
|
|
734
773
|
) public returns (bool) {
|
|
735
774
|
return
|
|
736
|
-
|
|
737
|
-
|
|
775
|
+
adminACLContract.allowed({
|
|
776
|
+
_sender: sender,
|
|
777
|
+
_contract: contract_,
|
|
778
|
+
_selector: selector
|
|
779
|
+
});
|
|
738
780
|
}
|
|
739
781
|
|
|
740
782
|
/**
|
|
741
|
-
* @notice Returns whether `
|
|
783
|
+
* @notice Returns whether `minter` is globally approved to mint tokens
|
|
742
784
|
* on any contract.
|
|
743
|
-
* @param
|
|
785
|
+
* @param minter Address of minter to check.
|
|
744
786
|
*/
|
|
745
787
|
function isGloballyApprovedMinter(
|
|
746
|
-
address
|
|
788
|
+
address minter
|
|
747
789
|
) public view returns (bool) {
|
|
748
|
-
return
|
|
790
|
+
return _globallyApprovedMinters.contains(minter);
|
|
749
791
|
}
|
|
750
792
|
|
|
751
793
|
/**
|
|
752
|
-
* @notice Returns whether `
|
|
753
|
-
* core contract `
|
|
754
|
-
* @param
|
|
755
|
-
* @param
|
|
794
|
+
* @notice Returns whether `minter` is approved to mint tokens on
|
|
795
|
+
* core contract `coreContract`.
|
|
796
|
+
* @param coreContract Address of core contract to check.
|
|
797
|
+
* @param minter Address of minter to check.
|
|
756
798
|
*/
|
|
757
799
|
function isApprovedMinterForContract(
|
|
758
|
-
address
|
|
759
|
-
address
|
|
800
|
+
address coreContract,
|
|
801
|
+
address minter
|
|
760
802
|
) public view returns (bool) {
|
|
761
803
|
return
|
|
762
|
-
isGloballyApprovedMinter(
|
|
763
|
-
|
|
804
|
+
isGloballyApprovedMinter(minter) ||
|
|
805
|
+
_contractApprovedMinters[coreContract].contains(minter);
|
|
764
806
|
}
|
|
765
807
|
|
|
766
808
|
/**
|
|
@@ -779,52 +821,59 @@ contract MinterFilterV2 is Ownable, IMinterFilterV1 {
|
|
|
779
821
|
return Ownable.owner();
|
|
780
822
|
}
|
|
781
823
|
|
|
824
|
+
/// @dev override to prevent renouncing ownership
|
|
825
|
+
/// @dev not permission gated since this immediately reverts
|
|
826
|
+
function renounceOwnership() public pure override {
|
|
827
|
+
revert("Cannot renounce ownership");
|
|
828
|
+
}
|
|
829
|
+
|
|
782
830
|
/**
|
|
783
|
-
* @notice Updates project `
|
|
831
|
+
* @notice Updates project `projectId` to have no configured minter
|
|
784
832
|
* Reverts if project does not already have an assigned minter.
|
|
785
|
-
* @param
|
|
833
|
+
* @param projectId Project ID to remove minter.
|
|
834
|
+
* @param coreContract Core contract of project.
|
|
786
835
|
* @dev requires project to have an assigned minter
|
|
787
836
|
* @dev this function intentionally does not check that the core contract
|
|
788
837
|
* is registered, since it must have been registered at the time the
|
|
789
838
|
* project was assigned a minter
|
|
790
839
|
*/
|
|
791
840
|
function _removeMinterForProject(
|
|
792
|
-
uint256
|
|
793
|
-
address
|
|
841
|
+
uint256 projectId,
|
|
842
|
+
address coreContract
|
|
794
843
|
) internal {
|
|
795
844
|
// remove minter for project and emit
|
|
796
845
|
// @dev `minterForProject.get()` reverts tx if no minter set for project
|
|
797
846
|
numProjectsUsingMinter[
|
|
798
|
-
|
|
799
|
-
_projectId,
|
|
800
|
-
"No minter assigned"
|
|
801
|
-
)
|
|
847
|
+
_minterForProject[coreContract].get(projectId, "No minter assigned")
|
|
802
848
|
]--;
|
|
803
|
-
|
|
804
|
-
emit ProjectMinterRemoved(
|
|
849
|
+
_minterForProject[coreContract].remove(projectId);
|
|
850
|
+
emit ProjectMinterRemoved({
|
|
851
|
+
projectId: projectId,
|
|
852
|
+
coreContract: coreContract
|
|
853
|
+
});
|
|
805
854
|
}
|
|
806
855
|
|
|
807
856
|
/**
|
|
808
|
-
* @notice Transfers ownership of the contract to a new account (`
|
|
857
|
+
* @notice Transfers ownership of the contract to a new account (`owner`).
|
|
809
858
|
* Internal function without access restriction.
|
|
810
|
-
* @param
|
|
859
|
+
* @param owner_ New owner.
|
|
811
860
|
* @dev owner role was called `admin` prior to V3 core contract.
|
|
812
861
|
* @dev Overrides and wraps OpenZeppelin's _transferOwnership function to
|
|
813
862
|
* also update adminACLContract for improved introspection.
|
|
814
863
|
*/
|
|
815
|
-
function _transferOwnership(address
|
|
816
|
-
Ownable._transferOwnership(
|
|
817
|
-
adminACLContract = IAdminACLV0(
|
|
864
|
+
function _transferOwnership(address owner_) internal override {
|
|
865
|
+
Ownable._transferOwnership(owner_);
|
|
866
|
+
adminACLContract = IAdminACLV0(owner_);
|
|
818
867
|
}
|
|
819
868
|
|
|
820
869
|
/**
|
|
821
870
|
* @notice Updates this contract's core registry contract to
|
|
822
|
-
* `
|
|
823
|
-
* @param
|
|
871
|
+
* `coreRegistry`.
|
|
872
|
+
* @param coreRegistry_ New core registry contract address.
|
|
824
873
|
*/
|
|
825
|
-
function _updateCoreRegistry(address
|
|
826
|
-
_onlyNonZeroAddress(
|
|
827
|
-
coreRegistry = ICoreRegistryV1(
|
|
828
|
-
emit CoreRegistryUpdated(
|
|
874
|
+
function _updateCoreRegistry(address coreRegistry_) internal {
|
|
875
|
+
_onlyNonZeroAddress(coreRegistry_);
|
|
876
|
+
coreRegistry = ICoreRegistryV1(coreRegistry_);
|
|
877
|
+
emit CoreRegistryUpdated(coreRegistry_);
|
|
829
878
|
}
|
|
830
879
|
}
|