feat: Improve Predict Across deposits for proxy setup and direct transfer flows#8208
Open
pedronfigueiredo wants to merge 4 commits intomainfrom
Open
feat: Improve Predict Across deposits for proxy setup and direct transfer flows#8208pedronfigueiredo wants to merge 4 commits intomainfrom
pedronfigueiredo wants to merge 4 commits intomainfrom
Conversation
43eb402 to
c770afa
Compare
matthewwalsh0
requested changes
Mar 17, 2026
packages/transaction-pay-controller/src/strategy/across/across-quotes.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/across/across-quotes.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/across/across-quotes.ts
Outdated
Show resolved
Hide resolved
matthewwalsh0
requested changes
Mar 17, 2026
packages/transaction-pay-controller/src/strategy/across/across-quotes.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/across/across-actions.ts
Outdated
Show resolved
Hide resolved
| : undefined, | ||
| getTarget: (call, request) => call.target ?? request.targetTokenAddress, | ||
| interface: TOKEN_TRANSFER_INTERFACE, | ||
| methodName: 'transfer', |
Member
There was a problem hiding this comment.
Can we not extract this from the signature dynamically?
|
|
||
| function getTransferData(transaction: TransactionMeta): Hex | undefined { | ||
| const { nestedTransactions, txParams } = transaction; | ||
| function getDestinationCalls( |
Member
There was a problem hiding this comment.
Should this be encapsulated inside across-actions too, as it's the main entrypoint?
Get me actions for this TransactionMeta?
packages/transaction-pay-controller/src/strategy/across/across-actions.ts
Outdated
Show resolved
Hide resolved
packages/transaction-pay-controller/src/strategy/across/across-actions.ts
Outdated
Show resolved
Hide resolved
47d87a1 to
7a8d479
Compare
matthewwalsh0
approved these changes
Mar 20, 2026
| return normalizeHexString(String(parsedCall.args[0])) as Hex; | ||
| } | ||
|
|
||
| export function getAcrossDestination( |
Member
There was a problem hiding this comment.
Minor, is this the only thing that needs exporting? So ideally we only unit test this? And at the top of the file for readability?
| return normalizeHexString(String(parsedCall.args[0])) as Hex; | ||
| } | ||
|
|
||
| export function getAcrossDestination( |
Member
There was a problem hiding this comment.
Minor, I was assuming separate functions but this works too, but maybe just getAcrossActions?
| const selector = getDestinationSelector(data); | ||
|
|
||
| return selector | ||
| ? `${UNSUPPORTED_DESTINATION_ERROR}. Destination selector: ${selector}` |
Member
There was a problem hiding this comment.
Minor, what do we mean by "destination", these are just calls / functions right?
So maybe just Function not supported by Across: ${selector}?
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
This PR updates predictDeposit Across quote handling to distinguish between initial proxy setup deposits and subsequent transfer-only deposits. When the destination calldata is empty or represents a single ERC-20 transfer, the quote now skips post-swap actions and relays directly to the transfer recipient to avoid unnecessary gas and fees. When calldata is present for proxy creation and setup, the destination transactions are decoded into ordered Across post-swap actions so the proxy initialization, Safe execution, and approval flow can still run after bridging. The change preserves existing non-Predict behavior, adds focused test coverage for both Predict flows and unsupported calldata cases, and keeps the original changelog entry while adding a separate follow-up note for this improvement.
References
https://consensyssoftware.atlassian.net/browse/CONF-1043?atlOrigin=eyJpIjoiOWRmOThmZWRjZjZkNDljYTgyMTE4NTNjYWU5MzgwNDEiLCJwIjoiaiJ9
Checklist
Note
Medium Risk
Changes how Across quotes derive
recipientandactionsby decoding destination calldata (including nested batches), which can alter bridged fund recipients and post-swap execution. Risk is mitigated by extensive new unit coverage but impacts a critical transaction flow.Overview
Across quote destination handling is overhauled to derive
recipientandactionsfrom destination calldata (preferringnestedTransactions), instead of treatingpredictDeposittransfers as post-swap actions.Transfer-only destinations now send directly to the transfer recipient with no actions, while supported setup calls (e.g.,
createProxy,execTransaction) are decoded into ordered post-swap actions; unsupported selectors or missing requiredtargetnow throw clearer errors.Adds a new
across-actionsmodule with focused tests, expandsacross-quotestests to cover transfer-only vs setup flows, batching behavior (first transfer sets recipient, later transfers become actions), and additional failure cases, and documents the behavior change in the changelog.Written by Cursor Bugbot for commit 8457618. This will update automatically on new commits. Configure here.