Skip to content

feat: arc network send max feature#43486

Closed
salimtb wants to merge 7 commits into
feat/arc-default-usdc-tokenfrom
feat/arc-default-usdc-token-second
Closed

feat: arc network send max feature#43486
salimtb wants to merge 7 commits into
feat/arc-default-usdc-tokenfrom
feat/arc-default-usdc-token-second

Conversation

@salimtb

@salimtb salimtb commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

this ranch is chained to this one #43455 in order to make reviews small and easy

Changelog

CHANGELOG entry: arc send max feeature

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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

Low Risk
Refactor-only change with equivalent branching and dependencies; limited to send max amount calculation in the confirmations flow.

Overview
Send max on Arc still reserves gas using layer-1 fees and a direct gas-API suggested fee when Redux gas estimates are missing; this change only how those values are loaded.

useMaxAmount merges two separate useAsyncResult calls (layer-1 gas + Arc fetchSuggestedMaxFeePerGas) into one async effect that returns { layer1GasFees, arcSuggestedMaxFeePerGas }, so the hook triggers a single state update per resolution instead of two.

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

@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.

@mm-token-exchange-service

mm-token-exchange-service Bot commented Jun 12, 2026

Copy link
Copy Markdown

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (1 files, +24 -20)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📁 send/
            • 📄 useMaxAmount.ts +24 -20

@salimtb salimtb changed the title Feat/arc default usdc token second feat: arc default usdc token second Jun 12, 2026
@salimtb salimtb marked this pull request as ready for review June 12, 2026 09:33
@salimtb salimtb requested a review from a team as a code owner June 12, 2026 09:33
@salimtb salimtb changed the title feat: arc default usdc token second feat: arc send max feeature Jun 12, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 825ea8a. Configure here.

Comment thread ui/pages/confirmations/utils/transaction-pay.ts
@salimtb salimtb changed the title feat: arc send max feeature feat: arc network send max feature Jun 12, 2026
@matthewwalsh0 matthewwalsh0 self-requested a review June 12, 2026 10:10
// selectable or auto-selected default pay token.
if (
token.chainId === CHAIN_IDS.ARC &&
token.address?.toLowerCase() === ARC_USDC_TOKEN_ADDRESS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But can you still select native Arc as a payment token? If they are the same, what's wrong with that? You can still select other native tokens for other chains.


const arcSuggestedMaxFeePerGas =
isArcNativeMirror && chainId
? await fetchSuggestedMaxFeePerGas(chainId)

@matthewwalsh0 matthewwalsh0 Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why wouldn't the gas fee controller automatically poll this to gas fee estimates as with any other chain?

// transfer. Because the gas is held upfront (gasLimit * maxFeePerGas) from the
// same balance the transfer draws from, a conservative ERC20 transfer gas
// limit is reserved so the transfer never exceeds the balance.
const ARC_USDC_TRANSFER_GAS_LIMIT = 100000;

@matthewwalsh0 matthewwalsh0 Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why have we refactored this file to such a degree if the only difference seems to be this alternate gas limit given the nature of the native / USDC token on Arc?

Could we instead just update getEstimatedTotalGas to accept an asset argument and conditionally use this gas limit instead?

@metamaskbotv2

metamaskbotv2 Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
Builds ready [ffca2fe]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 9 warn · 🔴 0 fail)

Baseline (latest main): 4744e15 | Date: 6/12/2026 | Pipeline: 27410434833 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: +33%
  • loadNewAccount/longTaskCount: -100%
  • loadNewAccount/longTaskTotalDuration: -100%
  • loadNewAccount/longTaskMaxDuration: -100%
  • loadNewAccount/tbt: -100%
  • loadNewAccount/total: +33%
  • loadNewAccount/inp: +16%
  • loadNewAccount/fcp: +17%
  • loadNewAccount/lcp: -60%
  • confirmTx/longTaskTotalDuration: -13%
  • confirmTx/tbt: -17%
  • confirmTx/inp: -15%
  • confirmTx/lcp: -12%
  • bridgeUserActions/bridge_load_page: -38%
  • bridgeUserActions/bridge_load_asset_picker: +24%
  • bridgeUserActions/longTaskCount: +100%
  • bridgeUserActions/longTaskTotalDuration: +52%
  • bridgeUserActions/inp: -14%
  • loadNewAccount/load_new_account: +47%
  • loadNewAccount/longTaskCount: -100%
  • loadNewAccount/longTaskTotalDuration: -100%
  • loadNewAccount/longTaskMaxDuration: -100%
  • loadNewAccount/tbt: -100%
  • loadNewAccount/total: +47%
  • loadNewAccount/lcp: +322%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/inp: -15%
  • confirmTx/lcp: +1051%
  • bridgeUserActions/bridge_load_page: +102%
  • bridgeUserActions/bridge_load_asset_picker: +56%
  • bridgeUserActions/bridge_search_token: +14%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +21%
  • bridgeUserActions/inp: +12%
  • bridgeUserActions/fcp: -50%
  • bridgeUserActions/lcp: +1064%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.1s
  • 🟡 loadNewAccount/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupPowerUserHome/domInteractive: -13%
  • startupPowerUserHome/numNetworkReqs: -11%
  • startupStandardHome/inp: +54%
  • startupPowerUserHome/domInteractive: -11%
  • startupPowerUserHome/backgroundConnect: -16%
  • startupPowerUserHome/setupStore: +23%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 520ms
  • 🟡 startupPowerUserHome/LCP: p75 2.8s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
importSrpHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/doneButtonToHomeScreen: -89%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: -98%
  • onboardingImportWallet/longTaskCount: -74%
  • onboardingImportWallet/longTaskTotalDuration: -87%
  • onboardingImportWallet/longTaskMaxDuration: -87%
  • onboardingImportWallet/tbt: -99%
  • onboardingImportWallet/total: -88%
  • onboardingNewWallet/srpButtonToPwForm: +10%
  • onboardingNewWallet/skipBackupToMetricsScreen: +11%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +25%
  • onboardingNewWallet/doneButtonToAssetList: -32%
  • onboardingNewWallet/longTaskCount: -58%
  • onboardingNewWallet/longTaskTotalDuration: -42%
  • onboardingNewWallet/longTaskMaxDuration: -15%
  • onboardingNewWallet/tbt: -50%
  • onboardingNewWallet/total: -28%
  • solanaAssetDetails/assetClickToPriceChart: -50%
  • solanaAssetDetails/longTaskCount: -100%
  • solanaAssetDetails/longTaskTotalDuration: -100%
  • solanaAssetDetails/longTaskMaxDuration: -100%
  • solanaAssetDetails/tbt: -100%
  • solanaAssetDetails/total: -50%
  • solanaAssetDetails/inp: +23%
  • solanaAssetDetails/cls: -92%
  • importSrpHome/loginToHomeScreen: -18%
  • importSrpHome/openAccountMenuAfterLogin: +72%
  • importSrpHome/homeAfterImportWithNewWallet: -34%
  • importSrpHome/longTaskCount: -26%
  • importSrpHome/longTaskTotalDuration: -24%
  • importSrpHome/longTaskMaxDuration: -10%
  • importSrpHome/tbt: -22%
  • importSrpHome/total: -28%
  • importSrpHome/inp: -28%
  • sendTransactions/selectTokenToSendFormLoaded: -30%
  • sendTransactions/tbt: +17%
  • sendTransactions/inp: -30%
  • sendTransactions/fcp: +13%
  • sendTransactions/cls: -87%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 sendTransactions/FCP: p75 1.9s
  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 sendTransactions/FCP: p75 1.9s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: -25%
  • dappPageLoad/domContentLoaded: -23%
  • dappPageLoad/firstPaint: -18%
  • dappPageLoad/firstContentfulPaint: -18%
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 24.28 KiB (0.36%)
  • ui: 4.63 KiB (0.04%)
  • common: 188 Bytes (0%)

@metamaskbotv2

metamaskbotv2 Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
Builds ready [9ec22f9]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 9 warn · 🔴 0 fail)

