@artblocks/contracts 1.0.2 → 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 +56 -21
- 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 +141 -15
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +42 -5
- 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/{GenArt721CoreV2_ENGINE_FLEX.sol → V2/GenArt721CoreV2_ENGINE_FLEX.sol}/GenArt721CoreV2_ENGINE_FLEX.json +3 -3
- package/artifacts/contracts/engine/{GenArt721CoreV2_PBAB.sol → V2/GenArt721CoreV2_PBAB.sol}/GenArt721CoreV2_PBAB.json +3 -3
- package/artifacts/contracts/engine/{GenArt721CoreV2_PRTNR.sol → V2/GenArt721CoreV2_PRTNR.sol}/GenArt721CoreV2_PRTNR.json +3 -3
- package/artifacts/contracts/engine/{GenArt721MinterBurner_PBAB.sol → V2/GenArt721MinterBurner_PBAB.sol}/GenArt721MinterBurner_PBAB.json +3 -3
- package/artifacts/contracts/engine/{GenArt721MinterDAExp_PBAB.sol → V2/GenArt721MinterDAExp_PBAB.sol}/GenArt721MinterDAExp_PBAB.json +3 -3
- package/artifacts/contracts/engine/{GenArt721Minter_PBAB.sol → V2/GenArt721Minter_PBAB.sol}/GenArt721Minter_PBAB.json +3 -3
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +1960 -0
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +2247 -0
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +2247 -0
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol/AdminACLV0_PROHIBITION.json +401 -0
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +2281 -0
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol/IAdminACLV0_PROHIBITION.json +359 -0
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.json +1094 -0
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +242 -0
- package/artifacts/contracts/engine-registry/EngineRegistryV0.sol/EngineRegistryV0.json +2 -2
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +41 -4
- 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/v0.8.x/IBytecodeStorageReader.sol/IBytecodeStorageReader.json +111 -0
- package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +172 -0
- 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 +56 -54
- 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/v0.8.x/IGenArt721CoreContractExposesHashSeed.sol/IGenArt721CoreContractExposesHashSeed.json +30 -0
- 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 +14 -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 +14 -1
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +8 -14
- package/artifacts/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +8 -14
- 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/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +514 -0
- 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/v0.8.x/IPseudorandomAtomic.sol/IPseudorandomAtomic.json +30 -0
- 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/v0.8.x/IRandomizer_V3CoreBase.sol/IRandomizer_V3CoreBase.json +24 -0
- 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/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +223 -0
- 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/integration-refs/gnosis-safe/GnosisSafeMock.sol/GnosisSafeMock.json +2 -2
- package/artifacts/contracts/libs/integration-refs/gnosis-safe/GnosisSafeProxyFactoryMock.sol/GnosisSafeProxyFactoryMock.json +2 -2
- package/artifacts/contracts/libs/integration-refs/gnosis-safe/MultiSendMock.sol/MultiSendMock.json +2 -2
- package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +2 -2
- package/artifacts/contracts/libs/{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/BytecodeStorage.sol → v0.8.x/BytecodeStorageV0.sol}/BytecodeStorage.json +3 -3
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageReader.json +163 -0
- package/artifacts/contracts/libs/v0.8.x/BytecodeStorageV1.sol/BytecodeStorageWriter.json +10 -0
- 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/v0.8.x/SSTORE2.sol/SSTORE2.json +10 -0
- 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 +748 -0
- 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/IGenArt721CoreContractV3WithRandomizer.json +10 -160
- package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV0.sol/MinterSEAV0.json +59 -80
- 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/{BytecodeTextCR_DMock.sol/BytecodeTextCR_DMock.json → BytecodeV0TextCR_DMock.sol/BytecodeV0TextCR_DMock.json} +4 -4
- package/artifacts/contracts/mock/BytecodeV1LibCallsMock.sol/BytecodeV1LibCallsMock.json +135 -0
- package/artifacts/contracts/mock/BytecodeV1TextCR_DMock.sol/BytecodeV1TextCR_DMock.json +301 -0
- package/artifacts/contracts/mock/DeadReceiverBidderMock.sol/DeadReceiverBidderMock.json +25 -2
- package/artifacts/contracts/mock/DeadReceiverMock.sol/DeadReceiverMock.json +2 -2
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +114 -0
- package/artifacts/contracts/mock/ERC20Mock.sol/ERC20Mock.json +28 -2
- package/artifacts/contracts/mock/GasLimitReceiverBidderMock.sol/GasLimitReceiverBidderMock.json +2 -2
- package/artifacts/contracts/mock/GasLimitReceiverMock.sol/GasLimitReceiverMock.json +2 -2
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +22 -4
- package/artifacts/contracts/mock/MockAdminACLV0.sol/MockAdminACLV0Events.json +2 -2
- package/artifacts/contracts/mock/MockAdminACLV0_PROHIBITION.sol/MockAdminACLV0Events_PROHIBITION.json +440 -0
- package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +39 -0
- 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 +118 -0
- package/artifacts/contracts/randomizer/{BasicRandomizer.sol → deprecated/BasicRandomizer.sol}/BasicRandomizer.json +3 -3
- package/artifacts/contracts/randomizer/{BasicRandomizerBase_v0_0_0.sol → deprecated/BasicRandomizerBase_v0_0_0.sol}/RandomizerBase.json +1 -1
- package/artifacts/contracts/randomizer/{PolyptychRandomizerV0.sol → deprecated/PolyptychRandomizerV0.sol}/BasicPolyptychRandomizerV0.json +3 -3
- package/artifacts/contracts/randomizer/{RandomizerV2.sol → deprecated/RandomizerV2.sol}/BasicRandomizerV2.json +3 -3
- package/artifacts/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol/PseudorandomAtomic.json +30 -0
- package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +247 -0
- 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 +2 -2
- package/contracts/AdminACLV1.sol +2 -2
- package/contracts/DependencyRegistryV0.sol +219 -123
- package/contracts/GenArt721CoreV3.sol +60 -42
- 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 +4 -4
- package/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol +4 -4
- 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 +4 -4
- package/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol +5 -5
- package/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol +5 -5
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV0.sol +3 -3
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol +4 -4
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol +5 -5
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol +5 -5
- package/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol +5 -5
- 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 +4 -4
- package/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol +4 -4
- 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 +4 -4
- package/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol +4 -4
- package/contracts/engine/{GenArt721CoreV2_ENGINE_FLEX.sol → V2/GenArt721CoreV2_ENGINE_FLEX.sol} +2 -2
- package/contracts/engine/{GenArt721CoreV2_PBAB.sol → V2/GenArt721CoreV2_PBAB.sol} +2 -2
- package/contracts/engine/{GenArt721CoreV2_PRTNR.sol → V2/GenArt721CoreV2_PRTNR.sol} +3 -3
- package/contracts/engine/{GenArt721MinterBurner_PBAB.sol → V2/GenArt721MinterBurner_PBAB.sol} +2 -2
- package/contracts/engine/{GenArt721MinterDAExp_PBAB.sol → V2/GenArt721MinterDAExp_PBAB.sol} +2 -2
- package/contracts/engine/{GenArt721Minter_PBAB.sol → V2/GenArt721Minter_PBAB.sol} +2 -2
- package/contracts/{GenArt721CoreV3_Engine.sol → engine/V3/GenArt721CoreV3_Engine.sol} +48 -24
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +2298 -0
- package/contracts/{GenArt721CoreV3_Engine_Flex.sol → engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol} +50 -31
- package/contracts/engine/V3/forks/PROHIBITION/AdminACLV0_PROHIBITION.sol +281 -0
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +2359 -0
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IAdminACLV0_PROHIBITION.sol +123 -0
- package/contracts/engine/V3/forks/PROHIBITION/interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol +29 -0
- package/contracts/engine-registry/CoreRegistryV1.sol +254 -0
- package/contracts/engine-registry/EngineRegistryV0.sol +2 -2
- package/contracts/explorations/GenArt721CoreV3_Explorations.sol +58 -40
- package/contracts/interfaces/v0.8.x/IBytecodeStorageReader.sol +62 -0
- package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +27 -0
- package/contracts/interfaces/{0.8.x → v0.8.x}/IDelegationRegistry.sol +1 -1
- package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryCompatibleV0.sol +1 -1
- package/contracts/interfaces/{0.8.x → v0.8.x}/IDependencyRegistryV0.sol +3 -3
- package/contracts/interfaces/{0.8.x → v0.8.x}/IEngineRegistryV0.sol +1 -1
- package/contracts/interfaces/{0.8.x → v0.8.x}/IFilteredMinterSEAV0.sol +34 -15
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractExposesHashSeed.sol +11 -0
- package/contracts/interfaces/v0.8.x/IGenArt721CoreContractV3WithSharedRandomizer.sol +23 -0
- package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Base.sol +3 -0
- package/contracts/interfaces/{0.8.x → v0.8.x}/IGenArt721CoreContractV3_Engine.sol +0 -5
- package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +184 -0
- package/contracts/interfaces/v0.8.x/IPseudorandomAtomic.sol +16 -0
- package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerPolyptychV0.sol +1 -1
- package/contracts/interfaces/{0.8.x → v0.8.x}/IRandomizerV2.sol +2 -5
- 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/v0.8.x/ISharedRandomizerV0.sol +123 -0
- package/contracts/legacy/GenArt721CoreV1.sol +2 -2
- package/contracts/legacy/GenArt721LegacyMinter.sol +5 -5
- package/contracts/libs/integration-refs/delegation-registry/DelegationRegistry.sol +2 -2
- package/contracts/libs/integration-refs/weth9/weth9.sol +2 -0
- 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/BytecodeStorageV1.sol +399 -0
- package/contracts/libs/v0.8.x/SSTORE2.sol +109 -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 +6 -6
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +830 -0
- 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 +4 -4
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +1126 -0
- package/contracts/minter-suite/Minters/MinterDAExpV4.sol +4 -4
- 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 +4 -4
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +591 -0
- package/contracts/minter-suite/Minters/MinterHolderV4.sol +5 -5
- package/contracts/minter-suite/Minters/MinterMerkleV5.sol +5 -5
- package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +18 -17
- package/contracts/minter-suite/Minters/MinterSEAV0.sol +235 -186
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +1190 -0
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +6 -6
- 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 +4 -4
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +461 -0
- package/contracts/mock/{BytecodeTextCR_DMock.sol → BytecodeV0TextCR_DMock.sol} +5 -5
- package/contracts/mock/BytecodeV1LibCallsMock.sol +114 -0
- package/contracts/mock/BytecodeV1TextCR_DMock.sol +233 -0
- package/contracts/mock/DeadReceiverBidderMock.sol +16 -1
- package/contracts/mock/DeadReceiverMock.sol +1 -1
- package/contracts/mock/DummySharedMinter.sol +75 -0
- package/contracts/mock/ERC20Mock.sol +16 -0
- package/contracts/mock/GasLimitReceiverBidderMock.sol +1 -1
- package/contracts/mock/GasLimitReceiverMock.sol +1 -1
- package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +22 -35
- package/contracts/mock/MockAdminACLV0.sol +2 -2
- package/contracts/mock/MockAdminACLV0_PROHIBITION.sol +207 -0
- package/contracts/mock/OriginRegisterMock.sol +27 -0
- package/contracts/mock/RandomizerV2_NoAssignMock.sol +2 -2
- 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 +93 -0
- package/contracts/randomizer/{BasicRandomizer.sol → deprecated/BasicRandomizer.sol} +1 -1
- package/contracts/randomizer/{BasicRandomizerBase_v0_0_0.sol → deprecated/BasicRandomizerBase_v0_0_0.sol} +1 -1
- package/contracts/randomizer/{PolyptychRandomizerV0.sol → deprecated/PolyptychRandomizerV0.sol} +3 -3
- package/contracts/randomizer/{RandomizerV2.sol → deprecated/RandomizerV2.sol} +3 -3
- package/contracts/randomizer/primitive/PseudorandomAtomicBasic.sol +30 -0
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +260 -0
- package/contracts/royalty-registry/GenArt721RoyaltyOverride.sol +2 -2
- package/contracts/royalty-registry/GenArt721RoyaltyOverride_PBAB.sol +2 -2
- package/package.json +51 -43
- package/.env.example +0 -17
- package/LICENSE +0 -165
- package/artifacts/contracts/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +0 -1942
- package/artifacts/contracts/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +0 -2229
- package/artifacts/contracts/engine-registry/future/EngineRegistryV1.sol/EngineRegistryV1.json +0 -109
- package/contracts/engine-registry/future/EngineRegistryV1.sol +0 -86
- /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}/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}/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}/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_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}/IRandomizer.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/BytecodeStorage.sol → v0.8.x/BytecodeStorageV0.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
|
@@ -0,0 +1,2359 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
pragma solidity 0.8.19;
|
|
3
|
+
|
|
4
|
+
// Created By: Art Blocks Inc.
|
|
5
|
+
|
|
6
|
+
import "./interfaces/IAdminACLV0_PROHIBITION.sol";
|
|
7
|
+
import "./interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol";
|
|
8
|
+
|
|
9
|
+
import "../../../../interfaces/v0.8.x/IRandomizerV2.sol";
|
|
10
|
+
import "../../../../interfaces/v0.8.x/IEngineRegistryV0.sol";
|
|
11
|
+
import "../../../../interfaces/v0.8.x/IDependencyRegistryCompatibleV0.sol";
|
|
12
|
+
import "../../../../interfaces/v0.8.x/IManifold.sol";
|
|
13
|
+
|
|
14
|
+
import "@openzeppelin-4.7/contracts/access/Ownable.sol";
|
|
15
|
+
import "../../../../libs/v0.8.x/ERC721_PackedHashSeed.sol";
|
|
16
|
+
import "../../../../libs/v0.8.x/BytecodeStorageV1.sol";
|
|
17
|
+
import "../../../../libs/v0.8.x/Bytes32Strings.sol";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @title Art Blocks Engine Flex ERC-721 core contract, V3.
|
|
21
|
+
* @author Art Blocks Inc.
|
|
22
|
+
* @notice Privileged Roles and Ownership:
|
|
23
|
+
* This contract is designed to be managed, with progressively limited powers
|
|
24
|
+
* as a project progresses from active to locked.
|
|
25
|
+
* Privileged roles and abilities are controlled by the admin ACL contract and
|
|
26
|
+
* artists. Both of these roles hold extensive power and can arbitrarily
|
|
27
|
+
* control and modify portions of projects, dependent upon project state. After
|
|
28
|
+
* a project is locked, important project metadata fields are locked including
|
|
29
|
+
* the project name, artist name, and script and display details. Edition size
|
|
30
|
+
* can never be increased.
|
|
31
|
+
* Care must be taken to ensure that the admin ACL contract and artist
|
|
32
|
+
* addresses are secure behind a multi-sig or other access control mechanism.
|
|
33
|
+
* ----------------------------------------------------------------------------
|
|
34
|
+
* The following functions are restricted to the Admin ACL contract:
|
|
35
|
+
* - updateArtblocksDependencyRegistryAddress
|
|
36
|
+
* - updateProviderSalesAddresses
|
|
37
|
+
* - updateProviderPrimarySalesPercentages (up to 100%)
|
|
38
|
+
* - updateProviderSecondarySalesBPS (up to 100%)
|
|
39
|
+
* - updateMinterContract
|
|
40
|
+
* - updateRandomizerAddress
|
|
41
|
+
* - toggleProjectIsActive
|
|
42
|
+
* - addProject
|
|
43
|
+
* - forbidNewProjects (forever forbidding new projects)
|
|
44
|
+
* - updateDefaultBaseURI (used to initialize new project base URIs)
|
|
45
|
+
* - updateIPFSGateway
|
|
46
|
+
* - updateArweaveGateway
|
|
47
|
+
* ----------------------------------------------------------------------------
|
|
48
|
+
* The following functions are restricted to either the the Artist address or
|
|
49
|
+
* the Admin ACL contract, only when the project is not locked:
|
|
50
|
+
* - updateProjectName
|
|
51
|
+
* - updateProjectArtistName
|
|
52
|
+
* - updateProjectLicense
|
|
53
|
+
* - Change project script via addProjectScript, updateProjectScript,
|
|
54
|
+
* and removeProjectLastScript
|
|
55
|
+
* - updateProjectScriptType
|
|
56
|
+
* - updateProjectAspectRatio
|
|
57
|
+
* - updateProjectSecondaryMarketRoyaltyPercentage (up to
|
|
58
|
+
* ARTIST_MAX_SECONDARY_ROYALTY_PERCENTAGE percent)
|
|
59
|
+
* - updateProjectWebsite
|
|
60
|
+
* - updateProjectMaxInvocations (to a number greater than or equal to the
|
|
61
|
+
* current number of invocations, and less than current project maximum
|
|
62
|
+
* invocations)
|
|
63
|
+
* - updateProjectBaseURI (controlling the base URI for tokens in the project)
|
|
64
|
+
* ----------------------------------------------------------------------------
|
|
65
|
+
* The following functions are restricted to only the Artist or Admin ACL
|
|
66
|
+
* contract of a valid project ID:
|
|
67
|
+
* - proposeArtistPaymentAddressesAndSplits (Note that this has to be accepted
|
|
68
|
+
* by adminAcceptArtistAddressesAndSplits to take effect, which is restricted
|
|
69
|
+
* to the Admin ACL contract, or the artist if the core contract owner has
|
|
70
|
+
* renounced ownership. Also note that a proposal will be automatically
|
|
71
|
+
* accepted if the artist only proposes changed payee percentages without
|
|
72
|
+
* modifying any payee addresses, or is only removing payee addresses, or
|
|
73
|
+
* if the global config `autoApproveArtistSplitProposals` is set to `true`.)
|
|
74
|
+
* - toggleProjectIsPaused (note the artist can still mint while paused)
|
|
75
|
+
* ----------------------------------------------------------------------------
|
|
76
|
+
* The following function is restricted to either the Admin ACL contract, or
|
|
77
|
+
* the Artist address if the core contract owner has renounced ownership:
|
|
78
|
+
* - adminAcceptArtistAddressesAndSplits
|
|
79
|
+
* - updateProjectArtistAddress (owner ultimately controlling the project and
|
|
80
|
+
* its and-on revenue, unless owner has renounced ownership)
|
|
81
|
+
* ----------------------------------------------------------------------------
|
|
82
|
+
* The following function is restricted to the artist or AdminACL contract when
|
|
83
|
+
* a project is unlocked, and only callable by Admin ACL contract when a project
|
|
84
|
+
* is locked:
|
|
85
|
+
* - updateProjectDescription
|
|
86
|
+
* ----------------------------------------------------------------------------
|
|
87
|
+
* The following functions for managing external asset dependencies are restricted
|
|
88
|
+
* to projects with external asset dependencies that are unlocked:
|
|
89
|
+
* - lockProjectExternalAssetDependencies
|
|
90
|
+
* - updateProjectExternalAssetDependency
|
|
91
|
+
* - removeProjectExternalAssetDependency
|
|
92
|
+
* - addProjectExternalAssetDependency
|
|
93
|
+
* ----------------------------------------------------------------------------
|
|
94
|
+
* The following function is restricted to owner calling directly:
|
|
95
|
+
* - transferOwnership
|
|
96
|
+
* - renounceOwnership
|
|
97
|
+
* ----------------------------------------------------------------------------
|
|
98
|
+
* The following configuration variables are set at time of contract deployment,
|
|
99
|
+
* and not modifiable thereafter (immutable after the point of deployment):
|
|
100
|
+
* - (bool) autoApproveArtistSplitProposals
|
|
101
|
+
* ----------------------------------------------------------------------------
|
|
102
|
+
* Additional admin and artist privileged roles may be described on minters,
|
|
103
|
+
* registries, and other contracts that may interact with this core contract.
|
|
104
|
+
*/
|
|
105
|
+
contract GenArt721CoreV3_Engine_Flex_PROHIBITION is
|
|
106
|
+
ERC721_PackedHashSeed,
|
|
107
|
+
Ownable,
|
|
108
|
+
IDependencyRegistryCompatibleV0,
|
|
109
|
+
IManifold,
|
|
110
|
+
IGenArt721CoreContractV3_Engine_Flex_PROHIBITION
|
|
111
|
+
{
|
|
112
|
+
using BytecodeStorageWriter for string;
|
|
113
|
+
using Bytes32Strings for bytes32;
|
|
114
|
+
uint256 constant ONE_HUNDRED = 100;
|
|
115
|
+
uint256 constant ONE_MILLION = 1_000_000;
|
|
116
|
+
uint24 constant ONE_MILLION_UINT24 = 1_000_000;
|
|
117
|
+
uint256 constant FOUR_WEEKS_IN_SECONDS = 2_419_200;
|
|
118
|
+
uint8 constant AT_CHARACTER_CODE = uint8(bytes1("@")); // 0x40
|
|
119
|
+
|
|
120
|
+
// numeric constants
|
|
121
|
+
uint256 constant MAX_PROVIDER_SECONDARY_SALES_BPS = 10000; // 10_000 BPS = 100%
|
|
122
|
+
uint256 constant ARTIST_MAX_SECONDARY_ROYALTY_PERCENTAGE = 95; // 95%
|
|
123
|
+
|
|
124
|
+
// This contract emits generic events that contain fields that indicate
|
|
125
|
+
// which parameter has been updated. This is sufficient for application
|
|
126
|
+
// state management, while also simplifying the contract and indexing code.
|
|
127
|
+
// This was done as an alternative to having custom events that emit what
|
|
128
|
+
// field-values have changed for each event, given that changed values can
|
|
129
|
+
// be introspected by indexers due to the design of this smart contract
|
|
130
|
+
// exposing these state changes via publicly viewable fields.
|
|
131
|
+
//
|
|
132
|
+
// The following fields are used to indicate which contract-level parameter
|
|
133
|
+
// has been updated in the `PlatformUpdated` event:
|
|
134
|
+
bytes32 FIELD_NEXT_PROJECT_ID = "nextProjectId";
|
|
135
|
+
bytes32 FIELD_NEW_PROJECTS_FORBIDDEN = "newProjectsForbidden";
|
|
136
|
+
bytes32 FIELD_DEFAULT_BASE_URI = "defaultBaseURI";
|
|
137
|
+
bytes32 FIELD_RANDOMIZER_ADDRESS = "randomizerAddress";
|
|
138
|
+
bytes32 FIELD_ARTBLOCKS_DEPENDENCY_REGISTRY_ADDRESS =
|
|
139
|
+
"dependencyRegistryAddress";
|
|
140
|
+
bytes32 FIELD_PROVIDER_SALES_ADDRESSES = "providerSalesAddresses";
|
|
141
|
+
bytes32 FIELD_PROVIDER_PRIMARY_SALES_PERCENTAGES =
|
|
142
|
+
"providerPrimaryPercentages";
|
|
143
|
+
bytes32 FIELD_PROVIDER_SECONDARY_SALES_BPS = "providerSecondaryBPS";
|
|
144
|
+
// The following fields are used to indicate which project-level parameter
|
|
145
|
+
// has been updated in the `ProjectUpdated` event:
|
|
146
|
+
bytes32 FIELD_PROJECT_COMPLETED = "completed";
|
|
147
|
+
bytes32 FIELD_PROJECT_ACTIVE = "active";
|
|
148
|
+
bytes32 FIELD_PROJECT_ARTIST_ADDRESS = "artistAddress";
|
|
149
|
+
bytes32 FIELD_PROJECT_PAUSED = "paused";
|
|
150
|
+
bytes32 FIELD_PROJECT_CREATED = "created";
|
|
151
|
+
bytes32 FIELD_PROJECT_NAME = "name";
|
|
152
|
+
bytes32 FIELD_PROJECT_ARTIST_NAME = "artistName";
|
|
153
|
+
bytes32 FIELD_PROJECT_SECONDARY_MARKET_ROYALTY_PERCENTAGE =
|
|
154
|
+
"royaltyPercentage";
|
|
155
|
+
bytes32 FIELD_PROJECT_DESCRIPTION = "description";
|
|
156
|
+
bytes32 FIELD_PROJECT_WEBSITE = "website";
|
|
157
|
+
bytes32 FIELD_PROJECT_LICENSE = "license";
|
|
158
|
+
bytes32 FIELD_PROJECT_MAX_INVOCATIONS = "maxInvocations";
|
|
159
|
+
bytes32 FIELD_PROJECT_SCRIPT = "script";
|
|
160
|
+
bytes32 FIELD_PROJECT_SCRIPT_TYPE = "scriptType";
|
|
161
|
+
bytes32 FIELD_PROJECT_ASPECT_RATIO = "aspectRatio";
|
|
162
|
+
bytes32 FIELD_PROJECT_BASE_URI = "baseURI";
|
|
163
|
+
|
|
164
|
+
/// Dependency registry managed by Art Blocks
|
|
165
|
+
address public artblocksDependencyRegistryAddress;
|
|
166
|
+
|
|
167
|
+
/// current randomizer contract
|
|
168
|
+
IRandomizerV2 public randomizerContract;
|
|
169
|
+
|
|
170
|
+
/// append-only array of all randomizer contract addresses ever used by
|
|
171
|
+
/// this contract
|
|
172
|
+
address[] private _historicalRandomizerAddresses;
|
|
173
|
+
|
|
174
|
+
/// admin ACL contract
|
|
175
|
+
IAdminACLV0 public adminACLContract;
|
|
176
|
+
|
|
177
|
+
struct Project {
|
|
178
|
+
uint24 invocations;
|
|
179
|
+
uint24 maxInvocations;
|
|
180
|
+
uint24 scriptCount;
|
|
181
|
+
// max uint64 ~= 1.8e19 sec ~= 570 billion years
|
|
182
|
+
uint64 completedTimestamp;
|
|
183
|
+
bool active;
|
|
184
|
+
bool paused;
|
|
185
|
+
string name;
|
|
186
|
+
string artist;
|
|
187
|
+
string description;
|
|
188
|
+
string website;
|
|
189
|
+
string license;
|
|
190
|
+
string projectBaseURI;
|
|
191
|
+
bytes32 scriptTypeAndVersion;
|
|
192
|
+
string aspectRatio;
|
|
193
|
+
// mapping from script index to address storing script in bytecode
|
|
194
|
+
mapping(uint256 => address) scriptBytecodeAddresses;
|
|
195
|
+
bool externalAssetDependenciesLocked;
|
|
196
|
+
uint24 externalAssetDependencyCount;
|
|
197
|
+
mapping(uint256 => ExternalAssetDependency) externalAssetDependencies;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
mapping(uint256 => Project) projects;
|
|
201
|
+
|
|
202
|
+
string public preferredIPFSGateway;
|
|
203
|
+
string public preferredArweaveGateway;
|
|
204
|
+
|
|
205
|
+
/// packed struct containing project financial information
|
|
206
|
+
struct ProjectFinance {
|
|
207
|
+
address payable additionalPayeePrimarySales;
|
|
208
|
+
// packed uint: max of 95, max uint8 = 255
|
|
209
|
+
uint8 secondaryMarketRoyaltyPercentage;
|
|
210
|
+
address payable additionalPayeeSecondarySales;
|
|
211
|
+
// packed uint: max of 100, max uint8 = 255
|
|
212
|
+
uint8 additionalPayeeSecondarySalesPercentage;
|
|
213
|
+
address payable artistAddress;
|
|
214
|
+
// packed uint: max of 100, max uint8 = 255
|
|
215
|
+
uint8 additionalPayeePrimarySalesPercentage;
|
|
216
|
+
}
|
|
217
|
+
// Project financials mapping
|
|
218
|
+
mapping(uint256 => ProjectFinance) projectIdToFinancials;
|
|
219
|
+
|
|
220
|
+
/// hash of artist's proposed payment updates to be approved by admin
|
|
221
|
+
mapping(uint256 => bytes32) public proposedArtistAddressesAndSplitsHash;
|
|
222
|
+
|
|
223
|
+
/// The render provider payment address for all primary sales revenues
|
|
224
|
+
/// (packed)
|
|
225
|
+
address payable public renderProviderPrimarySalesAddress;
|
|
226
|
+
/// Percentage of primary sales revenue allocated to the render provider
|
|
227
|
+
/// (packed)
|
|
228
|
+
// packed uint: max of 100, max uint8 = 255
|
|
229
|
+
uint8 private _renderProviderPrimarySalesPercentage = 10;
|
|
230
|
+
/// The platform provider payment address for all primary sales revenues
|
|
231
|
+
/// (packed)
|
|
232
|
+
address payable public platformProviderPrimarySalesAddress;
|
|
233
|
+
/// Percentage of primary sales revenue allocated to the platform provider
|
|
234
|
+
/// (packed)
|
|
235
|
+
// packed uint: max of 100, max uint8 = 255
|
|
236
|
+
uint8 private _platformProviderPrimarySalesPercentage = 10;
|
|
237
|
+
|
|
238
|
+
/// The render provider payment address for all secondary sales royalty
|
|
239
|
+
/// revenues
|
|
240
|
+
address payable public renderProviderSecondarySalesAddress;
|
|
241
|
+
/// Basis Points of secondary sales royalties allocated to the
|
|
242
|
+
/// render provider
|
|
243
|
+
uint256 public renderProviderSecondarySalesBPS = 250;
|
|
244
|
+
/// The platform provider payment address for all secondary sales royalty
|
|
245
|
+
/// revenues
|
|
246
|
+
address payable public platformProviderSecondarySalesAddress;
|
|
247
|
+
/// Basis Points of secondary sales royalties allocated to the
|
|
248
|
+
/// platform provider
|
|
249
|
+
uint256 public platformProviderSecondarySalesBPS = 250;
|
|
250
|
+
|
|
251
|
+
/// single minter allowed for this core contract
|
|
252
|
+
address public minterContract;
|
|
253
|
+
|
|
254
|
+
/// starting (initial) project ID on this contract
|
|
255
|
+
uint256 public immutable startingProjectId;
|
|
256
|
+
|
|
257
|
+
/// next project ID to be created
|
|
258
|
+
uint248 private _nextProjectId;
|
|
259
|
+
|
|
260
|
+
/// bool indicating if adding new projects is forbidden;
|
|
261
|
+
/// default behavior is to allow new projects
|
|
262
|
+
bool public newProjectsForbidden;
|
|
263
|
+
|
|
264
|
+
/// configuration variable (determined at time of deployment)
|
|
265
|
+
/// that determines whether or not admin approval^ should be required
|
|
266
|
+
/// to accept artist address change proposals, or if these proposals
|
|
267
|
+
/// should always auto-approve, as determined by the business process
|
|
268
|
+
/// requirements of the Engine partner using this contract.
|
|
269
|
+
///
|
|
270
|
+
/// ^does not apply in the case where contract-ownership itself is revoked
|
|
271
|
+
bool public immutable autoApproveArtistSplitProposals;
|
|
272
|
+
|
|
273
|
+
/// version & type of this core contract
|
|
274
|
+
bytes32 constant CORE_VERSION = "v3.1.3";
|
|
275
|
+
|
|
276
|
+
function coreVersion() external pure returns (string memory) {
|
|
277
|
+
return CORE_VERSION.toString();
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
bytes32 constant CORE_TYPE = "GenArt721CoreV3_Engine_Flex";
|
|
281
|
+
|
|
282
|
+
function coreType() external pure returns (string memory) {
|
|
283
|
+
return CORE_TYPE.toString();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/// default base URI to initialize all new project projectBaseURI values to
|
|
287
|
+
string public defaultBaseURI;
|
|
288
|
+
|
|
289
|
+
function _onlyUnlockedProjectExternalAssetDependencies(
|
|
290
|
+
uint256 _projectId
|
|
291
|
+
) internal view {
|
|
292
|
+
require(
|
|
293
|
+
!projects[_projectId].externalAssetDependenciesLocked,
|
|
294
|
+
"External dependencies locked"
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function _onlyNonZeroAddress(address _address) internal pure {
|
|
299
|
+
require(_address != address(0), "Must input non-zero address");
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function _onlyNonEmptyString(string memory _string) internal pure {
|
|
303
|
+
require(bytes(_string).length != 0, "Must input non-empty string");
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function _onlyValidTokenId(uint256 _tokenId) internal view {
|
|
307
|
+
require(_exists(_tokenId), "Token ID does not exist");
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function _onlyValidProjectId(uint256 _projectId) internal view {
|
|
311
|
+
require(
|
|
312
|
+
(_projectId >= startingProjectId) && (_projectId < _nextProjectId),
|
|
313
|
+
"Project ID does not exist"
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function _onlyUnlocked(uint256 _projectId) internal view {
|
|
318
|
+
// Note: calling `_projectUnlocked` enforces that the `_projectId`
|
|
319
|
+
// passed in is valid.`
|
|
320
|
+
require(_projectUnlocked(_projectId), "Only if unlocked");
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function _onlyAdminACL(bytes4 _selector, uint256 _projectId) internal {
|
|
324
|
+
require(
|
|
325
|
+
adminACLAllowed(msg.sender, address(this), _selector, _projectId),
|
|
326
|
+
"Only Admin ACL allowed"
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function _onlyArtist(uint256 _projectId) internal view {
|
|
331
|
+
require(
|
|
332
|
+
msg.sender == projectIdToFinancials[_projectId].artistAddress,
|
|
333
|
+
"Only artist"
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function _onlyArtistOrAdminACL(
|
|
338
|
+
uint256 _projectId,
|
|
339
|
+
bytes4 _selector
|
|
340
|
+
) internal {
|
|
341
|
+
require(
|
|
342
|
+
msg.sender == projectIdToFinancials[_projectId].artistAddress ||
|
|
343
|
+
adminACLAllowed(
|
|
344
|
+
msg.sender,
|
|
345
|
+
address(this),
|
|
346
|
+
_selector,
|
|
347
|
+
_projectId
|
|
348
|
+
),
|
|
349
|
+
"Only artist or Admin ACL allowed"
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* This modifier allows the artist of a project to call a function if the
|
|
355
|
+
* owner of the contract has renounced ownership. This is to allow the
|
|
356
|
+
* contract to continue to function if the owner decides to renounce
|
|
357
|
+
* ownership.
|
|
358
|
+
*/
|
|
359
|
+
function _onlyAdminACLOrRenouncedArtist(
|
|
360
|
+
uint256 _projectId,
|
|
361
|
+
bytes4 _selector
|
|
362
|
+
) internal {
|
|
363
|
+
require(
|
|
364
|
+
adminACLAllowed(msg.sender, address(this), _selector, _projectId) ||
|
|
365
|
+
(owner() == address(0) &&
|
|
366
|
+
msg.sender ==
|
|
367
|
+
projectIdToFinancials[_projectId].artistAddress),
|
|
368
|
+
"Only Admin ACL allowed, or artist if owner has renounced"
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* @notice Initializes contract.
|
|
374
|
+
* @param _tokenName Name of token.
|
|
375
|
+
* @param _tokenSymbol Token symbol.
|
|
376
|
+
* @param _randomizerContract Randomizer contract.
|
|
377
|
+
* @param _adminACLContract Address of admin access control contract, to be
|
|
378
|
+
* set as contract owner.
|
|
379
|
+
* @param _startingProjectId The initial next project ID.
|
|
380
|
+
* @param _autoApproveArtistSplitProposals Whether or not to always
|
|
381
|
+
* auto-approve proposed artist split updates.
|
|
382
|
+
* @dev _startingProjectId should be set to a value much, much less than
|
|
383
|
+
* max(uint248), but an explicit input type of `uint248` is used as it is
|
|
384
|
+
* safer to cast up to `uint256` than it is to cast down for the purposes
|
|
385
|
+
* of setting `_nextProjectId`.
|
|
386
|
+
*/
|
|
387
|
+
constructor(
|
|
388
|
+
string memory _tokenName,
|
|
389
|
+
string memory _tokenSymbol,
|
|
390
|
+
address _renderProviderAddress,
|
|
391
|
+
address _platformProviderAddress,
|
|
392
|
+
address _randomizerContract,
|
|
393
|
+
address _adminACLContract,
|
|
394
|
+
uint248 _startingProjectId,
|
|
395
|
+
bool _autoApproveArtistSplitProposals,
|
|
396
|
+
address _engineRegistryContract
|
|
397
|
+
) ERC721_PackedHashSeed(_tokenName, _tokenSymbol) {
|
|
398
|
+
_onlyNonZeroAddress(_renderProviderAddress);
|
|
399
|
+
_onlyNonZeroAddress(_platformProviderAddress);
|
|
400
|
+
_onlyNonZeroAddress(_randomizerContract);
|
|
401
|
+
_onlyNonZeroAddress(_adminACLContract);
|
|
402
|
+
// setup immutable `autoApproveArtistSplitProposals` config
|
|
403
|
+
autoApproveArtistSplitProposals = _autoApproveArtistSplitProposals;
|
|
404
|
+
// record contracts starting project ID
|
|
405
|
+
// casting-up is safe
|
|
406
|
+
startingProjectId = uint256(_startingProjectId);
|
|
407
|
+
_updateProviderSalesAddresses(
|
|
408
|
+
_renderProviderAddress,
|
|
409
|
+
_renderProviderAddress,
|
|
410
|
+
_platformProviderAddress,
|
|
411
|
+
_platformProviderAddress
|
|
412
|
+
);
|
|
413
|
+
_updateRandomizerAddress(_randomizerContract);
|
|
414
|
+
// set AdminACL management contract as owner
|
|
415
|
+
_transferOwnership(_adminACLContract);
|
|
416
|
+
// initialize default base URI
|
|
417
|
+
_updateDefaultBaseURI(
|
|
418
|
+
string.concat(
|
|
419
|
+
"https://token.artblocks.io/",
|
|
420
|
+
toHexString(address(this)),
|
|
421
|
+
"/"
|
|
422
|
+
)
|
|
423
|
+
);
|
|
424
|
+
// initialize next project ID
|
|
425
|
+
_nextProjectId = _startingProjectId;
|
|
426
|
+
emit PlatformUpdated(FIELD_NEXT_PROJECT_ID);
|
|
427
|
+
// register contract as an Engine contract
|
|
428
|
+
IEngineRegistryV0(_engineRegistryContract).registerContract(
|
|
429
|
+
address(this),
|
|
430
|
+
CORE_VERSION,
|
|
431
|
+
CORE_TYPE
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* @notice Updates preferredIPFSGateway to `_gateway`.
|
|
437
|
+
*/
|
|
438
|
+
function updateIPFSGateway(string calldata _gateway) public {
|
|
439
|
+
_onlyAdminACL(this.updateIPFSGateway.selector, type(uint256).max);
|
|
440
|
+
preferredIPFSGateway = _gateway;
|
|
441
|
+
emit GatewayUpdated(ExternalAssetDependencyType.IPFS, _gateway);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* @notice Updates preferredArweaveGateway to `_gateway`.
|
|
446
|
+
*/
|
|
447
|
+
function updateArweaveGateway(string calldata _gateway) public {
|
|
448
|
+
_onlyAdminACL(this.updateArweaveGateway.selector, type(uint256).max);
|
|
449
|
+
preferredArweaveGateway = _gateway;
|
|
450
|
+
emit GatewayUpdated(ExternalAssetDependencyType.ARWEAVE, _gateway);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* @notice Locks external asset dependencies for project `_projectId`.
|
|
455
|
+
*/
|
|
456
|
+
function lockProjectExternalAssetDependencies(uint256 _projectId) external {
|
|
457
|
+
_onlyUnlockedProjectExternalAssetDependencies(_projectId);
|
|
458
|
+
_onlyArtistOrAdminACL(
|
|
459
|
+
_projectId,
|
|
460
|
+
this.lockProjectExternalAssetDependencies.selector
|
|
461
|
+
);
|
|
462
|
+
projects[_projectId].externalAssetDependenciesLocked = true;
|
|
463
|
+
emit ProjectExternalAssetDependenciesLocked(_projectId);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* @notice Updates external asset dependency for project `_projectId`.
|
|
468
|
+
* @param _projectId Project to be updated.
|
|
469
|
+
* @param _index Asset index.
|
|
470
|
+
* @param _cidOrData Asset cid (Content identifier) or data string to be translated into bytecode.
|
|
471
|
+
* @param _dependencyType Asset dependency type.
|
|
472
|
+
* 0 - IPFS
|
|
473
|
+
* 1 - ARWEAVE
|
|
474
|
+
* 2 - ONCHAIN
|
|
475
|
+
*/
|
|
476
|
+
function updateProjectExternalAssetDependency(
|
|
477
|
+
uint256 _projectId,
|
|
478
|
+
uint256 _index,
|
|
479
|
+
string memory _cidOrData,
|
|
480
|
+
ExternalAssetDependencyType _dependencyType
|
|
481
|
+
) external {
|
|
482
|
+
_onlyUnlockedProjectExternalAssetDependencies(_projectId);
|
|
483
|
+
_onlyArtistOrAdminACL(
|
|
484
|
+
_projectId,
|
|
485
|
+
this.updateProjectExternalAssetDependency.selector
|
|
486
|
+
);
|
|
487
|
+
uint24 assetCount = projects[_projectId].externalAssetDependencyCount;
|
|
488
|
+
require(_index < assetCount, "Asset index out of range");
|
|
489
|
+
ExternalAssetDependency storage _oldDependency = projects[_projectId]
|
|
490
|
+
.externalAssetDependencies[_index];
|
|
491
|
+
ExternalAssetDependencyType _oldDependencyType = _oldDependency
|
|
492
|
+
.dependencyType;
|
|
493
|
+
projects[_projectId]
|
|
494
|
+
.externalAssetDependencies[_index]
|
|
495
|
+
.dependencyType = _dependencyType;
|
|
496
|
+
// if the incoming dependency type is onchain, we need to write the data to bytecode
|
|
497
|
+
if (_dependencyType == ExternalAssetDependencyType.ONCHAIN) {
|
|
498
|
+
if (_oldDependencyType != ExternalAssetDependencyType.ONCHAIN) {
|
|
499
|
+
// we only need to set the cid to an empty string if we are replacing an offchain asset
|
|
500
|
+
// an onchain asset will already have an empty cid
|
|
501
|
+
projects[_projectId].externalAssetDependencies[_index].cid = "";
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
projects[_projectId]
|
|
505
|
+
.externalAssetDependencies[_index]
|
|
506
|
+
.bytecodeAddress = _cidOrData.writeToBytecode();
|
|
507
|
+
// we don't want to emit data, so we emit the cid as an empty string
|
|
508
|
+
_cidOrData = "";
|
|
509
|
+
} else {
|
|
510
|
+
projects[_projectId]
|
|
511
|
+
.externalAssetDependencies[_index]
|
|
512
|
+
.cid = _cidOrData;
|
|
513
|
+
}
|
|
514
|
+
emit ExternalAssetDependencyUpdated(
|
|
515
|
+
_projectId,
|
|
516
|
+
_index,
|
|
517
|
+
_cidOrData,
|
|
518
|
+
_dependencyType,
|
|
519
|
+
assetCount
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* @notice Removes external asset dependency for project `_projectId` at index `_index`.
|
|
525
|
+
* Removal is done by swapping the element to be removed with the last element in the array, then deleting this last element.
|
|
526
|
+
* Assets with indices higher than `_index` can have their indices adjusted as a result of this operation.
|
|
527
|
+
* @param _projectId Project to be updated.
|
|
528
|
+
* @param _index Asset index
|
|
529
|
+
*/
|
|
530
|
+
function removeProjectExternalAssetDependency(
|
|
531
|
+
uint256 _projectId,
|
|
532
|
+
uint256 _index
|
|
533
|
+
) external {
|
|
534
|
+
_onlyUnlockedProjectExternalAssetDependencies(_projectId);
|
|
535
|
+
_onlyArtistOrAdminACL(
|
|
536
|
+
_projectId,
|
|
537
|
+
this.removeProjectExternalAssetDependency.selector
|
|
538
|
+
);
|
|
539
|
+
uint24 assetCount = projects[_projectId].externalAssetDependencyCount;
|
|
540
|
+
require(_index < assetCount, "Asset index out of range");
|
|
541
|
+
|
|
542
|
+
uint24 lastElementIndex = assetCount - 1;
|
|
543
|
+
|
|
544
|
+
// copy last element to index of element to be removed
|
|
545
|
+
projects[_projectId].externalAssetDependencies[_index] = projects[
|
|
546
|
+
_projectId
|
|
547
|
+
].externalAssetDependencies[lastElementIndex];
|
|
548
|
+
|
|
549
|
+
delete projects[_projectId].externalAssetDependencies[lastElementIndex];
|
|
550
|
+
|
|
551
|
+
projects[_projectId].externalAssetDependencyCount = lastElementIndex;
|
|
552
|
+
|
|
553
|
+
emit ExternalAssetDependencyRemoved(_projectId, _index);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @notice Adds external asset dependency for project `_projectId`.
|
|
558
|
+
* @param _projectId Project to be updated.
|
|
559
|
+
* @param _cidOrData Asset cid (Content identifier) or data string to be translated into bytecode.
|
|
560
|
+
* @param _dependencyType Asset dependency type.
|
|
561
|
+
* 0 - IPFS
|
|
562
|
+
* 1 - ARWEAVE
|
|
563
|
+
* 2 - ONCHAIN
|
|
564
|
+
*/
|
|
565
|
+
function addProjectExternalAssetDependency(
|
|
566
|
+
uint256 _projectId,
|
|
567
|
+
string memory _cidOrData,
|
|
568
|
+
ExternalAssetDependencyType _dependencyType
|
|
569
|
+
) external {
|
|
570
|
+
_onlyUnlockedProjectExternalAssetDependencies(_projectId);
|
|
571
|
+
_onlyArtistOrAdminACL(
|
|
572
|
+
_projectId,
|
|
573
|
+
this.addProjectExternalAssetDependency.selector
|
|
574
|
+
);
|
|
575
|
+
uint24 assetCount = projects[_projectId].externalAssetDependencyCount;
|
|
576
|
+
address _bytecodeAddress = address(0);
|
|
577
|
+
// if the incoming dependency type is onchain, we need to write the data to bytecode
|
|
578
|
+
if (_dependencyType == ExternalAssetDependencyType.ONCHAIN) {
|
|
579
|
+
_bytecodeAddress = _cidOrData.writeToBytecode();
|
|
580
|
+
// we don't want to emit data, so we emit the cid as an empty string
|
|
581
|
+
_cidOrData = "";
|
|
582
|
+
}
|
|
583
|
+
ExternalAssetDependency memory asset = ExternalAssetDependency({
|
|
584
|
+
cid: _cidOrData,
|
|
585
|
+
dependencyType: _dependencyType,
|
|
586
|
+
bytecodeAddress: _bytecodeAddress
|
|
587
|
+
});
|
|
588
|
+
projects[_projectId].externalAssetDependencies[assetCount] = asset;
|
|
589
|
+
projects[_projectId].externalAssetDependencyCount = assetCount + 1;
|
|
590
|
+
|
|
591
|
+
emit ExternalAssetDependencyUpdated(
|
|
592
|
+
_projectId,
|
|
593
|
+
assetCount,
|
|
594
|
+
_cidOrData,
|
|
595
|
+
_dependencyType,
|
|
596
|
+
assetCount + 1
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* @notice Mints a token from project `_projectId` and sets the
|
|
602
|
+
* token's owner to `_to`. Hash may or may not be assigned to the token
|
|
603
|
+
* during the mint transaction, depending on the randomizer contract.
|
|
604
|
+
* @param _to Address to be the minted token's owner.
|
|
605
|
+
* @param _projectId Project ID to mint a token on.
|
|
606
|
+
* @param _by Purchaser of minted token.
|
|
607
|
+
* @return _tokenId The ID of the minted token.
|
|
608
|
+
* @dev sender must be the allowed minterContract
|
|
609
|
+
* @dev name of function is optimized for gas usage
|
|
610
|
+
*/
|
|
611
|
+
function mint_Ecf(
|
|
612
|
+
address _to,
|
|
613
|
+
uint256 _projectId,
|
|
614
|
+
address _by
|
|
615
|
+
) external returns (uint256 _tokenId) {
|
|
616
|
+
// CHECKS
|
|
617
|
+
require(msg.sender == minterContract, "Must mint from minter contract");
|
|
618
|
+
Project storage project = projects[_projectId];
|
|
619
|
+
// load invocations into memory
|
|
620
|
+
uint24 invocationsBefore = project.invocations;
|
|
621
|
+
uint24 invocationsAfter;
|
|
622
|
+
unchecked {
|
|
623
|
+
// invocationsBefore guaranteed <= maxInvocations <= 1_000_000,
|
|
624
|
+
// 1_000_000 << max uint24, so no possible overflow
|
|
625
|
+
invocationsAfter = invocationsBefore + 1;
|
|
626
|
+
}
|
|
627
|
+
uint24 maxInvocations = project.maxInvocations;
|
|
628
|
+
|
|
629
|
+
require(
|
|
630
|
+
invocationsBefore < maxInvocations,
|
|
631
|
+
"Must not exceed max invocations"
|
|
632
|
+
);
|
|
633
|
+
require(
|
|
634
|
+
project.active ||
|
|
635
|
+
_by == projectIdToFinancials[_projectId].artistAddress,
|
|
636
|
+
"Project must exist and be active"
|
|
637
|
+
);
|
|
638
|
+
require(
|
|
639
|
+
!project.paused ||
|
|
640
|
+
_by == projectIdToFinancials[_projectId].artistAddress,
|
|
641
|
+
"Purchases are paused."
|
|
642
|
+
);
|
|
643
|
+
|
|
644
|
+
// EFFECTS
|
|
645
|
+
// increment project's invocations
|
|
646
|
+
project.invocations = invocationsAfter;
|
|
647
|
+
uint256 thisTokenId;
|
|
648
|
+
unchecked {
|
|
649
|
+
// invocationsBefore is uint24 << max uint256. In production use,
|
|
650
|
+
// _projectId * ONE_MILLION must be << max uint256, otherwise
|
|
651
|
+
// tokenIdToProjectId function become invalid.
|
|
652
|
+
// Therefore, no risk of overflow
|
|
653
|
+
thisTokenId = (_projectId * ONE_MILLION) + invocationsBefore;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// mark project as completed if hit max invocations
|
|
657
|
+
if (invocationsAfter == maxInvocations) {
|
|
658
|
+
_completeProject(_projectId);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// INTERACTIONS
|
|
662
|
+
_mint(_to, thisTokenId);
|
|
663
|
+
|
|
664
|
+
// token hash is updated by the randomizer contract on V3
|
|
665
|
+
randomizerContract.assignTokenHash(thisTokenId);
|
|
666
|
+
|
|
667
|
+
// Do not need to also log `projectId` in event, as the `projectId` for
|
|
668
|
+
// a given token can be derived from the `tokenId` with:
|
|
669
|
+
// projectId = tokenId / 1_000_000
|
|
670
|
+
emit Mint(_to, thisTokenId);
|
|
671
|
+
|
|
672
|
+
return thisTokenId;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* @notice Sets the hash seed for a given token ID `_tokenId`.
|
|
677
|
+
* May only be called by the current randomizer contract.
|
|
678
|
+
* May only be called for tokens that have not already been assigned a
|
|
679
|
+
* non-zero hash.
|
|
680
|
+
* @param _tokenId Token ID to set the hash for.
|
|
681
|
+
* @param _hashSeed Hash seed to set for the token ID. Only last 12 bytes
|
|
682
|
+
* will be used.
|
|
683
|
+
* @dev gas-optimized function name because called during mint sequence
|
|
684
|
+
* @dev if a separate event is required when the token hash is set, e.g.
|
|
685
|
+
* for indexing purposes, it must be emitted by the randomizer. This is to
|
|
686
|
+
* minimize gas when minting.
|
|
687
|
+
*/
|
|
688
|
+
function setTokenHash_8PT(uint256 _tokenId, bytes32 _hashSeed) external {
|
|
689
|
+
_onlyValidTokenId(_tokenId);
|
|
690
|
+
|
|
691
|
+
OwnerAndHashSeed storage ownerAndHashSeed = _ownersAndHashSeeds[
|
|
692
|
+
_tokenId
|
|
693
|
+
];
|
|
694
|
+
require(
|
|
695
|
+
msg.sender == address(randomizerContract),
|
|
696
|
+
"Only randomizer may set"
|
|
697
|
+
);
|
|
698
|
+
require(
|
|
699
|
+
ownerAndHashSeed.hashSeed == bytes12(0),
|
|
700
|
+
"Token hash already set"
|
|
701
|
+
);
|
|
702
|
+
require(_hashSeed != bytes12(0), "No zero hash seed");
|
|
703
|
+
ownerAndHashSeed.hashSeed = bytes12(_hashSeed);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* @notice Allows owner (AdminACL) to revoke ownership of the contract.
|
|
708
|
+
* Note that the contract is intended to continue to function after the
|
|
709
|
+
* owner renounces ownership, but no new projects will be able to be added.
|
|
710
|
+
* Renouncing ownership will leave the contract without an owner,
|
|
711
|
+
* thereby removing any functionality that is only available to the
|
|
712
|
+
* owner/AdminACL contract. The same is true for any dependent contracts
|
|
713
|
+
* that also integrate with the owner/AdminACL contract (e.g. potentially
|
|
714
|
+
* minter suite contracts, registry contracts, etc.).
|
|
715
|
+
* After renouncing ownership, artists will be in control of updates to
|
|
716
|
+
* their payment addresses and splits (see modifier
|
|
717
|
+
* onlyAdminACLOrRenouncedArtist`).
|
|
718
|
+
* While there is no currently intended reason to call this method based on
|
|
719
|
+
* typical Engine partner business practices, this method exists to allow
|
|
720
|
+
* artists to continue to maintain the limited set of contract
|
|
721
|
+
* functionality that exists post-project-lock in an environment in which
|
|
722
|
+
* there is no longer an admin maintaining this smart contract.
|
|
723
|
+
* @dev This function is intended to be called directly by the AdminACL,
|
|
724
|
+
* not by an address allowed by the AdminACL contract.
|
|
725
|
+
*/
|
|
726
|
+
function renounceOwnership() public override onlyOwner {
|
|
727
|
+
// broadcast that new projects are no longer allowed (if not already)
|
|
728
|
+
_forbidNewProjects();
|
|
729
|
+
// renounce ownership viw Ownable
|
|
730
|
+
Ownable.renounceOwnership();
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* @notice Updates reference to Art Blocks Dependency Registry contract.
|
|
735
|
+
* @param _artblocksDependencyRegistryAddress Address of new Dependency
|
|
736
|
+
* Registry.
|
|
737
|
+
*/
|
|
738
|
+
function updateArtblocksDependencyRegistryAddress(
|
|
739
|
+
address _artblocksDependencyRegistryAddress
|
|
740
|
+
) external {
|
|
741
|
+
_onlyAdminACL(
|
|
742
|
+
this.updateArtblocksDependencyRegistryAddress.selector,
|
|
743
|
+
type(uint256).max
|
|
744
|
+
);
|
|
745
|
+
_onlyNonZeroAddress(_artblocksDependencyRegistryAddress);
|
|
746
|
+
artblocksDependencyRegistryAddress = _artblocksDependencyRegistryAddress;
|
|
747
|
+
emit PlatformUpdated(FIELD_ARTBLOCKS_DEPENDENCY_REGISTRY_ADDRESS);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* @notice Updates sales addresses for the platform and render providers to
|
|
752
|
+
* the input parameters.
|
|
753
|
+
* @param _renderProviderPrimarySalesAddress Address of new primary sales
|
|
754
|
+
* payment address.
|
|
755
|
+
* @param _renderProviderSecondarySalesAddress Address of new secondary sales
|
|
756
|
+
* payment address.
|
|
757
|
+
* @param _platformProviderPrimarySalesAddress Address of new primary sales
|
|
758
|
+
* payment address.
|
|
759
|
+
* @param _platformProviderSecondarySalesAddress Address of new secondary sales
|
|
760
|
+
* payment address.
|
|
761
|
+
*/
|
|
762
|
+
function updateProviderSalesAddresses(
|
|
763
|
+
address payable _renderProviderPrimarySalesAddress,
|
|
764
|
+
address payable _renderProviderSecondarySalesAddress,
|
|
765
|
+
address payable _platformProviderPrimarySalesAddress,
|
|
766
|
+
address payable _platformProviderSecondarySalesAddress
|
|
767
|
+
) external {
|
|
768
|
+
_onlyAdminACL(
|
|
769
|
+
this.updateProviderSalesAddresses.selector,
|
|
770
|
+
type(uint256).max
|
|
771
|
+
);
|
|
772
|
+
_onlyNonZeroAddress(_renderProviderPrimarySalesAddress);
|
|
773
|
+
_onlyNonZeroAddress(_renderProviderSecondarySalesAddress);
|
|
774
|
+
_onlyNonZeroAddress(_platformProviderPrimarySalesAddress);
|
|
775
|
+
_onlyNonZeroAddress(_platformProviderSecondarySalesAddress);
|
|
776
|
+
_updateProviderSalesAddresses(
|
|
777
|
+
_renderProviderPrimarySalesAddress,
|
|
778
|
+
_renderProviderSecondarySalesAddress,
|
|
779
|
+
_platformProviderPrimarySalesAddress,
|
|
780
|
+
_platformProviderSecondarySalesAddress
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @notice Updates the render and platform provider primary sales revenue percentage to
|
|
786
|
+
* the provided inputs.
|
|
787
|
+
* @param renderProviderPrimarySalesPercentage_ New primary sales revenue % for the render provider
|
|
788
|
+
* @param platformProviderPrimarySalesPercentage_ New primary sales revenue % for the platform provider
|
|
789
|
+
* percentage.
|
|
790
|
+
*/
|
|
791
|
+
function updateProviderPrimarySalesPercentages(
|
|
792
|
+
uint256 renderProviderPrimarySalesPercentage_,
|
|
793
|
+
uint256 platformProviderPrimarySalesPercentage_
|
|
794
|
+
) external {
|
|
795
|
+
_onlyAdminACL(
|
|
796
|
+
this.updateProviderPrimarySalesPercentages.selector,
|
|
797
|
+
type(uint256).max
|
|
798
|
+
);
|
|
799
|
+
|
|
800
|
+
// Validate that the sum of the proposed %s, does not exceed 100%.
|
|
801
|
+
require(
|
|
802
|
+
(renderProviderPrimarySalesPercentage_ +
|
|
803
|
+
platformProviderPrimarySalesPercentage_) <= ONE_HUNDRED,
|
|
804
|
+
"Max sum of ONE_HUNDRED %"
|
|
805
|
+
);
|
|
806
|
+
// Casting to `uint8` here is safe due check above, which does not allow
|
|
807
|
+
// overflow as of solidity version ^0.8.0.
|
|
808
|
+
_renderProviderPrimarySalesPercentage = uint8(
|
|
809
|
+
renderProviderPrimarySalesPercentage_
|
|
810
|
+
);
|
|
811
|
+
_platformProviderPrimarySalesPercentage = uint8(
|
|
812
|
+
platformProviderPrimarySalesPercentage_
|
|
813
|
+
);
|
|
814
|
+
emit PlatformUpdated(FIELD_PROVIDER_PRIMARY_SALES_PERCENTAGES);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* @notice Updates render and platform provider secondary sales royalty Basis Points to
|
|
819
|
+
* the provided inputs.
|
|
820
|
+
* @param _renderProviderSecondarySalesBPS New secondary sales royalty Basis
|
|
821
|
+
* points.
|
|
822
|
+
* @param _platformProviderSecondarySalesBPS New secondary sales royalty Basis
|
|
823
|
+
* points.
|
|
824
|
+
* @dev Due to secondary royalties being ultimately enforced via social
|
|
825
|
+
* consensus, no hard upper limit is imposed on the BPS value, other than
|
|
826
|
+
* <= 100% royalty, which would not make mathematical sense. Realistically,
|
|
827
|
+
* changing this value is expected to either never occur, or be a rare
|
|
828
|
+
* occurrence.
|
|
829
|
+
*/
|
|
830
|
+
function updateProviderSecondarySalesBPS(
|
|
831
|
+
uint256 _renderProviderSecondarySalesBPS,
|
|
832
|
+
uint256 _platformProviderSecondarySalesBPS
|
|
833
|
+
) external {
|
|
834
|
+
_onlyAdminACL(
|
|
835
|
+
this.updateProviderSecondarySalesBPS.selector,
|
|
836
|
+
type(uint256).max
|
|
837
|
+
);
|
|
838
|
+
// Validate that the sum of the proposed provider BPS, does not exceed 10_000 BPS.
|
|
839
|
+
require(
|
|
840
|
+
(_renderProviderSecondarySalesBPS +
|
|
841
|
+
_platformProviderSecondarySalesBPS) <=
|
|
842
|
+
MAX_PROVIDER_SECONDARY_SALES_BPS,
|
|
843
|
+
"Over max sum of BPS"
|
|
844
|
+
);
|
|
845
|
+
renderProviderSecondarySalesBPS = _renderProviderSecondarySalesBPS;
|
|
846
|
+
platformProviderSecondarySalesBPS = _platformProviderSecondarySalesBPS;
|
|
847
|
+
emit PlatformUpdated(FIELD_PROVIDER_SECONDARY_SALES_BPS);
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* @notice Updates minter to `_address`.
|
|
852
|
+
* @param _address Address of new minter.
|
|
853
|
+
*/
|
|
854
|
+
function updateMinterContract(address _address) external {
|
|
855
|
+
_onlyAdminACL(this.updateMinterContract.selector, type(uint256).max);
|
|
856
|
+
_onlyNonZeroAddress(_address);
|
|
857
|
+
minterContract = _address;
|
|
858
|
+
emit MinterUpdated(_address);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* @notice Updates randomizer to `_randomizerAddress`.
|
|
863
|
+
* @param _randomizerAddress Address of new randomizer.
|
|
864
|
+
*/
|
|
865
|
+
function updateRandomizerAddress(address _randomizerAddress) external {
|
|
866
|
+
_onlyAdminACL(this.updateRandomizerAddress.selector, type(uint256).max);
|
|
867
|
+
_onlyNonZeroAddress(_randomizerAddress);
|
|
868
|
+
_updateRandomizerAddress(_randomizerAddress);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* @notice Toggles project `_projectId` as active/inactive.
|
|
873
|
+
* @param _projectId Project ID to be toggled.
|
|
874
|
+
*/
|
|
875
|
+
function toggleProjectIsActive(uint256 _projectId) external {
|
|
876
|
+
_onlyAdminACL(this.toggleProjectIsActive.selector, _projectId);
|
|
877
|
+
_onlyValidProjectId(_projectId);
|
|
878
|
+
projects[_projectId].active = !projects[_projectId].active;
|
|
879
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_ACTIVE);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* @notice Artist proposes updated set of artist address, additional payee
|
|
884
|
+
* addresses, and percentage splits for project `_projectId`. Addresses and
|
|
885
|
+
* percentages do not have to all be changed, but they must all be defined
|
|
886
|
+
* as a complete set.
|
|
887
|
+
* Note that if the artist is only proposing a change to the payee percentage
|
|
888
|
+
* splits, without modifying the payee addresses, the proposal will be
|
|
889
|
+
* automatically approved and the new splits will become active immediately.
|
|
890
|
+
* Automatic approval will also be granted if the artist is only removing
|
|
891
|
+
* additional payee addresses, without adding any new ones.
|
|
892
|
+
* Also note that if `autoApproveArtistSplitProposals` is true, proposals
|
|
893
|
+
* will always be auto-approved, regardless of what is being changed.
|
|
894
|
+
* Also note that if the artist is proposing sending funds to the zero
|
|
895
|
+
* address, this function will revert and the proposal will not be created.
|
|
896
|
+
* @param _projectId Project ID.
|
|
897
|
+
* @param _artistAddress Artist address that controls the project, and may
|
|
898
|
+
* receive payments.
|
|
899
|
+
* @param _additionalPayeePrimarySales Address that may receive a
|
|
900
|
+
* percentage split of the artist's primary sales revenue.
|
|
901
|
+
* @param _additionalPayeePrimarySalesPercentage Percent of artist's
|
|
902
|
+
* portion of primary sale revenue that will be split to address
|
|
903
|
+
* `_additionalPayeePrimarySales`.
|
|
904
|
+
* @param _additionalPayeeSecondarySales Address that may receive a percentage
|
|
905
|
+
* split of the secondary sales royalties.
|
|
906
|
+
* @param _additionalPayeeSecondarySalesPercentage Percent of artist's portion
|
|
907
|
+
* of secondary sale royalties that will be split to address
|
|
908
|
+
* `_additionalPayeeSecondarySales`.
|
|
909
|
+
* @dev `_artistAddress` must be a valid address (non-zero-address), but it
|
|
910
|
+
* is intentionally allowable for `_additionalPayee{Primary,Secondaary}Sales`
|
|
911
|
+
* and their associated percentages to be zero'd out by the controlling artist.
|
|
912
|
+
*/
|
|
913
|
+
function proposeArtistPaymentAddressesAndSplits(
|
|
914
|
+
uint256 _projectId,
|
|
915
|
+
address payable _artistAddress,
|
|
916
|
+
address payable _additionalPayeePrimarySales,
|
|
917
|
+
uint256 _additionalPayeePrimarySalesPercentage,
|
|
918
|
+
address payable _additionalPayeeSecondarySales,
|
|
919
|
+
uint256 _additionalPayeeSecondarySalesPercentage
|
|
920
|
+
) external {
|
|
921
|
+
_onlyValidProjectId(_projectId);
|
|
922
|
+
_onlyArtistOrAdminACL(
|
|
923
|
+
_projectId,
|
|
924
|
+
this.proposeArtistPaymentAddressesAndSplits.selector
|
|
925
|
+
);
|
|
926
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
927
|
+
ProjectFinance storage projectFinance = projectIdToFinancials[
|
|
928
|
+
_projectId
|
|
929
|
+
];
|
|
930
|
+
// checks
|
|
931
|
+
require(
|
|
932
|
+
_additionalPayeePrimarySalesPercentage <= ONE_HUNDRED &&
|
|
933
|
+
_additionalPayeeSecondarySalesPercentage <= ONE_HUNDRED,
|
|
934
|
+
"Max of 100%"
|
|
935
|
+
);
|
|
936
|
+
require(
|
|
937
|
+
_additionalPayeePrimarySalesPercentage == 0 ||
|
|
938
|
+
_additionalPayeePrimarySales != address(0),
|
|
939
|
+
"Primary payee is zero address"
|
|
940
|
+
);
|
|
941
|
+
require(
|
|
942
|
+
_additionalPayeeSecondarySalesPercentage == 0 ||
|
|
943
|
+
_additionalPayeeSecondarySales != address(0),
|
|
944
|
+
"Secondary payee is zero address"
|
|
945
|
+
);
|
|
946
|
+
// effects
|
|
947
|
+
// emit event for off-chain indexing
|
|
948
|
+
// note: always emit a proposal event, even in the pathway of
|
|
949
|
+
// automatic approval, to simplify indexing expectations
|
|
950
|
+
emit ProposedArtistAddressesAndSplits(
|
|
951
|
+
_projectId,
|
|
952
|
+
_artistAddress,
|
|
953
|
+
_additionalPayeePrimarySales,
|
|
954
|
+
_additionalPayeePrimarySalesPercentage,
|
|
955
|
+
_additionalPayeeSecondarySales,
|
|
956
|
+
_additionalPayeeSecondarySalesPercentage
|
|
957
|
+
);
|
|
958
|
+
// automatically accept if no proposed addresses modifications, or if
|
|
959
|
+
// the proposal only removes payee addresses, or if contract is set to
|
|
960
|
+
// always auto-approve.
|
|
961
|
+
// store proposal hash on-chain, only if not automatic accept
|
|
962
|
+
bool automaticAccept = autoApproveArtistSplitProposals;
|
|
963
|
+
if (!automaticAccept) {
|
|
964
|
+
// block scope to avoid stack too deep error
|
|
965
|
+
bool artistUnchanged = _artistAddress ==
|
|
966
|
+
projectFinance.artistAddress;
|
|
967
|
+
bool additionalPrimaryUnchangedOrRemoved = (_additionalPayeePrimarySales ==
|
|
968
|
+
projectFinance.additionalPayeePrimarySales) ||
|
|
969
|
+
(_additionalPayeePrimarySales == address(0));
|
|
970
|
+
bool additionalSecondaryUnchangedOrRemoved = (_additionalPayeeSecondarySales ==
|
|
971
|
+
projectFinance.additionalPayeeSecondarySales) ||
|
|
972
|
+
(_additionalPayeeSecondarySales == address(0));
|
|
973
|
+
automaticAccept =
|
|
974
|
+
artistUnchanged &&
|
|
975
|
+
additionalPrimaryUnchangedOrRemoved &&
|
|
976
|
+
additionalSecondaryUnchangedOrRemoved;
|
|
977
|
+
}
|
|
978
|
+
if (automaticAccept) {
|
|
979
|
+
// clear any previously proposed values
|
|
980
|
+
proposedArtistAddressesAndSplitsHash[_projectId] = bytes32(0);
|
|
981
|
+
// update storage
|
|
982
|
+
// artist address can change during automatic accept if
|
|
983
|
+
// autoApproveArtistSplitProposals is true
|
|
984
|
+
projectFinance.artistAddress = _artistAddress;
|
|
985
|
+
projectFinance
|
|
986
|
+
.additionalPayeePrimarySales = _additionalPayeePrimarySales;
|
|
987
|
+
// safe to cast as uint8 as max is 100%, max uint8 is 255
|
|
988
|
+
projectFinance.additionalPayeePrimarySalesPercentage = uint8(
|
|
989
|
+
_additionalPayeePrimarySalesPercentage
|
|
990
|
+
);
|
|
991
|
+
projectFinance
|
|
992
|
+
.additionalPayeeSecondarySales = _additionalPayeeSecondarySales;
|
|
993
|
+
// safe to cast as uint8 as max is 100%, max uint8 is 255
|
|
994
|
+
projectFinance.additionalPayeeSecondarySalesPercentage = uint8(
|
|
995
|
+
_additionalPayeeSecondarySalesPercentage
|
|
996
|
+
);
|
|
997
|
+
// emit event for off-chain indexing
|
|
998
|
+
emit AcceptedArtistAddressesAndSplits(_projectId);
|
|
999
|
+
} else {
|
|
1000
|
+
proposedArtistAddressesAndSplitsHash[_projectId] = keccak256(
|
|
1001
|
+
abi.encode(
|
|
1002
|
+
_artistAddress,
|
|
1003
|
+
_additionalPayeePrimarySales,
|
|
1004
|
+
_additionalPayeePrimarySalesPercentage,
|
|
1005
|
+
_additionalPayeeSecondarySales,
|
|
1006
|
+
_additionalPayeeSecondarySalesPercentage
|
|
1007
|
+
)
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* @notice Admin accepts a proposed set of updated artist address,
|
|
1014
|
+
* additional payee addresses, and percentage splits for project
|
|
1015
|
+
* `_projectId`. Addresses and percentages do not have to all be changed,
|
|
1016
|
+
* but they must all be defined as a complete set.
|
|
1017
|
+
* @param _projectId Project ID.
|
|
1018
|
+
* @param _artistAddress Artist address that controls the project, and may
|
|
1019
|
+
* receive payments.
|
|
1020
|
+
* @param _additionalPayeePrimarySales Address that may receive a
|
|
1021
|
+
* percentage split of the artist's primary sales revenue.
|
|
1022
|
+
* @param _additionalPayeePrimarySalesPercentage Percent of artist's
|
|
1023
|
+
* portion of primary sale revenue that will be split to address
|
|
1024
|
+
* `_additionalPayeePrimarySales`.
|
|
1025
|
+
* @param _additionalPayeeSecondarySales Address that may receive a percentage
|
|
1026
|
+
* split of the secondary sales royalties.
|
|
1027
|
+
* @param _additionalPayeeSecondarySalesPercentage Percent of artist's portion
|
|
1028
|
+
* of secondary sale royalties that will be split to address
|
|
1029
|
+
* `_additionalPayeeSecondarySales`.
|
|
1030
|
+
* @dev this must be called by the Admin ACL contract, and must only accept
|
|
1031
|
+
* the most recent proposed values for a given project (validated on-chain
|
|
1032
|
+
* by comparing the hash of the proposed and accepted values).
|
|
1033
|
+
* @dev `_artistAddress` must be a valid address (non-zero-address), but it
|
|
1034
|
+
* is intentionally allowable for `_additionalPayee{Primary,Secondaary}Sales`
|
|
1035
|
+
* and their associated percentages to be zero'd out by the controlling artist.
|
|
1036
|
+
*/
|
|
1037
|
+
function adminAcceptArtistAddressesAndSplits(
|
|
1038
|
+
uint256 _projectId,
|
|
1039
|
+
address payable _artistAddress,
|
|
1040
|
+
address payable _additionalPayeePrimarySales,
|
|
1041
|
+
uint256 _additionalPayeePrimarySalesPercentage,
|
|
1042
|
+
address payable _additionalPayeeSecondarySales,
|
|
1043
|
+
uint256 _additionalPayeeSecondarySalesPercentage
|
|
1044
|
+
) external {
|
|
1045
|
+
_onlyValidProjectId(_projectId);
|
|
1046
|
+
_onlyAdminACLOrRenouncedArtist(
|
|
1047
|
+
_projectId,
|
|
1048
|
+
this.adminAcceptArtistAddressesAndSplits.selector
|
|
1049
|
+
);
|
|
1050
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
1051
|
+
// checks
|
|
1052
|
+
require(
|
|
1053
|
+
proposedArtistAddressesAndSplitsHash[_projectId] ==
|
|
1054
|
+
keccak256(
|
|
1055
|
+
abi.encode(
|
|
1056
|
+
_artistAddress,
|
|
1057
|
+
_additionalPayeePrimarySales,
|
|
1058
|
+
_additionalPayeePrimarySalesPercentage,
|
|
1059
|
+
_additionalPayeeSecondarySales,
|
|
1060
|
+
_additionalPayeeSecondarySalesPercentage
|
|
1061
|
+
)
|
|
1062
|
+
),
|
|
1063
|
+
"Must match artist proposal"
|
|
1064
|
+
);
|
|
1065
|
+
// effects
|
|
1066
|
+
ProjectFinance storage projectFinance = projectIdToFinancials[
|
|
1067
|
+
_projectId
|
|
1068
|
+
];
|
|
1069
|
+
projectFinance.artistAddress = _artistAddress;
|
|
1070
|
+
projectFinance
|
|
1071
|
+
.additionalPayeePrimarySales = _additionalPayeePrimarySales;
|
|
1072
|
+
projectFinance.additionalPayeePrimarySalesPercentage = uint8(
|
|
1073
|
+
_additionalPayeePrimarySalesPercentage
|
|
1074
|
+
);
|
|
1075
|
+
projectFinance
|
|
1076
|
+
.additionalPayeeSecondarySales = _additionalPayeeSecondarySales;
|
|
1077
|
+
projectFinance.additionalPayeeSecondarySalesPercentage = uint8(
|
|
1078
|
+
_additionalPayeeSecondarySalesPercentage
|
|
1079
|
+
);
|
|
1080
|
+
// clear proposed values
|
|
1081
|
+
proposedArtistAddressesAndSplitsHash[_projectId] = bytes32(0);
|
|
1082
|
+
// emit event for off-chain indexing
|
|
1083
|
+
emit AcceptedArtistAddressesAndSplits(_projectId);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* @notice Updates artist of project `_projectId` to `_artistAddress`.
|
|
1088
|
+
* This is to only be used in the event that the artist address is
|
|
1089
|
+
* compromised or sanctioned.
|
|
1090
|
+
* @param _projectId Project ID.
|
|
1091
|
+
* @param _artistAddress New artist address.
|
|
1092
|
+
*/
|
|
1093
|
+
function updateProjectArtistAddress(
|
|
1094
|
+
uint256 _projectId,
|
|
1095
|
+
address payable _artistAddress
|
|
1096
|
+
) external {
|
|
1097
|
+
_onlyValidProjectId(_projectId);
|
|
1098
|
+
_onlyAdminACLOrRenouncedArtist(
|
|
1099
|
+
_projectId,
|
|
1100
|
+
this.updateProjectArtistAddress.selector
|
|
1101
|
+
);
|
|
1102
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
1103
|
+
projectIdToFinancials[_projectId].artistAddress = _artistAddress;
|
|
1104
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_ARTIST_ADDRESS);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* @notice Toggles paused state of project `_projectId`.
|
|
1109
|
+
* @param _projectId Project ID to be toggled.
|
|
1110
|
+
*/
|
|
1111
|
+
function toggleProjectIsPaused(uint256 _projectId) external {
|
|
1112
|
+
_onlyArtist(_projectId);
|
|
1113
|
+
projects[_projectId].paused = !projects[_projectId].paused;
|
|
1114
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_PAUSED);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* @notice Adds new project `_projectName` by `_artistAddress`.
|
|
1119
|
+
* @param _projectName Project name.
|
|
1120
|
+
* @param _artistAddress Artist's address.
|
|
1121
|
+
* @dev token price now stored on minter
|
|
1122
|
+
*/
|
|
1123
|
+
function addProject(
|
|
1124
|
+
string memory _projectName,
|
|
1125
|
+
address payable _artistAddress
|
|
1126
|
+
) external {
|
|
1127
|
+
_onlyNonEmptyString(_projectName);
|
|
1128
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
1129
|
+
require(!newProjectsForbidden, "New projects forbidden");
|
|
1130
|
+
require(
|
|
1131
|
+
IAdminACLV0_PROHIBITION(address(adminACLContract)).allowed(
|
|
1132
|
+
msg.sender,
|
|
1133
|
+
address(this),
|
|
1134
|
+
this.addProject.selector
|
|
1135
|
+
),
|
|
1136
|
+
"Only Admin ACL allowed"
|
|
1137
|
+
);
|
|
1138
|
+
uint256 projectId = _nextProjectId;
|
|
1139
|
+
projectIdToFinancials[projectId].artistAddress = _artistAddress;
|
|
1140
|
+
projects[projectId].name = _projectName;
|
|
1141
|
+
projects[projectId].paused = true;
|
|
1142
|
+
projects[projectId].maxInvocations = ONE_MILLION_UINT24;
|
|
1143
|
+
projects[projectId].projectBaseURI = defaultBaseURI;
|
|
1144
|
+
|
|
1145
|
+
_nextProjectId = uint248(projectId) + 1;
|
|
1146
|
+
emit ProjectUpdated(projectId, FIELD_PROJECT_CREATED);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* @notice Forever forbids new projects from being added to this contract.
|
|
1151
|
+
*/
|
|
1152
|
+
function forbidNewProjects() external {
|
|
1153
|
+
_onlyAdminACL(this.forbidNewProjects.selector, type(uint256).max);
|
|
1154
|
+
require(!newProjectsForbidden, "Already forbidden");
|
|
1155
|
+
_forbidNewProjects();
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* @notice Updates name of project `_projectId` to be `_projectName`.
|
|
1160
|
+
* @param _projectId Project ID.
|
|
1161
|
+
* @param _projectName New project name.
|
|
1162
|
+
*/
|
|
1163
|
+
function updateProjectName(
|
|
1164
|
+
uint256 _projectId,
|
|
1165
|
+
string memory _projectName
|
|
1166
|
+
) external {
|
|
1167
|
+
_onlyUnlocked(_projectId);
|
|
1168
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectName.selector);
|
|
1169
|
+
_onlyNonEmptyString(_projectName);
|
|
1170
|
+
projects[_projectId].name = _projectName;
|
|
1171
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_NAME);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* @notice Updates artist name for project `_projectId` to be
|
|
1176
|
+
* `_projectArtistName`.
|
|
1177
|
+
* @param _projectId Project ID.
|
|
1178
|
+
* @param _projectArtistName New artist name.
|
|
1179
|
+
*/
|
|
1180
|
+
function updateProjectArtistName(
|
|
1181
|
+
uint256 _projectId,
|
|
1182
|
+
string memory _projectArtistName
|
|
1183
|
+
) external {
|
|
1184
|
+
_onlyUnlocked(_projectId);
|
|
1185
|
+
_onlyArtistOrAdminACL(
|
|
1186
|
+
_projectId,
|
|
1187
|
+
this.updateProjectArtistName.selector
|
|
1188
|
+
);
|
|
1189
|
+
_onlyNonEmptyString(_projectArtistName);
|
|
1190
|
+
projects[_projectId].artist = _projectArtistName;
|
|
1191
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_ARTIST_NAME);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* @notice Updates artist secondary market royalties for project
|
|
1196
|
+
* `_projectId` to be `_secondMarketRoyalty` percent.
|
|
1197
|
+
* This DOES NOT include the secondary market royalty percentages collected
|
|
1198
|
+
* by the issuing platform; it is only the total percentage of royalties
|
|
1199
|
+
* that will be split to artist and additionalSecondaryPayee.
|
|
1200
|
+
* @param _projectId Project ID.
|
|
1201
|
+
* @param _secondMarketRoyalty Percent of secondary sales revenue that will
|
|
1202
|
+
* be split to artist and additionalSecondaryPayee. This must be less than
|
|
1203
|
+
* or equal to ARTIST_MAX_SECONDARY_ROYALTY_PERCENTAGE percent.
|
|
1204
|
+
*/
|
|
1205
|
+
function updateProjectSecondaryMarketRoyaltyPercentage(
|
|
1206
|
+
uint256 _projectId,
|
|
1207
|
+
uint256 _secondMarketRoyalty
|
|
1208
|
+
) external {
|
|
1209
|
+
_onlyArtistOrAdminACL(
|
|
1210
|
+
_projectId,
|
|
1211
|
+
this.updateProjectSecondaryMarketRoyaltyPercentage.selector
|
|
1212
|
+
);
|
|
1213
|
+
require(
|
|
1214
|
+
_secondMarketRoyalty <= ARTIST_MAX_SECONDARY_ROYALTY_PERCENTAGE,
|
|
1215
|
+
"Over max percent"
|
|
1216
|
+
);
|
|
1217
|
+
projectIdToFinancials[_projectId]
|
|
1218
|
+
.secondaryMarketRoyaltyPercentage = uint8(_secondMarketRoyalty);
|
|
1219
|
+
emit ProjectUpdated(
|
|
1220
|
+
_projectId,
|
|
1221
|
+
FIELD_PROJECT_SECONDARY_MARKET_ROYALTY_PERCENTAGE
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* @notice Updates description of project `_projectId`.
|
|
1227
|
+
* Only artist may call when unlocked, only admin may call when locked.
|
|
1228
|
+
* @param _projectId Project ID.
|
|
1229
|
+
* @param _projectDescription New project description.
|
|
1230
|
+
*/
|
|
1231
|
+
function updateProjectDescription(
|
|
1232
|
+
uint256 _projectId,
|
|
1233
|
+
string memory _projectDescription
|
|
1234
|
+
) external {
|
|
1235
|
+
// checks
|
|
1236
|
+
if (_projectUnlocked(_projectId)) {
|
|
1237
|
+
_onlyArtistOrAdminACL(
|
|
1238
|
+
_projectId,
|
|
1239
|
+
this.updateProjectDescription.selector
|
|
1240
|
+
);
|
|
1241
|
+
} else {
|
|
1242
|
+
require(
|
|
1243
|
+
adminACLAllowed(
|
|
1244
|
+
msg.sender,
|
|
1245
|
+
address(this),
|
|
1246
|
+
this.updateProjectDescription.selector,
|
|
1247
|
+
_projectId
|
|
1248
|
+
),
|
|
1249
|
+
"Only artist when unlocked, owner when locked"
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1252
|
+
// effects
|
|
1253
|
+
projects[_projectId].description = _projectDescription;
|
|
1254
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_DESCRIPTION);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* @notice Updates website of project `_projectId` to be `_projectWebsite`.
|
|
1259
|
+
* @param _projectId Project ID.
|
|
1260
|
+
* @param _projectWebsite New project website.
|
|
1261
|
+
* @dev It is intentionally allowed for this to be set to the empty string.
|
|
1262
|
+
*/
|
|
1263
|
+
function updateProjectWebsite(
|
|
1264
|
+
uint256 _projectId,
|
|
1265
|
+
string memory _projectWebsite
|
|
1266
|
+
) external {
|
|
1267
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectWebsite.selector);
|
|
1268
|
+
projects[_projectId].website = _projectWebsite;
|
|
1269
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_WEBSITE);
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* @notice Updates license for project `_projectId`.
|
|
1274
|
+
* @param _projectId Project ID.
|
|
1275
|
+
* @param _projectLicense New project license.
|
|
1276
|
+
*/
|
|
1277
|
+
function updateProjectLicense(
|
|
1278
|
+
uint256 _projectId,
|
|
1279
|
+
string memory _projectLicense
|
|
1280
|
+
) external {
|
|
1281
|
+
_onlyUnlocked(_projectId);
|
|
1282
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectLicense.selector);
|
|
1283
|
+
_onlyNonEmptyString(_projectLicense);
|
|
1284
|
+
projects[_projectId].license = _projectLicense;
|
|
1285
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_LICENSE);
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* @notice Updates maximum invocations for project `_projectId` to
|
|
1290
|
+
* `_maxInvocations`. Maximum invocations may only be decreased by the
|
|
1291
|
+
* artist, and must be greater than or equal to current invocations.
|
|
1292
|
+
* New projects are created with maximum invocations of 1 million by
|
|
1293
|
+
* default.
|
|
1294
|
+
* @param _projectId Project ID.
|
|
1295
|
+
* @param _maxInvocations New maximum invocations.
|
|
1296
|
+
*/
|
|
1297
|
+
function updateProjectMaxInvocations(
|
|
1298
|
+
uint256 _projectId,
|
|
1299
|
+
uint24 _maxInvocations
|
|
1300
|
+
) external {
|
|
1301
|
+
_onlyArtistOrAdminACL(
|
|
1302
|
+
_projectId,
|
|
1303
|
+
this.updateProjectMaxInvocations.selector
|
|
1304
|
+
);
|
|
1305
|
+
// CHECKS
|
|
1306
|
+
Project storage project = projects[_projectId];
|
|
1307
|
+
uint256 _invocations = project.invocations;
|
|
1308
|
+
require(
|
|
1309
|
+
(_maxInvocations < project.maxInvocations),
|
|
1310
|
+
"Only maxInvocations decrease"
|
|
1311
|
+
);
|
|
1312
|
+
require(_maxInvocations >= _invocations, "Only gte invocations");
|
|
1313
|
+
// EFFECTS
|
|
1314
|
+
project.maxInvocations = _maxInvocations;
|
|
1315
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_MAX_INVOCATIONS);
|
|
1316
|
+
|
|
1317
|
+
// register completed timestamp if action completed the project
|
|
1318
|
+
if (_maxInvocations == _invocations) {
|
|
1319
|
+
_completeProject(_projectId);
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* @notice Adds a script to project `_projectId`.
|
|
1325
|
+
* @param _projectId Project to be updated.
|
|
1326
|
+
* @param _script Script to be added. Required to be a non-empty string,
|
|
1327
|
+
* but no further validation is performed.
|
|
1328
|
+
*/
|
|
1329
|
+
function addProjectScript(
|
|
1330
|
+
uint256 _projectId,
|
|
1331
|
+
string memory _script
|
|
1332
|
+
) external {
|
|
1333
|
+
_onlyUnlocked(_projectId);
|
|
1334
|
+
_onlyArtistOrAdminACL(_projectId, this.addProjectScript.selector);
|
|
1335
|
+
_onlyNonEmptyString(_script);
|
|
1336
|
+
Project storage project = projects[_projectId];
|
|
1337
|
+
// store script in contract bytecode
|
|
1338
|
+
project.scriptBytecodeAddresses[project.scriptCount] = _script
|
|
1339
|
+
.writeToBytecode();
|
|
1340
|
+
project.scriptCount = project.scriptCount + 1;
|
|
1341
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_SCRIPT);
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* @notice Updates script for project `_projectId` at script ID `_scriptId`.
|
|
1346
|
+
* @param _projectId Project to be updated.
|
|
1347
|
+
* @param _scriptId Script ID to be updated.
|
|
1348
|
+
* @param _script The updated script value. Required to be a non-empty
|
|
1349
|
+
* string, but no further validation is performed.
|
|
1350
|
+
*/
|
|
1351
|
+
function updateProjectScript(
|
|
1352
|
+
uint256 _projectId,
|
|
1353
|
+
uint256 _scriptId,
|
|
1354
|
+
string memory _script
|
|
1355
|
+
) external {
|
|
1356
|
+
_onlyUnlocked(_projectId);
|
|
1357
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectScript.selector);
|
|
1358
|
+
_onlyNonEmptyString(_script);
|
|
1359
|
+
Project storage project = projects[_projectId];
|
|
1360
|
+
require(_scriptId < project.scriptCount, "scriptId out of range");
|
|
1361
|
+
|
|
1362
|
+
// store script in contract bytecode, replacing reference address from
|
|
1363
|
+
// the contract that no longer exists with the newly created one
|
|
1364
|
+
project.scriptBytecodeAddresses[_scriptId] = _script.writeToBytecode();
|
|
1365
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_SCRIPT);
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* @notice Removes last script from project `_projectId`.
|
|
1370
|
+
* @param _projectId Project to be updated.
|
|
1371
|
+
*/
|
|
1372
|
+
function removeProjectLastScript(uint256 _projectId) external {
|
|
1373
|
+
_onlyUnlocked(_projectId);
|
|
1374
|
+
_onlyArtistOrAdminACL(
|
|
1375
|
+
_projectId,
|
|
1376
|
+
this.removeProjectLastScript.selector
|
|
1377
|
+
);
|
|
1378
|
+
Project storage project = projects[_projectId];
|
|
1379
|
+
require(project.scriptCount > 0, "No scripts to remove");
|
|
1380
|
+
|
|
1381
|
+
// delete reference to contract address that no longer exists
|
|
1382
|
+
delete project.scriptBytecodeAddresses[project.scriptCount - 1];
|
|
1383
|
+
unchecked {
|
|
1384
|
+
project.scriptCount = project.scriptCount - 1;
|
|
1385
|
+
}
|
|
1386
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_SCRIPT);
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
/**
|
|
1390
|
+
* @notice Updates script type for project `_projectId`.
|
|
1391
|
+
* @param _projectId Project to be updated.
|
|
1392
|
+
* @param _scriptTypeAndVersion Script type and version e.g. "p5js@1.0.0",
|
|
1393
|
+
* as bytes32 encoded string.
|
|
1394
|
+
*/
|
|
1395
|
+
function updateProjectScriptType(
|
|
1396
|
+
uint256 _projectId,
|
|
1397
|
+
bytes32 _scriptTypeAndVersion
|
|
1398
|
+
) external {
|
|
1399
|
+
_onlyUnlocked(_projectId);
|
|
1400
|
+
_onlyArtistOrAdminACL(
|
|
1401
|
+
_projectId,
|
|
1402
|
+
this.updateProjectScriptType.selector
|
|
1403
|
+
);
|
|
1404
|
+
Project storage project = projects[_projectId];
|
|
1405
|
+
// require exactly one @ symbol in _scriptTypeAndVersion
|
|
1406
|
+
require(
|
|
1407
|
+
_scriptTypeAndVersion.containsExactCharacterQty(
|
|
1408
|
+
AT_CHARACTER_CODE,
|
|
1409
|
+
uint8(1)
|
|
1410
|
+
),
|
|
1411
|
+
"must contain exactly one @"
|
|
1412
|
+
);
|
|
1413
|
+
project.scriptTypeAndVersion = _scriptTypeAndVersion;
|
|
1414
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_SCRIPT_TYPE);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
/**
|
|
1418
|
+
* @notice Updates project's aspect ratio.
|
|
1419
|
+
* @param _projectId Project to be updated.
|
|
1420
|
+
* @param _aspectRatio Aspect ratio to be set. Intended to be string in the
|
|
1421
|
+
* format of a decimal, e.g. "1" for square, "1.77777778" for 16:9, etc.,
|
|
1422
|
+
* allowing for a maximum of 10 digits and one (optional) decimal separator.
|
|
1423
|
+
*/
|
|
1424
|
+
function updateProjectAspectRatio(
|
|
1425
|
+
uint256 _projectId,
|
|
1426
|
+
string memory _aspectRatio
|
|
1427
|
+
) external {
|
|
1428
|
+
_onlyUnlocked(_projectId);
|
|
1429
|
+
_onlyArtistOrAdminACL(
|
|
1430
|
+
_projectId,
|
|
1431
|
+
this.updateProjectAspectRatio.selector
|
|
1432
|
+
);
|
|
1433
|
+
_onlyNonEmptyString(_aspectRatio);
|
|
1434
|
+
// Perform more detailed input validation for aspect ratio.
|
|
1435
|
+
bytes memory aspectRatioBytes = bytes(_aspectRatio);
|
|
1436
|
+
uint256 bytesLength = aspectRatioBytes.length;
|
|
1437
|
+
require(bytesLength <= 11, "Aspect ratio format too long");
|
|
1438
|
+
bool hasSeenDecimalSeparator = false;
|
|
1439
|
+
bool hasSeenNumber = false;
|
|
1440
|
+
for (uint256 i; i < bytesLength; i++) {
|
|
1441
|
+
bytes1 character = aspectRatioBytes[i];
|
|
1442
|
+
// Allow as many #s as desired.
|
|
1443
|
+
if (character >= 0x30 && character <= 0x39) {
|
|
1444
|
+
// 9-0
|
|
1445
|
+
// We need to ensure there is at least 1 `9-0` occurrence.
|
|
1446
|
+
hasSeenNumber = true;
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1449
|
+
if (character == 0x2E) {
|
|
1450
|
+
// .
|
|
1451
|
+
// Allow no more than 1 `.` occurrence.
|
|
1452
|
+
if (!hasSeenDecimalSeparator) {
|
|
1453
|
+
hasSeenDecimalSeparator = true;
|
|
1454
|
+
continue;
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
revert("Improperly formatted aspect ratio");
|
|
1458
|
+
}
|
|
1459
|
+
require(hasSeenNumber, "Aspect ratio has no numbers");
|
|
1460
|
+
|
|
1461
|
+
projects[_projectId].aspectRatio = _aspectRatio;
|
|
1462
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_ASPECT_RATIO);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* @notice Updates base URI for project `_projectId` to `_newBaseURI`.
|
|
1467
|
+
* This is the controlling base URI for all tokens in the project. The
|
|
1468
|
+
* contract-level defaultBaseURI is only used when initializing new
|
|
1469
|
+
* projects.
|
|
1470
|
+
* @param _projectId Project to be updated.
|
|
1471
|
+
* @param _newBaseURI New base URI.
|
|
1472
|
+
*/
|
|
1473
|
+
function updateProjectBaseURI(
|
|
1474
|
+
uint256 _projectId,
|
|
1475
|
+
string memory _newBaseURI
|
|
1476
|
+
) external {
|
|
1477
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectBaseURI.selector);
|
|
1478
|
+
_onlyNonEmptyString(_newBaseURI);
|
|
1479
|
+
projects[_projectId].projectBaseURI = _newBaseURI;
|
|
1480
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_BASE_URI);
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* @notice Updates default base URI to `_defaultBaseURI`. The
|
|
1485
|
+
* contract-level defaultBaseURI is only used when initializing new
|
|
1486
|
+
* projects. Token URIs are determined by their project's `projectBaseURI`.
|
|
1487
|
+
* @param _defaultBaseURI New default base URI.
|
|
1488
|
+
*/
|
|
1489
|
+
function updateDefaultBaseURI(string memory _defaultBaseURI) external {
|
|
1490
|
+
_onlyAdminACL(this.updateDefaultBaseURI.selector, type(uint256).max);
|
|
1491
|
+
_onlyNonEmptyString(_defaultBaseURI);
|
|
1492
|
+
_updateDefaultBaseURI(_defaultBaseURI);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/**
|
|
1496
|
+
* @notice Next project ID to be created on this contract.
|
|
1497
|
+
* @return uint256 Next project ID.
|
|
1498
|
+
*/
|
|
1499
|
+
function nextProjectId() external view returns (uint256) {
|
|
1500
|
+
return _nextProjectId;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
/**
|
|
1504
|
+
* @notice Returns token hash for token ID `_tokenId`. Returns null if hash
|
|
1505
|
+
* has not been set.
|
|
1506
|
+
* @param _tokenId Token ID to be queried.
|
|
1507
|
+
* @return bytes32 Token hash.
|
|
1508
|
+
* @dev token hash is the keccak256 hash of the stored hash seed
|
|
1509
|
+
*/
|
|
1510
|
+
function tokenIdToHash(uint256 _tokenId) external view returns (bytes32) {
|
|
1511
|
+
bytes12 _hashSeed = _ownersAndHashSeeds[_tokenId].hashSeed;
|
|
1512
|
+
if (_hashSeed == 0) {
|
|
1513
|
+
return 0;
|
|
1514
|
+
}
|
|
1515
|
+
return keccak256(abi.encode(_hashSeed));
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* @notice Returns token hash **seed** for token ID `_tokenId`. Returns
|
|
1520
|
+
* null if hash seed has not been set. The hash seed id the bytes12 value
|
|
1521
|
+
* which is hashed to produce the token hash.
|
|
1522
|
+
* @param _tokenId Token ID to be queried.
|
|
1523
|
+
* @return bytes12 Token hash seed.
|
|
1524
|
+
* @dev token hash seed is keccak256 hashed to give the token hash
|
|
1525
|
+
*/
|
|
1526
|
+
function tokenIdToHashSeed(
|
|
1527
|
+
uint256 _tokenId
|
|
1528
|
+
) external view returns (bytes12) {
|
|
1529
|
+
return _ownersAndHashSeeds[_tokenId].hashSeed;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* @notice View function returning the render provider portion of
|
|
1534
|
+
* primary sales, in percent.
|
|
1535
|
+
* @return uint256 The render provider portion of primary sales,
|
|
1536
|
+
* in percent.
|
|
1537
|
+
*/
|
|
1538
|
+
function renderProviderPrimarySalesPercentage()
|
|
1539
|
+
external
|
|
1540
|
+
view
|
|
1541
|
+
returns (uint256)
|
|
1542
|
+
{
|
|
1543
|
+
return _renderProviderPrimarySalesPercentage;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* @notice View function returning the platform provider portion of
|
|
1548
|
+
* primary sales, in percent.
|
|
1549
|
+
* @return uint256 The platform provider portion of primary sales,
|
|
1550
|
+
* in percent.
|
|
1551
|
+
*/
|
|
1552
|
+
function platformProviderPrimarySalesPercentage()
|
|
1553
|
+
external
|
|
1554
|
+
view
|
|
1555
|
+
returns (uint256)
|
|
1556
|
+
{
|
|
1557
|
+
return _platformProviderPrimarySalesPercentage;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* @notice View function returning Artist's address for project
|
|
1562
|
+
* `_projectId`.
|
|
1563
|
+
* @param _projectId Project ID to be queried.
|
|
1564
|
+
* @return address Artist's address.
|
|
1565
|
+
*/
|
|
1566
|
+
function projectIdToArtistAddress(
|
|
1567
|
+
uint256 _projectId
|
|
1568
|
+
) external view returns (address payable) {
|
|
1569
|
+
return projectIdToFinancials[_projectId].artistAddress;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* @notice View function returning Artist's secondary market royalty
|
|
1574
|
+
* percentage for project `_projectId`.
|
|
1575
|
+
* This does not include render/platform providers portions of secondary
|
|
1576
|
+
* market royalties.
|
|
1577
|
+
* @param _projectId Project ID to be queried.
|
|
1578
|
+
* @return uint256 Artist's secondary market royalty percentage.
|
|
1579
|
+
*/
|
|
1580
|
+
function projectIdToSecondaryMarketRoyaltyPercentage(
|
|
1581
|
+
uint256 _projectId
|
|
1582
|
+
) external view returns (uint256) {
|
|
1583
|
+
return
|
|
1584
|
+
projectIdToFinancials[_projectId].secondaryMarketRoyaltyPercentage;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* @notice View function returning Artist's additional payee address for
|
|
1589
|
+
* primary sales, for project `_projectId`.
|
|
1590
|
+
* @param _projectId Project ID to be queried.
|
|
1591
|
+
* @return address Artist's additional payee address for primary sales.
|
|
1592
|
+
*/
|
|
1593
|
+
function projectIdToAdditionalPayeePrimarySales(
|
|
1594
|
+
uint256 _projectId
|
|
1595
|
+
) external view returns (address payable) {
|
|
1596
|
+
return projectIdToFinancials[_projectId].additionalPayeePrimarySales;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* @notice View function returning Artist's additional payee primary sales
|
|
1601
|
+
* percentage, for project `_projectId`.
|
|
1602
|
+
* @param _projectId Project ID to be queried.
|
|
1603
|
+
* @return uint256 Artist's additional payee primary sales percentage.
|
|
1604
|
+
*/
|
|
1605
|
+
function projectIdToAdditionalPayeePrimarySalesPercentage(
|
|
1606
|
+
uint256 _projectId
|
|
1607
|
+
) external view returns (uint256) {
|
|
1608
|
+
return
|
|
1609
|
+
projectIdToFinancials[_projectId]
|
|
1610
|
+
.additionalPayeePrimarySalesPercentage;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* @notice View function returning Artist's additional payee address for
|
|
1615
|
+
* secondary sales, for project `_projectId`.
|
|
1616
|
+
* @param _projectId Project ID to be queried.
|
|
1617
|
+
* @return address payable Artist's additional payee address for secondary
|
|
1618
|
+
* sales.
|
|
1619
|
+
*/
|
|
1620
|
+
function projectIdToAdditionalPayeeSecondarySales(
|
|
1621
|
+
uint256 _projectId
|
|
1622
|
+
) external view returns (address payable) {
|
|
1623
|
+
return projectIdToFinancials[_projectId].additionalPayeeSecondarySales;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
/**
|
|
1627
|
+
* @notice View function returning Artist's additional payee secondary
|
|
1628
|
+
* sales percentage, for project `_projectId`.
|
|
1629
|
+
* @param _projectId Project ID to be queried.
|
|
1630
|
+
* @return uint256 Artist's additional payee secondary sales percentage.
|
|
1631
|
+
*/
|
|
1632
|
+
function projectIdToAdditionalPayeeSecondarySalesPercentage(
|
|
1633
|
+
uint256 _projectId
|
|
1634
|
+
) external view returns (uint256) {
|
|
1635
|
+
return
|
|
1636
|
+
projectIdToFinancials[_projectId]
|
|
1637
|
+
.additionalPayeeSecondarySalesPercentage;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
/**
|
|
1641
|
+
* @notice Returns project details for project `_projectId`.
|
|
1642
|
+
* @param _projectId Project to be queried.
|
|
1643
|
+
* @return projectName Name of project
|
|
1644
|
+
* @return artist Artist of project
|
|
1645
|
+
* @return description Project description
|
|
1646
|
+
* @return website Project website
|
|
1647
|
+
* @return license Project license
|
|
1648
|
+
* @dev this function was named projectDetails prior to V3 core contract.
|
|
1649
|
+
*/
|
|
1650
|
+
function projectDetails(
|
|
1651
|
+
uint256 _projectId
|
|
1652
|
+
)
|
|
1653
|
+
external
|
|
1654
|
+
view
|
|
1655
|
+
returns (
|
|
1656
|
+
string memory projectName,
|
|
1657
|
+
string memory artist,
|
|
1658
|
+
string memory description,
|
|
1659
|
+
string memory website,
|
|
1660
|
+
string memory license
|
|
1661
|
+
)
|
|
1662
|
+
{
|
|
1663
|
+
Project storage project = projects[_projectId];
|
|
1664
|
+
projectName = project.name;
|
|
1665
|
+
artist = project.artist;
|
|
1666
|
+
description = project.description;
|
|
1667
|
+
website = project.website;
|
|
1668
|
+
license = project.license;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* @notice Returns project state data for project `_projectId`.
|
|
1673
|
+
* @param _projectId Project to be queried
|
|
1674
|
+
* @return invocations Current number of invocations
|
|
1675
|
+
* @return maxInvocations Maximum allowed invocations
|
|
1676
|
+
* @return active Boolean representing if project is currently active
|
|
1677
|
+
* @return paused Boolean representing if project is paused
|
|
1678
|
+
* @return completedTimestamp zero if project not complete, otherwise
|
|
1679
|
+
* timestamp of project completion.
|
|
1680
|
+
* @return locked Boolean representing if project is locked
|
|
1681
|
+
* @dev price and currency info are located on minter contracts
|
|
1682
|
+
*/
|
|
1683
|
+
function projectStateData(
|
|
1684
|
+
uint256 _projectId
|
|
1685
|
+
)
|
|
1686
|
+
external
|
|
1687
|
+
view
|
|
1688
|
+
returns (
|
|
1689
|
+
uint256 invocations,
|
|
1690
|
+
uint256 maxInvocations,
|
|
1691
|
+
bool active,
|
|
1692
|
+
bool paused,
|
|
1693
|
+
uint256 completedTimestamp,
|
|
1694
|
+
bool locked
|
|
1695
|
+
)
|
|
1696
|
+
{
|
|
1697
|
+
Project storage project = projects[_projectId];
|
|
1698
|
+
invocations = project.invocations;
|
|
1699
|
+
maxInvocations = project.maxInvocations;
|
|
1700
|
+
active = project.active;
|
|
1701
|
+
paused = project.paused;
|
|
1702
|
+
completedTimestamp = project.completedTimestamp;
|
|
1703
|
+
locked = !_projectUnlocked(_projectId);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
/**
|
|
1707
|
+
* @notice Returns artist payment information for project `_projectId`.
|
|
1708
|
+
* @param _projectId Project to be queried
|
|
1709
|
+
* @return artistAddress Project Artist's address
|
|
1710
|
+
* @return additionalPayeePrimarySales Additional payee address for primary
|
|
1711
|
+
* sales
|
|
1712
|
+
* @return additionalPayeePrimarySalesPercentage Percentage of artist revenue
|
|
1713
|
+
* to be sent to the additional payee address for primary sales
|
|
1714
|
+
* @return additionalPayeeSecondarySales Additional payee address for secondary
|
|
1715
|
+
* sales royalties
|
|
1716
|
+
* @return additionalPayeeSecondarySalesPercentage Percentage of artist revenue
|
|
1717
|
+
* to be sent to the additional payee address for secondary sales royalties
|
|
1718
|
+
* @return secondaryMarketRoyaltyPercentage Royalty percentage to be sent to
|
|
1719
|
+
* combination of artist and additional payee. This does not include the
|
|
1720
|
+
* platform's percentage of secondary sales royalties, which is defined as
|
|
1721
|
+
* the sum of `renderProviderSecondarySalesBPS`
|
|
1722
|
+
* and `platformProviderSecondarySalesBPS`.
|
|
1723
|
+
*/
|
|
1724
|
+
function projectArtistPaymentInfo(
|
|
1725
|
+
uint256 _projectId
|
|
1726
|
+
)
|
|
1727
|
+
external
|
|
1728
|
+
view
|
|
1729
|
+
returns (
|
|
1730
|
+
address artistAddress,
|
|
1731
|
+
address additionalPayeePrimarySales,
|
|
1732
|
+
uint256 additionalPayeePrimarySalesPercentage,
|
|
1733
|
+
address additionalPayeeSecondarySales,
|
|
1734
|
+
uint256 additionalPayeeSecondarySalesPercentage,
|
|
1735
|
+
uint256 secondaryMarketRoyaltyPercentage
|
|
1736
|
+
)
|
|
1737
|
+
{
|
|
1738
|
+
ProjectFinance storage projectFinance = projectIdToFinancials[
|
|
1739
|
+
_projectId
|
|
1740
|
+
];
|
|
1741
|
+
artistAddress = projectFinance.artistAddress;
|
|
1742
|
+
additionalPayeePrimarySales = projectFinance
|
|
1743
|
+
.additionalPayeePrimarySales;
|
|
1744
|
+
additionalPayeePrimarySalesPercentage = projectFinance
|
|
1745
|
+
.additionalPayeePrimarySalesPercentage;
|
|
1746
|
+
additionalPayeeSecondarySales = projectFinance
|
|
1747
|
+
.additionalPayeeSecondarySales;
|
|
1748
|
+
additionalPayeeSecondarySalesPercentage = projectFinance
|
|
1749
|
+
.additionalPayeeSecondarySalesPercentage;
|
|
1750
|
+
secondaryMarketRoyaltyPercentage = projectFinance
|
|
1751
|
+
.secondaryMarketRoyaltyPercentage;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* @notice Returns script information for project `_projectId`.
|
|
1756
|
+
* @param _projectId Project to be queried.
|
|
1757
|
+
* @return scriptTypeAndVersion Project's script type and version
|
|
1758
|
+
* (e.g. "p5js(atSymbol)1.0.0")
|
|
1759
|
+
* @return aspectRatio Aspect ratio of project (e.g. "1" for square,
|
|
1760
|
+
* "1.77777778" for 16:9, etc.)
|
|
1761
|
+
* @return scriptCount Count of scripts for project
|
|
1762
|
+
*/
|
|
1763
|
+
function projectScriptDetails(
|
|
1764
|
+
uint256 _projectId
|
|
1765
|
+
)
|
|
1766
|
+
external
|
|
1767
|
+
view
|
|
1768
|
+
override(IGenArt721CoreContractV3_Base, IDependencyRegistryCompatibleV0)
|
|
1769
|
+
returns (
|
|
1770
|
+
string memory scriptTypeAndVersion,
|
|
1771
|
+
string memory aspectRatio,
|
|
1772
|
+
uint256 scriptCount
|
|
1773
|
+
)
|
|
1774
|
+
{
|
|
1775
|
+
Project storage project = projects[_projectId];
|
|
1776
|
+
scriptTypeAndVersion = project.scriptTypeAndVersion.toString();
|
|
1777
|
+
aspectRatio = project.aspectRatio;
|
|
1778
|
+
scriptCount = project.scriptCount;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
/**
|
|
1782
|
+
* @notice Returns address with bytecode containing project script for
|
|
1783
|
+
* project `_projectId` at script index `_index`.
|
|
1784
|
+
*/
|
|
1785
|
+
function projectScriptBytecodeAddressByIndex(
|
|
1786
|
+
uint256 _projectId,
|
|
1787
|
+
uint256 _index
|
|
1788
|
+
) external view returns (address) {
|
|
1789
|
+
return projects[_projectId].scriptBytecodeAddresses[_index];
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* @notice Returns script for project `_projectId` at script index `_index`.
|
|
1794
|
+
* @param _projectId Project to be queried.
|
|
1795
|
+
* @param _index Index of script to be queried.
|
|
1796
|
+
*/
|
|
1797
|
+
function projectScriptByIndex(
|
|
1798
|
+
uint256 _projectId,
|
|
1799
|
+
uint256 _index
|
|
1800
|
+
) external view returns (string memory) {
|
|
1801
|
+
Project storage project = projects[_projectId];
|
|
1802
|
+
// If trying to access an out-of-index script, return the empty string.
|
|
1803
|
+
if (_index >= project.scriptCount) {
|
|
1804
|
+
return "";
|
|
1805
|
+
}
|
|
1806
|
+
return _readFromBytecode(project.scriptBytecodeAddresses[_index]);
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
/**
|
|
1810
|
+
* @notice Returns base URI for project `_projectId`.
|
|
1811
|
+
* @param _projectId Project to be queried.
|
|
1812
|
+
* @return projectBaseURI Base URI for project
|
|
1813
|
+
*/
|
|
1814
|
+
function projectURIInfo(
|
|
1815
|
+
uint256 _projectId
|
|
1816
|
+
) external view returns (string memory projectBaseURI) {
|
|
1817
|
+
projectBaseURI = projects[_projectId].projectBaseURI;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
/**
|
|
1821
|
+
* @notice Backwards-compatible (pre-V3) function returning if `_minter` is
|
|
1822
|
+
* minterContract.
|
|
1823
|
+
* @param _minter Address to be queried.
|
|
1824
|
+
* @return bool Boolean representing if `_minter` is minterContract.
|
|
1825
|
+
*/
|
|
1826
|
+
function isMintWhitelisted(address _minter) external view returns (bool) {
|
|
1827
|
+
return (minterContract == _minter);
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* @notice Gets qty of randomizers in history of all randomizers used by
|
|
1832
|
+
* this core contract. If a randomizer is switched away from then back to,
|
|
1833
|
+
* it will show up in the history twice.
|
|
1834
|
+
* @return randomizerHistoryCount Count of randomizers in history
|
|
1835
|
+
*/
|
|
1836
|
+
function numHistoricalRandomizers() external view returns (uint256) {
|
|
1837
|
+
return _historicalRandomizerAddresses.length;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
/**
|
|
1841
|
+
* @notice Gets address of randomizer at index `_index` in history of all
|
|
1842
|
+
* randomizers used by this core contract. Index is zero-based.
|
|
1843
|
+
* @param _index Historical index of randomizer to be queried.
|
|
1844
|
+
* @return randomizerAddress Address of randomizer at index `_index`.
|
|
1845
|
+
* @dev If a randomizer is switched away from and then switched back to, it
|
|
1846
|
+
* will show up in the history twice.
|
|
1847
|
+
*/
|
|
1848
|
+
function getHistoricalRandomizerAt(
|
|
1849
|
+
uint256 _index
|
|
1850
|
+
) external view returns (address) {
|
|
1851
|
+
require(
|
|
1852
|
+
_index < _historicalRandomizerAddresses.length,
|
|
1853
|
+
"Index out of bounds"
|
|
1854
|
+
);
|
|
1855
|
+
return _historicalRandomizerAddresses[_index];
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
/**
|
|
1859
|
+
* @notice Gets royalty Basis Points (BPS) for token ID `_tokenId`.
|
|
1860
|
+
* This conforms to the IManifold interface designated in the Royalty
|
|
1861
|
+
* Registry's RoyaltyEngineV1.sol contract.
|
|
1862
|
+
* ref: https://github.com/manifoldxyz/royalty-registry-solidity
|
|
1863
|
+
* @param _tokenId Token ID to be queried.
|
|
1864
|
+
* @return recipients Array of royalty payment recipients
|
|
1865
|
+
* @return bps Array of Basis Points (BPS) allocated to each recipient,
|
|
1866
|
+
* aligned by index.
|
|
1867
|
+
* @dev reverts if invalid _tokenId
|
|
1868
|
+
* @dev only returns recipients that have a non-zero BPS allocation
|
|
1869
|
+
*/
|
|
1870
|
+
function getRoyalties(
|
|
1871
|
+
uint256 _tokenId
|
|
1872
|
+
)
|
|
1873
|
+
external
|
|
1874
|
+
view
|
|
1875
|
+
returns (address payable[] memory recipients, uint256[] memory bps)
|
|
1876
|
+
{
|
|
1877
|
+
_onlyValidTokenId(_tokenId);
|
|
1878
|
+
// initialize arrays with maximum potential length
|
|
1879
|
+
recipients = new address payable[](4);
|
|
1880
|
+
bps = new uint256[](4);
|
|
1881
|
+
|
|
1882
|
+
uint256 projectId = tokenIdToProjectId(_tokenId);
|
|
1883
|
+
ProjectFinance storage projectFinance = projectIdToFinancials[
|
|
1884
|
+
projectId
|
|
1885
|
+
];
|
|
1886
|
+
// load values into memory
|
|
1887
|
+
uint256 royaltyPercentageForArtistAndAdditional = projectFinance
|
|
1888
|
+
.secondaryMarketRoyaltyPercentage;
|
|
1889
|
+
uint256 additionalPayeePercentage = projectFinance
|
|
1890
|
+
.additionalPayeeSecondarySalesPercentage;
|
|
1891
|
+
// calculate BPS = percentage * 100
|
|
1892
|
+
uint256 artistBPS = (ONE_HUNDRED - additionalPayeePercentage) *
|
|
1893
|
+
royaltyPercentageForArtistAndAdditional;
|
|
1894
|
+
|
|
1895
|
+
uint256 additionalBPS = additionalPayeePercentage *
|
|
1896
|
+
royaltyPercentageForArtistAndAdditional;
|
|
1897
|
+
uint256 renderProviderBPS = renderProviderSecondarySalesBPS;
|
|
1898
|
+
uint256 platformProviderBPS = platformProviderSecondarySalesBPS;
|
|
1899
|
+
// populate arrays
|
|
1900
|
+
uint256 payeeCount;
|
|
1901
|
+
if (artistBPS > 0) {
|
|
1902
|
+
recipients[payeeCount] = projectFinance.artistAddress;
|
|
1903
|
+
bps[payeeCount++] = artistBPS;
|
|
1904
|
+
}
|
|
1905
|
+
if (additionalBPS > 0) {
|
|
1906
|
+
recipients[payeeCount] = projectFinance
|
|
1907
|
+
.additionalPayeeSecondarySales;
|
|
1908
|
+
bps[payeeCount++] = additionalBPS;
|
|
1909
|
+
}
|
|
1910
|
+
if (renderProviderBPS > 0) {
|
|
1911
|
+
recipients[payeeCount] = renderProviderSecondarySalesAddress;
|
|
1912
|
+
bps[payeeCount++] = renderProviderBPS;
|
|
1913
|
+
}
|
|
1914
|
+
if (platformProviderBPS > 0) {
|
|
1915
|
+
recipients[payeeCount] = platformProviderSecondarySalesAddress;
|
|
1916
|
+
bps[payeeCount++] = platformProviderBPS;
|
|
1917
|
+
}
|
|
1918
|
+
// trim arrays if necessary
|
|
1919
|
+
if (4 > payeeCount) {
|
|
1920
|
+
assembly {
|
|
1921
|
+
let decrease := sub(4, payeeCount)
|
|
1922
|
+
mstore(recipients, sub(mload(recipients), decrease))
|
|
1923
|
+
mstore(bps, sub(mload(bps), decrease))
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
return (recipients, bps);
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* @notice View function that returns appropriate revenue splits between
|
|
1931
|
+
* different render provider, platform provider, Artist, and Artist's
|
|
1932
|
+
* additional primary sales payee given a sale price of `_price` on
|
|
1933
|
+
* project `_projectId`.
|
|
1934
|
+
* This always returns four revenue amounts and four addresses, but if a
|
|
1935
|
+
* revenue is zero for either Artist or additional payee, the corresponding
|
|
1936
|
+
* address returned will also be null (for gas optimization).
|
|
1937
|
+
* Does not account for refund if user overpays for a token (minter should
|
|
1938
|
+
* handle a refund of the difference, if appropriate).
|
|
1939
|
+
* Some minters may have alternative methods of splitting payments, in
|
|
1940
|
+
* which case they should implement their own payment splitting logic.
|
|
1941
|
+
* @param _projectId Project ID to be queried.
|
|
1942
|
+
* @param _price Sale price of token.
|
|
1943
|
+
* @return renderProviderRevenue_ amount of revenue to be sent to the
|
|
1944
|
+
* render provider
|
|
1945
|
+
* @return renderProviderAddress_ address to send render provider revenue to
|
|
1946
|
+
* @return platformProviderRevenue_ amount of revenue to be sent to the
|
|
1947
|
+
* platform provider
|
|
1948
|
+
* @return platformProviderAddress_ address to send platform provider revenue to
|
|
1949
|
+
* @return artistRevenue_ amount of revenue to be sent to Artist
|
|
1950
|
+
* @return artistAddress_ address to send Artist revenue to. Will be null
|
|
1951
|
+
* if no revenue is due to artist (gas optimization).
|
|
1952
|
+
* @return additionalPayeePrimaryRevenue_ amount of revenue to be sent to
|
|
1953
|
+
* additional payee for primary sales
|
|
1954
|
+
* @return additionalPayeePrimaryAddress_ address to send Artist's
|
|
1955
|
+
* additional payee for primary sales revenue to. Will be null if no
|
|
1956
|
+
* revenue is due to additional payee for primary sales (gas optimization).
|
|
1957
|
+
* @dev this always returns four addresses and four revenues, but if the
|
|
1958
|
+
* revenue is zero, the corresponding address will be address(0). It is up
|
|
1959
|
+
* to the contract performing the revenue split to handle this
|
|
1960
|
+
* appropriately.
|
|
1961
|
+
*/
|
|
1962
|
+
function getPrimaryRevenueSplits(
|
|
1963
|
+
uint256 _projectId,
|
|
1964
|
+
uint256 _price
|
|
1965
|
+
)
|
|
1966
|
+
external
|
|
1967
|
+
view
|
|
1968
|
+
returns (
|
|
1969
|
+
uint256 renderProviderRevenue_,
|
|
1970
|
+
address payable renderProviderAddress_,
|
|
1971
|
+
uint256 platformProviderRevenue_,
|
|
1972
|
+
address payable platformProviderAddress_,
|
|
1973
|
+
uint256 artistRevenue_,
|
|
1974
|
+
address payable artistAddress_,
|
|
1975
|
+
uint256 additionalPayeePrimaryRevenue_,
|
|
1976
|
+
address payable additionalPayeePrimaryAddress_
|
|
1977
|
+
)
|
|
1978
|
+
{
|
|
1979
|
+
ProjectFinance storage projectFinance = projectIdToFinancials[
|
|
1980
|
+
_projectId
|
|
1981
|
+
];
|
|
1982
|
+
// calculate revenues – this is a three-way split between the
|
|
1983
|
+
// render provider, the platform provider, and the artist, and
|
|
1984
|
+
// is safe to perform this given that in the case of loss of
|
|
1985
|
+
// precision Solidity will round down.
|
|
1986
|
+
uint256 projectFunds = _price;
|
|
1987
|
+
renderProviderRevenue_ =
|
|
1988
|
+
(_price * uint256(_renderProviderPrimarySalesPercentage)) /
|
|
1989
|
+
ONE_HUNDRED;
|
|
1990
|
+
// renderProviderRevenue_ percentage is always <=100, so guaranteed to never underflow
|
|
1991
|
+
projectFunds -= renderProviderRevenue_;
|
|
1992
|
+
platformProviderRevenue_ =
|
|
1993
|
+
(_price * uint256(_platformProviderPrimarySalesPercentage)) /
|
|
1994
|
+
ONE_HUNDRED;
|
|
1995
|
+
// platformProviderRevenue_ percentage is always <=100, so guaranteed to never underflow
|
|
1996
|
+
projectFunds -= platformProviderRevenue_;
|
|
1997
|
+
additionalPayeePrimaryRevenue_ =
|
|
1998
|
+
(projectFunds *
|
|
1999
|
+
projectFinance.additionalPayeePrimarySalesPercentage) /
|
|
2000
|
+
ONE_HUNDRED;
|
|
2001
|
+
// projectIdToAdditionalPayeePrimarySalesPercentage is always
|
|
2002
|
+
// <=100, so guaranteed to never underflow
|
|
2003
|
+
artistRevenue_ = projectFunds - additionalPayeePrimaryRevenue_;
|
|
2004
|
+
// set addresses from storage
|
|
2005
|
+
renderProviderAddress_ = renderProviderPrimarySalesAddress;
|
|
2006
|
+
platformProviderAddress_ = platformProviderPrimarySalesAddress;
|
|
2007
|
+
if (artistRevenue_ > 0) {
|
|
2008
|
+
artistAddress_ = projectFinance.artistAddress;
|
|
2009
|
+
}
|
|
2010
|
+
if (additionalPayeePrimaryRevenue_ > 0) {
|
|
2011
|
+
additionalPayeePrimaryAddress_ = projectFinance
|
|
2012
|
+
.additionalPayeePrimarySales;
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
/**
|
|
2017
|
+
* @notice Returns external asset dependency for project `_projectId` at index `_index`.
|
|
2018
|
+
* If the dependencyType is ONCHAIN, the `data` field will contain the extrated bytecode data and `cid`
|
|
2019
|
+
* will be an empty string. Conversly, for any other dependencyType, the `data` field will be an empty string
|
|
2020
|
+
* and the `bytecodeAddress` will point to the zero address.
|
|
2021
|
+
*/
|
|
2022
|
+
function projectExternalAssetDependencyByIndex(
|
|
2023
|
+
uint256 _projectId,
|
|
2024
|
+
uint256 _index
|
|
2025
|
+
) external view returns (ExternalAssetDependencyWithData memory) {
|
|
2026
|
+
ExternalAssetDependency storage _dependency = projects[_projectId]
|
|
2027
|
+
.externalAssetDependencies[_index];
|
|
2028
|
+
address _bytecodeAddress = _dependency.bytecodeAddress;
|
|
2029
|
+
|
|
2030
|
+
return
|
|
2031
|
+
ExternalAssetDependencyWithData({
|
|
2032
|
+
dependencyType: _dependency.dependencyType,
|
|
2033
|
+
cid: _dependency.cid,
|
|
2034
|
+
bytecodeAddress: _bytecodeAddress,
|
|
2035
|
+
data: (_dependency.dependencyType ==
|
|
2036
|
+
ExternalAssetDependencyType.ONCHAIN)
|
|
2037
|
+
? _readFromBytecode(_bytecodeAddress)
|
|
2038
|
+
: ""
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
/**
|
|
2043
|
+
* @notice Returns external asset dependency count for project `_projectId` at index `_index`.
|
|
2044
|
+
*/
|
|
2045
|
+
function projectExternalAssetDependencyCount(
|
|
2046
|
+
uint256 _projectId
|
|
2047
|
+
) external view returns (uint256) {
|
|
2048
|
+
return uint256(projects[_projectId].externalAssetDependencyCount);
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* @notice Backwards-compatible (pre-V3) getter returning contract admin
|
|
2053
|
+
* @return address Address of contract admin (same as owner)
|
|
2054
|
+
*/
|
|
2055
|
+
function admin() external view returns (address) {
|
|
2056
|
+
return owner();
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
/**
|
|
2060
|
+
* @notice Gets the project ID for a given `_tokenId`.
|
|
2061
|
+
* @param _tokenId Token ID to be queried.
|
|
2062
|
+
* @return _projectId Project ID for given `_tokenId`.
|
|
2063
|
+
*/
|
|
2064
|
+
function tokenIdToProjectId(
|
|
2065
|
+
uint256 _tokenId
|
|
2066
|
+
) public pure returns (uint256 _projectId) {
|
|
2067
|
+
return _tokenId / ONE_MILLION;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* @notice Convenience function that returns whether `_sender` is allowed
|
|
2072
|
+
* to call function with selector `_selector` on contract `_contract`, as
|
|
2073
|
+
* determined by this contract's current Admin ACL contract. Expected use
|
|
2074
|
+
* cases include minter contracts checking if caller is allowed to call
|
|
2075
|
+
* admin-gated functions on minter contracts.
|
|
2076
|
+
* @param _sender Address of the sender calling function with selector
|
|
2077
|
+
* `_selector` on contract `_contract`.
|
|
2078
|
+
* @param _contract Address of the contract being called by `_sender`.
|
|
2079
|
+
* @param _selector Function selector of the function being called by
|
|
2080
|
+
* `_sender`.
|
|
2081
|
+
* @param _projectId Project ID of the project being acted on by `_sender`.
|
|
2082
|
+
* @return bool Whether `_sender` is allowed to call function with selector
|
|
2083
|
+
* `_selector` on contract `_contract`.
|
|
2084
|
+
* @dev assumes the Admin ACL contract is the owner of this contract, which
|
|
2085
|
+
* is expected to always be true.
|
|
2086
|
+
* @dev adminACLContract is expected to either be null address (if owner
|
|
2087
|
+
* has renounced ownership), or conform to IAdminACLV0 interface. Check for
|
|
2088
|
+
* null address first to avoid revert when admin has renounced ownership.
|
|
2089
|
+
*/
|
|
2090
|
+
function adminACLAllowed(
|
|
2091
|
+
address _sender,
|
|
2092
|
+
address _contract,
|
|
2093
|
+
bytes4 _selector,
|
|
2094
|
+
uint256 _projectId
|
|
2095
|
+
) public returns (bool) {
|
|
2096
|
+
return
|
|
2097
|
+
owner() != address(0) &&
|
|
2098
|
+
IAdminACLV0_PROHIBITION(address(adminACLContract)).allowed(
|
|
2099
|
+
_sender,
|
|
2100
|
+
_contract,
|
|
2101
|
+
_selector,
|
|
2102
|
+
_projectId
|
|
2103
|
+
);
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
/**
|
|
2107
|
+
* @notice Convenience function that returns whether `_sender` is allowed
|
|
2108
|
+
* to call function with selector `_selector` on contract `_contract`, as
|
|
2109
|
+
* determined by this contract's current Admin ACL contract. Expected use
|
|
2110
|
+
* cases include minter contracts checking if caller is allowed to call
|
|
2111
|
+
* admin-gated functions on minter contracts.
|
|
2112
|
+
* @param _sender Address of the sender calling function with selector
|
|
2113
|
+
* `_selector` on contract `_contract`.
|
|
2114
|
+
* @param _contract Address of the contract being called by `_sender`.
|
|
2115
|
+
* @param _selector Function selector of the function being called by
|
|
2116
|
+
* `_sender`.
|
|
2117
|
+
* @return bool Whether `_sender` is allowed to call function with selector
|
|
2118
|
+
* `_selector` on contract `_contract`.
|
|
2119
|
+
* @dev assumes the Admin ACL contract is the owner of this contract, which
|
|
2120
|
+
* is expected to always be true.
|
|
2121
|
+
* @dev adminACLContract is expected to either be null address (if owner
|
|
2122
|
+
* has renounced ownership), or conform to IAdminACLV0 interface. Check for
|
|
2123
|
+
* null address first to avoid revert when admin has renounced ownership.
|
|
2124
|
+
*/
|
|
2125
|
+
function adminACLAllowed(
|
|
2126
|
+
address _sender,
|
|
2127
|
+
address _contract,
|
|
2128
|
+
bytes4 _selector
|
|
2129
|
+
) public returns (bool) {
|
|
2130
|
+
return
|
|
2131
|
+
adminACLAllowed(_sender, _contract, _selector, type(uint256).max);
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
/**
|
|
2135
|
+
* @notice Returns contract owner. Set to deployer's address by default on
|
|
2136
|
+
* contract deployment.
|
|
2137
|
+
* @return address Address of contract owner.
|
|
2138
|
+
* @dev ref: https://docs.openzeppelin.com/contracts/4.x/api/access#Ownable
|
|
2139
|
+
* @dev owner role was called `admin` prior to V3 core contract
|
|
2140
|
+
*/
|
|
2141
|
+
function owner()
|
|
2142
|
+
public
|
|
2143
|
+
view
|
|
2144
|
+
override(Ownable, IGenArt721CoreContractV3_Base)
|
|
2145
|
+
returns (address)
|
|
2146
|
+
{
|
|
2147
|
+
return Ownable.owner();
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
/**
|
|
2151
|
+
* @notice Gets token URI for token ID `_tokenId`.
|
|
2152
|
+
* @param _tokenId Token ID to be queried.
|
|
2153
|
+
* @return string URI of token ID `_tokenId`.
|
|
2154
|
+
* @dev token URIs are the concatenation of the project base URI and the
|
|
2155
|
+
* token ID.
|
|
2156
|
+
*/
|
|
2157
|
+
function tokenURI(
|
|
2158
|
+
uint256 _tokenId
|
|
2159
|
+
) public view override returns (string memory) {
|
|
2160
|
+
_onlyValidTokenId(_tokenId);
|
|
2161
|
+
string memory _projectBaseURI = projects[tokenIdToProjectId(_tokenId)]
|
|
2162
|
+
.projectBaseURI;
|
|
2163
|
+
return string.concat(_projectBaseURI, toString(_tokenId));
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
/**
|
|
2167
|
+
* @dev See {IERC165-supportsInterface}.
|
|
2168
|
+
*/
|
|
2169
|
+
function supportsInterface(
|
|
2170
|
+
bytes4 interfaceId
|
|
2171
|
+
) public view virtual override returns (bool) {
|
|
2172
|
+
return
|
|
2173
|
+
interfaceId == type(IManifold).interfaceId ||
|
|
2174
|
+
super.supportsInterface(interfaceId);
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* @notice Forbids new projects from being created
|
|
2179
|
+
* @dev only performs operation and emits event if contract is not already
|
|
2180
|
+
* forbidding new projects.
|
|
2181
|
+
*/
|
|
2182
|
+
function _forbidNewProjects() internal {
|
|
2183
|
+
if (!newProjectsForbidden) {
|
|
2184
|
+
newProjectsForbidden = true;
|
|
2185
|
+
emit PlatformUpdated(FIELD_NEW_PROJECTS_FORBIDDEN);
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
/**
|
|
2190
|
+
* @notice Transfers ownership of the contract to a new account (`newOwner`).
|
|
2191
|
+
* Internal function without access restriction.
|
|
2192
|
+
* @param newOwner New owner.
|
|
2193
|
+
* @dev owner role was called `admin` prior to V3 core contract.
|
|
2194
|
+
* @dev Overrides and wraps OpenZeppelin's _transferOwnership function to
|
|
2195
|
+
* also update adminACLContract for improved introspection.
|
|
2196
|
+
*/
|
|
2197
|
+
function _transferOwnership(address newOwner) internal override {
|
|
2198
|
+
Ownable._transferOwnership(newOwner);
|
|
2199
|
+
adminACLContract = IAdminACLV0(newOwner);
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
/**
|
|
2203
|
+
* @notice Updates sales addresses for the platform and render providers to
|
|
2204
|
+
* the input parameters.
|
|
2205
|
+
* @param _renderProviderPrimarySalesAddress Address of new primary sales
|
|
2206
|
+
* payment address.
|
|
2207
|
+
* @param _renderProviderSecondarySalesAddress Address of new secondary sales
|
|
2208
|
+
* payment address.
|
|
2209
|
+
* @param _platformProviderPrimarySalesAddress Address of new primary sales
|
|
2210
|
+
* payment address.
|
|
2211
|
+
* @param _platformProviderSecondarySalesAddress Address of new secondary sales
|
|
2212
|
+
* payment address.
|
|
2213
|
+
* @dev Note that this method does not check that the input address is
|
|
2214
|
+
* not `address(0)`, as it is expected that callers of this method should
|
|
2215
|
+
* perform input validation where applicable.
|
|
2216
|
+
*/
|
|
2217
|
+
function _updateProviderSalesAddresses(
|
|
2218
|
+
address _renderProviderPrimarySalesAddress,
|
|
2219
|
+
address _renderProviderSecondarySalesAddress,
|
|
2220
|
+
address _platformProviderPrimarySalesAddress,
|
|
2221
|
+
address _platformProviderSecondarySalesAddress
|
|
2222
|
+
) internal {
|
|
2223
|
+
platformProviderPrimarySalesAddress = payable(
|
|
2224
|
+
_platformProviderPrimarySalesAddress
|
|
2225
|
+
);
|
|
2226
|
+
platformProviderSecondarySalesAddress = payable(
|
|
2227
|
+
_platformProviderSecondarySalesAddress
|
|
2228
|
+
);
|
|
2229
|
+
renderProviderPrimarySalesAddress = payable(
|
|
2230
|
+
_renderProviderPrimarySalesAddress
|
|
2231
|
+
);
|
|
2232
|
+
renderProviderSecondarySalesAddress = payable(
|
|
2233
|
+
_renderProviderSecondarySalesAddress
|
|
2234
|
+
);
|
|
2235
|
+
emit PlatformUpdated(FIELD_PROVIDER_SALES_ADDRESSES);
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
/**
|
|
2239
|
+
* @notice Updates randomizer address to `_randomizerAddress`.
|
|
2240
|
+
* @param _randomizerAddress New randomizer address.
|
|
2241
|
+
* @dev Note that this method does not check that the input address is
|
|
2242
|
+
* not `address(0)`, as it is expected that callers of this method should
|
|
2243
|
+
* perform input validation where applicable.
|
|
2244
|
+
*/
|
|
2245
|
+
function _updateRandomizerAddress(address _randomizerAddress) internal {
|
|
2246
|
+
randomizerContract = IRandomizerV2(_randomizerAddress);
|
|
2247
|
+
// populate historical randomizer array
|
|
2248
|
+
_historicalRandomizerAddresses.push(_randomizerAddress);
|
|
2249
|
+
emit PlatformUpdated(FIELD_RANDOMIZER_ADDRESS);
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
/**
|
|
2253
|
+
* @notice Updates default base URI to `_defaultBaseURI`.
|
|
2254
|
+
* When new projects are added, their `projectBaseURI` is automatically
|
|
2255
|
+
* initialized to `_defaultBaseURI`.
|
|
2256
|
+
* @param _defaultBaseURI New default base URI.
|
|
2257
|
+
* @dev Note that this method does not check that the input string is not
|
|
2258
|
+
* the empty string, as it is expected that callers of this method should
|
|
2259
|
+
* perform input validation where applicable.
|
|
2260
|
+
*/
|
|
2261
|
+
function _updateDefaultBaseURI(string memory _defaultBaseURI) internal {
|
|
2262
|
+
defaultBaseURI = _defaultBaseURI;
|
|
2263
|
+
emit PlatformUpdated(FIELD_DEFAULT_BASE_URI);
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
/**
|
|
2267
|
+
* @notice Internal function to complete a project.
|
|
2268
|
+
* @param _projectId Project ID to be completed.
|
|
2269
|
+
*/
|
|
2270
|
+
function _completeProject(uint256 _projectId) internal {
|
|
2271
|
+
projects[_projectId].completedTimestamp = uint64(block.timestamp);
|
|
2272
|
+
emit ProjectUpdated(_projectId, FIELD_PROJECT_COMPLETED);
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
/**
|
|
2276
|
+
* @notice Internal function that returns whether a project is unlocked.
|
|
2277
|
+
* Projects automatically lock four weeks after they are completed.
|
|
2278
|
+
* Projects are considered completed when they have been invoked the
|
|
2279
|
+
* maximum number of times.
|
|
2280
|
+
* @param _projectId Project ID to be queried.
|
|
2281
|
+
* @return bool true if project is unlocked, false otherwise.
|
|
2282
|
+
* @dev This also enforces that the `_projectId` passed in is valid.
|
|
2283
|
+
*/
|
|
2284
|
+
function _projectUnlocked(uint256 _projectId) internal view returns (bool) {
|
|
2285
|
+
_onlyValidProjectId(_projectId);
|
|
2286
|
+
uint256 projectCompletedTimestamp = projects[_projectId]
|
|
2287
|
+
.completedTimestamp;
|
|
2288
|
+
bool projectOpen = projectCompletedTimestamp == 0;
|
|
2289
|
+
return
|
|
2290
|
+
projectOpen ||
|
|
2291
|
+
(block.timestamp - projectCompletedTimestamp <
|
|
2292
|
+
FOUR_WEEKS_IN_SECONDS);
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
/**
|
|
2296
|
+
* Helper for calling `BytecodeStorageReader` external library reader method,
|
|
2297
|
+
* added for bytecode size reduction purposes.
|
|
2298
|
+
*/
|
|
2299
|
+
function _readFromBytecode(
|
|
2300
|
+
address _address
|
|
2301
|
+
) internal view returns (string memory) {
|
|
2302
|
+
return BytecodeStorageReader.readFromBytecode(_address);
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
// strings library from OpenZeppelin, modified for no constants
|
|
2306
|
+
|
|
2307
|
+
bytes16 private _HEX_SYMBOLS = "0123456789abcdef";
|
|
2308
|
+
uint8 private _ADDRESS_LENGTH = 20;
|
|
2309
|
+
|
|
2310
|
+
/**
|
|
2311
|
+
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
|
|
2312
|
+
*/
|
|
2313
|
+
function toString(uint256 value) internal pure returns (string memory) {
|
|
2314
|
+
// Inspired by OraclizeAPI's implementation - MIT licence
|
|
2315
|
+
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
|
|
2316
|
+
|
|
2317
|
+
if (value == 0) {
|
|
2318
|
+
return "0";
|
|
2319
|
+
}
|
|
2320
|
+
uint256 temp = value;
|
|
2321
|
+
uint256 digits;
|
|
2322
|
+
while (temp != 0) {
|
|
2323
|
+
digits++;
|
|
2324
|
+
temp /= 10;
|
|
2325
|
+
}
|
|
2326
|
+
bytes memory buffer = new bytes(digits);
|
|
2327
|
+
while (value != 0) {
|
|
2328
|
+
digits -= 1;
|
|
2329
|
+
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
|
|
2330
|
+
value /= 10;
|
|
2331
|
+
}
|
|
2332
|
+
return string(buffer);
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
/**
|
|
2336
|
+
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
|
|
2337
|
+
*/
|
|
2338
|
+
function toHexString(
|
|
2339
|
+
uint256 value,
|
|
2340
|
+
uint256 length
|
|
2341
|
+
) internal view returns (string memory) {
|
|
2342
|
+
bytes memory buffer = new bytes(2 * length + 2);
|
|
2343
|
+
buffer[0] = "0";
|
|
2344
|
+
buffer[1] = "x";
|
|
2345
|
+
for (uint256 i = 2 * length + 1; i > 1; --i) {
|
|
2346
|
+
buffer[i] = _HEX_SYMBOLS[value & 0xf];
|
|
2347
|
+
value >>= 4;
|
|
2348
|
+
}
|
|
2349
|
+
require(value == 0, "hex length insufficient");
|
|
2350
|
+
return string(buffer);
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
/**
|
|
2354
|
+
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
|
|
2355
|
+
*/
|
|
2356
|
+
function toHexString(address addr) internal view returns (string memory) {
|
|
2357
|
+
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
|
|
2358
|
+
}
|
|
2359
|
+
}
|