MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.15k stars 1.11k forks source link

addEthereumChain not working on chain with chain_id of 10 #3269

Open danfinlay opened 3 years ago

danfinlay commented 3 years ago

A QBS customer says:

Currently, we are developing a blockchain application to be used on the Metamask Mobile dApp browser. We require the use of the methods 'wallet_switchEthereumChain' and 'wallet_addEthereumChain'. However, the popups to add a new chain and to switch chains do not work, and give the error, 'May not specify default Metamask chain'. This error does not appear on the desktop version of the metamask extension. The deployed QBS network is on chain ID: 10. Is there a way to change the chain ID? Or are there any fixes for the Metamask Mobile bug?

gantunesr commented 2 years ago

Related to #3581

defispartan commented 12 months ago

+1 on this, it is not just chainID 10, MetaMask mobile throws this error when attempting to add any chainID in their default list:

Object { code: 5000, message: '{"code":-32602,"message":"May not specify default MetaMask chain."}' }

This is a significant because it does not allow testing of fork networks with the same underlying chainID, which is necessary if you want to test signatures with the chainID encoded (such as EIP-2612 permit).