Add Across support for Predict withdraw post-quote flows#8593
Open
pedronfigueiredo wants to merge 14 commits intomainfrom
Open
Add Across support for Predict withdraw post-quote flows#8593pedronfigueiredo wants to merge 14 commits intomainfrom
pedronfigueiredo wants to merge 14 commits intomainfrom
Conversation
45f1f77 to
c219b14
Compare
d11ee7f to
4165ac4
Compare
e6e9d0c to
f6be627
Compare
a592bc4 to
ff863e1
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 ff863e1. Configure here.
31eef1c to
f1eea84
Compare
f1eea84 to
294498c
Compare
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.

Why
Predict withdraw funds can originate in the Predict proxy/Safe and need to be withdrawn to the source account before Across can bridge them. This flow has to keep the original withdrawal, any EIP-7702 authorization, and source-token gas payment on MetaMask's source-chain batch instead of embedding them as Across destination actions.
Flow
For Predict withdraw post-quote Across execution, the EOA submits one source-chain batch. The first batch leg calls the Predict Safe/proxy withdrawal so USDC.e moves from the Safe/proxy to the recipient EOA; the Safe/proxy does not initiate the transaction or need native gas. That same EOA then approves the Across spender and deposits/swaps through Across. Across uses the EOA as the quote recipient, while
refundAddressis set to the Safe when available so refunds go back to the Safe.What changed
predictAcrossWithdrawtoTransactionTypeso the Across bridge leg is typed separately from the original Predict withdrawal.Reviewer notes
Note
Medium Risk
Changes Across quoting and submission logic (including EIP-7702 authorization-list handling and gas-fee-token selection), which can affect transaction batching and fee payment behavior. Risk is mitigated by extensive new unit coverage but touches critical transaction execution paths.
Overview
Adds Across support for Predict withdraw post-quote flows by introducing a new
TransactionType.predictAcrossWithdrawand allowingisPostQuoteAcross requests that quote as exact input with no destination actions, plus optionalrefundToforwarded asrefundAddress.Updates Across strategy validation to allow source-chain EIP-7702 authorization lists only for Predict-withdraw post-quote requests, and extends quote normalization to reserve/pay source-chain gas with the source token (with stricter failure behavior for post-quote), including fallback pricing when gas-station pricing is unavailable.
Extends Across submission to prepend the original withdrawal leg into the batch, align gas limits accordingly, optionally re-estimate 7702 batch gas when the final batch shape differs from the quote, and set
excludeNativeTokenForFeeso execution follows the quoted gas-fee-token path;TransactionControllergas-fee-token pre-publish now treatsexcludeNativeTokenForFeeas forcing external signing and nonce clearing.Reviewed by Cursor Bugbot for commit 294498c. Bugbot is set up for automated code reviews on this repo. Configure here.