Browse Source

Mezo mainnet deployment (#4378)

* Mezo mainnet deployment

- Provides .env.mezo.mainnet used for deploying WH Core and Token Bridge
  contracts to Mezo Mainnet

* Add Mezo mainnet values to node and SDK

Adds support for Mezo on mainnet.

    Core contract here
    Token bridge contract here

To enable Mezo on mainnet, use the following config parameters:

```
--mezoRPC YOUR_MEZO_RPC
--mezoContract 0xaBf89de706B583424328B54dD05a8fC986750Da8
```

Verification
~~~
|- go run verify.go --chainId 50
Verifying prod mezo...
   Verifying EVM chain ID for prod mezo ✓
   Verifying finality values for prod mezo ✓
   Verifying contract address for prod mezo ✓
Verifying test mezo...
   Verifying EVM chain ID for test mezo ✓
   Verifying finality values for test mezo ✓
   Verifying contract address for test mezo ✓
~~~

* Update mainnet_tokens_test.go

SeiEVM -> Mezo in comment

---------

Co-authored-by: Adam <20446095+aadam-10@users.noreply.github.com>
Aaron Clark 6 months ago
parent
commit
79d918eae1

+ 17 - 0
ethereum/env/.env.mezo.mainnet

@@ -0,0 +1,17 @@
+RPC_URL=https://jsonrpc-mezo.boar.network/
+FORGE_ARGS="--gas-price 324 --skip-simulation --resume"
+
+INIT_SIGNERS=["0x58CC3AE5C097b213cE3c81979e1B9f9570746AA5"]
+INIT_GOV_CHAIN_ID=0x1
+INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
+INIT_CHAIN_ID=50
+INIT_EVM_CHAIN_ID=31612
+
+# Bridge Migrations
+BRIDGE_INIT_CHAIN_ID=50
+BRIDGE_INIT_GOV_CHAIN_ID=0x1
+BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
+
+# There is no WETH
+BRIDGE_INIT_WETH=0x0000000000000000000000000000000000000000
+BRIDGE_INIT_FINALITY=1

+ 1 - 0
node/hack/repair_eth/repair_eth.go

@@ -58,6 +58,7 @@ var etherscanAPIMap = map[vaa.ChainID]string{
 	vaa.ChainIDUnichain:   "https://api.uniscan.xyz/",
 	vaa.ChainIDUnichain:   "https://api.uniscan.xyz/",
 	vaa.ChainIDWorldchain: "https://api.worldscan.org",
 	vaa.ChainIDWorldchain: "https://api.worldscan.org",
 	vaa.ChainIDInk:        "", // TODO: Does Ink have an etherscan API endpoint?
 	vaa.ChainIDInk:        "", // TODO: Does Ink have an etherscan API endpoint?
+	vaa.ChainIDMezo:       "", // TODO: only known block explorer API for Mezo uses blockscout
 }
 }
 
 
 var (
 var (

+ 1 - 0
node/pkg/governor/mainnet_chains.go

@@ -46,5 +46,6 @@ func chainList() []chainConfigEntry {
 		{emitterChainID: vaa.ChainIDUnichain, dailyLimit: 500_000, bigTransactionSize: 50_000},
 		{emitterChainID: vaa.ChainIDUnichain, dailyLimit: 500_000, bigTransactionSize: 50_000},
 		{emitterChainID: vaa.ChainIDWorldchain, dailyLimit: 500_000, bigTransactionSize: 50_000},
 		{emitterChainID: vaa.ChainIDWorldchain, dailyLimit: 500_000, bigTransactionSize: 50_000},
 		{emitterChainID: vaa.ChainIDInk, dailyLimit: 500_000, bigTransactionSize: 50_000},
 		{emitterChainID: vaa.ChainIDInk, dailyLimit: 500_000, bigTransactionSize: 50_000},
+		{emitterChainID: vaa.ChainIDMezo, dailyLimit: 500_000, bigTransactionSize: 50_000},
 	}
 	}
 }
 }

+ 2 - 0
node/pkg/governor/mainnet_tokens_test.go

@@ -48,6 +48,8 @@ func TestGovernedChainHasGovernedAssets(t *testing.T) {
 		vaa.ChainIDInk: true,
 		vaa.ChainIDInk: true,
 		// TODO: Remove this once we have governed tokens for SeiEVM.
 		// TODO: Remove this once we have governed tokens for SeiEVM.
 		vaa.ChainIDSeiEVM: true,
 		vaa.ChainIDSeiEVM: true,
+		// TODO: Remove this once we have governed tokens for Mezo.
+		vaa.ChainIDMezo: true,
 	}
 	}
 	if len(ignoredChains) > 0 {
 	if len(ignoredChains) > 0 {
 		ignoredOutput := []string{}
 		ignoredOutput := []string{}

+ 1 - 1
node/pkg/watchers/evm/chain_config.go

@@ -99,7 +99,7 @@ var (
 		vaa.ChainIDInk:        {Finalized: true, Safe: true, EvmChainID: 57073, PublicRPC: "https://rpc-qnd.inkonchain.com", ContractAddr: "0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"},
 		vaa.ChainIDInk:        {Finalized: true, Safe: true, EvmChainID: 57073, PublicRPC: "https://rpc-qnd.inkonchain.com", ContractAddr: "0xCa1D5a146B03f6303baF59e5AD5615ae0b9d146D"},
 		// vaa.ChainIDHyperEVM:   Not in Mainnet yet.
 		// vaa.ChainIDHyperEVM:   Not in Mainnet yet.
 		// vaa.ChainIDMonad:      Not in Mainnet yet.
 		// vaa.ChainIDMonad:      Not in Mainnet yet.
-		// vaa.ChainIDMezo:       Not in Mainnet yet.
+		vaa.ChainIDMezo: {Finalized: true, Safe: true, EvmChainID: 31612, PublicRPC: "https://jsonrpc-mezo.boar.network/", ContractAddr: "0xaBf89de706B583424328B54dD05a8fC986750Da8"},
 	}
 	}
 
 
 	// testnetChainConfig specifies the configuration for all chains enabled in Testnet.
 	// testnetChainConfig specifies the configuration for all chains enabled in Testnet.

+ 1 - 0
sdk/mainnet_consts.go

@@ -130,6 +130,7 @@ var knownTokenbridgeEmitters = map[vaa.ChainID]string{
 	vaa.ChainIDWormchain:  "aeb534c45c3049d380b9d9b966f9895f53abd4301bfaff407fa09dea8ae7a924",
 	vaa.ChainIDWormchain:  "aeb534c45c3049d380b9d9b966f9895f53abd4301bfaff407fa09dea8ae7a924",
 	vaa.ChainIDWorldchain: "000000000000000000000000c309275443519adca74c9136b02A38eF96E3a1f6",
 	vaa.ChainIDWorldchain: "000000000000000000000000c309275443519adca74c9136b02A38eF96E3a1f6",
 	vaa.ChainIDInk:        "0000000000000000000000003Ff72741fd67D6AD0668d93B41a09248F4700560",
 	vaa.ChainIDInk:        "0000000000000000000000003Ff72741fd67D6AD0668d93B41a09248F4700560",
+	vaa.ChainIDMezo:       "000000000000000000000000F97B81E513f53c7a6B57Bd0b103a6c295b3096C5",
 }
 }
 
 
 // KnownNFTBridgeEmitters is a list of well-known mainnet emitters for the NFT bridge.
 // KnownNFTBridgeEmitters is a list of well-known mainnet emitters for the NFT bridge.