Skip to content

Fix: Duplicate TRON rows in Earn tab (#32110)#32130

Open
Abhigyan-git09 wants to merge 2 commits into
MetaMask:mainfrom
Abhigyan-git09:fix/earn-tron-duplicates
Open

Fix: Duplicate TRON rows in Earn tab (#32110)#32130
Abhigyan-git09 wants to merge 2 commits into
MetaMask:mainfrom
Abhigyan-git09:fix/earn-tron-duplicates

Conversation

@Abhigyan-git09

@Abhigyan-git09 Abhigyan-git09 commented Jun 21, 2026

Copy link
Copy Markdown

Description

Fixes #32110. The Earn deposit token picker previously showed duplicate TRON rows with blank names. This was caused by the multichain assets controller emitting TRON special assets (or tokens missing metadata) without a symbol or name. Since isTronSpecialAsset checked the symbol, it failed to filter them out when the symbol was missing, and selectEarnTokens subsequently treated each one as a native TRON staking token.

This PR:

  1. Updates isTronSpecialAsset to correctly filter out Tron tokens missing a symbol.
  2. Adds a robust guard in selectEarnTokens to completely ignore tokens across all chains that lack both a symbol and a name.

Changelog

CHANGELOG entry: Fixed a bug in the Earn deposit token list where duplicate blank TRON rows were displayed due to unparsed multichain assets.

Related issues

Fixes #32110

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards.
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable
  • I've documented my code using JSDoc format if applicable

Note

Low Risk
Display and token-list filtering only; no auth, payments, or persistence changes. Slight risk that legitimately unnamed tokens on any chain are excluded from Earn.

Overview
Fixes duplicate blank TRON rows in the Earn deposit token list when multichain assets arrive without metadata.

isTronSpecialAsset now treats Tron-chain tokens with a missing or empty symbol as special assets (filtered like energy/bandwidth), instead of letting them pass through when symbol was falsy.

selectEarnTokens additionally drops tokens across all chains that lack both symbol and name before building earn token lists.

Unit tests cover the updated isTronSpecialAsset behavior.

Reviewed by Cursor Bugbot for commit c0b877d. Bugbot is set up for automated code reviews on this repo. Configure here.

@Abhigyan-git09
Abhigyan-git09 requested a review from a team as a code owner June 21, 2026 20:10
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@Abhigyan-git09

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Earn deposit token list shows duplicate blank TRON rows with repeated APR

1 participant