Skip to content

Add validation of suggested metadata on ERC20 wallet_watchAsset confirmation  #1207

@adonesky1

Description

@adonesky1

Description

This issue aims to improve the reliability of suggested metadata for ERC20 tokens in the MetaMask extension by validating it against the metadata fetched directly from the chain during the wallet_watchAsset confirmation process.

Expected behavior

When the wallet_watchAsset function is invoked, the extension should compare the suggested metadata with the on-chain metadata before displaying the confirmation dialog. This ensures the provided metadata is accurate and trustworthy.

Proposed solution

Update the wallet_watchAsset function to fetch token metadata directly from the blockchain, such as token name, symbol, and decimals.
Compare the fetched metadata with the suggested metadata. If discrepancies are found, either display an error message or just use the on-chain metadata.

Potential drawbacks

This approach may introduce additional latency during the wallet_watchAsset process due to blockchain data fetching. However, the benefits of providing accurate token metadata outweigh the potential drawbacks.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions