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 / Arbitrum Sepolia support for Arbitrum cross-chain #753

Merged
merged 9 commits into from
Feb 19, 2024
6 changes: 3 additions & 3 deletions cross-chain/arbitrum/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Wormhole-specific tBTC representation into the canonical `ArbitrumTBTC` token.

The deployment scripts are responsible for managing updates of the tBTC gateway
addresses across various chains. These addresses are stored in the `external/`
directory for a specific network, such as `arbitrumGoerli/OptimismWormholeGateway.json.`
directory for a specific network, such as `arbitrumSepolia/OptimismWormholeGateway.json.`
It is important to note that these addresses should remain constant for the
mainnet network. However, there may be instances where a new version of a
cross-chain module is deployed to the testing network, which would require a
Expand All @@ -42,7 +42,7 @@ yarn deploy --network <network>

Supported networks:
- `hardhat` - for local development
- `arbitrumGoerli` - L2 testing network
- `arbitrumSepolia` - L2 testing network
- `arbitrumOne` - L2 mainnet

Currently, this module does not deploy any contracts on L1. All the existing
Expand All @@ -54,6 +54,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://arb-goerli.g.alchemy.com/v2/<alchemy_api_key>`
- `L2_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://arb-sepolia.g.alchemy.com/v2/<alchemy_api_key>`
- `L2_ACCOUNTS_PRIVATE_KEYS` - Private keys for the deployer and council `<0xOwnerPrivKey,0xCouncilPrivKey>`
- `ARBISCAN_API_KEY` - Arbiscan API key
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import type { HardhatRuntimeEnvironment } from "hardhat/types"
import type { DeployFunction } from "hardhat-deploy/types"

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

Check warning on line 4 in cross-chain/arbitrum/deploy_l2/12_update_wormhole_gateway_mapping.ts

View workflow job for this annotation

GitHub Actions / contracts-format

Unexpected unnamed async function
const { deployments, getNamedAccounts, ethers } = hre
const { execute } = deployments
const { deployer } = await getNamedAccounts()

// See https://book.wormhole.com/reference/contracts.html
// This ID is valid for both Arbitrum Goerli and Mainnet
const wormholeChainID = 23
// See https://docs.wormhole.com/wormhole/blockchain-environments/evm#arbitrum
// and https://docs.wormhole.com/wormhole/blockchain-environments/evm#arbitrum-sepolia
// The value `23` is valid for both Arbitrum Goerli and Arbitrum Mainnet. The
// value for Arbitrum Sepolia is `10003`.
const wormholeChainID = hre.network.name === "arbitrumSepolia" ? 10003 : 23

const ArbitrumWormholeGateway = await deployments.get(
"ArbitrumWormholeGateway"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const fakeOptimismWormholeGateway =
"0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9"

// See https://book.wormhole.com/reference/contracts.html
// This ID is valid for both Optimism Goerli and Mainnet
const optimismWormholeChainID = 24
// See https://docs.wormhole.com/wormhole/blockchain-environments/evm#optimism
// and https://docs.wormhole.com/wormhole/blockchain-environments/evm#optimism-sepolia
// The value `24` is valid for both Optimism Goerli and Optimism Mainnet. The
// value for Optimism Sepolia is `10005`.
const optimismWormholeChainID =
hre.network.name === "arbitrumSepolia" ? 10005 : 24

const optimismWormholeGateway = await deployments.getOrNull(
"OptimismWormholeGateway"
Expand All @@ -38,4 +41,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
export default func

func.tags = ["SetOptimismGatewayAddress"]
func.dependencies = ["OptimismWormholeGateway"]
func.dependencies = ["OptimismWormholeGateway", "ArbitrumWormholeGateway"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const fakePolygonWormholeGateway =
"0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9"

// See https://book.wormhole.com/reference/contracts.html
// This ID is valid for both Polygon Testnet (Mumbai) and Mainnet
// This ID is valid for both Polygonn Goerli-based Testnet (Mumbai) and
// Mainnet. Wormhole does not support the Sepolia-based Amoy Testnet yet.
// TODO: Update the ID once the support is added.
const polygonWormholeChainID = 5

const polygonWormholeGateway = await deployments.getOrNull(
Expand All @@ -36,4 +37,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
export default func

func.tags = ["SetPolygonGatewayAddress"]
func.dependencies = ["OptimismWormholeGateway"]
func.dependencies = ["PolygonWormholeGateway", "ArbitrumWormholeGateway"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// Fake BaseWormholeGateway for local development purposes only.
const fakeBaseWormholeGateway = "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9"

// See https://docs.wormhole.com/wormhole/blockchain-environments/evm#base
// This ID is valid for both Base Testnet and Mainnet
const baseWormholeChainID = 30
// See https://docs.wormhole.com/wormhole/blockchain-environments/evm#base and
// https://docs.wormhole.com/wormhole/blockchain-environments/evm#base-sepolia
// The value `30` is valid for both Base Goerli and Base Mainnet. The value
// for Base Sepolia is `10004`.
const baseWormholeChainID =
hre.network.name === "arbitrumSepolia" ? 10004 : 30

const baseWormholeGateway = await deployments.getOrNull("BaseWormholeGateway")

Expand All @@ -33,4 +36,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
export default func

func.tags = ["SetBaseGatewayAddress"]
func.dependencies = ["BaseWormholeGateway"]
func.dependencies = ["BaseWormholeGateway", "ArbitrumWormholeGateway"]
1 change: 1 addition & 0 deletions cross-chain/arbitrum/deployments/arbitrumSepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
421614
Loading
Loading