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

eth/chain: update list of chains #283

Merged
merged 1 commit into from
Jul 2, 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
43 changes: 32 additions & 11 deletions lib/eth/chain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ class ReplayProtectionError < StandardError; end
# Chain ID for Optimistic Ethereum mainnet.
OPTIMISM = 10.freeze

# Chain ID for Cronos mainnet.
CRONOS = 25.freeze

# Chain ID for Rootstock mainnet.
RSK = 30.freeze

# Chain ID for BNB Smart Chain mainnet.
BNB = 56.freeze

# Chain ID for Ethereum Classic mainnet.
CLASSIC = 61.freeze

Expand All @@ -50,9 +59,24 @@ class ReplayProtectionError < StandardError; end
# Chain ID for the Polygon mainnet (formerly Matic).
POLYGON = MATIC.freeze

# Chain ID for Arbitrum mainnet.
# Chain ID for Filecoin mainnet.
FILECOIN = 314.freeze

# Chain ID for Moonbeam
MOONBEAM = 1284.freeze

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

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

# Chain ID for Avalance C-Chain mainnet.
AVALANCHE = 43114.freeze

# Chain ID for Linea mainnet.
LINEA = 59144.freeze

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

Expand All @@ -77,7 +101,7 @@ class ReplayProtectionError < StandardError; end
# Chain ID for Mordor testnet.
MORDOR = 63.freeze

# Chain ID for Optimistik Kovan testnet.
# Chain ID for Optimistm Kovan testnet.
KOVAN_OPTIMISM = 69.freeze

# Chain ID for Arbitrum xDAI testnet.
Expand All @@ -86,6 +110,12 @@ class ReplayProtectionError < StandardError; end
# Chain ID for Optimistic Goerli testnet.
GOERLI_OPTIMISM = 420.freeze

# Chain ID for Moonriver testnet
MOONRIVER = 1285.freeze

# Chain ID for Moonbase alpha
MOONBASE = 1287.freeze

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

Expand All @@ -104,15 +134,6 @@ class ReplayProtectionError < StandardError; end
# Chain ID for the geth private network preset.
PRIVATE_GETH = 1337.freeze

# Chain ID for Moonbase
MOONBASE = 1287.freeze

# Chain ID for Moonriver
MOONRIVER = 1285.freeze

# Chain ID for Moonbeam
MOONBEAM = 1284.freeze

# Indicates wether the given `v` indicates a legacy chain value
# used by ledger wallets without EIP-155 replay protection.
#
Expand Down
14 changes: 10 additions & 4 deletions spec/eth/chain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
expect(Chain::EXPANSE).to eq 2
expect(Chain::OPTIMISM).to eq 10
expect(Chain::CLASSIC).to eq 61
expect(Chain::CRONOS).to eq 25
expect(Chain::RSK).to eq 30
expect(Chain::BNB).to eq 56
expect(Chain::POA_NET).to eq 99
expect(Chain::XDAI).to eq 100
expect(Chain::GNOSIS).to eq 100
expect(Chain::MATIC).to eq 137
expect(Chain::POLYGON).to eq 137
expect(Chain::ARBITRUM).to eq 42161
expect(Chain::FILECOIN).to eq 314
expect(Chain::MOONBEAM).to eq 1284
expect(Chain::BASE).to eq 8453
expect(Chain::ARBITRUM).to eq 42161
expect(Chain::AVALANCHE).to eq 43114
expect(Chain::LINEA).to eq 59144

# Chain IDs for selected testnets
expect(Chain::MORDEN).to eq 2
Expand All @@ -28,15 +35,14 @@
expect(Chain::KOVAN_OPTIMISM).to eq 69
expect(Chain::XDAI_ARBITRUM).to eq 200
expect(Chain::GOERLI_OPTIMISM).to eq 420
expect(Chain::MOONRIVER).to eq 1285
expect(Chain::MOONBASE).to eq 1287
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::MOONRIVER).to eq 1285
expect(Chain::MOONBASE).to eq 1287

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