Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: protocol rewards #143

Merged
merged 77 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
ce66a42
chore: add zora rewards package
kulkarohan Jun 6, 2023
6b9ac3d
chore: update remappings
kulkarohan Jun 6, 2023
943cd74
refactor: add ERC721Rewards extension
kulkarohan Jun 6, 2023
d8f6939
chore: update dependencies
kulkarohan Jun 6, 2023
bbe8f11
chore: add zora rewards to scripts
kulkarohan Jun 7, 2023
21c7bbe
chore: update existing tests
kulkarohan Jun 7, 2023
4e6a9aa
feat: add purchaseWithRewards
kulkarohan Jun 7, 2023
9ae43f0
chore: update dependencies
kulkarohan Jun 7, 2023
55403c9
fix: add finder and lister params
kulkarohan Jun 7, 2023
49f3adf
chore: add rewards tests
kulkarohan Jun 7, 2023
a19b9a7
chore: reduce optimizer runs
kulkarohan Jun 7, 2023
54d322f
chore: update dependencies
kulkarohan Jun 14, 2023
b811ac7
Merge branch 'main' into zora-rewards
kulkarohan Jun 15, 2023
8e6b82c
chore: update runs
kulkarohan Jun 15, 2023
79555ea
fix: handle supply royaltes when purchasing with rewards
kulkarohan Jun 15, 2023
f796d1e
chore: update tests
kulkarohan Jun 15, 2023
1ea8b27
chore: update OZ dependency location
kulkarohan Jun 27, 2023
77ab5c3
chore: update rewards tests
kulkarohan Jun 27, 2023
a907094
Merge branch 'main' into zora-rewards
kulkarohan Jul 4, 2023
16f9300
refactor: add recipient to purchase w rewards
kulkarohan Jul 4, 2023
573cb33
chore: update rewards dep
kulkarohan Jul 4, 2023
b3e725d
refactor: update lister to origin
kulkarohan Jul 4, 2023
51aef58
chore: update tests
kulkarohan Jul 4, 2023
606197d
chore: add zora rewards to chain configs
kulkarohan Jul 4, 2023
80446d8
refactor: change purchase to mint w/ rewards
kulkarohan Jul 5, 2023
1d916cb
refactor: update referral names
kulkarohan Jul 19, 2023
6f14c57
Merge branch 'main' into zora-rewards
kulkarohan Jul 20, 2023
c21c8a3
chore: add pgn
kulkarohan Jul 28, 2023
aff942d
chore: add rewards to deploy config
kulkarohan Jul 28, 2023
8b9f79b
chore: update dependencies
kulkarohan Jul 28, 2023
f3a9c01
refactor: set create referral on initialization
kulkarohan Jul 28, 2023
630c4c3
refactor: add create referral to factory
kulkarohan Jul 28, 2023
517fea9
chore: update scripts w/ default create referral
kulkarohan Jul 28, 2023
115fc54
chore: update tests
kulkarohan Jul 28, 2023
c8876f3
chore: update create referral tests
kulkarohan Jul 28, 2023
821491e
refactor: add common helpers
kulkarohan Jul 28, 2023
8d85761
chore: update deps
kulkarohan Jul 28, 2023
bdf9a7f
chore: update deps
kulkarohan Jul 28, 2023
a879d55
refactor: add rewards storage
kulkarohan Jul 28, 2023
56bbac5
chore: update runs
kulkarohan Jul 28, 2023
3221408
chore: update protocol rewards
kulkarohan Jul 28, 2023
8a69a89
chore: update deploy config
kulkarohan Jul 28, 2023
d8a66df
chore: update naming
kulkarohan Jul 28, 2023
24030ec
chore: update versions
kulkarohan Jul 28, 2023
48197ec
refactor: do not force create referral via factory
kulkarohan Jul 28, 2023
f5b995e
chore: update goerli deploy
kulkarohan Jul 28, 2023
c7cd561
chore: update zora goerli deploy
kulkarohan Jul 28, 2023
7107a68
chore: update op goerli deploy
kulkarohan Jul 29, 2023
7644578
chore: update base goerli deploy
kulkarohan Jul 30, 2023
ab68524
chore: update deps
kulkarohan Jul 31, 2023
ec70925
chore: update goerli deploy
kulkarohan Aug 1, 2023
c009127
chore: update zora goerli deploy
kulkarohan Aug 1, 2023
cffe9e3
chore: update op goerli deploy
kulkarohan Aug 1, 2023
f638164
chore: update base goerli deploy
kulkarohan Aug 1, 2023
27d7e58
chore: update dep
kulkarohan Aug 2, 2023
0eef638
refactor: update rewards handler
kulkarohan Aug 2, 2023
d27b7f3
chore: update tests
kulkarohan Aug 2, 2023
111a422
refactor: add error for protocol rewards withdraw
kulkarohan Aug 2, 2023
56331ad
refactor: add rewards withdraw and sale event helper
kulkarohan Aug 2, 2023
594e9b8
chore: update runs
kulkarohan Aug 2, 2023
88f0b47
Merge branch 'main' into zora-rewards
kulkarohan Aug 2, 2023
797af0a
chore: remove old var
kulkarohan Aug 2, 2023
f939e2f
Merge branch 'main' into zora-rewards
kulkarohan Aug 2, 2023
97318b7
Merge branch 'zora-rewards' of https://github.com/ourzora/zora-drops-…
kulkarohan Aug 2, 2023
d43f796
chore: add back OZ
kulkarohan Aug 2, 2023
fa68e34
chore: update lock
kulkarohan Aug 2, 2023
c228b1f
chore: update chain configs
kulkarohan Aug 2, 2023
4a8263f
chore: update testnets
kulkarohan Aug 2, 2023
15193ab
chore: update deploys
kulkarohan Aug 3, 2023
0344522
Merge branch 'zora-rewards' of https://github.com/ourzora/zora-drops-…
kulkarohan Aug 3, 2023
2489222
chore: update deployments
kulkarohan Aug 6, 2023
13a4d11
chore: update op goerli
kulkarohan Aug 6, 2023
6b7d258
chore: update chain configs
kulkarohan Aug 8, 2023
2478acf
fix: consistent chain config amounts
kulkarohan Aug 9, 2023
90d5e1a
chore: update deploys
kulkarohan Aug 9, 2023
59b3e58
fix: remove chain config key
kulkarohan Aug 9, 2023
857219f
generate new storage layout
jgeary Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addresses/420.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"DROP_METADATA_RENDERER": "0xCe6B190956D73dA045bA348743E4C1cb6652f37f",
"EDITION_METADATA_RENDERER": "0x169007EF8fF4d2a225f361654e4B8280910fD8FC",
"ERC721DROP_IMPL": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a",
"ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07",
"FACTORY_UPGRADE_GATE": "0x9B414A3F7872bdd2E6513689214BD2Debbe48340",
"ZORA_NFT_CREATOR_PROXY": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3",
"ZORA_NFT_CREATOR_V1_IMPL": "0xC5c958a65656A84b74100D1d420a1819fEA18d41",
"ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8",
"timestamp": 1683668679,
"commit": "e100eee"
}
6 changes: 2 additions & 4 deletions addresses/5.json
Original file line number Diff line number Diff line change
@@ -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": "0x242f0EE150a171CC250685F19faA062D79bd3170",
"FACTORY_UPGRADE_GATE": "0x942C03C7afE5c8118BDB728Aa06d1b894B1cD9A8",
"ZORA_NFT_CREATOR_PROXY": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519",
"ZORA_NFT_CREATOR_V1_IMPL": "0x4328cbDAD668E81B475766520E1004e6688D2949"
"ZORA_NFT_CREATOR_V1_IMPL": "0x2d54733cBebb23b8a10a935f6B42Efaaa9f5d27e"
}
4 changes: 2 additions & 2 deletions addresses/84531.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"DROP_METADATA_RENDERER": "0x0Cf8733DEd6d9E0905A8cCc8DC767F381A76970a",
"EDITION_METADATA_RENDERER": "0xC5c958a65656A84b74100D1d420a1819fEA18d41",
"ERC721DROP_IMPL": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1",
"ERC721DROP_IMPL": "0x53a85FbD2955EF713AA489Ae0C48523E727a0c07",
"FACTORY_UPGRADE_GATE": "0x3C1ebcF36Ca9DD9371c9aA99c274e4988906c6E3",
"ZORA_NFT_CREATOR_PROXY": "0x87cfd516c5ea86e50b950678CA970a8a28de27ac",
"ZORA_NFT_CREATOR_V1_IMPL": "0x0ABdD5AA61E9107519DB7cD626442B905284B7eb"
"ZORA_NFT_CREATOR_V1_IMPL": "0xfFFD7409031B1aeb731271C6C2D59771523Ff8a8"
}
4 changes: 2 additions & 2 deletions addresses/999.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"DROP_METADATA_RENDERER": "0xb9583D05Ba9ba8f7F14CCEe3Da10D2bc0A72f519",
"EDITION_METADATA_RENDERER": "0x481c56e15A9B2987Bd6041043e1d807697505d23",
"ERC721DROP_IMPL": "0xA3Fb46092D9DAe8eAa2F99417630930F4Ee5A45a",
"ERC721DROP_IMPL": "0xa1F45f5B50e16E79366867E91fE45c181D18Cb67",
"FACTORY_UPGRADE_GATE": "0x2068BA7Be6e22b97d21f5eb6e152A36d2Dc27da2",
"ZORA_NFT_CREATOR_PROXY": "0xeB29A4e5b84fef428c072debA2444e93c080CE87",
"ZORA_NFT_CREATOR_V1_IMPL": "0x4589A93f2444b736E3d35acB331f5241b1c6DAD3"
"ZORA_NFT_CREATOR_V1_IMPL": "0x2D6d587e9B09fa01405A5816938554ccdeEf69db"
}
3 changes: 2 additions & 1 deletion chainConfigs/420.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion chainConfigs/5.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0",
"SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6",
"ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f"
"ZORA_ERC721_TRANSFER_HELPER": "0xd1adAF05575295710dE1145c3c9427c364A70a7f",
"PROTOCOL_REWARDS": "0x8Ca5e648C5dFEfcdDa06d627F4b490B719ccFD98"
}
3 changes: 2 additions & 1 deletion chainConfigs/84531.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion chainConfigs/999.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x11cf5F667dC6AD4dEE58CB07e4AAc6a3fc7E1DCb",
"SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x0000000000000000000000000000000000000000",
"ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000"
"ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000",
"PROTOCOL_REWARDS": "0xF62b0d56BA617F803DF1C464C519FF7D29451B2f"
}
6 changes: 4 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[profile.default]
solc_version = '0.8.17'
optimizer = true
optimizer_runs = 2383
optimizer_runs = 500
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:'(

