@artblocks/contracts 1.1.0 → 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 +273 -155
- 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/{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 +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 +567 -206
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +787 -224
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +38 -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 +38 -8
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +36 -68
- 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/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +58 -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 +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/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +18 -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/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 +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/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/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/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 +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/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/DependencyRegistryV0.sol +687 -408
- 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 +419 -0
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +894 -488
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +1054 -650
- 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/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/IDependencyRegistryV0.sol +47 -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 +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/IPseudorandomAtomic.sol +1 -3
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +19 -0
- 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 -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/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/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 +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/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 +21 -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/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/mock/BytecodeV2LibCallsMock.sol +128 -0
- package/contracts/mock/BytecodeV2TextCR_DMock.sol +316 -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/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 +62 -34
- 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,121 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
// @dev fixed to specific solidity version for clarity and for more clear
|
|
5
|
+
// source code verification purposes.
|
|
6
|
+
pragma solidity 0.8.22;
|
|
7
|
+
|
|
8
|
+
import {ISplitAtomicV0, Split} from "../interfaces/v0.8.x/ISplitAtomicV0.sol";
|
|
9
|
+
import {ISplitAtomicFactoryV0} from "../interfaces/v0.8.x/ISplitAtomicFactoryV0.sol";
|
|
10
|
+
|
|
11
|
+
import {Clones} from "@openzeppelin-5.0/contracts/proxy/Clones.sol";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title SplitAtomicFactoryV0
|
|
15
|
+
* @author Art Blocks Inc.
|
|
16
|
+
* @notice Factory contract for creating new split atomic contracts.
|
|
17
|
+
* @dev This contract is deployed once, and then used to create new split
|
|
18
|
+
* atomic contracts. The contract may be abandoned once it is no longer needed.
|
|
19
|
+
* Once abandoned, the contract can no longer be used to create new split
|
|
20
|
+
* atomic contracts.
|
|
21
|
+
* The contract is initialized with a required split address and basis points.
|
|
22
|
+
* All splits must include the required split address and basis points.
|
|
23
|
+
* The contract is initialized with an implementation contract, which is cloned
|
|
24
|
+
* when creating new split atomic contracts.
|
|
25
|
+
*/
|
|
26
|
+
contract SplitAtomicFactoryV0 is ISplitAtomicFactoryV0 {
|
|
27
|
+
// public type
|
|
28
|
+
bytes32 public constant type_ = "SplitAtomicFactoryV0";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The implementation contract that is cloned when creating new split
|
|
32
|
+
* atomic contracts.
|
|
33
|
+
*/
|
|
34
|
+
address public immutable splitAtomicImplementation;
|
|
35
|
+
|
|
36
|
+
// required split address and basis points
|
|
37
|
+
// @dev make immutable to avoid SLOAD on every createSplit call
|
|
38
|
+
address public immutable requiredSplitAddress;
|
|
39
|
+
uint16 public immutable requiredSplitBasisPoints;
|
|
40
|
+
|
|
41
|
+
// deployer of the contract is the only one who may abandon the contract
|
|
42
|
+
address public immutable deployer;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Indicates whether the contract is abandoned.
|
|
46
|
+
* Once abandoned, the contract can no longer be used to create new split
|
|
47
|
+
* atomic contracts.
|
|
48
|
+
*/
|
|
49
|
+
bool public isAbandoned; // default false
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @notice validates and assigns immutable configuration variables
|
|
53
|
+
* @param splitAtomicImplementation_ address of the split atomic
|
|
54
|
+
* implementation contract
|
|
55
|
+
* @param requiredSplitAddress_ address that must be included in all splits
|
|
56
|
+
* @param requiredSplitBasisPoints_ basis points that must be included in
|
|
57
|
+
* all splits, for the required split address. Must be <= 10_000.
|
|
58
|
+
*/
|
|
59
|
+
constructor(
|
|
60
|
+
address splitAtomicImplementation_,
|
|
61
|
+
address requiredSplitAddress_,
|
|
62
|
+
uint16 requiredSplitBasisPoints_
|
|
63
|
+
) {
|
|
64
|
+
// input validation
|
|
65
|
+
require(
|
|
66
|
+
requiredSplitBasisPoints_ <= 10_000,
|
|
67
|
+
"only reqd split BPS <= 10_000"
|
|
68
|
+
);
|
|
69
|
+
splitAtomicImplementation = splitAtomicImplementation_;
|
|
70
|
+
requiredSplitAddress = requiredSplitAddress_;
|
|
71
|
+
requiredSplitBasisPoints = requiredSplitBasisPoints_;
|
|
72
|
+
deployer = msg.sender;
|
|
73
|
+
// emit event
|
|
74
|
+
emit Deployed({
|
|
75
|
+
implementation: splitAtomicImplementation_,
|
|
76
|
+
type_: type_,
|
|
77
|
+
requiredSplitAddress: requiredSplitAddress_,
|
|
78
|
+
requiredSplitBasisPoints: requiredSplitBasisPoints_
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @notice Creates a new split atomic contract with the provided `splits`.
|
|
84
|
+
* @param splits Splits to configure the contract with. Must add up to
|
|
85
|
+
* 10_000 BPS, and the first split must be the required split; reverts
|
|
86
|
+
* otherwise.
|
|
87
|
+
* @return splitAtomic The address of the newly created split atomic
|
|
88
|
+
* contract. The address is also emitted in the `SplitAtomicCreated` event.
|
|
89
|
+
*/
|
|
90
|
+
function createSplit(
|
|
91
|
+
Split[] calldata splits
|
|
92
|
+
) external returns (address splitAtomic) {
|
|
93
|
+
require(!isAbandoned, "factory is abandoned");
|
|
94
|
+
// validate first split is initial split
|
|
95
|
+
require(
|
|
96
|
+
splits[0].recipient == requiredSplitAddress &&
|
|
97
|
+
splits[0].basisPoints == requiredSplitBasisPoints,
|
|
98
|
+
"splits[0] must be required split"
|
|
99
|
+
);
|
|
100
|
+
// Create the EIP 1167 split atomic contract
|
|
101
|
+
splitAtomic = Clones.clone({implementation: splitAtomicImplementation});
|
|
102
|
+
// initialize the new split atomic contract
|
|
103
|
+
ISplitAtomicV0(splitAtomic).initialize(splits);
|
|
104
|
+
// emit event
|
|
105
|
+
emit SplitAtomicCreated(splitAtomic);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @notice Abandons the contract, preventing it from being used to create
|
|
110
|
+
* new split atomic contracts.
|
|
111
|
+
* Only callable by the deployer, and only once; reverts otherwise.
|
|
112
|
+
*/
|
|
113
|
+
function abandon() external {
|
|
114
|
+
require(!isAbandoned, "factory is abandoned");
|
|
115
|
+
require(msg.sender == deployer, "only deployer may abandon");
|
|
116
|
+
// set isAbandoned to true
|
|
117
|
+
isAbandoned = true;
|
|
118
|
+
// emit event
|
|
119
|
+
emit Abandoned();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
// @dev fixed to specific solidity version for clarity and for more clear
|
|
5
|
+
// source code verification purposes.
|
|
6
|
+
pragma solidity 0.8.22;
|
|
7
|
+
|
|
8
|
+
import {ISplitAtomicV0, Split} from "../interfaces/v0.8.x/ISplitAtomicV0.sol";
|
|
9
|
+
|
|
10
|
+
import {IERC20} from "@openzeppelin-5.0/contracts/token/ERC20/IERC20.sol";
|
|
11
|
+
import {SafeERC20} from "@openzeppelin-5.0/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title SplitAtomicV0
|
|
15
|
+
* @author Art Blocks Inc.
|
|
16
|
+
* @notice This contract splits received funds according to the configured
|
|
17
|
+
* `splits`, which are immutably configured at initialization time.
|
|
18
|
+
* Each split is defined as a `recipient` address and a `basisPoints` value.
|
|
19
|
+
* The total of all `basisPoints` values must add up to 10_000 (100%), which
|
|
20
|
+
* is verified at initialization time. All splits must be non-zero.
|
|
21
|
+
*
|
|
22
|
+
* When the contract receives funds, it splits the funds according to the
|
|
23
|
+
* configured `splits`. The contract can also manually split any funds that
|
|
24
|
+
* were sent outside of the `receive` function via the `drainETH` function.
|
|
25
|
+
* Additionally, a `drainERC20` function is provided to split any ERC20 tokens
|
|
26
|
+
* that were sent to the contract.
|
|
27
|
+
*
|
|
28
|
+
* There may be a small amount of funds left behind when splitting funds, due
|
|
29
|
+
* to integer division rounding down. This is conservatively safe (will always
|
|
30
|
+
* run a split), but may leave a small amount of funds behind (e.g. a few wei).
|
|
31
|
+
* The small amount of funds left behind can always be drained later, but
|
|
32
|
+
* likely never worth the gas.
|
|
33
|
+
*/
|
|
34
|
+
contract SplitAtomicV0 is ISplitAtomicV0 {
|
|
35
|
+
// simplified, initializable reentrancy guard
|
|
36
|
+
uint256 private constant _NOT_ENTERED = 1;
|
|
37
|
+
uint256 private constant _ENTERED = 2;
|
|
38
|
+
uint256 private constant _NOT_INITIALIZED = 0;
|
|
39
|
+
uint256 private _status; // initial value: _NOT_INITIALIZED (0)
|
|
40
|
+
|
|
41
|
+
// public type
|
|
42
|
+
bytes32 public constant type_ = "SplitAtomicV0";
|
|
43
|
+
|
|
44
|
+
// private array of Splits
|
|
45
|
+
Split[] private _splits;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @dev Prevents contract from calling itself, directly or indirectly.
|
|
49
|
+
* Calling a `nonReentrant` function from another `nonReentrant`
|
|
50
|
+
* function is not supported. It is possible to prevent this from happening
|
|
51
|
+
* by making the `nonReentrant` function external, and making it call a
|
|
52
|
+
* `private` function that does the actual work.
|
|
53
|
+
* @dev prefer to use modifier here due to wrapped function behavior
|
|
54
|
+
*/
|
|
55
|
+
modifier nonReentrant() {
|
|
56
|
+
_nonReentrantBefore();
|
|
57
|
+
_;
|
|
58
|
+
_nonReentrantAfter();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @notice receive function splits received funds according to the
|
|
63
|
+
* configured `splits`.
|
|
64
|
+
* Reverts if contract is not yet initialized.
|
|
65
|
+
* Non-reentrant function.
|
|
66
|
+
* @dev This function automatically splits funds when the native token of a
|
|
67
|
+
* blockchain is sent to the contract. It is important to note that this
|
|
68
|
+
* function uses an unspecified amount of gas, and therefore sending funds
|
|
69
|
+
* to this contract via the deprecated `transfer` method is not supported.
|
|
70
|
+
* @dev This function relies on being non-reentrant for security.
|
|
71
|
+
*/
|
|
72
|
+
receive() external payable nonReentrant {
|
|
73
|
+
// split received funds
|
|
74
|
+
// @dev reverts if not already initialized
|
|
75
|
+
_splitETH(msg.value);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @notice Initializes the contract with the provided `splits`.
|
|
80
|
+
* This function should be called atomically, immediately after deployment.
|
|
81
|
+
* Only callable once.
|
|
82
|
+
* @param splits Splits to configure the contract with. Must add up to
|
|
83
|
+
* 10_000 BPS.
|
|
84
|
+
*/
|
|
85
|
+
function initialize(Split[] calldata splits) external {
|
|
86
|
+
// initialize reentrancy guard
|
|
87
|
+
// @dev this reverts if already initialized, preventing this function
|
|
88
|
+
// from ever being called more than once
|
|
89
|
+
_reentrancyGuardInit();
|
|
90
|
+
// validate splits
|
|
91
|
+
uint256 totalBasisPoints = 0;
|
|
92
|
+
uint256 splitsLength = splits.length;
|
|
93
|
+
// @dev splits length implicitly checked to be > 0 via totalBasisPoints
|
|
94
|
+
// check after loop
|
|
95
|
+
for (uint256 i; i < splitsLength; ) {
|
|
96
|
+
Split memory split = splits[i];
|
|
97
|
+
uint256 bps = split.basisPoints;
|
|
98
|
+
require(bps > 0 && bps <= 10_000, "Invalid basis points");
|
|
99
|
+
// push the splits to the storage array
|
|
100
|
+
_splits.push(split);
|
|
101
|
+
// track total basis points for totals validation after loop
|
|
102
|
+
// @dev overflow checked automatically in solidity 0.8
|
|
103
|
+
totalBasisPoints += bps;
|
|
104
|
+
// @dev efficient unchecked increment
|
|
105
|
+
unchecked {
|
|
106
|
+
++i;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
require(totalBasisPoints == 10_000, "Invalid total basis points");
|
|
110
|
+
// emit initialized event
|
|
111
|
+
emit Initialized(type_);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @notice Drains the contract's balance to the configured `splits`.
|
|
116
|
+
* Reverts if not initialized.
|
|
117
|
+
* @dev This function is useful for draining the contract's balance to the
|
|
118
|
+
* configured `splits` in the event that the contract receives funds via
|
|
119
|
+
* a force-send (e.g. `SELFDESTRUCT` or `SENDALL`) operation.
|
|
120
|
+
* @dev This function relies on being non-reentrant for security.
|
|
121
|
+
*/
|
|
122
|
+
function drainETH() external nonReentrant {
|
|
123
|
+
// split contract balance
|
|
124
|
+
uint256 balance = address(this).balance;
|
|
125
|
+
if (balance > 0) {
|
|
126
|
+
// @dev reverts if not initialized
|
|
127
|
+
_splitETH(balance);
|
|
128
|
+
}
|
|
129
|
+
emit DrainedETH();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @notice Drains the contract's balance of an input ERC20 token to the
|
|
134
|
+
* configured `splits`.
|
|
135
|
+
* Reverts if not initialized
|
|
136
|
+
* @dev This function is useful for draining the contract's balance of an
|
|
137
|
+
* ERC20 token to the configured `splits`. ERC20 tokens are not split upon
|
|
138
|
+
* receiving (due to transfers not always calling a receive hook),
|
|
139
|
+
* therefore this function provides critical functionality for this
|
|
140
|
+
* contract.
|
|
141
|
+
* @dev This function relies on being non-reentrant for security.
|
|
142
|
+
* @param ERC20TokenAddress The address of the ERC20 token to split.
|
|
143
|
+
*/
|
|
144
|
+
function drainERC20(address ERC20TokenAddress) external nonReentrant {
|
|
145
|
+
// split contract balance of ERC20 token
|
|
146
|
+
uint256 balance = IERC20(ERC20TokenAddress).balanceOf(address(this));
|
|
147
|
+
if (balance > 0) {
|
|
148
|
+
// @dev reverts if not initialized
|
|
149
|
+
_splitERC20({ERC20TokenAddress: ERC20TokenAddress, value: balance});
|
|
150
|
+
}
|
|
151
|
+
emit DrainedERC20(ERC20TokenAddress);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @notice Returns the configured `splits`.
|
|
156
|
+
* @return Split[] memory The configured `splits`.
|
|
157
|
+
*/
|
|
158
|
+
function getSplits() external view returns (Split[] memory) {
|
|
159
|
+
return _splits;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @notice Splits the input `valueInWei` of ETH to the configured `splits`.
|
|
164
|
+
* Reverts if any transfers fail. Reverts if called outside of a
|
|
165
|
+
* non-reentrant function. Reverts if not initialized.
|
|
166
|
+
* @param valueInWei The amount of ETH to split.
|
|
167
|
+
*/
|
|
168
|
+
function _splitETH(uint256 valueInWei) internal {
|
|
169
|
+
// require only called in the context of a non-reentrant function
|
|
170
|
+
// @dev this provides fault-tolerant behavior for reentrancy guards
|
|
171
|
+
// @dev this also implicitly verifies contract is initialized
|
|
172
|
+
// @dev no cover on next line else banch due to fault-tolerant check
|
|
173
|
+
require(_status == _ENTERED, "only in non-reentrant function");
|
|
174
|
+
// split funds
|
|
175
|
+
uint256 splitsLength = _splits.length;
|
|
176
|
+
for (uint256 i; i < splitsLength; ) {
|
|
177
|
+
Split memory split = _splits[i];
|
|
178
|
+
// @dev overflow checked automatically in solidity 0.8
|
|
179
|
+
// @dev integer division rounds down, which is conservatively safe
|
|
180
|
+
// when splitting funds. Will not run out of funds, but may leave a
|
|
181
|
+
// small amount behind (e.g. a few wei). Can always be drained
|
|
182
|
+
// later, but likely never worth the gas.
|
|
183
|
+
uint256 splitValue = (valueInWei * split.basisPoints) / 10_000;
|
|
184
|
+
// send funds
|
|
185
|
+
(bool success, ) = split.recipient.call{value: splitValue}("");
|
|
186
|
+
require(success, "Payment failed");
|
|
187
|
+
// @dev efficient unchecked increment
|
|
188
|
+
unchecked {
|
|
189
|
+
++i;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @notice Splits the input `value` of ERC20 token at `ERC20TokenAddress`
|
|
196
|
+
* to the configured `splits`.
|
|
197
|
+
* Reverts if any transfers fail. Reverts if called outside of a
|
|
198
|
+
* non-reentrant function. Reverts if not initialized.
|
|
199
|
+
* @param ERC20TokenAddress The address of the ERC20 token to split.
|
|
200
|
+
* @param value The amount of the ERC20 token to split.
|
|
201
|
+
*/
|
|
202
|
+
function _splitERC20(address ERC20TokenAddress, uint256 value) internal {
|
|
203
|
+
// require only called in the context of a non-reentrant function
|
|
204
|
+
// @dev this provides fault-tolerant behavior for reentrancy guards
|
|
205
|
+
// @dev this also implicitly verifies contract is initialized
|
|
206
|
+
// @dev no cover on next line else banch due to fault-tolerant check
|
|
207
|
+
require(_status == _ENTERED, "only in non-reentrant function");
|
|
208
|
+
// split funds
|
|
209
|
+
uint256 splitsLength = _splits.length;
|
|
210
|
+
IERC20 token = IERC20(ERC20TokenAddress);
|
|
211
|
+
for (uint256 i; i < splitsLength; ) {
|
|
212
|
+
Split memory split = _splits[i];
|
|
213
|
+
// @dev overflow checked automatically in solidity 0.8
|
|
214
|
+
// @dev integer division rounds down, which is conservatively safe
|
|
215
|
+
// when splitting funds. Will not run out of funds, but may leave a
|
|
216
|
+
// small amount behind (e.g. a few wei). Can always be drained
|
|
217
|
+
// later, but likely never worth the gas.
|
|
218
|
+
uint256 splitValue = (value * split.basisPoints) / 10_000;
|
|
219
|
+
// transfer ERC20 tokens
|
|
220
|
+
// @dev use SafeERC20 to only revert if ERC20 transfer returns
|
|
221
|
+
// false, not if it returns nothing (which is the behavior of some
|
|
222
|
+
// ERC20 tokens, and we don't want to forever lock those tokens)
|
|
223
|
+
SafeERC20.safeTransfer({
|
|
224
|
+
token: token,
|
|
225
|
+
to: split.recipient,
|
|
226
|
+
value: splitValue
|
|
227
|
+
});
|
|
228
|
+
// @dev efficient unchecked increment
|
|
229
|
+
unchecked {
|
|
230
|
+
++i;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @notice Initializes the reentrancy guard. This function will revert if
|
|
237
|
+
* the contract is already initialized.
|
|
238
|
+
*/
|
|
239
|
+
function _reentrancyGuardInit() private {
|
|
240
|
+
// require not already initialized
|
|
241
|
+
require(_status == _NOT_INITIALIZED, "Already initialized");
|
|
242
|
+
// set status to not entered
|
|
243
|
+
_status = _NOT_ENTERED;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @notice Sets the reentrancy guard status to `_ENTERED`.
|
|
248
|
+
* Reverts if the guard is already entered.
|
|
249
|
+
*/
|
|
250
|
+
function _nonReentrantBefore() private {
|
|
251
|
+
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
|
|
252
|
+
// Any calls to nonReentrant after this point will fail
|
|
253
|
+
_status = _ENTERED;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @notice Sets the reentrancy guard status to `_NOT_ENTERED`, allowing
|
|
258
|
+
* calls to `nonReentrant` functions again.
|
|
259
|
+
*/
|
|
260
|
+
function _nonReentrantAfter() private {
|
|
261
|
+
// By storing the original value once again, a refund is triggered (see
|
|
262
|
+
// https://eips.ethereum.org/EIPS/eip-2200)
|
|
263
|
+
_status = _NOT_ENTERED;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity 0.8.22;
|
|
5
|
+
|
|
6
|
+
import {ISplitProviderV0} from "../../interfaces/v0.8.x/ISplitProviderV0.sol";
|
|
7
|
+
import {ISplitFactoryV2} from "../../interfaces/v0.8.x/integration-refs/splits-0x-v2/ISplitFactoryV2.sol";
|
|
8
|
+
|
|
9
|
+
import {ERC165} from "@openzeppelin-5.0/contracts/utils/introspection/ERC165.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @title SplitProviderV0
|
|
13
|
+
* @author Art Blocks Inc.
|
|
14
|
+
* @notice Split Provider to get or create immutable split contracts.
|
|
15
|
+
* This version of SplitProvider integrates with 0xSplits v2 to provide
|
|
16
|
+
* immutable split contracts.
|
|
17
|
+
* This contract is permissionless and does not have an owner. It is intended
|
|
18
|
+
* to be used by other contracts to create immutable split contracts, while
|
|
19
|
+
* adding a layer of abstraction to reduce the complexity of interacting with
|
|
20
|
+
* 0xSplits v2 directly, as well as to enable future migration paths to new
|
|
21
|
+
* upgrades.
|
|
22
|
+
* ----------------------------------------------------------------------------
|
|
23
|
+
* All split contracts will be created with the following properties:
|
|
24
|
+
* - The split contract will be immutable.
|
|
25
|
+
* - The split contract will be created with the provided split parameters.
|
|
26
|
+
* - The split contract includes zero distribution incentive.
|
|
27
|
+
* - The split contract will be created at a deterministic address, given the
|
|
28
|
+
* input split parameters and contract calling this contract (as well as the
|
|
29
|
+
* third party 0xSplits SplitFactoryV2 address).
|
|
30
|
+
*/
|
|
31
|
+
contract SplitProviderV0 is ISplitProviderV0, ERC165 {
|
|
32
|
+
bytes32 private constant _TYPE = "SplitProviderV0";
|
|
33
|
+
|
|
34
|
+
// 0xSplits SplitFactoryV2 address immutably configured on this contract
|
|
35
|
+
ISplitFactoryV2 private immutable _splitFactoryV2;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @notice Construct a new SplitProviderV0 contract.
|
|
39
|
+
* @param splitFactoryV2Address The immutable 0xSplits SplitFactoryV2 address.
|
|
40
|
+
*/
|
|
41
|
+
constructor(ISplitFactoryV2 splitFactoryV2Address) {
|
|
42
|
+
_splitFactoryV2 = ISplitFactoryV2(splitFactoryV2Address);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @notice Gets or creates an immutable splitter contract at a deterministic address.
|
|
47
|
+
* Splits in the splitter contract are determined by the input split parameters,
|
|
48
|
+
* so we can safely create the splitter contract at a deterministic address (or use
|
|
49
|
+
* the existing splitter contract if it already exists at that address).
|
|
50
|
+
* Returns null address if no royalties are due.
|
|
51
|
+
* @dev Uses the 0xSplits v2 implementation to create a splitter contract
|
|
52
|
+
* @dev Intentionally unpermissioned; no owner required; all created splits
|
|
53
|
+
* are immutable and deterministic
|
|
54
|
+
* @param splitInputs The split input parameters.
|
|
55
|
+
* @return splitter The newly created splitter contract address.
|
|
56
|
+
*/
|
|
57
|
+
function getOrCreateSplitter(
|
|
58
|
+
SplitInputs calldata splitInputs
|
|
59
|
+
) external override returns (address) {
|
|
60
|
+
// edge case: no royalties due; return zero address
|
|
61
|
+
if (
|
|
62
|
+
splitInputs.artistTotalRoyaltyPercentage +
|
|
63
|
+
splitInputs.renderProviderSecondarySalesBPS +
|
|
64
|
+
splitInputs.platformProviderSecondarySalesBPS ==
|
|
65
|
+
0
|
|
66
|
+
) {
|
|
67
|
+
return address(0);
|
|
68
|
+
}
|
|
69
|
+
// create Split struct from SplitInputs
|
|
70
|
+
ISplitFactoryV2.Split memory splitParams = _getSplitParams({
|
|
71
|
+
splitInputs: splitInputs
|
|
72
|
+
});
|
|
73
|
+
// use sender as salt to ensure unique splitters across contracts/partners for accounting
|
|
74
|
+
bytes32 salt = bytes32(bytes20(msg.sender));
|
|
75
|
+
// determine if splitter already exists
|
|
76
|
+
(address splitter, bool exists) = _splitFactoryV2.isDeployed({
|
|
77
|
+
_splitParams: splitParams,
|
|
78
|
+
_owner: address(0), // no owner, immutable,
|
|
79
|
+
_salt: salt
|
|
80
|
+
});
|
|
81
|
+
if (!exists) {
|
|
82
|
+
// create new splitter contract
|
|
83
|
+
// @dev no need to re-assign returned address; isDeployed already populated it
|
|
84
|
+
_splitFactoryV2.createSplitDeterministic({
|
|
85
|
+
_splitParams: splitParams,
|
|
86
|
+
_owner: address(0), // no owner, immutable
|
|
87
|
+
_creator: address(this),
|
|
88
|
+
_salt: salt
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// emit event for new splitter creation
|
|
92
|
+
emit SplitterCreated({splitter: splitter});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return splitter;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @notice Get the immutable 0xSplits SplitFactoryV2 address used by this SplitProviderV0.
|
|
100
|
+
* @return splitFactoryV2 The 0xSplits SplitFactoryV2 address.
|
|
101
|
+
*/
|
|
102
|
+
function getSplitFactoryV2() external view returns (ISplitFactoryV2) {
|
|
103
|
+
return _splitFactoryV2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @dev See {IERC165-supportsInterface}.
|
|
108
|
+
*/
|
|
109
|
+
function supportsInterface(
|
|
110
|
+
bytes4 interfaceId
|
|
111
|
+
) public view override returns (bool) {
|
|
112
|
+
// broadcast support of the getOrCreateSplitter function
|
|
113
|
+
// @dev intentionally only including getOrCreateSplitter, as that is the only function
|
|
114
|
+
// that is intended to be used for on-chain integration (type_ is for indexing and introspection only)
|
|
115
|
+
return
|
|
116
|
+
interfaceId == this.getOrCreateSplitter.selector ||
|
|
117
|
+
super.supportsInterface(interfaceId);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @notice Indicates the type of the contract, e.g. `SplitProviderV0`.
|
|
122
|
+
* @return type_ The type of the contract.
|
|
123
|
+
*/
|
|
124
|
+
function type_() external pure returns (bytes32) {
|
|
125
|
+
return _TYPE;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Converts the split inputs to the split parameters used by 0xSplits V2.
|
|
130
|
+
* This function assumes there is at least one party with a non-zero allocation,
|
|
131
|
+
* and should not be called if there are no royalties due.
|
|
132
|
+
* @param splitInputs The split input parameters.
|
|
133
|
+
* @return splitParams The split parameters in the form used by 0xSplits V2.
|
|
134
|
+
*/
|
|
135
|
+
function _getSplitParams(
|
|
136
|
+
SplitInputs calldata splitInputs
|
|
137
|
+
) private pure returns (ISplitFactoryV2.Split memory splitParams) {
|
|
138
|
+
// define allocations in BPS to avoid any rounding errors
|
|
139
|
+
uint256 artistAndAdditionalRoyaltyPercentage = splitInputs
|
|
140
|
+
.artistTotalRoyaltyPercentage;
|
|
141
|
+
uint256 artistAndAdditionalRoyaltyBPS = 100 *
|
|
142
|
+
artistAndAdditionalRoyaltyPercentage;
|
|
143
|
+
// load render provider royalty BPS
|
|
144
|
+
uint256 renderProviderRoyaltyBPS = splitInputs
|
|
145
|
+
.renderProviderSecondarySalesBPS;
|
|
146
|
+
// load platform provider royalty BPS
|
|
147
|
+
uint256 platformProviderRoyaltyBPS = splitInputs
|
|
148
|
+
.platformProviderSecondarySalesBPS;
|
|
149
|
+
|
|
150
|
+
bool artistNonZero = artistAndAdditionalRoyaltyPercentage > 0 &&
|
|
151
|
+
splitInputs.additionalPayeePercentage < 100;
|
|
152
|
+
bool additionalPayeeNonZero = artistAndAdditionalRoyaltyPercentage >
|
|
153
|
+
0 &&
|
|
154
|
+
splitInputs.additionalPayeePercentage > 0;
|
|
155
|
+
bool renderNonZero = renderProviderRoyaltyBPS > 0;
|
|
156
|
+
bool platformNonZero = platformProviderRoyaltyBPS > 0;
|
|
157
|
+
|
|
158
|
+
// allocate memory for splitParams arrays
|
|
159
|
+
uint256 partyLength = (artistNonZero ? 1 : 0) +
|
|
160
|
+
(additionalPayeeNonZero ? 1 : 0) +
|
|
161
|
+
(renderNonZero ? 1 : 0) +
|
|
162
|
+
(platformNonZero ? 1 : 0);
|
|
163
|
+
splitParams.recipients = new address[](partyLength);
|
|
164
|
+
splitParams.allocations = new uint256[](partyLength);
|
|
165
|
+
splitParams.totalAllocation =
|
|
166
|
+
artistAndAdditionalRoyaltyBPS +
|
|
167
|
+
renderProviderRoyaltyBPS +
|
|
168
|
+
platformProviderRoyaltyBPS;
|
|
169
|
+
|
|
170
|
+
// populate each party's split
|
|
171
|
+
uint256 currentIndex = 0;
|
|
172
|
+
if (artistNonZero) {
|
|
173
|
+
splitParams.recipients[currentIndex] = splitInputs.artist;
|
|
174
|
+
// @dev percent * 100 converts to BPS
|
|
175
|
+
splitParams.allocations[currentIndex++] =
|
|
176
|
+
artistAndAdditionalRoyaltyPercentage *
|
|
177
|
+
(100 - splitInputs.additionalPayeePercentage);
|
|
178
|
+
}
|
|
179
|
+
if (additionalPayeeNonZero) {
|
|
180
|
+
splitParams.recipients[currentIndex] = splitInputs.additionalPayee;
|
|
181
|
+
// @dev percent * 100 converts to BPS
|
|
182
|
+
splitParams.allocations[currentIndex++] =
|
|
183
|
+
artistAndAdditionalRoyaltyPercentage *
|
|
184
|
+
splitInputs.additionalPayeePercentage;
|
|
185
|
+
}
|
|
186
|
+
if (renderNonZero) {
|
|
187
|
+
splitParams.recipients[currentIndex] = splitInputs
|
|
188
|
+
.renderProviderSecondarySalesAddress;
|
|
189
|
+
splitParams.allocations[currentIndex++] = renderProviderRoyaltyBPS;
|
|
190
|
+
}
|
|
191
|
+
if (platformNonZero) {
|
|
192
|
+
splitParams.recipients[currentIndex] = splitInputs
|
|
193
|
+
.platformProviderSecondarySalesAddress;
|
|
194
|
+
splitParams.allocations[
|
|
195
|
+
currentIndex // no need to increment, last element
|
|
196
|
+
] = platformProviderRoyaltyBPS;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// @dev leave distribution incentive as zero on all splits
|
|
200
|
+
}
|
|
201
|
+
}
|