superhero-com / superhero-wallet

Superhero Wallet – More than just a way to receive, store & send tokens on the æternity blockchain
https://wallet.superhero.com
ISC License
39 stars 38 forks source link

ETH chain ID set as regular number instead of hex #3068

Closed peronczyk closed 4 months ago

peronczyk commented 4 months ago

Right now when creating new wallet network we need to provide the Chain ID for ethereum protocol. Required format is HEX, but actually it is more common to use regular numbers when interacting with user. Then convert the number to HEX when doing any blockchain activity.

See here: https://docs.simplehash.com/reference/supported-chains-testnets - the Chain IDs are thumbers located after eip155:.

This task is about using the INTegers instead of HEXadecimals values.

Image

So instead of ETH Mainnet 0x1 we need just use 1. ETH Sepolia Testnet: 0xaa36a7 => 11155111

This change affects connecting to ETH networks, so tests should also cover sending some ETH/ERC-20 funds on any network.

Liubov-crypto commented 4 months ago

Idk if it's an issue, but there is no way to check Chain Id on mainnet, because we have testnet by default on both networks when user want to add a custom network:

https://github.com/superhero-com/superhero-wallet/assets/69896204/20d0f465-11cc-4d6b-925c-b0bb1b5b559e

Sending ETH/ERC-20 is working good on testnet.

peronczyk commented 4 months ago

Yes, previously the testnet Chain ID was also used as the default value when adding custom network. The only difference is that it was using hex value instead of numerical.

Liubov-crypto commented 4 months ago

On testnet it looks fine, so could be approved I think.