Skip to content

Commit

Permalink
Merge branch 'main' into sepolia-support-base
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-zimnoch authored Feb 19, 2024
2 parents 241f00c + 4c50eb3 commit 58fc8c9
Show file tree
Hide file tree
Showing 167 changed files with 16,953 additions and 8,826 deletions.
27 changes: 3 additions & 24 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,7 @@ jobs:

- name: Deploy contracts
env:
# Using fake ternary expression to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
# is empty, the expression will be evaluated to
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
run: yarn deploy --network ${{ github.event.inputs.environment }}

Expand Down Expand Up @@ -275,14 +268,7 @@ jobs:
- name: Verify contracts on Etherscan
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
# Using fake ternary expression to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
# is empty, the expression will be evaluated to
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
run: yarn run hardhat --network ${{ github.event.inputs.environment }} etherscan-verify

# This job is responsible for publishing packackes with slightly modified
Expand Down Expand Up @@ -340,14 +326,7 @@ jobs:
- name: Deploy contracts
env:
# Using fake ternary expression to decide which credentials to use,
# depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
# is empty, the expression will be evaluated to
# `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
CHAIN_API_URL: |
${{ inputs.github.event.inputs.environment == 'goerli'
&& secrets.GOERLI_ETH_HOSTNAME_HTTP
|| secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
run: yarn deploy --network ${{ github.event.inputs.environment }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
type: choice
options:
- local # Just a bare Docker build without push
- goerli # Pushes Docker image to keep-test cluster
- sepolia # Pushes Docker image to keep-test cluster
- mainnet # Pushes Docker image to keep-prd cluster

jobs:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
if: ${{ github.event.inputs.environment != 'local' }}
uses: docker/login-action@v1
env:
CLUSTER_MAPPING: '{"goerli": "KEEP_TEST", "mainnet": "KEEP_PRD"}'
CLUSTER_MAPPING: '{"sepolia": "KEEP_TEST", "mainnet": "KEEP_PRD"}'
with:
registry: ${{ env.GCR_REGISTRY_URL }}
username: _json_key
Expand Down
1 change: 1 addition & 0 deletions cross-chain/optimism/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
!/deployments/mainnet/
!/deployments/optimism/
!/deployments/optimismGoerli/
!/deployments/optimismSepolia/

# OZ
/.openzeppelin/unknown-*.json
6 changes: 3 additions & 3 deletions cross-chain/optimism/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 `OptimismTBTC` 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 `optimismGoerli/ArbitrumWormholeGateway.json.`
directory for a specific network, such as `optimismSepolia/ArbitrumWormholeGateway.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
- `optimismGoerli` - L2 testing network
- `optimismSepolia` - L2 testing network
- `optimism` - 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://opt-goerli.g.alchemy.com/v2/<alchemy_api_key>`
- `L2_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://optimism-sepolia.infura.io/v3/<infura_api_key>`
- `L2_ACCOUNTS_PRIVATE_KEYS` - Private keys for the deployer and council `<0xOwnerPrivKey,0xCouncilPrivKey>`
- `OPTIMISM_ETHERSCAN_API_KEY` - Optimism Etherscan API key
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { execute } = deployments
const { deployer } = await getNamedAccounts()

// See https://book.wormhole.com/reference/contracts.html
// This ID is valid for both Optimism Goerli and Mainnet
const wormholeChainID = 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 wormholeChainID = hre.network.name === "optimismSepolia" ? 10005 : 24

const optimismWormholeGateway = await deployments.get(
"OptimismWormholeGateway"
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 fakeArbitrumWormholeGateway =
"0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9"

// See https://book.wormhole.com/reference/contracts.html
// This ID is valid for both Arbitrum Goerli and Mainnet
const arbitrumWormholeChainID = 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 arbitrumWormholeChainID =
hre.network.name === "optimismSepolia" ? 10003 : 23

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

func.tags = ["SetArbitrumGatewayAddress"]
func.dependencies = ["OptimismWormholeGateway"]
func.dependencies = ["OptimismWormholeGateway", "ArbitrumWormholeGateway"]
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ 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
// See https://docs.wormhole.com/wormhole/blockchain-environments/evm#polygon
// 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 +38,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
export default func

func.tags = ["SetPolygonGatewayAddress"]
func.dependencies = ["OptimismWormholeGateway"]
func.dependencies = ["OptimismWormholeGateway", "PolygonWormholeGateway"]
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 === "optimismSepolia" ? 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", "OptimismWormholeGateway"]
1 change: 1 addition & 0 deletions cross-chain/optimism/deployments/optimismSepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11155420
Loading

0 comments on commit 58fc8c9

Please sign in to comment.