Skip to content

fix(bridge): normalize Polygon native token addresses cp-7.75.0 #29440

Merged
bfullam merged 1 commit into
mainfrom
swaps-fix-pol-asset-details-handoff
Apr 28, 2026
Merged

fix(bridge): normalize Polygon native token addresses cp-7.75.0 #29440
bfullam merged 1 commit into
mainfrom
swaps-fix-pol-asset-details-handoff

Conversation

@bfullam

@bfullam bfullam commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Description

Polygon native POL can enter the bridge/swaps flow from token details with Polygon's native token alias address (0x0000000000000000000000000000000000001010). Bridge state expects native EVM assets to use the swaps native zero address, so the alias can break downstream balance, gas, and quote matching behavior.

This change normalizes source and destination bridge tokens as they are stored in the bridge Redux slice. That keeps bridge state canonical for all callers of setSourceToken and setDestToken, including the POL token details swap entry point.

Changelog

CHANGELOG entry: Fixed a bug that prevented quotes when swapping from POL token details

Related issues

Issue: #29231

Manual testing steps

Feature: POL swap quotes from token details

  Scenario: User starts a swap from the POL asset details screen
    Given the user has POL on Polygon Mainnet
    And the user opens POL from the wallet token list
    When the user taps Swap from the POL token details screen
    And the user enters a valid POL amount
    Then the swap flow fetches and displays available quotes

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@github-actions

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.

@metamaskbotv2 metamaskbotv2 Bot added the team-swaps-and-bridge Swaps and Bridge team label Apr 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are focused on the bridge Redux slice (app/core/redux/slices/bridge/index.ts), specifically adding a normalizeBridgeToken helper that normalizes Polygon's native token address (0x0000...1010 → 0x0000...0000) when setting source/destination tokens. This is a targeted bug fix for Polygon native token handling in bridge flows.

SmokeTrade is selected because:

  • The bridge slice directly powers the cross-chain bridging feature tested by SmokeTrade
  • The fix affects setSourceToken and setDestToken reducers which are core to the bridge/swap flow
  • Bridge flows between networks (e.g., Ethereum mainnet to Base, or involving Polygon) are covered by SmokeTrade

SmokeConfirmations is selected because:

  • Per SmokeTrade tag description: "When selecting SmokeTrade for swap or bridge flows, also select SmokeConfirmations (transaction confirmations are part of the flow)"
  • Bridge transactions go through the confirmation flow

No other tags are needed as:

  • The change is isolated to the bridge Redux slice
  • No shared navigation, modal, or account management components are affected
  • No network permission or multi-chain API changes
  • The normalizeTokenAddress utility already existed and was used in other bridge hooks; this just applies it at the Redux slice level for consistency

Performance Test Selection:
The changes are a targeted bug fix for Polygon native token address normalization in the bridge Redux slice. This is a simple address string normalization that adds negligible overhead and does not impact rendering performance, data loading, UI components, or any performance-sensitive paths. No performance tests are warranted.

View GitHub Actions results

@bfullam bfullam changed the title Fix bridge token address normalization for Polygon native assets fix(bridge): normalize Polygon native token addresses Apr 28, 2026
@SteP-n-s SteP-n-s changed the title fix(bridge): normalize Polygon native token addresses fix(bridge): normalize Polygon native token addresses cp-7.75.0 Apr 28, 2026
@sonarqubecloud

Copy link
Copy Markdown

@bfullam bfullam enabled auto-merge April 28, 2026 18:24
@bfullam bfullam added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit b84864b Apr 28, 2026
120 of 131 checks passed
@bfullam bfullam deleted the swaps-fix-pol-asset-details-handoff branch April 28, 2026 18:44
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.76.0 Issue or pull request that will be included in release 7.76.0 label Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.76.0 Issue or pull request that will be included in release 7.76.0 size-S team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants