-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: standardize fallback value for zero hex in balance checks #38649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+5
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Collaborator
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (1 files, +5 -3)
|
Collaborator
Builds ready [94996cb]
UI Startup Metrics (1235 ± 78 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
jpuri
previously approved these changes
Dec 9, 2025
OGPoyraz
previously approved these changes
Dec 9, 2025
Collaborator
Builds ready [3d24dbb]
UI Startup Metrics (1279 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
OGPoyraz
approved these changes
Dec 10, 2025
jpuri
approved these changes
Dec 10, 2025
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 10, 2025
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR fixes a [issue raised by cursor](#38306 (comment)) to 0x0 is a numeric literal (the number zero) rather than the hex string '0x0' <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/38649?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: MetaMask/MetaMask-planning#6408 ## **Manual testing steps** 1. Send flow with insufficient balance 2. should display the insufficient alert ## **Screenshots/Recordings** [alert.webm](https://github.com/user-attachments/assets/5cf66e88-8256-4995-9b2d-4cb30f2f5198) <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Standardizes zero-hex fallback via a shared `ZERO_HEX_FALLBACK` in `useHasInsufficientBalance` for tx value, batch values, and balance lookups. > > - **Hooks** > - `ui/pages/confirmations/hooks/useHasInsufficientBalance.ts`: > - Introduces `ZERO_HEX_FALLBACK = '0x0'`. > - Replaces inline zero-hex defaults with `ZERO_HEX_FALLBACK` for `txParams.value`, nested transaction values, and balance fallback. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 3d24dbb. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
no-changelog
no-changelog Indicates no external facing user changes, therefore no changelog documentation needed
release-13.14.0
Issue or pull request that will be included in release 13.14.0
size-XS
team-confirmations
Push issues to confirmations team
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
This PR fixes a issue raised by cursor to 0x0 is a numeric literal (the number zero) rather than the hex string '0x0'
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6408
Manual testing steps
Screenshots/Recordings
alert.webm
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Standardizes zero-hex fallback via a shared
ZERO_HEX_FALLBACKinuseHasInsufficientBalancefor tx value, batch values, and balance lookups.ui/pages/confirmations/hooks/useHasInsufficientBalance.ts:ZERO_HEX_FALLBACK = '0x0'.ZERO_HEX_FALLBACKfortxParams.value, nested transaction values, and balance fallback.Written by Cursor Bugbot for commit 3d24dbb. This will update automatically on new commits. Configure here.