via_ir = true
out = 'out'
test = 'test'
Expand All @@ -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"
base = "https://developer-access-mainnet.base.org"
pgn_sepolia = "https://sepolia.publicgoods.network"
pgn = "https://rpc.publicgoods.network"
1 change: 0 additions & 1 deletion lib/openzeppelin-contracts
Submodule openzeppelin-contracts deleted from c239e1
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
},
"dependencies": {
"@dotenv/cli": "^2.2.2",
"@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"
}
Expand Down
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +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/protocol-rewards/=node_modules/@zoralabs/protocol-rewards/
3 changes: 2 additions & 1 deletion script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ contract Deploy is ZoraDropsDeployBase {
_factoryUpgradeGate: factoryUpgradeGate,
_marketFilterDAOAddress: address(chainConfig.subscriptionMarketFilterAddress),
_mintFeeAmount: chainConfig.mintFeeAmount,
_mintFeeRecipient: payable(chainConfig.mintFeeRecipient)
_mintFeeRecipient: payable(chainConfig.mintFeeRecipient),
_protocolRewards: address(chainConfig.protocolRewards)
});

ZoraNFTCreatorV1 factoryImpl = new ZoraNFTCreatorV1(address(dropImplementation), editionMetadata, dropMetadata);
Expand Down
2 changes: 2 additions & 0 deletions script/TestUpgradeAndMint.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
kulkarohan marked this conversation as resolved.
Show resolved Hide resolved

