From caa71f18a6ba48891f94ff3754559583de310c2f Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Thu, 23 Feb 2023 15:42:30 -0500 Subject: [PATCH] Deploy base to testnet (#2422) * Deploy base to testnet * Shouldn't add testnet evmChainId to impl * Add base to rpc dump command * Oops, wrong branch! --- ethereum/.env.base.testnet | 17 +++++++++++++++++ ethereum/truffle-config.js | 9 +++++++++ scripts/contract-upgrade-governance.sh | 7 +++++++ sdk/js/src/utils/consts.ts | 23 +++++++++++++++++++++-- 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 ethereum/.env.base.testnet diff --git a/ethereum/.env.base.testnet b/ethereum/.env.base.testnet new file mode 100644 index 000000000..d9f497615 --- /dev/null +++ b/ethereum/.env.base.testnet @@ -0,0 +1,17 @@ +# Base testnet env +# Rename to .env to use with truffle migrations + +# Wormhole Core Migrations +INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"] +INIT_CHAIN_ID=30 +INIT_GOV_CHAIN_ID=0x1 +INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004 +INIT_EVM_CHAIN_ID=84531 + +# Bridge Migrations +BRIDGE_INIT_CHAIN_ID=30 +BRIDGE_INIT_GOV_CHAIN_ID=0x1 +BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004 +# There is no WETH. +BRIDGE_INIT_WETH=0x0000000000000000000000000000000000000000 +BRIDGE_INIT_FINALITY=1 diff --git a/ethereum/truffle-config.js b/ethereum/truffle-config.js index 23b871cba..fbaf9c3fa 100644 --- a/ethereum/truffle-config.js +++ b/ethereum/truffle-config.js @@ -348,6 +348,15 @@ module.exports = { }, network_id: 77, }, + base_testnet: { + provider: () => { + return new HDWalletProvider( + process.env.MNEMONIC, + "https://goerli.base.org" + ); + }, + network_id: 84531, + }, }, compilers: { diff --git a/scripts/contract-upgrade-governance.sh b/scripts/contract-upgrade-governance.sh index e2b38de15..6ad1f484e 100755 --- a/scripts/contract-upgrade-governance.sh +++ b/scripts/contract-upgrade-governance.sh @@ -190,6 +190,13 @@ case "$chain_name" in explorer="https://optimistic.etherscan.io/address/" evm=true ;; + base) + echo "Need to specify the base explorer URL!" + exit 1 + chain=30 + explorer="??/address/" + evm=true + ;; *) echo "Unknown chain: $chain_name" >&2 exit 1 diff --git a/sdk/js/src/utils/consts.ts b/sdk/js/src/utils/consts.ts index b1657c9d4..bdb20bd42 100644 --- a/sdk/js/src/utils/consts.ts +++ b/sdk/js/src/utils/consts.ts @@ -28,6 +28,7 @@ export const CHAINS = { pythnet: 26, xpla: 28, btc: 29, + base: 30, wormchain: 3104, } as const; @@ -54,7 +55,8 @@ export type EVMChainName = | "neon" | "arbitrum" | "optimism" - | "gnosis"; + | "gnosis" + | "base"; /** * @@ -227,6 +229,11 @@ const MAINNET = { token_bridge: undefined, nft_bridge: undefined, }, + base: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, wormchain: { core: undefined, token_bridge: undefined, @@ -383,6 +390,11 @@ const TESTNET = { token_bridge: undefined, nft_bridge: undefined, }, + base: { + core: "0x23908A62110e21C04F3A4e011d24F901F911744A", + token_bridge: "0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780", + nft_bridge: "0xF681d1cc5F25a3694E348e7975d7564Aa581db59", + }, wormchain: { core: undefined, token_bridge: undefined, @@ -539,6 +551,11 @@ const DEVNET = { token_bridge: undefined, nft_bridge: undefined, }, + base: { + core: undefined, + token_bridge: undefined, + nft_bridge: undefined, + }, wormchain: { core: "wormhole1ap5vgur5zlgys8whugfegnn43emka567dtq0jl", token_bridge: "wormhole1zugu6cajc4z7ue29g9wnes9a5ep9cs7yu7rn3z", @@ -613,6 +630,7 @@ export const CHAIN_ID_GNOSIS = CHAINS["gnosis"]; export const CHAIN_ID_PYTHNET = CHAINS["pythnet"]; export const CHAIN_ID_XPLA = CHAINS["xpla"]; export const CHAIN_ID_BTC = CHAINS["btc"]; +export const CHAIN_ID_BASE = CHAINS["base"]; export const CHAIN_ID_WORMCHAIN = CHAINS["wormchain"]; // This inverts the [[CHAINS]] object so that we can look up a chain by id @@ -743,7 +761,8 @@ export function isEVMChain( chainId === CHAIN_ID_NEON || chainId === CHAIN_ID_ARBITRUM || chainId === CHAIN_ID_OPTIMISM || - chainId === CHAIN_ID_GNOSIS + chainId === CHAIN_ID_GNOSIS || + chainId === CHAIN_ID_BASE ) { return isEVM(chainId); } else {