@artblocks/contracts 1.1.0 → 1.2.1
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 +86 -34
- package/artifacts/contracts/AdminACLV0.sol/AdminACLV0.json +2 -2
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol/BytecodeStorageReaderContractV2.json +201 -0
- package/artifacts/contracts/BytecodeStorageReaders/UniversalBytecodeStorageReader.sol/UniversalBytecodeStorageReader.json +154 -0
- package/artifacts/contracts/BytecodeStorageV2Writer.sol/BytecodeStorageV2Writer.json +87 -0
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +403 -155
- package/artifacts/contracts/GenArt721CoreV3_Curated.sol/GenArt721CoreV3_Curated.json +2493 -0
- package/artifacts/contracts/OwnedCreate2FactoryV0.sol/OwnedCreate2FactoryV0.json +311 -0
- package/artifacts/contracts/archive/GenArt721CoreV3.sol/GenArt721CoreV3.json +2060 -0
- package/artifacts/contracts/archive/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +2034 -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/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +3 -3
- 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 +54 -49
- 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 +624 -0
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +613 -216
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +805 -206
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +51 -8
- 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 +51 -8
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +59 -54
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +2 -2
- package/artifacts/contracts/generator/AddressChunks.sol/AddressChunks.json +10 -0
- package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/GenArt721GeneratorV0.json +333 -0
- package/artifacts/contracts/generator/GenArt721GeneratorV0.sol/ILegacyGenArt721CoreV2_PBAB_Flex.json +47 -0
- package/artifacts/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol/IAdminACLV0_Extended.json +140 -0
- package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +7 -7
- package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol/IBytecodeStorageReaderV2.json +130 -0
- package/artifacts/contracts/interfaces/v0.8.x/IBytecodeStorageReader_Base.sol/IBytecodeStorageReader_Base.json +30 -0
- package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +13 -0
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +228 -45
- 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 +53 -48
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +53 -48
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +198 -90
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +198 -90
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.sol/IGenArt721CoreContractV3_Engine_Flex_PreV3p2.json +1065 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_PreV3p2.sol/IGenArt721CoreContractV3_Engine_PreV3p2.json +778 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_ProjectFinance.sol/IGenArt721CoreContractV3_ProjectFinance.json +87 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV0.sol/IGenArt721CoreProjectScriptV0.json +59 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV1.sol/IGenArt721CoreProjectScriptV1.json +64 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV0.sol/IGenArt721CoreTokenHashProviderV0.json +30 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV1.sol/IGenArt721CoreTokenHashProviderV1.json +30 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721GeneratorV0.sol/IGenArt721GeneratorV0.json +63 -0
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol/IGenArt721Minter_PBAB.json +279 -0
- package/artifacts/contracts/interfaces/v0.8.x/IOwnedCreate2FactoryV0.sol/IOwnedCreate2FactoryV0.json +74 -0
- package/artifacts/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
- package/artifacts/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol/ISeaDropShimForContract.json +37 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +18 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMinPriceV0.sol/ISharedMinterMinPriceV0.json +37 -0
- 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 +1 -1
- 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/IUniversalBytecodeStorageReader.sol/IUniversalBytecodeStorageReader.json +56 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ERC721SeaDropStructsErrorsAndEvents.sol/ERC721SeaDropStructsErrorsAndEvents.json +43 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/INonFungibleSeaDropToken.sol/INonFungibleSeaDropToken.json +715 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDrop.sol/ISeaDrop.json +1571 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDropTokenContractMetadata.sol/ISeaDropTokenContractMetadata.json +345 -0
- package/artifacts/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropErrorsAndEvents.sol/SeaDropErrorsAndEvents.json +717 -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/JsonStatic.sol/JsonStatic.json +10 -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 +195 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MinPriceLib.sol/MinPriceLib.json +24 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/RAMLib.sol/RAMLib.json +398 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol/MinterMinPriceMerkleV0.json +664 -0
- package/artifacts/contracts/minter-suite/Minters/MinterMinPriceV0.sol/MinterMinPriceV0.json +387 -0
- package/artifacts/contracts/minter-suite/Minters/MinterRAMV0.sol/MinterRAMV0.json +1374 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +7 -7
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol/MinterSetPriceV5_SingleCore.json +417 -0
- package/artifacts/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol/SeaDropXArtBlocksShim.json +1206 -0
- package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +2 -2
- 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/ERC20MockAltDecimals.sol/ERC20MockAltDecimals.json +318 -0
- package/artifacts/contracts/mock/ForceSendMock.sol/ForceSendMock.json +24 -0
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
- 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/MockFileStore.sol/MockFileStore.json +35 -0
- 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 +2 -2
- package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +2 -2
- package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +2 -2
- package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +2 -2
- 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 +2 -2
- 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/BytecodeStorageReaders/BytecodeStorageReaderContractV2.sol +103 -0
- package/contracts/BytecodeStorageReaders/UniversalBytecodeStorageReader.sol +70 -0
- package/contracts/BytecodeStorageV2Writer.sol +69 -0
- package/contracts/DependencyRegistryV0.sol +878 -430
- package/contracts/GenArt721CoreV3_Curated.sol +133 -0
- package/contracts/OwnedCreate2FactoryV0.sol +173 -0
- 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 +8 -8
- 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 +427 -0
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +977 -502
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +1137 -663
- package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +3 -3
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +1 -1
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +2 -2
- package/contracts/generator/AddressChunks.sol +106 -0
- package/contracts/generator/GenArt721GeneratorV0.sol +1094 -0
- package/contracts/generator/scripty-support/Scripty.sol +5 -0
- package/contracts/interfaces/v0.8.x/IAdminACLV0_Extended.sol +20 -0
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReader.sol +34 -36
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReaderV2.sol +25 -0
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReader_Base.sol +20 -0
- package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +5 -0
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +141 -45
- 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 +126 -11
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol +86 -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/IGenArt721CoreProjectScriptV0.sol +22 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreProjectScriptV1.sol +23 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV0.sol +11 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreTokenHashProviderV1.sol +9 -0
- package/contracts/interfaces/v0.8.x/IGenArt721GeneratorV0.sol +14 -0
- package/contracts/interfaces/v0.8.x/IGenArt721Minter_PBAB.sol +91 -0
- package/contracts/interfaces/v0.8.x/IOwnedCreate2FactoryV0.sol +40 -0
- package/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol +1 -3
- package/contracts/interfaces/v0.8.x/ISeaDropShimForContract.sol +19 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +19 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterMinPriceV0.sol +22 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterRAMV0.sol +23 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterRequired.sol +26 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +1 -4
- package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +12 -6
- 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/IUniversalBytecodeStorageReader.sol +28 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ERC721SeaDropStructsErrorsAndEvents.sol +58 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/INonFungibleSeaDropToken.sol +186 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDrop.sol +337 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/ISeaDropTokenContractMetadata.sol +152 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropErrorsAndEvents.sol +320 -0
- package/contracts/interfaces/v0.8.x/integration-refs/OpenSea/SeaDropStructs.sol +146 -0
- package/contracts/interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol +62 -0
- package/contracts/libs/v0.8.x/ABHelpers.sol +18 -4
- 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 +20 -0
- package/contracts/libs/v0.8.x/DependencyRegistryStorageLib.sol +98 -0
- package/contracts/libs/v0.8.x/ERC721_PackedHashSeedV1.sol +591 -0
- package/contracts/libs/v0.8.x/JsonStatic.sol +373 -0
- package/contracts/libs/v0.8.x/PackedBools.sol +42 -0
- package/contracts/libs/v0.8.x/V3FlexLib.sol +597 -0
- package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +10 -12
- package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +4 -9
- package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +44 -44
- package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +64 -63
- package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +14 -10
- package/contracts/libs/v0.8.x/minter-libs/MinPriceLib.sol +64 -0
- package/contracts/libs/v0.8.x/minter-libs/RAMLib.sol +2927 -0
- package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +60 -62
- package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +4 -8
- package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +92 -89
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +128 -15
- package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +5 -4
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +16 -10
- package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +2 -2
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +19 -15
- package/contracts/minter-suite/Minters/MinterDAExpV5.sol +2 -2
- package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +2 -2
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +2 -2
- package/contracts/minter-suite/Minters/MinterMinPriceMerkleV0.sol +765 -0
- package/contracts/minter-suite/Minters/MinterMinPriceV0.sol +462 -0
- package/contracts/minter-suite/Minters/MinterRAMV0.sol +1205 -0
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +21 -32
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +17 -8
- package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +2 -2
- package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +2 -2
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +23 -9
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +2 -2
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +2 -2
- package/contracts/minter-suite/Minters/one-off/MinterSetPriceV5_SingleCore.sol +446 -0
- package/contracts/minter-suite/Minters/one-off/SeaDropXArtBlocksShim.sol +869 -0
- package/contracts/mock/BytecodeV2LibCallsMock.sol +128 -0
- package/contracts/mock/BytecodeV2TextCR_DMock.sol +316 -0
- package/contracts/mock/ERC20MockAltDecimals.sol +31 -0
- package/contracts/mock/ForceSendMock.sol +22 -0
- 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/MockFileStore.sol +22 -0
- package/contracts/mock/ReentrancyGenArt721MinterMock.sol +47 -0
- package/contracts/mock/ReentrancySplitterMocks.sol +67 -0
- package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +1 -1
- 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 +66 -36
- 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/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/archive/readme.md +0 -16
- package/contracts/engine/README.md +0 -21
- package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +0 -168
- package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +0 -221
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// @dev file is sourced from OpenSea's repository: https://github.com/ProjectOpenSea/seadrop/blob/main/src/lib/SeaDropErrorsAndEvents.sol
|
|
3
|
+
// @dev modified to not lock to specific version, as well as updated imports for this repository
|
|
4
|
+
pragma solidity ^0.8.17;
|
|
5
|
+
|
|
6
|
+
import {PublicDrop, TokenGatedDropStage, SignedMintValidationParams} from "./SeaDropStructs.sol";
|
|
7
|
+
|
|
8
|
+
interface SeaDropErrorsAndEvents {
|
|
9
|
+
/**
|
|
10
|
+
* @dev Revert with an error if the drop stage is not active.
|
|
11
|
+
*/
|
|
12
|
+
error NotActive(
|
|
13
|
+
uint256 currentTimestamp,
|
|
14
|
+
uint256 startTimestamp,
|
|
15
|
+
uint256 endTimestamp
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @dev Revert with an error if the mint quantity is zero.
|
|
20
|
+
*/
|
|
21
|
+
error MintQuantityCannotBeZero();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @dev Revert with an error if the mint quantity exceeds the max allowed
|
|
25
|
+
* to be minted per wallet.
|
|
26
|
+
*/
|
|
27
|
+
error MintQuantityExceedsMaxMintedPerWallet(uint256 total, uint256 allowed);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @dev Revert with an error if the mint quantity exceeds the max token
|
|
31
|
+
* supply.
|
|
32
|
+
*/
|
|
33
|
+
error MintQuantityExceedsMaxSupply(uint256 total, uint256 maxSupply);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @dev Revert with an error if the mint quantity exceeds the max token
|
|
37
|
+
* supply for the stage.
|
|
38
|
+
* Note: The `maxTokenSupplyForStage` for public mint is
|
|
39
|
+
* always `type(uint).max`.
|
|
40
|
+
*/
|
|
41
|
+
error MintQuantityExceedsMaxTokenSupplyForStage(
|
|
42
|
+
uint256 total,
|
|
43
|
+
uint256 maxTokenSupplyForStage
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @dev Revert if the fee recipient is the zero address.
|
|
48
|
+
*/
|
|
49
|
+
error FeeRecipientCannotBeZeroAddress();
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @dev Revert if the fee recipient is not already included.
|
|
53
|
+
*/
|
|
54
|
+
error FeeRecipientNotPresent();
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @dev Revert if the fee basis points is greater than 10_000.
|
|
58
|
+
*/
|
|
59
|
+
error InvalidFeeBps(uint256 feeBps);
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @dev Revert if the fee recipient is already included.
|
|
63
|
+
*/
|
|
64
|
+
error DuplicateFeeRecipient();
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @dev Revert if the fee recipient is restricted and not allowed.
|
|
68
|
+
*/
|
|
69
|
+
error FeeRecipientNotAllowed();
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @dev Revert if the creator payout address is the zero address.
|
|
73
|
+
*/
|
|
74
|
+
error CreatorPayoutAddressCannotBeZeroAddress();
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @dev Revert with an error if the received payment is incorrect.
|
|
78
|
+
*/
|
|
79
|
+
error IncorrectPayment(uint256 got, uint256 want);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @dev Revert with an error if the allow list proof is invalid.
|
|
83
|
+
*/
|
|
84
|
+
error InvalidProof();
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @dev Revert if a supplied signer address is the zero address.
|
|
88
|
+
*/
|
|
89
|
+
error SignerCannotBeZeroAddress();
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @dev Revert with an error if signer's signature is invalid.
|
|
93
|
+
*/
|
|
94
|
+
error InvalidSignature(address recoveredSigner);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @dev Revert with an error if a signer is not included in
|
|
98
|
+
* the enumeration when removing.
|
|
99
|
+
*/
|
|
100
|
+
error SignerNotPresent();
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @dev Revert with an error if a payer is not included in
|
|
104
|
+
* the enumeration when removing.
|
|
105
|
+
*/
|
|
106
|
+
error PayerNotPresent();
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @dev Revert with an error if a payer is already included in mapping
|
|
110
|
+
* when adding.
|
|
111
|
+
* Note: only applies when adding a single payer, as duplicates in
|
|
112
|
+
* enumeration can be removed with updatePayer.
|
|
113
|
+
*/
|
|
114
|
+
error DuplicatePayer();
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @dev Revert with an error if the payer is not allowed. The minter must
|
|
118
|
+
* pay for their own mint.
|
|
119
|
+
*/
|
|
120
|
+
error PayerNotAllowed();
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @dev Revert if a supplied payer address is the zero address.
|
|
124
|
+
*/
|
|
125
|
+
error PayerCannotBeZeroAddress();
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @dev Revert with an error if the sender does not
|
|
129
|
+
* match the INonFungibleSeaDropToken interface.
|
|
130
|
+
*/
|
|
131
|
+
error OnlyINonFungibleSeaDropToken(address sender);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @dev Revert with an error if the sender of a token gated supplied
|
|
135
|
+
* drop stage redeem is not the owner of the token.
|
|
136
|
+
*/
|
|
137
|
+
error TokenGatedNotTokenOwner(
|
|
138
|
+
address nftContract,
|
|
139
|
+
address allowedNftToken,
|
|
140
|
+
uint256 allowedNftTokenId
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @dev Revert with an error if the token id has already been used to
|
|
145
|
+
* redeem a token gated drop stage.
|
|
146
|
+
*/
|
|
147
|
+
error TokenGatedTokenIdAlreadyRedeemed(
|
|
148
|
+
address nftContract,
|
|
149
|
+
address allowedNftToken,
|
|
150
|
+
uint256 allowedNftTokenId
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @dev Revert with an error if an empty TokenGatedDropStage is provided
|
|
155
|
+
* for an already-empty TokenGatedDropStage.
|
|
156
|
+
*/
|
|
157
|
+
error TokenGatedDropStageNotPresent();
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @dev Revert with an error if an allowedNftToken is set to
|
|
161
|
+
* the zero address.
|
|
162
|
+
*/
|
|
163
|
+
error TokenGatedDropAllowedNftTokenCannotBeZeroAddress();
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* @dev Revert with an error if an allowedNftToken is set to
|
|
167
|
+
* the drop token itself.
|
|
168
|
+
*/
|
|
169
|
+
error TokenGatedDropAllowedNftTokenCannotBeDropToken();
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @dev Revert with an error if supplied signed mint price is less than
|
|
173
|
+
* the minimum specified.
|
|
174
|
+
*/
|
|
175
|
+
error InvalidSignedMintPrice(uint256 got, uint256 minimum);
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @dev Revert with an error if supplied signed maxTotalMintableByWallet
|
|
179
|
+
* is greater than the maximum specified.
|
|
180
|
+
*/
|
|
181
|
+
error InvalidSignedMaxTotalMintableByWallet(uint256 got, uint256 maximum);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @dev Revert with an error if supplied signed start time is less than
|
|
185
|
+
* the minimum specified.
|
|
186
|
+
*/
|
|
187
|
+
error InvalidSignedStartTime(uint256 got, uint256 minimum);
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @dev Revert with an error if supplied signed end time is greater than
|
|
191
|
+
* the maximum specified.
|
|
192
|
+
*/
|
|
193
|
+
error InvalidSignedEndTime(uint256 got, uint256 maximum);
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @dev Revert with an error if supplied signed maxTokenSupplyForStage
|
|
197
|
+
* is greater than the maximum specified.
|
|
198
|
+
*/
|
|
199
|
+
error InvalidSignedMaxTokenSupplyForStage(uint256 got, uint256 maximum);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @dev Revert with an error if supplied signed feeBps is greater than
|
|
203
|
+
* the maximum specified, or less than the minimum.
|
|
204
|
+
*/
|
|
205
|
+
error InvalidSignedFeeBps(uint256 got, uint256 minimumOrMaximum);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @dev Revert with an error if signed mint did not specify to restrict
|
|
209
|
+
* fee recipients.
|
|
210
|
+
*/
|
|
211
|
+
error SignedMintsMustRestrictFeeRecipients();
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @dev Revert with an error if a signature for a signed mint has already
|
|
215
|
+
* been used.
|
|
216
|
+
*/
|
|
217
|
+
error SignatureAlreadyUsed();
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @dev An event with details of a SeaDrop mint, for analytical purposes.
|
|
221
|
+
*
|
|
222
|
+
* @param nftContract The nft contract.
|
|
223
|
+
* @param minter The mint recipient.
|
|
224
|
+
* @param feeRecipient The fee recipient.
|
|
225
|
+
* @param payer The address who payed for the tx.
|
|
226
|
+
* @param quantityMinted The number of tokens minted.
|
|
227
|
+
* @param unitMintPrice The amount paid for each token.
|
|
228
|
+
* @param feeBps The fee out of 10_000 basis points collected.
|
|
229
|
+
* @param dropStageIndex The drop stage index. Items minted
|
|
230
|
+
* through mintPublic() have
|
|
231
|
+
* dropStageIndex of 0.
|
|
232
|
+
*/
|
|
233
|
+
event SeaDropMint(
|
|
234
|
+
address indexed nftContract,
|
|
235
|
+
address indexed minter,
|
|
236
|
+
address indexed feeRecipient,
|
|
237
|
+
address payer,
|
|
238
|
+
uint256 quantityMinted,
|
|
239
|
+
uint256 unitMintPrice,
|
|
240
|
+
uint256 feeBps,
|
|
241
|
+
uint256 dropStageIndex
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @dev An event with updated public drop data for an nft contract.
|
|
246
|
+
*/
|
|
247
|
+
event PublicDropUpdated(address indexed nftContract, PublicDrop publicDrop);
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @dev An event with updated token gated drop stage data
|
|
251
|
+
* for an nft contract.
|
|
252
|
+
*/
|
|
253
|
+
event TokenGatedDropStageUpdated(
|
|
254
|
+
address indexed nftContract,
|
|
255
|
+
address indexed allowedNftToken,
|
|
256
|
+
TokenGatedDropStage dropStage
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @dev An event with updated allow list data for an nft contract.
|
|
261
|
+
*
|
|
262
|
+
* @param nftContract The nft contract.
|
|
263
|
+
* @param previousMerkleRoot The previous allow list merkle root.
|
|
264
|
+
* @param newMerkleRoot The new allow list merkle root.
|
|
265
|
+
* @param publicKeyURI If the allow list is encrypted, the public key
|
|
266
|
+
* URIs that can decrypt the list.
|
|
267
|
+
* Empty if unencrypted.
|
|
268
|
+
* @param allowListURI The URI for the allow list.
|
|
269
|
+
*/
|
|
270
|
+
event AllowListUpdated(
|
|
271
|
+
address indexed nftContract,
|
|
272
|
+
bytes32 indexed previousMerkleRoot,
|
|
273
|
+
bytes32 indexed newMerkleRoot,
|
|
274
|
+
string[] publicKeyURI,
|
|
275
|
+
string allowListURI
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @dev An event with updated drop URI for an nft contract.
|
|
280
|
+
*/
|
|
281
|
+
event DropURIUpdated(address indexed nftContract, string newDropURI);
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @dev An event with the updated creator payout address for an nft
|
|
285
|
+
* contract.
|
|
286
|
+
*/
|
|
287
|
+
event CreatorPayoutAddressUpdated(
|
|
288
|
+
address indexed nftContract,
|
|
289
|
+
address indexed newPayoutAddress
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @dev An event with the updated allowed fee recipient for an nft
|
|
294
|
+
* contract.
|
|
295
|
+
*/
|
|
296
|
+
event AllowedFeeRecipientUpdated(
|
|
297
|
+
address indexed nftContract,
|
|
298
|
+
address indexed feeRecipient,
|
|
299
|
+
bool indexed allowed
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @dev An event with the updated validation parameters for server-side
|
|
304
|
+
* signers.
|
|
305
|
+
*/
|
|
306
|
+
event SignedMintValidationParamsUpdated(
|
|
307
|
+
address indexed nftContract,
|
|
308
|
+
address indexed signer,
|
|
309
|
+
SignedMintValidationParams signedMintValidationParams
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @dev An event with the updated payer for an nft contract.
|
|
314
|
+
*/
|
|
315
|
+
event PayerUpdated(
|
|
316
|
+
address indexed nftContract,
|
|
317
|
+
address indexed payer,
|
|
318
|
+
bool indexed allowed
|
|
319
|
+
);
|
|
320
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// @dev file is sourced from OpenSea's repository: https://github.com/ProjectOpenSea/seadrop/blob/main/src/lib/SeaDropStructs.sol
|
|
3
|
+
// @dev modified to not lock to specific version
|
|
4
|
+
pragma solidity ^0.8.17;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @notice A struct defining public drop data.
|
|
8
|
+
* Designed to fit efficiently in one storage slot.
|
|
9
|
+
*
|
|
10
|
+
* @param mintPrice The mint price per token. (Up to 1.2m
|
|
11
|
+
* of native token, e.g. ETH, MATIC)
|
|
12
|
+
* @param startTime The start time, ensure this is not zero.
|
|
13
|
+
* @param endTIme The end time, ensure this is not zero.
|
|
14
|
+
* @param maxTotalMintableByWallet Maximum total number of mints a user is
|
|
15
|
+
* allowed. (The limit for this field is
|
|
16
|
+
* 2^16 - 1)
|
|
17
|
+
* @param feeBps Fee out of 10_000 basis points to be
|
|
18
|
+
* collected.
|
|
19
|
+
* @param restrictFeeRecipients If false, allow any fee recipient;
|
|
20
|
+
* if true, check fee recipient is allowed.
|
|
21
|
+
*/
|
|
22
|
+
struct PublicDrop {
|
|
23
|
+
uint80 mintPrice; // 80/256 bits
|
|
24
|
+
uint48 startTime; // 128/256 bits
|
|
25
|
+
uint48 endTime; // 176/256 bits
|
|
26
|
+
uint16 maxTotalMintableByWallet; // 224/256 bits
|
|
27
|
+
uint16 feeBps; // 240/256 bits
|
|
28
|
+
bool restrictFeeRecipients; // 248/256 bits
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @notice A struct defining token gated drop stage data.
|
|
33
|
+
* Designed to fit efficiently in one storage slot.
|
|
34
|
+
*
|
|
35
|
+
* @param mintPrice The mint price per token. (Up to 1.2m
|
|
36
|
+
* of native token, e.g.: ETH, MATIC)
|
|
37
|
+
* @param maxTotalMintableByWallet Maximum total number of mints a user is
|
|
38
|
+
* allowed. (The limit for this field is
|
|
39
|
+
* 2^16 - 1)
|
|
40
|
+
* @param startTime The start time, ensure this is not zero.
|
|
41
|
+
* @param endTime The end time, ensure this is not zero.
|
|
42
|
+
* @param dropStageIndex The drop stage index to emit with the event
|
|
43
|
+
* for analytical purposes. This should be
|
|
44
|
+
* non-zero since the public mint emits
|
|
45
|
+
* with index zero.
|
|
46
|
+
* @param maxTokenSupplyForStage The limit of token supply this stage can
|
|
47
|
+
* mint within. (The limit for this field is
|
|
48
|
+
* 2^16 - 1)
|
|
49
|
+
* @param feeBps Fee out of 10_000 basis points to be
|
|
50
|
+
* collected.
|
|
51
|
+
* @param restrictFeeRecipients If false, allow any fee recipient;
|
|
52
|
+
* if true, check fee recipient is allowed.
|
|
53
|
+
*/
|
|
54
|
+
struct TokenGatedDropStage {
|
|
55
|
+
uint80 mintPrice; // 80/256 bits
|
|
56
|
+
uint16 maxTotalMintableByWallet; // 96/256 bits
|
|
57
|
+
uint48 startTime; // 144/256 bits
|
|
58
|
+
uint48 endTime; // 192/256 bits
|
|
59
|
+
uint8 dropStageIndex; // non-zero. 200/256 bits
|
|
60
|
+
uint32 maxTokenSupplyForStage; // 232/256 bits
|
|
61
|
+
uint16 feeBps; // 248/256 bits
|
|
62
|
+
bool restrictFeeRecipients; // 256/256 bits
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @notice A struct defining mint params for an allow list.
|
|
67
|
+
* An allow list leaf will be composed of `msg.sender` and
|
|
68
|
+
* the following params.
|
|
69
|
+
*
|
|
70
|
+
* Note: Since feeBps is encoded in the leaf, backend should ensure
|
|
71
|
+
* that feeBps is acceptable before generating a proof.
|
|
72
|
+
*
|
|
73
|
+
* @param mintPrice The mint price per token.
|
|
74
|
+
* @param maxTotalMintableByWallet Maximum total number of mints a user is
|
|
75
|
+
* allowed.
|
|
76
|
+
* @param startTime The start time, ensure this is not zero.
|
|
77
|
+
* @param endTime The end time, ensure this is not zero.
|
|
78
|
+
* @param dropStageIndex The drop stage index to emit with the event
|
|
79
|
+
* for analytical purposes. This should be
|
|
80
|
+
* non-zero since the public mint emits with
|
|
81
|
+
* index zero.
|
|
82
|
+
* @param maxTokenSupplyForStage The limit of token supply this stage can
|
|
83
|
+
* mint within.
|
|
84
|
+
* @param feeBps Fee out of 10_000 basis points to be
|
|
85
|
+
* collected.
|
|
86
|
+
* @param restrictFeeRecipients If false, allow any fee recipient;
|
|
87
|
+
* if true, check fee recipient is allowed.
|
|
88
|
+
*/
|
|
89
|
+
struct MintParams {
|
|
90
|
+
uint256 mintPrice;
|
|
91
|
+
uint256 maxTotalMintableByWallet;
|
|
92
|
+
uint256 startTime;
|
|
93
|
+
uint256 endTime;
|
|
94
|
+
uint256 dropStageIndex; // non-zero
|
|
95
|
+
uint256 maxTokenSupplyForStage;
|
|
96
|
+
uint256 feeBps;
|
|
97
|
+
bool restrictFeeRecipients;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @notice A struct defining token gated mint params.
|
|
102
|
+
*
|
|
103
|
+
* @param allowedNftToken The allowed nft token contract address.
|
|
104
|
+
* @param allowedNftTokenIds The token ids to redeem.
|
|
105
|
+
*/
|
|
106
|
+
struct TokenGatedMintParams {
|
|
107
|
+
address allowedNftToken;
|
|
108
|
+
uint256[] allowedNftTokenIds;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @notice A struct defining allow list data (for minting an allow list).
|
|
113
|
+
*
|
|
114
|
+
* @param merkleRoot The merkle root for the allow list.
|
|
115
|
+
* @param publicKeyURIs If the allowListURI is encrypted, a list of URIs
|
|
116
|
+
* pointing to the public keys. Empty if unencrypted.
|
|
117
|
+
* @param allowListURI The URI for the allow list.
|
|
118
|
+
*/
|
|
119
|
+
struct AllowListData {
|
|
120
|
+
bytes32 merkleRoot;
|
|
121
|
+
string[] publicKeyURIs;
|
|
122
|
+
string allowListURI;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @notice A struct defining minimum and maximum parameters to validate for
|
|
127
|
+
* signed mints, to minimize negative effects of a compromised signer.
|
|
128
|
+
*
|
|
129
|
+
* @param minMintPrice The minimum mint price allowed.
|
|
130
|
+
* @param maxMaxTotalMintableByWallet The maximum total number of mints allowed
|
|
131
|
+
* by a wallet.
|
|
132
|
+
* @param minStartTime The minimum start time allowed.
|
|
133
|
+
* @param maxEndTime The maximum end time allowed.
|
|
134
|
+
* @param maxMaxTokenSupplyForStage The maximum token supply allowed.
|
|
135
|
+
* @param minFeeBps The minimum fee allowed.
|
|
136
|
+
* @param maxFeeBps The maximum fee allowed.
|
|
137
|
+
*/
|
|
138
|
+
struct SignedMintValidationParams {
|
|
139
|
+
uint80 minMintPrice; // 80/256 bits
|
|
140
|
+
uint24 maxMaxTotalMintableByWallet; // 104/256 bits
|
|
141
|
+
uint40 minStartTime; // 144/256 bits
|
|
142
|
+
uint40 maxEndTime; // 184/256 bits
|
|
143
|
+
uint40 maxMaxTokenSupplyForStage; // 224/256 bits
|
|
144
|
+
uint16 minFeeBps; // 240/256 bits
|
|
145
|
+
uint16 maxFeeBps; // 256/256 bits
|
|
146
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc. to support the 0xSplits V2 integration
|
|
3
|
+
// Sourced from:
|
|
4
|
+
// - https://github.com/0xSplits/splits-contracts-monorepo/blob/main/packages/splits-v2/src/libraries/SplitV2.sol
|
|
5
|
+
// - https://github.com/0xSplits/splits-contracts-monorepo/blob/main/packages/splits-v2/src/splitters/SplitFactoryV2.sol
|
|
6
|
+
|
|
7
|
+
pragma solidity ^0.8.0;
|
|
8
|
+
|
|
9
|
+
interface ISplitFactoryV2 {
|
|
10
|
+
/* -------------------------------------------------------------------------- */
|
|
11
|
+
/* STRUCTS */
|
|
12
|
+
/* -------------------------------------------------------------------------- */
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @notice Split struct
|
|
16
|
+
* @dev This struct is used to store the split information.
|
|
17
|
+
* @dev There are no hard caps on the number of recipients/totalAllocation/allocation unit. Thus the chain and its
|
|
18
|
+
* gas limits will dictate these hard caps. Please double check if the split you are creating can be distributed on
|
|
19
|
+
* the chain.
|
|
20
|
+
* @param recipients The recipients of the split.
|
|
21
|
+
* @param allocations The allocations of the split.
|
|
22
|
+
* @param totalAllocation The total allocation of the split.
|
|
23
|
+
* @param distributionIncentive The incentive for distribution. Limits max incentive to 6.5%.
|
|
24
|
+
*/
|
|
25
|
+
struct Split {
|
|
26
|
+
address[] recipients;
|
|
27
|
+
uint256[] allocations;
|
|
28
|
+
uint256 totalAllocation;
|
|
29
|
+
uint16 distributionIncentive;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* -------------------------------------------------------------------------- */
|
|
33
|
+
/* FUNCTIONS */
|
|
34
|
+
/* -------------------------------------------------------------------------- */
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @notice Create a new split with params and owner.
|
|
38
|
+
* @param _splitParams Params to create split with.
|
|
39
|
+
* @param _owner Owner of created split.
|
|
40
|
+
* @param _creator Creator of created split.
|
|
41
|
+
* @param _salt Salt for create2.
|
|
42
|
+
* @return split Address of the created split.
|
|
43
|
+
*/
|
|
44
|
+
function createSplitDeterministic(
|
|
45
|
+
Split calldata _splitParams,
|
|
46
|
+
address _owner,
|
|
47
|
+
address _creator,
|
|
48
|
+
bytes32 _salt
|
|
49
|
+
) external returns (address split);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @notice Predict the address of a new split and check if it is deployed.
|
|
53
|
+
* @param _splitParams Params to create split with.
|
|
54
|
+
* @param _owner Owner of created split.
|
|
55
|
+
* @param _salt Salt for create2.
|
|
56
|
+
*/
|
|
57
|
+
function isDeployed(
|
|
58
|
+
Split calldata _splitParams,
|
|
59
|
+
address _owner,
|
|
60
|
+
bytes32 _salt
|
|
61
|
+
) external view returns (address split, bool exists);
|
|
62
|
+
}
|
|
@@ -21,10 +21,8 @@ library ABHelpers {
|
|
|
21
21
|
uint256 tokenId
|
|
22
22
|
) internal pure returns (uint256) {
|
|
23
23
|
// int division properly rounds down
|
|
24
|
-
// @dev
|
|
25
|
-
|
|
26
|
-
return tokenId / ONE_MILLION;
|
|
27
|
-
}
|
|
24
|
+
// @dev no way to disable division by zero check in solidity v0.8.24, so not unchecked
|
|
25
|
+
return tokenId / ONE_MILLION;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
/**
|
|
@@ -39,6 +37,22 @@ library ABHelpers {
|
|
|
39
37
|
return tokenId % ONE_MILLION;
|
|
40
38
|
}
|
|
41
39
|
|
|
40
|
+
/**
|
|
41
|
+
* @notice Function to convert token id to token invocation.
|
|
42
|
+
* @dev token invocation is the token number plus one, because token #0 is
|
|
43
|
+
* invocation 1.
|
|
44
|
+
* @param tokenId The id of the token.
|
|
45
|
+
*/
|
|
46
|
+
function tokenIdToTokenInvocation(
|
|
47
|
+
uint256 tokenId
|
|
48
|
+
) internal pure returns (uint256) {
|
|
49
|
+
unchecked {
|
|
50
|
+
// mod returns remainder, which is the token number
|
|
51
|
+
// @dev no way to disable mod zero check in solidity, unchecked to optimize gas for addition
|
|
52
|
+
return (tokenId % ONE_MILLION) + 1;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
42
56
|
/**
|
|
43
57
|
* @notice Function to convert project id and token number to token id.
|
|
44
58
|
* @param projectId The id of the project.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity ^0.8.0;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @dev Library for using uint256 as a mapping to 256 bool values via a bit map.
|
|
8
|
+
* This is useful for storing a large number of bool values in a compact way.
|
|
9
|
+
* @dev This implementation is similar to OpenZeppelin's BitMaps library, but a
|
|
10
|
+
* single uint256 is used directly in memory instead of operating within a
|
|
11
|
+
* a mapping within a storage struct.
|
|
12
|
+
* This design limits the number of indices to 256, but is more gas efficient
|
|
13
|
+
* for use cases that fit within that limit. This is especially true for
|
|
14
|
+
* operations that require many reads/writes, since SLOAD/SSTORE can be managed
|
|
15
|
+
* outside of the library.
|
|
16
|
+
*/
|
|
17
|
+
library BitMaps256 {
|
|
18
|
+
/**
|
|
19
|
+
* @notice Checks if the bit at a specific index in the bit map is set.
|
|
20
|
+
* A bit is considered set if it is 1, and unset if it is 0.
|
|
21
|
+
* @param bitMap BitMap to check.
|
|
22
|
+
* @param index The index of the bit to check.
|
|
23
|
+
* @return Indicating if the bit at the specified index is set, false otherwise.
|
|
24
|
+
*/
|
|
25
|
+
function get(uint256 bitMap, uint8 index) internal pure returns (bool) {
|
|
26
|
+
uint256 mask = 1 << index;
|
|
27
|
+
return bitMap & mask != 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @notice Sets the bit at a specific index in the bit map to 1.
|
|
32
|
+
* This function creates a new bit map where the bit at the specified index is set,
|
|
33
|
+
* leaving other bits unchanged.
|
|
34
|
+
* @param bitMap The original BitMap.
|
|
35
|
+
* @param index The index of the bit to set.
|
|
36
|
+
* @return newBitMap The new bit map after setting the bit at the specified index.
|
|
37
|
+
*/
|
|
38
|
+
function set(
|
|
39
|
+
uint256 bitMap,
|
|
40
|
+
uint8 index
|
|
41
|
+
) internal pure returns (uint256 newBitMap) {
|
|
42
|
+
uint256 mask = 1 << index;
|
|
43
|
+
return bitMap | mask;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @notice Unsets the bit at a specific index in the bit map, setting it to 0.
|
|
48
|
+
* This function creates a new bit map where the bit at the specified index is unset,
|
|
49
|
+
* leaving other bits unchanged.
|
|
50
|
+
* @param bitMap The original BitMap.
|
|
51
|
+
* @param index The index of the bit to unset.
|
|
52
|
+
* @return newBitMap The new bit map after unsetting the bit at the specified index.
|
|
53
|
+
*/
|
|
54
|
+
function unset(
|
|
55
|
+
uint256 bitMap,
|
|
56
|
+
uint8 index
|
|
57
|
+
) internal pure returns (uint256 newBitMap) {
|
|
58
|
+
uint256 mask = 1 << index;
|
|
59
|
+
return bitMap & ~mask;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @notice Finds the index of the first bit that is set in the bit map
|
|
64
|
+
* starting from a given index.
|
|
65
|
+
* Returns (255, false) if no set bits were found.
|
|
66
|
+
* @param bitMap BitMap to search
|
|
67
|
+
* @param startIndex Index to start searching from, inclusive
|
|
68
|
+
* @return minIndex Index of first set bit, or 255 if no bits were found
|
|
69
|
+
* @return foundSetBit True if a set bit was found, false otherwise
|
|
70
|
+
*/
|
|
71
|
+
function minBitSet(
|
|
72
|
+
uint256 bitMap,
|
|
73
|
+
uint8 startIndex
|
|
74
|
+
) internal pure returns (uint256 minIndex, bool foundSetBit) {
|
|
75
|
+
// check if there's any set bit at or above startIndex
|
|
76
|
+
if ((bitMap >> startIndex) == 0) {
|
|
77
|
+
return (255, false);
|
|
78
|
+
}
|
|
79
|
+
minIndex = startIndex;
|
|
80
|
+
// @dev this is a linear search, optimized to start only if there's a set bit at or above startIndex
|
|
81
|
+
// worst case 255 iterations in memory
|
|
82
|
+
while (minIndex < 255 && !get(bitMap, uint8(minIndex))) {
|
|
83
|
+
minIndex++;
|
|
84
|
+
}
|
|
85
|
+
foundSetBit = get(bitMap, uint8(minIndex));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @notice Finds the index of the highest bit that is set in the bit map
|
|
90
|
+
* starting from a given index and counting down.
|
|
91
|
+
* Returns (0, false) if no set bits were found.
|
|
92
|
+
* @param bitMap BitMap to search
|
|
93
|
+
* @param startIndex Index to start searching from, inclusive
|
|
94
|
+
* @return maxIndex Index of last set bit, or 0 if no bits were found
|
|
95
|
+
* @return foundSetBit True if a set bit was found, false otherwise
|
|
96
|
+
*/
|
|
97
|
+
function maxBitSet(
|
|
98
|
+
uint256 bitMap,
|
|
99
|
+
uint8 startIndex
|
|
100
|
+
) internal pure returns (uint256 maxIndex, bool foundSetBit) {
|
|
101
|
+
if ((bitMap << (255 - startIndex)) == 0) {
|
|
102
|
+
return (0, false);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
maxIndex = startIndex;
|
|
106
|
+
// @dev this is a linear search, worst case 255 iterations in memory
|
|
107
|
+
while (maxIndex > 0 && !get(bitMap, uint8(maxIndex))) {
|
|
108
|
+
maxIndex--;
|
|
109
|
+
}
|
|
110
|
+
foundSetBit = get(bitMap, uint8(maxIndex));
|
|
111
|
+
}
|
|
112
|
+
}
|