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

Add Sepolia / Base Sepolia support for Base cross-chain #742

Merged
merged 9 commits into from
Feb 19, 2024
2 changes: 2 additions & 0 deletions cross-chain/base/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
!/deployments/mainnet/
!/deployments/base/
!/deployments/baseGoerli/
!/deployments/baseSepolia/

# OZ
/.openzeppelin/unknown-*.json
!/.openzeppelin/unknown-84531.json
!/.openzeppelin/unknown-8453.json
!/.openzeppelin/unknown-84532.json
5 changes: 3 additions & 2 deletions cross-chain/base/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ yarn deploy --network <network>

Supported networks:
- `hardhat` - for local development
- `baseGoerli` - L2 testing network
- `baseGoerli` - L2 testing network (will become deprecated with end of 2023)
- `baseSepolia` - L2 testing network
- `base` - L2 mainnet

Currently, this module does not deploy any contracts on L1. All the existing
Expand All @@ -54,6 +55,6 @@ the contracts before running the deployment script. This command produces
an `export.json` file containing contract deployment info. Note that for the
chains other than `hardhat` the following environment variables are needed:

- `L2_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://goerli.base.org`
- `L2_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://sepolia.base.org`
- `L2_ACCOUNTS_PRIVATE_KEYS` - Private keys for the deployer and council `<0xOwnerPrivKey,0xCouncilPrivKey>`
- `BASESCAN_API_KEY` - Base Etherscan API key
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

// See https://docs.wormhole.com/wormhole/blockchain-environments/evm#base
// This ID is valid for both Base Goerli and Base Mainnet
// TODO: check if id is correct for Base Sepolia as well (once Wormhole
// supports that testnet)
const wormholeChainID = 30

const baseWormholeGateway = await deployments.get("BaseWormholeGateway")
Expand Down
42 changes: 42 additions & 0 deletions cross-chain/base/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ const config: HardhatUserConfig = {
: undefined,
tags: ["etherscan"],
},
sepolia: {
url: process.env.L1_CHAIN_API_URL || "",
chainId: 11155111,
deploy: ["deploy_l1"],
accounts: process.env.L1_ACCOUNTS_PRIVATE_KEYS
? process.env.L1_ACCOUNTS_PRIVATE_KEYS.split(",")
: undefined,
tags: ["etherscan"],
},
mainnet: {
url: process.env.L1_CHAIN_API_URL || "",
chainId: 1,
Expand All @@ -68,6 +77,21 @@ const config: HardhatUserConfig = {
// l1: "goerli",
// },
},
baseSepolia: {
url: process.env.L2_CHAIN_API_URL || "",
chainId: 84532,
deploy: ["deploy_l2"],
accounts: process.env.L2_ACCOUNTS_PRIVATE_KEYS
? process.env.L2_ACCOUNTS_PRIVATE_KEYS.split(",")
: undefined,
tags: ["basescan"],
// In case of deployment failing with underpriced transaction error set
// the `gasPrice` parameter.
// gasPrice: 1000000000,
// companionNetworks: {
// l1: "sepolia",
// },
},
base: {
url: process.env.L2_CHAIN_API_URL || "",
chainId: 8453,
Expand All @@ -88,24 +112,30 @@ const config: HardhatUserConfig = {
external: {
deployments: {
goerli: ["./external/goerli"],
sepolia: ["./external/sepolia"],
mainnet: ["./external/mainnet"],
baseGoerli: ["./external/baseGoerli"],
baseSepolia: ["./external/baseSepolia"],
base: ["./external/base"],
},
},

deploymentArtifactsExport: {
goerli: "artifacts/l1",
sepolia: "artifacts/l1",
mainnet: "artifacts/l1",
baseGoerli: "artifacts/l2",
baseSepolia: "artifacts/l2",
base: "artifacts/l2",
},

etherscan: {
apiKey: {
goerli: process.env.ETHERSCAN_API_KEY,
sepolia: process.env.ETHERSCAN_API_KEY,
mainnet: process.env.ETHERSCAN_API_KEY,
"base-goerli": process.env.BASESCAN_API_KEY,
"base-sepolia": process.env.BLOCKSCOUT_API_KEY,
"base-mainnet": process.env.BASESCAN_API_KEY,
},
customChains: [
Expand All @@ -117,6 +147,14 @@ const config: HardhatUserConfig = {
browserURL: "https://goerli.basescan.org",
},
},
{
network: "base-sepolia",
chainId: 84532,
urls: {
apiURL: "https://base-sepolia.blockscout.com/api",
browserURL: "https://base-sepolia.blockscout.com/",
},
},
michalinacienciala marked this conversation as resolved.
Show resolved Hide resolved
{
network: "base-mainnet",
chainId: 8453,
Expand All @@ -132,14 +170,18 @@ const config: HardhatUserConfig = {
deployer: {
default: 1,
goerli: 0,
sepolia:0,
baseGoerli: 0,
baseSepolia: 0,
mainnet: "0x123694886DBf5Ac94DDA07135349534536D14cAf",
base: "0x123694886DBf5Ac94DDA07135349534536D14cAf",
},
governance: {
default: 2,
goerli: 0,
sepolia:0,
baseGoerli: 0,
baseSepolia: 0,
mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", // Threshold Council
base: "0x518385dd31289F1000fE6382b0C65df4d1Cd3bfC", // Threshold Council
},
Expand Down
1 change: 1 addition & 0 deletions cross-chain/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"lint:config:fix": "prettier --write '**/*.@(json|yaml)'",
"prepack": "tsc -p tsconfig.export.json && hardhat export-artifacts export/artifacts",
"export-artifacts:goerli": "yarn hardhat export-deployment-artifacts --network baseGoerli",
"export-artifacts:sepolia": "yarn hardhat export-deployment-artifacts --network baseSepolia",
"export-artifacts:mainnet": "yarn hardhat export-deployment-artifacts --network base",
"prepublishOnly": "npm run export-artifacts:$npm_config_network",
"test": "hardhat test"
Expand Down