From 7c5e5897849139c5c74501f7cc2b5c9c8d3c25d6 Mon Sep 17 00:00:00 2001 From: Haider-Ali-DS Date: Wed, 8 May 2024 00:16:44 +0500 Subject: [PATCH 1/3] fix ethereum config --- chains/ethereum/config/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chains/ethereum/config/src/lib.rs b/chains/ethereum/config/src/lib.rs index 9717ac55..f683330d 100644 --- a/chains/ethereum/config/src/lib.rs +++ b/chains/ethereum/config/src/lib.rs @@ -238,10 +238,10 @@ pub fn arbitrum_config(network: &str) -> anyhow::Result { /// Returns `Err` if the network is not supported pub fn config(network: &str) -> anyhow::Result { let (network, symbol, bip44_id, is_dev) = match network { - "dev" => ("dev", "ETH", 1, true), + "dev" => ("dev", "ETH", 60, true), "mainnet" => ("mainnet", "ETH", 60, false), - "goerli" => ("goerli", "TST", 1, true), - "sepolia" => ("sepolia", "SepoliaETH", 1, true), + "goerli" => ("goerli", "TST", 60, true), + "sepolia" => ("sepolia", "SepoliaETH", 60, true), // Polygon "polygon-local" => return polygon_config("dev"), From fde0d37dacfed13910f3b8b912a7c0009caf9935 Mon Sep 17 00:00:00 2001 From: Haider-Ali-DS Date: Thu, 9 May 2024 00:31:54 +0500 Subject: [PATCH 2/3] fix coin_type for ethereum chains --- chains/ethereum/config/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chains/ethereum/config/src/lib.rs b/chains/ethereum/config/src/lib.rs index f683330d..1dd6eb38 100644 --- a/chains/ethereum/config/src/lib.rs +++ b/chains/ethereum/config/src/lib.rs @@ -266,9 +266,15 @@ fn evm_config( blockchain: &'static str, network: &'static str, symbol: &'static str, - bip44_id: u32, + _bip44_id: u32, is_dev: bool, ) -> BlockchainConfig { + // hard codes bip44_id to 60 + // proper bip44 ids are here: https://github.com/satoshilabs/slips/blob/master/slip-0044.md + // but famous wallets i.e. metamask, trust wallet uses 60 as coin_type' for ethereum chains. + // Reference: https://support.metamask.io/managing-my-wallet/secret-recovery-phrase-and-private-keys/importing-a-seed-phrase-from-another-wallet-software-derivation-path/ + let bip44_id = 60; + BlockchainConfig { blockchain, network, From 083604515712b0742b38cd64be4658a876c6e6c5 Mon Sep 17 00:00:00 2001 From: Haider-Ali-DS Date: Thu, 9 May 2024 16:59:12 +0500 Subject: [PATCH 3/3] revert eth testnet coin_types --- chains/ethereum/config/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chains/ethereum/config/src/lib.rs b/chains/ethereum/config/src/lib.rs index 1dd6eb38..63311194 100644 --- a/chains/ethereum/config/src/lib.rs +++ b/chains/ethereum/config/src/lib.rs @@ -238,10 +238,10 @@ pub fn arbitrum_config(network: &str) -> anyhow::Result { /// Returns `Err` if the network is not supported pub fn config(network: &str) -> anyhow::Result { let (network, symbol, bip44_id, is_dev) = match network { - "dev" => ("dev", "ETH", 60, true), + "dev" => ("dev", "ETH", 1, true), "mainnet" => ("mainnet", "ETH", 60, false), - "goerli" => ("goerli", "TST", 60, true), - "sepolia" => ("sepolia", "SepoliaETH", 60, true), + "goerli" => ("goerli", "TST", 1, true), + "sepolia" => ("sepolia", "SepoliaETH", 1, true), // Polygon "polygon-local" => return polygon_config("dev"),