fix: use toAddress instead of NULL_ADDRESS for fee calc#245
Closed
mikesposito wants to merge 1 commit into
Closed
Conversation
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
4 tasks
ulissesferreira
added a commit
that referenced
this pull request
Mar 24, 2026
…ssing (#259) ## Explanation `onAmountInput` currently estimates fees by building a transaction before the recipient is always available. Closed PR #245 fixed part of that by accepting `toAddress` in the request and using it for fee estimation. This PR ports that fix onto the `fix/incident-1528` branch and adds the incident-specific safeguard we want on top: when `toAddress` is not provided, the handler now skips fee validation and returns `valid: true` after the normal asset-balance check. When `toAddress` is provided, fee estimation uses the real recipient address. This prevents fee-estimation failures for token contracts that reject zero-address transfers while preserving correct fee validation once the user has entered a recipient. ## References - Related to [incident-1528](https://consensys.slack.com/archives/C0AMFS19E0P) - Adapts the changes from [#245](#245) ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
[WIP]
Including
toAddresswhen calculating fees asNULL_ADDRESScan cause issues with certain token contracts that have guards against sending to the zero address.References
Checklist