fix: remove duplicate POL tokens from swap select token screen #21924
+572
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Description
POL token is defined with zero address in our backend services but its actual address is
0x0000000000000000000000000000000000001010. That creates an issue where both tokes are rendered even if they are the same. To mitigate this issue we keep the one with zero address as it's more consistent with similar logic.Changelog
CHANGELOG entry: Fixes an issue where users will see two POL tokens on swap select token screen
Related issues
Fixes: #19334
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Normalize Polygon native token addressing to dedupe POL across token sources and ensure correct rendering/exclusion.
0x0000000000000000000000000000000000001010tozeroAddress()inuseTokensgetTokenKeyfor consistent deduplication across sources.zeroAddress()or native address.hooks/useTokens.test.tscovering:tokensWithBalanceandtopTokens(both address variants).allTokensnormalization, and exclusion cases.POLYGON_NATIVE_TOKENinconstants/assets.ts.Written by Cursor Bugbot for commit 3cde5f8. This will update automatically on new commits. Configure here.