Skip to content

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Oct 17, 2025

Description

The fee is being determined dynamically in the API already, so this is just displaying the correct value now, since 35% fee is capped at 10$.

Open in GitHub Codespaces

Changelog

CHANGELOG entry:

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6052

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Screenshot 2025-10-17 at 17 34 20

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

Use gasFeeToken.fee for MetaMask fee instead of a hardcoded 35% calculation.

  • Fees:
    • Replace hardcoded 35% MetaMask fee with dynamic gasFeeToken.fee in ui/pages/confirmations/components/confirm/info/hooks/useGasFeeToken.ts.
    • Remove METAMASK_FEE_PERCENTAGE and dependent BigNumber calculation; downstream fiat fee uses the provided fee value.

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

@pedronfigueiredo pedronfigueiredo self-assigned this Oct 17, 2025
@pedronfigueiredo pedronfigueiredo requested a review from a team as a code owner October 17, 2025 16:42
@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Oct 17, 2025
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.

const metaMaskFee = add0x(
new BigNumber(amount).times(METAMASK_FEE_PERCENTAGE).toString(16),
);
const metaMaskFee = gasFeeToken?.fee;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: MetaMask Fee Display Fails for Native Tokens

The metaMaskFee is undefined for native token transactions. This occurs because useNativeGasFeeToken() doesn't provide a fee property, which the new logic expects. This breaks the MetaMask fee display when falling back to native tokens, as a fee was always calculated previously.

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (1 files, +1 -4)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 components/
          • 📁 confirm/
            • 📁 info/
              • 📁 hooks/
                • 📄 useGasFeeToken.ts +1 -4

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: bf7f992 | Date: 10/17/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±77ms) 🟡 | historical mean value: 1.05s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 740ms (±72ms) 🟢 | historical mean value: 737ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±13ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 77ms 1.01s 1.36s 1.31s 1.36s
domContentLoaded 740ms 72ms 702ms 1.04s 990ms 1.04s
firstPaint 80ms 13ms 64ms 188ms 88ms 188ms
firstContentfulPaint 80ms 13ms 64ms 188ms 88ms 188ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [bf7f992]
UI Startup Metrics (1289 ± 73 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1289114114757313411411
load110294612886711451208
domContentLoaded109594012826711391205
domInteractive2013119141840
firstPaint82088129742111281202
backgroundConnect2582442828263271
firstReactRender2919176212744
getState17690131936
initialActions717111621
loadScripts844698103067890958
setupStore1163461129
WebpackHomeuiStartup819700130476838941
load620571115275625716
domContentLoaded612566114474615709
domInteractive15115081433
firstPaint18554798169193614
backgroundConnect21105072533
firstReactRender2716123123136
getState933141115
initialActions308246
loadScripts610564113372614698
setupStore951931114
FirefoxBrowserifyHomeuiStartup14691293198210815221653
load1247110714527713061351
domContentLoaded1247110714517613061350
domInteractive1153637761119292
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3622136173974
firstReactRender25214142636
getState95899914
initialActions4125348
loadScripts1223106014317812841329
setupStore155188221161
WebpackHomeuiStartup15551359196412716131873
load1330118016409313801510
domContentLoaded1330117916399313801510
domInteractive1063237766102320
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect362187134069
firstReactRender292276103155
getState10413114916
initialActions41233311
loadScripts1307116416119013581483
setupStore14599191071
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 58 Bytes (0%)
  • ui: -118 Bytes (0%)
  • common: -230 Bytes (0%)

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

Labels

size-XS team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants