Skip to content

Commit

Permalink
eth/chain: update ids (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
q9f authored Dec 17, 2024
1 parent 33fbd3b commit 95e520a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lib/eth/chain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,30 @@ class ReplayProtectionError < StandardError; end
# Chain ID for Filecoin mainnet.
FILECOIN = 314.freeze

# Chain ID for the Cronos zkEVM chain.
CRONOS_ZK = 388.freeze

# Chain ID for Redstone Optimistic Rollup.
REDSTONE = 690.freeze

# Chain ID for the Polygon zkEVM.
POLYGON_ZK = 1101.freeze

# Chain ID for the Lisk layer 2.
LISK = 1135.freeze

# Chain ID for Moonbeam
MOONBEAM = 1284.freeze

# Chain ID for Base mainnet.
BASE = 8453.freeze

# Chain ID for the EVMOS mainnet.
EVMOS = 9001.freeze

# Chain ID for the Celo layer 2.
CELO = 42220.freeze

# Chain ID for Arbitrum One mainnet.
ARBITRUM = 42161.freeze

Expand All @@ -77,6 +95,9 @@ class ReplayProtectionError < StandardError; end
# Chain ID for Linea mainnet.
LINEA = 59144.freeze

# Chain ID for the Scroll layer 2.
SCROLL = 534352.freeze

# Chain ID for Morden (Ethereum) testnet.
MORDEN = 2.freeze

Expand Down Expand Up @@ -116,6 +137,9 @@ class ReplayProtectionError < StandardError; end
# Chain ID for Moonbase alpha
MOONBASE = 1287.freeze

# Chain ID for the Garnet Holesky testnet
GARNET = 17069.freeze

# Chain ID for the Polygon Mumbai testnet.
MUMBAI = 80001.freeze

Expand All @@ -130,6 +154,7 @@ class ReplayProtectionError < StandardError; end

# Chain ID for Holesovice testnet.
HOLESOVICE = 11166111.freeze
HOLESKY = HOLESOVICE

# Chain ID for the geth private network preset.
PRIVATE_GETH = 1337.freeze
Expand Down
9 changes: 9 additions & 0 deletions spec/eth/chain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@
expect(Chain::MATIC).to eq 137
expect(Chain::POLYGON).to eq 137
expect(Chain::FILECOIN).to eq 314
expect(Chain::CRONOS_ZK).to eq 388
expect(Chain::REDSTONE).to eq 690
expect(Chain::POLYGON_ZK).to eq 1101
expect(Chain::LISK).to eq 1135
expect(Chain::MOONBEAM).to eq 1284
expect(Chain::BASE).to eq 8453
expect(Chain::EVMOS).to eq 9001
expect(Chain::CELO).to eq 42220
expect(Chain::ARBITRUM).to eq 42161
expect(Chain::AVALANCHE).to eq 43114
expect(Chain::LINEA).to eq 59144
expect(Chain::SCROLL).to eq 534352

# Chain IDs for selected testnets
expect(Chain::MORDEN).to eq 2
Expand All @@ -37,11 +44,13 @@
expect(Chain::GOERLI_OPTIMISM).to eq 420
expect(Chain::MOONRIVER).to eq 1285
expect(Chain::MOONBASE).to eq 1287
expect(Chain::GARNET).to eq 17069
expect(Chain::MUMBAI).to eq 80001
expect(Chain::RINKEBY_ARBITRUM).to eq 421611
expect(Chain::GOERLI_ARBITRUM).to eq 421613
expect(Chain::SEPOLIA).to eq 11155111
expect(Chain::HOLESOVICE).to eq 11166111
expect(Chain::HOLESKY).to eq 11166111

# Chain IDs for selected private networks
expect(Chain::PRIVATE_GETH).to eq 1337
Expand Down

0 comments on commit 95e520a

Please sign in to comment.