Baseline (latest main): 2383562 | Date: 6/12/2026 | Pipeline: 27413850374 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: +47%
  • loadNewAccount/total: +47%
  • loadNewAccount/inp: -19%
  • loadNewAccount/lcp: -14%
  • confirmTx/inp: -29%
  • bridgeUserActions/bridge_load_page: -30%
  • bridgeUserActions/bridge_load_asset_picker: +20%
  • bridgeUserActions/longTaskTotalDuration: -10%
  • bridgeUserActions/longTaskMaxDuration: -10%
  • bridgeUserActions/tbt: -25%
  • bridgeUserActions/inp: -21%
  • loadNewAccount/load_new_account: +147%
  • loadNewAccount/total: +147%
  • loadNewAccount/inp: -26%
  • loadNewAccount/fcp: -62%
  • loadNewAccount/lcp: +1033%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/inp: +11%
  • confirmTx/lcp: +1238%
  • bridgeUserActions/bridge_load_page: +111%
  • bridgeUserActions/bridge_load_asset_picker: +22%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +15%
  • bridgeUserActions/inp: -12%
  • bridgeUserActions/lcp: +1193%
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: +10%
  • startupStandardHome/domInteractive: +21%
  • startupStandardHome/backgroundConnect: +21%
  • startupStandardHome/firstReactRender: +13%
  • startupStandardHome/setupStore: +42%
  • startupStandardHome/inp: +127%
  • startupStandardHome/fcp: +20%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 512ms
  • 🟡 startupPowerUserHome/LCP: p75 3.1s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/doneButtonToHomeScreen: -88%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: -98%
  • onboardingImportWallet/longTaskCount: -76%
  • onboardingImportWallet/longTaskTotalDuration: -92%
  • onboardingImportWallet/longTaskMaxDuration: -88%
  • onboardingImportWallet/tbt: -97%
  • onboardingImportWallet/total: -88%
  • onboardingNewWallet/skipBackupToMetricsScreen: +11%
  • onboardingNewWallet/doneButtonToAssetList: -29%
  • onboardingNewWallet/longTaskCount: -62%
  • onboardingNewWallet/longTaskTotalDuration: -51%
  • onboardingNewWallet/longTaskMaxDuration: -26%
  • onboardingNewWallet/tbt: -61%
  • onboardingNewWallet/total: -24%
  • solanaAssetDetails/assetClickToPriceChart: +30%
  • solanaAssetDetails/longTaskCount: +400%
  • solanaAssetDetails/longTaskTotalDuration: +288%
  • solanaAssetDetails/longTaskMaxDuration: +288%
  • solanaAssetDetails/tbt: +189%
  • solanaAssetDetails/total: +30%
  • solanaAssetDetails/inp: +15%
  • solanaAssetDetails/cls: -92%
  • importSrpHome/openAccountMenuAfterLogin: +172%
  • importSrpHome/homeAfterImportWithNewWallet: -38%
  • importSrpHome/longTaskCount: -15%
  • importSrpHome/total: -27%
  • importSrpHome/inp: -17%
  • importSrpHome/fcp: +14%
  • importSrpHome/cls: -34%
  • sendTransactions/selectTokenToSendFormLoaded: +49%
  • sendTransactions/tbt: +14%
  • sendTransactions/cls: -84%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 importSrpHome/INP: p75 240ms
  • 🟡 importSrpHome/FCP: p75 2.0s
  • 🟡 sendTransactions/INP: p75 224ms
  • 🟡 assetDetails/FCP: p75 1.8s
  • 🟡 solanaAssetDetails/FCP: p75 1.8s
  • 🟡 importSrpHome/FCP: p75 1.9s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 24.28 KiB (0.36%)
  • ui: 4.46 KiB (0.04%)
  • common: 188 Bytes (0%)

@github-actions github-actions Bot added size-S and removed size-L labels Jun 12, 2026
@salimtb salimtb force-pushed the feat/arc-default-usdc-token branch from 928d8db to 8368bb0 Compare June 12, 2026 14:53
@salimtb salimtb closed this Jun 15, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants