Skip to content

Commit

Permalink
Add base mainnet chain (#127)
Browse files Browse the repository at this point in the history
* adding base mainnet chain

* updating docs
  • Loading branch information
iainnash authored Jul 17, 2023
1 parent 3630df3 commit d9ce4ce
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 43 deletions.
61 changes: 61 additions & 0 deletions DEPLOYING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

## Deploying to a new chain

### 0.1. Prepare

Make sure required addresses / multisigs are setup for
1. funds recipient
2. contract factory upgrade owner address

Ensure that the default operator-filterer-registry deployment is on the current chain.

If not, use the mainnet default filter address to re-deploy on the chain using ImmutableCreate2Factory (required also for seaport).

To deploy ImmutableCreate2Factory, follow the steps in the seaport deploy scripts: https://github.com/ProjectOpenSea/seaport/blob/main/docs/Deployment.md#setting-up-factory-on-a-new-chain

example call:
cast send 0x0000000000FFe8B47B3e2130213B802212439497 'function safeCreate2(bytes32,bytes)' [...] --rpc-url $(rpc base) --interactive

copied from the mainnet deploy txn: https://etherscan.io/tx/0x4c2038f55147cae309c2e597a5323b42b63fd556a15d2f1b5a799eee1b3ddf04

### 1. Setup `chainConfigs` file.

Use `1.json` for reference. We are ordering keys alphabetically.

```
{
# owner of the factory contract – owner to allow upgrading public factory
"FACTORY_OWNER": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
# upgrade gate for existing deployed 721 contracts owner – this address gates upgrades allowed
"FACTORY_UPGRADE_GATE_OWNER": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
# mint fee amount in wei (0 is valid)
"MINT_FEE_AMOUNT": 777000000000000,
# recipient for above mint fee
"MINT_FEE_RECIPIENT": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
# subscription market filter address for operator filter registry.
# can be set to 0 to disable. see: https://github.com/ProjectOpenSea/operator-filter-registry
"SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6",
# subscription market filter owner address.
"SUBSCRIPTION_MARKET_FILTER_OWNER": "0x9AaC739c133074dB445183A95149880a2156541A",
# pre-approved transfer helper for ZORA v3, likely should be 0 on new networks
"ZORA_ERC721_TRANSFER_HELPER": "0x909e9efE4D87d1a6018C2065aE642b6D0447bc91"
}
```

### 2. Deploy forge script

forge script script/Deploy.s.sol --broadcast --verify --rpc-url $ETH_RPC --sender $SENDER_WALLET

For example, to deploy on optimism goerli, this is the forge command:

forge script script/Deploy.s.sol --rpc-url $RPC --verify --etherscan-api-key $API_KEY --broadcast --interactives 1 --sender $SENDER_WALLET

*Important*: Sender is required to have the simulation succeed. Without it, the drops contract is not deployed.

Use your own RPC configuration variables

### 3. Copy new chain configuration for deployment

Copies new addresses over to `addresses` folder:

node js-scripts/copy-latest-deployment-addresses.mjs deploy
42 changes: 0 additions & 42 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,3 @@
4. If a deployment of the contracts should to be done that would affect the deployed contract addresses, checkout the branch `changeset-release/changeset`,
*follow the deployment steps below,* commit changes, and push that branch, which will contain the updated deployed addresses.
5. Merge the PR "Version Packages" to master, which will trigger a github action to publish the new packages to npm.

## Deploying to a new chain

### 1. Setup `chainConfigs` file.

Use `1.json` for reference. We are ordering keys alphabetically.

```
{
# owner of the factory contract – owner to allow upgrading public factory
"FACTORY_OWNER": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
# upgrade gate for existing deployed 721 contracts owner – this address gates upgrades allowed
"FACTORY_UPGRADE_GATE_OWNER": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
# mint fee amount in wei (0 is valid)
"MINT_FEE_AMOUNT": 777000000000000,
# recipient for above mint fee
"MINT_FEE_RECIPIENT": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
# subscription market filter address for operator filter registry.
# can be set to 0 to disable. see: https://github.com/ProjectOpenSea/operator-filter-registry
"SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6",
# subscription market filter owner address.
"SUBSCRIPTION_MARKET_FILTER_OWNER": "0x9AaC739c133074dB445183A95149880a2156541A",
# pre-approved transfer helper for ZORA v3, likely should be 0 on new networks
"ZORA_ERC721_TRANSFER_HELPER": "0x909e9efE4D87d1a6018C2065aE642b6D0447bc91"
}
```

### 2. Deploy forge script

forge script script/Deploy.s.sol --broadcast --verify --rpc-url $ETH_RPC

For example, to deploy on optimism goerli, this is the forge command:

forge script script/Deploy.s.sol --rpc-url https://goerli.optimism.io --verify --etherscan-api-key ${ETHERSCAN_OPTISM_API_KEY} --broadcast --interactives 1

Use your own RPC configuration variables

### 3. Copy new chain configuration for deployment

Copies new addresses over to `addresses` folder:

node js-scripts/copy-latest-deployment-addresses.mjs deploy
10 changes: 10 additions & 0 deletions addresses/8453.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"DROP_METADATA_RENDERER": "0xd1cba36d92B052079523F471Eb891563F2E5dF5C",
"EDITION_METADATA_RENDERER": "0x7d1a46c6e614A0091c39E102F2798C27c1fA8892",
"ERC721DROP_IMPL": "0xaDf8fF6a7EA4f028A384D00136fEF0FFfEb39f14",
"FACTORY_UPGRADE_GATE": "0xE3c0d82D1905C93a34d1C6E96842f499EcE3Bc86",
"ZORA_NFT_CREATOR_PROXY": "0x899ce31dF6C6Af81203AcAaD285bF539234eF4b8",
"ZORA_NFT_CREATOR_V1_IMPL": "0x3678862f04290E565cCA2EF163BAeb92Bb76790C",
"timestamp": 1689055306,
"commit": "7812bd3"
}
9 changes: 9 additions & 0 deletions chainConfigs/8453.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"FACTORY_OWNER": "0x99B5E1B42f018EEA69AFBB3a653F0338fc28013A",
"FACTORY_UPGRADE_GATE_OWNER": "0x99B5E1B42f018EEA69AFBB3a653F0338fc28013A",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x44928735180F03b334F82617A552DEE4631c9Bdb",
"SUBSCRIPTION_MARKET_FILTER_ADDRESS": "0x000000000000AAeB6D7670E522A718067333cd4E",
"SUBSCRIPTION_MARKET_FILTER_OWNER": "0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6",
"ZORA_ERC721_TRANSFER_HELPER": "0x0000000000000000000000000000000000000000"
}
9 changes: 8 additions & 1 deletion script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ contract Deploy is ZoraDropsDeployBase {
function run() public returns (string memory) {
console2.log("Starting --- chainId", chainId());
ChainConfig memory chainConfig = getChainConfig();
console2.log(" --- chain config --- ");
console2.log("Factory Owner", chainConfig.factoryOwner);
console2.log("Fee Recipient", chainConfig.mintFeeRecipient);
console2.log("Fee Amount", chainConfig.mintFeeAmount);
console2.log("Filterer Registry", chainConfig.subscriptionMarketFilterAddress);
console2.log("Filterer Subscription", chainConfig.subscriptionMarketFilterOwner);

console2.log("Setup contracts ---");

vm.startBroadcast();
Expand Down Expand Up @@ -50,7 +57,7 @@ contract Deploy is ZoraDropsDeployBase {

deployTestContractForVerification(factory);

vm.stopBroadcast();
// vm.stopBroadcast();

return
getDeploymentJSON(
Expand Down

0 comments on commit d9ce4ce

Please sign in to comment.