@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
|
@@ -151,11 +151,16 @@ library SEALib {
|
|
|
151
151
|
// for this library
|
|
152
152
|
bytes32 constant SEA_LIB_STORAGE_POSITION = keccak256("sealib.storage");
|
|
153
153
|
|
|
154
|
-
uint256 constant ONE_MILLION = 1_000_000;
|
|
155
|
-
|
|
156
154
|
// project-specific parameters
|
|
157
155
|
struct SEAProjectConfig {
|
|
156
|
+
// bool to indicate if next token number has been populated, or is
|
|
157
|
+
// still default value of 0
|
|
158
|
+
// @dev required to handle edge case where next token number is 0
|
|
159
|
+
bool nextTokenNumberIsPopulated;
|
|
160
|
+
// timestamp at/after which new auctions may be created
|
|
158
161
|
uint64 timestampStart;
|
|
162
|
+
//
|
|
163
|
+
// ---- Auction Factory Settings Start ----
|
|
159
164
|
// duration of each new auction, before any extensions due to late bids
|
|
160
165
|
// @dev for configured auctions, this will be gt 0, so it may be used
|
|
161
166
|
// to determine if an auction is configured
|
|
@@ -173,12 +178,10 @@ library SEALib {
|
|
|
173
178
|
// be derived from this value in combination with project ID
|
|
174
179
|
// max uint24 ~= 1.6e7, > max possible project invocations of 1e6
|
|
175
180
|
uint24 nextTokenNumber;
|
|
176
|
-
// bool to indicate if next token number has been populated, or is
|
|
177
|
-
// still default value of 0
|
|
178
|
-
// @dev required to handle edge case where next token number is 0
|
|
179
|
-
bool nextTokenNumberIsPopulated;
|
|
180
181
|
// reserve price, i.e. minimum starting bid price, in wei
|
|
181
182
|
uint256 basePrice;
|
|
183
|
+
// ---- Auction Factory Settings End ----
|
|
184
|
+
//
|
|
182
185
|
// active auction for project
|
|
183
186
|
Auction activeAuction;
|
|
184
187
|
}
|
|
@@ -264,6 +267,13 @@ library SEALib {
|
|
|
264
267
|
projectId: projectId,
|
|
265
268
|
coreContract: coreContract
|
|
266
269
|
});
|
|
270
|
+
// base price of zero breaks auction system as percent min increase
|
|
271
|
+
// makes no sense
|
|
272
|
+
require(basePrice != 0, "Only non-zero");
|
|
273
|
+
// midBidIncrementPercentage of zero would allow a bidder to "outbid"
|
|
274
|
+
// previous users without posting more, so don't allow it
|
|
275
|
+
require(minBidIncrementPercentage != 0, "Only non-zero");
|
|
276
|
+
|
|
267
277
|
require(
|
|
268
278
|
timestampStart == 0 || block.timestamp < timestampStart,
|
|
269
279
|
"Only future start times or 0"
|
|
@@ -279,7 +289,7 @@ library SEALib {
|
|
|
279
289
|
projectId: projectId,
|
|
280
290
|
coreContract: coreContract,
|
|
281
291
|
timestampStart: uint64(timestampStart), // @dev safe-casting already previously checked
|
|
282
|
-
auctionDurationSeconds: auctionDurationSeconds
|
|
292
|
+
auctionDurationSeconds: uint32(auctionDurationSeconds), // @dev safe-casting already previously checked
|
|
283
293
|
basePrice: basePrice,
|
|
284
294
|
minBidIncrementPercentage: minBidIncrementPercentage
|
|
285
295
|
});
|
|
@@ -378,7 +388,7 @@ library SEALib {
|
|
|
378
388
|
* - there is an auction for a different token ID on the project
|
|
379
389
|
* (likely due to a front-run)
|
|
380
390
|
* This function reverts if the auction for `tokenId` exists, but has not
|
|
381
|
-
* yet ended.
|
|
391
|
+
* yet ended. Function also reverts if there is no initialized auction.
|
|
382
392
|
* @param tokenId Token ID to settle auction for.
|
|
383
393
|
* @param coreContract Core contract address for the given token.
|
|
384
394
|
*/
|
|
@@ -393,8 +403,6 @@ library SEALib {
|
|
|
393
403
|
address currentBidder = auction.currentBidder;
|
|
394
404
|
uint256 currentBid = auction.currentBid;
|
|
395
405
|
// CHECKS
|
|
396
|
-
// @dev this check is not strictly necessary, but is included for
|
|
397
|
-
// clear error messaging
|
|
398
406
|
require(auctionIsInitialized(auction), "Auction not initialized");
|
|
399
407
|
if (auction.settled || (auction.tokenId != tokenId)) {
|
|
400
408
|
// auction already settled or is for a different token ID, so
|
|
@@ -572,10 +580,10 @@ library SEALib {
|
|
|
572
580
|
// invocations has not been reached
|
|
573
581
|
// we require up-to-date invocation data to properly handle last token
|
|
574
582
|
// and avoid revert if relying on core to limit invocations, therefore
|
|
575
|
-
// use MaxInvocationsLib.
|
|
583
|
+
// use MaxInvocationsLib.invocationsRemainOnCore, which calls core contract
|
|
576
584
|
// to get latest invocation data
|
|
577
585
|
if (
|
|
578
|
-
!MaxInvocationsLib.
|
|
586
|
+
!MaxInvocationsLib.invocationsRemainOnCore({
|
|
579
587
|
projectId: projectId,
|
|
580
588
|
coreContract: coreContract
|
|
581
589
|
})
|
|
@@ -605,7 +613,7 @@ library SEALib {
|
|
|
605
613
|
);
|
|
606
614
|
}
|
|
607
615
|
// update local maxHasBeenInvoked value if necessary
|
|
608
|
-
MaxInvocationsLib.
|
|
616
|
+
MaxInvocationsLib.validateMintEffectsInvocations({
|
|
609
617
|
tokenId: nextTokenId,
|
|
610
618
|
coreContract: coreContract
|
|
611
619
|
});
|
|
@@ -650,12 +658,12 @@ library SEALib {
|
|
|
650
658
|
}
|
|
651
659
|
|
|
652
660
|
/**
|
|
653
|
-
* @notice Function returns bool representing if an auction is
|
|
654
|
-
* price. It is
|
|
655
|
-
* end time.
|
|
661
|
+
* @notice Function returns bool representing if an auction is live and
|
|
662
|
+
* accepting bids above base price. It is live if it is initialized and
|
|
663
|
+
* has not reached its end time.
|
|
656
664
|
* @param auction The auction to check.
|
|
657
665
|
*/
|
|
658
|
-
function
|
|
666
|
+
function isAuctionLive(
|
|
659
667
|
Auction storage auction
|
|
660
668
|
) internal view returns (bool isAcceptingBids) {
|
|
661
669
|
// auction is accepting bids if it is initialized and has not reached
|
|
@@ -713,9 +721,7 @@ library SEALib {
|
|
|
713
721
|
Auction storage auction = SEAProjectConfig_.activeAuction;
|
|
714
722
|
// if project has an active token auction that is not settled, return
|
|
715
723
|
// that token ID
|
|
716
|
-
if (
|
|
717
|
-
auctionIsInitialized(auction) && (auction.endTime > block.timestamp)
|
|
718
|
-
) {
|
|
724
|
+
if (isAuctionLive(auction)) {
|
|
719
725
|
return auction.tokenId;
|
|
720
726
|
}
|
|
721
727
|
// otherwise, return the next expected token ID to be auctioned.
|
|
@@ -742,10 +748,10 @@ library SEALib {
|
|
|
742
748
|
"Next token not populated"
|
|
743
749
|
);
|
|
744
750
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
751
|
+
nextTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
|
|
752
|
+
projectId: projectId,
|
|
753
|
+
tokenNumber: SEAProjectConfig_.nextTokenNumber
|
|
754
|
+
});
|
|
749
755
|
}
|
|
750
756
|
|
|
751
757
|
/**
|
|
@@ -776,21 +782,15 @@ library SEALib {
|
|
|
776
782
|
coreContract: coreContract
|
|
777
783
|
});
|
|
778
784
|
Auction storage auction = SEAProjectConfig_.activeAuction;
|
|
779
|
-
// base price of zero not allowed when configuring auctions, so use it
|
|
780
|
-
// as indicator of whether auctions are configured for the project
|
|
781
785
|
bool projectIsConfigured_ = projectIsConfigured({
|
|
782
786
|
projectId: projectId,
|
|
783
787
|
coreContract: coreContract
|
|
784
788
|
});
|
|
785
|
-
bool
|
|
786
|
-
|
|
787
|
-
);
|
|
788
|
-
isConfigured =
|
|
789
|
-
projectIsConfigured_ ||
|
|
790
|
-
auctionIsAcceptingIncreasingBids_;
|
|
789
|
+
bool isAuctionLive_ = isAuctionLive(auction);
|
|
790
|
+
isConfigured = projectIsConfigured_ || isAuctionLive_;
|
|
791
791
|
// only return non-zero price if auction is configured
|
|
792
792
|
if (isConfigured) {
|
|
793
|
-
if (
|
|
793
|
+
if (isAuctionLive_) {
|
|
794
794
|
// return minimum next bid, given current bid
|
|
795
795
|
tokenPriceInWei = getMinimumNextBid(auction);
|
|
796
796
|
} else {
|
|
@@ -858,8 +858,6 @@ library SEALib {
|
|
|
858
858
|
Auction storage auction = SEAProjectConfig_.activeAuction;
|
|
859
859
|
// CHECKS
|
|
860
860
|
// ensure project auctions are configured
|
|
861
|
-
// @dev base price of zero indicates auctions are not configured
|
|
862
|
-
// because only base price of gt zero is allowed when configuring
|
|
863
861
|
require(
|
|
864
862
|
projectIsConfigured({
|
|
865
863
|
projectId: projectId,
|
|
@@ -903,7 +901,7 @@ library SEALib {
|
|
|
903
901
|
|
|
904
902
|
// EFFECTS
|
|
905
903
|
// create new auction, overwriting previous auction if it exists
|
|
906
|
-
uint64 endTime =
|
|
904
|
+
uint64 endTime = _overwriteProjectActiveAuction({
|
|
907
905
|
SEAProjectConfig_: SEAProjectConfig_,
|
|
908
906
|
targetTokenId: targetTokenId,
|
|
909
907
|
bidAmount: msg.value,
|
|
@@ -937,6 +935,31 @@ library SEALib {
|
|
|
937
935
|
});
|
|
938
936
|
}
|
|
939
937
|
|
|
938
|
+
/**
|
|
939
|
+
* Loads the SEAProjectConfig for a given project and core
|
|
940
|
+
* contract.
|
|
941
|
+
* @param projectId Project Id to get config for
|
|
942
|
+
* @param coreContract Core contract address to get config for
|
|
943
|
+
*/
|
|
944
|
+
function getSEAProjectConfig(
|
|
945
|
+
uint256 projectId,
|
|
946
|
+
address coreContract
|
|
947
|
+
) internal view returns (SEAProjectConfig storage) {
|
|
948
|
+
return s().SEAProjectConfigs[coreContract][projectId];
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* @notice Return the storage struct for reading and writing. This library
|
|
953
|
+
* uses a diamond storage pattern when managing storage.
|
|
954
|
+
* @return storageStruct The SEALibStorage struct.
|
|
955
|
+
*/
|
|
956
|
+
function s() internal pure returns (SEALibStorage storage storageStruct) {
|
|
957
|
+
bytes32 position = SEA_LIB_STORAGE_POSITION;
|
|
958
|
+
assembly ("memory-safe") {
|
|
959
|
+
storageStruct.slot := position
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
|
|
940
963
|
/**
|
|
941
964
|
* @notice Function to overwrite the active auction for a project with a new auction.
|
|
942
965
|
* @dev This function is used to initialize a new auction. Care must be
|
|
@@ -947,7 +970,7 @@ library SEALib {
|
|
|
947
970
|
* @param bidder initial bidder's payable address
|
|
948
971
|
* @return endTime end time of the newly created auction
|
|
949
972
|
*/
|
|
950
|
-
function
|
|
973
|
+
function _overwriteProjectActiveAuction(
|
|
951
974
|
SEAProjectConfig storage SEAProjectConfig_,
|
|
952
975
|
uint256 targetTokenId,
|
|
953
976
|
uint256 bidAmount,
|
|
@@ -967,29 +990,4 @@ library SEALib {
|
|
|
967
990
|
settled: false
|
|
968
991
|
});
|
|
969
992
|
}
|
|
970
|
-
|
|
971
|
-
/**
|
|
972
|
-
* Loads the SEAProjectConfig for a given project and core
|
|
973
|
-
* contract.
|
|
974
|
-
* @param projectId Project Id to get config for
|
|
975
|
-
* @param coreContract Core contract address to get config for
|
|
976
|
-
*/
|
|
977
|
-
function getSEAProjectConfig(
|
|
978
|
-
uint256 projectId,
|
|
979
|
-
address coreContract
|
|
980
|
-
) internal view returns (SEAProjectConfig storage) {
|
|
981
|
-
return s().SEAProjectConfigs[coreContract][projectId];
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
/**
|
|
985
|
-
* @notice Return the storage struct for reading and writing. This library
|
|
986
|
-
* uses a diamond storage pattern when managing storage.
|
|
987
|
-
* @return storageStruct The SEALibStorage struct.
|
|
988
|
-
*/
|
|
989
|
-
function s() internal pure returns (SEALibStorage storage storageStruct) {
|
|
990
|
-
bytes32 position = SEA_LIB_STORAGE_POSITION;
|
|
991
|
-
assembly ("memory-safe") {
|
|
992
|
-
storageStruct.slot := position
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
993
|
}
|
|
@@ -95,14 +95,10 @@ library SetPriceLib {
|
|
|
95
95
|
uint256 projectId,
|
|
96
96
|
address coreContract
|
|
97
97
|
) internal {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
// update storage with solidity initial values
|
|
104
|
-
setPriceProjectConfig.pricePerToken = uint248(0);
|
|
105
|
-
setPriceProjectConfig.priceIsConfigured = false;
|
|
98
|
+
// @dev all fields must be deleted, and none of them are a complex type
|
|
99
|
+
// @dev getSetPriceProjectConfig not used, as deletion of storage
|
|
100
|
+
// pointers is not supported
|
|
101
|
+
delete s().setPriceProjectConfigs[coreContract][projectId];
|
|
106
102
|
|
|
107
103
|
emit PricePerTokenReset({
|
|
108
104
|
projectId: projectId,
|
|
@@ -41,7 +41,7 @@ library SettlementExpLib {
|
|
|
41
41
|
// position of Settlement Exp Lib storage, using a diamond storage pattern
|
|
42
42
|
// for this library
|
|
43
43
|
bytes32 constant SETTLEMENT_EXP_LIB_STORAGE_POSITION =
|
|
44
|
-
keccak256("
|
|
44
|
+
keccak256("settlementexplib.storage");
|
|
45
45
|
|
|
46
46
|
bytes32 internal constant CONFIG_CURRENT_SETTLED_PRICE =
|
|
47
47
|
"currentSettledPrice";
|
|
@@ -106,58 +106,6 @@ library SettlementExpLib {
|
|
|
106
106
|
mapping(address walletAddress => mapping(address coreContract => mapping(uint256 projectId => Receipt))) receipts;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
/**
|
|
110
|
-
* @notice This function updates the _receipt to include `msg.value` and increments
|
|
111
|
-
* the number of tokens purchased by 1. It then checks that the updated
|
|
112
|
-
* receipt is valid (i.e. sufficient funds have been posted for the
|
|
113
|
-
* number of tokens purchased on the updated receipt), and reverts if not.
|
|
114
|
-
* The new receipt net posted and num purchased are then returned to make
|
|
115
|
-
* the values available in a gas-efficient manner to the caller of this
|
|
116
|
-
* function.
|
|
117
|
-
* @param walletAddress Address of user to update receipt for
|
|
118
|
-
* @param projectId Project ID to update receipt for
|
|
119
|
-
* @param coreContract Core contract address
|
|
120
|
-
* @param currentPriceInWei current price of token in Wei
|
|
121
|
-
* @return netPosted total funds posted by user on project (that have not
|
|
122
|
-
* been yet settled), including the current transaction
|
|
123
|
-
* @return numPurchased total number of tokens purchased by user on
|
|
124
|
-
* project, including the current transaction
|
|
125
|
-
*/
|
|
126
|
-
function _validateReceiptEffects(
|
|
127
|
-
address walletAddress,
|
|
128
|
-
uint256 projectId,
|
|
129
|
-
address coreContract,
|
|
130
|
-
uint256 currentPriceInWei
|
|
131
|
-
) private returns (uint232 netPosted, uint24 numPurchased) {
|
|
132
|
-
Receipt storage receipt = getReceipt({
|
|
133
|
-
walletAddress: walletAddress,
|
|
134
|
-
projectId: projectId,
|
|
135
|
-
coreContract: coreContract
|
|
136
|
-
});
|
|
137
|
-
// in memory copy + update
|
|
138
|
-
netPosted = (receipt.netPosted + msg.value).toUint232();
|
|
139
|
-
numPurchased = receipt.numPurchased + 1;
|
|
140
|
-
|
|
141
|
-
// require sufficient payment on project
|
|
142
|
-
require(
|
|
143
|
-
netPosted >= numPurchased * currentPriceInWei,
|
|
144
|
-
"Min value to mint req."
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
// update Receipt in storage
|
|
148
|
-
receipt.netPosted = netPosted;
|
|
149
|
-
receipt.numPurchased = numPurchased;
|
|
150
|
-
|
|
151
|
-
// emit event indicating new receipt state
|
|
152
|
-
emit ReceiptUpdated({
|
|
153
|
-
purchaser: msg.sender,
|
|
154
|
-
projectId: projectId,
|
|
155
|
-
coreContract: coreContract,
|
|
156
|
-
numPurchased: numPurchased,
|
|
157
|
-
netPosted: netPosted
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
109
|
/**
|
|
162
110
|
* @notice Distributes the net revenues from the project's auction, and
|
|
163
111
|
* marks the auction as having had its revenues collected.
|
|
@@ -193,9 +141,9 @@ library SettlementExpLib {
|
|
|
193
141
|
|
|
194
142
|
// get the current net price of the auction - reverts if no auction
|
|
195
143
|
// is configured.
|
|
196
|
-
// @dev we use
|
|
144
|
+
// @dev we use getPriceUnsafe here, since we just safely synced the
|
|
197
145
|
// project's max invocations and maxHasBeenInvoked, which guarantees
|
|
198
|
-
// an accurate price calculation from
|
|
146
|
+
// an accurate price calculation from getPriceUnsafe, while being
|
|
199
147
|
// more gas efficient than getPriceSafe.
|
|
200
148
|
// @dev price is guaranteed <= _projectConfig.latestPurchasePrice,
|
|
201
149
|
// since this minter enforces monotonically decreasing purchase prices.
|
|
@@ -252,7 +200,8 @@ library SettlementExpLib {
|
|
|
252
200
|
} else {
|
|
253
201
|
// base price of zero indicates that the auction has not been configured,
|
|
254
202
|
// since base price of zero is not allowed when configuring an auction.
|
|
255
|
-
// @dev no coverage else branch of following line because redundant
|
|
203
|
+
// @dev no coverage else branch of following line because redundant,
|
|
204
|
+
// acknowledge redundant check
|
|
256
205
|
require(basePrice > 0, "Only latestPurchasePrice > 0");
|
|
257
206
|
// if the price is base price, the auction is valid and may be claimed
|
|
258
207
|
// update the latest purchase price to the base price, to ensure
|
|
@@ -309,13 +258,20 @@ library SettlementExpLib {
|
|
|
309
258
|
* @param coreContract Core contract address
|
|
310
259
|
* @param purchaserAddress Address to reclaim excess settlement funds for
|
|
311
260
|
* @param to Address to send excess settlement funds to
|
|
261
|
+
* @param doSendFunds If true, sends funds to `to`. If false, only updates
|
|
262
|
+
* the receipt to reflect the new funds posted, and returns the amount of
|
|
263
|
+
* excess settlement funds that still need to be sent to `to`.
|
|
264
|
+
* @return remainingUnsentExcessSettlementFunds amount of excess settlement
|
|
265
|
+
* funds that still need to be sent to `to`, in wei. If doSendFunds, this
|
|
266
|
+
* value will be zero, because funds will have been sent to `to`.
|
|
312
267
|
*/
|
|
313
268
|
function reclaimProjectExcessSettlementFundsTo(
|
|
314
269
|
address payable to,
|
|
315
270
|
uint256 projectId,
|
|
316
271
|
address coreContract,
|
|
317
|
-
address purchaserAddress
|
|
318
|
-
|
|
272
|
+
address purchaserAddress,
|
|
273
|
+
bool doSendFunds
|
|
274
|
+
) internal returns (uint256 remainingUnsentExcessSettlementFunds) {
|
|
319
275
|
(
|
|
320
276
|
uint256 excessSettlementFunds,
|
|
321
277
|
uint256 requiredAmountPosted
|
|
@@ -353,9 +309,14 @@ library SettlementExpLib {
|
|
|
353
309
|
});
|
|
354
310
|
|
|
355
311
|
// INTERACTIONS
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
312
|
+
if (doSendFunds) {
|
|
313
|
+
bool success_;
|
|
314
|
+
(success_, ) = to.call{value: excessSettlementFunds}("");
|
|
315
|
+
require(success_, "Reclaiming failed");
|
|
316
|
+
} else {
|
|
317
|
+
// return unsent funds amount to caller
|
|
318
|
+
remainingUnsentExcessSettlementFunds = excessSettlementFunds;
|
|
319
|
+
}
|
|
359
320
|
}
|
|
360
321
|
|
|
361
322
|
/**
|
|
@@ -516,7 +477,7 @@ library SettlementExpLib {
|
|
|
516
477
|
}
|
|
517
478
|
|
|
518
479
|
/**
|
|
519
|
-
* Returns number of purchases that have been made on the minter, for a
|
|
480
|
+
* @notice Returns number of purchases that have been made on the minter, for a
|
|
520
481
|
* given project.
|
|
521
482
|
* @param projectId The id of the project.
|
|
522
483
|
* @param coreContract The address of the core contract.
|
|
@@ -651,37 +612,25 @@ library SettlementExpLib {
|
|
|
651
612
|
uint256 projectId,
|
|
652
613
|
address coreContract
|
|
653
614
|
) internal view returns (uint256 tokenPriceInWei) {
|
|
654
|
-
//
|
|
655
|
-
|
|
656
|
-
|
|
615
|
+
// get up-to-date maxHasBeenInvoked state from core contract
|
|
616
|
+
bool maxHasBeenInvokedSafe = MaxInvocationsLib
|
|
617
|
+
.projectMaxHasBeenInvokedSafe({
|
|
657
618
|
projectId: projectId,
|
|
658
619
|
coreContract: coreContract
|
|
659
620
|
});
|
|
660
|
-
//
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
) {
|
|
667
|
-
// max invocations have been reached, return the latest purchased
|
|
668
|
-
// price
|
|
669
|
-
tokenPriceInWei = settlementAuctionProjectConfig
|
|
670
|
-
.latestPurchasePrice;
|
|
671
|
-
} else {
|
|
672
|
-
// if not sold out, return the current price via getPriceUnsafe
|
|
673
|
-
tokenPriceInWei = getPriceUnsafe({
|
|
674
|
-
projectId: projectId,
|
|
675
|
-
coreContract: coreContract,
|
|
676
|
-
maxHasBeenInvoked: false // this branch is only reached if max invocations have not been reached
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
return tokenPriceInWei;
|
|
621
|
+
// get price using up-to-date maxHasBeenInvoked state
|
|
622
|
+
tokenPriceInWei = getPriceUnsafe({
|
|
623
|
+
projectId: projectId,
|
|
624
|
+
coreContract: coreContract,
|
|
625
|
+
maxHasBeenInvoked: maxHasBeenInvokedSafe
|
|
626
|
+
});
|
|
680
627
|
}
|
|
681
628
|
|
|
682
629
|
/**
|
|
683
630
|
* @notice Returns if a new auction's start price is valid, given the current
|
|
684
631
|
* state of the project's settlement auction configuration.
|
|
632
|
+
* @dev does not check for non-zero start price, since startPrice > basePrice
|
|
633
|
+
* is checked in DAExpLib.
|
|
685
634
|
* @param projectId Project ID to check start price for
|
|
686
635
|
* @param coreContract Core contract address to check start price for
|
|
687
636
|
* @param startPrice starting price of new auction, in wei
|
|
@@ -702,13 +651,15 @@ library SettlementExpLib {
|
|
|
702
651
|
// claiming logic. Since base price is always non-zero, if
|
|
703
652
|
// latestPurchasePrice is zero, then no previous purchases have been
|
|
704
653
|
// made, and startPrice may be set to any value.
|
|
654
|
+
// @dev DAExpLib checks that startPrice > basePrice, so no need to
|
|
655
|
+
// check for non-zero startPrice here.
|
|
705
656
|
return (settlementAuctionProjectConfig.latestPurchasePrice == 0 || // never purchased
|
|
706
657
|
startPrice <= settlementAuctionProjectConfig.latestPurchasePrice);
|
|
707
658
|
}
|
|
708
659
|
|
|
709
660
|
/**
|
|
710
|
-
* Loads the SettlementAuctionProjectConfig for a given project and
|
|
711
|
-
* contract.
|
|
661
|
+
* @notice Loads the SettlementAuctionProjectConfig for a given project and
|
|
662
|
+
* core contract.
|
|
712
663
|
* @param projectId Project Id to get config for
|
|
713
664
|
* @param coreContract Core contract address to get config for
|
|
714
665
|
*/
|
|
@@ -720,7 +671,7 @@ library SettlementExpLib {
|
|
|
720
671
|
}
|
|
721
672
|
|
|
722
673
|
/**
|
|
723
|
-
* Loads the Receipt for a given user, project and core contract.
|
|
674
|
+
* @notice Loads the Receipt for a given user, project and core contract.
|
|
724
675
|
* @param walletAddress User address to get receipt for
|
|
725
676
|
* @param projectId Project Id to get config for
|
|
726
677
|
* @param coreContract Core contract address to get config for
|
|
@@ -750,7 +701,7 @@ library SettlementExpLib {
|
|
|
750
701
|
}
|
|
751
702
|
|
|
752
703
|
/**
|
|
753
|
-
* Returns if all tokens to be auctioned were sold, for a given project.
|
|
704
|
+
* @notice Returns if all tokens to be auctioned were sold, for a given project.
|
|
754
705
|
* Returns false if the number of tokens to be auctioned is zero, since
|
|
755
706
|
* that is the default value for unconfigured values.
|
|
756
707
|
* @param settlementAuctionProjectConfig The SettlementAuctionProjectConfig
|
|
@@ -767,4 +718,56 @@ library SettlementExpLib {
|
|
|
767
718
|
settlementAuctionProjectConfig.numPurchasesOnMinter ==
|
|
768
719
|
numTokensToBeAuctioned;
|
|
769
720
|
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* @notice This function updates the receipt to include `msg.value` and increments
|
|
724
|
+
* the number of tokens purchased by 1. It then checks that the updated
|
|
725
|
+
* receipt is valid (i.e. sufficient funds have been posted for the
|
|
726
|
+
* number of tokens purchased on the updated receipt), and reverts if not.
|
|
727
|
+
* The new receipt net posted and num purchased are then returned to make
|
|
728
|
+
* the values available in a gas-efficient manner to the caller of this
|
|
729
|
+
* function.
|
|
730
|
+
* @param walletAddress Address of user to update receipt for
|
|
731
|
+
* @param projectId Project ID to update receipt for
|
|
732
|
+
* @param coreContract Core contract address
|
|
733
|
+
* @param currentPriceInWei current price of token in Wei
|
|
734
|
+
* @return netPosted total funds posted by user on project (that have not
|
|
735
|
+
* been yet settled), including the current transaction
|
|
736
|
+
* @return numPurchased total number of tokens purchased by user on
|
|
737
|
+
* project, including the current transaction
|
|
738
|
+
*/
|
|
739
|
+
function _validateReceiptEffects(
|
|
740
|
+
address walletAddress,
|
|
741
|
+
uint256 projectId,
|
|
742
|
+
address coreContract,
|
|
743
|
+
uint256 currentPriceInWei
|
|
744
|
+
) private returns (uint232 netPosted, uint24 numPurchased) {
|
|
745
|
+
Receipt storage receipt = getReceipt({
|
|
746
|
+
walletAddress: walletAddress,
|
|
747
|
+
projectId: projectId,
|
|
748
|
+
coreContract: coreContract
|
|
749
|
+
});
|
|
750
|
+
// in memory copy + update
|
|
751
|
+
netPosted = (receipt.netPosted + msg.value).toUint232();
|
|
752
|
+
numPurchased = receipt.numPurchased + 1;
|
|
753
|
+
|
|
754
|
+
// require sufficient payment on project
|
|
755
|
+
require(
|
|
756
|
+
netPosted >= numPurchased * currentPriceInWei,
|
|
757
|
+
"Min value to mint req."
|
|
758
|
+
);
|
|
759
|
+
|
|
760
|
+
// update Receipt in storage
|
|
761
|
+
receipt.netPosted = netPosted;
|
|
762
|
+
receipt.numPurchased = numPurchased;
|
|
763
|
+
|
|
764
|
+
// emit event indicating new receipt state
|
|
765
|
+
emit ReceiptUpdated({
|
|
766
|
+
purchaser: msg.sender,
|
|
767
|
+
projectId: projectId,
|
|
768
|
+
coreContract: coreContract,
|
|
769
|
+
numPurchased: numPurchased,
|
|
770
|
+
netPosted: netPosted
|
|
771
|
+
});
|
|
772
|
+
}
|
|
770
773
|
}
|
|
@@ -197,7 +197,9 @@ library SplitFundsLib {
|
|
|
197
197
|
* business practices, including end-to-end testing on mainnet, and
|
|
198
198
|
* admin-accepted artist payment addresses.
|
|
199
199
|
* @param projectId Project ID for which funds shall be split.
|
|
200
|
-
* @param pricePerToken Current price of token,
|
|
200
|
+
* @param pricePerToken Current price of token, in base units. For example,
|
|
201
|
+
* if the ERC20 token has 6 decimals, an input value of `1_000_000` would
|
|
202
|
+
* represent a price of `1.000000` tokens.
|
|
201
203
|
* @param coreContract Core contract address.
|
|
202
204
|
*/
|
|
203
205
|
function splitFundsERC20(
|
|
@@ -221,7 +223,6 @@ library SplitFundsLib {
|
|
|
221
223
|
currencyAddress != address(0),
|
|
222
224
|
"ERC20: payment not configured"
|
|
223
225
|
);
|
|
224
|
-
require(msg.value == 0, "ERC20: No ETH when using ERC20");
|
|
225
226
|
// ERC20 token is used for payment
|
|
226
227
|
validateERC20Approvals({
|
|
227
228
|
msgSender: msg.sender,
|
|
@@ -230,7 +231,7 @@ library SplitFundsLib {
|
|
|
230
231
|
});
|
|
231
232
|
projectCurrency = IERC20(currencyAddress);
|
|
232
233
|
}
|
|
233
|
-
// split remaining funds between foundation, artist, and artist's
|
|
234
|
+
// split remaining funds between foundation, artist, and artist's additional payee
|
|
234
235
|
bool isEngine_ = isEngine(coreContract);
|
|
235
236
|
uint256 renderProviderRevenue;
|
|
236
237
|
address payable renderProviderAddress;
|
|
@@ -333,9 +334,8 @@ library SplitFundsLib {
|
|
|
333
334
|
coreContract: coreContract
|
|
334
335
|
});
|
|
335
336
|
// recommend price reset if currency address was previously configured
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
337
|
+
recommendPriceReset = (splitFundsProjectConfig.currencyAddress !=
|
|
338
|
+
address(0));
|
|
339
339
|
splitFundsProjectConfig.currencySymbol = currencySymbol;
|
|
340
340
|
splitFundsProjectConfig.currencyAddress = currencyAddress;
|
|
341
341
|
|
|
@@ -478,10 +478,9 @@ library SplitFundsLib {
|
|
|
478
478
|
// also note that per Solidity ABI encoding, the address return
|
|
479
479
|
// values are padded to 32 bytes.
|
|
480
480
|
return true;
|
|
481
|
-
} else {
|
|
482
|
-
// unexpected return value length
|
|
483
|
-
revert("Unexpected revenue split bytes");
|
|
484
481
|
}
|
|
482
|
+
// unexpected return value length
|
|
483
|
+
revert("Unexpected revenue split bytes");
|
|
485
484
|
}
|
|
486
485
|
|
|
487
486
|
/**
|
|
@@ -491,8 +490,8 @@ library SplitFundsLib {
|
|
|
491
490
|
* `currencyAddress` is zero.
|
|
492
491
|
* @param projectId Project ID to get config for
|
|
493
492
|
* @param coreContract Core contract address to get config for
|
|
494
|
-
* @return currencyAddress
|
|
495
|
-
* @return currencySymbol
|
|
493
|
+
* @return currencyAddress currency address for the referenced SplitFundsProjectConfig.
|
|
494
|
+
* @return currencySymbol currency symbol for the referenced SplitFundsProjectConfig.
|
|
496
495
|
*/
|
|
497
496
|
function getCurrencyInfoERC20(
|
|
498
497
|
uint256 projectId,
|
|
@@ -518,7 +517,7 @@ library SplitFundsLib {
|
|
|
518
517
|
* @notice Gets the balance of `currencyAddress` ERC20 tokens for `walletAddress`.
|
|
519
518
|
* @param currencyAddress ERC20 token address.
|
|
520
519
|
* @param walletAddress wallet address.
|
|
521
|
-
* @return balance
|
|
520
|
+
* @return balance Balance of ERC-20
|
|
522
521
|
*/
|
|
523
522
|
function getERC20Balance(
|
|
524
523
|
address currencyAddress,
|
|
@@ -533,7 +532,7 @@ library SplitFundsLib {
|
|
|
533
532
|
* @param currencyAddress ERC20 token address.
|
|
534
533
|
* @param walletAddress wallet address.
|
|
535
534
|
* @param spenderAddress spender address.
|
|
536
|
-
* @return allowance
|
|
535
|
+
* @return allowance Allowance of ERC-20
|
|
537
536
|
*/
|
|
538
537
|
function getERC20Allowance(
|
|
539
538
|
address currencyAddress,
|
|
@@ -555,7 +554,9 @@ library SplitFundsLib {
|
|
|
555
554
|
* Reverts if insufficient allowance or balance.
|
|
556
555
|
* @param msgSender Address of the message sender to validate.
|
|
557
556
|
* @param currencyAddress Address of the ERC20 token to validate.
|
|
558
|
-
* @param pricePerToken Price
|
|
557
|
+
* @param pricePerToken Price of token, in base units. For example,
|
|
558
|
+
* if the ERC20 token has 6 decimals, an input value of `1_000_000` would
|
|
559
|
+
* represent a price of `1.000000` tokens.
|
|
559
560
|
*/
|
|
560
561
|
function validateERC20Approvals(
|
|
561
562
|
address msgSender,
|
|
@@ -578,6 +579,9 @@ library SplitFundsLib {
|
|
|
578
579
|
/**
|
|
579
580
|
* @notice Sends ETH revenues between providers, artist, and artist's
|
|
580
581
|
* additional payee. Reverts if any payment fails.
|
|
582
|
+
* @dev This function pays priviliged addresses. DoS is acknowledged, and
|
|
583
|
+
* mitigated by business practices, including end-to-end testing on
|
|
584
|
+
* mainnet, and admin-accepted artist payment addresses.
|
|
581
585
|
* @param platformProviderRevenue Platform Provider revenue.
|
|
582
586
|
* @param platformProviderAddress Platform Provider address.
|
|
583
587
|
* @param renderProviderRevenue Render Provider revenue.
|
|
@@ -628,7 +632,9 @@ library SplitFundsLib {
|
|
|
628
632
|
/**
|
|
629
633
|
* @notice Sends ERC20 revenues between providers, artist, and artist's
|
|
630
634
|
* additional payee. Reverts if any payment fails. All revenue values
|
|
631
|
-
* should
|
|
635
|
+
* should use base units. For example, if the ERC20 token has 6 decimals,
|
|
636
|
+
* an input value of `1_000_000` would represent an amount of `1.000000`
|
|
637
|
+
* tokens.
|
|
632
638
|
* @dev This function relies on msg.sender, so it must be called from
|
|
633
639
|
* the contract that is receiving the payment.
|
|
634
640
|
* @param projectCurrency IERC20 payment token.
|