@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
|
@@ -237,7 +237,7 @@ contract GenArt721CoreV3_Explorations is
|
|
|
237
237
|
/// version & type of this core contract
|
|
238
238
|
/// coreVersion is updated from Flagship V3 core due to minor changes
|
|
239
239
|
/// implemented in the Explorations version of the contract.
|
|
240
|
-
string public constant coreVersion = "v3.0.
|
|
240
|
+
string public constant coreVersion = "v3.0.3";
|
|
241
241
|
/// coreType remains consistent with flagship V3 core because external &
|
|
242
242
|
/// public functions used for indexing are unchanged.
|
|
243
243
|
string public constant coreType = "GenArt721CoreV3";
|
|
@@ -245,71 +245,66 @@ contract GenArt721CoreV3_Explorations is
|
|
|
245
245
|
/// default base URI to initialize all new project projectBaseURI values to
|
|
246
246
|
string public defaultBaseURI;
|
|
247
247
|
|
|
248
|
-
|
|
248
|
+
function _onlyNonZeroAddress(address _address) internal pure {
|
|
249
249
|
require(_address != address(0), "Must input non-zero address");
|
|
250
|
-
_;
|
|
251
250
|
}
|
|
252
251
|
|
|
253
|
-
|
|
252
|
+
function _onlyNonEmptyString(string memory _string) internal pure {
|
|
254
253
|
require(bytes(_string).length != 0, "Must input non-empty string");
|
|
255
|
-
_;
|
|
256
254
|
}
|
|
257
255
|
|
|
258
|
-
|
|
256
|
+
function _onlyValidTokenId(uint256 _tokenId) internal view {
|
|
259
257
|
require(_exists(_tokenId), "Token ID does not exist");
|
|
260
|
-
_;
|
|
261
258
|
}
|
|
262
259
|
|
|
263
|
-
|
|
260
|
+
function _onlyValidProjectId(uint256 _projectId) internal view {
|
|
264
261
|
require(
|
|
265
262
|
(_projectId >= startingProjectId) && (_projectId < _nextProjectId),
|
|
266
263
|
"Project ID does not exist"
|
|
267
264
|
);
|
|
268
|
-
_;
|
|
269
265
|
}
|
|
270
266
|
|
|
271
|
-
|
|
267
|
+
function _onlyUnlocked(uint256 _projectId) internal view {
|
|
272
268
|
// Note: calling `_projectUnlocked` enforces that the `_projectId`
|
|
273
269
|
// passed in is valid.`
|
|
274
270
|
require(_projectUnlocked(_projectId), "Only if unlocked");
|
|
275
|
-
_;
|
|
276
271
|
}
|
|
277
272
|
|
|
278
|
-
|
|
273
|
+
function _onlyAdminACL(bytes4 _selector) internal {
|
|
279
274
|
require(
|
|
280
275
|
adminACLAllowed(msg.sender, address(this), _selector),
|
|
281
276
|
"Only Admin ACL allowed"
|
|
282
277
|
);
|
|
283
|
-
_;
|
|
284
278
|
}
|
|
285
279
|
|
|
286
|
-
|
|
280
|
+
function _onlyArtist(uint256 _projectId) internal view {
|
|
287
281
|
require(
|
|
288
282
|
msg.sender == projectIdToFinancials[_projectId].artistAddress,
|
|
289
283
|
"Only artist"
|
|
290
284
|
);
|
|
291
|
-
_;
|
|
292
285
|
}
|
|
293
286
|
|
|
294
|
-
|
|
287
|
+
function _onlyArtistOrAdminACL(
|
|
288
|
+
uint256 _projectId,
|
|
289
|
+
bytes4 _selector
|
|
290
|
+
) internal {
|
|
295
291
|
require(
|
|
296
292
|
msg.sender == projectIdToFinancials[_projectId].artistAddress ||
|
|
297
293
|
adminACLAllowed(msg.sender, address(this), _selector),
|
|
298
294
|
"Only artist or Admin ACL allowed"
|
|
299
295
|
);
|
|
300
|
-
_;
|
|
301
296
|
}
|
|
302
297
|
|
|
303
298
|
/**
|
|
304
|
-
* This
|
|
299
|
+
* This function allows the artist of a project to call a function if the
|
|
305
300
|
* owner of the contract has renounced ownership. This is to allow the
|
|
306
301
|
* contract to continue to function if the owner decides to renounce
|
|
307
302
|
* ownership.
|
|
308
303
|
*/
|
|
309
|
-
|
|
304
|
+
function _onlyAdminACLOrRenouncedArtist(
|
|
310
305
|
uint256 _projectId,
|
|
311
306
|
bytes4 _selector
|
|
312
|
-
) {
|
|
307
|
+
) internal {
|
|
313
308
|
require(
|
|
314
309
|
adminACLAllowed(msg.sender, address(this), _selector) ||
|
|
315
310
|
(owner() == address(0) &&
|
|
@@ -317,7 +312,6 @@ contract GenArt721CoreV3_Explorations is
|
|
|
317
312
|
projectIdToFinancials[_projectId].artistAddress),
|
|
318
313
|
"Only Admin ACL allowed, or artist if owner has renounced"
|
|
319
314
|
);
|
|
320
|
-
_;
|
|
321
315
|
}
|
|
322
316
|
|
|
323
317
|
/**
|
|
@@ -339,10 +333,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
339
333
|
address _randomizerContract,
|
|
340
334
|
address _adminACLContract,
|
|
341
335
|
uint248 _startingProjectId
|
|
342
|
-
)
|
|
343
|
-
|
|
344
|
-
onlyNonZeroAddress(_randomizerContract)
|
|
345
|
-
{
|
|
336
|
+
) ERC721_PackedHashSeed(_tokenName, _tokenSymbol) {
|
|
337
|
+
_onlyNonZeroAddress(_randomizerContract);
|
|
346
338
|
// record contracts starting project ID
|
|
347
339
|
// casting-up is safe
|
|
348
340
|
startingProjectId = uint256(_startingProjectId);
|
|
@@ -452,10 +444,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
452
444
|
* for indexing purposes, it must be emitted by the randomizer. This is to
|
|
453
445
|
* minimize gas when minting.
|
|
454
446
|
*/
|
|
455
|
-
function setTokenHash_8PT(
|
|
456
|
-
|
|
457
|
-
bytes32 _hashSeed
|
|
458
|
-
) external onlyValidTokenId(_tokenId) {
|
|
447
|
+
function setTokenHash_8PT(uint256 _tokenId, bytes32 _hashSeed) external {
|
|
448
|
+
_onlyValidTokenId(_tokenId);
|
|
459
449
|
OwnerAndHashSeed storage ownerAndHashSeed = _ownersAndHashSeeds[
|
|
460
450
|
_tokenId
|
|
461
451
|
];
|
|
@@ -481,8 +471,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
481
471
|
* that also integrate with the owner/AdminACL contract (e.g. potentially
|
|
482
472
|
* minter suite contracts, registry contracts, etc.).
|
|
483
473
|
* After renouncing ownership, artists will be in control of updates to
|
|
484
|
-
* their payment addresses and splits (see
|
|
485
|
-
*
|
|
474
|
+
* their payment addresses and splits (see function
|
|
475
|
+
* _onlyAdminACLOrRenouncedArtist`).
|
|
486
476
|
* While there is no currently intended reason to call this method based on
|
|
487
477
|
* defined Art Blocks business practices, this method exists to allow
|
|
488
478
|
* artists to continue to maintain the limited set of contract
|
|
@@ -507,11 +497,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
507
497
|
*/
|
|
508
498
|
function updateArtblocksCurationRegistryAddress(
|
|
509
499
|
address _artblocksCurationRegistryAddress
|
|
510
|
-
)
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
onlyNonZeroAddress(_artblocksCurationRegistryAddress)
|
|
514
|
-
{
|
|
500
|
+
) external {
|
|
501
|
+
_onlyAdminACL(this.updateArtblocksCurationRegistryAddress.selector);
|
|
502
|
+
_onlyNonZeroAddress(_artblocksCurationRegistryAddress);
|
|
515
503
|
revert("Action not supported");
|
|
516
504
|
}
|
|
517
505
|
|
|
@@ -522,11 +510,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
522
510
|
*/
|
|
523
511
|
function updateArtblocksDependencyRegistryAddress(
|
|
524
512
|
address _artblocksDependencyRegistryAddress
|
|
525
|
-
)
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
onlyNonZeroAddress(_artblocksDependencyRegistryAddress)
|
|
529
|
-
{
|
|
513
|
+
) external {
|
|
514
|
+
_onlyAdminACL(this.updateArtblocksDependencyRegistryAddress.selector);
|
|
515
|
+
_onlyNonZeroAddress(_artblocksDependencyRegistryAddress);
|
|
530
516
|
artblocksDependencyRegistryAddress = _artblocksDependencyRegistryAddress;
|
|
531
517
|
emit PlatformUpdated(FIELD_ARTBLOCKS_DEPENDENCY_REGISTRY_ADDRESS);
|
|
532
518
|
}
|
|
@@ -539,11 +525,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
539
525
|
*/
|
|
540
526
|
function updateArtblocksPrimarySalesAddress(
|
|
541
527
|
address payable _artblocksPrimarySalesAddress
|
|
542
|
-
)
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
onlyNonZeroAddress(_artblocksPrimarySalesAddress)
|
|
546
|
-
{
|
|
528
|
+
) external {
|
|
529
|
+
_onlyAdminACL(this.updateArtblocksPrimarySalesAddress.selector);
|
|
530
|
+
_onlyNonZeroAddress(_artblocksPrimarySalesAddress);
|
|
547
531
|
_updateArtblocksPrimarySalesAddress(_artblocksPrimarySalesAddress);
|
|
548
532
|
}
|
|
549
533
|
|
|
@@ -555,11 +539,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
555
539
|
*/
|
|
556
540
|
function updateArtblocksSecondarySalesAddress(
|
|
557
541
|
address payable _artblocksSecondarySalesAddress
|
|
558
|
-
)
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
onlyNonZeroAddress(_artblocksSecondarySalesAddress)
|
|
562
|
-
{
|
|
542
|
+
) external {
|
|
543
|
+
_onlyAdminACL(this.updateArtblocksSecondarySalesAddress.selector);
|
|
544
|
+
_onlyNonZeroAddress(_artblocksSecondarySalesAddress);
|
|
563
545
|
_updateArtblocksSecondarySalesAddress(_artblocksSecondarySalesAddress);
|
|
564
546
|
}
|
|
565
547
|
|
|
@@ -571,10 +553,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
571
553
|
*/
|
|
572
554
|
function updateArtblocksPrimarySalesPercentage(
|
|
573
555
|
uint256 artblocksPrimarySalesPercentage_
|
|
574
|
-
)
|
|
575
|
-
|
|
576
|
-
onlyAdminACL(this.updateArtblocksPrimarySalesPercentage.selector)
|
|
577
|
-
{
|
|
556
|
+
) external {
|
|
557
|
+
_onlyAdminACL(this.updateArtblocksPrimarySalesPercentage.selector);
|
|
578
558
|
require(
|
|
579
559
|
artblocksPrimarySalesPercentage_ <=
|
|
580
560
|
ART_BLOCKS_MAX_PRIMARY_SALES_PERCENTAGE,
|
|
@@ -599,7 +579,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
599
579
|
*/
|
|
600
580
|
function updateArtblocksSecondarySalesBPS(
|
|
601
581
|
uint256 _artblocksSecondarySalesBPS
|
|
602
|
-
) external
|
|
582
|
+
) external {
|
|
583
|
+
_onlyAdminACL(this.updateArtblocksSecondarySalesBPS.selector);
|
|
603
584
|
require(
|
|
604
585
|
_artblocksSecondarySalesBPS <= ART_BLOCKS_MAX_SECONDARY_SALES_BPS,
|
|
605
586
|
"Max of ART_BLOCKS_MAX_SECONDARY_SALES_BPS BPS"
|
|
@@ -612,13 +593,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
612
593
|
* @notice Updates minter to `_address`.
|
|
613
594
|
* @param _address Address of new minter.
|
|
614
595
|
*/
|
|
615
|
-
function updateMinterContract(
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
external
|
|
619
|
-
onlyAdminACL(this.updateMinterContract.selector)
|
|
620
|
-
onlyNonZeroAddress(_address)
|
|
621
|
-
{
|
|
596
|
+
function updateMinterContract(address _address) external {
|
|
597
|
+
_onlyAdminACL(this.updateMinterContract.selector);
|
|
598
|
+
_onlyNonZeroAddress(_address);
|
|
622
599
|
minterContract = _address;
|
|
623
600
|
emit MinterUpdated(_address);
|
|
624
601
|
}
|
|
@@ -627,13 +604,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
627
604
|
* @notice Updates randomizer to `_randomizerAddress`.
|
|
628
605
|
* @param _randomizerAddress Address of new randomizer.
|
|
629
606
|
*/
|
|
630
|
-
function updateRandomizerAddress(
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
external
|
|
634
|
-
onlyAdminACL(this.updateRandomizerAddress.selector)
|
|
635
|
-
onlyNonZeroAddress(_randomizerAddress)
|
|
636
|
-
{
|
|
607
|
+
function updateRandomizerAddress(address _randomizerAddress) external {
|
|
608
|
+
_onlyAdminACL(this.updateRandomizerAddress.selector);
|
|
609
|
+
_onlyNonZeroAddress(_randomizerAddress);
|
|
637
610
|
_updateRandomizerAddress(_randomizerAddress);
|
|
638
611
|
}
|
|
639
612
|
|
|
@@ -641,13 +614,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
641
614
|
* @notice Toggles project `_projectId` as active/inactive.
|
|
642
615
|
* @param _projectId Project ID to be toggled.
|
|
643
616
|
*/
|
|
644
|
-
function toggleProjectIsActive(
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
external
|
|
648
|
-
onlyAdminACL(this.toggleProjectIsActive.selector)
|
|
649
|
-
onlyValidProjectId(_projectId)
|
|
650
|
-
{
|
|
617
|
+
function toggleProjectIsActive(uint256 _projectId) external {
|
|
618
|
+
_onlyAdminACL(this.toggleProjectIsActive.selector);
|
|
619
|
+
_onlyValidProjectId(_projectId);
|
|
651
620
|
projects[_projectId].active = !projects[_projectId].active;
|
|
652
621
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_ACTIVE);
|
|
653
622
|
}
|
|
@@ -688,12 +657,10 @@ contract GenArt721CoreV3_Explorations is
|
|
|
688
657
|
uint256 _additionalPayeePrimarySalesPercentage,
|
|
689
658
|
address payable _additionalPayeeSecondarySales,
|
|
690
659
|
uint256 _additionalPayeeSecondarySalesPercentage
|
|
691
|
-
)
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
onlyNonZeroAddress(_artistAddress)
|
|
696
|
-
{
|
|
660
|
+
) external {
|
|
661
|
+
_onlyValidProjectId(_projectId);
|
|
662
|
+
_onlyArtist(_projectId);
|
|
663
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
697
664
|
ProjectFinance storage projectFinance = projectIdToFinancials[
|
|
698
665
|
_projectId
|
|
699
666
|
];
|
|
@@ -808,15 +775,13 @@ contract GenArt721CoreV3_Explorations is
|
|
|
808
775
|
uint256 _additionalPayeePrimarySalesPercentage,
|
|
809
776
|
address payable _additionalPayeeSecondarySales,
|
|
810
777
|
uint256 _additionalPayeeSecondarySalesPercentage
|
|
811
|
-
)
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
onlyAdminACLOrRenouncedArtist(
|
|
778
|
+
) external {
|
|
779
|
+
_onlyValidProjectId(_projectId);
|
|
780
|
+
_onlyAdminACLOrRenouncedArtist(
|
|
815
781
|
_projectId,
|
|
816
782
|
this.adminAcceptArtistAddressesAndSplits.selector
|
|
817
|
-
)
|
|
818
|
-
|
|
819
|
-
{
|
|
783
|
+
);
|
|
784
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
820
785
|
// checks
|
|
821
786
|
require(
|
|
822
787
|
proposedArtistAddressesAndSplitsHash[_projectId] ==
|
|
@@ -862,15 +827,13 @@ contract GenArt721CoreV3_Explorations is
|
|
|
862
827
|
function updateProjectArtistAddress(
|
|
863
828
|
uint256 _projectId,
|
|
864
829
|
address payable _artistAddress
|
|
865
|
-
)
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
onlyAdminACLOrRenouncedArtist(
|
|
830
|
+
) external {
|
|
831
|
+
_onlyValidProjectId(_projectId);
|
|
832
|
+
_onlyAdminACLOrRenouncedArtist(
|
|
869
833
|
_projectId,
|
|
870
834
|
this.updateProjectArtistAddress.selector
|
|
871
|
-
)
|
|
872
|
-
|
|
873
|
-
{
|
|
835
|
+
);
|
|
836
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
874
837
|
projectIdToFinancials[_projectId].artistAddress = _artistAddress;
|
|
875
838
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_ARTIST_ADDRESS);
|
|
876
839
|
}
|
|
@@ -879,9 +842,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
879
842
|
* @notice Toggles paused state of project `_projectId`.
|
|
880
843
|
* @param _projectId Project ID to be toggled.
|
|
881
844
|
*/
|
|
882
|
-
function toggleProjectIsPaused(
|
|
883
|
-
|
|
884
|
-
) external onlyArtist(_projectId) {
|
|
845
|
+
function toggleProjectIsPaused(uint256 _projectId) external {
|
|
846
|
+
_onlyArtist(_projectId);
|
|
885
847
|
projects[_projectId].paused = !projects[_projectId].paused;
|
|
886
848
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_PAUSED);
|
|
887
849
|
}
|
|
@@ -895,12 +857,10 @@ contract GenArt721CoreV3_Explorations is
|
|
|
895
857
|
function addProject(
|
|
896
858
|
string memory _projectName,
|
|
897
859
|
address payable _artistAddress
|
|
898
|
-
)
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
onlyNonZeroAddress(_artistAddress)
|
|
903
|
-
{
|
|
860
|
+
) external {
|
|
861
|
+
_onlyAdminACL(this.addProject.selector);
|
|
862
|
+
_onlyNonEmptyString(_projectName);
|
|
863
|
+
_onlyNonZeroAddress(_artistAddress);
|
|
904
864
|
require(!newProjectsForbidden, "New projects forbidden");
|
|
905
865
|
uint256 projectId = _nextProjectId;
|
|
906
866
|
projectIdToFinancials[projectId].artistAddress = _artistAddress;
|
|
@@ -916,10 +876,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
916
876
|
/**
|
|
917
877
|
* @notice Forever forbids new projects from being added to this contract.
|
|
918
878
|
*/
|
|
919
|
-
function forbidNewProjects()
|
|
920
|
-
|
|
921
|
-
onlyAdminACL(this.forbidNewProjects.selector)
|
|
922
|
-
{
|
|
879
|
+
function forbidNewProjects() external {
|
|
880
|
+
_onlyAdminACL(this.forbidNewProjects.selector);
|
|
923
881
|
require(!newProjectsForbidden, "Already forbidden");
|
|
924
882
|
_forbidNewProjects();
|
|
925
883
|
}
|
|
@@ -932,12 +890,10 @@ contract GenArt721CoreV3_Explorations is
|
|
|
932
890
|
function updateProjectName(
|
|
933
891
|
uint256 _projectId,
|
|
934
892
|
string memory _projectName
|
|
935
|
-
)
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
onlyNonEmptyString(_projectName)
|
|
940
|
-
{
|
|
893
|
+
) external {
|
|
894
|
+
_onlyUnlocked(_projectId);
|
|
895
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectName.selector);
|
|
896
|
+
_onlyNonEmptyString(_projectName);
|
|
941
897
|
projects[_projectId].name = _projectName;
|
|
942
898
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_NAME);
|
|
943
899
|
}
|
|
@@ -951,12 +907,13 @@ contract GenArt721CoreV3_Explorations is
|
|
|
951
907
|
function updateProjectArtistName(
|
|
952
908
|
uint256 _projectId,
|
|
953
909
|
string memory _projectArtistName
|
|
954
|
-
)
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
910
|
+
) external {
|
|
911
|
+
_onlyUnlocked(_projectId);
|
|
912
|
+
_onlyArtistOrAdminACL(
|
|
913
|
+
_projectId,
|
|
914
|
+
this.updateProjectArtistName.selector
|
|
915
|
+
);
|
|
916
|
+
_onlyNonEmptyString(_projectArtistName);
|
|
960
917
|
projects[_projectId].artist = _projectArtistName;
|
|
961
918
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_ARTIST_NAME);
|
|
962
919
|
}
|
|
@@ -975,7 +932,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
975
932
|
function updateProjectSecondaryMarketRoyaltyPercentage(
|
|
976
933
|
uint256 _projectId,
|
|
977
934
|
uint256 _secondMarketRoyalty
|
|
978
|
-
) external
|
|
935
|
+
) external {
|
|
936
|
+
_onlyArtist(_projectId);
|
|
979
937
|
require(
|
|
980
938
|
_secondMarketRoyalty <= ARTIST_MAX_SECONDARY_ROYALTY_PERCENTAGE,
|
|
981
939
|
"Max of ARTIST_MAX_SECONDARY_ROYALTY_PERCENTAGE percent"
|
|
@@ -1023,7 +981,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1023
981
|
function updateProjectWebsite(
|
|
1024
982
|
uint256 _projectId,
|
|
1025
983
|
string memory _projectWebsite
|
|
1026
|
-
) external
|
|
984
|
+
) external {
|
|
985
|
+
_onlyArtist(_projectId);
|
|
1027
986
|
projects[_projectId].website = _projectWebsite;
|
|
1028
987
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_WEBSITE);
|
|
1029
988
|
}
|
|
@@ -1036,12 +995,10 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1036
995
|
function updateProjectLicense(
|
|
1037
996
|
uint256 _projectId,
|
|
1038
997
|
string memory _projectLicense
|
|
1039
|
-
)
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
onlyNonEmptyString(_projectLicense)
|
|
1044
|
-
{
|
|
998
|
+
) external {
|
|
999
|
+
_onlyUnlocked(_projectId);
|
|
1000
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectLicense.selector);
|
|
1001
|
+
_onlyNonEmptyString(_projectLicense);
|
|
1045
1002
|
projects[_projectId].license = _projectLicense;
|
|
1046
1003
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_LICENSE);
|
|
1047
1004
|
}
|
|
@@ -1058,7 +1015,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1058
1015
|
function updateProjectMaxInvocations(
|
|
1059
1016
|
uint256 _projectId,
|
|
1060
1017
|
uint24 _maxInvocations
|
|
1061
|
-
) external
|
|
1018
|
+
) external {
|
|
1019
|
+
_onlyArtist(_projectId);
|
|
1062
1020
|
// CHECKS
|
|
1063
1021
|
Project storage project = projects[_projectId];
|
|
1064
1022
|
uint256 _invocations = project.invocations;
|
|
@@ -1083,17 +1041,16 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1083
1041
|
/**
|
|
1084
1042
|
* @notice Adds a script to project `_projectId`.
|
|
1085
1043
|
* @param _projectId Project to be updated.
|
|
1086
|
-
* @param _script Script to be added.
|
|
1044
|
+
* @param _script Script to be added. Required to be a non-empty string,
|
|
1045
|
+
* but no further validation is performed.
|
|
1087
1046
|
*/
|
|
1088
1047
|
function addProjectScript(
|
|
1089
1048
|
uint256 _projectId,
|
|
1090
1049
|
string memory _script
|
|
1091
|
-
)
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
onlyNonEmptyString(_script)
|
|
1096
|
-
{
|
|
1050
|
+
) external {
|
|
1051
|
+
_onlyUnlocked(_projectId);
|
|
1052
|
+
_onlyArtistOrAdminACL(_projectId, this.addProjectScript.selector);
|
|
1053
|
+
_onlyNonEmptyString(_script);
|
|
1097
1054
|
Project storage project = projects[_projectId];
|
|
1098
1055
|
// store script in contract bytecode
|
|
1099
1056
|
project.scriptBytecodeAddresses[project.scriptCount] = _script
|
|
@@ -1106,21 +1063,28 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1106
1063
|
* @notice Updates script for project `_projectId` at script ID `_scriptId`.
|
|
1107
1064
|
* @param _projectId Project to be updated.
|
|
1108
1065
|
* @param _scriptId Script ID to be updated.
|
|
1109
|
-
* @param _script The updated script value.
|
|
1066
|
+
* @param _script The updated script value. Required to be a non-empty
|
|
1067
|
+
* string, but no further validation is performed.
|
|
1110
1068
|
*/
|
|
1111
1069
|
function updateProjectScript(
|
|
1112
1070
|
uint256 _projectId,
|
|
1113
1071
|
uint256 _scriptId,
|
|
1114
1072
|
string memory _script
|
|
1115
|
-
)
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
onlyNonEmptyString(_script)
|
|
1120
|
-
{
|
|
1073
|
+
) external {
|
|
1074
|
+
_onlyUnlocked(_projectId);
|
|
1075
|
+
_onlyArtistOrAdminACL(_projectId, this.updateProjectScript.selector);
|
|
1076
|
+
_onlyNonEmptyString(_script);
|
|
1121
1077
|
Project storage project = projects[_projectId];
|
|
1122
1078
|
require(_scriptId < project.scriptCount, "scriptId out of range");
|
|
1123
1079
|
// purge old contract bytecode contract from the blockchain state
|
|
1080
|
+
// note: Although this does reduce usage of Ethereum state, it does not
|
|
1081
|
+
// reduce the gas costs of removal transactions. We believe this is the
|
|
1082
|
+
// best behavior at the time of writing, and do not expect this to
|
|
1083
|
+
// result in any breaking changes in the future. All current proposals
|
|
1084
|
+
// to change the self-destruct opcode are backwards compatible, but may
|
|
1085
|
+
// result in not removing the bytecode from the blockchain state. This
|
|
1086
|
+
// implementation is compatible with that architecture, as it does not
|
|
1087
|
+
// rely on the bytecode being removed from the blockchain state.
|
|
1124
1088
|
project.scriptBytecodeAddresses[_scriptId].purgeBytecode();
|
|
1125
1089
|
// store script in contract bytecode, replacing reference address from
|
|
1126
1090
|
// the contract that no longer exists with the newly created one
|
|
@@ -1132,16 +1096,23 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1132
1096
|
* @notice Removes last script from project `_projectId`.
|
|
1133
1097
|
* @param _projectId Project to be updated.
|
|
1134
1098
|
*/
|
|
1135
|
-
function removeProjectLastScript(
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
{
|
|
1099
|
+
function removeProjectLastScript(uint256 _projectId) external {
|
|
1100
|
+
_onlyUnlocked(_projectId);
|
|
1101
|
+
_onlyArtistOrAdminACL(
|
|
1102
|
+
_projectId,
|
|
1103
|
+
this.removeProjectLastScript.selector
|
|
1104
|
+
);
|
|
1142
1105
|
Project storage project = projects[_projectId];
|
|
1143
1106
|
require(project.scriptCount > 0, "there are no scripts to remove");
|
|
1144
1107
|
// purge old contract bytecode contract from the blockchain state
|
|
1108
|
+
// note: Although this does reduce usage of Ethereum state, it does not
|
|
1109
|
+
// reduce the gas costs of removal transactions. We believe this is the
|
|
1110
|
+
// best behavior at the time of writing, and do not expect this to
|
|
1111
|
+
// result in any breaking changes in the future. All current proposals
|
|
1112
|
+
// to change the self-destruct opcode are backwards compatible, but may
|
|
1113
|
+
// result in not removing the bytecode from the blockchain state. This
|
|
1114
|
+
// implementation is compatible with that architecture, as it does not
|
|
1115
|
+
// rely on the bytecode being removed from the blockchain state.
|
|
1145
1116
|
project
|
|
1146
1117
|
.scriptBytecodeAddresses[project.scriptCount - 1]
|
|
1147
1118
|
.purgeBytecode();
|
|
@@ -1162,11 +1133,12 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1162
1133
|
function updateProjectScriptType(
|
|
1163
1134
|
uint256 _projectId,
|
|
1164
1135
|
bytes32 _scriptTypeAndVersion
|
|
1165
|
-
)
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1136
|
+
) external {
|
|
1137
|
+
_onlyUnlocked(_projectId);
|
|
1138
|
+
_onlyArtistOrAdminACL(
|
|
1139
|
+
_projectId,
|
|
1140
|
+
this.updateProjectScriptType.selector
|
|
1141
|
+
);
|
|
1170
1142
|
Project storage project = projects[_projectId];
|
|
1171
1143
|
// require exactly one @ symbol in _scriptTypeAndVersion
|
|
1172
1144
|
require(
|
|
@@ -1190,12 +1162,13 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1190
1162
|
function updateProjectAspectRatio(
|
|
1191
1163
|
uint256 _projectId,
|
|
1192
1164
|
string memory _aspectRatio
|
|
1193
|
-
)
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1165
|
+
) external {
|
|
1166
|
+
_onlyUnlocked(_projectId);
|
|
1167
|
+
_onlyArtistOrAdminACL(
|
|
1168
|
+
_projectId,
|
|
1169
|
+
this.updateProjectAspectRatio.selector
|
|
1170
|
+
);
|
|
1171
|
+
_onlyNonEmptyString(_aspectRatio);
|
|
1199
1172
|
// Perform more detailed input validation for aspect ratio.
|
|
1200
1173
|
bytes memory aspectRatioBytes = bytes(_aspectRatio);
|
|
1201
1174
|
uint256 bytesLength = aspectRatioBytes.length;
|
|
@@ -1238,7 +1211,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1238
1211
|
function updateProjectBaseURI(
|
|
1239
1212
|
uint256 _projectId,
|
|
1240
1213
|
string memory _newBaseURI
|
|
1241
|
-
) external
|
|
1214
|
+
) external {
|
|
1215
|
+
_onlyArtist(_projectId);
|
|
1216
|
+
_onlyNonEmptyString(_newBaseURI);
|
|
1242
1217
|
projects[_projectId].projectBaseURI = _newBaseURI;
|
|
1243
1218
|
emit ProjectUpdated(_projectId, FIELD_PROJECT_BASE_URI);
|
|
1244
1219
|
}
|
|
@@ -1249,13 +1224,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1249
1224
|
* projects. Token URIs are determined by their project's `projectBaseURI`.
|
|
1250
1225
|
* @param _defaultBaseURI New default base URI.
|
|
1251
1226
|
*/
|
|
1252
|
-
function updateDefaultBaseURI(
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
external
|
|
1256
|
-
onlyAdminACL(this.updateDefaultBaseURI.selector)
|
|
1257
|
-
onlyNonEmptyString(_defaultBaseURI)
|
|
1258
|
-
{
|
|
1227
|
+
function updateDefaultBaseURI(string memory _defaultBaseURI) external {
|
|
1228
|
+
_onlyAdminACL(this.updateDefaultBaseURI.selector);
|
|
1229
|
+
_onlyNonEmptyString(_defaultBaseURI);
|
|
1259
1230
|
_updateDefaultBaseURI(_defaultBaseURI);
|
|
1260
1231
|
}
|
|
1261
1232
|
|
|
@@ -1658,9 +1629,9 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1658
1629
|
)
|
|
1659
1630
|
external
|
|
1660
1631
|
view
|
|
1661
|
-
onlyValidTokenId(_tokenId)
|
|
1662
1632
|
returns (address payable[] memory recipients, uint256[] memory bps)
|
|
1663
1633
|
{
|
|
1634
|
+
_onlyValidTokenId(_tokenId);
|
|
1664
1635
|
// initialize arrays with maximum potential length
|
|
1665
1636
|
recipients = new address payable[](3);
|
|
1666
1637
|
bps = new uint256[](3);
|
|
@@ -1855,7 +1826,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1855
1826
|
*/
|
|
1856
1827
|
function tokenURI(
|
|
1857
1828
|
uint256 _tokenId
|
|
1858
|
-
) public view override
|
|
1829
|
+
) public view override returns (string memory) {
|
|
1830
|
+
_onlyValidTokenId(_tokenId);
|
|
1859
1831
|
string memory _projectBaseURI = projects[tokenIdToProjectId(_tokenId)]
|
|
1860
1832
|
.projectBaseURI;
|
|
1861
1833
|
return string.concat(_projectBaseURI, _tokenId.toString());
|
|
@@ -1975,9 +1947,8 @@ contract GenArt721CoreV3_Explorations is
|
|
|
1975
1947
|
* @return bool true if project is unlocked, false otherwise.
|
|
1976
1948
|
* @dev This also enforces that the `_projectId` passed in is valid.
|
|
1977
1949
|
*/
|
|
1978
|
-
function _projectUnlocked(
|
|
1979
|
-
|
|
1980
|
-
) internal view onlyValidProjectId(_projectId) returns (bool) {
|
|
1950
|
+
function _projectUnlocked(uint256 _projectId) internal view returns (bool) {
|
|
1951
|
+
_onlyValidProjectId(_projectId);
|
|
1981
1952
|
uint256 projectCompletedTimestamp = projects[_projectId]
|
|
1982
1953
|
.completedTimestamp;
|
|
1983
1954
|
bool projectOpen = projectCompletedTimestamp == 0;
|