@artblocks/contracts 1.0.1 → 1.0.2
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/.env.example +8 -1
- package/README.md +42 -157
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +2 -2
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +2 -2
- package/artifacts/contracts/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +2 -2
- package/artifacts/contracts/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +2229 -0
- 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/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/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/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/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/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +2 -2
- package/artifacts/contracts/interfaces/0.8.x/IFilteredMinterSEAV0.sol/IFilteredMinterSEAV0.json +1032 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +149 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +149 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +130 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +1066 -0
- package/artifacts/contracts/interfaces/0.8.x/IWETH.sol/IWETH.json +55 -0
- package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +295 -0
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV4.sol/MinterDALinV4.json +2 -2
- 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 +130 -0
- package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV0.sol/MinterSEAV0.json +1310 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
- package/artifacts/contracts/mock/DeadReceiverBidderMock.sol/DeadReceiverBidderMock.json +33 -0
- package/artifacts/contracts/mock/GasLimitReceiverBidderMock.sol/GasLimitReceiverBidderMock.json +46 -0
- package/artifacts/contracts/mock/GasLimitReceiverMock.sol/GasLimitReceiverMock.json +28 -0
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
- package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +51 -0
- package/artifacts/contracts/{BasicRandomizer.sol → randomizer/BasicRandomizer.sol}/BasicRandomizer.json +3 -3
- package/artifacts/contracts/randomizer/BasicRandomizerBase_v0_0_0.sol/RandomizerBase.json +10 -0
- package/artifacts/contracts/randomizer/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +229 -0
- package/artifacts/contracts/randomizer/RandomizerV2.sol/BasicRandomizerV2.json +102 -0
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +2 -2
- package/contracts/DependencyRegistryV0.sol +74 -113
- package/contracts/GenArt721CoreV3.sol +124 -171
- package/contracts/GenArt721CoreV3_Engine.sol +136 -198
- package/contracts/GenArt721CoreV3_Engine_Flex.sol +2274 -0
- package/contracts/explorations/GenArt721CoreV3_Explorations.sol +147 -176
- package/contracts/interfaces/0.8.x/IFilteredMinterSEAV0.sol +145 -0
- package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol +39 -0
- package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine.sol +0 -3
- package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol +132 -0
- package/contracts/interfaces/0.8.x/IWETH.sol +11 -0
- package/contracts/libs/integration-refs/weth9/weth9.sol +763 -0
- package/contracts/minter-suite/MinterFilter/MinterFilterV1.sol +35 -47
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +26 -34
- package/contracts/minter-suite/Minters/MinterDAExpV4.sol +16 -21
- package/contracts/minter-suite/Minters/MinterDALinV4.sol +15 -17
- package/contracts/minter-suite/Minters/MinterHolderV4.sol +19 -19
- package/contracts/minter-suite/Minters/MinterMerkleV5.sol +13 -15
- package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +23 -23
- package/contracts/minter-suite/Minters/MinterSEAV0.sol +1224 -0
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +11 -11
- package/contracts/minter-suite/Minters/MinterSetPriceV4.sol +9 -10
- package/contracts/mock/DeadReceiverBidderMock.sol +23 -0
- package/contracts/mock/GasLimitReceiverBidderMock.sol +23 -0
- package/contracts/mock/GasLimitReceiverMock.sol +19 -0
- package/contracts/mock/RandomizerV2_NoAssignMock.sol +2 -11
- package/contracts/mock/ReentrancySEAMock.sol +36 -0
- package/contracts/{BasicRandomizer.sol → randomizer/BasicRandomizer.sol} +1 -1
- package/contracts/randomizer/BasicRandomizerBase_v0_0_0.sol +23 -0
- package/contracts/{BasicPolyptychRandomizerV0.sol → randomizer/PolyptychRandomizerV0.sol} +19 -28
- package/contracts/{BasicRandomizerV2.sol → randomizer/RandomizerV2.sol} +5 -13
- package/package.json +27 -14
- package/artifacts/contracts/BasicPolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +0 -229
- package/artifacts/contracts/BasicRandomizerV2.sol/BasicRandomizerV2.json +0 -102
|
@@ -258,7 +258,7 @@ contract GenArt721CoreV3_Engine is
|
|
|
258
258
|
bool public immutable autoApproveArtistSplitProposals;
|
|
259
259
|
|
|
260
260
|
/// version & type of this core contract
|
|
261
|
-
bytes32 constant CORE_VERSION = "v3.1.
|
|
261
|
+
bytes32 constant CORE_VERSION = "v3.1.2";
|
|
262
262
|
|
|
263
263
|
function coreVersion() external pure returns (string memory) {
|
|
264
264
|
return CORE_VERSION.toString();
|
|
@@ -273,59 +273,54 @@ contract GenArt721CoreV3_Engine is
|
|
|
273
273
|
/// default base URI to initialize all new project projectBaseURI values to
|
|
274
274
|
string public defaultBaseURI;
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
function _onlyNonZeroAddress(address _address) internal pure {
|
|
277
277
|
require(_address != address(0), "Must input non-zero address");
|
|
278
|
-
_;
|
|
279
278
|
}
|
|
280
279
|
|
|
281
|
-
|
|
280
|
+
function _onlyNonEmptyString(string memory _string) internal pure {
|
|
282
281
|
require(bytes(_string).length != 0, "Must input non-empty string");
|
|
283
|
-
_;
|
|
284
282
|
}
|
|
285
283
|
|
|
286
|
-
|
|
284
|
+
function _onlyValidTokenId(uint256 _tokenId) internal view {
|
|
287
285
|
require(_exists(_tokenId), "Token ID does not exist");
|
|
288
|
-
_;
|
|
289
286
|
}
|
|
290
287
|
|
|
291
|
-
|
|
288
|
+
function _onlyValidProjectId(uint256 _projectId) internal view {
|
|
292
289
|
require(
|
|
293
290
|
(_projectId >= startingProjectId) && (_projectId < _nextProjectId),
|
|
294
291
|
"Project ID does not exist"
|
|
295
292
|
);
|
|
296
|
-
_;
|
|
297
293
|
}
|
|
298
294
|
|
|
299
|
-
|
|
295
|
+
function _onlyUnlocked(uint256 _projectId) internal view {
|
|
300
296
|
// Note: calling `_projectUnlocked` enforces that the `_projectId`
|
|
301
297
|
// passed in is valid.`
|
|
302
298
|
require(_projectUnlocked(_projectId), "Only if unlocked");
|
|
303
|
-
_;
|
|
304
299
|
}
|
|
305
300
|
|
|
306
|
-
|
|
301
|
+
function _onlyAdminACL(bytes4 _selector) internal {
|
|
307
302
|
require(
|
|
308
303
|
adminACLAllowed(msg.sender, address(this), _selector),
|
|
309
304
|
"Only Admin ACL allowed"
|
|
310
305
|
);
|
|
311
|
-
_;
|
|
312
306
|
}
|
|
313
307
|
|
|
314
|
-
|
|
308
|
+
function _onlyArtist(uint256 _projectId) internal view {
|
|
315
309
|
require(
|
|
316
310
|
msg.sender == projectIdToFinancials[_projectId].artistAddress,
|
|
317
311
|
"Only artist"
|
|
318
312
|
);
|
|
319
|
-
_;
|
|
320
313
|
}
|
|
321
314
|
|
|
322
|
-
|
|
315
|
+
function _onlyArtistOrAdminACL(
|
|
316
|
+
uint256 _projectId,
|
|
317
|
+
bytes4 _selector
|
|
318
|
+
) internal {
|
|
323
319
|
require(
|
|
324
320
|
msg.sender == projectIdToFinancials[_projectId].artistAddress ||
|
|
325
321
|
adminACLAllowed(msg.sender, address(this), _selector),
|
|
326
322
|
"Only artist or Admin ACL allowed"
|
|
327
323
|
);
|
|
328
|
-
_;
|
|
329
324
|
}
|
|
330
325
|
|
|
331
326
|
/**
|
|
@@ -334,10 +329,10 @@ contract GenArt721CoreV3_Engine is
|
|
|
334
329
|
* contract to continue to function if the owner decides to renounce
|
|
335
330
|
* ownership.
|
|
336
331
|
*/
|
|
337
|
-
|
|
332
|
+
function _onlyAdminACLOrRenouncedArtist(
|
|
338
333
|
uint256 _projectId,
|
|
339
334
|
bytes4 _selector
|
|
340
|
-
) {
|
|
335
|
+
) internal {
|
|
341
336
|
require(
|
|
342
337
|
adminACLAllowed(msg.sender, address(this), _selector) ||
|
|
343
338
|
(owner() == address(0) &&
|
|
@@ -345,7 +340,6 @@ contract GenArt721CoreV3_Engine is
|
|
|
345
340
|
projectIdToFinancials[_projectId].artistAddress),
|
|
346
341
|
"Only Admin ACL allowed, or artist if owner has renounced"
|
|
347
342
|
);
|
|
348
|
-
_;
|
|
349
343
|
}
|
|
350
344
|
|
|
351
345
|
/**
|
|
@@ -373,13 +367,11 @@ contract GenArt721CoreV3_Engine is
|
|
|
373
367
|
uint248 _startingProjectId,
|
|
374
368
|
bool _autoApproveArtistSplitProposals,
|
|
375
369
|
address _engineRegistryContract
|
|
376
|
-
)
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
onlyNonZeroAddress(_adminACLContract)
|
|
382
|
-
{
|
|
370
|
+
) ERC721_PackedHashSeed(_tokenName, _tokenSymbol) {
|
|
371
|
+
_onlyNonZeroAddress(_renderProviderAddress);
|
|
372
|
+
_onlyNonZeroAddress(_platformProviderAddress);
|
|
373
|
+
_onlyNonZeroAddress(_randomizerContract);
|
|
374
|
+
_onlyNonZeroAddress(_adminACLContract);
|
|
383
375
|
// setup immutable `autoApproveArtistSplitProposals` config
|
|
384
376
|
autoApproveArtistSplitProposals = _autoApproveArtistSplitProposals;
|
|
385
377
|
// record contracts starting project ID
|
|
@@ -501,10 +493,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
501
493
|
* for indexing purposes, it must be emitted by the randomizer. This is to
|
|
502
494
|
* minimize gas when minting.
|
|
503
495
|
*/
|
|
504
|
-
function setTokenHash_8PT(
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
) external onlyValidTokenId(_tokenId) {
|
|
496
|
+
function setTokenHash_8PT(uint256 _tokenId, bytes32 _hashSeed) external {
|
|
497
|
+
_onlyValidTokenId(_tokenId);
|
|
498
|
+
|
|
508
499
|
OwnerAndHashSeed storage ownerAndHashSeed = _ownersAndHashSeeds[
|
|
509
500
|
_tokenId
|
|
510
501
|
];
|
|
@@ -554,11 +545,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
554
545
|
*/
|
|
555
546
|
function updateArtblocksDependencyRegistryAddress(
|
|
556
547
|
address _artblocksDependencyRegistryAddress
|
|
557
|
-
)
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
onlyNonZeroAddress(_artblocksDependencyRegistryAddress)
|
|
561
|
-
{
|
|
548
|
+
) external {
|
|
549
|
+
_onlyAdminACL(this.updateArtblocksDependencyRegistryAddress.selector);
|
|
550
|
+
_onlyNonZeroAddress(_artblocksDependencyRegistryAddress);
|
|
562
551
|
artblocksDependencyRegistryAddress = _artblocksDependencyRegistryAddress;
|
|
563
552
|
emit PlatformUpdated(FIELD_ARTBLOCKS_DEPENDENCY_REGISTRY_ADDRESS);
|
|
564
553
|
}
|
|
@@ -580,14 +569,12 @@ contract GenArt721CoreV3_Engine is
|
|
|
580
569
|
address payable _renderProviderSecondarySalesAddress,
|
|
581
570
|
address payable _platformProviderPrimarySalesAddress,
|
|
582
571
|
address payable _platformProviderSecondarySalesAddress
|
|
583
|
-
)
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
onlyNonZeroAddress(_platformProviderSecondarySalesAddress)
|
|
590
|
-
{
|
|
572
|
+
) external {
|
|
573
|
+
_onlyAdminACL(this.updateProviderSalesAddresses.selector);
|
|
574
|
+
_onlyNonZeroAddress(_renderProviderPrimarySalesAddress);
|
|
575
|
+
_onlyNonZeroAddress(_renderProviderSecondarySalesAddress);
|
|
576
|
+
_onlyNonZeroAddress(_platformProviderPrimarySalesAddress);
|
|
577
|
+
_onlyNonZeroAddress(_platformProviderSecondarySalesAddress);
|
|
591
578
|
_updateProviderSalesAddresses(
|
|
592
579
|
_renderProviderPrimarySalesAddress,
|
|
593
580
|
_renderProviderSecondarySalesAddress,
|
|
@@ -606,10 +593,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
606
593
|
function updateProviderPrimarySalesPercentages(
|
|
607
594
|
uint256 renderProviderPrimarySalesPercentage_,
|
|
608
595
|
uint256 platformProviderPrimarySalesPercentage_
|
|
609
|
-
)
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
{
|
|
596
|
+
) external {
|
|
597
|
+
_onlyAdminACL(this.updateProviderPrimarySalesPercentages.selector);
|
|
598
|
+
|
|
613
599
|
// Validate that the sum of the proposed %s, does not exceed 100%.
|
|
614
600
|
require(
|
|
615
601
|
(renderProviderPrimarySalesPercentage_ +
|
|
@@ -643,13 +629,14 @@ contract GenArt721CoreV3_Engine is
|
|
|
643
629
|
function updateProviderSecondarySalesBPS(
|
|
644
630
|
uint256 _renderProviderSecondarySalesBPS,
|
|
645
631
|
uint256 _platformProviderSecondarySalesBPS
|
|
646
|
-
) external
|
|
632
|
+
) external {
|
|
633
|
+
_onlyAdminACL(this.updateProviderSecondarySalesBPS.selector);
|
|
647
634
|
// Validate that the sum of the proposed provider BPS, does not exceed 10_000 BPS.
|
|
648
635
|
require(
|
|
649
636
|
(_renderProviderSecondarySalesBPS +
|
|
650
637
|
_platformProviderSecondarySalesBPS) <=
|
|
651
638
|
MAX_PROVIDER_SECONDARY_SALES_BPS,
|
|
652
|
-
"
|
|
639
|
+
"Over max sum of BPS"
|
|
653
640
|
);
|
|
654
641
|
renderProviderSecondarySalesBPS = _renderProviderSecondarySalesBPS;
|
|
655
642
|
platformProviderSecondarySalesBPS = _platformProviderSecondarySalesBPS;
|
|
@@ -660,13 +647,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
660
647
|
* @notice Updates minter to `_address`.
|
|
661
648
|
* @param _address Address of new minter.
|
|
662
649
|
*/
|
|
663
|
-
function updateMinterContract(
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
external
|
|
667
|
-
onlyAdminACL(this.updateMinterContract.selector)
|
|
668
|
-
onlyNonZeroAddress(_address)
|
|
669
|
-
{
|
|
650
|
+
function updateMinterContract(address _address) external {
|
|
651
|
+
_onlyAdminACL(this.updateMinterContract.selector);
|
|
652
|
+
_onlyNonZeroAddress(_address);
|
|
670
653
|
minterContract = _address;
|
|
671
654
|
emit MinterUpdated(_address);
|
|
672
655
|
}
|
|
@@ -675,13 +658,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
675
658
|
* @notice Updates randomizer to `_randomizerAddress`.
|
|
676
659
|
* @param _randomizerAddress Address of new randomizer.
|
|
677
660
|
*/
|
|
678
|
-
function updateRandomizerAddress(
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
external
|
|
682
|
-
onlyAdminACL(this.updateRandomizerAddress.selector)
|
|
683
|
-
onlyNonZeroAddress(_randomizerAddress)
|
|
684
|
-
{
|
|
661
|
+
function updateRandomizerAddress(address _randomizerAddress) external {
|
|
662
|
+
_onlyAdminACL(this.updateRandomizerAddress.selector);
|
|
663
|
+
_onlyNonZeroAddress(_randomizerAddress);
|
|
685
664
|
_updateRandomizerAddress(_randomizerAddress);
|
|
686
665
|
}
|
|
687
666
|
|
|
@@ -689,13 +668,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
689
668
|
* @notice Toggles project `_projectId` as active/inactive.
|
|
690
669
|
* @param _projectId Project ID to be toggled.
|
|
691
670
|
*/
|
|
692
|
-
function toggleProjectIsActive(
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
external
|
|
696
|
-
onlyAdminACL(this.toggleProjectIsActive.selector)
|
|
697
|
-
onlyValidProjectId(_projectId)
|
|
698
|
-
{
|
|
671
|
+
function toggleProjectIsActive(uint256 _projectId) external {
|
|
672
|
+
_onlyAdminACL(this.toggleProjectIsActive.selector);
|
|
673
|
+
_onlyValidProjectId(_projectId);
|
|
699
674
|
projects[_projectId].active = !projects[_projectId].active;
|
|
700
675
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_ACTIVE);
|
|
701
676
|
}
|
|
@@ -738,12 +713,10 @@ contract GenArt721CoreV3_Engine is
|
|
|
738
713
|
uint256 _additionalPayeePrimarySalesPercentage,
|
|
739
714
|
address payable _additionalPayeeSecondarySales,
|
|
740
715
|
uint256 _additionalPayeeSecondarySalesPercentage
|
|
741
|
-
)
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
onlyNonZeroAddress(_artistAddress)
|
|
746
|
-
{
|
|
716
|
+
) external {
|
|
717
|
+
_onlyValidProjectId(_projectId);
|
|
718
|
+
_onlyArtist(_projectId);
|
|
719
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
747
720
|
ProjectFinance storage projectFinance = projectIdToFinancials[
|
|
748
721
|
_projectId
|
|
749
722
|
];
|
|
@@ -861,15 +834,13 @@ contract GenArt721CoreV3_Engine is
|
|
|
861
834
|
uint256 _additionalPayeePrimarySalesPercentage,
|
|
862
835
|
address payable _additionalPayeeSecondarySales,
|
|
863
836
|
uint256 _additionalPayeeSecondarySalesPercentage
|
|
864
|
-
)
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
onlyAdminACLOrRenouncedArtist(
|
|
837
|
+
) external {
|
|
838
|
+
_onlyValidProjectId(_projectId);
|
|
839
|
+
_onlyAdminACLOrRenouncedArtist(
|
|
868
840
|
_projectId,
|
|
869
841
|
this.adminAcceptArtistAddressesAndSplits.selector
|
|
870
|
-
)
|
|
871
|
-
|
|
872
|
-
{
|
|
842
|
+
);
|
|
843
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
873
844
|
// checks
|
|
874
845
|
require(
|
|
875
846
|
proposedArtistAddressesAndSplitsHash[_projectId] ==
|
|
@@ -915,15 +886,13 @@ contract GenArt721CoreV3_Engine is
|
|
|
915
886
|
function updateProjectArtistAddress(
|
|
916
887
|
uint256 _projectId,
|
|
917
888
|
address payable _artistAddress
|
|
918
|
-
)
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
onlyAdminACLOrRenouncedArtist(
|
|
889
|
+
) external {
|
|
890
|
+
_onlyValidProjectId(_projectId);
|
|
891
|
+
_onlyAdminACLOrRenouncedArtist(
|
|
922
892
|
_projectId,
|
|
923
893
|
this.updateProjectArtistAddress.selector
|
|
924
|
-
)
|
|
925
|
-
|
|
926
|
-
{
|
|
894
|
+
);
|
|
895
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
927
896
|
projectIdToFinancials[_projectId].artistAddress = _artistAddress;
|
|
928
897
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_ARTIST_ADDRESS);
|
|
929
898
|
}
|
|
@@ -932,9 +901,8 @@ contract GenArt721CoreV3_Engine is
|
|
|
932
901
|
* @notice Toggles paused state of project `_projectId`.
|
|
933
902
|
* @param _projectId Project ID to be toggled.
|
|
934
903
|
*/
|
|
935
|
-
function toggleProjectIsPaused(
|
|
936
|
-
|
|
937
|
-
) external onlyArtist(_projectId) {
|
|
904
|
+
function toggleProjectIsPaused(uint256 _projectId) external {
|
|
905
|
+
_onlyArtist(_projectId);
|
|
938
906
|
projects[_projectId].paused = !projects[_projectId].paused;
|
|
939
907
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_PAUSED);
|
|
940
908
|
}
|
|
@@ -948,12 +916,10 @@ contract GenArt721CoreV3_Engine is
|
|
|
948
916
|
function addProject(
|
|
949
917
|
string memory _projectName,
|
|
950
918
|
address payable _artistAddress
|
|
951
|
-
)
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
onlyNonZeroAddress(_artistAddress)
|
|
956
|
-
{
|
|
919
|
+
) external {
|
|
920
|
+
_onlyAdminACL(this.addProject.selector);
|
|
921
|
+
_onlyNonEmptyString(_projectName);
|
|
922
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
957
923
|
require(!newProjectsForbidden, "New projects forbidden");
|
|
958
924
|
uint256 projectId = _nextProjectId;
|
|
959
925
|
projectIdToFinancials[projectId].artistAddress = _artistAddress;
|
|
@@ -969,10 +935,8 @@ contract GenArt721CoreV3_Engine is
|
|
|
969
935
|
/**
|
|
970
936
|
* @notice Forever forbids new projects from being added to this contract.
|
|
971
937
|
*/
|
|
972
|
-
function forbidNewProjects()
|
|
973
|
-
|
|
974
|
-
onlyAdminACL(this.forbidNewProjects.selector)
|
|
975
|
-
{
|
|
938
|
+
function forbidNewProjects() external {
|
|
939
|
+
_onlyAdminACL(this.forbidNewProjects.selector);
|
|
976
940
|
require(!newProjectsForbidden, "Already forbidden");
|
|
977
941
|
_forbidNewProjects();
|
|
978
942
|
}
|
|
@@ -985,12 +949,10 @@ contract GenArt721CoreV3_Engine is
|
|
|
985
949
|
function updateProjectName(
|
|
986
950
|
uint256 _projectId,
|
|
987
951
|
string memory _projectName
|
|
988
|
-
)
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
onlyNonEmptyString(_projectName)
|
|
993
|
-
{
|
|
952
|
+
) external {
|
|
953
|
+
_onlyUnlocked(_projectId);
|
|
954
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectName.selector);
|
|
955
|
+
_onlyNonEmptyString(_projectName);
|
|
994
956
|
projects[_projectId].name = _projectName;
|
|
995
957
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_NAME);
|
|
996
958
|
}
|
|
@@ -1004,12 +966,13 @@ contract GenArt721CoreV3_Engine is
|
|
|
1004
966
|
function updateProjectArtistName(
|
|
1005
967
|
uint256 _projectId,
|
|
1006
968
|
string memory _projectArtistName
|
|
1007
|
-
)
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
969
|
+
) external {
|
|
970
|
+
_onlyUnlocked(_projectId);
|
|
971
|
+
_onlyArtistOrAdminACL(
|
|
972
|
+
_projectId,
|
|
973
|
+
this.updateProjectArtistName.selector
|
|
974
|
+
);
|
|
975
|
+
_onlyNonEmptyString(_projectArtistName);
|
|
1013
976
|
projects[_projectId].artist = _projectArtistName;
|
|
1014
977
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_ARTIST_NAME);
|
|
1015
978
|
}
|
|
@@ -1028,10 +991,11 @@ contract GenArt721CoreV3_Engine is
|
|
|
1028
991
|
function updateProjectSecondaryMarketRoyaltyPercentage(
|
|
1029
992
|
uint256 _projectId,
|
|
1030
993
|
uint256 _secondMarketRoyalty
|
|
1031
|
-
) external
|
|
994
|
+
) external {
|
|
995
|
+
_onlyArtist(_projectId);
|
|
1032
996
|
require(
|
|
1033
997
|
_secondMarketRoyalty <= ARTIST_MAX_SECONDARY_ROYALTY_PERCENTAGE,
|
|
1034
|
-
"
|
|
998
|
+
"Over max percent"
|
|
1035
999
|
);
|
|
1036
1000
|
projectIdToFinancials[_projectId]
|
|
1037
1001
|
.secondaryMarketRoyaltyPercentage = uint8(_secondMarketRoyalty);
|
|
@@ -1076,7 +1040,8 @@ contract GenArt721CoreV3_Engine is
|
|
|
1076
1040
|
function updateProjectWebsite(
|
|
1077
1041
|
uint256 _projectId,
|
|
1078
1042
|
string memory _projectWebsite
|
|
1079
|
-
) external
|
|
1043
|
+
) external {
|
|
1044
|
+
_onlyArtist(_projectId);
|
|
1080
1045
|
projects[_projectId].website = _projectWebsite;
|
|
1081
1046
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_WEBSITE);
|
|
1082
1047
|
}
|
|
@@ -1089,12 +1054,10 @@ contract GenArt721CoreV3_Engine is
|
|
|
1089
1054
|
function updateProjectLicense(
|
|
1090
1055
|
uint256 _projectId,
|
|
1091
1056
|
string memory _projectLicense
|
|
1092
|
-
)
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
onlyNonEmptyString(_projectLicense)
|
|
1097
|
-
{
|
|
1057
|
+
) external {
|
|
1058
|
+
_onlyUnlocked(_projectId);
|
|
1059
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectLicense.selector);
|
|
1060
|
+
_onlyNonEmptyString(_projectLicense);
|
|
1098
1061
|
projects[_projectId].license = _projectLicense;
|
|
1099
1062
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_LICENSE);
|
|
1100
1063
|
}
|
|
@@ -1111,18 +1074,16 @@ contract GenArt721CoreV3_Engine is
|
|
|
1111
1074
|
function updateProjectMaxInvocations(
|
|
1112
1075
|
uint256 _projectId,
|
|
1113
1076
|
uint24 _maxInvocations
|
|
1114
|
-
) external
|
|
1077
|
+
) external {
|
|
1078
|
+
_onlyArtist(_projectId);
|
|
1115
1079
|
// CHECKS
|
|
1116
1080
|
Project storage project = projects[_projectId];
|
|
1117
1081
|
uint256 _invocations = project.invocations;
|
|
1118
1082
|
require(
|
|
1119
1083
|
(_maxInvocations < project.maxInvocations),
|
|
1120
|
-
"maxInvocations
|
|
1121
|
-
);
|
|
1122
|
-
require(
|
|
1123
|
-
_maxInvocations >= _invocations,
|
|
1124
|
-
"Only max invocations gte current invocations"
|
|
1084
|
+
"Only maxInvocations decrease"
|
|
1125
1085
|
);
|
|
1086
|
+
require(_maxInvocations >= _invocations, "Only gte invocations");
|
|
1126
1087
|
// EFFECTS
|
|
1127
1088
|
project.maxInvocations = _maxInvocations;
|
|
1128
1089
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_MAX_INVOCATIONS);
|
|
@@ -1137,17 +1098,15 @@ contract GenArt721CoreV3_Engine is
|
|
|
1137
1098
|
* @notice Adds a script to project `_projectId`.
|
|
1138
1099
|
* @param _projectId Project to be updated.
|
|
1139
1100
|
* @param _script Script to be added. Required to be a non-empty string,
|
|
1140
|
-
*
|
|
1101
|
+
* but no further validation is performed.
|
|
1141
1102
|
*/
|
|
1142
1103
|
function addProjectScript(
|
|
1143
1104
|
uint256 _projectId,
|
|
1144
1105
|
string memory _script
|
|
1145
|
-
)
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
onlyNonEmptyString(_script)
|
|
1150
|
-
{
|
|
1106
|
+
) external {
|
|
1107
|
+
_onlyUnlocked(_projectId);
|
|
1108
|
+
_onlyArtistOrAdminACL(_projectId, this.addProjectScript.selector);
|
|
1109
|
+
_onlyNonEmptyString(_script);
|
|
1151
1110
|
Project storage project = projects[_projectId];
|
|
1152
1111
|
// store script in contract bytecode
|
|
1153
1112
|
project.scriptBytecodeAddresses[project.scriptCount] = _script
|
|
@@ -1167,24 +1126,13 @@ contract GenArt721CoreV3_Engine is
|
|
|
1167
1126
|
uint256 _projectId,
|
|
1168
1127
|
uint256 _scriptId,
|
|
1169
1128
|
string memory _script
|
|
1170
|
-
)
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
onlyNonEmptyString(_script)
|
|
1175
|
-
{
|
|
1129
|
+
) external {
|
|
1130
|
+
_onlyUnlocked(_projectId);
|
|
1131
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectScript.selector);
|
|
1132
|
+
_onlyNonEmptyString(_script);
|
|
1176
1133
|
Project storage project = projects[_projectId];
|
|
1177
1134
|
require(_scriptId < project.scriptCount, "scriptId out of range");
|
|
1178
|
-
|
|
1179
|
-
// note: Although this does reduce usage of Ethereum state, it does not
|
|
1180
|
-
// reduce the gas costs of removal transactions. We believe this is the
|
|
1181
|
-
// best behavior at the time of writing, and do not expect this to
|
|
1182
|
-
// result in any breaking changes in the future. All current proposals
|
|
1183
|
-
// to change the self-destruct opcode are backwards compatible, but may
|
|
1184
|
-
// result in not removing the bytecode from the blockchain state. This
|
|
1185
|
-
// implementation is compatible with that architecture, as it does not
|
|
1186
|
-
// rely on the bytecode being removed from the blockchain state.
|
|
1187
|
-
project.scriptBytecodeAddresses[_scriptId].purgeBytecode();
|
|
1135
|
+
|
|
1188
1136
|
// store script in contract bytecode, replacing reference address from
|
|
1189
1137
|
// the contract that no longer exists with the newly created one
|
|
1190
1138
|
project.scriptBytecodeAddresses[_scriptId] = _script.writeToBytecode();
|
|
@@ -1195,27 +1143,15 @@ contract GenArt721CoreV3_Engine is
|
|
|
1195
1143
|
* @notice Removes last script from project `_projectId`.
|
|
1196
1144
|
* @param _projectId Project to be updated.
|
|
1197
1145
|
*/
|
|
1198
|
-
function removeProjectLastScript(
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
{
|
|
1146
|
+
function removeProjectLastScript(uint256 _projectId) external {
|
|
1147
|
+
_onlyUnlocked(_projectId);
|
|
1148
|
+
_onlyArtistOrAdminACL(
|
|
1149
|
+
_projectId,
|
|
1150
|
+
this.removeProjectLastScript.selector
|
|
1151
|
+
);
|
|
1205
1152
|
Project storage project = projects[_projectId];
|
|
1206
|
-
require(project.scriptCount > 0, "
|
|
1207
|
-
|
|
1208
|
-
// note: Although this does reduce usage of Ethereum state, it does not
|
|
1209
|
-
// reduce the gas costs of removal transactions. We believe this is the
|
|
1210
|
-
// best behavior at the time of writing, and do not expect this to
|
|
1211
|
-
// result in any breaking changes in the future. All current proposals
|
|
1212
|
-
// to change the self-destruct opcode are backwards compatible, but may
|
|
1213
|
-
// result in not removing the bytecode from the blockchain state. This
|
|
1214
|
-
// implementation is compatible with that architecture, as it does not
|
|
1215
|
-
// rely on the bytecode being removed from the blockchain state.
|
|
1216
|
-
project
|
|
1217
|
-
.scriptBytecodeAddresses[project.scriptCount - 1]
|
|
1218
|
-
.purgeBytecode();
|
|
1153
|
+
require(project.scriptCount > 0, "No scripts to remove");
|
|
1154
|
+
|
|
1219
1155
|
// delete reference to contract address that no longer exists
|
|
1220
1156
|
delete project.scriptBytecodeAddresses[project.scriptCount - 1];
|
|
1221
1157
|
unchecked {
|
|
@@ -1233,11 +1169,12 @@ contract GenArt721CoreV3_Engine is
|
|
|
1233
1169
|
function updateProjectScriptType(
|
|
1234
1170
|
uint256 _projectId,
|
|
1235
1171
|
bytes32 _scriptTypeAndVersion
|
|
1236
|
-
)
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1172
|
+
) external {
|
|
1173
|
+
_onlyUnlocked(_projectId);
|
|
1174
|
+
_onlyArtistOrAdminACL(
|
|
1175
|
+
_projectId,
|
|
1176
|
+
this.updateProjectScriptType.selector
|
|
1177
|
+
);
|
|
1241
1178
|
Project storage project = projects[_projectId];
|
|
1242
1179
|
// require exactly one @ symbol in _scriptTypeAndVersion
|
|
1243
1180
|
require(
|
|
@@ -1261,12 +1198,13 @@ contract GenArt721CoreV3_Engine is
|
|
|
1261
1198
|
function updateProjectAspectRatio(
|
|
1262
1199
|
uint256 _projectId,
|
|
1263
1200
|
string memory _aspectRatio
|
|
1264
|
-
)
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1201
|
+
) external {
|
|
1202
|
+
_onlyUnlocked(_projectId);
|
|
1203
|
+
_onlyArtistOrAdminACL(
|
|
1204
|
+
_projectId,
|
|
1205
|
+
this.updateProjectAspectRatio.selector
|
|
1206
|
+
);
|
|
1207
|
+
_onlyNonEmptyString(_aspectRatio);
|
|
1270
1208
|
// Perform more detailed input validation for aspect ratio.
|
|
1271
1209
|
bytes memory aspectRatioBytes = bytes(_aspectRatio);
|
|
1272
1210
|
uint256 bytesLength = aspectRatioBytes.length;
|
|
@@ -1309,7 +1247,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
1309
1247
|
function updateProjectBaseURI(
|
|
1310
1248
|
uint256 _projectId,
|
|
1311
1249
|
string memory _newBaseURI
|
|
1312
|
-
) external
|
|
1250
|
+
) external {
|
|
1251
|
+
_onlyArtist(_projectId);
|
|
1252
|
+
_onlyNonEmptyString(_newBaseURI);
|
|
1313
1253
|
projects[_projectId].projectBaseURI = _newBaseURI;
|
|
1314
1254
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_BASE_URI);
|
|
1315
1255
|
}
|
|
@@ -1320,13 +1260,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
1320
1260
|
* projects. Token URIs are determined by their project's `projectBaseURI`.
|
|
1321
1261
|
* @param _defaultBaseURI New default base URI.
|
|
1322
1262
|
*/
|
|
1323
|
-
function updateDefaultBaseURI(
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
external
|
|
1327
|
-
onlyAdminACL(this.updateDefaultBaseURI.selector)
|
|
1328
|
-
onlyNonEmptyString(_defaultBaseURI)
|
|
1329
|
-
{
|
|
1263
|
+
function updateDefaultBaseURI(string memory _defaultBaseURI) external {
|
|
1264
|
+
_onlyAdminACL(this.updateDefaultBaseURI.selector);
|
|
1265
|
+
_onlyNonEmptyString(_defaultBaseURI);
|
|
1330
1266
|
_updateDefaultBaseURI(_defaultBaseURI);
|
|
1331
1267
|
}
|
|
1332
1268
|
|
|
@@ -1603,6 +1539,7 @@ contract GenArt721CoreV3_Engine is
|
|
|
1603
1539
|
)
|
|
1604
1540
|
external
|
|
1605
1541
|
view
|
|
1542
|
+
override(IGenArt721CoreContractV3_Base, IDependencyRegistryCompatibleV0)
|
|
1606
1543
|
returns (
|
|
1607
1544
|
string memory scriptTypeAndVersion,
|
|
1608
1545
|
string memory aspectRatio,
|
|
@@ -1709,9 +1646,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
1709
1646
|
)
|
|
1710
1647
|
external
|
|
1711
1648
|
view
|
|
1712
|
-
onlyValidTokenId(_tokenId)
|
|
1713
1649
|
returns (address payable[] memory recipients, uint256[] memory bps)
|
|
1714
1650
|
{
|
|
1651
|
+
_onlyValidTokenId(_tokenId);
|
|
1715
1652
|
// initialize arrays with maximum potential length
|
|
1716
1653
|
recipients = new address payable[](4);
|
|
1717
1654
|
bps = new uint256[](4);
|
|
@@ -1923,7 +1860,8 @@ contract GenArt721CoreV3_Engine is
|
|
|
1923
1860
|
*/
|
|
1924
1861
|
function tokenURI(
|
|
1925
1862
|
uint256 _tokenId
|
|
1926
|
-
) public view override
|
|
1863
|
+
) public view override returns (string memory) {
|
|
1864
|
+
_onlyValidTokenId(_tokenId);
|
|
1927
1865
|
string memory _projectBaseURI = projects[tokenIdToProjectId(_tokenId)]
|
|
1928
1866
|
.projectBaseURI;
|
|
1929
1867
|
return string.concat(_projectBaseURI, _tokenId.toString());
|
|
@@ -2047,9 +1985,9 @@ contract GenArt721CoreV3_Engine is
|
|
|
2047
1985
|
* @return bool true if project is unlocked, false otherwise.
|
|
2048
1986
|
* @dev This also enforces that the `_projectId` passed in is valid.
|
|
2049
1987
|
*/
|
|
2050
|
-
function _projectUnlocked(
|
|
2051
|
-
|
|
2052
|
-
|
|
1988
|
+
function _projectUnlocked(uint256 _projectId) internal view returns (bool) {
|
|
1989
|
+
_onlyValidProjectId(_projectId);
|
|
1990
|
+
|
|
2053
1991
|
uint256 projectCompletedTimestamp = projects[_projectId]
|
|
2054
1992
|
.completedTimestamp;
|
|
2055
1993
|
bool projectOpen = projectCompletedTimestamp == 0;
|