From ce66a42b0c49b2457196751e3d129f914c7217cf Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 12:35:57 -0400 Subject: [PATCH 01/70] chore: add zora rewards package --- package.json | 3 ++- yarn.lock | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e5d5e3c..3f6eeea 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "typescript": "^5.0.4" }, "dependencies": { - "@dotenv/cli": "^2.2.2" + "@dotenv/cli": "^2.2.2", + "@zoralabs/zora-rewards": "^0.1.0" } } diff --git a/yarn.lock b/yarn.lock index a88a26c..cd13f17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -528,6 +528,11 @@ widest-line "^3.1.0" wrap-ansi "^6.2.0" +"@openzeppelin/contracts@^4.9.0": + version "4.9.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.0.tgz#683f33b6598970051bc5f0806fd8660da9e018dd" + integrity sha512-DUP74AFGKlic2sQb/CmgrN2aUPMFGxRrmCTUxLHsiU2RzwWqVuMPZBxiAyvlff6Pea77uylAX6B5x9W6evEbhA== + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -599,6 +604,13 @@ viem "~0.3.18" zod "^3.21.4" +"@zoralabs/zora-rewards@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.0.tgz#e27a133118328e8f51c2ea79d12e61ecf450b796" + integrity sha512-85+Tg6MZC/zcqrEq+P5fXbFUyh13FgT1qLKMU/1aJwMqm7Cr+wZxTsSxI62hyN7IsdDRXP31GeBHJ9HkenecuA== + dependencies: + "@openzeppelin/contracts" "^4.9.0" + abitype@0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.8.1.tgz#9575a21da88bb4094a262a653e526a088ab06041" From 6b9ac3d43a03dfbfc30b00fefd0adc247e97c20d Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 12:41:03 -0400 Subject: [PATCH 02/70] chore: update remappings --- remappings.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/remappings.txt b/remappings.txt index a8d15e8..5df0c88 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,5 +1,6 @@ @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ +@zoralabs/zora-rewards/=node_modules/@zoralabs/zora-rewards/dist/contracts/ erc721a-upgradeable=lib/ERC721A-Upgradeable/contracts/ base64/=lib/base64/ forge-std/=lib/forge-std/src/ From 943cd74113b8a8bc427e7e7205c4f8a66df6693a Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 12:43:57 -0400 Subject: [PATCH 03/70] refactor: add ERC721Rewards extension --- src/ERC721Drop.sol | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index c15c808..b5a4940 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -23,6 +23,7 @@ import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/acce import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; +import {ERC721Rewards} from "@zoralabs/zora-rewards/ERC721/ERC721Rewards.sol"; import {IMetadataRenderer} from "./interfaces/IMetadataRenderer.sol"; import {IOperatorFilterRegistry} from "./interfaces/IOperatorFilterRegistry.sol"; @@ -56,7 +57,8 @@ contract ERC721Drop is OwnableSkeleton, FundsReceiver, Version(12), - ERC721DropStorageV1 + ERC721DropStorageV1, + ERC721Rewards { /// @dev This is the max mint batch size for the optimized ERC721A mint contract uint256 internal immutable MAX_MINT_BATCH_SIZE = 8; @@ -175,8 +177,9 @@ contract ERC721Drop is IFactoryUpgradeGate _factoryUpgradeGate, address _marketFilterDAOAddress, uint256 _mintFeeAmount, - address payable _mintFeeRecipient - ) initializer { + address payable _mintFeeRecipient, + address _zoraRewards + ) initializer ERC721Rewards(_zoraRewards, _mintFeeRecipient) { zoraERC721TransferHelper = _zoraERC721TransferHelper; factoryUpgradeGate = _factoryUpgradeGate; marketFilterDAOAddress = _marketFilterDAOAddress; From d8f693976e8d399f144891e1e47d6ec2a0d06179 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 18:51:34 -0400 Subject: [PATCH 04/70] chore: update dependencies --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index cd13f17..52f8600 100644 --- a/yarn.lock +++ b/yarn.lock @@ -605,9 +605,9 @@ zod "^3.21.4" "@zoralabs/zora-rewards@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.0.tgz#e27a133118328e8f51c2ea79d12e61ecf450b796" - integrity sha512-85+Tg6MZC/zcqrEq+P5fXbFUyh13FgT1qLKMU/1aJwMqm7Cr+wZxTsSxI62hyN7IsdDRXP31GeBHJ9HkenecuA== + version "0.1.1" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.1.tgz#a19bbc454898951fa12f0cc42724a088866d0182" + integrity sha512-CWiDIQZI5GG6NXxY7IuroFkoe3qvzDZTi2izxGrt1CSqJf1nworBiM2o00w9itfA71+HkMm2yHXabN4gWfUTPw== dependencies: "@openzeppelin/contracts" "^4.9.0" From bbe8f1114e580806db8f00951df30d37223c4fef Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 22:23:31 -0400 Subject: [PATCH 05/70] chore: add zora rewards to scripts --- script/Deploy.s.sol | 5 ++++- script/UpgradeERC721DropFactory.s.sol | 6 +++++- script/ZoraDropsDeployBase.sol | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 681ed05..951a097 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -4,6 +4,8 @@ pragma solidity ^0.8.13; import "forge-std/Script.sol"; import "forge-std/console2.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; + import {ERC721Drop} from "../src/ERC721Drop.sol"; import {ERC721DropProxy} from "../src/ERC721DropProxy.sol"; import {ZoraNFTCreatorV1} from "../src/ZoraNFTCreatorV1.sol"; @@ -33,7 +35,8 @@ contract Deploy is ZoraDropsDeployBase { _factoryUpgradeGate: factoryUpgradeGate, _marketFilterDAOAddress: address(chainConfig.subscriptionMarketFilterAddress), _mintFeeAmount: chainConfig.mintFeeAmount, - _mintFeeRecipient: payable(chainConfig.mintFeeRecipient) + _mintFeeRecipient: payable(chainConfig.mintFeeRecipient), + _zoraRewards: address(chainConfig.zoraRewards) }); ZoraNFTCreatorV1 factoryImpl = new ZoraNFTCreatorV1(address(dropImplementation), editionMetadata, dropMetadata); diff --git a/script/UpgradeERC721DropFactory.s.sol b/script/UpgradeERC721DropFactory.s.sol index a252356..660f636 100644 --- a/script/UpgradeERC721DropFactory.s.sol +++ b/script/UpgradeERC721DropFactory.s.sol @@ -2,6 +2,9 @@ pragma solidity ^0.8.13; import "forge-std/console2.sol"; + +import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; + import {ZoraDropsDeployBase, ChainConfig, DropDeployment} from "./ZoraDropsDeployBase.sol"; import {ERC721Drop} from "../src/ERC721Drop.sol"; @@ -58,7 +61,8 @@ contract UpgradeERC721DropFactory is ZoraDropsDeployBase { _factoryUpgradeGate: IFactoryUpgradeGate(deployment.factoryUpgradeGate), _marketFilterDAOAddress: chainConfig.subscriptionMarketFilterAddress, _mintFeeAmount: chainConfig.mintFeeAmount, - _mintFeeRecipient: payable(chainConfig.mintFeeRecipient) + _mintFeeRecipient: payable(chainConfig.mintFeeRecipient), + _zoraRewards: chainConfig.zoraRewards }); deployment.dropImplementation = address(dropImplementation); diff --git a/script/ZoraDropsDeployBase.sol b/script/ZoraDropsDeployBase.sol index 743736e..9a45c09 100644 --- a/script/ZoraDropsDeployBase.sol +++ b/script/ZoraDropsDeployBase.sol @@ -22,6 +22,8 @@ struct ChainConfig { address subscriptionMarketFilterOwner; /// @notice Auto-approved hyperstructure on mainnet for enabling ZORA v3 with less gas. Deprecated – safe to set to address(0x) address zoraERC721TransferHelper; + /// @notice Zora Rewards contract for issuing/withdrawing mint rewards + address zoraRewards; } /// @notice Deployment addresses – set to new deployed addresses by the scripts. @@ -66,6 +68,7 @@ abstract contract ZoraDropsDeployBase is Script { string constant SUBSCRIPTION_MARKET_FILTER_ADDRESS = "SUBSCRIPTION_MARKET_FILTER_ADDRESS"; string constant SUBSCRIPTION_MARKET_FILTER_OWNER = "SUBSCRIPTION_MARKET_FILTER_OWNER"; string constant ZORA_ERC721_TRANSFER_HELPER = "ZORA_ERC721_TRANSFER_HELPER"; + string constant ZORA_REWARDS = "ZORA_REWARDS"; string constant DROP_METADATA_RENDERER = "DROP_METADATA_RENDERER"; string constant EDITION_METADATA_RENDERER = "EDITION_METADATA_RENDERER"; @@ -92,6 +95,7 @@ abstract contract ZoraDropsDeployBase is Script { chainConfig.subscriptionMarketFilterAddress = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_ADDRESS)); chainConfig.subscriptionMarketFilterOwner = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_OWNER)); chainConfig.zoraERC721TransferHelper = json.readAddress(getKeyPrefix(ZORA_ERC721_TRANSFER_HELPER)); + chainConfig.zoraRewards = json.readAddress(getKeyPrefix(ZORA_REWARDS)); } /// @notice Get the deployment configuration struct from the JSON configuration file From 21c7bbe3e989d4e5425e012552a424f7cb5e0e55 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 22:36:23 -0400 Subject: [PATCH 06/70] chore: update existing tests --- test/ERC721Drop.t.sol | 16 ++++++++++++---- test/ZoraNFTCreatorV1.t.sol | 10 ++++++++-- test/merkle/MerkleDrop.t.sol | 10 +++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index 50a0846..26dc163 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; import {ERC721Drop} from "../src/ERC721Drop.sol"; import {DummyMetadataRenderer} from "./utils/DummyMetadataRenderer.sol"; @@ -46,6 +47,7 @@ contract ERC721DropTest is Test { string comment ); + ZoraRewards zoraRewards; ERC721Drop zoraNFTBase; MockUser mockUser; DummyMetadataRenderer public dummyRenderer = new DummyMetadataRenderer(); @@ -87,6 +89,8 @@ contract ERC721DropTest is Test { } function setUp() public { + zoraRewards = new ZoraRewards("Zora Rewards", "ZEWARDS"); + vm.prank(DEFAULT_ZORA_DAO_ADDRESS); factoryUpgradeGate = new FactoryUpgradeGate(UPGRADE_GATE_ADMIN_ADDRESS); vm.etch( @@ -104,7 +108,8 @@ contract ERC721DropTest is Test { factoryUpgradeGate, address(0x0), mintFee, - mintFeeRecipient + mintFeeRecipient, + address(zoraRewards) ) ); address payable newDrop = payable( @@ -121,7 +126,8 @@ contract ERC721DropTest is Test { factoryUpgradeGate, address(subscriptionAddress), mintFee, - mintFeeRecipient + mintFeeRecipient, + address(zoraRewards) ) ); address payable newDrop = payable( @@ -372,7 +378,8 @@ contract ERC721DropTest is Test { factoryUpgradeGate, address(0x0), mintFee, - mintFeeRecipient + mintFeeRecipient, + address(zoraRewards) ) ); @@ -394,7 +401,8 @@ contract ERC721DropTest is Test { factoryUpgradeGate, address(0x0), mintFee, - mintFeeRecipient + mintFeeRecipient, + address(zoraRewards) ) ); diff --git a/test/ZoraNFTCreatorV1.t.sol b/test/ZoraNFTCreatorV1.t.sol index cf38341..626e51b 100644 --- a/test/ZoraNFTCreatorV1.t.sol +++ b/test/ZoraNFTCreatorV1.t.sol @@ -2,12 +2,14 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; +import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; + import {IMetadataRenderer} from "../src/interfaces/IMetadataRenderer.sol"; import "../src/ZoraNFTCreatorV1.sol"; import "../src/ZoraNFTCreatorProxy.sol"; import {MockMetadataRenderer} from "./metadata/MockMetadataRenderer.sol"; import {FactoryUpgradeGate} from "../src/FactoryUpgradeGate.sol"; -import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; contract ZoraNFTCreatorV1Test is Test { address public constant DEFAULT_OWNER_ADDRESS = address(0x23499); @@ -21,15 +23,19 @@ contract ZoraNFTCreatorV1Test is Test { ZoraNFTCreatorV1 public creator; EditionMetadataRenderer public editionMetadataRenderer; DropMetadataRenderer public dropMetadataRenderer; + ZoraRewards internal zoraRewards; function setUp() public { + zoraRewards = new ZoraRewards("Zora Rewards", "ZEWARDS"); + vm.prank(DEFAULT_ZORA_DAO_ADDRESS); dropImpl = new ERC721Drop( address(1234), FactoryUpgradeGate(address(0)), address(0), mintFee, - mintFeeRecipient + mintFeeRecipient, + address(zoraRewards) ); editionMetadataRenderer = new EditionMetadataRenderer(); dropMetadataRenderer = new DropMetadataRenderer(); diff --git a/test/merkle/MerkleDrop.t.sol b/test/merkle/MerkleDrop.t.sol index e227053..197af4d 100644 --- a/test/merkle/MerkleDrop.t.sol +++ b/test/merkle/MerkleDrop.t.sol @@ -2,15 +2,17 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; + import {IERC721Drop} from "../../src/interfaces/IERC721Drop.sol"; import {ERC721Drop} from "../../src/ERC721Drop.sol"; import {DummyMetadataRenderer} from "../utils/DummyMetadataRenderer.sol"; import {FactoryUpgradeGate} from "../../src/FactoryUpgradeGate.sol"; import {ERC721DropProxy} from "../../src/ERC721DropProxy.sol"; - import {MerkleData} from "./MerkleData.sol"; contract ZoraNFTBaseTest is Test { + ZoraRewards internal zoraRewards; ERC721Drop zoraNFTBase; DummyMetadataRenderer public dummyRenderer = new DummyMetadataRenderer(); MerkleData public merkleData; @@ -41,15 +43,17 @@ contract ZoraNFTBaseTest is Test { } function setUp() public { - vm.prank(DEFAULT_ZORA_DAO_ADDRESS); + zoraRewards = new ZoraRewards("Zora Rewards", "ZEWARDS"); + vm.prank(DEFAULT_ZORA_DAO_ADDRESS); address impl = address( new ERC721Drop( address(1234), FactoryUpgradeGate(address(0)), address(0), mintFee, - mintFeeRecipient + mintFeeRecipient, + address(zoraRewards) ) ); address payable newDrop = payable( From 4e6a9aa496de79fc1d437a7f806fbe9e45426eb0 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 22:38:48 -0400 Subject: [PATCH 07/70] feat: add purchaseWithRewards --- src/ERC721Drop.sol | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index b5a4940..26261eb 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -465,6 +465,60 @@ contract ERC721Drop is return _handlePurchase(quantity, comment); } + /// @notice Purchase a quantity of tokens with a comment that will pay out rewards + /// @param quantity quantity to purchase + /// @param comment comment to include in the IERC721Drop.Sale event + /// @return tokenId of the first token minted + function purchaseWithRewards(uint256 quantity, string calldata comment) + external + payable + nonReentrant + canMintTokens(quantity) + onlyPublicSaleActive + returns (uint256) + { + return _handlePurchaseWithRewards(quantity, comment, address(0), address(0)); + } + + function _handlePurchaseWithRewards(uint256 quantity, string memory comment, address finder, address lister) internal returns (uint256) { + // If max purchase per address == 0 there is no limit. + // Any other number, the per address mint limit is that. + if ( + salesConfig.maxSalePurchasePerAddress != 0 + && _numberMinted(_msgSender()) + quantity - presaleMintsByAddress[_msgSender()] + > salesConfig.maxSalePurchasePerAddress + ) { + revert Purchase_TooManyForAddress(); + } + + uint256 salePrice = salesConfig.publicSalePrice; + + _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, finder, lister); + + _mintNFTs(_msgSender(), quantity); + + uint256 firstMintedTokenId = _lastMintedTokenId() - quantity; + + emit IERC721Drop.Sale({ + to: _msgSender(), + quantity: quantity, + pricePerToken: salePrice, + firstPurchasedTokenId: firstMintedTokenId + }); + + if (bytes(comment).length > 0) { + emit IERC721Drop.MintComment({ + sender: _msgSender(), + tokenContract: address(this), + tokenId: firstMintedTokenId, + quantity: quantity, + comment: comment + }); + } + + return firstMintedTokenId; + } + function _handlePurchase(uint256 quantity, string memory comment) internal returns (uint256) { uint256 salePrice = salesConfig.publicSalePrice; From 9ae43f0028e849b0f1c3fd1d88bc26b7613d491f Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 23:16:41 -0400 Subject: [PATCH 08/70] chore: update dependencies --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3f6eeea..16ec014 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,6 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/zora-rewards": "^0.1.0" + "@zoralabs/zora-rewards": "^0.1.2" } } diff --git a/yarn.lock b/yarn.lock index 52f8600..a071a83 100644 --- a/yarn.lock +++ b/yarn.lock @@ -604,10 +604,10 @@ viem "~0.3.18" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.1.tgz#a19bbc454898951fa12f0cc42724a088866d0182" - integrity sha512-CWiDIQZI5GG6NXxY7IuroFkoe3qvzDZTi2izxGrt1CSqJf1nworBiM2o00w9itfA71+HkMm2yHXabN4gWfUTPw== +"@zoralabs/zora-rewards@^0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.2.tgz#a76dac799bce6744b3a136ff4b11e4ef2119cbdc" + integrity sha512-RFSODP4t4+owYWzEYKa3RkBuCFwudgUHR+63753wZIMIhpcLHN8LzAYVKkavSdFdU4dkTcfS6x50hds+OvR5Fg== dependencies: "@openzeppelin/contracts" "^4.9.0" From 55403c96a425b86a871984dfddc57bf468561b55 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 23:34:07 -0400 Subject: [PATCH 09/70] fix: add finder and lister params --- src/ERC721Drop.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 26261eb..e4bcece 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -469,7 +469,7 @@ contract ERC721Drop is /// @param quantity quantity to purchase /// @param comment comment to include in the IERC721Drop.Sale event /// @return tokenId of the first token minted - function purchaseWithRewards(uint256 quantity, string calldata comment) + function purchaseWithRewards(uint256 quantity, string calldata comment, address finder, address lister) external payable nonReentrant @@ -477,7 +477,7 @@ contract ERC721Drop is onlyPublicSaleActive returns (uint256) { - return _handlePurchaseWithRewards(quantity, comment, address(0), address(0)); + return _handlePurchaseWithRewards(quantity, comment, finder, lister); } function _handlePurchaseWithRewards(uint256 quantity, string memory comment, address finder, address lister) internal returns (uint256) { From 49f3adf1fe05a206694ac86a067cb4d5dd1fc71d Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 23:50:36 -0400 Subject: [PATCH 10/70] chore: add rewards tests --- test/ERC721Drop.t.sol | 243 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 243 insertions(+) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index 26dc163..1adf895 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -63,6 +63,7 @@ contract ERC721DropTest is Test { address public ownedSubscriptionManager; address payable public constant mintFeeRecipient = payable(address(0x11)); uint256 public constant mintFee = 777000000000000; // 0.000777 ETH + uint256 public constant TOTAL_REWARD_PER_MINT = 0.000999 ether; struct Configuration { IMetadataRenderer metadataRenderer; @@ -371,6 +372,248 @@ contract ERC721DropTest is Test { zoraNFTBase.purchaseWithComment{value: paymentAmount}(purchaseQuantity, "test comment"); } + function test_FreeMintRewards(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + + vm.deal(address(456), totalReward); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", address(0), address(0)); + + assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + listerReward); + } + + function test_FreeMintRewardsWithFinder(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + + address finder = makeAddr("finder"); + + vm.deal(address(456), totalReward); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", finder, address(0)); + + assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + listerReward); + assertEq(zoraRewards.balanceOf(finder), finderReward); + } + + function test_FreeMintRewardsWithLister(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + + address lister = makeAddr("lister"); + + vm.deal(address(456), totalReward); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", address(0), lister); + + assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); + assertEq(zoraRewards.balanceOf(lister), listerReward); + } + + function test_FreeMintRewardsWithFinderAndLister(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + + address finder = makeAddr("finder"); + address lister = makeAddr("lister"); + + vm.deal(address(456), totalReward); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", finder, lister); + + assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); + assertEq(zoraRewards.balanceOf(finder), finderReward); + assertEq(zoraRewards.balanceOf(lister), listerReward); + } + + function test_PaidMintRewards(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(salePrice > 0); + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: salePrice, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + uint256 totalSales = uint256(salePrice) * purchaseQuantity; + + (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computePaidMintRewards(purchaseQuantity); + + uint256 totalPayment = totalSales + totalReward; + + vm.deal(address(456), totalPayment); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", address(0), address(0)); + + assertEq(address(zoraNFTBase).balance, totalSales); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + listerReward); + } + + function test_PaidMintRewardsWithFinder(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(salePrice > 0); + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: salePrice, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + uint256 totalSales = uint256(salePrice) * purchaseQuantity; + + (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computePaidMintRewards(purchaseQuantity); + + uint256 totalPayment = totalSales + totalReward; + + address finder = makeAddr("finder"); + + vm.deal(address(456), totalPayment); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", finder, address(0)); + + assertEq(address(zoraNFTBase).balance, totalSales); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + listerReward); + assertEq(zoraRewards.balanceOf(finder), finderReward); + } + + function test_PaidMintRewardsWithLister(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(salePrice > 0); + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: salePrice, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + uint256 totalSales = uint256(salePrice) * purchaseQuantity; + + (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computePaidMintRewards(purchaseQuantity); + + uint256 totalPayment = totalSales + totalReward; + + address lister = makeAddr("lister"); + + vm.deal(address(456), totalPayment); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", address(0), lister); + + assertEq(address(zoraNFTBase).balance, totalSales); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); + assertEq(zoraRewards.balanceOf(lister), listerReward); + } + + function test_PaidMintRewardsWithFinderAndLister(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(salePrice > 0); + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: salePrice, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + uint256 totalSales = uint256(salePrice) * purchaseQuantity; + + (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computePaidMintRewards(purchaseQuantity); + + uint256 totalPayment = totalSales + totalReward; + + address finder = makeAddr("finder"); + address lister = makeAddr("lister"); + + vm.deal(address(456), totalPayment); + vm.prank(address(456)); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", finder, lister); + + assertEq(address(zoraNFTBase).balance, totalSales); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); + assertEq(zoraRewards.balanceOf(finder), finderReward); + assertEq(zoraRewards.balanceOf(lister), listerReward); + } + function test_UpgradeApproved() public setupZoraNFTBase(10) { address newImpl = address( new ERC721Drop( From a19b9a72a4f05e25409c5f67fc829e5db4e7e657 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Tue, 6 Jun 2023 23:54:12 -0400 Subject: [PATCH 11/70] chore: reduce optimizer runs --- foundry.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index 666531c..d69101a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,7 +1,7 @@ [profile.default] solc_version = '0.8.17' optimizer = true -optimizer_runs = 5000 +optimizer_runs = 800 via_ir = true out = 'dist/artifacts' test = 'test' From 54d322f819cf0f359fab82045c5258b26fba72e5 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Wed, 14 Jun 2023 02:45:09 -0400 Subject: [PATCH 12/70] chore: update dependencies --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 16ec014..4d6bb81 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,6 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/zora-rewards": "^0.1.2" + "@zoralabs/zora-rewards": "^0.1.4" } } diff --git a/yarn.lock b/yarn.lock index a071a83..c79fba4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -604,10 +604,10 @@ viem "~0.3.18" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.2.tgz#a76dac799bce6744b3a136ff4b11e4ef2119cbdc" - integrity sha512-RFSODP4t4+owYWzEYKa3RkBuCFwudgUHR+63753wZIMIhpcLHN8LzAYVKkavSdFdU4dkTcfS6x50hds+OvR5Fg== +"@zoralabs/zora-rewards@^0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.4.tgz#fc3ccf924b2ee05231af4fec7aa06e572585eb5d" + integrity sha512-3ZTDZ+1zTsjmd+wbQkzifhiHrlkYq268a0C+ZmixXsEBeBWEzxZwIXVoUCTZxTPguWlddN16rRrg2bumyvsQQA== dependencies: "@openzeppelin/contracts" "^4.9.0" From 8e6b82c360254e48f70bc3a082c60e15317ec99d Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Thu, 15 Jun 2023 12:24:22 -0400 Subject: [PATCH 13/70] chore: update runs --- foundry.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index d69101a..6412dd8 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,7 +1,7 @@ [profile.default] solc_version = '0.8.17' optimizer = true -optimizer_runs = 800 +optimizer_runs = 555 via_ir = true out = 'dist/artifacts' test = 'test' From 79555ea31f80a383d04300a33e9e29596b86be19 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Thu, 15 Jun 2023 19:14:49 -0400 Subject: [PATCH 14/70] fix: handle supply royaltes when purchasing with rewards --- src/ERC721Drop.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 42cde03..630de38 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -485,6 +485,8 @@ contract ERC721Drop is } function _handlePurchaseWithRewards(uint256 quantity, string memory comment, address finder, address lister) internal returns (uint256) { + _mintSupplyRoyalty(quantity); + // If max purchase per address == 0 there is no limit. // Any other number, the per address mint limit is that. if ( From f796d1efa2c486283918d18ec86171d0590b5f42 Mon Sep 17 00:00:00 2001 From: kulkarohan Date: Thu, 15 Jun 2023 19:15:01 -0400 Subject: [PATCH 15/70] chore: update tests --- test/ERC721Drop.t.sol | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index 5d9fc12..b76dc00 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -484,6 +484,24 @@ contract ERC721DropTest is Test { assertEq(zoraRewards.balanceOf(lister), listerReward); } + function testRevert_FreeMintRewardsInsufficientEth(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); + zoraNFTBase.purchaseWithRewards(purchaseQuantity, "test comment", address(0), address(0)); + } + function test_PaidMintRewards(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { vm.assume(salePrice > 0); vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); @@ -615,6 +633,32 @@ contract ERC721DropTest is Test { assertEq(zoraRewards.balanceOf(lister), listerReward); } + function testRevert_PaidMintRewardsInsufficientEth(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + vm.assume(salePrice > 0); + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: salePrice, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); + + uint256 totalSales = uint256(salePrice) * purchaseQuantity; + + (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + zoraNFTBase.computePaidMintRewards(purchaseQuantity); + + uint256 totalPayment = totalSales + totalReward; + + vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); + zoraNFTBase.purchaseWithRewards(purchaseQuantity, "test comment", address(0), address(0)); + } + function test_UpgradeApproved() public setupZoraNFTBase(10) { address newImpl = address( new ERC721Drop( From 1ea8b27241c714345fb7d6dbc7679b4e04844f59 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 27 Jun 2023 18:11:10 -0400 Subject: [PATCH 16/70] chore: update OZ dependency location --- .gitmodules | 3 --- lib/openzeppelin-contracts | 1 - package.json | 3 ++- remappings.txt | 2 +- yarn.lock | 18 +++++++++--------- 5 files changed, 12 insertions(+), 15 deletions(-) delete mode 160000 lib/openzeppelin-contracts diff --git a/.gitmodules b/.gitmodules index b3c5b03..a2f2629 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "lib/openzeppelin-contracts-upgradeable"] path = lib/openzeppelin-contracts-upgradeable url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/ -[submodule "lib/openzeppelin-contracts"] - path = lib/openzeppelin-contracts - url = https://github.com/OpenZeppelin/openzeppelin-contracts/ [submodule "lib/ERC721A-Upgradeable"] path = lib/ERC721A-Upgradeable url = https://github.com/chiru-labs/ERC721A-Upgradeable diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts deleted file mode 160000 index c239e1a..0000000 --- a/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c239e1af8d1a1296577108dd6989a17b57434f8e diff --git a/package.json b/package.json index 9a64757..6cc0038 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/zora-rewards": "^0.1.4" + "@openzeppelin/contracts": "^4.9.2", + "@zoralabs/zora-rewards": "^0.1.5" } } diff --git a/remappings.txt b/remappings.txt index 5df0c88..4da8ae3 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,5 +1,5 @@ @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ -@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ +@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ @zoralabs/zora-rewards/=node_modules/@zoralabs/zora-rewards/dist/contracts/ erc721a-upgradeable=lib/ERC721A-Upgradeable/contracts/ base64/=lib/base64/ diff --git a/yarn.lock b/yarn.lock index 6293837..7b9b7f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -528,10 +528,10 @@ widest-line "^3.1.0" wrap-ansi "^6.2.0" -"@openzeppelin/contracts@^4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.0.tgz#683f33b6598970051bc5f0806fd8660da9e018dd" - integrity sha512-DUP74AFGKlic2sQb/CmgrN2aUPMFGxRrmCTUxLHsiU2RzwWqVuMPZBxiAyvlff6Pea77uylAX6B5x9W6evEbhA== +"@openzeppelin/contracts@^4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1" + integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg== "@pkgjs/parseargs@^0.11.0": version "0.11.0" @@ -604,12 +604,12 @@ viem "~0.3.18" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.4.tgz#fc3ccf924b2ee05231af4fec7aa06e572585eb5d" - integrity sha512-3ZTDZ+1zTsjmd+wbQkzifhiHrlkYq268a0C+ZmixXsEBeBWEzxZwIXVoUCTZxTPguWlddN16rRrg2bumyvsQQA== +"@zoralabs/zora-rewards@^0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.5.tgz#af3c7e4b99f1f56907bb666b68388c6ff80b2e73" + integrity sha512-sM3tjVKEF2nDGxGGejOdNvSNGMCt2toFw9iaPmU4hNHBcRVueS7/lzb4Qi142oMiiv8VqinTcsdZfTbk4KDs7g== dependencies: - "@openzeppelin/contracts" "^4.9.0" + "@openzeppelin/contracts" "^4.9.2" abitype@0.8.1: version "0.8.1" From 77ab5c31def69380b19fdf4a608baa10b97a5e8c Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 27 Jun 2023 18:14:18 -0400 Subject: [PATCH 17/70] chore: update rewards tests --- test/ERC721Drop.t.sol | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index b76dc00..72589e1 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -387,14 +387,15 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); vm.deal(address(456), totalReward); vm.prank(address(456)); zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", address(0), address(0)); - assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + listerReward); } @@ -412,7 +413,7 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); address finder = makeAddr("finder"); @@ -421,7 +422,8 @@ contract ERC721DropTest is Test { vm.prank(address(456)); zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", finder, address(0)); - assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + listerReward); assertEq(zoraRewards.balanceOf(finder), finderReward); } @@ -440,7 +442,7 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); address lister = makeAddr("lister"); @@ -449,7 +451,8 @@ contract ERC721DropTest is Test { vm.prank(address(456)); zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", address(0), lister); - assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); assertEq(zoraRewards.balanceOf(lister), listerReward); } @@ -468,7 +471,7 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); address finder = makeAddr("finder"); @@ -478,7 +481,8 @@ contract ERC721DropTest is Test { vm.prank(address(456)); zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", finder, lister); - assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); assertEq(zoraRewards.balanceOf(finder), finderReward); assertEq(zoraRewards.balanceOf(lister), listerReward); @@ -519,7 +523,7 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; @@ -549,7 +553,7 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; @@ -582,7 +586,7 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; @@ -615,7 +619,7 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; @@ -650,7 +654,7 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 zoraReward, uint256 finderReward, uint256 listerReward) = + (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; From 16f9300bd2e6dfdb6c6dba0001e570ccfe707d6c Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 4 Jul 2023 17:40:57 -0400 Subject: [PATCH 18/70] refactor: add recipient to purchase w rewards --- src/ERC721Drop.sol | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 0f43fac..34e1994 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -469,11 +469,26 @@ contract ERC721Drop is return _handlePurchase(msg.sender, quantity, comment); } + /// @notice Purchase a quantity of tokens to a specified recipient, with an optional comment + /// @param recipient recipient of the tokens + /// @param quantity quantity to purchase + /// @param comment optional comment to include in the IERC721Drop.Sale event (leave blank for no comment) + /// @return tokenId of the first token minted + function purchaseWithRecipient(address recipient, uint256 quantity, string calldata comment) + external + payable + nonReentrant + onlyPublicSaleActive + returns (uint256) + { + return _handlePurchase(recipient, quantity, comment); + } + /// @notice Purchase a quantity of tokens with a comment that will pay out rewards /// @param quantity quantity to purchase /// @param comment comment to include in the IERC721Drop.Sale event /// @return tokenId of the first token minted - function purchaseWithRewards(uint256 quantity, string calldata comment, address finder, address lister) + function purchaseWithRewards(address recipient, uint256 quantity, string calldata comment, address finder, address lister) external payable nonReentrant @@ -481,17 +496,17 @@ contract ERC721Drop is onlyPublicSaleActive returns (uint256) { - return _handlePurchaseWithRewards(quantity, comment, finder, lister); + return _handlePurchaseWithRewards(recipient, quantity, comment, finder, lister); } - function _handlePurchaseWithRewards(uint256 quantity, string memory comment, address finder, address lister) internal returns (uint256) { + function _handlePurchaseWithRewards(address recipient, uint256 quantity, string memory comment, address finder, address lister) internal returns (uint256) { _mintSupplyRoyalty(quantity); // If max purchase per address == 0 there is no limit. // Any other number, the per address mint limit is that. if ( salesConfig.maxSalePurchasePerAddress != 0 - && _numberMinted(_msgSender()) + quantity - presaleMintsByAddress[_msgSender()] + && _numberMinted(recipient) + quantity - presaleMintsByAddress[recipient] > salesConfig.maxSalePurchasePerAddress ) { revert Purchase_TooManyForAddress(); @@ -501,12 +516,12 @@ contract ERC721Drop is _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, finder, lister); - _mintNFTs(_msgSender(), quantity); + _mintNFTs(recipient, quantity); uint256 firstMintedTokenId = _lastMintedTokenId() - quantity; emit IERC721Drop.Sale({ - to: _msgSender(), + to: recipient, quantity: quantity, pricePerToken: salePrice, firstPurchasedTokenId: firstMintedTokenId @@ -525,21 +540,6 @@ contract ERC721Drop is return firstMintedTokenId; } - /// @notice Purchase a quantity of tokens to a specified recipient, with an optional comment - /// @param recipient recipient of the tokens - /// @param quantity quantity to purchase - /// @param comment optional comment to include in the IERC721Drop.Sale event (leave blank for no comment) - /// @return tokenId of the first token minted - function purchaseWithRecipient(address recipient, uint256 quantity, string calldata comment) - external - payable - nonReentrant - onlyPublicSaleActive - returns (uint256) - { - return _handlePurchase(recipient, quantity, comment); - } - function _handlePurchase(address recipient, uint256 quantity, string memory comment) internal returns (uint256) { _mintSupplyRoyalty(quantity); _requireCanMintQuantity(quantity); From 573cb33e94944ed77a66b2833c593e1f90291270 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 4 Jul 2023 17:42:42 -0400 Subject: [PATCH 19/70] chore: update rewards dep --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6749ddc..6e58a87 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,6 @@ "dependencies": { "@dotenv/cli": "^2.2.2", "@openzeppelin/contracts": "^4.9.2", - "@zoralabs/zora-rewards": "^0.1.5" + "@zoralabs/zora-rewards": "^0.1.7" } } diff --git a/yarn.lock b/yarn.lock index 04265a4..039c5a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -881,10 +881,10 @@ viem "~0.3.18" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.5": - version "0.1.5" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.5.tgz#af3c7e4b99f1f56907bb666b68388c6ff80b2e73" - integrity sha512-sM3tjVKEF2nDGxGGejOdNvSNGMCt2toFw9iaPmU4hNHBcRVueS7/lzb4Qi142oMiiv8VqinTcsdZfTbk4KDs7g== +"@zoralabs/zora-rewards@^0.1.7": + version "0.1.7" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.7.tgz#02808ab65ac8454a22e933e6fe691db23fb6e008" + integrity sha512-irihibZtg99ihMlWPhuEc0j1s68Gm2Y1uLRyS3sOxm85L1JoaFRlvuDLnFjFvWGvXruOPGbjRymrLPpFOTiHNg== dependencies: "@openzeppelin/contracts" "^4.9.2" From b3e725dcd34bfbac9d30610db0ed9cb0a3cfa91e Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 4 Jul 2023 17:53:16 -0400 Subject: [PATCH 20/70] refactor: update lister to origin --- src/ERC721Drop.sol | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 34e1994..46a5ece 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -485,10 +485,13 @@ contract ERC721Drop is } /// @notice Purchase a quantity of tokens with a comment that will pay out rewards + /// @param recipient recipient of the tokens /// @param quantity quantity to purchase /// @param comment comment to include in the IERC721Drop.Sale event + /// @param finder The finder of the mint + /// @param origin The origin of the collection /// @return tokenId of the first token minted - function purchaseWithRewards(address recipient, uint256 quantity, string calldata comment, address finder, address lister) + function purchaseWithRewards(address recipient, uint256 quantity, string calldata comment, address finder, address origin) external payable nonReentrant @@ -496,10 +499,10 @@ contract ERC721Drop is onlyPublicSaleActive returns (uint256) { - return _handlePurchaseWithRewards(recipient, quantity, comment, finder, lister); + return _handlePurchaseWithRewards(recipient, quantity, comment, finder, origin); } - function _handlePurchaseWithRewards(address recipient, uint256 quantity, string memory comment, address finder, address lister) internal returns (uint256) { + function _handlePurchaseWithRewards(address recipient, uint256 quantity, string memory comment, address finder, address origin) internal returns (uint256) { _mintSupplyRoyalty(quantity); // If max purchase per address == 0 there is no limit. @@ -514,7 +517,7 @@ contract ERC721Drop is uint256 salePrice = salesConfig.publicSalePrice; - _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, finder, lister); + _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, finder, origin); _mintNFTs(recipient, quantity); From 51aef586a5d23dc3d8288348178b4d7f283e1084 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 4 Jul 2023 18:04:50 -0400 Subject: [PATCH 21/70] chore: update tests --- test/ERC721Drop.t.sol | 112 +++++++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 51 deletions(-) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index 1112074..b20261c 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -475,16 +475,17 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); - vm.deal(address(456), totalReward); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", address(0), address(0)); + address buyer = makeAddr("buyer"); + + vm.deal(buyer, totalReward); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), address(0)); - // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + listerReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + originReward); } function test_FreeMintRewardsWithFinder(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -501,18 +502,18 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + address buyer = makeAddr("buyer"); address finder = makeAddr("finder"); - vm.deal(address(456), totalReward); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", finder, address(0)); + vm.deal(buyer, totalReward); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, address(0)); - // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + listerReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + originReward); assertEq(zoraRewards.balanceOf(finder), finderReward); } @@ -530,19 +531,19 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); - address lister = makeAddr("lister"); + address buyer = makeAddr("buyer"); + address origin = makeAddr("origin"); - vm.deal(address(456), totalReward); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", address(0), lister); + vm.deal(buyer, totalReward); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), origin); - // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); - assertEq(zoraRewards.balanceOf(lister), listerReward); + assertEq(zoraRewards.balanceOf(origin), originReward); } function test_FreeMintRewardsWithFinderAndLister(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -559,21 +560,21 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + address buyer = makeAddr("buyer"); address finder = makeAddr("finder"); - address lister = makeAddr("lister"); + address origin = makeAddr("origin"); - vm.deal(address(456), totalReward); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalReward}(purchaseQuantity, "test comment", finder, lister); + vm.deal(buyer, totalReward); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, origin); - // assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, creatorReward); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); assertEq(zoraRewards.balanceOf(finder), finderReward); - assertEq(zoraRewards.balanceOf(lister), listerReward); + assertEq(zoraRewards.balanceOf(origin), originReward); } function testRevert_FreeMintRewardsInsufficientEth(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -590,8 +591,10 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); + address buyer = makeAddr("buyer"); + vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); - zoraNFTBase.purchaseWithRewards(purchaseQuantity, "test comment", address(0), address(0)); + zoraNFTBase.purchaseWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); } function test_PaidMintRewards(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -611,17 +614,19 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; - vm.deal(address(456), totalPayment); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", address(0), address(0)); + address buyer = makeAddr("buyer"); + + vm.deal(buyer, totalPayment); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), address(0)); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + listerReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + originReward); } function test_PaidMintRewardsWithFinder(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -641,19 +646,20 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; + address buyer = makeAddr("buyer"); address finder = makeAddr("finder"); - vm.deal(address(456), totalPayment); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", finder, address(0)); + vm.deal(buyer, totalPayment); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, address(0)); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + listerReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + originReward); assertEq(zoraRewards.balanceOf(finder), finderReward); } @@ -674,20 +680,21 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; - address lister = makeAddr("lister"); + address buyer = makeAddr("buyer"); + address origin = makeAddr("origin"); - vm.deal(address(456), totalPayment); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", address(0), lister); + vm.deal(buyer, totalPayment); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), origin); assertEq(address(zoraNFTBase).balance, totalSales); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); - assertEq(zoraRewards.balanceOf(lister), listerReward); + assertEq(zoraRewards.balanceOf(origin), originReward); } function test_PaidMintRewardsWithFinderAndLister(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -707,22 +714,23 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; + address buyer = makeAddr("buyer"); address finder = makeAddr("finder"); - address lister = makeAddr("lister"); + address origin = makeAddr("origin"); - vm.deal(address(456), totalPayment); - vm.prank(address(456)); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(purchaseQuantity, "test comment", finder, lister); + vm.deal(buyer, totalPayment); + vm.prank(buyer); + zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, origin); assertEq(address(zoraNFTBase).balance, totalSales); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); assertEq(zoraRewards.balanceOf(finder), finderReward); - assertEq(zoraRewards.balanceOf(lister), listerReward); + assertEq(zoraRewards.balanceOf(origin), originReward); } function testRevert_PaidMintRewardsInsufficientEth(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -742,13 +750,15 @@ contract ERC721DropTest is Test { uint256 totalSales = uint256(salePrice) * purchaseQuantity; - (uint256 totalReward, uint256 finderReward, uint256 listerReward, uint256 zoraReward) = + (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalPayment = totalSales + totalReward; + address buyer = makeAddr("buyer"); + vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); - zoraNFTBase.purchaseWithRewards(purchaseQuantity, "test comment", address(0), address(0)); + zoraNFTBase.purchaseWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); } function test_UpgradeApproved() public setupZoraNFTBase(10) { From 606197d991060f43db95c08e8fc6423c6a71deff Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 4 Jul 2023 19:01:27 -0400 Subject: [PATCH 22/70] chore: add zora rewards to chain configs --- chainConfigs/5.json | 3 ++- chainConfigs/999.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chainConfigs/5.json b/chainConfigs/5.json index 7daac2a..5f06d56 100644 --- a/chainConfigs/5.json +++ b/chainConfigs/5.json @@ -5,5 +5,6 @@ "MINT_FEE_RECIPIENT": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "SUBSCRIPTION_MARKET_FILTER_OWNER": "0x9AaC739c133074dB445183A95149880a2156541A", - "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f" + "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", + "ZORA_REWARDS": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1" } diff --git a/chainConfigs/999.json b/chainConfigs/999.json index c3a04d0..c096d51 100644 --- a/chainConfigs/999.json +++ b/chainConfigs/999.json @@ -5,5 +5,6 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "SUBSCRIPTION_MARKET_FILTER_OWNER": "0x0000000000000000000000000000000000000000", - "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000" + "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", + "ZORA_REWARDS": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1" } \ No newline at end of file From 80446d847d165553c7264e5ee286bcc748450dfe Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 5 Jul 2023 14:22:18 -0400 Subject: [PATCH 23/70] refactor: change purchase to mint w/ rewards --- src/ERC721Drop.sol | 8 ++++---- test/ERC721Drop.t.sol | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 46a5ece..b71269a 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -484,14 +484,14 @@ contract ERC721Drop is return _handlePurchase(recipient, quantity, comment); } - /// @notice Purchase a quantity of tokens with a comment that will pay out rewards + /// @notice Mint a quantity of tokens with a comment that will pay out rewards /// @param recipient recipient of the tokens /// @param quantity quantity to purchase /// @param comment comment to include in the IERC721Drop.Sale event /// @param finder The finder of the mint /// @param origin The origin of the collection /// @return tokenId of the first token minted - function purchaseWithRewards(address recipient, uint256 quantity, string calldata comment, address finder, address origin) + function mintWithRewards(address recipient, uint256 quantity, string calldata comment, address finder, address origin) external payable nonReentrant @@ -499,10 +499,10 @@ contract ERC721Drop is onlyPublicSaleActive returns (uint256) { - return _handlePurchaseWithRewards(recipient, quantity, comment, finder, origin); + return _handleMintWithRewards(recipient, quantity, comment, finder, origin); } - function _handlePurchaseWithRewards(address recipient, uint256 quantity, string memory comment, address finder, address origin) internal returns (uint256) { + function _handleMintWithRewards(address recipient, uint256 quantity, string memory comment, address finder, address origin) internal returns (uint256) { _mintSupplyRoyalty(quantity); // If max purchase per address == 0 there is no limit. diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index b20261c..e362ab3 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -482,7 +482,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalReward); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), address(0)); + zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), address(0)); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + originReward); @@ -510,7 +510,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalReward); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, address(0)); + zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, address(0)); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + originReward); @@ -539,7 +539,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalReward); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), origin); + zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), origin); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); @@ -569,7 +569,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalReward); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, origin); + zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, origin); assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); @@ -594,7 +594,7 @@ contract ERC721DropTest is Test { address buyer = makeAddr("buyer"); vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); - zoraNFTBase.purchaseWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); + zoraNFTBase.mintWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); } function test_PaidMintRewards(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -623,7 +623,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalPayment); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), address(0)); + zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), address(0)); assertEq(address(zoraNFTBase).balance, totalSales); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + originReward); @@ -656,7 +656,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalPayment); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, address(0)); + zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, address(0)); assertEq(address(zoraNFTBase).balance, totalSales); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + originReward); @@ -690,7 +690,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalPayment); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), origin); + zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), origin); assertEq(address(zoraNFTBase).balance, totalSales); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); @@ -725,7 +725,7 @@ contract ERC721DropTest is Test { vm.deal(buyer, totalPayment); vm.prank(buyer); - zoraNFTBase.purchaseWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, origin); + zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, origin); assertEq(address(zoraNFTBase).balance, totalSales); assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); @@ -758,7 +758,7 @@ contract ERC721DropTest is Test { address buyer = makeAddr("buyer"); vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); - zoraNFTBase.purchaseWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); + zoraNFTBase.mintWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); } function test_UpgradeApproved() public setupZoraNFTBase(10) { From 1d916cb0a4393a01905a17d9de61342bee1b328e Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 19 Jul 2023 17:14:00 -0400 Subject: [PATCH 24/70] refactor: update referral names --- src/ERC721Drop.sol | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index b71269a..eb04370 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -488,10 +488,10 @@ contract ERC721Drop is /// @param recipient recipient of the tokens /// @param quantity quantity to purchase /// @param comment comment to include in the IERC721Drop.Sale event - /// @param finder The finder of the mint - /// @param origin The origin of the collection + /// @param mintReferral The finder of the mint + /// @param createReferral The origin platform of the collection /// @return tokenId of the first token minted - function mintWithRewards(address recipient, uint256 quantity, string calldata comment, address finder, address origin) + function mintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral, address createReferral) external payable nonReentrant @@ -499,10 +499,10 @@ contract ERC721Drop is onlyPublicSaleActive returns (uint256) { - return _handleMintWithRewards(recipient, quantity, comment, finder, origin); + return _handleMintWithRewards(recipient, quantity, comment, mintReferral, createReferral); } - - function _handleMintWithRewards(address recipient, uint256 quantity, string memory comment, address finder, address origin) internal returns (uint256) { + + function _handleMintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral, address createReferral) internal returns (uint256) { _mintSupplyRoyalty(quantity); // If max purchase per address == 0 there is no limit. @@ -517,7 +517,7 @@ contract ERC721Drop is uint256 salePrice = salesConfig.publicSalePrice; - _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, finder, origin); + _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, mintReferral, createReferral); _mintNFTs(recipient, quantity); From c21c8a330e9368e9ebb9b053ffec14392f74577e Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Thu, 27 Jul 2023 21:55:07 -0400 Subject: [PATCH 25/70] chore: add pgn --- foundry.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index 43b582a..b07f1b1 100644 --- a/foundry.toml +++ b/foundry.toml @@ -21,4 +21,6 @@ optimism_goerli = "https://goerli.optimism.io" zora = "https://rpc.zora.energy" zora_goerli = "https://testnet.rpc.zora.energy" base_goerli = "https://goerli.base.org" -base = "https://developer-access-mainnet.base.org" \ No newline at end of file +base = "https://developer-access-mainnet.base.org" +pgn_sepolia = "https://sepolia.publicgoods.network" +pgn = "https://rpc.publicgoods.network" \ No newline at end of file From aff942d915d28ecdc7c704bf509e03f4bcfa968b Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Thu, 27 Jul 2023 22:51:50 -0400 Subject: [PATCH 26/70] chore: add rewards to deploy config --- script/Deploy.s.sol | 2 +- src/DeploymentConfig.sol | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 0f6bf4b..902bf55 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.13; import "forge-std/Script.sol"; import "forge-std/console2.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; import {ERC721Drop} from "../src/ERC721Drop.sol"; import {ERC721DropProxy} from "../src/ERC721DropProxy.sol"; diff --git a/src/DeploymentConfig.sol b/src/DeploymentConfig.sol index d627ee9..567c54c 100644 --- a/src/DeploymentConfig.sol +++ b/src/DeploymentConfig.sol @@ -22,6 +22,8 @@ struct ChainConfig { address subscriptionMarketFilterOwner; /// @notice Auto-approved hyperstructure on mainnet for enabling ZORA v3 with less gas. Deprecated – safe to set to address(0x) address zoraERC721TransferHelper; + /// @notice The Zora Rewards contract + address zoraRewards; } /// @notice Deployment addresses – set to new deployed addresses by the scripts. @@ -62,6 +64,7 @@ abstract contract DeploymentConfig is StdChains, StdCheatsSafe, StdUtils, Script string constant SUBSCRIPTION_MARKET_FILTER_ADDRESS = "SUBSCRIPTION_MARKET_FILTER_ADDRESS"; string constant SUBSCRIPTION_MARKET_FILTER_OWNER = "SUBSCRIPTION_MARKET_FILTER_OWNER"; string constant ZORA_ERC721_TRANSFER_HELPER = "ZORA_ERC721_TRANSFER_HELPER"; + string constant ZORA_REWARDS = "ZORA_REWARDS"; string constant DROP_METADATA_RENDERER = "DROP_METADATA_RENDERER"; string constant EDITION_METADATA_RENDERER = "EDITION_METADATA_RENDERER"; @@ -88,6 +91,7 @@ abstract contract DeploymentConfig is StdChains, StdCheatsSafe, StdUtils, Script chainConfig.subscriptionMarketFilterAddress = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_ADDRESS)); chainConfig.subscriptionMarketFilterOwner = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_OWNER)); chainConfig.zoraERC721TransferHelper = json.readAddress(getKeyPrefix(ZORA_ERC721_TRANSFER_HELPER)); + chainConfig.zoraRewards = json.readAddress(getKeyPrefix(ZORA_REWARDS)); } /// @notice Get the deployment configuration struct from the JSON configuration file From 8b9f79b63f837be037d3fa4194e69de9ee9008d6 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Thu, 27 Jul 2023 22:53:11 -0400 Subject: [PATCH 27/70] chore: update dependencies --- .gitmodules | 3 + package.json | 2 +- remappings.txt | 4 +- yarn.lock | 710 ++++++++++++++++++++++++++----------------------- 4 files changed, 383 insertions(+), 336 deletions(-) diff --git a/.gitmodules b/.gitmodules index f9174b1..259f8cf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,9 @@ [submodule "lib/openzeppelin-contracts-upgradeable"] path = lib/openzeppelin-contracts-upgradeable url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/ +[submodule "lib/openzeppelin-contracts"] + path = lib/openzeppelin-contracts + url = https://github.com/OpenZeppelin/openzeppelin-contracts/ [submodule "lib/ERC721A-Upgradeable"] path = lib/ERC721A-Upgradeable url = https://github.com/chiru-labs/ERC721A-Upgradeable diff --git a/package.json b/package.json index cfbad08..f02a2e2 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/zora-rewards": "^0.1.7", + "@zoralabs/zora-rewards": "^0.1.12", "ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b", "forge-std": "https://github.com/foundry-rs/forge-std#cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653" } diff --git a/remappings.txt b/remappings.txt index 699167d..8a86ffc 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,7 +1,7 @@ @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ -@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/ -@zoralabs/zora-rewards/=node_modules/@zoralabs/zora-rewards/dist/contracts/ +@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ erc721a-upgradeable=lib/ERC721A-Upgradeable/contracts/ base64/=lib/base64/ ds-test/=node_modules/ds-test/src/ forge-std/=node_modules/forge-std/src/ +@zoralabs/zora-rewards/=node_modules/@zoralabs/zora-rewards/ \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a54308a..5b6026c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,9 +29,9 @@ js-tokens "^4.0.0" "@babel/runtime@^7.20.1", "@babel/runtime@^7.5.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.5.tgz#8564dd588182ce0047d55d7a75e93921107b57ec" - integrity sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA== + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.6.tgz#57d64b9ae3cff1d67eb067ae117dac087f5bd438" + integrity sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ== dependencies: regenerator-runtime "^0.13.11" @@ -251,125 +251,125 @@ signale "^1.4.0" tslib "^1" -"@esbuild/android-arm64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.18.tgz#4aa8d8afcffb4458736ca9b32baa97d7cb5861ea" - integrity sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw== +"@esbuild/android-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd" + integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA== "@esbuild/android-arm@0.15.13": version "0.15.13" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.13.tgz#ce11237a13ee76d5eae3908e47ba4ddd380af86a" integrity sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw== -"@esbuild/android-arm@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.18.tgz#74a7e95af4ee212ebc9db9baa87c06a594f2a427" - integrity sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw== - -"@esbuild/android-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.18.tgz#1dcd13f201997c9fe0b204189d3a0da4eb4eb9b6" - integrity sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg== - -"@esbuild/darwin-arm64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.18.tgz#444f3b961d4da7a89eb9bd35cfa4415141537c2a" - integrity sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ== - -"@esbuild/darwin-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.18.tgz#a6da308d0ac8a498c54d62e0b2bfb7119b22d315" - integrity sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A== - -"@esbuild/freebsd-arm64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.18.tgz#b83122bb468889399d0d63475d5aea8d6829c2c2" - integrity sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA== - -"@esbuild/freebsd-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.18.tgz#af59e0e03fcf7f221b34d4c5ab14094862c9c864" - integrity sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew== - -"@esbuild/linux-arm64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.18.tgz#8551d72ba540c5bce4bab274a81c14ed01eafdcf" - integrity sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ== - -"@esbuild/linux-arm@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.18.tgz#e09e76e526df4f665d4d2720d28ff87d15cdf639" - integrity sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg== - -"@esbuild/linux-ia32@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.18.tgz#47878860ce4fe73a36fd8627f5647bcbbef38ba4" - integrity sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ== +"@esbuild/android-arm@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d" + integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A== + +"@esbuild/android-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1" + integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww== + +"@esbuild/darwin-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276" + integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg== + +"@esbuild/darwin-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb" + integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw== + +"@esbuild/freebsd-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2" + integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ== + +"@esbuild/freebsd-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4" + integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ== + +"@esbuild/linux-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb" + integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg== + +"@esbuild/linux-arm@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a" + integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA== + +"@esbuild/linux-ia32@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a" + integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ== "@esbuild/linux-loong64@0.15.13": version "0.15.13" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.13.tgz#64e8825bf0ce769dac94ee39d92ebe6272020dfc" integrity sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag== -"@esbuild/linux-loong64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.18.tgz#3f8fbf5267556fc387d20b2e708ce115de5c967a" - integrity sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ== - -"@esbuild/linux-mips64el@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.18.tgz#9d896d8f3c75f6c226cbeb840127462e37738226" - integrity sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA== - -"@esbuild/linux-ppc64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.18.tgz#3d9deb60b2d32c9985bdc3e3be090d30b7472783" - integrity sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ== - -"@esbuild/linux-riscv64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.18.tgz#8a943cf13fd24ff7ed58aefb940ef178f93386bc" - integrity sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA== - -"@esbuild/linux-s390x@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.18.tgz#66cb01f4a06423e5496facabdce4f7cae7cb80e5" - integrity sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw== - -"@esbuild/linux-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.18.tgz#23c26050c6c5d1359c7b774823adc32b3883b6c9" - integrity sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA== - -"@esbuild/netbsd-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.18.tgz#789a203d3115a52633ff6504f8cbf757f15e703b" - integrity sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg== - -"@esbuild/openbsd-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.18.tgz#d7b998a30878f8da40617a10af423f56f12a5e90" - integrity sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA== - -"@esbuild/sunos-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.18.tgz#ecad0736aa7dae07901ba273db9ef3d3e93df31f" - integrity sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg== - -"@esbuild/win32-arm64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.18.tgz#58dfc177da30acf956252d7c8ae9e54e424887c4" - integrity sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg== - -"@esbuild/win32-ia32@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.18.tgz#340f6163172b5272b5ae60ec12c312485f69232b" - integrity sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw== - -"@esbuild/win32-x64@0.17.18": - version "0.17.18" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.18.tgz#3a8e57153905308db357fd02f57c180ee3a0a1fa" - integrity sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg== +"@esbuild/linux-loong64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72" + integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ== + +"@esbuild/linux-mips64el@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289" + integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A== + +"@esbuild/linux-ppc64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7" + integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg== + +"@esbuild/linux-riscv64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09" + integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA== + +"@esbuild/linux-s390x@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829" + integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q== + +"@esbuild/linux-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4" + integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw== + +"@esbuild/netbsd-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462" + integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q== + +"@esbuild/openbsd-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691" + integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g== + +"@esbuild/sunos-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273" + integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg== + +"@esbuild/win32-arm64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f" + integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag== + +"@esbuild/win32-ia32@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03" + integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw== + +"@esbuild/win32-x64@0.17.19": + version "0.17.19" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061" + integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA== "@ethersproject/abi@^5.7.0": version "5.7.0" @@ -635,11 +635,16 @@ dependencies: "@noble/hashes" "1.3.0" -"@noble/hashes@1.3.0", "@noble/hashes@~1.3.0": +"@noble/hashes@1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== +"@noble/hashes@~1.3.0": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" + integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -662,16 +667,28 @@ fastq "^1.6.0" "@oclif/command@^1", "@oclif/command@^1.8.15": - version "1.8.24" - resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.24.tgz#203ad9e2b2dc2336c0333f100978aada50d53007" - integrity sha512-FbSChfBO2QFeC5eEeXmi8+kZvBCDzYdpEKhOMaz0sfKMerwSlKxsqWQPGWCjTHaowIUMtnMD3VZ8yfX5qE7SAQ== + version "1.8.34" + resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.34.tgz#ed3b7678f1c410d1a6a3cc6a3441b825fb0b4227" + integrity sha512-9JlYRAsPzo3sziCVsZikSCgGm22aVSi9fL3ZbEpkR1yU6xd4R+m5YP75xJ57gnRv9U18aLRUl8iRYwxOuaqvhg== dependencies: "@oclif/config" "^1.18.2" "@oclif/errors" "^1.3.6" "@oclif/help" "^1.0.1" - "@oclif/parser" "^3.8.10" + "@oclif/parser" "^3.8.15" debug "^4.1.1" - semver "^7.5.0" + semver "^7.5.4" + +"@oclif/config@1.18.14": + version "1.18.14" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.14.tgz#b7569b92b0501fd34244c210ccae3ca4eee8a753" + integrity sha512-cLT/deFDm6A69LjAfV5ZZMMvMDlPt7sjMHYBrsOgQ5Upq5kDMgbaZM3hEbw74DmYIsuhq2E2wYrPD+Ax2qAfkA== + dependencies: + "@oclif/errors" "^1.3.6" + "@oclif/parser" "^3.8.14" + debug "^4.3.4" + globby "^11.1.0" + is-wsl "^2.1.1" + tslib "^2.5.0" "@oclif/config@1.18.2": version "1.18.2" @@ -685,25 +702,13 @@ is-wsl "^2.1.1" tslib "^2.0.0" -"@oclif/config@1.18.6": - version "1.18.6" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.6.tgz#37367026b3110a2f04875509b1920a8ee4489f21" - integrity sha512-OWhCpdu4QqggOPX1YPZ4XVmLLRX+lhGjXV6RNA7sogOwLqlEmSslnN/lhR5dkhcWZbKWBQH29YCrB3LDPRu/IA== - dependencies: - "@oclif/errors" "^1.3.6" - "@oclif/parser" "^3.8.9" - debug "^4.3.4" - globby "^11.1.0" - is-wsl "^2.1.1" - tslib "^2.3.1" - "@oclif/config@^1", "@oclif/config@^1.18.2": - version "1.18.8" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.8.tgz#efaccbd0381f90a98fa69c9131e14c5a91fc0659" - integrity sha512-FetS52+emaZQui0roFSdbBP8ddBkIezEoH2NcjLJRjqkMGdE9Z1V+jsISVqTYXk2KJ1gAI0CHDXFjJlNBYbJBg== + version "1.18.15" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.15.tgz#3be95862dda32d759fc61bcadff1e7819915a112" + integrity sha512-eBTiFXGfXSzghc4Yjp3EutYU+6MrHX1kzk4j5i4CsR5AEor43ynXFrzpO6v7IwbR1KyUo+9SYE2D69Y+sHIMpg== dependencies: "@oclif/errors" "^1.3.6" - "@oclif/parser" "^3.8.10" + "@oclif/parser" "^3.8.15" debug "^4.3.4" globby "^11.1.0" is-wsl "^2.1.1" @@ -732,11 +737,11 @@ wrap-ansi "^7.0.0" "@oclif/help@^1.0.1": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@oclif/help/-/help-1.0.5.tgz#0a370d0340fcf167ec3cb7a4f3074ebb3db8a94a" - integrity sha512-77ZXqVXcd+bQ6EafN56KbL4PbNtZM/Lq4GQElekNav+CPIgPNKT3AtMTQrc0fWke6bb/BTLB+1Fu1gWgx643jQ== + version "1.0.13" + resolved "https://registry.yarnpkg.com/@oclif/help/-/help-1.0.13.tgz#7d81538851d8c76809e2d9d147008deb92483e1e" + integrity sha512-/DWgI7umEG3mmTKweKlCJ2a4iS3QIdVYXUltmpFvgfZ6YHPy1DrLRN/l8j9yqawPlPMPn8DfCbINJ9atZ+4Kcw== dependencies: - "@oclif/config" "1.18.6" + "@oclif/config" "1.18.14" "@oclif/errors" "1.3.6" chalk "^4.1.2" indent-string "^4.0.0" @@ -751,15 +756,15 @@ resolved "https://registry.yarnpkg.com/@oclif/linewrap/-/linewrap-1.0.0.tgz#aedcb64b479d4db7be24196384897b5000901d91" integrity sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw== -"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.10", "@oclif/parser@^3.8.9": - version "3.8.10" - resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.10.tgz#7b1048566e1d3f45ed09ca92b2e30f09bd9647e1" - integrity sha512-J4l/NcnfbIU84+NNdy6bxq9yJt4joFWNvpk59hq+uaQPUNtjmNJDVGuRvf6GUOxHNgRsVK1JRmd/Ez+v7Z9GqQ== +"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.14", "@oclif/parser@^3.8.15": + version "3.8.15" + resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.15.tgz#b5581c288543a4a7f59e61cb186109715819b1d0" + integrity sha512-M7ljUexkyJkR2efqG+PL31fAWyWDW1dczaMKoY+sOVqk78sm23iDMOJj/1vkfUrhO+W8dhseoPFnpSB6Hewfyw== dependencies: "@oclif/errors" "^1.3.6" "@oclif/linewrap" "^1.0.0" chalk "^4.1.0" - tslib "^2.5.0" + tslib "^2.6.0" "@oclif/plugin-help@^3": version "3.3.1" @@ -778,11 +783,6 @@ widest-line "^3.1.0" wrap-ansi "^6.2.0" -"@openzeppelin/contracts@^4.9.2": - version "4.9.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1" - integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg== - "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -828,9 +828,9 @@ integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== "@types/node@^20.1.2": - version "20.1.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.2.tgz#8fd63447e3f99aba6c3168fd2ec4580d5b97886f" - integrity sha512-CTO/wa8x+rZU626cL2BlbCDzydgnFNgc19h4YvizpTO88MFQxab8wqisxaofQJ/9bLGugRdWIuX/TbIs6VVF6g== + version "20.4.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.5.tgz#9dc0a5cb1ccce4f7a731660935ab70b9c00a5d69" + integrity sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -842,23 +842,23 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== -"@wagmi/chains@0.2.16": - version "0.2.16" - resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-0.2.16.tgz#a726716e4619ec1c192b312e23f9c38407617aa0" - integrity sha512-rkWaI2PxCnbD8G07ZZff5QXftnSkYL0h5f4DkHCG3fGYYr/ZDvmCL4bMae7j7A9sAif1csPPBmbCzHp3R5ogCQ== +"@wagmi/chains@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-1.3.0.tgz#a17438d44abe98fdf1ec3a91df115c6bfaed39c0" + integrity sha512-7tyr1irTZQpA4/4HoIiJP3XYZuJIZuWiZ1V1j5WEG3cjm8TXIlMEzO0N+hT/cZKw4/UtF2EukvB8GkDWa2S77w== -"@wagmi/chains@0.2.22": - version "0.2.22" - resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-0.2.22.tgz#25e511e134a00742e4fbf5108613dadf876c5bd9" - integrity sha512-TdiOzJT6TO1JrztRNjTA5Quz+UmQlbvWFG8N41u9tta0boHA1JCAzGGvU6KuIcOmJfRJkKOUIt67wlbopCpVHg== +"@wagmi/chains@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-1.6.0.tgz#eb992ad28dbaaab729b5bcab3e5b461e8a035656" + integrity sha512-5FRlVxse5P4ZaHG3GTvxwVANSmYJas1eQrTBHhjxVtqXoorm0aLmCHbhmN8Xo1yu09PaWKlleEvfE98yH4AgIw== "@wagmi/cli@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@wagmi/cli/-/cli-1.0.1.tgz#f705648c71c7b19e028d5a5a1a74c1c15496c9c8" - integrity sha512-SZwT7RglyVDipDTPL/dEKfrAJ3GdSKfdhaF6CFoseIgSiOLkj3xbakvAqdjYSkYnnpjrqLXc3WKZCnszQryctA== + version "1.3.0" + resolved "https://registry.yarnpkg.com/@wagmi/cli/-/cli-1.3.0.tgz#e090e6167cdd36a37adbf0f6d03108e82c539c99" + integrity sha512-/YXmdp0XWgQEwRSVO8IjVB8KY5HK+6+eqJsZI3a+y3XMH4T/NxVBoT/JxTqV6HEivr3HOLgDcTzvQhNy3mZ0HA== dependencies: - "@wagmi/chains" "0.2.22" - abitype "0.8.1" + "@wagmi/chains" "1.3.0" + abitype "0.8.7" abort-controller "^3.0.0" bundle-require "^3.1.2" cac "^6.7.12" @@ -878,25 +878,23 @@ pathe "^1.0.0" picocolors "^1.0.0" prettier "^2.8.1" - viem "~0.3.18" + viem "^1.0.0" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.7": - version "0.1.7" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.7.tgz#02808ab65ac8454a22e933e6fe691db23fb6e008" - integrity sha512-irihibZtg99ihMlWPhuEc0j1s68Gm2Y1uLRyS3sOxm85L1JoaFRlvuDLnFjFvWGvXruOPGbjRymrLPpFOTiHNg== - dependencies: - "@openzeppelin/contracts" "^4.9.2" +"@zoralabs/zora-rewards@^0.1.12": + version "0.1.12" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.12.tgz#848c4c8a62d8e707d00371dfa17fd67a067f4c6d" + integrity sha512-kJfVCNEN6Ap2hzV/RbWJiXG2Co/9m05NWcBBVwVGbRPgyc/rUBri2tprLBsbcAAQN2BZwafpnU/1EgBicyYZaw== -abitype@0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.8.1.tgz#9575a21da88bb4094a262a653e526a088ab06041" - integrity sha512-n8Di6AWb3i7HnEkBvecU6pG0a5nj5YwMvdAIwPLsQK95ulRy/XS113s/RXvSfTX1iOQJYFrEO3/q4SMWu7OwTA== +abitype@0.8.7: + version "0.8.7" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.8.7.tgz#e4b3f051febd08111f486c0cc6a98fa72d033622" + integrity sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w== -abitype@0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.8.2.tgz#cacd330d07488a4020d84f54fc361361234b9c83" - integrity sha512-B1ViNMGpfx/qjVQi0RTc2HEFHuR9uoCoTEkwELT5Y7pBPtBbctYijz9BK6+Kd0hQ3S70FhYTO2dWWk0QNUEXMA== +abitype@0.9.3: + version "0.9.3" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.3.tgz#294d25288ee683d72baf4e1fed757034e3c8c277" + integrity sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w== abort-controller@^3.0.0: version "3.0.0" @@ -982,6 +980,18 @@ array.prototype.flat@^1.2.3: es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" +arraybuffer.prototype.slice@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz#9b5ea3868a6eebc30273da577eb888381c0044bb" + integrity sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -1163,9 +1173,9 @@ chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: supports-color "^7.1.0" chalk@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" - integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== + version "5.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385" + integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== change-case@^4.1.2: version "4.1.2" @@ -1431,9 +1441,9 @@ dotenv@^10.0.0: integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== dotenv@^16.0.3: - version "16.0.3" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" - integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== + version "16.3.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" + integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== dotenv@^9.0.0: version "9.0.2" @@ -1480,11 +1490,12 @@ emoji-regex@^9.2.2: integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== enquirer@^2.3.0: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + version "2.4.0" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.0.tgz#4f36f6c644137cc4fd2891da407ede2b1fea904a" + integrity sha512-ehu97t6FTYK2I3ZYtnp0BZ9vt0mvEL/cnHBds7Ct6jo9VX1VIkiFhOvVRWh6eblQqd7KOoICIQV+syZ3neXO/Q== dependencies: ansi-colors "^4.1.1" + strip-ansi "^6.0.1" error-ex@^1.3.1: version "1.3.2" @@ -1494,17 +1505,18 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.19.0, es-abstract@^1.20.4: - version "1.21.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" - integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== + version "1.22.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.1.tgz#8b4e5fc5cefd7f1660f0f8e1a52900dfbc9d9ccc" + integrity sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw== dependencies: array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.1" available-typed-arrays "^1.0.5" call-bind "^1.0.2" es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.2.0" + get-intrinsic "^1.2.1" get-symbol-description "^1.0.0" globalthis "^1.0.3" gopd "^1.0.1" @@ -1524,14 +1536,18 @@ es-abstract@^1.19.0, es-abstract@^1.20.4: object-inspect "^1.12.3" object-keys "^1.1.1" object.assign "^4.1.4" - regexp.prototype.flags "^1.4.3" + regexp.prototype.flags "^1.5.0" + safe-array-concat "^1.0.0" safe-regex-test "^1.0.0" string.prototype.trim "^1.2.7" string.prototype.trimend "^1.0.6" string.prototype.trimstart "^1.0.6" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" typed-array-length "^1.0.4" unbox-primitive "^1.0.2" - which-typed-array "^1.1.9" + which-typed-array "^1.1.10" es-main@^1.0.2: version "1.2.0" @@ -1692,32 +1708,32 @@ esbuild@0.15.13: esbuild-windows-arm64 "0.15.13" esbuild@^0.17.6: - version "0.17.18" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.18.tgz#f4f8eb6d77384d68cd71c53eb6601c7efe05e746" - integrity sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w== + version "0.17.19" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955" + integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw== optionalDependencies: - "@esbuild/android-arm" "0.17.18" - "@esbuild/android-arm64" "0.17.18" - "@esbuild/android-x64" "0.17.18" - "@esbuild/darwin-arm64" "0.17.18" - "@esbuild/darwin-x64" "0.17.18" - "@esbuild/freebsd-arm64" "0.17.18" - "@esbuild/freebsd-x64" "0.17.18" - "@esbuild/linux-arm" "0.17.18" - "@esbuild/linux-arm64" "0.17.18" - "@esbuild/linux-ia32" "0.17.18" - "@esbuild/linux-loong64" "0.17.18" - "@esbuild/linux-mips64el" "0.17.18" - "@esbuild/linux-ppc64" "0.17.18" - "@esbuild/linux-riscv64" "0.17.18" - "@esbuild/linux-s390x" "0.17.18" - "@esbuild/linux-x64" "0.17.18" - "@esbuild/netbsd-x64" "0.17.18" - "@esbuild/openbsd-x64" "0.17.18" - "@esbuild/sunos-x64" "0.17.18" - "@esbuild/win32-arm64" "0.17.18" - "@esbuild/win32-ia32" "0.17.18" - "@esbuild/win32-x64" "0.17.18" + "@esbuild/android-arm" "0.17.19" + "@esbuild/android-arm64" "0.17.19" + "@esbuild/android-x64" "0.17.19" + "@esbuild/darwin-arm64" "0.17.19" + "@esbuild/darwin-x64" "0.17.19" + "@esbuild/freebsd-arm64" "0.17.19" + "@esbuild/freebsd-x64" "0.17.19" + "@esbuild/linux-arm" "0.17.19" + "@esbuild/linux-arm64" "0.17.19" + "@esbuild/linux-ia32" "0.17.19" + "@esbuild/linux-loong64" "0.17.19" + "@esbuild/linux-mips64el" "0.17.19" + "@esbuild/linux-ppc64" "0.17.19" + "@esbuild/linux-riscv64" "0.17.19" + "@esbuild/linux-s390x" "0.17.19" + "@esbuild/linux-x64" "0.17.19" + "@esbuild/netbsd-x64" "0.17.19" + "@esbuild/openbsd-x64" "0.17.19" + "@esbuild/sunos-x64" "0.17.19" + "@esbuild/win32-arm64" "0.17.19" + "@esbuild/win32-ia32" "0.17.19" + "@esbuild/win32-x64" "0.17.19" escalade@^3.1.1: version "3.1.1" @@ -1788,10 +1804,10 @@ external-editor@^3.1.0: iconv-lite "^0.4.24" tmp "^0.0.33" -fast-glob@^3.2.11, fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== +fast-glob@^3.2.9, fast-glob@^3.3.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" + integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -1821,7 +1837,7 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -filelist@^1.0.1: +filelist@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" integrity sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q== @@ -1967,7 +1983,7 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== @@ -2021,15 +2037,15 @@ glob@7.1.6: path-is-absolute "^1.0.0" glob@^10.2.7: - version "10.2.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.2.7.tgz#9dd2828cd5bc7bd861e7738d91e7113dda41d7d8" - integrity sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA== + version "10.3.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.3.tgz#8360a4ffdd6ed90df84aa8d52f21f452e86a123b" + integrity sha512-92vPiMb/iqpmEgsOoIDvTjc50wf9CCCvMzsi6W0JLPeUKE8TWP1a73PgqSrqy7iAZxaSD1YdzU7QZR5LF51MJw== dependencies: foreground-child "^3.1.0" jackspeak "^2.0.3" minimatch "^9.0.1" - minipass "^5.0.0 || ^6.0.2" - path-scurry "^1.7.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" glob@^7.0.0: version "7.2.3" @@ -2063,13 +2079,13 @@ globby@^11.0.0, globby@^11.0.1, globby@^11.0.3, globby@^11.1.0: slash "^3.0.0" globby@^13.1.3: - version "13.1.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.4.tgz#2f91c116066bcec152465ba36e5caa4a13c01317" - integrity sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g== + version "13.2.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-13.2.2.tgz#63b90b1bf68619c2135475cbd4e71e66aa090592" + integrity sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w== dependencies: dir-glob "^3.0.1" - fast-glob "^3.2.11" - ignore "^5.2.0" + fast-glob "^3.3.0" + ignore "^5.2.4" merge2 "^1.4.1" slash "^4.0.0" @@ -2198,7 +2214,7 @@ ieee754@^1.2.1: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore@^5.2.0: +ignore@^5.2.0, ignore@^5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== @@ -2284,9 +2300,9 @@ is-ci@^3.0.1: ci-info "^3.2.0" is-core-module@^2.11.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" - integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== + version "2.12.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.1.tgz#0c0b6885b6f80011c71541ce15c8d66cf5a4f9fd" + integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg== dependencies: has "^1.0.3" @@ -2393,15 +2409,11 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: has-symbols "^1.0.2" is-typed-array@^1.1.10, is-typed-array@^1.1.9: - version "1.1.10" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" - integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - for-each "^0.3.3" - gopd "^1.0.1" - has-tostringtag "^1.0.0" + which-typed-array "^1.1.11" is-unicode-supported@^1.1.0: version "1.3.0" @@ -2427,6 +2439,11 @@ is-wsl@^2.1.1: dependencies: is-docker "^2.0.0" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2438,23 +2455,23 @@ isomorphic-ws@5.0.0: integrity sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw== jackspeak@^2.0.3: - version "2.2.0" - resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.0.tgz#497cbaedc902ec3f31d5d61be804d2364ff9ddad" - integrity sha512-r5XBrqIJfwRIjRt/Xr5fv9Wh09qyhHfKnYddDlpM+ibRR20qrYActpCAgU6U+d53EOEjzkvxPMVHSlgR7leXrQ== + version "2.2.2" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.2.2.tgz#707c62733924b8dc2a0a629dc6248577788b5385" + integrity sha512-mgNtVv4vUuaKA97yxUHoA3+FkuhtxkjdXEWOyB/N76fjy0FjezEt34oy3epBtvCvS+7DyKwqCFWx/oJLV5+kCg== dependencies: "@isaacs/cliui" "^8.0.2" optionalDependencies: "@pkgjs/parseargs" "^0.11.0" jake@^10.8.5: - version "10.8.5" - resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.5.tgz#f2183d2c59382cb274226034543b9c03b8164c46" - integrity sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw== + version "10.8.7" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.7.tgz#63a32821177940c33f356e0ba44ff9d34e1c7d8f" + integrity sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w== dependencies: async "^3.2.3" chalk "^4.0.2" - filelist "^1.0.1" - minimatch "^3.0.4" + filelist "^1.0.4" + minimatch "^3.1.2" joycon@^3.0.1: version "3.1.1" @@ -2652,10 +2669,10 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lru-cache@^9.1.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.1.1.tgz#c58a93de58630b688de39ad04ef02ef26f1902f1" - integrity sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A== +"lru-cache@^9.1.1 || ^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.0.tgz#b9e2a6a72a129d81ab317202d93c7691df727e61" + integrity sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw== map-obj@^1.0.0: version "1.0.1" @@ -2727,7 +2744,7 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2742,9 +2759,9 @@ minimatch@^5.0.1: brace-expansion "^2.0.1" minimatch@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253" - integrity sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w== + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== dependencies: brace-expansion "^2.0.1" @@ -2757,15 +2774,10 @@ minimist-options@^4.0.2: is-plain-obj "^1.1.0" kind-of "^6.0.3" -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== - -"minipass@^5.0.0 || ^6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-6.0.2.tgz#542844b6c4ce95b202c0995b0a471f1229de4c81" - integrity sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w== +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.0.2" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.2.tgz#58a82b7d81c7010da5bd4b2c0c85ac4b4ec5131e" + integrity sha512-eL79dXrE1q9dBbDCLg7xfn/vl7MS4F1gvJAgjJrQli/jbQWdUttuVawphqpffoIYfRdq78LHx6GP4bU/EQ2ATA== mixme@^0.5.1: version "0.5.9" @@ -2805,9 +2817,9 @@ node-domexception@^1.0.0: integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== node-fetch@^3.3.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.1.tgz#b3eea7b54b3a48020e46f4f88b9c5a7430d20b2e" - integrity sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow== + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" @@ -2894,9 +2906,9 @@ onetime@^6.0.0: mimic-fn "^4.0.0" ora@^6.1.2: - version "6.3.0" - resolved "https://registry.yarnpkg.com/ora/-/ora-6.3.0.tgz#a314600999f514a989a0904f5c17c8b7c1f7c878" - integrity sha512-1/D8uRFY0ay2kgBpmAwmSA404w4OoPVhHMqRqtjvrcK/dnzcEZxMJ+V4DUbyICu8IIVRclHcOf5wlD1tMY4GUQ== + version "6.3.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-6.3.1.tgz#a4e9e5c2cf5ee73c259e8b410273e706a2ad3ed6" + integrity sha512-ERAyNnZOfqM+Ao3RAvIXkYh5joP220yf59gVe2X/cI6SiCxIdi4c9HZKZD8R6q/RDXEje1THBju6iExiSsgJaQ== dependencies: chalk "^5.0.0" cli-cursor "^4.0.0" @@ -3073,13 +3085,13 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-scurry@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.8.0.tgz#809e09690c63817c76d0183f19a5b21b530ff7d2" - integrity sha512-IjTrKseM404/UAWA8bBbL3Qp6O2wXkanuIE3seCxBH7ctRuvH1QRawy1N3nVDHGkdeZsjOsSe/8AQBL/VQCy2g== +path-scurry@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== dependencies: - lru-cache "^9.1.1" - minipass "^5.0.0" + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-type@^4.0.0: version "4.0.0" @@ -3087,9 +3099,9 @@ path-type@^4.0.0: integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== pathe@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.0.tgz#e2e13f6c62b31a3289af4ba19886c230f295ec03" - integrity sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w== + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.1.tgz#1dd31d382b974ba69809adc9a7a347e65d84829a" + integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q== picocolors@^1.0.0: version "1.0.0" @@ -3112,9 +3124,9 @@ pify@^4.0.1: integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== pirates@^4.0.1: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + version "4.0.6" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== pkg-conf@^2.1.0: version "2.1.0" @@ -3247,7 +3259,7 @@ regenerator-runtime@^0.13.11: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regexp.prototype.flags@^1.4.3: +regexp.prototype.flags@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== @@ -3294,9 +3306,9 @@ reusify@^1.0.4: integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== rollup@^3.2.5: - version "3.21.6" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.21.6.tgz#f5649ccdf8fcc7729254faa457cbea9547eb86db" - integrity sha512-SXIICxvxQxR3D4dp/3LDHZIJPC8a4anKMHd4E3Jiz2/JnY+2bEjqrOokAauc5ShGVNFHlEFjBXAXlaxkJqIqSg== + version "3.26.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.26.3.tgz#bbc8818cadd0aebca348dbb3d68d296d220967b8" + integrity sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ== optionalDependencies: fsevents "~2.3.2" @@ -3307,6 +3319,16 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +safe-array-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" + integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -3327,21 +3349,14 @@ safe-regex-test@^1.0.0: integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== "semver@2 || 3 || 4 || 5": - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@^7.5.0: - version "7.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" - integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== - dependencies: - lru-cache "^6.0.0" + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@^7.5.3: - version "7.5.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== +semver@^7.5.3, semver@^7.5.4: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" @@ -3412,9 +3427,9 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== signal-exit@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.1.tgz#96a61033896120ec9335d96851d902cc98f0ba2a" - integrity sha512-uUWsN4aOxJAS8KOuf3QMyFtgm1pkb6I+KRZbRF/ghdf5T7sM+B1lLLzPDxswUjkmHyxQAVzEgG35E3NzDM9GVw== + version "4.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" + integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== signale@^1.4.0: version "1.4.0" @@ -3580,9 +3595,9 @@ string_decoder@^1.1.1: ansi-regex "^5.0.1" strip-ansi@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" - integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== dependencies: ansi-regex "^6.0.1" @@ -3609,9 +3624,9 @@ strip-indent@^3.0.0: min-indent "^1.0.0" sucrase@^3.20.3: - version "3.32.0" - resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.32.0.tgz#c4a95e0f1e18b6847127258a75cf360bc568d4a7" - integrity sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ== + version "3.34.0" + resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.34.0.tgz#1e0e2d8fcf07f8b9c3569067d92fbd8690fb576f" + integrity sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw== dependencies: "@jridgewell/gen-mapping" "^0.3.2" commander "^4.0.0" @@ -3700,10 +3715,10 @@ tslib@^1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.3.1, tslib@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== +tslib@^2.0.0, tslib@^2.0.3, tslib@^2.5.0, tslib@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" + integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== tsup@^6.7.0: version "6.7.0" @@ -3753,6 +3768,36 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" @@ -3763,9 +3808,9 @@ typed-array-length@^1.0.4: is-typed-array "^1.1.9" typescript@^5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== + version "5.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" + integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== unbox-primitive@^1.0.2: version "1.0.2" @@ -3814,18 +3859,18 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -viem@~0.3.18: - version "0.3.19" - resolved "https://registry.yarnpkg.com/viem/-/viem-0.3.19.tgz#71b88e9de66ce070f3096709d3558de46380b692" - integrity sha512-7OlSgiB7e+OFz9OqTOZ/Mpx8GAAVKCxsaPDJRuR8QtixlruUHPfHBHOemkX+O/Drn6B7l04iCUZjCvSB8OtVKg== +viem@^1.0.0: + version "1.4.2" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.4.2.tgz#81aaff0d8ee0d39bb2994ffa6c89bf7ee4fbcde6" + integrity sha512-125E7HoOr5PrL+Iwt8853dQexwRoiPpLwPsrRvlDX94su2xoe7AYqrdfR6N9nmy6vd6mt8eQy8+LWiP3A+1dqw== dependencies: "@adraffy/ens-normalize" "1.9.0" "@noble/curves" "1.0.0" "@noble/hashes" "1.3.0" "@scure/bip32" "1.3.0" "@scure/bip39" "1.2.0" - "@wagmi/chains" "0.2.16" - abitype "0.8.2" + "@wagmi/chains" "1.6.0" + abitype "0.9.3" isomorphic-ws "5.0.0" ws "8.12.0" @@ -3879,17 +3924,16 @@ which-pm@2.0.0: load-yaml-file "^0.2.0" path-exists "^4.0.0" -which-typed-array@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" - integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== +which-typed-array@^1.1.10, which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" for-each "^0.3.3" gopd "^1.0.1" has-tostringtag "^1.0.0" - is-typed-array "^1.1.10" which@^1.2.9: version "1.3.1" From f3a9c01ae86f65b21aae3ac37cac86a4d8e31a42 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Thu, 27 Jul 2023 23:52:19 -0400 Subject: [PATCH 28/70] refactor: set create referral on initialization --- src/ERC721Drop.sol | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index eb04370..97da720 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -24,7 +24,7 @@ import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/se import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {MathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; -import {ERC721Rewards} from "@zoralabs/zora-rewards/ERC721/ERC721Rewards.sol"; +import {ERC721Rewards} from "@zoralabs/zora-rewards/dist/contracts/ERC721/ERC721Rewards.sol"; import {IMetadataRenderer} from "./interfaces/IMetadataRenderer.sol"; import {IOperatorFilterRegistry} from "./interfaces/IOperatorFilterRegistry.sol"; @@ -203,6 +203,7 @@ contract ERC721Drop is /// @param _setupCalls Bytes-encoded list of setup multicalls /// @param _metadataRenderer Renderer contract to use /// @param _metadataRendererInit Renderer data initial contract + /// @param _createReferral The platform where the collection was created function initialize( string memory _contractName, string memory _contractSymbol, @@ -212,7 +213,8 @@ contract ERC721Drop is uint16 _royaltyBPS, bytes[] calldata _setupCalls, IMetadataRenderer _metadataRenderer, - bytes memory _metadataRendererInit + bytes memory _metadataRendererInit, + address _createReferral ) public initializer { // Setup ERC721A __ERC721A_init(_contractName, _contractSymbol); @@ -243,6 +245,11 @@ contract ERC721Drop is config.metadataRenderer = _metadataRenderer; config.royaltyBPS = _royaltyBPS; config.fundsRecipient = _fundsRecipient; + + if (_createReferral != address(0)) { + _setCreateReferral(_createReferral); + } + _metadataRenderer.initializeWithData(_metadataRendererInit); } @@ -489,20 +496,19 @@ contract ERC721Drop is /// @param quantity quantity to purchase /// @param comment comment to include in the IERC721Drop.Sale event /// @param mintReferral The finder of the mint - /// @param createReferral The origin platform of the collection /// @return tokenId of the first token minted - function mintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral, address createReferral) + function mintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral) external payable nonReentrant canMintTokens(quantity) onlyPublicSaleActive - returns (uint256) + returns (uint256) { - return _handleMintWithRewards(recipient, quantity, comment, mintReferral, createReferral); + return _handleMintWithRewards(recipient, quantity, comment, mintReferral); } - function _handleMintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral, address createReferral) internal returns (uint256) { + function _handleMintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral) internal returns (uint256) { _mintSupplyRoyalty(quantity); // If max purchase per address == 0 there is no limit. @@ -517,7 +523,7 @@ contract ERC721Drop is uint256 salePrice = salesConfig.publicSalePrice; - _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, mintReferral, createReferral); + _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, mintReferral); _mintNFTs(recipient, quantity); From 630c4c377cc0ac0f2aef49d2d6055c789486de92 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 00:19:20 -0400 Subject: [PATCH 29/70] refactor: add create referral to factory --- src/ZoraNFTCreatorV1.sol | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/ZoraNFTCreatorV1.sol b/src/ZoraNFTCreatorV1.sol index 0aa9013..af90675 100644 --- a/src/ZoraNFTCreatorV1.sol +++ b/src/ZoraNFTCreatorV1.sol @@ -85,7 +85,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad address payable fundsRecipient, bytes[] memory setupCalls, IMetadataRenderer metadataRenderer, - bytes memory metadataInitializer + bytes memory metadataInitializer, + address createReferral ) public returns (address payable newDropAddress) { ERC721DropProxy newDrop = new ERC721DropProxy(implementation, ""); @@ -99,7 +100,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad _royaltyBPS: royaltyBPS, _setupCalls: setupCalls, _metadataRenderer: metadataRenderer, - _metadataRendererInit: metadataInitializer + _metadataRendererInit: metadataInitializer, + _createReferral: createReferral }); } @@ -152,7 +154,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad address payable fundsRecipient, IERC721Drop.SalesConfiguration memory saleConfig, IMetadataRenderer metadataRenderer, - bytes memory metadataInitializer + bytes memory metadataInitializer, + address createReferral ) public returns (address) { bytes[] memory setupData = new bytes[](1); setupData[0] = abi.encodeWithSelector( @@ -174,7 +177,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad royaltyBPS: royaltyBPS, setupCalls: setupData, metadataRenderer: metadataRenderer, - metadataInitializer: metadataInitializer + metadataInitializer: metadataInitializer, + createReferral: createReferral }); emit CreatedDrop({ @@ -236,7 +240,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad address payable fundsRecipient, IERC721Drop.SalesConfiguration memory saleConfig, string memory metadataURIBase, - string memory metadataContractURI + string memory metadataContractURI, + address createReferral ) external returns (address) { bytes memory metadataInitializer = abi.encode( metadataURIBase, @@ -252,7 +257,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad fundsRecipient: fundsRecipient, saleConfig: saleConfig, metadataRenderer: dropMetadataRenderer, - metadataInitializer: metadataInitializer + metadataInitializer: metadataInitializer, + createReferral: createReferral }); } @@ -309,7 +315,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad IERC721Drop.SalesConfiguration memory saleConfig, string memory description, string memory animationURI, - string memory imageURI + string memory imageURI, + address createReferral ) external returns (address) { bytes memory metadataInitializer = abi.encode( description, @@ -327,7 +334,8 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad saleConfig: saleConfig, fundsRecipient: fundsRecipient, metadataRenderer: editionMetadataRenderer, - metadataInitializer: metadataInitializer + metadataInitializer: metadataInitializer, + createReferral: createReferral }); } } From 517fea96e3761ddd1544aaa44b1af30d2085bd75 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 00:21:41 -0400 Subject: [PATCH 30/70] chore: update scripts w/ default create referral --- script/TestUpgradeAndMint.s.sol | 8 ++++++-- script/ZoraDropsDeployBase.sol | 2 +- src/DeploymentConfig.sol | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/script/TestUpgradeAndMint.s.sol b/script/TestUpgradeAndMint.s.sol index 8000657..ce08b4c 100644 --- a/script/TestUpgradeAndMint.s.sol +++ b/script/TestUpgradeAndMint.s.sol @@ -22,6 +22,8 @@ import {ERC721DropProxy} from "../src/ERC721DropProxy.sol"; contract DeployNewERC721Drop is Script { using Strings for uint256; + address internal DEFAULT_CREATE_REFERRAL = address(0); + string configFile; function _getKey(string memory key) internal returns (address result) { @@ -67,7 +69,8 @@ contract DeployNewERC721Drop is Script { }), "desc", "animation", - "image" + "image", + DEFAULT_CREATE_REFERRAL ))); drop.adminMint(sender, 4); @@ -116,7 +119,8 @@ contract DeployNewERC721Drop is Script { }), "desc", "animation", - "image" + "image", + DEFAULT_CREATE_REFERRAL ))); assert(drop2.balanceOf(sender) == 0); diff --git a/script/ZoraDropsDeployBase.sol b/script/ZoraDropsDeployBase.sol index 1b4e9ff..a8ab64c 100644 --- a/script/ZoraDropsDeployBase.sol +++ b/script/ZoraDropsDeployBase.sol @@ -31,7 +31,7 @@ abstract contract ZoraDropsDeployBase is ScriptDeploymentConfig { function deployTestContractForVerification(ZoraNFTCreatorV1 factory) internal { IERC721Drop.SalesConfiguration memory saleConfig; address newContract = address( - factory.createEdition(unicode"☾*☽", "~", 0, 0, payable(address(0)), address(0), saleConfig, "", DEMO_IPFS_METADATA_FILE, DEMO_IPFS_METADATA_FILE) + factory.createEdition(unicode"☾*☽", "~", 0, 0, payable(address(0)), address(0), saleConfig, "", DEMO_IPFS_METADATA_FILE, DEMO_IPFS_METADATA_FILE, DEFAULT_CREATE_REFERRAL) ); console2.log("Deployed new contract for verification purposes", newContract); } diff --git a/src/DeploymentConfig.sol b/src/DeploymentConfig.sol index 567c54c..886361b 100644 --- a/src/DeploymentConfig.sol +++ b/src/DeploymentConfig.sol @@ -53,6 +53,8 @@ abstract contract DeploymentConfig is StdChains, StdCheatsSafe, StdUtils, Script /// @notice File used for demo metadata on verification test mint string constant DEMO_IPFS_METADATA_FILE = "ipfs://bafkreigu544g6wjvqcysurpzy5pcskbt45a5f33m6wgythpgb3rfqi3lzi"; + address constant DEFAULT_CREATE_REFERRAL = address(0); + /// // These are the JSON key constants to standardize writing and reading configuration /// From 115fc5435ef737f6a264a20b77c8f72d272ba3d7 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 00:21:52 -0400 Subject: [PATCH 31/70] chore: update tests --- test/ERC721Drop.t.sol | 770 ++++++++++++------------------- test/ZoraNFTCreatorV1.t.sol | 14 +- test/ZoraNFTCreatorV1_Fork.t.sol | 3 +- test/merkle/MerkleDrop.t.sol | 11 +- 4 files changed, 320 insertions(+), 478 deletions(-) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index e362ab3..33f9fb8 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; import {ERC721Drop} from "../src/ERC721Drop.sol"; import {DummyMetadataRenderer} from "./utils/DummyMetadataRenderer.sol"; @@ -34,30 +34,27 @@ contract ERC721DropTest is Test { ); event Sale( - address indexed to, - uint256 indexed quantity, - uint256 indexed pricePerToken, - uint256 firstPurchasedTokenId + address indexed to, uint256 indexed purchaseQuantity, uint256 indexed pricePerToken, uint256 firstPurchasedTokenId ); event MintComment( - address indexed sender, - address indexed tokenContract, - uint256 indexed tokenId, - uint256 quantity, - string comment + address indexed sender, address indexed tokenContract, uint256 indexed tokenId, uint256 purchaseQuantity, string comment ); + address internal creator; + address internal collector; + address internal mintReferral; + address internal createReferral; + address internal zora; + ZoraRewards zoraRewards; ERC721Drop zoraNFTBase; MockUser mockUser; DummyMetadataRenderer public dummyRenderer = new DummyMetadataRenderer(); FactoryUpgradeGate public factoryUpgradeGate; address public constant DEFAULT_OWNER_ADDRESS = address(0x23499); - address payable public constant DEFAULT_FUNDS_RECIPIENT_ADDRESS = - payable(address(0x21303)); - address payable public constant DEFAULT_ZORA_DAO_ADDRESS = - payable(address(0x999)); + address payable public constant DEFAULT_FUNDS_RECIPIENT_ADDRESS = payable(address(0x21303)); + address payable public constant DEFAULT_ZORA_DAO_ADDRESS = payable(address(0x999)); address public constant UPGRADE_GATE_ADMIN_ADDRESS = address(0x942924224); address public constant mediaContract = address(0x123456); address public impl; @@ -65,6 +62,7 @@ contract ERC721DropTest is Test { address payable public constant mintFeeRecipient = payable(address(0x11)); uint256 public constant mintFee = 777000000000000; // 0.000777 ETH uint256 public constant TOTAL_REWARD_PER_MINT = 0.000999 ether; + address internal constant DEFAULT_CREATE_REFERRAL = address(0); struct Configuration { IMetadataRenderer metadataRenderer; @@ -84,24 +82,26 @@ contract ERC721DropTest is Test { _royaltyBPS: 800, _setupCalls: setupCalls, _metadataRenderer: dummyRenderer, - _metadataRendererInit: "" + _metadataRendererInit: "", + _createReferral: DEFAULT_CREATE_REFERRAL }); _; } function setUp() public { - zoraRewards = new ZoraRewards("Zora Rewards", "ZEWARDS"); + creator = makeAddr("creator"); + collector = makeAddr("collector"); + mintReferral = makeAddr("mintReferral"); + createReferral = makeAddr("createReferral"); + zora = makeAddr("zora"); + + zoraRewards = new ZoraRewards(); vm.prank(DEFAULT_ZORA_DAO_ADDRESS); factoryUpgradeGate = new FactoryUpgradeGate(UPGRADE_GATE_ADMIN_ADDRESS); - vm.etch( - address(0x000000000000AAeB6D7670E522A718067333cd4E), - address(new OperatorFilterRegistry()).code - ); - ownedSubscriptionManager = address( - new OwnedSubscriptionManager(address(0x123456)) - ); + vm.etch(address(0x000000000000AAeB6D7670E522A718067333cd4E), address(new OperatorFilterRegistry()).code); + ownedSubscriptionManager = address(new OwnedSubscriptionManager(address(0x123456))); vm.prank(DEFAULT_ZORA_DAO_ADDRESS); impl = address( @@ -114,9 +114,7 @@ contract ERC721DropTest is Test { address(zoraRewards) ) ); - address payable newDrop = payable( - address(new ERC721DropProxy(impl, "")) - ); + address payable newDrop = payable(address(new ERC721DropProxy(impl, ""))); zoraNFTBase = ERC721Drop(newDrop); } @@ -132,34 +130,22 @@ contract ERC721DropTest is Test { address(zoraRewards) ) ); - address payable newDrop = payable( - address(new ERC721DropProxy(impl, "")) - ); + address payable newDrop = payable(address(new ERC721DropProxy(impl, ""))); zoraNFTBase = ERC721Drop(newDrop); _; } function test_Init() public setupZoraNFTBase(10) { - require( - zoraNFTBase.owner() == DEFAULT_OWNER_ADDRESS, - "Default owner set wrong" - ); + require(zoraNFTBase.owner() == DEFAULT_OWNER_ADDRESS, "Default owner set wrong"); - ( - IMetadataRenderer renderer, - uint64 editionSize, - uint16 royaltyBPS, - address payable fundsRecipient - ) = zoraNFTBase.config(); + (IMetadataRenderer renderer, uint64 editionSize, uint16 royaltyBPS, address payable fundsRecipient) = + zoraNFTBase.config(); require(address(renderer) == address(dummyRenderer)); require(editionSize == 10, "EditionSize is wrong"); require(royaltyBPS == 800, "RoyaltyBPS is wrong"); - require( - fundsRecipient == payable(DEFAULT_FUNDS_RECIPIENT_ADDRESS), - "FundsRecipient is wrong" - ); + require(fundsRecipient == payable(DEFAULT_FUNDS_RECIPIENT_ADDRESS), "FundsRecipient is wrong"); string memory name = zoraNFTBase.name(); string memory symbol = zoraNFTBase.symbol(); @@ -177,7 +163,8 @@ contract ERC721DropTest is Test { _royaltyBPS: 800, _setupCalls: setupCalls, _metadataRenderer: dummyRenderer, - _metadataRendererInit: "" + _metadataRendererInit: "", + _createReferral: DEFAULT_CREATE_REFERRAL }); } @@ -211,15 +198,10 @@ contract ERC721DropTest is Test { factoryWithSubscriptionAddress(ownedSubscriptionManager) setupZoraNFTBase(10) { - IOperatorFilterRegistry operatorFilterRegistry = IOperatorFilterRegistry( - 0x000000000000AAeB6D7670E522A718067333cd4E - ); + IOperatorFilterRegistry operatorFilterRegistry = + IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); vm.startPrank(address(0x123456)); - operatorFilterRegistry.updateOperator( - ownedSubscriptionManager, - address(0xcafeea3), - true - ); + operatorFilterRegistry.updateOperator(ownedSubscriptionManager, address(0xcafeea3), true); vm.stopPrank(); vm.startPrank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.manageMarketFilterDAOSubscription(true); @@ -228,10 +210,7 @@ contract ERC721DropTest is Test { vm.stopPrank(); vm.prank(address(0xcafeea3)); vm.expectRevert( - abi.encodeWithSelector( - OperatorFilterRegistryErrorsAndEvents.AddressFiltered.selector, - address(0xcafeea3) - ) + abi.encodeWithSelector(OperatorFilterRegistryErrorsAndEvents.AddressFiltered.selector, address(0xcafeea3)) ); zoraNFTBase.transferFrom(DEFAULT_OWNER_ADDRESS, address(0x123456), 1); vm.prank(DEFAULT_OWNER_ADDRESS); @@ -256,10 +235,7 @@ contract ERC721DropTest is Test { factoryWithSubscriptionAddress(ownedSubscriptionManager) setupZoraNFTBase(10) { - bytes memory baseCall = abi.encodeWithSelector( - IOperatorFilterRegistry.register.selector, - address(zoraNFTBase) - ); + bytes memory baseCall = abi.encodeWithSelector(IOperatorFilterRegistry.register.selector, address(zoraNFTBase)); vm.startPrank(address(0xcafecafe)); vm.expectRevert(IERC721Drop.Access_OnlyAdmin.selector); zoraNFTBase.updateMarketFilterSettings(baseCall); @@ -272,41 +248,26 @@ contract ERC721DropTest is Test { setupZoraNFTBase(10) { vm.startPrank(address(DEFAULT_OWNER_ADDRESS)); - bytes memory baseCall = abi.encodeWithSelector( - IOperatorFilterRegistry.register.selector, - address(zoraNFTBase) - ); + bytes memory baseCall = abi.encodeWithSelector(IOperatorFilterRegistry.register.selector, address(zoraNFTBase)); zoraNFTBase.updateMarketFilterSettings(baseCall); vm.stopPrank(); } function test_RoyaltyInfo() public setupZoraNFTBase(10) { // assert 800 royaltyAmount or 8% - (address recipient, uint256 royaltyAmount) = zoraNFTBase.royaltyInfo( - 10, - 1 ether - ); + ( , uint256 royaltyAmount) = zoraNFTBase.royaltyInfo(10, 1 ether); assertEq(royaltyAmount, 0.08 ether); } - function test_NoRoyaltyInfoNoFundsRecipientAddress() - public - setupZoraNFTBase(10) - { + function test_NoRoyaltyInfoNoFundsRecipientAddress() public setupZoraNFTBase(10) { vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.setFundsRecipient(payable(address(0))); // assert 800 royaltyAmount or 8% - (address recipient, uint256 royaltyAmount) = zoraNFTBase.royaltyInfo( - 10, - 1 ether - ); + ( , uint256 royaltyAmount) = zoraNFTBase.royaltyInfo(10, 1 ether); assertEq(royaltyAmount, 0 ether); } - function test_Purchase( - uint64 salePrice, - uint32 purchaseQuantity - ) public setupZoraNFTBase(purchaseQuantity) { + function test_Purchase(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.setSaleConfiguration({ @@ -324,28 +285,20 @@ contract ERC721DropTest is Test { vm.deal(address(456), paymentAmount); vm.prank(address(456)); vm.expectEmit(true, true, true, true); - emit Sale( - address(456), - purchaseQuantity, - salePrice, - 0 - ); + emit Sale(address(456), purchaseQuantity, salePrice, 0); zoraNFTBase.purchase{value: paymentAmount}(purchaseQuantity); assertEq(zoraNFTBase.saleDetails().maxSupply, purchaseQuantity); assertEq(zoraNFTBase.saleDetails().totalMinted, purchaseQuantity); - require( - zoraNFTBase.ownerOf(1) == address(456), - "owner is wrong for new minted token" - ); + require(zoraNFTBase.ownerOf(1) == address(456), "owner is wrong for new minted token"); assertEq(address(zoraNFTBase).balance, paymentAmount - zoraFee); assertEq(mintFeeRecipient.balance, zoraFee); } - function test_PurchaseWithComment( - uint64 salePrice, - uint32 purchaseQuantity - ) public setupZoraNFTBase(purchaseQuantity) { + function test_PurchaseWithComment(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.setSaleConfiguration({ @@ -363,17 +316,14 @@ contract ERC721DropTest is Test { vm.deal(address(456), paymentAmount); vm.prank(address(456)); vm.expectEmit(true, true, true, true); - emit MintComment( - address(456), - address(zoraNFTBase), - 0, - purchaseQuantity, - "test comment" - ); + emit MintComment(address(456), address(zoraNFTBase), 0, purchaseQuantity, "test comment"); zoraNFTBase.purchaseWithComment{value: paymentAmount}(purchaseQuantity, "test comment"); } - function test_PurchaseWithRecipient(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function test_PurchaseWithRecipient(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.setSaleConfiguration({ @@ -396,12 +346,15 @@ contract ERC721DropTest is Test { vm.prank(minter); zoraNFTBase.purchaseWithRecipient{value: paymentAmount}(recipient, purchaseQuantity, ""); - for (uint256 i; i < purchaseQuantity; ) { + for (uint256 i; i < purchaseQuantity;) { assertEq(zoraNFTBase.ownerOf(++i), recipient); } } - function test_PurchaseWithRecipientAndComment(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function test_PurchaseWithRecipientAndComment(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.setSaleConfiguration({ @@ -423,18 +376,15 @@ contract ERC721DropTest is Test { vm.deal(minter, paymentAmount); vm.expectEmit(true, true, true, true); - emit MintComment( - minter, - address(zoraNFTBase), - 0, - purchaseQuantity, - "test comment" - ); + emit MintComment(minter, address(zoraNFTBase), 0, purchaseQuantity, "test comment"); vm.prank(minter); zoraNFTBase.purchaseWithRecipient{value: paymentAmount}(recipient, purchaseQuantity, "test comment"); } - function testRevert_PurchaseWithInvalidRecipient(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function testRevert_PurchaseWithInvalidRecipient(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.setSaleConfiguration({ @@ -450,7 +400,6 @@ contract ERC721DropTest is Test { (, uint256 zoraFee) = zoraNFTBase.zoraFeeForAmount(purchaseQuantity); uint256 paymentAmount = uint256(salePrice) * purchaseQuantity + zoraFee; - address minter = makeAddr("minter"); address recipient = address(0); @@ -459,7 +408,7 @@ contract ERC721DropTest is Test { vm.expectRevert(abi.encodeWithSignature("MintToZeroAddress()")); vm.prank(minter); zoraNFTBase.purchaseWithRecipient{value: paymentAmount}(recipient, purchaseQuantity, ""); - } + } function test_FreeMintRewards(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); @@ -475,20 +424,25 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = - zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - address buyer = makeAddr("buyer"); - - vm.deal(buyer, totalReward); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), address(0)); - - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + originReward); + ( + uint256 creatorReward, + uint256 mintReferralReward, + uint256 createReferralReward, + uint256 firstMinterReward, + uint256 zoraReward + ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + + vm.deal(collector, totalReward); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); + + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); } - function test_FreeMintRewardsWithFinder(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function test_FreeMintRewardsWithMintReferral(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); vm.prank(DEFAULT_OWNER_ADDRESS); @@ -502,82 +456,102 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = - zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - address buyer = makeAddr("buyer"); - address finder = makeAddr("finder"); - - vm.deal(buyer, totalReward); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, address(0)); - - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + originReward); - assertEq(zoraRewards.balanceOf(finder), finderReward); + ( + uint256 creatorReward, + uint256 mintReferralReward, + uint256 createReferralReward, + uint256 firstMinterReward, + uint256 zoraReward + ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + + vm.deal(collector, totalReward); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); + + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); + assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); } - function test_FreeMintRewardsWithLister(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { - vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - - vm.prank(DEFAULT_OWNER_ADDRESS); - zoraNFTBase.setSaleConfiguration({ - publicSaleStart: 0, - publicSaleEnd: type(uint64).max, - presaleStart: 0, - presaleEnd: 0, - publicSalePrice: 0, - maxSalePurchasePerAddress: purchaseQuantity + 1, - presaleMerkleRoot: bytes32(0) - }); - - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = - zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + // function test_FreeMintRewardsWithCreateReferral(uint32 purchaseQuantity) + // public + // setupZoraNFTBase(purchaseQuantity) + // { + // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + // vm.prank(DEFAULT_OWNER_ADDRESS); + // zoraNFTBase.setSaleConfiguration({ + // publicSaleStart: 0, + // publicSaleEnd: type(uint64).max, + // presaleStart: 0, + // presaleEnd: 0, + // publicSalePrice: 0, + // maxSalePurchasePerAddress: purchaseQuantity + 1, + // presaleMerkleRoot: bytes32(0) + // }); - address buyer = makeAddr("buyer"); - address origin = makeAddr("origin"); + // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - vm.deal(buyer, totalReward); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", address(0), origin); + // ( + // uint256 creatorReward, + // uint256 mintReferralReward, + // uint256 createReferralReward, + // uint256 firstMinterReward, + // uint256 zoraReward + // ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); - assertEq(zoraRewards.balanceOf(origin), originReward); - } + // vm.deal(collector, totalReward); + // vm.prank(collector); + // zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); - function test_FreeMintRewardsWithFinderAndLister(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { - vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + // assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); + // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + // } - vm.prank(DEFAULT_OWNER_ADDRESS); - zoraNFTBase.setSaleConfiguration({ - publicSaleStart: 0, - publicSaleEnd: type(uint64).max, - presaleStart: 0, - presaleEnd: 0, - publicSalePrice: 0, - maxSalePurchasePerAddress: purchaseQuantity + 1, - presaleMerkleRoot: bytes32(0) - }); + // function test_FreeMintRewardsWithmintReferralAndLister(uint32 purchaseQuantity) + // public + // setupZoraNFTBase(purchaseQuantity) + // { + // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + // vm.prank(DEFAULT_OWNER_ADDRESS); + // zoraNFTBase.setSaleConfiguration({ + // publicSaleStart: 0, + // publicSaleEnd: type(uint64).max, + // presaleStart: 0, + // presaleEnd: 0, + // publicSalePrice: 0, + // maxSalePurchasePerAddress: purchaseQuantity + 1, + // presaleMerkleRoot: bytes32(0) + // }); - (uint256 totalReward, uint256 creatorReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = - zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - address buyer = makeAddr("buyer"); - address finder = makeAddr("finder"); - address origin = makeAddr("origin"); + // ( + // uint256 creatorReward, + // uint256 mintReferralReward, + // uint256 createReferralReward, + // uint256 firstMinterReward, + // uint256 zoraReward + // ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); - vm.deal(buyer, totalReward); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalReward}(buyer, purchaseQuantity, "test comment", finder, origin); + // vm.deal(collector, totalReward); + // vm.prank(collector); + // zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); - assertEq(zoraRewards.balanceOf(finder), finderReward); - assertEq(zoraRewards.balanceOf(origin), originReward); - } + // assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); + // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); + // assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); + // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + // } - function testRevert_FreeMintRewardsInsufficientEth(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function testRevert_FreeMintRewardsInsufficientEth(uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); vm.prank(DEFAULT_OWNER_ADDRESS); @@ -591,13 +565,14 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - address buyer = makeAddr("buyer"); - - vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); - zoraNFTBase.mintWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); + vm.expectRevert(abi.encodeWithSignature("INVALID_ETH_AMOUNT()")); + zoraNFTBase.mintWithRewards(collector, purchaseQuantity, "test comment", address(0)); } - function test_PaidMintRewards(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function test_PaidMintRewards(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(salePrice > 0); vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); @@ -612,24 +587,26 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - uint256 totalSales = uint256(salePrice) * purchaseQuantity; - - (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = + (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + uint256 totalSales = uint256(salePrice) * purchaseQuantity; uint256 totalPayment = totalSales + totalReward; - address buyer = makeAddr("buyer"); - - vm.deal(buyer, totalPayment); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), address(0)); + vm.deal(collector, totalPayment); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward + originReward); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); } - function test_PaidMintRewardsWithFinder(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function test_PaidMintRewardsWithMintReferral(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(salePrice > 0); vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); @@ -644,96 +621,95 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - uint256 totalSales = uint256(salePrice) * purchaseQuantity; - - (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = + (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = zoraNFTBase.computePaidMintRewards(purchaseQuantity); - + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + uint256 totalSales = uint256(salePrice) * purchaseQuantity; uint256 totalPayment = totalSales + totalReward; - address buyer = makeAddr("buyer"); - address finder = makeAddr("finder"); - - vm.deal(buyer, totalPayment); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, address(0)); + vm.deal(collector, totalPayment); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + originReward); - assertEq(zoraRewards.balanceOf(finder), finderReward); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); + assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); } - function test_PaidMintRewardsWithLister(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { - vm.assume(salePrice > 0); - vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - - vm.prank(DEFAULT_OWNER_ADDRESS); - zoraNFTBase.setSaleConfiguration({ - publicSaleStart: 0, - publicSaleEnd: type(uint64).max, - presaleStart: 0, - presaleEnd: 0, - publicSalePrice: salePrice, - maxSalePurchasePerAddress: purchaseQuantity + 1, - presaleMerkleRoot: bytes32(0) - }); - - uint256 totalSales = uint256(salePrice) * purchaseQuantity; - - (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = - zoraNFTBase.computePaidMintRewards(purchaseQuantity); - - uint256 totalPayment = totalSales + totalReward; - - address buyer = makeAddr("buyer"); - address origin = makeAddr("origin"); + // function test_PaidMintRewardsWithLister(uint64 salePrice, uint32 purchaseQuantity) + // public + // setupZoraNFTBase(purchaseQuantity) + // { + // vm.assume(salePrice > 0); + // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + // vm.prank(DEFAULT_OWNER_ADDRESS); + // zoraNFTBase.setSaleConfiguration({ + // publicSaleStart: 0, + // publicSaleEnd: type(uint64).max, + // presaleStart: 0, + // presaleEnd: 0, + // publicSalePrice: salePrice, + // maxSalePurchasePerAddress: purchaseQuantity + 1, + // presaleMerkleRoot: bytes32(0) + // }); - vm.deal(buyer, totalPayment); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", address(0), origin); + // (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = + // zoraNFTBase.computePaidMintRewards(purchaseQuantity); - assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + finderReward); - assertEq(zoraRewards.balanceOf(origin), originReward); - } + // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + // uint256 totalSales = uint256(salePrice) * purchaseQuantity; + // uint256 totalPayment = totalSales + totalReward; - function test_PaidMintRewardsWithFinderAndLister(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { - vm.assume(salePrice > 0); - vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + // vm.deal(collector, totalPayment); + // vm.prank(collector); + // zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); - vm.prank(DEFAULT_OWNER_ADDRESS); - zoraNFTBase.setSaleConfiguration({ - publicSaleStart: 0, - publicSaleEnd: type(uint64).max, - presaleStart: 0, - presaleEnd: 0, - publicSalePrice: salePrice, - maxSalePurchasePerAddress: purchaseQuantity + 1, - presaleMerkleRoot: bytes32(0) - }); + // assertEq(address(zoraNFTBase).balance, totalSales); + // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); + // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + // } - uint256 totalSales = uint256(salePrice) * purchaseQuantity; + // function test_PaidMintRewardsWithmintReferralAndLister(uint64 salePrice, uint32 purchaseQuantity) + // public + // setupZoraNFTBase(purchaseQuantity) + // { + // vm.assume(salePrice > 0); + // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); + + // vm.prank(DEFAULT_OWNER_ADDRESS); + // zoraNFTBase.setSaleConfiguration({ + // publicSaleStart: 0, + // publicSaleEnd: type(uint64).max, + // presaleStart: 0, + // presaleEnd: 0, + // publicSalePrice: salePrice, + // maxSalePurchasePerAddress: purchaseQuantity + 1, + // presaleMerkleRoot: bytes32(0) + // }); - (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = - zoraNFTBase.computePaidMintRewards(purchaseQuantity); - - uint256 totalPayment = totalSales + totalReward; + // (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = + // zoraNFTBase.computePaidMintRewards(purchaseQuantity); - address buyer = makeAddr("buyer"); - address finder = makeAddr("finder"); - address origin = makeAddr("origin"); + // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + // uint256 totalSales = uint256(salePrice) * purchaseQuantity; + // uint256 totalPayment = totalSales + totalReward; - vm.deal(buyer, totalPayment); - vm.prank(buyer); - zoraNFTBase.mintWithRewards{value: totalPayment}(buyer, purchaseQuantity, "test comment", finder, origin); + // vm.deal(collector, totalPayment); + // vm.prank(collector); + // zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); - assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); - assertEq(zoraRewards.balanceOf(finder), finderReward); - assertEq(zoraRewards.balanceOf(origin), originReward); - } + // assertEq(address(zoraNFTBase).balance, totalSales); + // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); + // assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); + // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + // } - function testRevert_PaidMintRewardsInsufficientEth(uint64 salePrice, uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { + function testRevert_PaidMintRewardsInsufficientEth(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBase(purchaseQuantity) + { vm.assume(salePrice > 0); vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); @@ -748,17 +724,8 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - uint256 totalSales = uint256(salePrice) * purchaseQuantity; - - (uint256 totalReward, uint256 finderReward, uint256 originReward, uint256 zoraReward) = - zoraNFTBase.computePaidMintRewards(purchaseQuantity); - - uint256 totalPayment = totalSales + totalReward; - - address buyer = makeAddr("buyer"); - - vm.expectRevert(abi.encodeWithSignature("INSUFFICIENT_ETH_FOR_REWARDS()")); - zoraNFTBase.mintWithRewards(buyer, purchaseQuantity, "test comment", address(0), address(0)); + vm.expectRevert(abi.encodeWithSignature("INVALID_ETH_AMOUNT()")); + zoraNFTBase.mintWithRewards(collector, purchaseQuantity, "test comment", address(0)); } function test_UpgradeApproved() public setupZoraNFTBase(10) { @@ -776,10 +743,7 @@ contract ERC721DropTest is Test { address[] memory lastImpls = new address[](1); lastImpls[0] = impl; vm.prank(UPGRADE_GATE_ADMIN_ADDRESS); - factoryUpgradeGate.registerNewUpgradePath({ - _newImpl: newImpl, - _supportedPrevImpls: lastImpls - }); + factoryUpgradeGate.registerNewUpgradePath({_newImpl: newImpl, _supportedPrevImpls: lastImpls}); vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.upgradeTo(newImpl); } @@ -797,12 +761,7 @@ contract ERC721DropTest is Test { ); vm.prank(DEFAULT_OWNER_ADDRESS); - vm.expectRevert( - abi.encodeWithSelector( - IERC721Drop.Admin_InvalidUpgradeAddress.selector, - newImpl - ) - ); + vm.expectRevert(abi.encodeWithSelector(IERC721Drop.Admin_InvalidUpgradeAddress.selector, newImpl)); zoraNFTBase.upgradeTo(newImpl); } @@ -859,10 +818,7 @@ contract ERC721DropTest is Test { zoraNFTBase.adminMint(DEFAULT_OWNER_ADDRESS, 1); assertEq(zoraNFTBase.saleDetails().maxSupply, 10); assertEq(zoraNFTBase.saleDetails().totalMinted, 1); - require( - zoraNFTBase.ownerOf(1) == DEFAULT_OWNER_ADDRESS, - "Owner is wrong for new minted token" - ); + require(zoraNFTBase.ownerOf(1) == DEFAULT_OWNER_ADDRESS, "Owner is wrong for new minted token"); } function test_MulticallAccessControl() public setupZoraNFTBase(10) { @@ -877,25 +833,14 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - address notAdmin = address(0x444); bytes[] memory calls = new bytes[](2); - calls[0] = abi.encodeWithSelector( - IERC721Drop.adminMint.selector, - address(0x456), - 1 - ); - calls[1] = abi.encodeWithSelector( - IERC721Drop.adminMint.selector, - address(0x123), - 3 - ); + calls[0] = abi.encodeWithSelector(IERC721Drop.adminMint.selector, address(0x456), 1); + calls[1] = abi.encodeWithSelector(IERC721Drop.adminMint.selector, address(0x123), 3); vm.expectRevert( abi.encodeWithSelector( IERC721Drop.Access_MissingRoleOrAdmin.selector, - bytes32( - 0xf0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9 - ) + bytes32(0xf0887ba65ee2024ea881d91b74c2450ef19e1557f03bed3ea9f16b037cbe2dc9) ) ); zoraNFTBase.multicall(calls); @@ -912,47 +857,14 @@ contract ERC721DropTest is Test { function test_MintMulticall() public setupZoraNFTBase(10) { vm.startPrank(DEFAULT_OWNER_ADDRESS); bytes[] memory calls = new bytes[](3); - calls[0] = abi.encodeWithSelector( - IERC721Drop.adminMint.selector, - DEFAULT_OWNER_ADDRESS, - 5 - ); - calls[1] = abi.encodeWithSelector( - IERC721Drop.adminMint.selector, - address(0x123), - 3 - ); + calls[0] = abi.encodeWithSelector(IERC721Drop.adminMint.selector, DEFAULT_OWNER_ADDRESS, 5); + calls[1] = abi.encodeWithSelector(IERC721Drop.adminMint.selector, address(0x123), 3); calls[2] = abi.encodeWithSelector(IERC721Drop.saleDetails.selector); bytes[] memory results = zoraNFTBase.multicall(calls); - ( - bool saleActive, - bool presaleActive, - uint256 publicSalePrice, - , - , - , - , - , - , - , - - ) = abi.decode( - results[2], - ( - bool, - bool, - uint256, - uint64, - uint64, - uint64, - uint64, - bytes32, - uint256, - uint256, - uint256 - ) - ); + (bool saleActive, bool presaleActive, uint256 publicSalePrice,,,,,,,,) = abi.decode( + results[2], (bool, bool, uint256, uint64, uint64, uint64, uint64, bytes32, uint256, uint256, uint256) + ); assertTrue(!saleActive); assertTrue(!presaleActive); assertEq(publicSalePrice, 0); @@ -966,25 +878,10 @@ contract ERC721DropTest is Test { vm.startPrank(DEFAULT_OWNER_ADDRESS); bytes[] memory calls = new bytes[](3); calls[0] = abi.encodeWithSelector( - IERC721Drop.setSaleConfiguration.selector, - 0.1 ether, - 2, - 0, - type(uint64).max, - 0, - 0, - bytes32(0) - ); - calls[1] = abi.encodeWithSelector( - IERC721Drop.adminMint.selector, - address(0x123), - 3 - ); - calls[2] = abi.encodeWithSelector( - IERC721Drop.adminMint.selector, - address(0x123), - 3 + IERC721Drop.setSaleConfiguration.selector, 0.1 ether, 2, 0, type(uint64).max, 0, 0, bytes32(0) ); + calls[1] = abi.encodeWithSelector(IERC721Drop.adminMint.selector, address(0x123), 3); + calls[2] = abi.encodeWithSelector(IERC721Drop.adminMint.selector, address(0x123), 3); bytes[] memory results = zoraNFTBase.multicall(calls); IERC721Drop.SaleDetails memory saleDetails = zoraNFTBase.saleDetails(); @@ -1021,12 +918,7 @@ contract ERC721DropTest is Test { }); (, uint256 fee) = zoraNFTBase.zoraFeeForAmount(1); vm.prank(address(456)); - vm.expectRevert( - abi.encodeWithSelector( - IERC721Drop.Purchase_WrongPrice.selector, - 0.15 ether + fee - ) - ); + vm.expectRevert(abi.encodeWithSelector(IERC721Drop.Purchase_WrongPrice.selector, 0.15 ether + fee)); zoraNFTBase.purchase{value: 0.12 ether}(1); } @@ -1038,20 +930,14 @@ contract ERC721DropTest is Test { vm.prank(DEFAULT_OWNER_ADDRESS); vm.expectEmit(true, true, true, true); emit FundsWithdrawn( - DEFAULT_OWNER_ADDRESS, - DEFAULT_FUNDS_RECIPIENT_ADDRESS, - leftoverFunds, - payable(address(0)), - 0 + DEFAULT_OWNER_ADDRESS, DEFAULT_FUNDS_RECIPIENT_ADDRESS, leftoverFunds, payable(address(0)), 0 ); zoraNFTBase.withdraw(); assertEq(DEFAULT_FUNDS_RECIPIENT_ADDRESS.balance, amount); } - function test_WithdrawNoZoraFee( - uint128 amount - ) public setupZoraNFTBase(10) { + function test_WithdrawNoZoraFee(uint128 amount) public setupZoraNFTBase(10) { vm.assume(amount > 0.01 ether); address payable fundsRecipientTarget = payable(address(0x0)); @@ -1062,13 +948,7 @@ contract ERC721DropTest is Test { vm.deal(address(zoraNFTBase), amount); vm.prank(DEFAULT_OWNER_ADDRESS); vm.expectEmit(true, true, true, true); - emit FundsWithdrawn( - DEFAULT_OWNER_ADDRESS, - fundsRecipientTarget, - amount, - payable(address(0)), - 0 - ); + emit FundsWithdrawn(DEFAULT_OWNER_ADDRESS, fundsRecipientTarget, amount, payable(address(0)), 0); zoraNFTBase.withdraw(); assertTrue(fundsRecipientTarget.balance == uint256(amount)); @@ -1090,9 +970,7 @@ contract ERC721DropTest is Test { (, uint256 limitFee) = zoraNFTBase.zoraFeeForAmount(limit); vm.deal(address(456), 100_000_000 ether); vm.prank(address(456)); - zoraNFTBase.purchase{value: 0.1 ether * uint256(limit) + limitFee}( - limit - ); + zoraNFTBase.purchase{value: 0.1 ether * uint256(limit) + limitFee}(limit); assertEq(zoraNFTBase.saleDetails().totalMinted, limit); @@ -1100,10 +978,9 @@ contract ERC721DropTest is Test { vm.deal(address(444), 1_000_000 ether); vm.prank(address(444)); vm.expectRevert(IERC721Drop.Purchase_TooManyForAddress.selector); - zoraNFTBase.purchase{ - value: (0.1 ether * (uint256(limit) + 1)) + - (fee * (uint256(limit) + 1)) - }(uint256(limit) + 1); + zoraNFTBase.purchase{value: (0.1 ether * (uint256(limit) + 1)) + (fee * (uint256(limit) + 1))}( + uint256(limit) + 1 + ); assertEq(zoraNFTBase.saleDetails().totalMinted, limit); } @@ -1120,15 +997,12 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (, , , , , uint64 presaleEndLookup, ) = zoraNFTBase.salesConfig(); + (,,,,, uint64 presaleEndLookup,) = zoraNFTBase.salesConfig(); assertEq(presaleEndLookup, 100); address SALES_MANAGER_ADDR = address(0x11002); vm.startPrank(DEFAULT_OWNER_ADDRESS); - zoraNFTBase.grantRole( - zoraNFTBase.SALES_MANAGER_ROLE(), - SALES_MANAGER_ADDR - ); + zoraNFTBase.grantRole(zoraNFTBase.SALES_MANAGER_ROLE(), SALES_MANAGER_ADDR); vm.stopPrank(); vm.prank(SALES_MANAGER_ADDR); zoraNFTBase.setSaleConfiguration({ @@ -1141,22 +1015,12 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - ( - , - , - , - , - uint64 presaleStartLookup2, - uint64 presaleEndLookup2, - - ) = zoraNFTBase.salesConfig(); + (,,,, uint64 presaleStartLookup2, uint64 presaleEndLookup2,) = zoraNFTBase.salesConfig(); assertEq(presaleEndLookup2, 0); assertEq(presaleStartLookup2, 100); } - function test_GlobalLimit( - uint16 limit - ) public setupZoraNFTBase(uint64(limit)) { + function test_GlobalLimit(uint16 limit) public setupZoraNFTBase(uint64(limit)) { vm.assume(limit > 0); vm.startPrank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.adminMint(DEFAULT_OWNER_ADDRESS, limit); @@ -1185,16 +1049,11 @@ contract ERC721DropTest is Test { vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.adminMint(address(0x1234), 2); vm.prank(DEFAULT_OWNER_ADDRESS); - vm.expectRevert( - IERC721Drop.Admin_UnableToFinalizeNotOpenEdition.selector - ); + vm.expectRevert(IERC721Drop.Admin_UnableToFinalizeNotOpenEdition.selector); zoraNFTBase.finalizeOpenEdition(); } - function test_ValidFinalizeOpenEdition() - public - setupZoraNFTBase(type(uint64).max) - { + function test_ValidFinalizeOpenEdition() public setupZoraNFTBase(type(uint64).max) { vm.prank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.setSaleConfiguration({ publicSaleStart: 0, @@ -1222,10 +1081,7 @@ contract ERC721DropTest is Test { address minter = address(0x32402); vm.startPrank(DEFAULT_OWNER_ADDRESS); zoraNFTBase.adminMint(DEFAULT_OWNER_ADDRESS, 1); - require( - zoraNFTBase.balanceOf(DEFAULT_OWNER_ADDRESS) == 1, - "Wrong balance" - ); + require(zoraNFTBase.balanceOf(DEFAULT_OWNER_ADDRESS) == 1, "Wrong balance"); zoraNFTBase.grantRole(zoraNFTBase.MINTER_ROLE(), minter); vm.stopPrank(); vm.prank(minter); @@ -1286,12 +1142,7 @@ contract ERC721DropTest is Test { toMint[2] = address(0x12); toMint[3] = address(0x13); bytes32 minterRole = zoraNFTBase.MINTER_ROLE(); - vm.expectRevert( - abi.encodeWithSignature( - "Access_MissingRoleOrAdmin(bytes32)", - minterRole - ) - ); + vm.expectRevert(abi.encodeWithSignature("Access_MissingRoleOrAdmin(bytes32)", minterRole)); zoraNFTBase.adminMintAirdrop(toMint); } @@ -1306,9 +1157,7 @@ contract ERC721DropTest is Test { function test_AdminMintBatchFails() public setupZoraNFTBase(1000) { vm.startPrank(address(0x10)); bytes32 role = zoraNFTBase.MINTER_ROLE(); - vm.expectRevert( - abi.encodeWithSignature("Access_MissingRoleOrAdmin(bytes32)", role) - ); + vm.expectRevert(abi.encodeWithSignature("Access_MissingRoleOrAdmin(bytes32)", role)); zoraNFTBase.adminMint(address(0x10), 100); } @@ -1337,39 +1186,24 @@ contract ERC721DropTest is Test { vm.stopPrank(); vm.prank(address(1)); - vm.expectRevert( - IERC721AUpgradeable.TransferCallerNotOwnerNorApproved.selector - ); + vm.expectRevert(IERC721AUpgradeable.TransferCallerNotOwnerNorApproved.selector); zoraNFTBase.burn(1); } - function test_AdminMetadataRendererUpdateCall() - public - setupZoraNFTBase(10) - { + function test_AdminMetadataRendererUpdateCall() public setupZoraNFTBase(10) { vm.startPrank(DEFAULT_OWNER_ADDRESS); assertEq(dummyRenderer.someState(), ""); zoraNFTBase.callMetadataRenderer( - abi.encodeWithSelector( - DummyMetadataRenderer.updateSomeState.selector, - "new state", - address(zoraNFTBase) - ) + abi.encodeWithSelector(DummyMetadataRenderer.updateSomeState.selector, "new state", address(zoraNFTBase)) ); assertEq(dummyRenderer.someState(), "new state"); } - function test_NonAdminMetadataRendererUpdateCall() - public - setupZoraNFTBase(10) - { + function test_NonAdminMetadataRendererUpdateCall() public setupZoraNFTBase(10) { vm.startPrank(address(0x99493)); assertEq(dummyRenderer.someState(), ""); - bytes memory targetCall = abi.encodeWithSelector( - DummyMetadataRenderer.updateSomeState.selector, - "new state", - address(zoraNFTBase) - ); + bytes memory targetCall = + abi.encodeWithSelector(DummyMetadataRenderer.updateSomeState.selector, "new state", address(zoraNFTBase)); vm.expectRevert(IERC721Drop.Access_OnlyAdmin.selector); zoraNFTBase.callMetadataRenderer(targetCall); assertEq(dummyRenderer.someState(), ""); @@ -1381,13 +1215,19 @@ contract ERC721DropTest is Test { zoraNFTBase.updateRoyaltyMintSchedule(1); } - function test_SupplyRoyaltyPurchase(uint32 royaltyMintSchedule, uint32 editionSize, uint256 mintQuantity) public setupZoraNFTBase(editionSize) { - vm.assume(royaltyMintSchedule > 1 && royaltyMintSchedule <= editionSize && editionSize <= 100000 && mintQuantity > 0 && mintQuantity <= editionSize); + function test_SupplyRoyaltyPurchase(uint32 royaltyMintSchedule, uint32 editionSize, uint256 mintQuantity) + public + setupZoraNFTBase(editionSize) + { + vm.assume( + royaltyMintSchedule > 1 && royaltyMintSchedule <= editionSize && editionSize <= 100000 && mintQuantity > 0 + && mintQuantity <= editionSize + ); uint256 totalRoyaltyMintsForSale = editionSize / royaltyMintSchedule; vm.assume(mintQuantity <= editionSize - totalRoyaltyMintsForSale); vm.startPrank(DEFAULT_OWNER_ADDRESS); - + zoraNFTBase.updateRoyaltyMintSchedule(royaltyMintSchedule); zoraNFTBase.setSaleConfiguration({ @@ -1516,15 +1356,9 @@ contract ERC721DropTest is Test { function test_EIP165() public view { require(zoraNFTBase.supportsInterface(0x01ffc9a7), "supports 165"); require(zoraNFTBase.supportsInterface(0x80ac58cd), "supports 721"); - require( - zoraNFTBase.supportsInterface(0x5b5e139f), - "supports 721-metdata" - ); + require(zoraNFTBase.supportsInterface(0x5b5e139f), "supports 721-metdata"); require(zoraNFTBase.supportsInterface(0x2a55205a), "supports 2981"); require(zoraNFTBase.supportsInterface(0x49064906), "supports 4906"); - require( - !zoraNFTBase.supportsInterface(0x0000000), - "doesnt allow non-interface" - ); + require(!zoraNFTBase.supportsInterface(0x0000000), "doesnt allow non-interface"); } } diff --git a/test/ZoraNFTCreatorV1.t.sol b/test/ZoraNFTCreatorV1.t.sol index 6de36b9..4931eb6 100644 --- a/test/ZoraNFTCreatorV1.t.sol +++ b/test/ZoraNFTCreatorV1.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; import {IMetadataRenderer} from "../src/interfaces/IMetadataRenderer.sol"; import "../src/ZoraNFTCreatorV1.sol"; @@ -27,9 +27,10 @@ contract ZoraNFTCreatorV1Test is Test { EditionMetadataRenderer public editionMetadataRenderer; DropMetadataRenderer public dropMetadataRenderer; ZoraRewards internal zoraRewards; + address internal constant DEFAULT_CREATE_REFERRAL = address(0); function setUp() public { - zoraRewards = new ZoraRewards("Zora Rewards", "ZEWARDS"); + zoraRewards = new ZoraRewards(); vm.prank(DEFAULT_ZORA_DAO_ADDRESS); dropImpl = new ERC721Drop( @@ -84,7 +85,8 @@ contract ZoraNFTCreatorV1Test is Test { }), "desc", "animation", - "image" + "image", + DEFAULT_CREATE_REFERRAL ); ERC721Drop drop = ERC721Drop(payable(deployedEdition)); (, uint256 fee) = drop.zoraFeeForAmount(10); @@ -112,7 +114,8 @@ contract ZoraNFTCreatorV1Test is Test { presaleMerkleRoot: bytes32(0) }), "metadata_uri", - "metadata_contract_uri" + "metadata_contract_uri", + DEFAULT_CREATE_REFERRAL ); ERC721Drop drop = ERC721Drop(payable(deployedDrop)); (, uint256 fee) = drop.zoraFeeForAmount(10); @@ -139,7 +142,8 @@ contract ZoraNFTCreatorV1Test is Test { presaleMerkleRoot: bytes32(0) }), mockRenderer, - "" + "", + DEFAULT_CREATE_REFERRAL ); ERC721Drop drop = ERC721Drop(payable(deployedDrop)); ERC721Drop.SaleDetails memory saleDetails = drop.saleDetails(); diff --git a/test/ZoraNFTCreatorV1_Fork.t.sol b/test/ZoraNFTCreatorV1_Fork.t.sol index 8af9fcc..9bccbae 100644 --- a/test/ZoraNFTCreatorV1_Fork.t.sol +++ b/test/ZoraNFTCreatorV1_Fork.t.sol @@ -56,7 +56,8 @@ contract ZoraNFTCreatorV1_ForkTests is Test, ForkHelper { }), "desc", "animation", - "image" + "image", + DEFAULT_CREATE_REFERRAL ); ERC721Drop drop = ERC721Drop(payable(deployedEdition)); (, uint256 fee) = drop.zoraFeeForAmount(10); diff --git a/test/merkle/MerkleDrop.t.sol b/test/merkle/MerkleDrop.t.sol index 197af4d..0d6dc77 100644 --- a/test/merkle/MerkleDrop.t.sol +++ b/test/merkle/MerkleDrop.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/ZoraRewards.sol"; +import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; import {IERC721Drop} from "../../src/interfaces/IERC721Drop.sol"; import {ERC721Drop} from "../../src/ERC721Drop.sol"; @@ -24,6 +24,7 @@ contract ZoraNFTBaseTest is Test { address public constant mediaContract = address(0x123456); address payable public constant mintFeeRecipient = payable(address(0x1234)); uint256 public constant mintFee = 0.000777 ether; + address internal constant DEFAULT_CREATE_REFERRAL = address(0); modifier setupZoraNFTBase() { bytes[] memory setupCalls = new bytes[](0); @@ -36,14 +37,15 @@ contract ZoraNFTBaseTest is Test { _royaltyBPS: 800, _setupCalls: setupCalls, _metadataRenderer: dummyRenderer, - _metadataRendererInit: "" + _metadataRendererInit: "", + _createReferral: DEFAULT_CREATE_REFERRAL }); _; } function setUp() public { - zoraRewards = new ZoraRewards("Zora Rewards", "ZEWARDS"); + zoraRewards = new ZoraRewards(); vm.prank(DEFAULT_ZORA_DAO_ADDRESS); address impl = address( @@ -269,7 +271,8 @@ contract ZoraNFTBaseTest is Test { _royaltyBPS: 800, _setupCalls: setupCalls, _metadataRenderer: dummyRenderer, - _metadataRendererInit: "" + _metadataRendererInit: "", + _createReferral: DEFAULT_CREATE_REFERRAL }); vm.startPrank(DEFAULT_OWNER_ADDRESS); From c8876f3e2ac386500fe894a12117c2ac45564a27 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 00:34:57 -0400 Subject: [PATCH 32/70] chore: update create referral tests --- test/ERC721Drop.t.sol | 264 +++++++++++++++++++++++------------------- 1 file changed, 142 insertions(+), 122 deletions(-) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index 33f9fb8..a0f2fc8 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -89,6 +89,24 @@ contract ERC721DropTest is Test { _; } + modifier setupZoraNFTBaseWithCreateReferral(uint64 editionSize, address initCreateReferral) { + bytes[] memory setupCalls = new bytes[](0); + zoraNFTBase.initialize({ + _contractName: "Test NFT", + _contractSymbol: "TNFT", + _initialOwner: DEFAULT_OWNER_ADDRESS, + _fundsRecipient: payable(DEFAULT_FUNDS_RECIPIENT_ADDRESS), + _editionSize: editionSize, + _royaltyBPS: 800, + _setupCalls: setupCalls, + _metadataRenderer: dummyRenderer, + _metadataRendererInit: "", + _createReferral: initCreateReferral + }); + + _; + } + function setUp() public { creator = makeAddr("creator"); collector = makeAddr("collector"); @@ -475,78 +493,78 @@ contract ERC721DropTest is Test { assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); } - // function test_FreeMintRewardsWithCreateReferral(uint32 purchaseQuantity) - // public - // setupZoraNFTBase(purchaseQuantity) - // { - // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - - // vm.prank(DEFAULT_OWNER_ADDRESS); - // zoraNFTBase.setSaleConfiguration({ - // publicSaleStart: 0, - // publicSaleEnd: type(uint64).max, - // presaleStart: 0, - // presaleEnd: 0, - // publicSalePrice: 0, - // maxSalePurchasePerAddress: purchaseQuantity + 1, - // presaleMerkleRoot: bytes32(0) - // }); + function test_FreeMintRewardsWithCreateReferral(uint32 purchaseQuantity) + public + setupZoraNFTBaseWithCreateReferral(purchaseQuantity, createReferral) + { + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); - // ( - // uint256 creatorReward, - // uint256 mintReferralReward, - // uint256 createReferralReward, - // uint256 firstMinterReward, - // uint256 zoraReward - // ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - // vm.deal(collector, totalReward); - // vm.prank(collector); - // zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); + ( + uint256 creatorReward, + uint256 mintReferralReward, + uint256 createReferralReward, + uint256 firstMinterReward, + uint256 zoraReward + ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); - // assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); - // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); - // } + vm.deal(collector, totalReward); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); - // function test_FreeMintRewardsWithmintReferralAndLister(uint32 purchaseQuantity) - // public - // setupZoraNFTBase(purchaseQuantity) - // { - // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - - // vm.prank(DEFAULT_OWNER_ADDRESS); - // zoraNFTBase.setSaleConfiguration({ - // publicSaleStart: 0, - // publicSaleEnd: type(uint64).max, - // presaleStart: 0, - // presaleEnd: 0, - // publicSalePrice: 0, - // maxSalePurchasePerAddress: purchaseQuantity + 1, - // presaleMerkleRoot: bytes32(0) - // }); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); + assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + } - // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + function test_FreeMintRewardsWithMintAndCreateReferrals(uint32 purchaseQuantity) + public + setupZoraNFTBaseWithCreateReferral(purchaseQuantity, createReferral) + { + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - // ( - // uint256 creatorReward, - // uint256 mintReferralReward, - // uint256 createReferralReward, - // uint256 firstMinterReward, - // uint256 zoraReward - // ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); - // vm.deal(collector, totalReward); - // vm.prank(collector); - // zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - // assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward); - // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); - // assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); - // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); - // } + ( + uint256 creatorReward, + uint256 mintReferralReward, + uint256 createReferralReward, + uint256 firstMinterReward, + uint256 zoraReward + ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + + vm.deal(collector, totalReward); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); + + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); + assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + } function testRevert_FreeMintRewardsInsufficientEth(uint32 purchaseQuantity) public @@ -637,74 +655,76 @@ contract ERC721DropTest is Test { assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); } - // function test_PaidMintRewardsWithLister(uint64 salePrice, uint32 purchaseQuantity) - // public - // setupZoraNFTBase(purchaseQuantity) - // { - // vm.assume(salePrice > 0); - // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - - // vm.prank(DEFAULT_OWNER_ADDRESS); - // zoraNFTBase.setSaleConfiguration({ - // publicSaleStart: 0, - // publicSaleEnd: type(uint64).max, - // presaleStart: 0, - // presaleEnd: 0, - // publicSalePrice: salePrice, - // maxSalePurchasePerAddress: purchaseQuantity + 1, - // presaleMerkleRoot: bytes32(0) - // }); + function test_PaidMintRewardsWithCreateReferral(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBaseWithCreateReferral(purchaseQuantity, createReferral) + { + vm.assume(salePrice > 0); + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - // (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = - // zoraNFTBase.computePaidMintRewards(purchaseQuantity); + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: salePrice, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); - // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - // uint256 totalSales = uint256(salePrice) * purchaseQuantity; - // uint256 totalPayment = totalSales + totalReward; + (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = + zoraNFTBase.computePaidMintRewards(purchaseQuantity); - // vm.deal(collector, totalPayment); - // vm.prank(collector); - // zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + uint256 totalSales = uint256(salePrice) * purchaseQuantity; + uint256 totalPayment = totalSales + totalReward; - // assertEq(address(zoraNFTBase).balance, totalSales); - // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); - // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); - // } + vm.deal(collector, totalPayment); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); - // function test_PaidMintRewardsWithmintReferralAndLister(uint64 salePrice, uint32 purchaseQuantity) - // public - // setupZoraNFTBase(purchaseQuantity) - // { - // vm.assume(salePrice > 0); - // vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - - // vm.prank(DEFAULT_OWNER_ADDRESS); - // zoraNFTBase.setSaleConfiguration({ - // publicSaleStart: 0, - // publicSaleEnd: type(uint64).max, - // presaleStart: 0, - // presaleEnd: 0, - // publicSalePrice: salePrice, - // maxSalePurchasePerAddress: purchaseQuantity + 1, - // presaleMerkleRoot: bytes32(0) - // }); + assertEq(address(zoraNFTBase).balance, totalSales); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); + assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + } - // (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = - // zoraNFTBase.computePaidMintRewards(purchaseQuantity); + function test_PaidMintRewardsWithMintAndCreateReferrals(uint64 salePrice, uint32 purchaseQuantity) + public + setupZoraNFTBaseWithCreateReferral(purchaseQuantity, createReferral) + { + vm.assume(salePrice > 0); + vm.assume(purchaseQuantity < 100 && purchaseQuantity > 0); - // uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - // uint256 totalSales = uint256(salePrice) * purchaseQuantity; - // uint256 totalPayment = totalSales + totalReward; + vm.prank(DEFAULT_OWNER_ADDRESS); + zoraNFTBase.setSaleConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: salePrice, + maxSalePurchasePerAddress: purchaseQuantity + 1, + presaleMerkleRoot: bytes32(0) + }); - // vm.deal(collector, totalPayment); - // vm.prank(collector); - // zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); + (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = + zoraNFTBase.computePaidMintRewards(purchaseQuantity); - // assertEq(address(zoraNFTBase).balance, totalSales); - // assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); - // assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); - // assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); - // } + uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); + uint256 totalSales = uint256(salePrice) * purchaseQuantity; + uint256 totalPayment = totalSales + totalReward; + + vm.deal(collector, totalPayment); + vm.prank(collector); + zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); + + assertEq(address(zoraNFTBase).balance, totalSales); + assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); + assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + } function testRevert_PaidMintRewardsInsufficientEth(uint64 salePrice, uint32 purchaseQuantity) public From 821491e2a23d7dd19ec392fbe7e48c90ad8c1a36 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 09:06:00 -0600 Subject: [PATCH 33/70] refactor: add common helpers --- src/ERC721Drop.sol | 182 +++++++++++++++++++++++++++++++-------------- 1 file changed, 127 insertions(+), 55 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 97da720..c79124c 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -510,16 +510,7 @@ contract ERC721Drop is function _handleMintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral) internal returns (uint256) { _mintSupplyRoyalty(quantity); - - // If max purchase per address == 0 there is no limit. - // Any other number, the per address mint limit is that. - if ( - salesConfig.maxSalePurchasePerAddress != 0 - && _numberMinted(recipient) + quantity - presaleMintsByAddress[recipient] - > salesConfig.maxSalePurchasePerAddress - ) { - revert Purchase_TooManyForAddress(); - } + _requireCanPurchaseQuantity(recipient, quantity); uint256 salePrice = salesConfig.publicSalePrice; @@ -552,24 +543,11 @@ contract ERC721Drop is function _handlePurchase(address recipient, uint256 quantity, string memory comment) internal returns (uint256) { _mintSupplyRoyalty(quantity); _requireCanMintQuantity(quantity); + _requireCanPurchaseQuantity(recipient, quantity); uint256 salePrice = salesConfig.publicSalePrice; - if (msg.value != (salePrice + ZORA_MINT_FEE) * quantity) { - revert Purchase_WrongPrice((salePrice + ZORA_MINT_FEE) * quantity); - } - - // If max purchase per address == 0 there is no limit. - // Any other number, the per address mint limit is that. - if ( - salesConfig.maxSalePurchasePerAddress != 0 && - _numberMinted(recipient) + - quantity - - presaleMintsByAddress[recipient] > - salesConfig.maxSalePurchasePerAddress - ) { - revert Purchase_TooManyForAddress(); - } + _requireLegacyFee(msg.value, salePrice, quantity); _mintNFTs(recipient, quantity); uint256 firstMintedTokenId = _lastMintedTokenId() - quantity; @@ -722,44 +700,95 @@ contract ERC721Drop is _mintSupplyRoyalty(quantity); _requireCanMintQuantity(quantity); - if ( - !MerkleProofUpgradeable.verify( - merkleProof, - salesConfig.presaleMerkleRoot, - keccak256( - // address, uint256, uint256 - abi.encode(_msgSender(), maxQuantity, pricePerToken) - ) - ) - ) { - revert Presale_MerkleNotApproved(); - } + address msgSender = _msgSender(); - if (msg.value != (pricePerToken + ZORA_MINT_FEE) * quantity) { - revert Purchase_WrongPrice( - (pricePerToken + ZORA_MINT_FEE) * quantity - ); - } + _requireMerkleApproval(msgSender, maxQuantity, pricePerToken, merkleProof); - presaleMintsByAddress[_msgSender()] += quantity; - if (presaleMintsByAddress[_msgSender()] > maxQuantity) { - revert Presale_TooManyForAddress(); - } + _requireLegacyFee(msg.value, pricePerToken, quantity); + + _requireCanPurchasePresale(msgSender, quantity, maxQuantity); - _mintNFTs(_msgSender(), quantity); + _mintNFTs(msgSender, quantity); uint256 firstMintedTokenId = _lastMintedTokenId() - quantity; _payoutZoraFee(quantity); emit IERC721Drop.Sale({ - to: _msgSender(), + to: msgSender, quantity: quantity, pricePerToken: pricePerToken, firstPurchasedTokenId: firstMintedTokenId }); if (bytes(comment).length > 0) { emit IERC721Drop.MintComment({ - sender: _msgSender(), + sender: msgSender, + tokenContract: address(this), + tokenId: firstMintedTokenId, + quantity: quantity, + comment: comment + }); + } + + return firstMintedTokenId; + } + + /// @notice Merkle-tree based presale purchase function with a comment and protocol rewards + /// @param quantity quantity to purchase + /// @param maxQuantity max quantity that can be purchased via merkle proof # + /// @param pricePerToken price that each token is purchased at + /// @param merkleProof proof for presale mint + /// @param comment comment to include in the IERC721Drop.Sale event + /// @param mintReferral The facilitator of the mint + function purchasePresaleWithRewards( + uint256 quantity, + uint256 maxQuantity, + uint256 pricePerToken, + bytes32[] calldata merkleProof, + string calldata comment, + address mintReferral + ) + external + payable + nonReentrant + onlyPresaleActive + returns (uint256) + { + return _handlePurchasePresaleWithRewards(quantity, maxQuantity, pricePerToken, merkleProof, comment, mintReferral); + } + + function _handlePurchasePresaleWithRewards( + uint256 quantity, + uint256 maxQuantity, + uint256 pricePerToken, + bytes32[] calldata merkleProof, + string calldata comment, + address mintReferral + ) internal returns (uint256) { + _mintSupplyRoyalty(quantity); + _requireCanMintQuantity(quantity); + + address msgSender = _msgSender(); + + _requireMerkleApproval(msgSender, maxQuantity, pricePerToken, merkleProof); + + _requireCanPurchasePresale(msgSender, quantity, maxQuantity); + + _handleRewards(msg.value, quantity, pricePerToken, config.fundsRecipient, mintReferral); + + _mintNFTs(msgSender, quantity); + + uint256 firstMintedTokenId = _lastMintedTokenId() - quantity; + + + emit IERC721Drop.Sale({ + to: msgSender, + quantity: quantity, + pricePerToken: pricePerToken, + firstPurchasedTokenId: firstMintedTokenId + }); + if (bytes(comment).length > 0) { + emit IERC721Drop.MintComment({ + sender: msgSender, tokenContract: address(this), tokenId: firstMintedTokenId, quantity: quantity, @@ -818,14 +847,11 @@ contract ERC721Drop is /// @notice Hook to filter operators (no-op if no filters are registered) /// @dev Part of ERC721A token hooks /// @param from Transfer from user - /// @param to Transfer to user - /// @param startTokenId Token ID to start with - /// @param quantity Quantity of token being transferred function _beforeTokenTransfers( address from, - address to, - uint256 startTokenId, - uint256 quantity + address, + uint256, + uint256 ) internal virtual override { if ( from != address(0) && // skip on mints @@ -1358,12 +1384,58 @@ contract ERC721Drop is emit MintFeePayout(zoraFee, ZORA_MINT_FEE_RECIPIENT, success); } + function _requireLegacyFee(uint256 msgValue, uint256 salePrice, uint256 quantity) internal view { + if (msgValue != (salePrice + ZORA_MINT_FEE) * quantity) { + revert Purchase_WrongPrice((salePrice + ZORA_MINT_FEE) * quantity); + } + } + function _requireCanMintQuantity(uint256 quantity) internal view { if (quantity + _totalMinted() > config.editionSize) { revert Mint_SoldOut(); } } + function _requireCanPurchaseQuantity(address recipient, uint256 quantity) internal view { + // If max purchase per address == 0 there is no limit. + // Any other number, the per address mint limit is that. + if ( + salesConfig.maxSalePurchasePerAddress != 0 + && _numberMinted(recipient) + quantity - presaleMintsByAddress[recipient] + > salesConfig.maxSalePurchasePerAddress + ) { + revert Purchase_TooManyForAddress(); + } + } + + function _requireCanPurchasePresale(address recipient, uint256 quantity, uint256 maxQuantity) internal { + presaleMintsByAddress[recipient] += quantity; + + if (presaleMintsByAddress[recipient] > maxQuantity) { + revert Presale_TooManyForAddress(); + } + } + + function _requireMerkleApproval( + address recipient, + uint256 maxQuantity, + uint256 pricePerToken, + bytes32[] calldata merkleProof + ) internal view { + if ( + !MerkleProofUpgradeable.verify( + merkleProof, + salesConfig.presaleMerkleRoot, + keccak256( + // address, uint256, uint256 + abi.encode(recipient, maxQuantity, pricePerToken) + ) + ) + ) { + revert Presale_MerkleNotApproved(); + } + } + function _mintSupplyRoyalty(uint256 mintQuantity) internal { uint32 royaltySchedule = royaltyMintSchedule; if (royaltySchedule == 0) { From 8d857613a0668ff994a69ad0951dd6f264cd950d Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 09:34:20 -0600 Subject: [PATCH 34/70] chore: update deps --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f02a2e2..a50b34b 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/zora-rewards": "^0.1.12", + "@zoralabs/zora-rewards": "^0.1.13", "ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b", "forge-std": "https://github.com/foundry-rs/forge-std#cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653" } diff --git a/yarn.lock b/yarn.lock index 5b6026c..5fed920 100644 --- a/yarn.lock +++ b/yarn.lock @@ -881,10 +881,10 @@ viem "^1.0.0" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.12": - version "0.1.12" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.12.tgz#848c4c8a62d8e707d00371dfa17fd67a067f4c6d" - integrity sha512-kJfVCNEN6Ap2hzV/RbWJiXG2Co/9m05NWcBBVwVGbRPgyc/rUBri2tprLBsbcAAQN2BZwafpnU/1EgBicyYZaw== +"@zoralabs/zora-rewards@^0.1.13": + version "0.1.13" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.13.tgz#f3690e76f5a446479bad6432cbcf9adbf498e28a" + integrity sha512-khRmXEFMnc+R9y6JOj5odtW/oqm3XJQx640D2sjhRQ/iPAR7R+HjvUCj2Wj97wDf3dk/FQ46PSlF4tR5sDnfrg== abitype@0.8.7: version "0.8.7" From bdf9a7fd72d23aea8f4cfe7853bfe200f4734808 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 09:39:35 -0600 Subject: [PATCH 35/70] chore: update deps --- package.json | 2 +- yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a50b34b..5532192 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/zora-rewards": "^0.1.13", + "@zoralabs/zora-rewards": "^0.1.14", "ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b", "forge-std": "https://github.com/foundry-rs/forge-std#cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653" } diff --git a/yarn.lock b/yarn.lock index 5fed920..784b22c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -881,10 +881,10 @@ viem "^1.0.0" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.13": - version "0.1.13" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.13.tgz#f3690e76f5a446479bad6432cbcf9adbf498e28a" - integrity sha512-khRmXEFMnc+R9y6JOj5odtW/oqm3XJQx640D2sjhRQ/iPAR7R+HjvUCj2Wj97wDf3dk/FQ46PSlF4tR5sDnfrg== +"@zoralabs/zora-rewards@^0.1.14": + version "0.1.14" + resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.14.tgz#ce4f75c681517893b529504cc1a4c59be0fd975b" + integrity sha512-2TVD3/RbYtnsS1b88u83Qa1SuPLmmDOeIBTLl6ZE0oHvowAFfLJTX6lv7Hrkvljd4dYuSuxKfUFrQMK3RulgRg== abitype@0.8.7: version "0.8.7" @@ -1490,9 +1490,9 @@ emoji-regex@^9.2.2: integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== enquirer@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.0.tgz#4f36f6c644137cc4fd2891da407ede2b1fea904a" - integrity sha512-ehu97t6FTYK2I3ZYtnp0BZ9vt0mvEL/cnHBds7Ct6jo9VX1VIkiFhOvVRWh6eblQqd7KOoICIQV+syZ3neXO/Q== + version "2.4.1" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== dependencies: ansi-colors "^4.1.1" strip-ansi "^6.0.1" @@ -3306,9 +3306,9 @@ reusify@^1.0.4: integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== rollup@^3.2.5: - version "3.26.3" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.26.3.tgz#bbc8818cadd0aebca348dbb3d68d296d220967b8" - integrity sha512-7Tin0C8l86TkpcMtXvQu6saWH93nhG3dGQ1/+l5V2TDMceTxO7kDiK6GzbfLWNNxqJXm591PcEZUozZm51ogwQ== + version "3.27.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.27.0.tgz#15bd07e2e1cbfa9255bf6a3f04a432621c2f3550" + integrity sha512-aOltLCrYZ0FhJDm7fCqwTjIUEVjWjcydKBV/Zeid6Mn8BWgDCUBBWT5beM5ieForYNo/1ZHuGJdka26kvQ3Gzg== optionalDependencies: fsevents "~2.3.2" From a879d55c7e10f17742a1d7d9e03ff88b4d4b89e3 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 10:15:34 -0600 Subject: [PATCH 36/70] refactor: add rewards storage --- src/ERC721Drop.sol | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index c79124c..8d97714 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -24,7 +24,7 @@ import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/se import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {MathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; -import {ERC721Rewards} from "@zoralabs/zora-rewards/dist/contracts/ERC721/ERC721Rewards.sol"; +import {ERC721Rewards, ERC721RewardsStorage} from "@zoralabs/zora-rewards/dist/contracts/abstract/ERC721/ERC721Rewards.sol"; import {IMetadataRenderer} from "./interfaces/IMetadataRenderer.sol"; import {IOperatorFilterRegistry} from "./interfaces/IOperatorFilterRegistry.sol"; @@ -62,7 +62,8 @@ contract ERC721Drop is Version(13), ERC721DropStorageV1, ERC721DropStorageV2, - ERC721Rewards + ERC721Rewards, + ERC721RewardsStorage { /// @dev This is the max mint batch size for the optimized ERC721A mint contract uint256 internal immutable MAX_MINT_BATCH_SIZE = 8; @@ -514,7 +515,7 @@ contract ERC721Drop is uint256 salePrice = salesConfig.publicSalePrice; - _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, mintReferral); + _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, mintReferral, createReferral); _mintNFTs(recipient, quantity); @@ -773,7 +774,7 @@ contract ERC721Drop is _requireCanPurchasePresale(msgSender, quantity, maxQuantity); - _handleRewards(msg.value, quantity, pricePerToken, config.fundsRecipient, mintReferral); + _handleRewards(msg.value, quantity, pricePerToken, config.fundsRecipient, mintReferral, createReferral); _mintNFTs(msgSender, quantity); @@ -1461,6 +1462,17 @@ contract ERC721Drop is royaltyMintSchedule = newSchedule; } + function updateCreateReferral(address recipient) external { + if (msg.sender != createReferral) revert ONLY_CREATE_REFERRAL(); + + _setCreateReferral(recipient); + } + + function _setCreateReferral(address recipient) internal { + createReferral = recipient; + } + + /// @notice ERC165 supports interface /// @param interfaceId interface id to check if supported function supportsInterface(bytes4 interfaceId) From 56bbac5846cfb292bc3067c5ea54c25ac7bf4102 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 10:42:46 -0600 Subject: [PATCH 37/70] chore: update runs --- foundry.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index b07f1b1..0072790 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,7 +1,7 @@ [profile.default] solc_version = '0.8.17' optimizer = true -optimizer_runs = 2383 +optimizer_runs = 500 via_ir = true out = 'out' test = 'test' From 3221408c7aebc7f269ccf1348612f1bba72b6096 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 14:03:37 -0600 Subject: [PATCH 38/70] chore: update protocol rewards --- package.json | 2 +- remappings.txt | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5532192..1fd96ee 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/zora-rewards": "^0.1.14", + "@zoralabs/protocol-rewards": "^1.0.0", "ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b", "forge-std": "https://github.com/foundry-rs/forge-std#cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653" } diff --git a/remappings.txt b/remappings.txt index 8a86ffc..099e00c 100644 --- a/remappings.txt +++ b/remappings.txt @@ -4,4 +4,4 @@ erc721a-upgradeable=lib/ERC721A-Upgradeable/contracts/ base64/=lib/base64/ ds-test/=node_modules/ds-test/src/ forge-std/=node_modules/forge-std/src/ -@zoralabs/zora-rewards/=node_modules/@zoralabs/zora-rewards/ \ No newline at end of file +@zoralabs/protocol-rewards/=node_modules/@zoralabs/protocol-rewards/ \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 784b22c..ddad7fd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -881,10 +881,10 @@ viem "^1.0.0" zod "^3.21.4" -"@zoralabs/zora-rewards@^0.1.14": - version "0.1.14" - resolved "https://registry.yarnpkg.com/@zoralabs/zora-rewards/-/zora-rewards-0.1.14.tgz#ce4f75c681517893b529504cc1a4c59be0fd975b" - integrity sha512-2TVD3/RbYtnsS1b88u83Qa1SuPLmmDOeIBTLl6ZE0oHvowAFfLJTX6lv7Hrkvljd4dYuSuxKfUFrQMK3RulgRg== +"@zoralabs/protocol-rewards@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@zoralabs/protocol-rewards/-/protocol-rewards-1.0.0.tgz#c38f0f9c340cb79313463b5c1084b3b1d610a0de" + integrity sha512-/r3MSrza2zau17EV8mk1gioekU1ABUz12zn+N1papSQ5kV+0TXqJsd+EoDqMR+Maupo5go4p/rnYlT7wmvfWjw== abitype@0.8.7: version "0.8.7" From 8a69a89b5c5ecc10a7de837cd821207497530e05 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 14:03:59 -0600 Subject: [PATCH 39/70] chore: update deploy config --- chainConfigs/420.json | 3 ++- chainConfigs/5.json | 2 +- chainConfigs/84531.json | 3 ++- chainConfigs/999.json | 2 +- script/Deploy.s.sol | 4 +--- script/UpgradeERC721DropFactory.s.sol | 2 +- src/DeploymentConfig.sol | 8 ++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/chainConfigs/420.json b/chainConfigs/420.json index b75a240..0970372 100644 --- a/chainConfigs/420.json +++ b/chainConfigs/420.json @@ -4,5 +4,6 @@ "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", - "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000" + "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", + "PROTOCOL_REWARDS": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1" } diff --git a/chainConfigs/5.json b/chainConfigs/5.json index 42296a8..0d2867c 100644 --- a/chainConfigs/5.json +++ b/chainConfigs/5.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", - "ZORA_REWARDS": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1" + "PROTOCOL_REWARDS": "0x8Ca5e648C5dFEfcdDa06d627F4b490B719ccFD98" } diff --git a/chainConfigs/84531.json b/chainConfigs/84531.json index 7a45789..c481307 100644 --- a/chainConfigs/84531.json +++ b/chainConfigs/84531.json @@ -4,5 +4,6 @@ "MINT_FEE_AMOUNT": 111000000000000, "MINT_FEE_RECIPIENT": "0x02539E813cA450C2c7334e885423f4A899a063Fe", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", - "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f" + "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", + "PROTOCOL_REWARDS": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE" } diff --git a/chainConfigs/999.json b/chainConfigs/999.json index c4539ec..afe9295 100644 --- a/chainConfigs/999.json +++ b/chainConfigs/999.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "ZORA_REWARDS": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1" + "PROTOCOL_REWARDS": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f" } \ No newline at end of file diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 902bf55..17b2ca4 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -4,8 +4,6 @@ pragma solidity ^0.8.13; import "forge-std/Script.sol"; import "forge-std/console2.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; - import {ERC721Drop} from "../src/ERC721Drop.sol"; import {ERC721DropProxy} from "../src/ERC721DropProxy.sol"; import {ZoraNFTCreatorV1} from "../src/ZoraNFTCreatorV1.sol"; @@ -44,7 +42,7 @@ contract Deploy is ZoraDropsDeployBase { _marketFilterDAOAddress: address(chainConfig.subscriptionMarketFilterAddress), _mintFeeAmount: chainConfig.mintFeeAmount, _mintFeeRecipient: payable(chainConfig.mintFeeRecipient), - _zoraRewards: address(chainConfig.zoraRewards) + _protocolRewards: address(chainConfig.protocolRewards) }); ZoraNFTCreatorV1 factoryImpl = new ZoraNFTCreatorV1(address(dropImplementation), editionMetadata, dropMetadata); diff --git a/script/UpgradeERC721DropFactory.s.sol b/script/UpgradeERC721DropFactory.s.sol index ba4f247..591f43c 100644 --- a/script/UpgradeERC721DropFactory.s.sol +++ b/script/UpgradeERC721DropFactory.s.sol @@ -60,7 +60,7 @@ contract UpgradeERC721DropFactory is ZoraDropsDeployBase { _marketFilterDAOAddress: chainConfig.subscriptionMarketFilterAddress, _mintFeeAmount: chainConfig.mintFeeAmount, _mintFeeRecipient: payable(chainConfig.mintFeeRecipient), - _zoraRewards: chainConfig.zoraRewards + _protocolRewards: chainConfig.protocolRewards }); deployment.dropImplementation = address(dropImplementation); diff --git a/src/DeploymentConfig.sol b/src/DeploymentConfig.sol index 886361b..0933f7c 100644 --- a/src/DeploymentConfig.sol +++ b/src/DeploymentConfig.sol @@ -22,8 +22,8 @@ struct ChainConfig { address subscriptionMarketFilterOwner; /// @notice Auto-approved hyperstructure on mainnet for enabling ZORA v3 with less gas. Deprecated – safe to set to address(0x) address zoraERC721TransferHelper; - /// @notice The Zora Rewards contract - address zoraRewards; + /// @notice The Protocol Rewards contract + address protocolRewards; } /// @notice Deployment addresses – set to new deployed addresses by the scripts. @@ -66,7 +66,7 @@ abstract contract DeploymentConfig is StdChains, StdCheatsSafe, StdUtils, Script string constant SUBSCRIPTION_MARKET_FILTER_ADDRESS = "SUBSCRIPTION_MARKET_FILTER_ADDRESS"; string constant SUBSCRIPTION_MARKET_FILTER_OWNER = "SUBSCRIPTION_MARKET_FILTER_OWNER"; string constant ZORA_ERC721_TRANSFER_HELPER = "ZORA_ERC721_TRANSFER_HELPER"; - string constant ZORA_REWARDS = "ZORA_REWARDS"; + string constant PROTOCOL_REWARDS = "PROTOCOL_REWARDS"; string constant DROP_METADATA_RENDERER = "DROP_METADATA_RENDERER"; string constant EDITION_METADATA_RENDERER = "EDITION_METADATA_RENDERER"; @@ -93,7 +93,7 @@ abstract contract DeploymentConfig is StdChains, StdCheatsSafe, StdUtils, Script chainConfig.subscriptionMarketFilterAddress = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_ADDRESS)); chainConfig.subscriptionMarketFilterOwner = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_OWNER)); chainConfig.zoraERC721TransferHelper = json.readAddress(getKeyPrefix(ZORA_ERC721_TRANSFER_HELPER)); - chainConfig.zoraRewards = json.readAddress(getKeyPrefix(ZORA_REWARDS)); + chainConfig.protocolRewards = json.readAddress(getKeyPrefix(PROTOCOL_REWARDS)); } /// @notice Get the deployment configuration struct from the JSON configuration file From d8a66df2cfa772d1afed130678f0aa07962c9f55 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 14:04:15 -0600 Subject: [PATCH 40/70] chore: update naming --- src/ERC721Drop.sol | 6 ++-- test/ERC721Drop.t.sol | 62 ++++++++++++++++++------------------ test/ZoraNFTCreatorV1.t.sol | 8 ++--- test/merkle/MerkleDrop.t.sol | 8 ++--- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 8d97714..e5a71bd 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -24,7 +24,7 @@ import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/se import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {MathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; -import {ERC721Rewards, ERC721RewardsStorage} from "@zoralabs/zora-rewards/dist/contracts/abstract/ERC721/ERC721Rewards.sol"; +import {ERC721Rewards, ERC721RewardsStorage} from "@zoralabs/protocol-rewards/dist/contracts/abstract/ERC721/ERC721Rewards.sol"; import {IMetadataRenderer} from "./interfaces/IMetadataRenderer.sol"; import {IOperatorFilterRegistry} from "./interfaces/IOperatorFilterRegistry.sol"; @@ -185,8 +185,8 @@ contract ERC721Drop is address _marketFilterDAOAddress, uint256 _mintFeeAmount, address payable _mintFeeRecipient, - address _zoraRewards - ) initializer ERC721Rewards(_zoraRewards, _mintFeeRecipient) { + address _protocolRewards + ) initializer ERC721Rewards(_protocolRewards, _mintFeeRecipient) { zoraERC721TransferHelper = _zoraERC721TransferHelper; factoryUpgradeGate = _factoryUpgradeGate; marketFilterDAOAddress = _marketFilterDAOAddress; diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index a0f2fc8..cd728b7 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; +import {ProtocolRewards} from "@zoralabs/protocol-rewards/dist/contracts/ProtocolRewards.sol"; import {ERC721Drop} from "../src/ERC721Drop.sol"; import {DummyMetadataRenderer} from "./utils/DummyMetadataRenderer.sol"; @@ -47,7 +47,7 @@ contract ERC721DropTest is Test { address internal createReferral; address internal zora; - ZoraRewards zoraRewards; + ProtocolRewards protocolRewards; ERC721Drop zoraNFTBase; MockUser mockUser; DummyMetadataRenderer public dummyRenderer = new DummyMetadataRenderer(); @@ -114,7 +114,7 @@ contract ERC721DropTest is Test { createReferral = makeAddr("createReferral"); zora = makeAddr("zora"); - zoraRewards = new ZoraRewards(); + protocolRewards = new ProtocolRewards(); vm.prank(DEFAULT_ZORA_DAO_ADDRESS); factoryUpgradeGate = new FactoryUpgradeGate(UPGRADE_GATE_ADMIN_ADDRESS); @@ -129,7 +129,7 @@ contract ERC721DropTest is Test { address(0x0), mintFee, mintFeeRecipient, - address(zoraRewards) + address(protocolRewards) ) ); address payable newDrop = payable(address(new ERC721DropProxy(impl, ""))); @@ -145,7 +145,7 @@ contract ERC721DropTest is Test { address(subscriptionAddress), mintFee, mintFeeRecipient, - address(zoraRewards) + address(protocolRewards) ) ); address payable newDrop = payable(address(new ERC721DropProxy(impl, ""))); @@ -456,8 +456,8 @@ contract ERC721DropTest is Test { vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); } function test_FreeMintRewardsWithMintReferral(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -488,9 +488,9 @@ contract ERC721DropTest is Test { vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); - assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); + assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); } function test_FreeMintRewardsWithCreateReferral(uint32 purchaseQuantity) @@ -524,9 +524,9 @@ contract ERC721DropTest is Test { vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); - assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); } function test_FreeMintRewardsWithMintAndCreateReferrals(uint32 purchaseQuantity) @@ -560,10 +560,10 @@ contract ERC721DropTest is Test { vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); - assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); - assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward); + assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); } function testRevert_FreeMintRewardsInsufficientEth(uint32 purchaseQuantity) @@ -617,8 +617,8 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); } function test_PaidMintRewardsWithMintReferral(uint64 salePrice, uint32 purchaseQuantity) @@ -650,9 +650,9 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); - assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); + assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); } function test_PaidMintRewardsWithCreateReferral(uint64 salePrice, uint32 purchaseQuantity) @@ -685,9 +685,9 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); - assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); } function test_PaidMintRewardsWithMintAndCreateReferrals(uint64 salePrice, uint32 purchaseQuantity) @@ -720,10 +720,10 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(zoraRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(zoraRewards.balanceOf(mintFeeRecipient), zoraReward); - assertEq(zoraRewards.balanceOf(mintReferral), mintReferralReward); - assertEq(zoraRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward); + assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); } function testRevert_PaidMintRewardsInsufficientEth(uint64 salePrice, uint32 purchaseQuantity) @@ -756,7 +756,7 @@ contract ERC721DropTest is Test { address(0x0), mintFee, mintFeeRecipient, - address(zoraRewards) + address(protocolRewards) ) ); @@ -776,7 +776,7 @@ contract ERC721DropTest is Test { address(0x0), mintFee, mintFeeRecipient, - address(zoraRewards) + address(protocolRewards) ) ); diff --git a/test/ZoraNFTCreatorV1.t.sol b/test/ZoraNFTCreatorV1.t.sol index 4931eb6..542b65d 100644 --- a/test/ZoraNFTCreatorV1.t.sol +++ b/test/ZoraNFTCreatorV1.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; +import {ProtocolRewards} from "@zoralabs/protocol-rewards/dist/contracts/ProtocolRewards.sol"; import {IMetadataRenderer} from "../src/interfaces/IMetadataRenderer.sol"; import "../src/ZoraNFTCreatorV1.sol"; @@ -26,11 +26,11 @@ contract ZoraNFTCreatorV1Test is Test { ZoraNFTCreatorV1 public creator; EditionMetadataRenderer public editionMetadataRenderer; DropMetadataRenderer public dropMetadataRenderer; - ZoraRewards internal zoraRewards; + ProtocolRewards internal protocolRewards; address internal constant DEFAULT_CREATE_REFERRAL = address(0); function setUp() public { - zoraRewards = new ZoraRewards(); + protocolRewards = new ProtocolRewards(); vm.prank(DEFAULT_ZORA_DAO_ADDRESS); dropImpl = new ERC721Drop( @@ -39,7 +39,7 @@ contract ZoraNFTCreatorV1Test is Test { address(0), mintFee, mintFeeRecipient, - address(zoraRewards) + address(protocolRewards) ); editionMetadataRenderer = new EditionMetadataRenderer(); dropMetadataRenderer = new DropMetadataRenderer(); diff --git a/test/merkle/MerkleDrop.t.sol b/test/merkle/MerkleDrop.t.sol index 0d6dc77..447c86a 100644 --- a/test/merkle/MerkleDrop.t.sol +++ b/test/merkle/MerkleDrop.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.10; import {Test} from "forge-std/Test.sol"; -import {ZoraRewards} from "@zoralabs/zora-rewards/dist/contracts/ZoraRewards.sol"; +import {ProtocolRewards} from "@zoralabs/protocol-rewards/dist/contracts/ProtocolRewards.sol"; import {IERC721Drop} from "../../src/interfaces/IERC721Drop.sol"; import {ERC721Drop} from "../../src/ERC721Drop.sol"; @@ -12,7 +12,7 @@ import {ERC721DropProxy} from "../../src/ERC721DropProxy.sol"; import {MerkleData} from "./MerkleData.sol"; contract ZoraNFTBaseTest is Test { - ZoraRewards internal zoraRewards; + ProtocolRewards internal protocolRewards; ERC721Drop zoraNFTBase; DummyMetadataRenderer public dummyRenderer = new DummyMetadataRenderer(); MerkleData public merkleData; @@ -45,7 +45,7 @@ contract ZoraNFTBaseTest is Test { } function setUp() public { - zoraRewards = new ZoraRewards(); + protocolRewards = new ProtocolRewards(); vm.prank(DEFAULT_ZORA_DAO_ADDRESS); address impl = address( @@ -55,7 +55,7 @@ contract ZoraNFTBaseTest is Test { address(0), mintFee, mintFeeRecipient, - address(zoraRewards) + address(protocolRewards) ) ); address payable newDrop = payable( From 24030ece2efd1c90fb620d1017507287323f74c0 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 16:49:17 -0600 Subject: [PATCH 41/70] chore: update versions --- src/ERC721Drop.sol | 2 +- src/ZoraNFTCreatorV1.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index e5a71bd..7f13ba8 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -59,7 +59,7 @@ contract ERC721Drop is PublicMulticall, OwnableSkeleton, FundsReceiver, - Version(13), + Version(14), ERC721DropStorageV1, ERC721DropStorageV2, ERC721Rewards, diff --git a/src/ZoraNFTCreatorV1.sol b/src/ZoraNFTCreatorV1.sol index af90675..a417d49 100644 --- a/src/ZoraNFTCreatorV1.sol +++ b/src/ZoraNFTCreatorV1.sol @@ -14,7 +14,7 @@ import {ERC721Drop} from "./ERC721Drop.sol"; import {IContractMetadata} from "./interfaces/IContractMetadata.sol"; /// @notice Zora NFT Creator V1 -contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetadata, Version(7) { +contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetadata, Version(8) { string private constant CANNOT_BE_ZERO = "Cannot be 0 address"; /// @notice Emitted when a edition is created reserving the corresponding token IDs. From 48197ec899a96e52e94012b761dfecfd8eb71d6e Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 16:58:38 -0600 Subject: [PATCH 42/70] refactor: do not force create referral via factory --- script/TestUpgradeAndMint.s.sol | 6 +-- script/ZoraDropsDeployBase.sol | 2 +- src/ZoraNFTCreatorV1.sol | 63 ++++++++++++++++++++++++++++++++ test/ZoraNFTCreatorV1.t.sol | 6 +-- test/ZoraNFTCreatorV1_Fork.t.sol | 3 +- 5 files changed, 69 insertions(+), 11 deletions(-) diff --git a/script/TestUpgradeAndMint.s.sol b/script/TestUpgradeAndMint.s.sol index ce08b4c..c8fd496 100644 --- a/script/TestUpgradeAndMint.s.sol +++ b/script/TestUpgradeAndMint.s.sol @@ -69,8 +69,7 @@ contract DeployNewERC721Drop is Script { }), "desc", "animation", - "image", - DEFAULT_CREATE_REFERRAL + "image" ))); drop.adminMint(sender, 4); @@ -119,8 +118,7 @@ contract DeployNewERC721Drop is Script { }), "desc", "animation", - "image", - DEFAULT_CREATE_REFERRAL + "image" ))); assert(drop2.balanceOf(sender) == 0); diff --git a/script/ZoraDropsDeployBase.sol b/script/ZoraDropsDeployBase.sol index a8ab64c..1b4e9ff 100644 --- a/script/ZoraDropsDeployBase.sol +++ b/script/ZoraDropsDeployBase.sol @@ -31,7 +31,7 @@ abstract contract ZoraDropsDeployBase is ScriptDeploymentConfig { function deployTestContractForVerification(ZoraNFTCreatorV1 factory) internal { IERC721Drop.SalesConfiguration memory saleConfig; address newContract = address( - factory.createEdition(unicode"☾*☽", "~", 0, 0, payable(address(0)), address(0), saleConfig, "", DEMO_IPFS_METADATA_FILE, DEMO_IPFS_METADATA_FILE, DEFAULT_CREATE_REFERRAL) + factory.createEdition(unicode"☾*☽", "~", 0, 0, payable(address(0)), address(0), saleConfig, "", DEMO_IPFS_METADATA_FILE, DEMO_IPFS_METADATA_FILE) ); console2.log("Deployed new contract for verification purposes", newContract); } diff --git a/src/ZoraNFTCreatorV1.sol b/src/ZoraNFTCreatorV1.sol index a417d49..d093ad6 100644 --- a/src/ZoraNFTCreatorV1.sol +++ b/src/ZoraNFTCreatorV1.sol @@ -232,6 +232,36 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad /// @param metadataURIBase URI Base for metadata /// @param metadataContractURI URI for contract metadata function createDrop( + string memory name, + string memory symbol, + address defaultAdmin, + uint64 editionSize, + uint16 royaltyBPS, + address payable fundsRecipient, + IERC721Drop.SalesConfiguration memory saleConfig, + string memory metadataURIBase, + string memory metadataContractURI + ) external returns (address) { + bytes memory metadataInitializer = abi.encode( + metadataURIBase, + metadataContractURI + ); + return + setupDropsContract({ + defaultAdmin: defaultAdmin, + name: name, + symbol: symbol, + royaltyBPS: royaltyBPS, + editionSize: editionSize, + fundsRecipient: fundsRecipient, + saleConfig: saleConfig, + metadataRenderer: dropMetadataRenderer, + metadataInitializer: metadataInitializer, + createReferral: address(0) + }); + } + + function createDropWithReferral( string memory name, string memory symbol, address defaultAdmin, @@ -306,6 +336,39 @@ contract ZoraNFTCreatorV1 is OwnableUpgradeable, UUPSUpgradeable, IContractMetad /// @param animationURI Metadata: Animation url (optional) of the edition entry /// @param imageURI Metadata: Image url (semi-required) of the edition entry function createEdition( + string memory name, + string memory symbol, + uint64 editionSize, + uint16 royaltyBPS, + address payable fundsRecipient, + address defaultAdmin, + IERC721Drop.SalesConfiguration memory saleConfig, + string memory description, + string memory animationURI, + string memory imageURI + ) external returns (address) { + bytes memory metadataInitializer = abi.encode( + description, + imageURI, + animationURI + ); + + return + setupDropsContract({ + name: name, + symbol: symbol, + defaultAdmin: defaultAdmin, + editionSize: editionSize, + royaltyBPS: royaltyBPS, + saleConfig: saleConfig, + fundsRecipient: fundsRecipient, + metadataRenderer: editionMetadataRenderer, + metadataInitializer: metadataInitializer, + createReferral: address(0) + }); + } + + function createEditionWithReferral( string memory name, string memory symbol, uint64 editionSize, diff --git a/test/ZoraNFTCreatorV1.t.sol b/test/ZoraNFTCreatorV1.t.sol index 542b65d..acff13e 100644 --- a/test/ZoraNFTCreatorV1.t.sol +++ b/test/ZoraNFTCreatorV1.t.sol @@ -85,8 +85,7 @@ contract ZoraNFTCreatorV1Test is Test { }), "desc", "animation", - "image", - DEFAULT_CREATE_REFERRAL + "image" ); ERC721Drop drop = ERC721Drop(payable(deployedEdition)); (, uint256 fee) = drop.zoraFeeForAmount(10); @@ -114,8 +113,7 @@ contract ZoraNFTCreatorV1Test is Test { presaleMerkleRoot: bytes32(0) }), "metadata_uri", - "metadata_contract_uri", - DEFAULT_CREATE_REFERRAL + "metadata_contract_uri" ); ERC721Drop drop = ERC721Drop(payable(deployedDrop)); (, uint256 fee) = drop.zoraFeeForAmount(10); diff --git a/test/ZoraNFTCreatorV1_Fork.t.sol b/test/ZoraNFTCreatorV1_Fork.t.sol index 9bccbae..8af9fcc 100644 --- a/test/ZoraNFTCreatorV1_Fork.t.sol +++ b/test/ZoraNFTCreatorV1_Fork.t.sol @@ -56,8 +56,7 @@ contract ZoraNFTCreatorV1_ForkTests is Test, ForkHelper { }), "desc", "animation", - "image", - DEFAULT_CREATE_REFERRAL + "image" ); ERC721Drop drop = ERC721Drop(payable(deployedEdition)); (, uint256 fee) = drop.zoraFeeForAmount(10); From f5b995e8d1ef1fbfa1346c3a4da90f5bc74d1d1b Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 17:15:09 -0600 Subject: [PATCH 43/70] chore: update goerli deploy --- addresses/5.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addresses/5.json b/addresses/5.json index b88b8ce..ac0e5c8 100644 --- a/addresses/5.json +++ b/addresses/5.json @@ -1,12 +1,10 @@ { - "ZORA_NFT_CREATOR_V1": "0xb4d319458E489825Cea8e25b5e43742BCdAFc6dd", - "ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", "ZORA_FEE_MANAGER": "0xCf5E957CA7b77EC16611992d79f4E179132ad98C", "EDITION_METADATA_RENDERER": "0x2f5C21EF9DdFf9A1FE76a1c55dd5112fcf2EfD39", "DROP_METADATA_RENDERER": "0x5956Fd16c4d8c4b4711F2551971aBB7c2F4aF677", - "ERC721_DROP": "0x2093eFB737C07324D8b6c5807910EFF45045D987", + "ERC721_DROP": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f", "FACTORY_UPGRADE_GATE": "0x942C03C7afE5c8118BDB728Aa06d1b894B1cD9A8", "ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", - "ZORA_NFT_CREATOR_V1_IMPL": "0x4328cbDAD668E81B475766520E1004e6688D2949" + "ZORA_NFT_CREATOR_V1_IMPL": "0x2810D376AC3b80C443ddD3F4e84E036F2e90622A" } From c7cd5614933c8eb4390bb55a7fdd1cae8f34e4eb Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Fri, 28 Jul 2023 17:24:31 -0600 Subject: [PATCH 44/70] chore: update zora goerli deploy --- addresses/999.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/999.json b/addresses/999.json index e3a9ba7..c935974 100644 --- a/addresses/999.json +++ b/addresses/999.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", "EDITION_METADATA_RENDERER": "0x481c56e15A9B2987Bd6041043e1d807697505d23", - "ERC721DROP_IMPL": "0xA3Fb46092D9DAe8eAa2F99417630930F4Ee5A45a", + "ERC721DROP_IMPL": "0x362e411b630596CdDcbD48C02d009120715266A0", "FACTORY_UPGRADE_GATE": "0x2068BA7Be6e22b97d21f5eb6e152A36d2Dc27da2", "ZORA_NFT_CREATOR_PROXY": "0xeB29A4e5b84fef428c072debA2444e93c080CE87", - "ZORA_NFT_CREATOR_V1_IMPL": "0x4589A93f2444b736E3d35acB331f5241b1c6DAD3" + "ZORA_NFT_CREATOR_V1_IMPL": "0xcFbdC68dfF1E6c8D9e6979DF8B11aF33D978D911" } \ No newline at end of file From 7107a68c0565a2b6f63d5f8ada5aa818427dcf3b Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Sat, 29 Jul 2023 11:23:21 -0600 Subject: [PATCH 45/70] chore: update op goerli deploy --- addresses/420.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/420.json b/addresses/420.json index 39c8efc..5f0eb0f 100644 --- a/addresses/420.json +++ b/addresses/420.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xCe6B190956D73dA045bA348743E4C1cb6652f37f", "EDITION_METADATA_RENDERER": "0x169007EF8fF4d2a225f361654e4B8280910fD8FC", - "ERC721DROP_IMPL": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a", + "ERC721DROP_IMPL": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE", "FACTORY_UPGRADE_GATE": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_NFT_CREATOR_PROXY": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", - "ZORA_NFT_CREATOR_V1_IMPL": "0xC5c958a65656A84b74100D1d420a1819fEA18d41", + "ZORA_NFT_CREATOR_V1_IMPL": "0x3E8524770adD176bE381a0529E09f1c6c3502A5a", "timestamp": 1683668679, "commit": "e100eee" } \ No newline at end of file From 7644578c5e138717e28511b5ad7c4e8c2b40e4da Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Sun, 30 Jul 2023 16:15:14 -0600 Subject: [PATCH 46/70] chore: update base goerli deploy --- addresses/84531.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/84531.json b/addresses/84531.json index 95e5f50..63a3046 100644 --- a/addresses/84531.json +++ b/addresses/84531.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a", "EDITION_METADATA_RENDERER": "0xC5c958a65656A84b74100D1d420a1819fEA18d41", - "ERC721DROP_IMPL": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1", + "ERC721DROP_IMPL": "0x805E0a08dE70f85C01F7848370d5e3fc08aAd0ea", "FACTORY_UPGRADE_GATE": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", "ZORA_NFT_CREATOR_PROXY": "0x87cfd516c5ea86e50b950678CA970a8a28de27ac", - "ZORA_NFT_CREATOR_V1_IMPL": "0x0ABdD5AA61E9107519DB7cD626442B905284B7eb" + "ZORA_NFT_CREATOR_V1_IMPL": "0xeB29A4e5b84fef428c072debA2444e93c080CE87" } From ab685247a0dd78f9765825cafbd24f9789c111c6 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Mon, 31 Jul 2023 12:16:12 -0600 Subject: [PATCH 47/70] chore: update deps --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1fd96ee..d7c3310 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/protocol-rewards": "^1.0.0", + "@zoralabs/protocol-rewards": "^1.0.1", "ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b", "forge-std": "https://github.com/foundry-rs/forge-std#cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653" } diff --git a/yarn.lock b/yarn.lock index ddad7fd..4ad2d0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -881,10 +881,10 @@ viem "^1.0.0" zod "^3.21.4" -"@zoralabs/protocol-rewards@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@zoralabs/protocol-rewards/-/protocol-rewards-1.0.0.tgz#c38f0f9c340cb79313463b5c1084b3b1d610a0de" - integrity sha512-/r3MSrza2zau17EV8mk1gioekU1ABUz12zn+N1papSQ5kV+0TXqJsd+EoDqMR+Maupo5go4p/rnYlT7wmvfWjw== +"@zoralabs/protocol-rewards@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@zoralabs/protocol-rewards/-/protocol-rewards-1.0.1.tgz#63880dbd2999ab0a56ab0a483e8848d15236062e" + integrity sha512-1ZopbZ3x0cvSL08ZlHZ2b4JLOX+UC6cwUr24Q8xso2G++3+DBZneDuAQxh+i02mEICp86fH6EZC37VvazemZeg== abitype@0.8.7: version "0.8.7" From ec70925966b7195811d9720c99ada73b0e84788e Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Mon, 31 Jul 2023 22:49:11 -0400 Subject: [PATCH 48/70] chore: update goerli deploy --- addresses/5.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/5.json b/addresses/5.json index ac0e5c8..0469acd 100644 --- a/addresses/5.json +++ b/addresses/5.json @@ -3,8 +3,8 @@ "ZORA_FEE_MANAGER": "0xCf5E957CA7b77EC16611992d79f4E179132ad98C", "EDITION_METADATA_RENDERER": "0x2f5C21EF9DdFf9A1FE76a1c55dd5112fcf2EfD39", "DROP_METADATA_RENDERER": "0x5956Fd16c4d8c4b4711F2551971aBB7c2F4aF677", - "ERC721_DROP": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f", + "ERC721_DROP": "0x242f0EE150a171CC250685F19faA062D79bd3170", "FACTORY_UPGRADE_GATE": "0x942C03C7afE5c8118BDB728Aa06d1b894B1cD9A8", "ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", - "ZORA_NFT_CREATOR_V1_IMPL": "0x2810D376AC3b80C443ddD3F4e84E036F2e90622A" + "ZORA_NFT_CREATOR_V1_IMPL": "0x2d54733cBebb23b8a10a935f6B42Efaaa9f5d27e" } From c0091273cb4630e0c19bf18311aaf2b0c4c18f2b Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Mon, 31 Jul 2023 22:56:24 -0400 Subject: [PATCH 49/70] chore: update zora goerli deploy --- addresses/999.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/999.json b/addresses/999.json index c935974..527bb2e 100644 --- a/addresses/999.json +++ b/addresses/999.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", "EDITION_METADATA_RENDERER": "0x481c56e15A9B2987Bd6041043e1d807697505d23", - "ERC721DROP_IMPL": "0x362e411b630596CdDcbD48C02d009120715266A0", + "ERC721DROP_IMPL": "0xa1F45f5B50e16E79366867E91fE45c181D18Cb67", "FACTORY_UPGRADE_GATE": "0x2068BA7Be6e22b97d21f5eb6e152A36d2Dc27da2", "ZORA_NFT_CREATOR_PROXY": "0xeB29A4e5b84fef428c072debA2444e93c080CE87", - "ZORA_NFT_CREATOR_V1_IMPL": "0xcFbdC68dfF1E6c8D9e6979DF8B11aF33D978D911" + "ZORA_NFT_CREATOR_V1_IMPL": "0x2D6d587e9B09fa01405A5816938554ccdeEf69db" } \ No newline at end of file From cffe9e345ceda00aa25ee297c9cd914fb49a6905 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 1 Aug 2023 00:19:32 -0400 Subject: [PATCH 50/70] chore: update op goerli deploy --- addresses/420.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/420.json b/addresses/420.json index 5f0eb0f..933ac2d 100644 --- a/addresses/420.json +++ b/addresses/420.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xCe6B190956D73dA045bA348743E4C1cb6652f37f", "EDITION_METADATA_RENDERER": "0x169007EF8fF4d2a225f361654e4B8280910fD8FC", - "ERC721DROP_IMPL": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE", + "ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07", "FACTORY_UPGRADE_GATE": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_NFT_CREATOR_PROXY": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", - "ZORA_NFT_CREATOR_V1_IMPL": "0x3E8524770adD176bE381a0529E09f1c6c3502A5a", + "ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8", "timestamp": 1683668679, "commit": "e100eee" } \ No newline at end of file From f6381644ee5a56ae19016ae217ed9605466b3d97 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Tue, 1 Aug 2023 07:56:36 -0400 Subject: [PATCH 51/70] chore: update base goerli deploy --- addresses/84531.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/84531.json b/addresses/84531.json index 63a3046..262d44f 100644 --- a/addresses/84531.json +++ b/addresses/84531.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a", "EDITION_METADATA_RENDERER": "0xC5c958a65656A84b74100D1d420a1819fEA18d41", - "ERC721DROP_IMPL": "0x805E0a08dE70f85C01F7848370d5e3fc08aAd0ea", + "ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07", "FACTORY_UPGRADE_GATE": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", "ZORA_NFT_CREATOR_PROXY": "0x87cfd516c5ea86e50b950678CA970a8a28de27ac", - "ZORA_NFT_CREATOR_V1_IMPL": "0xeB29A4e5b84fef428c072debA2444e93c080CE87" + "ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8" } From 27d7e5892cf184a1f44bb81adbdae23b21c2fe5a Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 13:39:29 -0400 Subject: [PATCH 52/70] chore: update dep --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d7c3310..87bde39 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ }, "dependencies": { "@dotenv/cli": "^2.2.2", - "@zoralabs/protocol-rewards": "^1.0.1", + "@zoralabs/protocol-rewards": "^1.0.2", "ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b", "forge-std": "https://github.com/foundry-rs/forge-std#cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653" } diff --git a/yarn.lock b/yarn.lock index 4ad2d0b..8ff5c0f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -881,10 +881,10 @@ viem "^1.0.0" zod "^3.21.4" -"@zoralabs/protocol-rewards@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@zoralabs/protocol-rewards/-/protocol-rewards-1.0.1.tgz#63880dbd2999ab0a56ab0a483e8848d15236062e" - integrity sha512-1ZopbZ3x0cvSL08ZlHZ2b4JLOX+UC6cwUr24Q8xso2G++3+DBZneDuAQxh+i02mEICp86fH6EZC37VvazemZeg== +"@zoralabs/protocol-rewards@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@zoralabs/protocol-rewards/-/protocol-rewards-1.0.2.tgz#7727b3b6bbba57c26aae088884ff168542f745ed" + integrity sha512-r+4EGY9HKHXTwY89VFciI4wvjgh9ZJPuPGKBoAY6TwXXk8bN1h4CathbUmzkjC8hCw4knItEKTgebbHNpslAcg== abitype@0.8.7: version "0.8.7" From 0eef63869554c6395cea117fea4b8188878d1f72 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 13:43:53 -0400 Subject: [PATCH 53/70] refactor: update rewards handler --- src/ERC721Drop.sol | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index 7f13ba8..b3a86ca 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -24,7 +24,8 @@ import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/se import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {MathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; -import {ERC721Rewards, ERC721RewardsStorage} from "@zoralabs/protocol-rewards/dist/contracts/abstract/ERC721/ERC721Rewards.sol"; +import {ERC721Rewards} from "@zoralabs/protocol-rewards/dist/contracts/abstract/ERC721/ERC721Rewards.sol"; +import {ERC721RewardsStorageV1} from "@zoralabs/protocol-rewards/dist/contracts/abstract/ERC721/ERC721RewardsStorageV1.sol"; import {IMetadataRenderer} from "./interfaces/IMetadataRenderer.sol"; import {IOperatorFilterRegistry} from "./interfaces/IOperatorFilterRegistry.sol"; @@ -63,7 +64,7 @@ contract ERC721Drop is ERC721DropStorageV1, ERC721DropStorageV2, ERC721Rewards, - ERC721RewardsStorage + ERC721RewardsStorageV1 { /// @dev This is the max mint batch size for the optimized ERC721A mint contract uint256 internal immutable MAX_MINT_BATCH_SIZE = 8; @@ -515,7 +516,7 @@ contract ERC721Drop is uint256 salePrice = salesConfig.publicSalePrice; - _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient, mintReferral, createReferral); + _handleRewards(msg.value, quantity, salePrice, config.fundsRecipient != address(0) ? config.fundsRecipient : address(this), createReferral, mintReferral); _mintNFTs(recipient, quantity); @@ -774,7 +775,7 @@ contract ERC721Drop is _requireCanPurchasePresale(msgSender, quantity, maxQuantity); - _handleRewards(msg.value, quantity, pricePerToken, config.fundsRecipient, mintReferral, createReferral); + _handleRewards(msg.value, quantity, pricePerToken, config.fundsRecipient != address(0) ? config.fundsRecipient : address(this), createReferral, mintReferral); _mintNFTs(msgSender, quantity); @@ -1261,6 +1262,8 @@ contract ERC721Drop is ); } + function withdrawRewards(address to, uint256 amount) external nonReentrant {} + // ,-. // `-' // /|\ From d27b7f3babff344a309a600a6a7e417752cba2de Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 14:37:49 -0400 Subject: [PATCH 54/70] chore: update tests --- test/ERC721Drop.t.sol | 93 +++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/test/ERC721Drop.t.sol b/test/ERC721Drop.t.sol index cd728b7..a399882 100644 --- a/test/ERC721Drop.t.sol +++ b/test/ERC721Drop.t.sol @@ -5,6 +5,7 @@ import {Test} from "forge-std/Test.sol"; import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; import {Math} from "@openzeppelin/contracts/utils/math/Math.sol"; import {ProtocolRewards} from "@zoralabs/protocol-rewards/dist/contracts/ProtocolRewards.sol"; +import {RewardsSettings} from "@zoralabs/protocol-rewards/dist/contracts/abstract/RewardSplits.sol"; import {ERC721Drop} from "../src/ERC721Drop.sol"; import {DummyMetadataRenderer} from "./utils/DummyMetadataRenderer.sol"; @@ -444,20 +445,14 @@ contract ERC721DropTest is Test { uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - ( - uint256 creatorReward, - uint256 mintReferralReward, - uint256 createReferralReward, - uint256 firstMinterReward, - uint256 zoraReward - ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); vm.deal(collector, totalReward); vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.creatorReward + settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward + settings.mintReferralReward + settings.createReferralReward); } function test_FreeMintRewardsWithMintReferral(uint32 purchaseQuantity) public setupZoraNFTBase(purchaseQuantity) { @@ -476,21 +471,15 @@ contract ERC721DropTest is Test { uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - ( - uint256 creatorReward, - uint256 mintReferralReward, - uint256 createReferralReward, - uint256 firstMinterReward, - uint256 zoraReward - ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); vm.deal(collector, totalReward); vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); - assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.creatorReward + settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward + settings.createReferralReward); + assertEq(protocolRewards.balanceOf(mintReferral), settings.mintReferralReward); } function test_FreeMintRewardsWithCreateReferral(uint32 purchaseQuantity) @@ -512,21 +501,15 @@ contract ERC721DropTest is Test { uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - ( - uint256 creatorReward, - uint256 mintReferralReward, - uint256 createReferralReward, - uint256 firstMinterReward, - uint256 zoraReward - ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); vm.deal(collector, totalReward); vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", address(0)); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); - assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.creatorReward + settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward + settings.mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), settings.createReferralReward); } function test_FreeMintRewardsWithMintAndCreateReferrals(uint32 purchaseQuantity) @@ -548,22 +531,16 @@ contract ERC721DropTest is Test { uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); - ( - uint256 creatorReward, - uint256 mintReferralReward, - uint256 createReferralReward, - uint256 firstMinterReward, - uint256 zoraReward - ) = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computeFreeMintRewards(purchaseQuantity); vm.deal(collector, totalReward); vm.prank(collector); zoraNFTBase.mintWithRewards{value: totalReward}(collector, purchaseQuantity, "test comment", mintReferral); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), creatorReward + firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward); - assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); - assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.creatorReward + settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward); + assertEq(protocolRewards.balanceOf(mintReferral), settings.mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), settings.createReferralReward); } function testRevert_FreeMintRewardsInsufficientEth(uint32 purchaseQuantity) @@ -605,8 +582,7 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = - zoraNFTBase.computePaidMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); uint256 totalSales = uint256(salePrice) * purchaseQuantity; @@ -617,8 +593,8 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward + createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward + settings.mintReferralReward + settings.createReferralReward); } function test_PaidMintRewardsWithMintReferral(uint64 salePrice, uint32 purchaseQuantity) @@ -639,8 +615,7 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = - zoraNFTBase.computePaidMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); uint256 totalSales = uint256(salePrice) * purchaseQuantity; uint256 totalPayment = totalSales + totalReward; @@ -650,9 +625,9 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + createReferralReward); - assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward + settings.createReferralReward); + assertEq(protocolRewards.balanceOf(mintReferral), settings.mintReferralReward); } function test_PaidMintRewardsWithCreateReferral(uint64 salePrice, uint32 purchaseQuantity) @@ -673,8 +648,7 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = - zoraNFTBase.computePaidMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); uint256 totalSales = uint256(salePrice) * purchaseQuantity; @@ -685,9 +659,9 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", address(0)); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward + mintReferralReward); - assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward + settings.mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), settings.createReferralReward); } function test_PaidMintRewardsWithMintAndCreateReferrals(uint64 salePrice, uint32 purchaseQuantity) @@ -708,8 +682,7 @@ contract ERC721DropTest is Test { presaleMerkleRoot: bytes32(0) }); - (uint256 mintReferralReward, uint256 createReferralReward, uint256 firstMinterReward, uint256 zoraReward) = - zoraNFTBase.computePaidMintRewards(purchaseQuantity); + RewardsSettings memory settings = zoraNFTBase.computePaidMintRewards(purchaseQuantity); uint256 totalReward = zoraNFTBase.computeTotalReward(purchaseQuantity); uint256 totalSales = uint256(salePrice) * purchaseQuantity; @@ -720,10 +693,10 @@ contract ERC721DropTest is Test { zoraNFTBase.mintWithRewards{value: totalPayment}(collector, purchaseQuantity, "test comment", mintReferral); assertEq(address(zoraNFTBase).balance, totalSales); - assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), firstMinterReward); - assertEq(protocolRewards.balanceOf(mintFeeRecipient), zoraReward); - assertEq(protocolRewards.balanceOf(mintReferral), mintReferralReward); - assertEq(protocolRewards.balanceOf(createReferral), createReferralReward); + assertEq(protocolRewards.balanceOf(DEFAULT_FUNDS_RECIPIENT_ADDRESS), settings.firstMinterReward); + assertEq(protocolRewards.balanceOf(mintFeeRecipient), settings.zoraReward); + assertEq(protocolRewards.balanceOf(mintReferral), settings.mintReferralReward); + assertEq(protocolRewards.balanceOf(createReferral), settings.createReferralReward); } function testRevert_PaidMintRewardsInsufficientEth(uint64 salePrice, uint32 purchaseQuantity) From 111a422844f5f8d9839a9ad33484bd8586f1a8d7 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 15:10:44 -0400 Subject: [PATCH 55/70] refactor: add error for protocol rewards withdraw --- src/interfaces/IERC721Drop.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/interfaces/IERC721Drop.sol b/src/interfaces/IERC721Drop.sol index dd8d6e2..1dae224 100644 --- a/src/interfaces/IERC721Drop.sol +++ b/src/interfaces/IERC721Drop.sol @@ -31,6 +31,8 @@ interface IERC721Drop { error Withdraw_FundsSendFailure(); /// @notice Mint fee send failure error MintFee_FundsSendFailure(); + /// @notice Protocol Rewards withdraw failure + error ProtocolRewards_WithdrawSendFailure(); /// @notice Call to external metadata renderer failed. error ExternalMetadataRenderer_CallFailed(); From 56331ade6cce82ecbacace30c90f08a5ab576bcb Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 15:25:32 -0400 Subject: [PATCH 56/70] refactor: add rewards withdraw and sale event helper --- src/ERC721Drop.sol | 104 ++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 57 deletions(-) diff --git a/src/ERC721Drop.sol b/src/ERC721Drop.sol index b3a86ca..eafb28d 100644 --- a/src/ERC721Drop.sol +++ b/src/ERC721Drop.sol @@ -24,6 +24,7 @@ import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/se import {MerkleProofUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import {MathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; +import {IProtocolRewards} from "@zoralabs/protocol-rewards/dist/contracts/interfaces/IProtocolRewards.sol"; import {ERC721Rewards} from "@zoralabs/protocol-rewards/dist/contracts/abstract/ERC721/ERC721Rewards.sol"; import {ERC721RewardsStorageV1} from "@zoralabs/protocol-rewards/dist/contracts/abstract/ERC721/ERC721RewardsStorageV1.sol"; @@ -522,22 +523,7 @@ contract ERC721Drop is uint256 firstMintedTokenId = _lastMintedTokenId() - quantity; - emit IERC721Drop.Sale({ - to: recipient, - quantity: quantity, - pricePerToken: salePrice, - firstPurchasedTokenId: firstMintedTokenId - }); - - if (bytes(comment).length > 0) { - emit IERC721Drop.MintComment({ - sender: _msgSender(), - tokenContract: address(this), - tokenId: firstMintedTokenId, - quantity: quantity, - comment: comment - }); - } + _emitSaleEvents(_msgSender(), recipient, quantity, salePrice, firstMintedTokenId, comment); return firstMintedTokenId; } @@ -556,21 +542,8 @@ contract ERC721Drop is _payoutZoraFee(quantity); - emit IERC721Drop.Sale({ - to: recipient, - quantity: quantity, - pricePerToken: salePrice, - firstPurchasedTokenId: firstMintedTokenId - }); - if(bytes(comment).length > 0) { - emit IERC721Drop.MintComment({ - sender: _msgSender(), - tokenContract: address(this), - tokenId: firstMintedTokenId, - quantity: quantity, - comment: comment - }); - } + _emitSaleEvents(_msgSender(), recipient, quantity, salePrice, firstMintedTokenId, comment); + return firstMintedTokenId; } @@ -781,22 +754,7 @@ contract ERC721Drop is uint256 firstMintedTokenId = _lastMintedTokenId() - quantity; - - emit IERC721Drop.Sale({ - to: msgSender, - quantity: quantity, - pricePerToken: pricePerToken, - firstPurchasedTokenId: firstMintedTokenId - }); - if (bytes(comment).length > 0) { - emit IERC721Drop.MintComment({ - sender: msgSender, - tokenContract: address(this), - tokenId: firstMintedTokenId, - quantity: quantity, - comment: comment - }); - } + _emitSaleEvents(msgSender, msgSender, quantity, pricePerToken, firstMintedTokenId, comment); return firstMintedTokenId; } @@ -1232,16 +1190,9 @@ contract ERC721Drop is function withdraw() external nonReentrant { address sender = _msgSender(); - uint256 funds = address(this).balance; + _verifyWithdrawAccess(sender); - // Check if withdraw is allowed for sender - if ( - !hasRole(DEFAULT_ADMIN_ROLE, sender) && - !hasRole(SALES_MANAGER_ROLE, sender) && - sender != config.fundsRecipient - ) { - revert Access_WithdrawNotAllowed(); - } + uint256 funds = address(this).balance; // Payout recipient (bool successFunds, ) = config.fundsRecipient.call{ @@ -1262,7 +1213,28 @@ contract ERC721Drop is ); } - function withdrawRewards(address to, uint256 amount) external nonReentrant {} + /// @notice This withdraws ETH from the protocol rewards contract to an address specified by the contract owner. + function withdrawRewards(address to, uint256 amount) external nonReentrant { + _verifyWithdrawAccess(msg.sender); + + bytes memory data = abi.encodeWithSelector(IProtocolRewards.withdraw.selector, to, amount); + + (bool success, ) = address(protocolRewards).call(data); + + if (!success) { + revert ProtocolRewards_WithdrawSendFailure(); + } + } + + function _verifyWithdrawAccess(address msgSender) internal view { + if ( + !hasRole(DEFAULT_ADMIN_ROLE, msgSender) && + !hasRole(SALES_MANAGER_ROLE, msgSender) && + msgSender != config.fundsRecipient + ) { + revert Access_WithdrawNotAllowed(); + } + } // ,-. // `-' @@ -1475,6 +1447,24 @@ contract ERC721Drop is createReferral = recipient; } + function _emitSaleEvents(address msgSender, address recipient, uint256 quantity, uint256 pricePerToken, uint256 firstMintedTokenId, string memory comment) internal { + emit IERC721Drop.Sale({ + to: recipient, + quantity: quantity, + pricePerToken: pricePerToken, + firstPurchasedTokenId: firstMintedTokenId + }); + + if (bytes(comment).length > 0) { + emit IERC721Drop.MintComment({ + sender: msgSender, + tokenContract: address(this), + tokenId: firstMintedTokenId, + quantity: quantity, + comment: comment + }); + } + } /// @notice ERC165 supports interface /// @param interfaceId interface id to check if supported From 594e9b8fe560caca04e12f1244a2d9ddcde649a9 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 15:25:44 -0400 Subject: [PATCH 57/70] chore: update runs --- foundry.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index 0072790..318a2d1 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,7 +1,7 @@ [profile.default] solc_version = '0.8.17' optimizer = true -optimizer_runs = 500 +optimizer_runs = 300 via_ir = true out = 'out' test = 'test' From 797af0a088801b9c13d7c0794d5a04877ed55df6 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 15:29:24 -0400 Subject: [PATCH 58/70] chore: remove old var --- script/TestUpgradeAndMint.s.sol | 2 -- 1 file changed, 2 deletions(-) diff --git a/script/TestUpgradeAndMint.s.sol b/script/TestUpgradeAndMint.s.sol index c8fd496..8000657 100644 --- a/script/TestUpgradeAndMint.s.sol +++ b/script/TestUpgradeAndMint.s.sol @@ -22,8 +22,6 @@ import {ERC721DropProxy} from "../src/ERC721DropProxy.sol"; contract DeployNewERC721Drop is Script { using Strings for uint256; - address internal DEFAULT_CREATE_REFERRAL = address(0); - string configFile; function _getKey(string memory key) internal returns (address result) { From d43f79640a652db8fd8911623d0a75371998bafc Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 16:30:36 -0400 Subject: [PATCH 59/70] chore: add back OZ --- lib/openzeppelin-contracts | 1 + 1 file changed, 1 insertion(+) create mode 160000 lib/openzeppelin-contracts diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts new file mode 160000 index 0000000..c239e1a --- /dev/null +++ b/lib/openzeppelin-contracts @@ -0,0 +1 @@ +Subproject commit c239e1af8d1a1296577108dd6989a17b57434f8e From fa68e34eddcc7b131e7e2c071fcdfb3eca885e7f Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 16:46:09 -0400 Subject: [PATCH 60/70] chore: update lock --- yarn.lock | 78 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8ff5c0f..b926055 100644 --- a/yarn.lock +++ b/yarn.lock @@ -667,24 +667,24 @@ fastq "^1.6.0" "@oclif/command@^1", "@oclif/command@^1.8.15": - version "1.8.34" - resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.34.tgz#ed3b7678f1c410d1a6a3cc6a3441b825fb0b4227" - integrity sha512-9JlYRAsPzo3sziCVsZikSCgGm22aVSi9fL3ZbEpkR1yU6xd4R+m5YP75xJ57gnRv9U18aLRUl8iRYwxOuaqvhg== + version "1.8.35" + resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.35.tgz#7023f48a6b058d33ccb578c28a1522fba192efd2" + integrity sha512-oILFTe3n6WjEbhXaSJd6FPsU4H97WxkC3Q0+Y63pfTXIZ424Fb9Hlg1CazscWcJqCrhuuUag6mItdgYo0kpinw== dependencies: "@oclif/config" "^1.18.2" "@oclif/errors" "^1.3.6" "@oclif/help" "^1.0.1" - "@oclif/parser" "^3.8.15" + "@oclif/parser" "^3.8.16" debug "^4.1.1" semver "^7.5.4" -"@oclif/config@1.18.14": - version "1.18.14" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.14.tgz#b7569b92b0501fd34244c210ccae3ca4eee8a753" - integrity sha512-cLT/deFDm6A69LjAfV5ZZMMvMDlPt7sjMHYBrsOgQ5Upq5kDMgbaZM3hEbw74DmYIsuhq2E2wYrPD+Ax2qAfkA== +"@oclif/config@1.18.15": + version "1.18.15" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.15.tgz#3be95862dda32d759fc61bcadff1e7819915a112" + integrity sha512-eBTiFXGfXSzghc4Yjp3EutYU+6MrHX1kzk4j5i4CsR5AEor43ynXFrzpO6v7IwbR1KyUo+9SYE2D69Y+sHIMpg== dependencies: "@oclif/errors" "^1.3.6" - "@oclif/parser" "^3.8.14" + "@oclif/parser" "^3.8.15" debug "^4.3.4" globby "^11.1.0" is-wsl "^2.1.1" @@ -703,16 +703,16 @@ tslib "^2.0.0" "@oclif/config@^1", "@oclif/config@^1.18.2": - version "1.18.15" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.15.tgz#3be95862dda32d759fc61bcadff1e7819915a112" - integrity sha512-eBTiFXGfXSzghc4Yjp3EutYU+6MrHX1kzk4j5i4CsR5AEor43ynXFrzpO6v7IwbR1KyUo+9SYE2D69Y+sHIMpg== + version "1.18.16" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.16.tgz#3235d260ab1eb8388ebb6255bca3dd956249d796" + integrity sha512-VskIxVcN22qJzxRUq+raalq6Q3HUde7sokB7/xk5TqRZGEKRVbFeqdQBxDWwQeudiJEgcNiMvIFbMQ43dY37FA== dependencies: "@oclif/errors" "^1.3.6" - "@oclif/parser" "^3.8.15" + "@oclif/parser" "^3.8.16" debug "^4.3.4" globby "^11.1.0" is-wsl "^2.1.1" - tslib "^2.5.0" + tslib "^2.6.1" "@oclif/errors@1.3.5": version "1.3.5" @@ -737,11 +737,11 @@ wrap-ansi "^7.0.0" "@oclif/help@^1.0.1": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@oclif/help/-/help-1.0.13.tgz#7d81538851d8c76809e2d9d147008deb92483e1e" - integrity sha512-/DWgI7umEG3mmTKweKlCJ2a4iS3QIdVYXUltmpFvgfZ6YHPy1DrLRN/l8j9yqawPlPMPn8DfCbINJ9atZ+4Kcw== + version "1.0.14" + resolved "https://registry.yarnpkg.com/@oclif/help/-/help-1.0.14.tgz#da5f9fdf6f57b40b133f095cbb9c78c480975ca3" + integrity sha512-Hu2/Dyo91cgLNaqN3wkvkBGuZ7eqb0TQNVKrzGButZyaBpJzmwW4L6D4tAF390WDYZG7EubmLePlNYb+rNB4jw== dependencies: - "@oclif/config" "1.18.14" + "@oclif/config" "1.18.15" "@oclif/errors" "1.3.6" chalk "^4.1.2" indent-string "^4.0.0" @@ -756,15 +756,15 @@ resolved "https://registry.yarnpkg.com/@oclif/linewrap/-/linewrap-1.0.0.tgz#aedcb64b479d4db7be24196384897b5000901d91" integrity sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw== -"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.14", "@oclif/parser@^3.8.15": - version "3.8.15" - resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.15.tgz#b5581c288543a4a7f59e61cb186109715819b1d0" - integrity sha512-M7ljUexkyJkR2efqG+PL31fAWyWDW1dczaMKoY+sOVqk78sm23iDMOJj/1vkfUrhO+W8dhseoPFnpSB6Hewfyw== +"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.15", "@oclif/parser@^3.8.16": + version "3.8.16" + resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.16.tgz#bedfc55153075b8b2925657f8865035aa877515c" + integrity sha512-jeleXSh5izmBQ6vwyCJmbFPahPpd/ajxASi25FaYAWcvwVMzP/vKAKQXKWZun6T9K/gd6ywSsTpfAXiZAjBd6g== dependencies: "@oclif/errors" "^1.3.6" "@oclif/linewrap" "^1.0.0" chalk "^4.1.0" - tslib "^2.6.0" + tslib "^2.6.1" "@oclif/plugin-help@^3": version "3.3.1" @@ -822,16 +822,16 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== +"@types/node@*", "@types/node@^20.1.2": + version "20.4.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.6.tgz#b66b66c9bb5d49b199f03399e341c9d6036e9e88" + integrity sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA== + "@types/node@^12.7.1": version "12.20.55" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== -"@types/node@^20.1.2": - version "20.4.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.5.tgz#9dc0a5cb1ccce4f7a731660935ab70b9c00a5d69" - integrity sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg== - "@types/normalize-package-data@^2.4.0": version "2.4.1" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" @@ -842,6 +842,13 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== +"@types/ws@^8.5.4": + version "8.5.5" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.5.tgz#af587964aa06682702ee6dcbc7be41a80e4b28eb" + integrity sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg== + dependencies: + "@types/node" "*" + "@wagmi/chains@1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@wagmi/chains/-/chains-1.3.0.tgz#a17438d44abe98fdf1ec3a91df115c6bfaed39c0" @@ -3427,9 +3434,9 @@ signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== signal-exit@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" - integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== signale@^1.4.0: version "1.4.0" @@ -3715,7 +3722,7 @@ tslib@^1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.5.0, tslib@^2.6.0: +tslib@^2.0.0, tslib@^2.0.3, tslib@^2.5.0, tslib@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== @@ -3860,15 +3867,16 @@ validate-npm-package-license@^3.0.1: spdx-expression-parse "^3.0.0" viem@^1.0.0: - version "1.4.2" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.4.2.tgz#81aaff0d8ee0d39bb2994ffa6c89bf7ee4fbcde6" - integrity sha512-125E7HoOr5PrL+Iwt8853dQexwRoiPpLwPsrRvlDX94su2xoe7AYqrdfR6N9nmy6vd6mt8eQy8+LWiP3A+1dqw== + version "1.5.2" + resolved "https://registry.yarnpkg.com/viem/-/viem-1.5.2.tgz#b8b9b464c4fb211c1daec6253b3e2559b69607b7" + integrity sha512-hPs4TJ9ONZw44K8lh24I5+Qntu62DEP85yhPsGqSSyr2d9yROY/9AisLLTlrlsudhg+A+BnLQGAuqvj/X+i8Ow== dependencies: "@adraffy/ens-normalize" "1.9.0" "@noble/curves" "1.0.0" "@noble/hashes" "1.3.0" "@scure/bip32" "1.3.0" "@scure/bip39" "1.2.0" + "@types/ws" "^8.5.4" "@wagmi/chains" "1.6.0" abitype "0.9.3" isomorphic-ws "5.0.0" From c228b1f82beab52fc5717780f0a9e555e826debe Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 16:52:40 -0400 Subject: [PATCH 61/70] chore: update chain configs --- chainConfigs/420.json | 2 +- chainConfigs/5.json | 2 +- chainConfigs/84531.json | 2 +- chainConfigs/999.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chainConfigs/420.json b/chainConfigs/420.json index 0970372..1ac079d 100644 --- a/chainConfigs/420.json +++ b/chainConfigs/420.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1" + "PROTOCOL_REWARDS": "0x8237F421357F87a23ed0CFf3a5586172F210A21B" } diff --git a/chainConfigs/5.json b/chainConfigs/5.json index 0d2867c..7eeca9c 100644 --- a/chainConfigs/5.json +++ b/chainConfigs/5.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", - "PROTOCOL_REWARDS": "0x8Ca5e648C5dFEfcdDa06d627F4b490B719ccFD98" + "PROTOCOL_REWARDS": "0xD70de31dA9B9FD35aCa0D299f2850b4077024310" } diff --git a/chainConfigs/84531.json b/chainConfigs/84531.json index c481307..873cfca 100644 --- a/chainConfigs/84531.json +++ b/chainConfigs/84531.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x02539E813cA450C2c7334e885423f4A899a063Fe", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", - "PROTOCOL_REWARDS": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE" + "PROTOCOL_REWARDS": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f" } diff --git a/chainConfigs/999.json b/chainConfigs/999.json index afe9295..1387eb7 100644 --- a/chainConfigs/999.json +++ b/chainConfigs/999.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f" + "PROTOCOL_REWARDS": "0x39Bcc1e15b8ec15684F17fEf298151F4A544B591" } \ No newline at end of file From 4a8263f035c205934df854fb49d1cf68768dea51 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 2 Aug 2023 17:53:23 -0400 Subject: [PATCH 62/70] chore: update testnets --- addresses/420.json | 4 ++-- addresses/5.json | 4 ++-- addresses/84531.json | 4 ++-- addresses/999.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addresses/420.json b/addresses/420.json index 933ac2d..f06dc1e 100644 --- a/addresses/420.json +++ b/addresses/420.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xCe6B190956D73dA045bA348743E4C1cb6652f37f", "EDITION_METADATA_RENDERER": "0x169007EF8fF4d2a225f361654e4B8280910fD8FC", - "ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07", + "ERC721DROP_IMPL": "0x932A29Dbfc1B8c3BdfC763eF53F113486A5b5E7D", "FACTORY_UPGRADE_GATE": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_NFT_CREATOR_PROXY": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", - "ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8", + "ZORA_NFT_CREATOR_V1_IMPL": "0x8cfbF874A12b346115003532119C29f6B56719CB", "timestamp": 1683668679, "commit": "e100eee" } \ No newline at end of file diff --git a/addresses/5.json b/addresses/5.json index 0469acd..39b42f6 100644 --- a/addresses/5.json +++ b/addresses/5.json @@ -3,8 +3,8 @@ "ZORA_FEE_MANAGER": "0xCf5E957CA7b77EC16611992d79f4E179132ad98C", "EDITION_METADATA_RENDERER": "0x2f5C21EF9DdFf9A1FE76a1c55dd5112fcf2EfD39", "DROP_METADATA_RENDERER": "0x5956Fd16c4d8c4b4711F2551971aBB7c2F4aF677", - "ERC721_DROP": "0x242f0EE150a171CC250685F19faA062D79bd3170", + "ERC721_DROP": "0x8d7c01361d5e764f6Dd0d502f72769CE6124E5d9", "FACTORY_UPGRADE_GATE": "0x942C03C7afE5c8118BDB728Aa06d1b894B1cD9A8", "ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", - "ZORA_NFT_CREATOR_V1_IMPL": "0x2d54733cBebb23b8a10a935f6B42Efaaa9f5d27e" + "ZORA_NFT_CREATOR_V1_IMPL": "0x669c0E36c7C3b7Ba984F746c43C5b7C073db7197" } diff --git a/addresses/84531.json b/addresses/84531.json index 262d44f..1c126e0 100644 --- a/addresses/84531.json +++ b/addresses/84531.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a", "EDITION_METADATA_RENDERER": "0xC5c958a65656A84b74100D1d420a1819fEA18d41", - "ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07", + "ERC721DROP_IMPL": "0x2810D376AC3b80C443ddD3F4e84E036F2e90622A", "FACTORY_UPGRADE_GATE": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", "ZORA_NFT_CREATOR_PROXY": "0x87cfd516c5ea86e50b950678CA970a8a28de27ac", - "ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8" + "ZORA_NFT_CREATOR_V1_IMPL": "0x0Ba958A449701907302e28F5955fa9d16dDC45c3" } diff --git a/addresses/999.json b/addresses/999.json index 527bb2e..84dd2f2 100644 --- a/addresses/999.json +++ b/addresses/999.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", "EDITION_METADATA_RENDERER": "0x481c56e15A9B2987Bd6041043e1d807697505d23", - "ERC721DROP_IMPL": "0xa1F45f5B50e16E79366867E91fE45c181D18Cb67", + "ERC721DROP_IMPL": "0x489f8fFbd5f5eA8875c2EbC5CA9ED1214BD77F42", "FACTORY_UPGRADE_GATE": "0x2068BA7Be6e22b97d21f5eb6e152A36d2Dc27da2", "ZORA_NFT_CREATOR_PROXY": "0xeB29A4e5b84fef428c072debA2444e93c080CE87", - "ZORA_NFT_CREATOR_V1_IMPL": "0x2D6d587e9B09fa01405A5816938554ccdeEf69db" + "ZORA_NFT_CREATOR_V1_IMPL": "0x8d7c01361d5e764f6Dd0d502f72769CE6124E5d9" } \ No newline at end of file From 15193ab96a0ee419363784077dd621ac5f710f9e Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Thu, 3 Aug 2023 00:52:38 -0400 Subject: [PATCH 63/70] chore: update deploys --- addresses/420.json | 4 ++-- addresses/5.json | 4 ++-- addresses/84531.json | 4 ++-- addresses/999.json | 4 ++-- chainConfigs/1.json | 3 ++- chainConfigs/10.json | 3 ++- chainConfigs/420.json | 2 +- chainConfigs/424.json | 3 ++- chainConfigs/5.json | 2 +- chainConfigs/7777777.json | 3 ++- chainConfigs/8453.json | 3 ++- chainConfigs/84531.json | 2 +- chainConfigs/999.json | 2 +- 13 files changed, 22 insertions(+), 17 deletions(-) diff --git a/addresses/420.json b/addresses/420.json index 933ac2d..f06dc1e 100644 --- a/addresses/420.json +++ b/addresses/420.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xCe6B190956D73dA045bA348743E4C1cb6652f37f", "EDITION_METADATA_RENDERER": "0x169007EF8fF4d2a225f361654e4B8280910fD8FC", - "ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07", + "ERC721DROP_IMPL": "0x932A29Dbfc1B8c3BdfC763eF53F113486A5b5E7D", "FACTORY_UPGRADE_GATE": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_NFT_CREATOR_PROXY": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", - "ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8", + "ZORA_NFT_CREATOR_V1_IMPL": "0x8cfbF874A12b346115003532119C29f6B56719CB", "timestamp": 1683668679, "commit": "e100eee" } \ No newline at end of file diff --git a/addresses/5.json b/addresses/5.json index 0469acd..39b42f6 100644 --- a/addresses/5.json +++ b/addresses/5.json @@ -3,8 +3,8 @@ "ZORA_FEE_MANAGER": "0xCf5E957CA7b77EC16611992d79f4E179132ad98C", "EDITION_METADATA_RENDERER": "0x2f5C21EF9DdFf9A1FE76a1c55dd5112fcf2EfD39", "DROP_METADATA_RENDERER": "0x5956Fd16c4d8c4b4711F2551971aBB7c2F4aF677", - "ERC721_DROP": "0x242f0EE150a171CC250685F19faA062D79bd3170", + "ERC721_DROP": "0x8d7c01361d5e764f6Dd0d502f72769CE6124E5d9", "FACTORY_UPGRADE_GATE": "0x942C03C7afE5c8118BDB728Aa06d1b894B1cD9A8", "ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", - "ZORA_NFT_CREATOR_V1_IMPL": "0x2d54733cBebb23b8a10a935f6B42Efaaa9f5d27e" + "ZORA_NFT_CREATOR_V1_IMPL": "0x669c0E36c7C3b7Ba984F746c43C5b7C073db7197" } diff --git a/addresses/84531.json b/addresses/84531.json index 262d44f..1c126e0 100644 --- a/addresses/84531.json +++ b/addresses/84531.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a", "EDITION_METADATA_RENDERER": "0xC5c958a65656A84b74100D1d420a1819fEA18d41", - "ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07", + "ERC721DROP_IMPL": "0x2810D376AC3b80C443ddD3F4e84E036F2e90622A", "FACTORY_UPGRADE_GATE": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", "ZORA_NFT_CREATOR_PROXY": "0x87cfd516c5ea86e50b950678CA970a8a28de27ac", - "ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8" + "ZORA_NFT_CREATOR_V1_IMPL": "0x0Ba958A449701907302e28F5955fa9d16dDC45c3" } diff --git a/addresses/999.json b/addresses/999.json index 527bb2e..84dd2f2 100644 --- a/addresses/999.json +++ b/addresses/999.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", "EDITION_METADATA_RENDERER": "0x481c56e15A9B2987Bd6041043e1d807697505d23", - "ERC721DROP_IMPL": "0xa1F45f5B50e16E79366867E91fE45c181D18Cb67", + "ERC721DROP_IMPL": "0x489f8fFbd5f5eA8875c2EbC5CA9ED1214BD77F42", "FACTORY_UPGRADE_GATE": "0x2068BA7Be6e22b97d21f5eb6e152A36d2Dc27da2", "ZORA_NFT_CREATOR_PROXY": "0xeB29A4e5b84fef428c072debA2444e93c080CE87", - "ZORA_NFT_CREATOR_V1_IMPL": "0x2D6d587e9B09fa01405A5816938554ccdeEf69db" + "ZORA_NFT_CREATOR_V1_IMPL": "0x8d7c01361d5e764f6Dd0d502f72769CE6124E5d9" } \ No newline at end of file diff --git a/chainConfigs/1.json b/chainConfigs/1.json index 2eed09a..e34ec32 100644 --- a/chainConfigs/1.json +++ b/chainConfigs/1.json @@ -4,5 +4,6 @@ "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", - "ZORA_ERC721_TRANSFER_HELPER": "0x909e9efE4D87d1a6018C2065aE642b6D0447bc91" + "ZORA_ERC721_TRANSFER_HELPER": "0x909e9efE4D87d1a6018C2065aE642b6D0447bc91", + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } diff --git a/chainConfigs/10.json b/chainConfigs/10.json index 2465ac4..80fc879 100644 --- a/chainConfigs/10.json +++ b/chainConfigs/10.json @@ -4,5 +4,6 @@ "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0x7A810DCd0f8d83B20212326813Db6EF7E9FD030c", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", - "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000" + "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } diff --git a/chainConfigs/420.json b/chainConfigs/420.json index 1ac079d..d1574a3 100644 --- a/chainConfigs/420.json +++ b/chainConfigs/420.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x8237F421357F87a23ed0CFf3a5586172F210A21B" + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } diff --git a/chainConfigs/424.json b/chainConfigs/424.json index 3d66d97..7212b2d 100644 --- a/chainConfigs/424.json +++ b/chainConfigs/424.json @@ -5,5 +5,6 @@ "MINT_FEE_RECIPIENT": "0x95FD5d77B206cCc0B1f7D7A4077fbE8eb4fC31eF", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "SUBSCRIPTION_MARKET_FILTER_OWNER": "0x0000000000000000000000000000000000000000", - "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000" + "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } diff --git a/chainConfigs/5.json b/chainConfigs/5.json index 7eeca9c..0defc5a 100644 --- a/chainConfigs/5.json +++ b/chainConfigs/5.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", - "PROTOCOL_REWARDS": "0xD70de31dA9B9FD35aCa0D299f2850b4077024310" + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } diff --git a/chainConfigs/7777777.json b/chainConfigs/7777777.json index f9f8908..deb532a 100644 --- a/chainConfigs/7777777.json +++ b/chainConfigs/7777777.json @@ -4,5 +4,6 @@ "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0xEcfc2ee50409E459c554a2b0376F882Ce916D853", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", - "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000" + "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } \ No newline at end of file diff --git a/chainConfigs/8453.json b/chainConfigs/8453.json index 916b019..5337f43 100644 --- a/chainConfigs/8453.json +++ b/chainConfigs/8453.json @@ -4,5 +4,6 @@ "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0x7bf90111Ad7C22bec9E9dFf8A01A44713CC1b1B6", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x000000000000AAeB6D7670E522A718067333cd4E", - "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000" + "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } diff --git a/chainConfigs/84531.json b/chainConfigs/84531.json index 873cfca..8828691 100644 --- a/chainConfigs/84531.json +++ b/chainConfigs/84531.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x02539E813cA450C2c7334e885423f4A899a063Fe", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", - "PROTOCOL_REWARDS": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f" + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } diff --git a/chainConfigs/999.json b/chainConfigs/999.json index 1387eb7..d52416a 100644 --- a/chainConfigs/999.json +++ b/chainConfigs/999.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x39Bcc1e15b8ec15684F17fEf298151F4A544B591" + "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" } \ No newline at end of file From 2489222aa7dec188d1596b42165a7448c0a34560 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Sun, 6 Aug 2023 15:16:50 -0400 Subject: [PATCH 64/70] chore: update deployments --- addresses/1.json | 4 ++-- addresses/10.json | 4 ++-- addresses/5.json | 4 ++-- addresses/7777777.json | 4 ++-- addresses/8453.json | 4 ++-- addresses/84531.json | 4 ++-- addresses/999.json | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addresses/1.json b/addresses/1.json index 28c6196..e2b4587 100644 --- a/addresses/1.json +++ b/addresses/1.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x5914d9a241008b9f02f22811bf3a77e02b84d226", "EDITION_METADATA_RENDERER": "0x192ce8267cbab9c3c477d61e85d7f0c5fe3b46af", - "ERC721DROP_IMPL": "0x419074d73Cf0852e46b8531b430B1230C348C291", + "ERC721DROP_IMPL": "0x805E0a08dE70f85C01F7848370d5e3fc08aAd0ea", "FACTORY_UPGRADE_GATE": "0x8Da5aC3A39D3B8BCaA1FC15A01506cf4F5e79830", "ZORA_NFT_CREATOR_PROXY": "0xF74B146ce44CC162b601deC3BE331784DB111DC1", - "ZORA_NFT_CREATOR_V1_IMPL": "0xa6a2956fa075d50b021385478A99f3642dAfCc2C" + "ZORA_NFT_CREATOR_V1_IMPL": "0xeB29A4e5b84fef428c072debA2444e93c080CE87" } diff --git a/addresses/10.json b/addresses/10.json index 26443e0..1c8ed8b 100644 --- a/addresses/10.json +++ b/addresses/10.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0x96CcF205A366E15E261d77B14586389f80a029e9", "EDITION_METADATA_RENDERER": "0xa2a7D8bcE0bf58D177137ECB94f3Fa6aA06aA7A1", - "ERC721DROP_IMPL": "0x46E772210f01647FA573b915bE287Ff9b65AD4B0", + "ERC721DROP_IMPL": "0x0ABdD5AA61E9107519DB7cD626442B905284B7eb", "FACTORY_UPGRADE_GATE": "0x192D663C3D6813a24a24582A76B8d872c4F6F7f9", "ZORA_NFT_CREATOR_PROXY": "0x7d1a46c6e614A0091c39E102F2798C27c1fA8892", - "ZORA_NFT_CREATOR_V1_IMPL": "0xd1cba36d92B052079523F471Eb891563F2E5dF5C", + "ZORA_NFT_CREATOR_V1_IMPL": "0x0fbAB7302F9351dD1DB6674cc3bB855f0C55840B", "timestamp": 1683682873, "commit": "8b52993" } \ No newline at end of file diff --git a/addresses/5.json b/addresses/5.json index 39b42f6..94b0cd4 100644 --- a/addresses/5.json +++ b/addresses/5.json @@ -3,8 +3,8 @@ "ZORA_FEE_MANAGER": "0xCf5E957CA7b77EC16611992d79f4E179132ad98C", "EDITION_METADATA_RENDERER": "0x2f5C21EF9DdFf9A1FE76a1c55dd5112fcf2EfD39", "DROP_METADATA_RENDERER": "0x5956Fd16c4d8c4b4711F2551971aBB7c2F4aF677", - "ERC721_DROP": "0x8d7c01361d5e764f6Dd0d502f72769CE6124E5d9", + "ERC721_DROP": "0xd0aEF09cDb402F19244BbA5D7790FC071671Fb0C", "FACTORY_UPGRADE_GATE": "0x942C03C7afE5c8118BDB728Aa06d1b894B1cD9A8", "ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", - "ZORA_NFT_CREATOR_V1_IMPL": "0x669c0E36c7C3b7Ba984F746c43C5b7C073db7197" + "ZORA_NFT_CREATOR_V1_IMPL": "0x6e920c877E7928C1eD70e4CacCB8F8d4D4996332" } diff --git a/addresses/7777777.json b/addresses/7777777.json index bac272a..f815edb 100644 --- a/addresses/7777777.json +++ b/addresses/7777777.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0x4A0ad3Ef9bE8095590D854bC8481C9E50922a3c0", "EDITION_METADATA_RENDERER": "0xCA7bF48453B72e4E175267127B4Ed7EB12F83b93", - "ERC721DROP_IMPL": "0x8ee55A8598EC2CE412a476890695fa0E7154510c", + "ERC721DROP_IMPL": "0x0fbAB7302F9351dD1DB6674cc3bB855f0C55840B", "FACTORY_UPGRADE_GATE": "0x446A4135FB31007064107EFfDC15B8843B72B6F6", "ZORA_NFT_CREATOR_PROXY": "0xA2c2A96A232113Dd4993E8b048EEbc3371AE8d85", - "ZORA_NFT_CREATOR_V1_IMPL": "0xe7763512099a9C2567a40a669aA9F48FF8493455", + "ZORA_NFT_CREATOR_V1_IMPL": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE", "timestamp": 1686787866, "commit": "87735a2" } \ No newline at end of file diff --git a/addresses/8453.json b/addresses/8453.json index ff4f8d2..dab217f 100644 --- a/addresses/8453.json +++ b/addresses/8453.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xF77330C8b1c41f2e44470763Cf9E3ACa78Db4381", "EDITION_METADATA_RENDERER": "0x2008C05685F9fA15BBD75d80e9A44ab0c7230577", - "ERC721DROP_IMPL": "0x3F155E58AcA1AE60e4FEce2753CC6B363525042c", + "ERC721DROP_IMPL": "0x0fbAB7302F9351dD1DB6674cc3bB855f0C55840B", "FACTORY_UPGRADE_GATE": "0x532142aE8e53a5F92B9dE1a43F1FFD6eF789e65e", "ZORA_NFT_CREATOR_PROXY": "0x58C3ccB2dcb9384E5AB9111CD1a5DEA916B0f33c", - "ZORA_NFT_CREATOR_V1_IMPL": "0xba187429b966788B5C11a99A848938c88DfDFf5C", + "ZORA_NFT_CREATOR_V1_IMPL": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE", "timestamp": 1689712140, "commit": "a9e390f" } \ No newline at end of file diff --git a/addresses/84531.json b/addresses/84531.json index 1c126e0..629b926 100644 --- a/addresses/84531.json +++ b/addresses/84531.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a", "EDITION_METADATA_RENDERER": "0xC5c958a65656A84b74100D1d420a1819fEA18d41", - "ERC721DROP_IMPL": "0x2810D376AC3b80C443ddD3F4e84E036F2e90622A", + "ERC721DROP_IMPL": "0x242f0EE150a171CC250685F19faA062D79bd3170", "FACTORY_UPGRADE_GATE": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", "ZORA_NFT_CREATOR_PROXY": "0x87cfd516c5ea86e50b950678CA970a8a28de27ac", - "ZORA_NFT_CREATOR_V1_IMPL": "0x0Ba958A449701907302e28F5955fa9d16dDC45c3" + "ZORA_NFT_CREATOR_V1_IMPL": "0x2d54733cBebb23b8a10a935f6B42Efaaa9f5d27e" } diff --git a/addresses/999.json b/addresses/999.json index 84dd2f2..e95bdf5 100644 --- a/addresses/999.json +++ b/addresses/999.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", "EDITION_METADATA_RENDERER": "0x481c56e15A9B2987Bd6041043e1d807697505d23", - "ERC721DROP_IMPL": "0x489f8fFbd5f5eA8875c2EbC5CA9ED1214BD77F42", + "ERC721DROP_IMPL": "0x2372671877EFB92A04b6778d0490ed4B06882751", "FACTORY_UPGRADE_GATE": "0x2068BA7Be6e22b97d21f5eb6e152A36d2Dc27da2", "ZORA_NFT_CREATOR_PROXY": "0xeB29A4e5b84fef428c072debA2444e93c080CE87", - "ZORA_NFT_CREATOR_V1_IMPL": "0x8d7c01361d5e764f6Dd0d502f72769CE6124E5d9" + "ZORA_NFT_CREATOR_V1_IMPL": "0x13D48CF16917Bbc91810153d4D4e3284609C3CDc" } \ No newline at end of file From 13a4d115254396b78c0e4f22a3c3306b3f57284d Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Sun, 6 Aug 2023 15:37:48 -0400 Subject: [PATCH 65/70] chore: update op goerli --- addresses/420.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addresses/420.json b/addresses/420.json index f06dc1e..ce4d50b 100644 --- a/addresses/420.json +++ b/addresses/420.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xCe6B190956D73dA045bA348743E4C1cb6652f37f", "EDITION_METADATA_RENDERER": "0x169007EF8fF4d2a225f361654e4B8280910fD8FC", - "ERC721DROP_IMPL": "0x932A29Dbfc1B8c3BdfC763eF53F113486A5b5E7D", + "ERC721DROP_IMPL": "0xcFbdC68dfF1E6c8D9e6979DF8B11aF33D978D911", "FACTORY_UPGRADE_GATE": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_NFT_CREATOR_PROXY": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", - "ZORA_NFT_CREATOR_V1_IMPL": "0x8cfbF874A12b346115003532119C29f6B56719CB", + "ZORA_NFT_CREATOR_V1_IMPL": "0x36ac36e1b68Ec516398C12b6631ed552B0F1fE2D", "timestamp": 1683668679, "commit": "e100eee" } \ No newline at end of file From 6b7d2580291d0596ad8aafb3a6ccd6c7a87b78d4 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Mon, 7 Aug 2023 22:47:35 -0400 Subject: [PATCH 66/70] chore: update chain configs --- chainConfigs/1.json | 2 +- chainConfigs/10.json | 2 +- chainConfigs/420.json | 2 +- chainConfigs/5.json | 2 +- chainConfigs/7777777.json | 2 +- chainConfigs/8453.json | 2 +- chainConfigs/84531.json | 2 +- chainConfigs/999.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chainConfigs/1.json b/chainConfigs/1.json index e34ec32..338a6e5 100644 --- a/chainConfigs/1.json +++ b/chainConfigs/1.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0x909e9efE4D87d1a6018C2065aE642b6D0447bc91", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } diff --git a/chainConfigs/10.json b/chainConfigs/10.json index 80fc879..2f069f8 100644 --- a/chainConfigs/10.json +++ b/chainConfigs/10.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x7A810DCd0f8d83B20212326813Db6EF7E9FD030c", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } diff --git a/chainConfigs/420.json b/chainConfigs/420.json index d1574a3..ea95149 100644 --- a/chainConfigs/420.json +++ b/chainConfigs/420.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } diff --git a/chainConfigs/5.json b/chainConfigs/5.json index 0defc5a..f8bbea0 100644 --- a/chainConfigs/5.json +++ b/chainConfigs/5.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } diff --git a/chainConfigs/7777777.json b/chainConfigs/7777777.json index deb532a..5654c34 100644 --- a/chainConfigs/7777777.json +++ b/chainConfigs/7777777.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0xEcfc2ee50409E459c554a2b0376F882Ce916D853", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } \ No newline at end of file diff --git a/chainConfigs/8453.json b/chainConfigs/8453.json index 5337f43..94f50e2 100644 --- a/chainConfigs/8453.json +++ b/chainConfigs/8453.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x7bf90111Ad7C22bec9E9dFf8A01A44713CC1b1B6", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x000000000000AAeB6D7670E522A718067333cd4E", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } diff --git a/chainConfigs/84531.json b/chainConfigs/84531.json index 8828691..2ef8eb9 100644 --- a/chainConfigs/84531.json +++ b/chainConfigs/84531.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x02539E813cA450C2c7334e885423f4A899a063Fe", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } diff --git a/chainConfigs/999.json b/chainConfigs/999.json index d52416a..273cc19 100644 --- a/chainConfigs/999.json +++ b/chainConfigs/999.json @@ -5,5 +5,5 @@ "MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000", - "PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32" + "PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B" } \ No newline at end of file From 2478acf80cab3ce48ccb0fa4811ac6a9ec30e283 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 9 Aug 2023 01:12:46 -0400 Subject: [PATCH 67/70] fix: consistent chain config amounts --- chainConfigs/11155111.json | 2 +- chainConfigs/58008.json | 2 +- chainConfigs/84531.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chainConfigs/11155111.json b/chainConfigs/11155111.json index b448462..6e0ce65 100644 --- a/chainConfigs/11155111.json +++ b/chainConfigs/11155111.json @@ -1,7 +1,7 @@ { "FACTORY_OWNER": "0xE51051a204afb2fC071A2406914cdEA5638e5018", "FACTORY_UPGRADE_GATE_OWNER": "0xE51051a204afb2fC071A2406914cdEA5638e5018", - "MINT_FEE_AMOUNT": 111000000000000, + "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0xE51051a204afb2fC071A2406914cdEA5638e5018", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "SUBSCRIPTION_MARKET_FILTER_OWNER": "0xE51051a204afb2fC071A2406914cdEA5638e5018", diff --git a/chainConfigs/58008.json b/chainConfigs/58008.json index 33e5b3a..c917fc9 100644 --- a/chainConfigs/58008.json +++ b/chainConfigs/58008.json @@ -1,7 +1,7 @@ { "FACTORY_OWNER": "0xfAe426B462f4Bc9857ED28D8473Fb85192f23E9b", "FACTORY_UPGRADE_GATE_OWNER": "0xfAe426B462f4Bc9857ED28D8473Fb85192f23E9b", - "MINT_FEE_AMOUNT": 111000000000000, + "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0x917D86f1eBD1d9f59Dae1C00e5Af7f8689299EC4", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000", "SUBSCRIPTION_MARKET_FILTER_OWNER": "0x0000000000000000000000000000000000000000", diff --git a/chainConfigs/84531.json b/chainConfigs/84531.json index 2ef8eb9..721b586 100644 --- a/chainConfigs/84531.json +++ b/chainConfigs/84531.json @@ -1,7 +1,7 @@ { "FACTORY_OWNER": "0x02539E813cA450C2c7334e885423f4A899a063Fe", "FACTORY_UPGRADE_GATE_OWNER": "0x02539E813cA450C2c7334e885423f4A899a063Fe", - "MINT_FEE_AMOUNT": 111000000000000, + "MINT_FEE_AMOUNT": 777000000000000, "MINT_FEE_RECIPIENT": "0x02539E813cA450C2c7334e885423f4A899a063Fe", "SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f", From 90d5e1af0d02396beda0368b8cdcf5def3d23081 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 9 Aug 2023 01:12:56 -0400 Subject: [PATCH 68/70] chore: update deploys --- addresses/1.json | 4 ++-- addresses/10.json | 4 ++-- addresses/420.json | 4 ++-- addresses/5.json | 4 ++-- addresses/7777777.json | 4 ++-- addresses/8453.json | 4 ++-- addresses/84531.json | 4 ++-- addresses/999.json | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addresses/1.json b/addresses/1.json index e2b4587..45cb0ad 100644 --- a/addresses/1.json +++ b/addresses/1.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x5914d9a241008b9f02f22811bf3a77e02b84d226", "EDITION_METADATA_RENDERER": "0x192ce8267cbab9c3c477d61e85d7f0c5fe3b46af", - "ERC721DROP_IMPL": "0x805E0a08dE70f85C01F7848370d5e3fc08aAd0ea", + "ERC721DROP_IMPL": "0x8237F421357F87a23ed0CFf3a5586172F210A21B", "FACTORY_UPGRADE_GATE": "0x8Da5aC3A39D3B8BCaA1FC15A01506cf4F5e79830", "ZORA_NFT_CREATOR_PROXY": "0xF74B146ce44CC162b601deC3BE331784DB111DC1", - "ZORA_NFT_CREATOR_V1_IMPL": "0xeB29A4e5b84fef428c072debA2444e93c080CE87" + "ZORA_NFT_CREATOR_V1_IMPL": "0x932A29Dbfc1B8c3BdfC763eF53F113486A5b5E7D" } diff --git a/addresses/10.json b/addresses/10.json index 1c8ed8b..526d419 100644 --- a/addresses/10.json +++ b/addresses/10.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0x96CcF205A366E15E261d77B14586389f80a029e9", "EDITION_METADATA_RENDERER": "0xa2a7D8bcE0bf58D177137ECB94f3Fa6aA06aA7A1", - "ERC721DROP_IMPL": "0x0ABdD5AA61E9107519DB7cD626442B905284B7eb", + "ERC721DROP_IMPL": "0x3E8524770adD176bE381a0529E09f1c6c3502A5a", "FACTORY_UPGRADE_GATE": "0x192D663C3D6813a24a24582A76B8d872c4F6F7f9", "ZORA_NFT_CREATOR_PROXY": "0x7d1a46c6e614A0091c39E102F2798C27c1fA8892", - "ZORA_NFT_CREATOR_V1_IMPL": "0x0fbAB7302F9351dD1DB6674cc3bB855f0C55840B", + "ZORA_NFT_CREATOR_V1_IMPL": "0x805E0a08dE70f85C01F7848370d5e3fc08aAd0ea", "timestamp": 1683682873, "commit": "8b52993" } \ No newline at end of file diff --git a/addresses/420.json b/addresses/420.json index ce4d50b..fac3e4d 100644 --- a/addresses/420.json +++ b/addresses/420.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xCe6B190956D73dA045bA348743E4C1cb6652f37f", "EDITION_METADATA_RENDERER": "0x169007EF8fF4d2a225f361654e4B8280910fD8FC", - "ERC721DROP_IMPL": "0xcFbdC68dfF1E6c8D9e6979DF8B11aF33D978D911", + "ERC721DROP_IMPL": "0x61Cb091f8EC70029E393D31BA8F6D533c1308408", "FACTORY_UPGRADE_GATE": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340", "ZORA_NFT_CREATOR_PROXY": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", - "ZORA_NFT_CREATOR_V1_IMPL": "0x36ac36e1b68Ec516398C12b6631ed552B0F1fE2D", + "ZORA_NFT_CREATOR_V1_IMPL": "0xbe83E15eED1FD666C241960f50549bE9D639743c", "timestamp": 1683668679, "commit": "e100eee" } \ No newline at end of file diff --git a/addresses/5.json b/addresses/5.json index 94b0cd4..5f9b3f6 100644 --- a/addresses/5.json +++ b/addresses/5.json @@ -3,8 +3,8 @@ "ZORA_FEE_MANAGER": "0xCf5E957CA7b77EC16611992d79f4E179132ad98C", "EDITION_METADATA_RENDERER": "0x2f5C21EF9DdFf9A1FE76a1c55dd5112fcf2EfD39", "DROP_METADATA_RENDERER": "0x5956Fd16c4d8c4b4711F2551971aBB7c2F4aF677", - "ERC721_DROP": "0xd0aEF09cDb402F19244BbA5D7790FC071671Fb0C", + "ERC721DROP_IMPL": "0xe4c17055048aEe01D0d122804816fEe5E6ac4A67", "FACTORY_UPGRADE_GATE": "0x942C03C7afE5c8118BDB728Aa06d1b894B1cD9A8", "ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", - "ZORA_NFT_CREATOR_V1_IMPL": "0x6e920c877E7928C1eD70e4CacCB8F8d4D4996332" + "ZORA_NFT_CREATOR_V1_IMPL": "0x0209aAEC870BE5C1cC243eE18eF6e80d545e9F32" } diff --git a/addresses/7777777.json b/addresses/7777777.json index f815edb..add45f1 100644 --- a/addresses/7777777.json +++ b/addresses/7777777.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0x4A0ad3Ef9bE8095590D854bC8481C9E50922a3c0", "EDITION_METADATA_RENDERER": "0xCA7bF48453B72e4E175267127B4Ed7EB12F83b93", - "ERC721DROP_IMPL": "0x0fbAB7302F9351dD1DB6674cc3bB855f0C55840B", + "ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07", "FACTORY_UPGRADE_GATE": "0x446A4135FB31007064107EFfDC15B8843B72B6F6", "ZORA_NFT_CREATOR_PROXY": "0xA2c2A96A232113Dd4993E8b048EEbc3371AE8d85", - "ZORA_NFT_CREATOR_V1_IMPL": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE", + "ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8", "timestamp": 1686787866, "commit": "87735a2" } \ No newline at end of file diff --git a/addresses/8453.json b/addresses/8453.json index dab217f..ca7945c 100644 --- a/addresses/8453.json +++ b/addresses/8453.json @@ -1,10 +1,10 @@ { "DROP_METADATA_RENDERER": "0xF77330C8b1c41f2e44470763Cf9E3ACa78Db4381", "EDITION_METADATA_RENDERER": "0x2008C05685F9fA15BBD75d80e9A44ab0c7230577", - "ERC721DROP_IMPL": "0x0fbAB7302F9351dD1DB6674cc3bB855f0C55840B", + "ERC721DROP_IMPL": "0x8Ca5e648C5dFEfcdDa06d627F4b490B719ccFD98", "FACTORY_UPGRADE_GATE": "0x532142aE8e53a5F92B9dE1a43F1FFD6eF789e65e", "ZORA_NFT_CREATOR_PROXY": "0x58C3ccB2dcb9384E5AB9111CD1a5DEA916B0f33c", - "ZORA_NFT_CREATOR_V1_IMPL": "0xd34872BE0cdb6b09d45FCa067B07f04a1A9aE1aE", + "ZORA_NFT_CREATOR_V1_IMPL": "0x76CC78EF3aafD52e716a8e37F3dBbE0C42c51d54", "timestamp": 1689712140, "commit": "a9e390f" } \ No newline at end of file diff --git a/addresses/84531.json b/addresses/84531.json index 629b926..b634a46 100644 --- a/addresses/84531.json +++ b/addresses/84531.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a", "EDITION_METADATA_RENDERER": "0xC5c958a65656A84b74100D1d420a1819fEA18d41", - "ERC721DROP_IMPL": "0x242f0EE150a171CC250685F19faA062D79bd3170", + "ERC721DROP_IMPL": "0x39Bcc1e15b8ec15684F17fEf298151F4A544B591", "FACTORY_UPGRADE_GATE": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3", "ZORA_NFT_CREATOR_PROXY": "0x87cfd516c5ea86e50b950678CA970a8a28de27ac", - "ZORA_NFT_CREATOR_V1_IMPL": "0x2d54733cBebb23b8a10a935f6B42Efaaa9f5d27e" + "ZORA_NFT_CREATOR_V1_IMPL": "0x489f8fFbd5f5eA8875c2EbC5CA9ED1214BD77F42" } diff --git a/addresses/999.json b/addresses/999.json index e95bdf5..395e58e 100644 --- a/addresses/999.json +++ b/addresses/999.json @@ -1,8 +1,8 @@ { "DROP_METADATA_RENDERER": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519", "EDITION_METADATA_RENDERER": "0x481c56e15A9B2987Bd6041043e1d807697505d23", - "ERC721DROP_IMPL": "0x2372671877EFB92A04b6778d0490ed4B06882751", + "ERC721DROP_IMPL": "0x293997C6a1f2A1cA3aB971f548c4D95585E46282", "FACTORY_UPGRADE_GATE": "0x2068BA7Be6e22b97d21f5eb6e152A36d2Dc27da2", "ZORA_NFT_CREATOR_PROXY": "0xeB29A4e5b84fef428c072debA2444e93c080CE87", - "ZORA_NFT_CREATOR_V1_IMPL": "0x13D48CF16917Bbc91810153d4D4e3284609C3CDc" + "ZORA_NFT_CREATOR_V1_IMPL": "0xe4c17055048aEe01D0d122804816fEe5E6ac4A67" } \ No newline at end of file From 59b3e58d39adcfb1050065f0a311a9b02b7132b9 Mon Sep 17 00:00:00 2001 From: Rohan Kulkarni Date: Wed, 9 Aug 2023 01:13:52 -0400 Subject: [PATCH 69/70] fix: remove chain config key --- src/DeploymentConfig.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DeploymentConfig.sol b/src/DeploymentConfig.sol index 0933f7c..d68d7cf 100644 --- a/src/DeploymentConfig.sol +++ b/src/DeploymentConfig.sol @@ -91,7 +91,6 @@ abstract contract DeploymentConfig is StdChains, StdCheatsSafe, StdUtils, Script chainConfig.mintFeeAmount = json.readUint(getKeyPrefix(MINT_FEE_AMOUNT)); chainConfig.mintFeeRecipient = json.readAddress(getKeyPrefix(MINT_FEE_RECIPIENT)); chainConfig.subscriptionMarketFilterAddress = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_ADDRESS)); - chainConfig.subscriptionMarketFilterOwner = json.readAddress(getKeyPrefix(SUBSCRIPTION_MARKET_FILTER_OWNER)); chainConfig.zoraERC721TransferHelper = json.readAddress(getKeyPrefix(ZORA_ERC721_TRANSFER_HELPER)); chainConfig.protocolRewards = json.readAddress(getKeyPrefix(PROTOCOL_REWARDS)); } From 857219f20d12fc4f42e0233ef96c93c8e099d65b Mon Sep 17 00:00:00 2001 From: James Geary <36774175+jgeary@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:15:41 -0400 Subject: [PATCH 70/70] generate new storage layout --- .storage-layout | 1 + 1 file changed, 1 insertion(+) diff --git a/.storage-layout b/.storage-layout index fddfd12..e549afa 100644 --- a/.storage-layout +++ b/.storage-layout @@ -31,6 +31,7 @@ | salesConfig | struct IERC721Drop.SalesConfiguration | 354 | 0 | 96 | src/ERC721Drop.sol:ERC721Drop | | presaleMintsByAddress | mapping(address => uint256) | 357 | 0 | 32 | src/ERC721Drop.sol:ERC721Drop | | royaltyMintSchedule | uint32 | 358 | 0 | 4 | src/ERC721Drop.sol:ERC721Drop | +| createReferral | address | 358 | 4 | 20 | src/ERC721Drop.sol:ERC721Drop | ======================= ➡ ERC721DropProxy