metamask-extension
metamask-extension copied to clipboard
[Bug]: Unable to add a network with 'wallet_addEthereumChain' with token symbol length less than 2
Describe the bug
When adding a network using the JSON-RPC API request "wallet_addEthereumChain", I get the following error.
Expected 2-6 character string 'nativeCurrency.symbol'. Received: Q
We tried to get around this limitation by adding a space after sybol "Q ". In the latest update, this message appeared in the latest updates
Also, you can enter 1 character in the UI and it won't give an error.
You can also use this request to check that the network is registered with 1 character. chainId: 35441
Expected behavior
When adding a network using 'wallet_addEthereumChain' there should be no error if the token symbol length is 1.
Screenshots/Recordings
No response
Steps to reproduce
provider.send('wallet_addEthereumChain', [
{
chainId: '0x8A71',
chainName: 'Q Mainnet',
nativeCurrency: {
name: 'Q token',
symbol: 'Q',
decimals: 18,
},
rpcUrls: ['https://rpc.q.org'],
blockExplorerUrls: ['https://explorer.q.org'],
},
])
Error messages or log output
No response
Version
11.7.2
Build type
None
Browser
Chrome
Operating system
MacOS
Hardware wallet
No response
Additional context
This error can be fixed for expansion on this section of code.
Suggestion for correction:
(typeof ticker !== 'string' || ticker.length < 1 || ticker.length > 6)
Also, it would be nice to add this change to the mobile app as well.
Severity
No response
Hello, @KlausKidman. Thanks for reporting! I will pass this on to the appropriate team so they can look into this issue. Happy New Year!
This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.
This issue was closed because there has been no follow up activity in the last 45 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.