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

Deploy Snaxchain mainnet #4078

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions clients/js/src/consts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ const Mainnet = {
chain_id: undefined,
},
Snaxchain: {
rpc: undefined,
key: undefined,
chain_id: undefined,
rpc: "https://mainnet.snaxchain.io",
key: getEnvVar("ETH_KEY"),
chain_id: 2192,
},
Seievm: {
rpc: undefined,
Expand Down Expand Up @@ -420,9 +420,9 @@ const Testnet = {
chain_id: 80084,
},
Snaxchain: {
rpc: "https://rpc-snaxchain-s50q0kjngn.t.conduit.xyz/",
rpc: "https://testnet.snaxchain.io",
key: getEnvVar("ETH_KEY_TESTNET"),
chain_id: 2192,
chain_id: 13001,
},
Seievm: {
rpc: "https://evm-rpc-arctic-1.sei-apis.com/",
Expand Down
6 changes: 3 additions & 3 deletions ethereum/env/.env.snaxchain.testnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
# Rename to .env

# Common config for forge deployment
RPC_URL="https://rpc-snaxchain-s50q0kjngn.t.conduit.xyz/"
RPC_URL="https://testnet.snaxchain.io"
FORGE_ARGS="--legacy"

# Wormhole Core Migrations
INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
INIT_CHAIN_ID=43
INIT_GOV_CHAIN_ID=0x1
INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
INIT_EVM_CHAIN_ID=2192
INIT_EVM_CHAIN_ID=13001

# Bridge Migrations
BRIDGE_INIT_CHAIN_ID=43
BRIDGE_INIT_GOV_CHAIN_ID=0x1
BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
BRIDGE_INIT_FINALITY=1
# TODO: This exists. Is this what we should use?
# Snaxchain is an OP Stack chain and therefore has the same WETH address. https://docs.optimism.io/stack/protocol/features/custom-gas-token#what-is-the-wrapped-erc-20-gas-token
BRIDGE_INIT_WETH=0x4200000000000000000000000000000000000006
2 changes: 1 addition & 1 deletion node/cmd/guardiand/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func runNode(cmd *cobra.Command, args []string) {
*blastContract = checkEvmArgs(logger, *blastRPC, *blastContract, "blast", true)
*xlayerContract = checkEvmArgs(logger, *xlayerRPC, *xlayerContract, "xlayer", true)
*berachainContract = checkEvmArgs(logger, *berachainRPC, *berachainContract, "berachain", false)
*snaxchainContract = checkEvmArgs(logger, *snaxchainRPC, *snaxchainContract, "snaxchain", false)
*snaxchainContract = checkEvmArgs(logger, *snaxchainRPC, *snaxchainContract, "snaxchain", true)

// These chains will only ever be testnet / devnet.
*sepoliaContract = checkEvmArgs(logger, *sepoliaRPC, *sepoliaContract, "sepolia", false)
Expand Down
1 change: 1 addition & 0 deletions node/pkg/governor/mainnet_chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ func chainList() []chainConfigEntry {
{emitterChainID: vaa.ChainIDBlast, dailyLimit: 500_000, bigTransactionSize: 50_000},
{emitterChainID: vaa.ChainIDXLayer, dailyLimit: 500_000, bigTransactionSize: 50_000},
{emitterChainID: vaa.ChainIDWormchain, dailyLimit: 500_000, bigTransactionSize: 50_000},
{emitterChainID: vaa.ChainIDSnaxchain, dailyLimit: 500_000, bigTransactionSize: 50_000},
}
}
13 changes: 12 additions & 1 deletion node/pkg/governor/mainnet_tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ func TestTokenListAddressSize(t *testing.T) {
// populated.) While this is not a hard requirement, it may represent that a developer has forgotten to take the step
// of configuring tokens when deploying the chain. This test helps to remind them.
func TestGovernedChainHasGovernedAssets(t *testing.T) {

// Add a chain ID to this set if it genuinely has no native assets that should be governed.
ignoredChains := map[vaa.ChainID]bool{
// TODO: Remove this once we have governed tokens for Snax.
vaa.ChainIDSnaxchain: true,

// Wormchain is an abstraction over IBC-connected chains so no assets are "native" to it
vaa.ChainIDWormchain: true,
}
Expand Down Expand Up @@ -71,6 +73,15 @@ func TestGovernedChainHasGovernedAssets(t *testing.T) {
assert.True(t, found, "Chain is governed but has no governed native assets configured")
})
}

// Make sure we're not ignoring any chains with governed tokens.
for _, tokenEntry := range tokenList() {
t.Run(vaa.ChainID(tokenEntry.chain).String(), func(t *testing.T) {
if _, exists := ignoredChains[vaa.ChainID(tokenEntry.chain)]; exists {
assert.Fail(t, "Chain is in ignoredChains but it has governed tokens")
}
})
}
}

func TestTokenListTokenAddressDuplicates(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions sdk/js/src/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ const MAINNET = {
nft_bridge: undefined,
},
snaxchain: {
core: undefined,
token_bridge: undefined,
core: "0xc1BA3CC4bFE724A08FbbFbF64F8db196738665f4",
bruce-riley marked this conversation as resolved.
Show resolved Hide resolved
token_bridge: "0x8B94bfE456B48a6025b92E11Be393BAa86e68410",
nft_bridge: undefined,
},
wormchain: {
Expand Down
2 changes: 2 additions & 0 deletions sdk/mainnet_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ var knownTokenbridgeEmitters = map[vaa.ChainID]string{
vaa.ChainIDMantle: "00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",
vaa.ChainIDBlast: "00000000000000000000000024850c6f61C438823F01B7A3BF2B89B72174Fa9d",
vaa.ChainIDXLayer: "0000000000000000000000005537857664B0f9eFe38C9f320F75fEf23234D904",
vaa.ChainIDSnaxchain: "0000000000000000000000008B94bfE456B48a6025b92E11Be393BAa86e68410",
vaa.ChainIDInjective: "00000000000000000000000045dbea4617971d93188eda21530bc6503d153313",
vaa.ChainIDSui: "ccceeb29348f71bdd22ffef43a2a19c1f5b5e17c5cca5411529120182672ade5",
vaa.ChainIDSei: "86c5fd957e2db8389553e1728f9c27964b22a8154091ccba54d75f4b10c61f5e",
Expand Down Expand Up @@ -189,4 +190,5 @@ var KnownAutomaticRelayerEmitters = []struct {
{ChainId: vaa.ChainIDBlast, Addr: "00000000000000000000000027428DD2d3DD32A4D7f7C497eAaa23130d894911"},
{ChainId: vaa.ChainIDMantle, Addr: "00000000000000000000000027428dd2d3dd32a4d7f7c497eaaa23130d894911"},
{ChainId: vaa.ChainIDXLayer, Addr: "00000000000000000000000027428dd2d3dd32a4d7f7c497eaaa23130d894911"},
{ChainId: vaa.ChainIDSnaxchain, Addr: "00000000000000000000000027428DD2d3DD32A4D7f7C497eAaa23130d894911"},
evan-gray marked this conversation as resolved.
Show resolved Hide resolved
}
Loading