string configFile;

function _getKey(string memory key) internal returns (address result) {
Expand Down
3 changes: 2 additions & 1 deletion script/UpgradeERC721DropFactory.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ contract UpgradeERC721DropFactory is ZoraDropsDeployBase {
_factoryUpgradeGate: IFactoryUpgradeGate(deployment.factoryUpgradeGate),
_marketFilterDAOAddress: chainConfig.subscriptionMarketFilterAddress,
_mintFeeAmount: chainConfig.mintFeeAmount,
_mintFeeRecipient: payable(chainConfig.mintFeeRecipient)
_mintFeeRecipient: payable(chainConfig.mintFeeRecipient),
_protocolRewards: chainConfig.protocolRewards
});

deployment.dropImplementation = address(dropImplementation);
Expand Down
2 changes: 1 addition & 1 deletion script/ZoraDropsDeployBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {IERC721Drop} from "../src/interfaces/IERC721Drop.sol";

/// @notice Deployment drops for base where
abstract contract ZoraDropsDeployBase is ScriptDeploymentConfig {

/// @notice Get deployment configuration struct as JSON
/// @param deployment deploymet struct
/// @return deploymentJson string JSON of the deployment info
Expand Down
6 changes: 6 additions & 0 deletions src/DeploymentConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 Protocol Rewards contract
address protocolRewards;
}

/// @notice Deployment addresses – set to new deployed addresses by the scripts.
Expand Down Expand Up @@ -51,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
///
Expand All @@ -62,6 +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 PROTOCOL_REWARDS = "PROTOCOL_REWARDS";

string constant DROP_METADATA_RENDERER = "DROP_METADATA_RENDERER";
string constant EDITION_METADATA_RENDERER = "EDITION_METADATA_RENDERER";
Expand All @@ -88,6 +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.protocolRewards = json.readAddress(getKeyPrefix(PROTOCOL_REWARDS));
}

/// @notice Get the deployment configuration struct from the JSON configuration file
Expand Down
Loading
Loading