Skip to content

Conversation

@SteP-n-s
Copy link
Contributor

@SteP-n-s SteP-n-s commented Oct 31, 2025

Description

Translate Polygon native token address (0x0000000000000000000000000000000000001010) to zero address to prevent logic treating it as an ERC20 token and enabling the Max button.

Changelog

CHANGELOG entry: fix: remove Max button from Polygon native asset

Related issues

Fixes: #22001

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Simulator Screenshot - iPhone 16 Pro Max - 2025-10-31 at 13 12 49

Pre-merge author checklist

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.

Note

Normalize Polygon native token (0x…1010) to zero address to detect it as native and conditionally show/hide the Max button; add targeted tests.

  • Bridge UI:
    • Normalize Polygon native token address (0x0000000000000000000000000000000000001010) to zeroAddress() before isNativeAddress checks and address formatting in TokenInputArea.
    • Correct Max button visibility for native assets: hidden when gasless swaps disabled, shown when enabled.
  • Tests:
    • Add tests verifying Polygon native token is treated as native and Max button visibility toggles with gasless swap flag.
    • Include necessary imports (CHAIN_IDS, POLYGON_NATIVE_TOKEN).

Written by Cursor Bugbot for commit 106f8b4. This will update automatically on new commits. Configure here.

@SteP-n-s SteP-n-s requested a review from a team as a code owner October 31, 2025 13:15
@SteP-n-s SteP-n-s added the team-swaps-and-bridge Swaps and Bridge team label Oct 31, 2025
@github-actions
Copy link
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.

@SteP-n-s SteP-n-s changed the title fix: remove max button on Polygon native asset fix: remove max button on Polygon native asset cp-7.57.2 Oct 31, 2025
@SteP-n-s SteP-n-s changed the title fix: remove max button on Polygon native asset cp-7.57.2 fix: remove max button on Polygon native asset Oct 31, 2025
@sonarqubecloud
Copy link

@SteP-n-s SteP-n-s added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit 008e25c Oct 31, 2025
85 checks passed
@SteP-n-s SteP-n-s deleted the fix/max-button-polygon branch October 31, 2025 18:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2025
@metamaskbot metamaskbot added the release-7.59.0 Issue or pull request that will be included in release 7.59.0 label Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Max button appearing for Polygon native asset

4 participants