@artblocks/contracts 1.0.3 → 1.0.4
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 +32 -25
- 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 +125 -17
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +6 -6
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV0.sol/MinterDAExpV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV1.sol/MinterDAExpV1.json +2 -2
- 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/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV0.sol/MinterDALinV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV1.sol/MinterDALinV1.json +2 -2
- 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/archive/minter-suite/Minters/MinterHolder/MinterHolderV0.sol/MinterHolderV0.json +2 -2
- 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/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV0.sol/MinterMerkleV0.json +2 -2
- 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/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV0.sol/MinterSetPriceV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV1.sol/MinterSetPriceV1.json +2 -2
- 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/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol/MinterSetPriceERC20V0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol/MinterSetPriceERC20V1.json +2 -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/engine/V2/GenArt721CoreV2_ENGINE_FLEX.sol/GenArt721CoreV2_ENGINE_FLEX.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721CoreV2_PBAB.sol/GenArt721CoreV2_PBAB.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721CoreV2_PRTNR.sol/GenArt721CoreV2_PRTNR.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol/GenArt721MinterBurner_PBAB.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721MinterDAExp_PBAB.sol/GenArt721MinterDAExp_PBAB.json +2 -2
- package/artifacts/contracts/engine/V2/GenArt721Minter_PBAB.sol/GenArt721Minter_PBAB.json +2 -2
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +6 -6
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +6 -6
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +4 -4
- 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 +6 -6
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +2 -2
- package/artifacts/contracts/engine-registry/EngineRegistryV0.sol/EngineRegistryV0.json +2 -2
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +6 -6
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IBonusContract.sol/IBonusContract.json +1 -1
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreContractV1.sol/IGenArt721CoreContractV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreV2_PBAB.sol/IGenArt721CoreV2_PBAB.json +1 -1
- package/artifacts/contracts/interfaces/{0.5.x → v0.5.x}/IRandomizer.sol/IRandomizer.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IAdminACLV0.sol/IAdminACLV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IArtblocksRoyaltyOverride.sol/IArtblocksRoyaltyOverride.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IBonusContract.sol/IBonusContract.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/ICoreRegistryV1.sol/ICoreRegistryV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDelegationRegistry.sol/IDelegationRegistry.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryCompatibleV0.sol/IDependencyRegistryCompatibleV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +3 -3
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IEngineRegistryV0.sol/IEngineRegistryV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV0.sol/IFilteredMinterDAExpSettlementV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlement_Mixin.sol/IFilteredMinterDAExpSettlement_Mixin.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV0.sol/IFilteredMinterDAExpV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV1.sol/IFilteredMinterDAExpV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV0.sol/IFilteredMinterDALinV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV1.sol/IFilteredMinterDALinV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV0.sol/IFilteredMinterHolderV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV1.sol/IFilteredMinterHolderV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV2.sol/IFilteredMinterHolderV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV0.sol/IFilteredMinterMerkleV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV1.sol/IFilteredMinterMerkleV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV2.sol/IFilteredMinterMerkleV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterSEAV0.sol/IFilteredMinterSEAV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV0.sol/IFilteredMinterV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV1.sol/IFilteredMinterV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV2.sol/IFilteredMinterV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractExposesHashSeed.sol/IGenArt721CoreContractExposesHashSeed.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV1.sol/IGenArt721CoreContractV1.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +1 -1
- package/artifacts/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3WithSharedRandomizer.sol/IGenArt721CoreContractV3WithSharedRandomizer.json +24 -0
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreV2_PBAB.sol/IGenArt721CoreV2_PBAB.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IManifold.sol/IManifold.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterBaseV0.sol/IMinterBaseV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV0.sol/IMinterFilterV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV1.sol/IMinterFilterV1.json +86 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPICoreV0.sol/IMintingAPICoreV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPIMinterV0.sol/IMintingAPIMinterV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer.sol/IRandomizer.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerPolyptychV0.sol/IRandomizerPolyptychV0.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerV2.sol/IRandomizerV2.json +1 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer_V3CoreBase.sol/IRandomizer_V3CoreBase.json +1 -1
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +207 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +93 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +93 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +69 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +203 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +123 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +261 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +64 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +533 -0
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +42 -26
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IWETH.sol/IWETH.json +1 -1
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Address.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Counters.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/CustomERC721Metadata.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/ERC721.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/ERC721Enumerable.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/GenArt721CoreV1.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/SafeMath.json +2 -2
- package/artifacts/contracts/legacy/GenArt721CoreV1.sol/Strings.json +2 -2
- package/artifacts/contracts/legacy/GenArt721LegacyMinter.sol/GenArt721LegacyMinter.json +2 -2
- package/artifacts/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol/DelegationRegistry.json +2 -2
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/CustomERC721Metadata.sol/CustomERC721Metadata.json +3 -3
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/IERC20.sol/IERC20.json +1 -1
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/SafeMath.sol/SafeMath.json +3 -3
- package/artifacts/contracts/libs/{0.5.x → v0.5.x}/Strings.sol/Strings.json +3 -3
- package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +10 -0
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV0.sol/BytecodeStorage.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol/BytecodeStorageReader.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol/BytecodeStorageWriter.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/Bytes32Strings.sol/Bytes32Strings.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/ERC721_PackedHashSeed.sol/ERC721_PackedHashSeed.json +3 -3
- package/artifacts/contracts/libs/{0.8.x → v0.8.x}/SSTORE2.sol/SSTORE2.json +3 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +10 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +10 -0
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV0.sol/MinterFilterV0.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 +58 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +1228 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +1146 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +909 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +1228 -0
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV4.sol/MinterDALinV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +909 -0
- package/artifacts/contracts/minter-suite/Minters/MinterHolderV4.sol/MinterHolderV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV0.sol/MinterSEAV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +1325 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +848 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +1091 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +1075 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +1243 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +1167 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +772 -0
- package/artifacts/contracts/mock/BytecodeV0TextCR_DMock.sol/BytecodeV0TextCR_DMock.json +2 -2
- package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +2 -2
- package/artifacts/contracts/mock/BytecodeV1TextCR_DMock.sol/BytecodeV1TextCR_DMock.json +4 -4
- package/artifacts/contracts/mock/DeadReceiverBidderMock.sol/DeadReceiverBidderMock.json +25 -2
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +28 -2
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -4
- package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +2 -2
- package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +2 -2
- package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
- package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyHolderMock.sol/ReentrancyHolderMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyMerkleMock.sol/ReentrancyMerkleMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyMock.sol/ReentrancyMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +2 -2
- package/artifacts/contracts/mock/SSTORE2Mock.sol/SSTORE2Mock.json +2 -2
- package/artifacts/contracts/randomizer/deprecated/BasicRandomizer.sol/BasicRandomizer.json +2 -2
- 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 +48 -32
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +2 -2
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol/GenArt721RoyaltyOverride_PBAB.json +2 -2
- package/contracts/AdminACLV0.sol +1 -1
- package/contracts/AdminACLV1.sol +1 -1
- package/contracts/DependencyRegistryV0.sol +216 -107
- package/contracts/GenArt721CoreV3.sol +27 -12
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol +3 -3
- package/contracts/engine/V2/GenArt721CoreV2_ENGINE_FLEX.sol +2 -2
- package/contracts/engine/V2/GenArt721CoreV2_PBAB.sol +2 -2
- package/contracts/engine/V2/GenArt721CoreV2_PRTNR.sol +3 -3
- package/contracts/engine/V2/GenArt721MinterBurner_PBAB.sol +2 -2
- package/contracts/engine/V2/GenArt721MinterDAExp_PBAB.sol +1 -1
- package/contracts/engine/V2/GenArt721Minter_PBAB.sol +2 -2
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +29 -14
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +29 -14
- package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +9 -9
- package/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol +1 -1
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +20 -15
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol +1 -1
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +1 -1
- package/contracts/engine-registry/CoreRegistryV1.sol +1 -1
- package/contracts/engine-registry/EngineRegistryV0.sol +1 -1
- package/contracts/explorations/GenArt721CoreV3_Explorations.sol +27 -12
- package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryV0.sol +2 -2
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3WithSharedRandomizer.sol +23 -0
- package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV1.sol +26 -0
- package/contracts/interfaces/v0.8.x/IRandomizer_V3CoreBase.sol +23 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +37 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +25 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +26 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +19 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +69 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +44 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +78 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +28 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +191 -0
- package/contracts/interfaces/{0.8.x → v0.8.x}/ISharedRandomizerV0.sol +42 -24
- package/contracts/legacy/GenArt721CoreV1.sol +2 -2
- package/contracts/legacy/GenArt721LegacyMinter.sol +5 -5
- package/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol +1 -1
- package/contracts/libs/v0.8.x/ABHelpers.sol +55 -0
- package/contracts/libs/v0.8.x/AuthLib.sol +197 -0
- package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +125 -0
- package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +109 -0
- package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +348 -0
- package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +175 -0
- package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +160 -0
- package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +320 -0
- package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +44 -0
- package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +390 -0
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +583 -0
- package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +153 -0
- package/contracts/minter-suite/MinterFilter/MinterFilterV0.sol +3 -3
- package/contracts/minter-suite/MinterFilter/MinterFilterV1.sol +5 -5
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +83 -9
- package/contracts/minter-suite/Minters/MinterBase_v0_1_1.sol +4 -4
- package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +966 -0
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +3 -3
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +1126 -0
- package/contracts/minter-suite/Minters/MinterDAExpV4.sol +3 -3
- package/contracts/minter-suite/Minters/MinterDAExpV5.sol +606 -0
- package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +952 -0
- package/contracts/minter-suite/Minters/MinterDALinV4.sol +3 -3
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +591 -0
- package/contracts/minter-suite/Minters/MinterHolderV4.sol +4 -4
- package/contracts/minter-suite/Minters/MinterMerkleV5.sol +4 -4
- package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +6 -6
- package/contracts/minter-suite/Minters/MinterSEAV0.sol +3 -3
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +1190 -0
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +5 -5
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +570 -0
- package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +821 -0
- package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +802 -0
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +1096 -0
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +992 -0
- package/contracts/minter-suite/Minters/MinterSetPriceV4.sol +3 -3
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +461 -0
- package/contracts/mock/BytecodeV0TextCR_DMock.sol +1 -1
- package/contracts/mock/BytecodeV1LibCallsMock.sol +1 -1
- package/contracts/mock/BytecodeV1TextCR_DMock.sol +1 -1
- package/contracts/mock/DeadReceiverBidderMock.sol +15 -0
- package/contracts/mock/DummySharedMinter.sol +2 -2
- package/contracts/mock/ERC20Mock.sol +16 -0
- package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +9 -9
- package/contracts/mock/MockAdminACLV0.sol +1 -1
- package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +1 -1
- package/contracts/mock/OriginRegisterMock.sol +1 -1
- package/contracts/mock/ReentrancyHolderMock.sol +1 -1
- package/contracts/mock/ReentrancyMerkleMock.sol +1 -1
- package/contracts/mock/ReentrancyMock.sol +1 -1
- package/contracts/mock/ReentrancySEAMock.sol +1 -1
- package/contracts/mock/SSTORE2Mock.sol +1 -1
- package/contracts/randomizer/deprecated/BasicRandomizer.sol +1 -1
- package/contracts/randomizer/deprecated/PolyptychRandomizerV0.sol +2 -2
- package/contracts/randomizer/deprecated/RandomizerV2.sol +2 -2
- package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +1 -1
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +91 -76
- package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +2 -2
- package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +2 -2
- package/package.json +46 -31
- package/LICENSE +0 -165
- package/contracts/interfaces/0.8.x/IRandomizer_V3CoreBase.sol +0 -10
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IBonusContract.sol +0 -0
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreContractV1.sol +0 -0
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IGenArt721CoreV2_PBAB.sol +0 -0
- /package/contracts/interfaces/{0.5.x → v0.5.x}/IRandomizer.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IAdminACLV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IArtblocksRoyaltyOverride.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IBonusContract.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IBytecodeStorageReader.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/ICoreRegistryV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IDelegationRegistry.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryCompatibleV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IEngineRegistryV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlementV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpSettlement_Mixin.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDAExpV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterDALinV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterHolderV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterMerkleV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterSEAV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractExposesHashSeed.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV1.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Base.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine_Flex.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreV2_PBAB.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IManifold.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterBaseV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMinterFilterV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPICoreV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IMintingAPIMinterV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IPseudorandomAtomic.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizer.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerPolyptychV0.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerV2.sol +0 -0
- /package/contracts/interfaces/{0.8.x → v0.8.x}/IWETH.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/CustomERC721Metadata.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/IERC20.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/SafeMath.sol +0 -0
- /package/contracts/libs/{0.5.x → v0.5.x}/Strings.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV0.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/BytecodeStorageV1.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/Bytes32Strings.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/ERC721_PackedHashSeed.sol +0 -0
- /package/contracts/libs/{0.8.x → v0.8.x}/SSTORE2.sol +0 -0
|
@@ -0,0 +1,1190 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
// Created By: Art Blocks Inc.
|
|
3
|
+
|
|
4
|
+
pragma solidity 0.8.19;
|
|
5
|
+
|
|
6
|
+
import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
|
|
7
|
+
import "../../interfaces/v0.8.x/ISharedMinterSEAV0.sol";
|
|
8
|
+
import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
9
|
+
|
|
10
|
+
import "../../libs/v0.8.x/ABHelpers.sol";
|
|
11
|
+
import "../../libs/v0.8.x/AuthLib.sol";
|
|
12
|
+
import "../../libs/v0.8.x/minter-libs/SEALib.sol";
|
|
13
|
+
import "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
|
|
14
|
+
import "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
|
|
15
|
+
|
|
16
|
+
import "@openzeppelin-4.7/contracts/token/ERC721/IERC721.sol";
|
|
17
|
+
import "@openzeppelin-4.7/contracts/security/ReentrancyGuard.sol";
|
|
18
|
+
import "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
|
|
19
|
+
import "@openzeppelin-4.7/contracts/utils/math/Math.sol";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @title Filtered Minter contract that allows tokens to be minted with ETH.
|
|
23
|
+
* Pricing is achieved using an automated serial English Auction mechanism.
|
|
24
|
+
* This is designed to be used with GenArt721CoreContractV3 flagship or
|
|
25
|
+
* engine contracts.
|
|
26
|
+
* @author Art Blocks Inc.
|
|
27
|
+
* @notice This contract was inspired by the release mechanism implemented by
|
|
28
|
+
* nouns.wtf, and we thank them for their pioneering work in this area.
|
|
29
|
+
/*********************************
|
|
30
|
+
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
|
|
31
|
+
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
|
|
32
|
+
* ░░░░░░█████████░░█████████░░░ *
|
|
33
|
+
* ░░░░░░██░░░████░░██░░░████░░░ *
|
|
34
|
+
* ░░██████░░░████████░░░████░░░ *
|
|
35
|
+
* ░░██░░██░░░████░░██░░░████░░░ *
|
|
36
|
+
* ░░██░░██░░░████░░██░░░████░░░ *
|
|
37
|
+
* ░░░░░░█████████░░█████████░░░ *
|
|
38
|
+
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
|
|
39
|
+
* ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ *
|
|
40
|
+
*********************************
|
|
41
|
+
* @notice Bid Front-Running:
|
|
42
|
+
* Collectors can front-run bids to become the highest bidder by bidding any
|
|
43
|
+
* amount sufficiently higher than the current highest bid, considering the
|
|
44
|
+
* minter-level configured value of `minterMinBidIncrementPercentage`. For
|
|
45
|
+
* instance, if current bid is 1 ETH, and collector A sends a transaction with
|
|
46
|
+
* a bid of 2.50 ETH, collector B may send a transaction with a bid of 2.499
|
|
47
|
+
* ETH, that if successfully front-runs Collector A's transaction, is able to
|
|
48
|
+
* cause collector A's transaction to revert. This is a difficult problem to
|
|
49
|
+
* get around in a decentralized system with public bids, and we have chosen to
|
|
50
|
+
* keep the minter simple and transparent, and leave it up to collectors to
|
|
51
|
+
* understand the risks of front-running and bid accordingly.
|
|
52
|
+
* @notice Token Ownership:
|
|
53
|
+
* This minter contract may own up to two tokens at a time for a given project.
|
|
54
|
+
* The first possible token owned is the token that is currently being
|
|
55
|
+
* auctioned. During the auction, the token is owned by the minter contract.
|
|
56
|
+
* Once the auction ends, the token is transferred to the winning bidder via a
|
|
57
|
+
* call to "settle" the auction.
|
|
58
|
+
* The second possible token owned is the token that will be auctioned next.
|
|
59
|
+
* This token is minted to and owned by the minter contract whenever possible
|
|
60
|
+
* (i.e. when the project's max invocations has not been reached) when an
|
|
61
|
+
* artist configures their project on this minter, or when a new auction is
|
|
62
|
+
* started. The purpose of this token is to allow users to have a preview of
|
|
63
|
+
* the next token that will be auctioned, even before the auction has started.
|
|
64
|
+
* @notice Privileged Roles and Ownership:
|
|
65
|
+
* This contract is designed to be managed, with limited powers.
|
|
66
|
+
* Privileged roles and abilities are controlled by the core contract's Admin
|
|
67
|
+
* ACL contract and a project's artist. Both of these roles hold extensive
|
|
68
|
+
* power and can modify minter details.
|
|
69
|
+
* Care must be taken to ensure that the admin ACL contract and artist
|
|
70
|
+
* addresses are secure behind a multi-sig or other access control mechanism.
|
|
71
|
+
* ----------------------------------------------------------------------------
|
|
72
|
+
* The following functions are restricted to the core contract's Admin ACL
|
|
73
|
+
* contract:
|
|
74
|
+
* - ejectNextTokenTo
|
|
75
|
+
* ----------------------------------------------------------------------------
|
|
76
|
+
* The following functions are restricted to this minter's minter filter's
|
|
77
|
+
* Admin ACL contract:
|
|
78
|
+
* - updateMinterTimeBufferSeconds
|
|
79
|
+
* - updateRefundGasLimit
|
|
80
|
+
* ----------------------------------------------------------------------------
|
|
81
|
+
* The following functions are restricted to a project's artist:
|
|
82
|
+
* - syncProjectMaxInvocationsToCore
|
|
83
|
+
* - manuallyLimitProjectMaxInvocations
|
|
84
|
+
* - configureFutureAuctions
|
|
85
|
+
* - tryPopulateNextToken
|
|
86
|
+
* ----------------------------------------------------------------------------
|
|
87
|
+
* The following functions are restricted to a project's artist or the core
|
|
88
|
+
* contract's Admin ACL contract:
|
|
89
|
+
* - resetFutureAuctionDetails
|
|
90
|
+
* ----------------------------------------------------------------------------
|
|
91
|
+
* Additional admin and artist privileged roles may be described on other
|
|
92
|
+
* contracts that this minter integrates with.
|
|
93
|
+
*
|
|
94
|
+
* @dev Note that while this minter makes use of `block.timestamp` and it is
|
|
95
|
+
* technically possible that this value is manipulated by block producers, such
|
|
96
|
+
* manipulation will not have material impact on the ability for collectors to
|
|
97
|
+
* place a bid before auction end time. This is due to the admin-configured
|
|
98
|
+
* `minterTimeBufferSeconds` parameter, which will used to ensure that
|
|
99
|
+
* collectors have sufficient time to place a bid after the final bid and
|
|
100
|
+
* before the auction end time.
|
|
101
|
+
*/
|
|
102
|
+
contract MinterSEAV1 is ReentrancyGuard, ISharedMinterV0, ISharedMinterSEAV0 {
|
|
103
|
+
using SafeCast for uint256;
|
|
104
|
+
|
|
105
|
+
/// Minter filter address this minter interacts with
|
|
106
|
+
address public immutable minterFilterAddress;
|
|
107
|
+
|
|
108
|
+
/// Minter filter this minter may interact with.
|
|
109
|
+
IMinterFilterV1 private immutable minterFilter;
|
|
110
|
+
|
|
111
|
+
/// minterType for this minter
|
|
112
|
+
string public constant minterType = "MinterSEAV1";
|
|
113
|
+
|
|
114
|
+
/// minter version for this minter
|
|
115
|
+
string public constant minterVersion = "v1.0.0";
|
|
116
|
+
|
|
117
|
+
uint256 public constant MIN_AUCTION_DURATION_SECONDS = 60; // seconds
|
|
118
|
+
|
|
119
|
+
// minter-wide, AdminACL-configurable parameters, where AdminACL is the
|
|
120
|
+
// admin of this minter's MinterFilter.
|
|
121
|
+
// ----------------------------------------
|
|
122
|
+
// minimum time remaining in auction after a new bid is placed
|
|
123
|
+
// configureable by admin, default to 120 seconds
|
|
124
|
+
// max uint32 ~= 4.3e9 sec ~= 136 years
|
|
125
|
+
// @dev used when determining the buffer time for any new bid on the
|
|
126
|
+
// minter, across all projects
|
|
127
|
+
uint32 minterTimeBufferSeconds = 120;
|
|
128
|
+
// gas limit for refunding ETH to bidders
|
|
129
|
+
// configurable by admin, default to 30,000
|
|
130
|
+
// max uint24 ~= 16 million gas, more than enough for a refund
|
|
131
|
+
// @dev SENDALL fallback is used to refund ETH if this limit is exceeded
|
|
132
|
+
uint24 minterRefundGasLimit = 30_000;
|
|
133
|
+
|
|
134
|
+
// storage mappings for project and contract configs
|
|
135
|
+
// @dev base minter project config is not used on this minter, therefore no
|
|
136
|
+
// mapping is declared here to ProjectConfig structs
|
|
137
|
+
|
|
138
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
139
|
+
// STATE VARIABLES FOR SplitFundsLib begin here
|
|
140
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
141
|
+
|
|
142
|
+
// contractAddress => IsEngineCache
|
|
143
|
+
mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
|
|
144
|
+
|
|
145
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
146
|
+
// STATE VARIABLES FOR SplitFundsLib end here
|
|
147
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
148
|
+
|
|
149
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
150
|
+
// STATE VARIABLES FOR MaxInvocationsLib begin here
|
|
151
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
152
|
+
|
|
153
|
+
// contractAddress => projectId => max invocations specific project config
|
|
154
|
+
mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
|
|
155
|
+
private _maxInvocationsProjectConfigMapping;
|
|
156
|
+
|
|
157
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
158
|
+
// STATE VARIABLES FOR MaxInvocationsLib end here
|
|
159
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
160
|
+
|
|
161
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
162
|
+
// STATE VARIABLES FOR SEALib begin here
|
|
163
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
164
|
+
|
|
165
|
+
// contractAddress => projectId => SEA project config
|
|
166
|
+
mapping(address => mapping(uint256 => SEALib.SEAProjectConfig))
|
|
167
|
+
private _SEAProjectConfigs;
|
|
168
|
+
|
|
169
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
170
|
+
// STATE VARIABLES FOR SEALib end here
|
|
171
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
172
|
+
|
|
173
|
+
// MODIFIERS
|
|
174
|
+
// @dev contract uses modifier-like internal functions instead of modifiers
|
|
175
|
+
// to reduce contract bytecode size
|
|
176
|
+
// @dev contract uses AuthLib for some modifier-like functions
|
|
177
|
+
|
|
178
|
+
// function to require that a value is non-zero
|
|
179
|
+
function _onlyNonZero(uint256 _value) internal pure {
|
|
180
|
+
require(_value != 0, "Only non-zero");
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @notice Initializes contract to be a shared, filtered minter for
|
|
185
|
+
* minter filter `_minterFilter`
|
|
186
|
+
* @param _minterFilter Minter filter for which this will be a minter
|
|
187
|
+
*/
|
|
188
|
+
constructor(address _minterFilter) ReentrancyGuard() {
|
|
189
|
+
minterFilterAddress = _minterFilter;
|
|
190
|
+
minterFilter = IMinterFilterV1(_minterFilter);
|
|
191
|
+
// emit events indicating default minter configuration values
|
|
192
|
+
emit MinAuctionDurationSecondsUpdated(MIN_AUCTION_DURATION_SECONDS);
|
|
193
|
+
emit MinterTimeBufferUpdated(minterTimeBufferSeconds);
|
|
194
|
+
emit MinterRefundGasLimitUpdated(minterRefundGasLimit);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @notice Manually sets the local maximum invocations of project `_projectId`
|
|
199
|
+
* with the provided `_maxInvocations`, checking that `_maxInvocations` is less
|
|
200
|
+
* than or equal to the value of project `_project_id`'s maximum invocations that is
|
|
201
|
+
* set on the core contract.
|
|
202
|
+
* @dev Note that a `_maxInvocations` of 0 can only be set if the current `invocations`
|
|
203
|
+
* value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
|
|
204
|
+
* this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
|
|
205
|
+
* @param _projectId Project ID to set the maximum invocations for.
|
|
206
|
+
* @param _coreContract Core contract address for the given project.
|
|
207
|
+
* @param _maxInvocations Maximum invocations to set for the project.
|
|
208
|
+
*/
|
|
209
|
+
function manuallyLimitProjectMaxInvocations(
|
|
210
|
+
uint256 _projectId,
|
|
211
|
+
address _coreContract,
|
|
212
|
+
uint24 _maxInvocations
|
|
213
|
+
) external {
|
|
214
|
+
AuthLib.onlyArtist({
|
|
215
|
+
_projectId: _projectId,
|
|
216
|
+
_coreContract: _coreContract,
|
|
217
|
+
_sender: msg.sender
|
|
218
|
+
});
|
|
219
|
+
MaxInvocationsLib.manuallyLimitProjectMaxInvocations(
|
|
220
|
+
_projectId,
|
|
221
|
+
_coreContract,
|
|
222
|
+
_maxInvocations,
|
|
223
|
+
_maxInvocationsProjectConfigMapping[_coreContract][_projectId]
|
|
224
|
+
);
|
|
225
|
+
emit ProjectMaxInvocationsLimitUpdated(
|
|
226
|
+
_projectId,
|
|
227
|
+
_coreContract,
|
|
228
|
+
_maxInvocations
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
// @dev the following is unique behavior to this minter
|
|
232
|
+
// for convenience, try to mint and assign a token to the project's
|
|
233
|
+
// next slot
|
|
234
|
+
_tryMintTokenToNextSlot(_projectId, _coreContract);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @notice Sets the minter-wide time buffer in seconds. The time buffer is
|
|
239
|
+
* the minimum amount of time that must pass between the final bid and the
|
|
240
|
+
* the end of an auction. Auctions are extended if a new bid is placed
|
|
241
|
+
* within this time buffer of the auction end time.
|
|
242
|
+
* @param _minterTimeBufferSeconds Time buffer in seconds.
|
|
243
|
+
*/
|
|
244
|
+
function updateMinterTimeBufferSeconds(
|
|
245
|
+
uint32 _minterTimeBufferSeconds
|
|
246
|
+
) external {
|
|
247
|
+
// CHECKS
|
|
248
|
+
_onlyNonZero(_minterTimeBufferSeconds);
|
|
249
|
+
AuthLib.onlyMinterFilterAdminACL({
|
|
250
|
+
_minterFilterAddress: minterFilterAddress,
|
|
251
|
+
_sender: msg.sender,
|
|
252
|
+
_contract: address(this),
|
|
253
|
+
_selector: this.updateMinterTimeBufferSeconds.selector
|
|
254
|
+
});
|
|
255
|
+
// EFFECTS
|
|
256
|
+
minterTimeBufferSeconds = _minterTimeBufferSeconds;
|
|
257
|
+
emit MinterTimeBufferUpdated(_minterTimeBufferSeconds);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @notice Sets the gas limit during ETH refunds when a collector is
|
|
262
|
+
* outbid. This value should be set to a value that is high enough to
|
|
263
|
+
* ensure that refunds are successful for commonly used wallets, but low
|
|
264
|
+
* enough to avoid excessive abuse of refund gas allowance during a new
|
|
265
|
+
* bid.
|
|
266
|
+
* @dev max gas limit is ~16M, which is considered well over a future-safe
|
|
267
|
+
* upper bound.
|
|
268
|
+
* @param _minterRefundGasLimit Gas limit to set for refunds. Must be
|
|
269
|
+
* between 7,000 and max uint24 (~16M).
|
|
270
|
+
*/
|
|
271
|
+
function updateRefundGasLimit(uint24 _minterRefundGasLimit) external {
|
|
272
|
+
// CHECKS
|
|
273
|
+
AuthLib.onlyMinterFilterAdminACL({
|
|
274
|
+
_minterFilterAddress: minterFilterAddress,
|
|
275
|
+
_sender: msg.sender,
|
|
276
|
+
_contract: address(this),
|
|
277
|
+
_selector: this.updateRefundGasLimit.selector
|
|
278
|
+
});
|
|
279
|
+
// @dev max gas limit implicitly checked by using uint16 input arg
|
|
280
|
+
// @dev min gas limit is based on rounding up current cost to send ETH
|
|
281
|
+
// to a Gnosis Safe wallet, which accesses cold address and emits event
|
|
282
|
+
require(_minterRefundGasLimit >= 7_000, "Only gte 7_000");
|
|
283
|
+
// EFFECTS
|
|
284
|
+
minterRefundGasLimit = _minterRefundGasLimit;
|
|
285
|
+
emit MinterRefundGasLimitUpdated(_minterRefundGasLimit);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @notice Sets auction details for project `_projectId`.
|
|
290
|
+
* If project does not have a "next token" assigned, this function attempts
|
|
291
|
+
* to mint a token and assign it to the project's next token slot.
|
|
292
|
+
* @param _projectId Project ID to set future auction details for.
|
|
293
|
+
* @param _coreContract Core contract address for the given project.
|
|
294
|
+
* @param _timestampStart Timestamp after which new auctions may be
|
|
295
|
+
* started. Note that this is not the timestamp of the auction start, but
|
|
296
|
+
* rather the timestamp after which a auction may be started. Also note
|
|
297
|
+
* that the passed value here must either be in the future, or `0` (which
|
|
298
|
+
* indicates that auctions are immediately startable).
|
|
299
|
+
* @param _auctionDurationSeconds Duration of new auctions, in seconds,
|
|
300
|
+
* before any extensions due to bids being placed inside buffer period near
|
|
301
|
+
* the end of an auction.
|
|
302
|
+
* @param _basePrice reserve price (minimum starting bid price), in wei.
|
|
303
|
+
* Must be greater than 0, but may be as low as 1 wei.
|
|
304
|
+
* @param _minBidIncrementPercentage Minimum percentage amount that a new
|
|
305
|
+
* bid must be over the previous bid. Must be greater than 0, and may be as
|
|
306
|
+
* high as 255. Recommended value is 5%. Values represent whole
|
|
307
|
+
* percentages, so a value of 5 represents 5%.
|
|
308
|
+
* @dev `_basePrice` of zero not allowed to prevent accidental
|
|
309
|
+
* misconfiguration of auctions
|
|
310
|
+
*/
|
|
311
|
+
function configureFutureAuctions(
|
|
312
|
+
uint256 _projectId,
|
|
313
|
+
address _coreContract,
|
|
314
|
+
uint256 _timestampStart,
|
|
315
|
+
uint256 _auctionDurationSeconds,
|
|
316
|
+
uint256 _basePrice,
|
|
317
|
+
uint8 _minBidIncrementPercentage
|
|
318
|
+
) external {
|
|
319
|
+
// CHECKS
|
|
320
|
+
_onlyNonZero(_basePrice);
|
|
321
|
+
_onlyNonZero(_minBidIncrementPercentage);
|
|
322
|
+
AuthLib.onlyArtist({
|
|
323
|
+
_projectId: _projectId,
|
|
324
|
+
_coreContract: _coreContract,
|
|
325
|
+
_sender: msg.sender
|
|
326
|
+
});
|
|
327
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
328
|
+
_coreContract
|
|
329
|
+
][_projectId];
|
|
330
|
+
MaxInvocationsLib.MaxInvocationsProjectConfig
|
|
331
|
+
storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
|
|
332
|
+
_coreContract
|
|
333
|
+
][_projectId];
|
|
334
|
+
require(
|
|
335
|
+
_timestampStart == 0 || block.timestamp < _timestampStart,
|
|
336
|
+
"Only future start times or 0"
|
|
337
|
+
);
|
|
338
|
+
require(
|
|
339
|
+
_auctionDurationSeconds >= MIN_AUCTION_DURATION_SECONDS,
|
|
340
|
+
"Auction duration below minimum"
|
|
341
|
+
);
|
|
342
|
+
// EFFECTS
|
|
343
|
+
_SEAProjectConfig.timestampStart = _timestampStart.toUint64();
|
|
344
|
+
_SEAProjectConfig.auctionDurationSeconds = _auctionDurationSeconds
|
|
345
|
+
.toUint32();
|
|
346
|
+
_SEAProjectConfig.basePrice = _basePrice;
|
|
347
|
+
_SEAProjectConfig
|
|
348
|
+
.minBidIncrementPercentage = _minBidIncrementPercentage;
|
|
349
|
+
|
|
350
|
+
emit ConfiguredFutureAuctions({
|
|
351
|
+
projectId: _projectId,
|
|
352
|
+
coreContract: _coreContract,
|
|
353
|
+
timestampStart: _timestampStart.toUint64(),
|
|
354
|
+
auctionDurationSeconds: _auctionDurationSeconds.toUint32(),
|
|
355
|
+
basePrice: _basePrice,
|
|
356
|
+
minBidIncrementPercentage: _minBidIncrementPercentage
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
// for convenience, sync local max invocations to the core contract if
|
|
360
|
+
// and only if max invocations have not already been synced.
|
|
361
|
+
// @dev do not sync if max invocations have already been synced, as
|
|
362
|
+
// local max invocations could have been manually set to be
|
|
363
|
+
// intentionally less than the core contract's max invocations.
|
|
364
|
+
// sync local max invocations if not initially populated
|
|
365
|
+
if (
|
|
366
|
+
MaxInvocationsLib.maxInvocationsIsUnconfigured(
|
|
367
|
+
_maxInvocationsProjectConfig
|
|
368
|
+
)
|
|
369
|
+
) {
|
|
370
|
+
syncProjectMaxInvocationsToCore(_projectId, _coreContract);
|
|
371
|
+
// @dev syncProjectMaxInvocationsToCore function calls
|
|
372
|
+
// _tryMintTokenToNextSlot, so we do not call it here.
|
|
373
|
+
} else {
|
|
374
|
+
// for convenience, try to mint to next token slot
|
|
375
|
+
_tryMintTokenToNextSlot(_projectId, _coreContract);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @notice Resets future auction configuration for project `_projectId` on
|
|
381
|
+
* core contract `_coreContract`, zero-ing out all details having to do
|
|
382
|
+
* with future auction parameters.
|
|
383
|
+
* This is not intended to be used in normal operation, but rather only in
|
|
384
|
+
* case of the need to halt the creation of any future auctions.
|
|
385
|
+
* Does not affect any project max invocation details.
|
|
386
|
+
* Does not affect any project next token details (i.e. if a next token is
|
|
387
|
+
* assigned, it will remain assigned and held by the minter until auction
|
|
388
|
+
* details are reconfigured).
|
|
389
|
+
* @param _projectId Project ID to reset future auction configuration
|
|
390
|
+
* details for.
|
|
391
|
+
* @param _coreContract Core contract address for the given project.
|
|
392
|
+
*/
|
|
393
|
+
function resetFutureAuctionDetails(
|
|
394
|
+
uint256 _projectId,
|
|
395
|
+
address _coreContract
|
|
396
|
+
) external {
|
|
397
|
+
AuthLib.onlyCoreAdminACLOrArtist({
|
|
398
|
+
_projectId: _projectId,
|
|
399
|
+
_coreContract: _coreContract,
|
|
400
|
+
_sender: msg.sender,
|
|
401
|
+
_contract: address(this),
|
|
402
|
+
_selector: this.resetFutureAuctionDetails.selector
|
|
403
|
+
});
|
|
404
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
405
|
+
_coreContract
|
|
406
|
+
][_projectId];
|
|
407
|
+
// reset to initial values
|
|
408
|
+
SEALib.resetFutureAuctionDetails(_SEAProjectConfig);
|
|
409
|
+
// @dev do not affect next token or max invocations
|
|
410
|
+
emit ResetAuctionDetails(_projectId, _coreContract);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* @notice Admin-only function that ejects a project's "next token" from
|
|
415
|
+
* the minter and sends it to the input `_to` address.
|
|
416
|
+
* This function is only intended for use in the edge case where the minter
|
|
417
|
+
* has a "next token" assigned to a project, but the project has been reset
|
|
418
|
+
* via `resetAuctionDetails`, and the artist does not want an auction to be
|
|
419
|
+
* started for the "next token". This function also protects against the
|
|
420
|
+
* unforseen case where the minter is in an unexpected state where it has a
|
|
421
|
+
* "next token" assigned to a project, but for some reason the project is
|
|
422
|
+
* unable to begin a new auction due to a bug.
|
|
423
|
+
* @dev only a single token may be actively assigned to a project's "next
|
|
424
|
+
* token" slot at any given time. This function will eject the token, and
|
|
425
|
+
* no further tokens will be assigned to the project's "next token" slot,
|
|
426
|
+
* unless the project is subsequently reconfigured via an artist call to
|
|
427
|
+
* `configureFutureAuctions`.
|
|
428
|
+
* @param _projectId Project ID to eject next token for.
|
|
429
|
+
* @param _coreContract Core contract address for the given project.
|
|
430
|
+
* @param _to Address to send the ejected token to.
|
|
431
|
+
*/
|
|
432
|
+
function ejectNextTokenTo(
|
|
433
|
+
uint256 _projectId,
|
|
434
|
+
address _coreContract,
|
|
435
|
+
address _to
|
|
436
|
+
) external {
|
|
437
|
+
AuthLib.onlyCoreAdminACL({
|
|
438
|
+
_coreContract: _coreContract,
|
|
439
|
+
_sender: msg.sender,
|
|
440
|
+
_contract: address(this),
|
|
441
|
+
_selector: this.ejectNextTokenTo.selector
|
|
442
|
+
});
|
|
443
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
444
|
+
_coreContract
|
|
445
|
+
][_projectId];
|
|
446
|
+
// CHECKS
|
|
447
|
+
// only if project is not configured (i.e. artist called
|
|
448
|
+
// `resetAuctionDetails`)
|
|
449
|
+
require(
|
|
450
|
+
!SEALib.projectIsConfigured(_SEAProjectConfig),
|
|
451
|
+
"Only unconfigured projects"
|
|
452
|
+
);
|
|
453
|
+
// only if project has a next token assigned
|
|
454
|
+
require(
|
|
455
|
+
_SEAProjectConfig.nextTokenNumberIsPopulated == true,
|
|
456
|
+
"No next token"
|
|
457
|
+
);
|
|
458
|
+
// EFFECTS
|
|
459
|
+
_SEAProjectConfig.nextTokenNumberIsPopulated = false;
|
|
460
|
+
// INTERACTIONS
|
|
461
|
+
// @dev overflow automatically handled by Sol ^0.8.0
|
|
462
|
+
uint256 nextTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
|
|
463
|
+
_projectId: _projectId,
|
|
464
|
+
_tokenNumber: _SEAProjectConfig.nextTokenNumber
|
|
465
|
+
});
|
|
466
|
+
IERC721(_coreContract).transferFrom({
|
|
467
|
+
from: address(this),
|
|
468
|
+
to: _to,
|
|
469
|
+
tokenId: nextTokenId
|
|
470
|
+
});
|
|
471
|
+
emit ProjectNextTokenEjected(_projectId, _coreContract);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @notice Settles any complete auction for token `_settleTokenId` (if
|
|
476
|
+
* applicable), then attempts to create a bid for token
|
|
477
|
+
* `_bidTokenId` with bid amount and bidder address equal to
|
|
478
|
+
* `msg.value` and `msg.sender`, respectively.
|
|
479
|
+
* Intended to gracefully handle the case where a user is front-run by
|
|
480
|
+
* one or more transactions to settle and/or initialize a new auction,
|
|
481
|
+
* potentially still placing a bid on the auction for the token ID if the
|
|
482
|
+
* bid value is sufficiently higher than the current highest bid.
|
|
483
|
+
* Note that the use of `_bidTokenId` is to prevent the possibility of
|
|
484
|
+
* transactions that are stuck in the pending pool for long periods of time
|
|
485
|
+
* from unintentionally bidding on auctions for future tokens.
|
|
486
|
+
* Note that calls to `settleAuction` and `createBid` are possible
|
|
487
|
+
* to be called in separate transactions, but this function is provided for
|
|
488
|
+
* convenience and executes both of those functions in a single
|
|
489
|
+
* transaction, while handling front-running as gracefully as possible.
|
|
490
|
+
* @param _settleTokenId Token ID to settle auction for.
|
|
491
|
+
* @param _bidTokenId Token ID to bid on.
|
|
492
|
+
* @param _coreContract Core contract address for the given project.
|
|
493
|
+
* @dev this function is not non-reentrant, but the underlying calls are
|
|
494
|
+
* to non-reentrant functions.
|
|
495
|
+
*/
|
|
496
|
+
function settleAuctionAndCreateBid(
|
|
497
|
+
uint256 _settleTokenId,
|
|
498
|
+
uint256 _bidTokenId,
|
|
499
|
+
address _coreContract
|
|
500
|
+
) external payable {
|
|
501
|
+
// ensure tokens are in the same project
|
|
502
|
+
require(
|
|
503
|
+
ABHelpers.tokenIdToProjectId(_settleTokenId) ==
|
|
504
|
+
ABHelpers.tokenIdToProjectId(_bidTokenId),
|
|
505
|
+
"Only tokens in same project"
|
|
506
|
+
);
|
|
507
|
+
// settle completed auction, if applicable
|
|
508
|
+
settleAuction(_settleTokenId, _coreContract);
|
|
509
|
+
// attempt to bid on next token
|
|
510
|
+
createBid(_bidTokenId, _coreContract);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* @notice View function to return the current minter-level configuration
|
|
515
|
+
* details.
|
|
516
|
+
* @return minAuctionDurationSeconds_ Minimum auction duration in seconds.
|
|
517
|
+
* Note that this value is a constant on this version of the minter.
|
|
518
|
+
* @return minterTimeBufferSeconds_ Buffer time in seconds
|
|
519
|
+
* @return minterRefundGasLimit_ Gas limit for refunding ETH
|
|
520
|
+
*/
|
|
521
|
+
function minterConfigurationDetails()
|
|
522
|
+
external
|
|
523
|
+
view
|
|
524
|
+
returns (
|
|
525
|
+
uint256 minAuctionDurationSeconds_,
|
|
526
|
+
uint32 minterTimeBufferSeconds_,
|
|
527
|
+
uint24 minterRefundGasLimit_
|
|
528
|
+
)
|
|
529
|
+
{
|
|
530
|
+
minAuctionDurationSeconds_ = MIN_AUCTION_DURATION_SECONDS;
|
|
531
|
+
minterTimeBufferSeconds_ = minterTimeBufferSeconds;
|
|
532
|
+
minterRefundGasLimit_ = minterRefundGasLimit;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* @notice Gets the maximum invocations project configuration.
|
|
537
|
+
* @param _projectId The ID of the project whose data needs to be fetched.
|
|
538
|
+
* @param _coreContract The address of the core contract.
|
|
539
|
+
* @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
|
|
540
|
+
* configuration data.
|
|
541
|
+
*/
|
|
542
|
+
function maxInvocationsProjectConfig(
|
|
543
|
+
uint256 _projectId,
|
|
544
|
+
address _coreContract
|
|
545
|
+
)
|
|
546
|
+
external
|
|
547
|
+
view
|
|
548
|
+
returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
|
|
549
|
+
{
|
|
550
|
+
return _maxInvocationsProjectConfigMapping[_coreContract][_projectId];
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* @notice projectId => has project reached its maximum number of
|
|
555
|
+
* invocations? Note that this returns a local cache of the core contract's
|
|
556
|
+
* state, and may be out of sync with the core contract. This is
|
|
557
|
+
* intentional, as it only enables gas optimization of mints after a
|
|
558
|
+
* project's maximum invocations has been reached. A false negative will
|
|
559
|
+
* only result in a gas cost increase, since the core contract will still
|
|
560
|
+
* enforce a maxInvocation check during minting. A false positive is not
|
|
561
|
+
* possible because the V3 core contract only allows maximum invocations
|
|
562
|
+
* to be reduced, not increased. Based on this rationale, we intentionally
|
|
563
|
+
* do not do input validation in this method as to whether or not the input
|
|
564
|
+
* @param `_projectId` is an existing project ID.
|
|
565
|
+
* @param `_coreContract` is an existing core contract address.
|
|
566
|
+
*/
|
|
567
|
+
function projectMaxHasBeenInvoked(
|
|
568
|
+
uint256 _projectId,
|
|
569
|
+
address _coreContract
|
|
570
|
+
) external view returns (bool) {
|
|
571
|
+
return
|
|
572
|
+
MaxInvocationsLib.getMaxHasBeenInvoked(
|
|
573
|
+
_maxInvocationsProjectConfigMapping[_coreContract][_projectId]
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* @notice projectId => project's maximum number of invocations.
|
|
579
|
+
* Optionally synced with core contract value, for gas optimization.
|
|
580
|
+
* Note that this returns a local cache of the core contract's
|
|
581
|
+
* state, and may be out of sync with the core contract. This is
|
|
582
|
+
* intentional, as it only enables gas optimization of mints after a
|
|
583
|
+
* project's maximum invocations has been reached.
|
|
584
|
+
* @dev A number greater than the core contract's project max invocations
|
|
585
|
+
* will only result in a gas cost increase, since the core contract will
|
|
586
|
+
* still enforce a maxInvocation check during minting. A number less than
|
|
587
|
+
* the core contract's project max invocations is only possible when the
|
|
588
|
+
* project's max invocations have not been synced on this minter, since the
|
|
589
|
+
* V3 core contract only allows maximum invocations to be reduced, not
|
|
590
|
+
* increased. When this happens, the minter will enable minting, allowing
|
|
591
|
+
* the core contract to enforce the max invocations check. Based on this
|
|
592
|
+
* rationale, we intentionally do not do input validation in this method as
|
|
593
|
+
* to whether or not the input `_projectId` is an existing project ID.
|
|
594
|
+
* @param `_projectId` is an existing project ID.
|
|
595
|
+
* @param `_coreContract` is an existing core contract address.
|
|
596
|
+
*/
|
|
597
|
+
function projectMaxInvocations(
|
|
598
|
+
uint256 _projectId,
|
|
599
|
+
address _coreContract
|
|
600
|
+
) external view returns (uint256) {
|
|
601
|
+
return
|
|
602
|
+
MaxInvocationsLib.getMaxInvocations(
|
|
603
|
+
_maxInvocationsProjectConfigMapping[_coreContract][_projectId]
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* @notice Checks if the specified `_coreContract` is a valid engine contract.
|
|
609
|
+
* @dev This function retrieves the cached value of `_isEngine` from
|
|
610
|
+
* the `isEngineCache` mapping. If the cached value is already set, it
|
|
611
|
+
* returns the cached value. Otherwise, it calls the `getV3CoreIsEngine`
|
|
612
|
+
* function from the `SplitFundsLib` library to check if `_coreContract`
|
|
613
|
+
* is a valid engine contract.
|
|
614
|
+
* @dev This function will revert if the provided `_coreContract` is not
|
|
615
|
+
* a valid Engine or V3 Flagship contract.
|
|
616
|
+
* @param _coreContract The address of the contract to check.
|
|
617
|
+
* @return bool indicating if `_coreContract` is a valid engine contract.
|
|
618
|
+
*/
|
|
619
|
+
function isEngineView(address _coreContract) external view returns (bool) {
|
|
620
|
+
SplitFundsLib.IsEngineCache storage isEngineCache = _isEngineCaches[
|
|
621
|
+
_coreContract
|
|
622
|
+
];
|
|
623
|
+
if (isEngineCache.isCached) {
|
|
624
|
+
return isEngineCache.isEngine;
|
|
625
|
+
} else {
|
|
626
|
+
// @dev this calls the non-modifying variant of getV3CoreIsEngine
|
|
627
|
+
return SplitFundsLib.getV3CoreIsEngineView(_coreContract);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* @notice projectId => SEA project configuration details.
|
|
633
|
+
* Note that in the case of no auction being initialized for the project,
|
|
634
|
+
* the returned `auction` will be the default struct.
|
|
635
|
+
* @param _projectId The project ID
|
|
636
|
+
* @param _coreContract The core contract address
|
|
637
|
+
* @return _SEAProjectConfig The SEA project configuration details
|
|
638
|
+
*/
|
|
639
|
+
function SEAProjectConfigurationDetails(
|
|
640
|
+
uint256 _projectId,
|
|
641
|
+
address _coreContract
|
|
642
|
+
) external view returns (SEALib.SEAProjectConfig memory _SEAProjectConfig) {
|
|
643
|
+
_SEAProjectConfig = _SEAProjectConfigs[_coreContract][_projectId];
|
|
644
|
+
// clean up next token number to handle case where it is stale
|
|
645
|
+
_SEAProjectConfig.nextTokenNumber = _SEAProjectConfig
|
|
646
|
+
.nextTokenNumberIsPopulated
|
|
647
|
+
? _SEAProjectConfig.nextTokenNumber
|
|
648
|
+
: 0;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* @notice projectId => active auction details.
|
|
653
|
+
* @dev reverts if no auction exists for the project.
|
|
654
|
+
* @param _projectId The project ID
|
|
655
|
+
* @param _coreContract The core contract address
|
|
656
|
+
*/
|
|
657
|
+
function projectActiveAuctionDetails(
|
|
658
|
+
uint256 _projectId,
|
|
659
|
+
address _coreContract
|
|
660
|
+
) external view returns (SEALib.Auction memory auction) {
|
|
661
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
662
|
+
_coreContract
|
|
663
|
+
][_projectId];
|
|
664
|
+
return SEALib.projectActiveAuctionDetails(_SEAProjectConfig);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* @notice Convenience function that returns either the current token ID
|
|
669
|
+
* being auctioned, or the next expected token ID to be auction if no
|
|
670
|
+
* auction is currently initialized or if the current auction has concluded
|
|
671
|
+
* (block.timestamp > auction.endTime).
|
|
672
|
+
* This is intended to be useful for frontends or scripts that intend to
|
|
673
|
+
* call `createBid` or `settleAuctionAndCreateBid`, which requires a
|
|
674
|
+
* target bid token ID to be passed in as an argument.
|
|
675
|
+
* The function reverts if a project does not have an active auction and
|
|
676
|
+
* the next expected token ID has not been populated.
|
|
677
|
+
* @param _projectId The project ID being queried
|
|
678
|
+
* @param _coreContract The core contract address
|
|
679
|
+
* @return The current token ID being auctioned, or the next token ID to be
|
|
680
|
+
* auctioned if a new auction is ready to be created.
|
|
681
|
+
*/
|
|
682
|
+
function getTokenToBid(
|
|
683
|
+
uint256 _projectId,
|
|
684
|
+
address _coreContract
|
|
685
|
+
) external view returns (uint256) {
|
|
686
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
687
|
+
_coreContract
|
|
688
|
+
][_projectId];
|
|
689
|
+
return SEALib.getTokenToBid(_SEAProjectConfig, _projectId);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* @notice View function that returns the next token ID to be auctioned
|
|
694
|
+
* by this minter for project `_projectId`.
|
|
695
|
+
* Reverts if the next token ID has not been populated for the project.
|
|
696
|
+
* @param _projectId The project ID being queried
|
|
697
|
+
* @param _coreContract The core contract address
|
|
698
|
+
* @return nextTokenId The next token ID to be auctioned by this minter
|
|
699
|
+
*/
|
|
700
|
+
function getNextTokenId(
|
|
701
|
+
uint256 _projectId,
|
|
702
|
+
address _coreContract
|
|
703
|
+
) external view returns (uint256 nextTokenId) {
|
|
704
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
705
|
+
_coreContract
|
|
706
|
+
][_projectId];
|
|
707
|
+
return SEALib.getNextTokenId(_SEAProjectConfig, _projectId);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* @notice Gets price info to become the leading bidder on a token auction.
|
|
712
|
+
* If artist has not called `configureFutureAuctions` and there is no
|
|
713
|
+
* active token auction accepting bids, `isConfigured` will be false, and a
|
|
714
|
+
* dummy price of zero is assigned to `tokenPriceInWei`.
|
|
715
|
+
* If there is an active auction accepting bids, `isConfigured` will be
|
|
716
|
+
* true, and `tokenPriceInWei` will be the sum of the current bid value and
|
|
717
|
+
* the minimum bid increment due to the minter's
|
|
718
|
+
* `minterMinBidIncrementPercentage`.
|
|
719
|
+
* If there is an auction that has ended (no longer accepting bids), but
|
|
720
|
+
* the project is configured, `isConfigured` will be true, and
|
|
721
|
+
* `tokenPriceInWei` will be the minimum initial bid price for the next
|
|
722
|
+
* token auction.
|
|
723
|
+
* Also returns currency symbol and address to be being used as payment,
|
|
724
|
+
* which for this minter is ETH only.
|
|
725
|
+
* @param _projectId Project ID to get price information for.
|
|
726
|
+
* @param _coreContract Core contract to get price information for.
|
|
727
|
+
* @return isConfigured true only if project auctions are configured.
|
|
728
|
+
* @return tokenPriceInWei price in wei to become the leading bidder on a
|
|
729
|
+
* token auction.
|
|
730
|
+
* @return currencySymbol currency symbol for purchases of project on this
|
|
731
|
+
* minter. This minter always returns "ETH"
|
|
732
|
+
* @return currencyAddress currency address for purchases of project on
|
|
733
|
+
* this minter. This minter always returns null address, reserved for ether
|
|
734
|
+
*/
|
|
735
|
+
function getPriceInfo(
|
|
736
|
+
uint256 _projectId,
|
|
737
|
+
address _coreContract
|
|
738
|
+
)
|
|
739
|
+
external
|
|
740
|
+
view
|
|
741
|
+
returns (
|
|
742
|
+
bool isConfigured,
|
|
743
|
+
uint256 tokenPriceInWei,
|
|
744
|
+
string memory currencySymbol,
|
|
745
|
+
address currencyAddress
|
|
746
|
+
)
|
|
747
|
+
{
|
|
748
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
749
|
+
_coreContract
|
|
750
|
+
][_projectId];
|
|
751
|
+
(isConfigured, tokenPriceInWei) = SEALib
|
|
752
|
+
.getPriceInfoFromSEAProjectConfig(_SEAProjectConfig);
|
|
753
|
+
// currency is always ETH
|
|
754
|
+
currencySymbol = "ETH";
|
|
755
|
+
currencyAddress = address(0);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* @notice Syncs local maximum invocations of project `_projectId` based on
|
|
760
|
+
* the value currently defined in the core contract.
|
|
761
|
+
* @param _projectId Project ID to set the maximum invocations for.
|
|
762
|
+
* @param _coreContract Core contract address for the given project.
|
|
763
|
+
* @dev this enables gas reduction after maxInvocations have been reached -
|
|
764
|
+
* core contracts shall still enforce a maxInvocation check during mint.
|
|
765
|
+
*/
|
|
766
|
+
function syncProjectMaxInvocationsToCore(
|
|
767
|
+
uint256 _projectId,
|
|
768
|
+
address _coreContract
|
|
769
|
+
) public {
|
|
770
|
+
AuthLib.onlyArtist({
|
|
771
|
+
_projectId: _projectId,
|
|
772
|
+
_coreContract: _coreContract,
|
|
773
|
+
_sender: msg.sender
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
uint256 maxInvocations = MaxInvocationsLib
|
|
777
|
+
.syncProjectMaxInvocationsToCore(
|
|
778
|
+
_projectId,
|
|
779
|
+
_coreContract,
|
|
780
|
+
_maxInvocationsProjectConfigMapping[_coreContract][_projectId]
|
|
781
|
+
);
|
|
782
|
+
emit ProjectMaxInvocationsLimitUpdated(
|
|
783
|
+
_projectId,
|
|
784
|
+
_coreContract,
|
|
785
|
+
maxInvocations
|
|
786
|
+
);
|
|
787
|
+
|
|
788
|
+
// for convenience, try to mint and assign a token to the project's
|
|
789
|
+
// next slot
|
|
790
|
+
_tryMintTokenToNextSlot(_projectId, _coreContract);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* @notice Emergency, Artist-only function that attempts to mint a new
|
|
795
|
+
* token and set it as the the next token to be auctioned for project
|
|
796
|
+
* `_projectId`.
|
|
797
|
+
* Note: This function is only included for emergency, unforseen use cases,
|
|
798
|
+
* and should not be used in normal operation. It is here only for
|
|
799
|
+
* redundant protection against an unforseen edge case where the minter
|
|
800
|
+
* does not have a populated "next token", but there are still invocations
|
|
801
|
+
* remaining on the project.
|
|
802
|
+
* This function reverts if the project is not configured on this minter.
|
|
803
|
+
* This function returns early and does not modify state when:
|
|
804
|
+
* - the minter already has a populated "next token" for the project
|
|
805
|
+
* - the project has reached its maximum invocations on the core contract
|
|
806
|
+
* or minter
|
|
807
|
+
* @dev This function is gated to only the project's artist to prevent
|
|
808
|
+
* early minting of tokens by other users.
|
|
809
|
+
* @param _projectId The project ID
|
|
810
|
+
* @param _coreContract The core contract address for the given project.
|
|
811
|
+
*/
|
|
812
|
+
function tryPopulateNextToken(
|
|
813
|
+
uint256 _projectId,
|
|
814
|
+
address _coreContract
|
|
815
|
+
) public nonReentrant {
|
|
816
|
+
AuthLib.onlyArtist({
|
|
817
|
+
_projectId: _projectId,
|
|
818
|
+
_coreContract: _coreContract,
|
|
819
|
+
_sender: msg.sender
|
|
820
|
+
});
|
|
821
|
+
// CHECKS
|
|
822
|
+
// revert if project is not configured on this minter
|
|
823
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
824
|
+
_coreContract
|
|
825
|
+
][_projectId];
|
|
826
|
+
require(
|
|
827
|
+
SEALib.projectIsConfigured(_SEAProjectConfig),
|
|
828
|
+
"Project not configured"
|
|
829
|
+
);
|
|
830
|
+
// INTERACTIONS
|
|
831
|
+
// attempt to mint new token to this minter contract, only if max
|
|
832
|
+
// invocations has not been reached
|
|
833
|
+
_tryMintTokenToNextSlot(_projectId, _coreContract);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* @notice Settles a completed auction for `_tokenId`, if it exists and is
|
|
838
|
+
* not yet settled.
|
|
839
|
+
* Returns early (does not modify state) if
|
|
840
|
+
* - there is no initialized auction for the project
|
|
841
|
+
* - there is an auction that has already been settled for the project
|
|
842
|
+
* - there is an auction for a different token ID on the project
|
|
843
|
+
* (likely due to a front-run)
|
|
844
|
+
* This function reverts if the auction for `_tokenId` exists, but has not
|
|
845
|
+
* yet ended.
|
|
846
|
+
* @param _tokenId Token ID to settle auction for.
|
|
847
|
+
* @param _coreContract Core contract address for the given project.
|
|
848
|
+
*/
|
|
849
|
+
function settleAuction(
|
|
850
|
+
uint256 _tokenId,
|
|
851
|
+
address _coreContract
|
|
852
|
+
) public nonReentrant {
|
|
853
|
+
uint256 _projectId = ABHelpers.tokenIdToProjectId(_tokenId);
|
|
854
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
855
|
+
_coreContract
|
|
856
|
+
][_projectId];
|
|
857
|
+
SEALib.Auction storage _auction = _SEAProjectConfig.activeAuction;
|
|
858
|
+
// load from storage to memory for gas efficiency
|
|
859
|
+
address currentBidder = _auction.currentBidder;
|
|
860
|
+
uint256 currentBid = _auction.currentBid;
|
|
861
|
+
// CHECKS
|
|
862
|
+
// @dev this check is not strictly necessary, but is included for
|
|
863
|
+
// clear error messaging
|
|
864
|
+
require(
|
|
865
|
+
SEALib.auctionIsInitialized(_auction),
|
|
866
|
+
"Auction not initialized"
|
|
867
|
+
);
|
|
868
|
+
if (_auction.settled || (_auction.tokenId != _tokenId)) {
|
|
869
|
+
// auction already settled or is for a different token ID, so
|
|
870
|
+
// return early and do not modify state
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
// @dev important that the following check is after the early return
|
|
874
|
+
// block above to maintain desired behavior
|
|
875
|
+
require(block.timestamp >= _auction.endTime, "Auction not yet ended");
|
|
876
|
+
// EFFECTS
|
|
877
|
+
_auction.settled = true;
|
|
878
|
+
// INTERACTIONS
|
|
879
|
+
// send token to the winning bidder
|
|
880
|
+
IERC721(_coreContract).transferFrom({
|
|
881
|
+
from: address(this),
|
|
882
|
+
to: currentBidder,
|
|
883
|
+
tokenId: _tokenId
|
|
884
|
+
});
|
|
885
|
+
// distribute revenues from auction
|
|
886
|
+
bool isEngine = SplitFundsLib.isEngine(
|
|
887
|
+
_coreContract,
|
|
888
|
+
_isEngineCaches[_coreContract]
|
|
889
|
+
);
|
|
890
|
+
SplitFundsLib.splitRevenuesETH({
|
|
891
|
+
_projectId: _projectId,
|
|
892
|
+
_valueInWei: currentBid,
|
|
893
|
+
_coreContract: _coreContract,
|
|
894
|
+
_isEngine: isEngine
|
|
895
|
+
});
|
|
896
|
+
|
|
897
|
+
emit AuctionSettled({
|
|
898
|
+
tokenId: _tokenId,
|
|
899
|
+
coreContract: _coreContract,
|
|
900
|
+
winner: currentBidder,
|
|
901
|
+
price: currentBid
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* @notice Enters a bid for token `_tokenId`.
|
|
907
|
+
* If an auction for token `_tokenId` does not exist, an auction will be
|
|
908
|
+
* initialized as long as any existing auction for the project has been
|
|
909
|
+
* settled.
|
|
910
|
+
* In order to successfully place the bid, the token bid must be:
|
|
911
|
+
* - greater than or equal to a project's minimum bid price if a new
|
|
912
|
+
* auction is initialized
|
|
913
|
+
* - sufficiently greater than the current highest bid, according to the
|
|
914
|
+
* minter's bid increment percentage `minterMinBidIncrementPercentage`,
|
|
915
|
+
* if an auction for the token already exists
|
|
916
|
+
* If the bid is unsuccessful, the transaction will revert.
|
|
917
|
+
* If the bid is successful, but outbid by another bid before the auction
|
|
918
|
+
* ends, the funds will be noncustodially returned to the bidder's address,
|
|
919
|
+
* `msg.sender`. A fallback method of sending funds back to the bidder via
|
|
920
|
+
* SELFDESTRUCT (SENDALL) prevents denial of service attacks, even if the
|
|
921
|
+
* original bidder reverts or runs out of gas during receive or fallback.
|
|
922
|
+
* ------------------------------------------------------------------------
|
|
923
|
+
* WARNING: bidders must be prepared to handle the case where their bid is
|
|
924
|
+
* outbid and their funds are returned to the original `msg.sender` address
|
|
925
|
+
* via SELFDESTRUCT (SENDALL).
|
|
926
|
+
* ------------------------------------------------------------------------
|
|
927
|
+
* Note that the use of `_tokenId` is to prevent the possibility of
|
|
928
|
+
* transactions that are stuck in the pending pool for long periods of time
|
|
929
|
+
* from unintentionally bidding on auctions for future tokens.
|
|
930
|
+
* If a new auction is initialized during this call, the project's next
|
|
931
|
+
* token will be attempted to be minted to this minter contract, preparing
|
|
932
|
+
* it for the next auction. If the project's next token cannot be minted
|
|
933
|
+
* due to e.g. reaching the maximum invocations on the core contract or
|
|
934
|
+
* minter, the project's next token will not be minted.
|
|
935
|
+
* @param _tokenId Token ID being bid on.
|
|
936
|
+
* @param _coreContract Core contract address for the given project.
|
|
937
|
+
* @dev nonReentrant modifier is used to prevent reentrancy attacks, e.g.
|
|
938
|
+
* an an auto-bidder that would be able to atomically outbid a user's
|
|
939
|
+
* new bid via a reentrant call to createBid.
|
|
940
|
+
*/
|
|
941
|
+
function createBid(
|
|
942
|
+
uint256 _tokenId,
|
|
943
|
+
address _coreContract
|
|
944
|
+
) public payable nonReentrant {
|
|
945
|
+
uint256 _projectId = ABHelpers.tokenIdToProjectId(_tokenId);
|
|
946
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
947
|
+
_coreContract
|
|
948
|
+
][_projectId];
|
|
949
|
+
SEALib.Auction storage _auction = _SEAProjectConfig.activeAuction;
|
|
950
|
+
// CHECKS
|
|
951
|
+
// ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
952
|
+
// load from storage to memory for gas efficiency
|
|
953
|
+
uint256 auctionEndTime = _auction.endTime;
|
|
954
|
+
uint256 previousBid = _auction.currentBid;
|
|
955
|
+
|
|
956
|
+
// if no auction exists, or current auction is already settled, attempt
|
|
957
|
+
// to initialize a new auction for the input token ID and immediately
|
|
958
|
+
// return
|
|
959
|
+
if ((!SEALib.auctionIsInitialized(_auction)) || _auction.settled) {
|
|
960
|
+
_initializeAuctionWithBid(_projectId, _coreContract, _tokenId);
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
// @dev this branch is guaranteed to have an initialized auction that
|
|
964
|
+
// not settled, so no need to check for initialized or not settled
|
|
965
|
+
|
|
966
|
+
// ensure bids for a specific token ID are only applied to the auction
|
|
967
|
+
// for that token ID.
|
|
968
|
+
require(
|
|
969
|
+
_auction.tokenId == _tokenId,
|
|
970
|
+
"Token ID does not match auction"
|
|
971
|
+
);
|
|
972
|
+
|
|
973
|
+
// ensure auction is not already ended
|
|
974
|
+
require(auctionEndTime > block.timestamp, "Auction already ended");
|
|
975
|
+
|
|
976
|
+
// require bid to be sufficiently greater than current highest bid
|
|
977
|
+
// @dev no overflow enforced automatically by solidity ^0.8.0
|
|
978
|
+
require(
|
|
979
|
+
msg.value >= SEALib.getMinimumNextBid(_auction),
|
|
980
|
+
"Bid is too low"
|
|
981
|
+
);
|
|
982
|
+
|
|
983
|
+
// EFFECTS
|
|
984
|
+
// record previous highest bider for refunding
|
|
985
|
+
address payable previousBidder = _auction.currentBidder;
|
|
986
|
+
|
|
987
|
+
// update auction bid state
|
|
988
|
+
SEALib.auctionUpdateBid({
|
|
989
|
+
_auction: _auction,
|
|
990
|
+
_timeBufferSeconds: minterTimeBufferSeconds,
|
|
991
|
+
_bidAmount: msg.value,
|
|
992
|
+
_bidder: payable(msg.sender)
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
// INTERACTIONS
|
|
996
|
+
// refund previous highest bidder
|
|
997
|
+
SplitFundsLib.forceSafeTransferETH({
|
|
998
|
+
_to: previousBidder,
|
|
999
|
+
_amount: previousBid,
|
|
1000
|
+
_minterRefundGasLimit: minterRefundGasLimit
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
emit AuctionBid({
|
|
1004
|
+
tokenId: _tokenId,
|
|
1005
|
+
coreContract: _coreContract,
|
|
1006
|
+
bidder: msg.sender,
|
|
1007
|
+
bidAmount: msg.value
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* @dev Internal function to initialize an auction for the next token ID
|
|
1013
|
+
* on project `_projectId` with a bid of `msg.value` from `msg.sender`.
|
|
1014
|
+
* This function reverts in any of the following cases:
|
|
1015
|
+
* - project is not configured on this minter
|
|
1016
|
+
* - project is configured but has not yet reached its start time
|
|
1017
|
+
* - project has a current active auction that is not settled
|
|
1018
|
+
* - insufficient bid amount (msg.value < basePrice)
|
|
1019
|
+
* - no next token has been minted for the project (artist may need to
|
|
1020
|
+
* call `tryPopulateNextToken`)
|
|
1021
|
+
* - `_targetTokenId` does not match the next token ID for the project
|
|
1022
|
+
* After initializing a new auction, this function attempts to mint a new
|
|
1023
|
+
* token and assign it to the project's next token slot, in preparation for
|
|
1024
|
+
* a future token auction. However, if the project has reached its maximum
|
|
1025
|
+
* invocations on either the core contract or minter, the next token slot
|
|
1026
|
+
* for the project will remain empty.
|
|
1027
|
+
* @dev This should be executed in a nonReentrant context to provide redundant
|
|
1028
|
+
* protection against reentrancy.
|
|
1029
|
+
*/
|
|
1030
|
+
function _initializeAuctionWithBid(
|
|
1031
|
+
uint256 _projectId,
|
|
1032
|
+
address _coreContract,
|
|
1033
|
+
uint256 _targetTokenId
|
|
1034
|
+
) internal {
|
|
1035
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
1036
|
+
_coreContract
|
|
1037
|
+
][_projectId];
|
|
1038
|
+
SEALib.Auction storage _auction = _SEAProjectConfig.activeAuction;
|
|
1039
|
+
// CHECKS
|
|
1040
|
+
// ensure project auctions are configured
|
|
1041
|
+
// @dev base price of zero indicates auctions are not configured
|
|
1042
|
+
// because only base price of gt zero is allowed when configuring
|
|
1043
|
+
require(
|
|
1044
|
+
SEALib.projectIsConfigured(_SEAProjectConfig),
|
|
1045
|
+
"Project not configured"
|
|
1046
|
+
);
|
|
1047
|
+
// only initialize new auctions if they meet the start time
|
|
1048
|
+
// requirement
|
|
1049
|
+
require(
|
|
1050
|
+
block.timestamp >= _SEAProjectConfig.timestampStart,
|
|
1051
|
+
"Only gte project start time"
|
|
1052
|
+
);
|
|
1053
|
+
// the following require statement is redundant based on how this
|
|
1054
|
+
// internal function is called, but it is included for protection
|
|
1055
|
+
// against future changes that could easily introduce a bug if this
|
|
1056
|
+
// check is not present
|
|
1057
|
+
// @dev no cover else branch of next line because unreachable
|
|
1058
|
+
require(
|
|
1059
|
+
(!SEALib.auctionIsInitialized(_auction)) || _auction.settled,
|
|
1060
|
+
"Existing auction not settled"
|
|
1061
|
+
);
|
|
1062
|
+
// require valid bid value
|
|
1063
|
+
require(
|
|
1064
|
+
msg.value >= _SEAProjectConfig.basePrice,
|
|
1065
|
+
"Insufficient initial bid"
|
|
1066
|
+
);
|
|
1067
|
+
// require next token number is populated
|
|
1068
|
+
// @dev this should only be encountered if the project has reached
|
|
1069
|
+
// its maximum invocations on either the core contract or minter
|
|
1070
|
+
require(
|
|
1071
|
+
_SEAProjectConfig.nextTokenNumberIsPopulated,
|
|
1072
|
+
"No next token, check max invocations"
|
|
1073
|
+
);
|
|
1074
|
+
// require next token number is the target token ID
|
|
1075
|
+
require(
|
|
1076
|
+
_SEAProjectConfig.nextTokenNumber ==
|
|
1077
|
+
ABHelpers.tokenIdToTokenNumber(_targetTokenId),
|
|
1078
|
+
"Incorrect target token ID"
|
|
1079
|
+
);
|
|
1080
|
+
|
|
1081
|
+
// EFFECTS
|
|
1082
|
+
// create new auction, overwriting previous auction if it exists
|
|
1083
|
+
uint64 endTime = SEALib.overwriteProjectActiveAuction({
|
|
1084
|
+
_SEAProjectConfig: _SEAProjectConfig,
|
|
1085
|
+
_targetTokenId: _targetTokenId,
|
|
1086
|
+
_bidAmount: msg.value,
|
|
1087
|
+
_bidder: payable(msg.sender)
|
|
1088
|
+
});
|
|
1089
|
+
// mark next token number as not populated
|
|
1090
|
+
// @dev intentionally not setting nextTokenNumber to zero to avoid
|
|
1091
|
+
// unnecessary gas costs
|
|
1092
|
+
_SEAProjectConfig.nextTokenNumberIsPopulated = false;
|
|
1093
|
+
|
|
1094
|
+
// @dev we intentionally emit event here due to potential of early
|
|
1095
|
+
// return in INTERACTIONS section
|
|
1096
|
+
emit AuctionInitialized({
|
|
1097
|
+
tokenId: _targetTokenId,
|
|
1098
|
+
coreContract: _coreContract,
|
|
1099
|
+
bidder: msg.sender,
|
|
1100
|
+
bidAmount: msg.value,
|
|
1101
|
+
endTime: endTime,
|
|
1102
|
+
minBidIncrementPercentage: _SEAProjectConfig
|
|
1103
|
+
.activeAuction
|
|
1104
|
+
.minBidIncrementPercentage
|
|
1105
|
+
});
|
|
1106
|
+
|
|
1107
|
+
// INTERACTIONS
|
|
1108
|
+
// attempt to mint new token to this minter contract, only if max
|
|
1109
|
+
// invocations has not been reached
|
|
1110
|
+
_tryMintTokenToNextSlot(_projectId, _coreContract);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* @notice Internal function that attempts to mint a new token to the next
|
|
1115
|
+
* token slot for the project `_projectId`.
|
|
1116
|
+
* This function returns early and does not modify state if
|
|
1117
|
+
* - the project has reached its maximum invocations on either the core
|
|
1118
|
+
* contract or minter
|
|
1119
|
+
* - the project config's `nextTokenNumberIsPopulated` is already true
|
|
1120
|
+
* @param _projectId The ID of the project to mint a new token for.
|
|
1121
|
+
* @param _coreContract The core contract address
|
|
1122
|
+
* @dev this calls mint with `msg.sender` as the sender, allowing artists
|
|
1123
|
+
* to mint tokens to the next token slot for their project while a project
|
|
1124
|
+
* is still paused. This happens when an artist is configuring their
|
|
1125
|
+
* project's auction parameters or minter max invocations.
|
|
1126
|
+
*/
|
|
1127
|
+
function _tryMintTokenToNextSlot(
|
|
1128
|
+
uint256 _projectId,
|
|
1129
|
+
address _coreContract
|
|
1130
|
+
) internal {
|
|
1131
|
+
SEALib.SEAProjectConfig storage _SEAProjectConfig = _SEAProjectConfigs[
|
|
1132
|
+
_coreContract
|
|
1133
|
+
][_projectId];
|
|
1134
|
+
MaxInvocationsLib.MaxInvocationsProjectConfig
|
|
1135
|
+
storage _maxInvocationProjectConfig = _maxInvocationsProjectConfigMapping[
|
|
1136
|
+
_coreContract
|
|
1137
|
+
][_projectId];
|
|
1138
|
+
if (_SEAProjectConfig.nextTokenNumberIsPopulated) {
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
// INTERACTIONS
|
|
1142
|
+
// attempt to mint new token to this minter contract, only if max
|
|
1143
|
+
// invocations has not been reached
|
|
1144
|
+
// we require up-to-date invocation data to properly handle last token
|
|
1145
|
+
// and avoid revert if relying on core to limit invocations, therefore
|
|
1146
|
+
// use MaxInvocationsLib.invocationsRemain, which calls core contract
|
|
1147
|
+
// to get latest invocation data
|
|
1148
|
+
if (
|
|
1149
|
+
!MaxInvocationsLib.invocationsRemain(
|
|
1150
|
+
_maxInvocationProjectConfig,
|
|
1151
|
+
_projectId,
|
|
1152
|
+
_coreContract
|
|
1153
|
+
)
|
|
1154
|
+
) {
|
|
1155
|
+
// we have reached the max invocations, so we do not mint a new
|
|
1156
|
+
// token as the "next token", and leave the next token number as
|
|
1157
|
+
// not populated
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
// @dev this is an effect after a trusted contract interaction
|
|
1161
|
+
_SEAProjectConfig.nextTokenNumberIsPopulated = true;
|
|
1162
|
+
// mint a new token to this project's "next token" slot
|
|
1163
|
+
// @dev this is an interaction with a trusted contract
|
|
1164
|
+
uint256 nextTokenId = minterFilter.mint_joo(
|
|
1165
|
+
address(this),
|
|
1166
|
+
_projectId,
|
|
1167
|
+
_coreContract,
|
|
1168
|
+
msg.sender
|
|
1169
|
+
);
|
|
1170
|
+
// update state to reflect new token number
|
|
1171
|
+
// @dev state changes after trusted contract interaction
|
|
1172
|
+
// @dev unchecked is safe because mod 1e6 is guaranteed to be less than
|
|
1173
|
+
// max uint24
|
|
1174
|
+
unchecked {
|
|
1175
|
+
_SEAProjectConfig.nextTokenNumber = uint24(
|
|
1176
|
+
ABHelpers.tokenIdToTokenNumber(nextTokenId)
|
|
1177
|
+
);
|
|
1178
|
+
}
|
|
1179
|
+
// update local maxHasBeenInvoked value if necessary
|
|
1180
|
+
MaxInvocationsLib.validatePurchaseEffectsInvocations({
|
|
1181
|
+
_tokenId: nextTokenId,
|
|
1182
|
+
maxInvocationsProjectConfig: _maxInvocationProjectConfig
|
|
1183
|
+
});
|
|
1184
|
+
emit ProjectNextTokenUpdated({
|
|
1185
|
+
projectId: _projectId,
|
|
1186
|
+
coreContract: _coreContract,
|
|
1187
|
+
tokenId: nextTokenId
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
}
|