feat: tx-ctrl add excludeNativeTokenForFee param#8052
Conversation
1764dfd to
1b21bb7
Compare
1b21bb7 to
c64b46d
Compare
94d0364 to
692c786
Compare
692c786 to
15dd7d6
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.
| actionId, | ||
| batchId, | ||
| gasFeeToken, | ||
| excludeNativeTokenForFee: userRequest.excludeNativeTokenForFee, |
There was a problem hiding this comment.
New parameters lost in hook fallback path
Medium Severity
actionId and excludeNativeTokenForFee are only passed through in the addTransactionBatchWith7702 path. If 7702 fails (e.g., chain doesn't support it) and the code falls back to addTransactionBatchWithHook, these parameters are silently dropped. The processTransactionWithHook function's call to addTransaction does not include actionId or excludeNativeTokenForFee, meaning transactions won't appear in the Activity tab and native token exclusion won't apply in the fallback path.
Additional Locations (1)
There was a problem hiding this comment.
The intent of this is to have the minimum change possible to existing flows. Tempo first iteration of the implementation will only support 7702 flow, hence the parameters are only being added for this context and the intent is for the behavior to remain unchanged for the other flows.


Explanation
Context:
With upcoming phase 1 for Tempo support, the initial approach will leverage EIP-7702 mechanics and UX.
One difference vs. other chains is that Tempo doesn't have a concept of native token.
--> This means that some current logic when we "fall back" to the native token for gas fee when user has enough native balance won't work.
excludeNativeTokenForFeeis a new parameter for signaling that native token should not be an option when set totrueand whengasFeeTokenis provided.Since the client dApps will trigger a call
addTransactionBatchfor some Tempo transactions - was only called internally until now - we add theactionIdso such transactions appear on the Activity tab (transaction history). Otherwise such transactions still made it to the state but those withoutactionIddon't appear in the activity tab.References
Checklist
Note
Medium Risk
Changes transaction creation metadata and fee-token fallback behavior when
gasFeeTokenis provided, which can affect how gas payment is selected for batched/EIP-7702 flows. Impact is gated behind new optional params but touches core transaction creation paths.Overview
Adds an optional
excludeNativeTokenForFeeflag toTransactionMeta,AddTransactionOptions, andTransactionBatchRequestto force use ofgasFeeTokeneven when the user has native balance.Updates
addTransactionsoisGasFeeTokenIgnoredIfBalancebecomesfalsewhenexcludeNativeTokenForFeeis set, and persistsexcludeNativeTokenForFeeon the transaction only when explicitly provided. Batch/EIP-7702 submission now also forwards optionalactionId(for Activity visibility) andexcludeNativeTokenForFeeintoaddTransaction, with new unit tests covering both default and opt-in behaviors.Written by Cursor Bugbot for commit 15dd7d6. This will update automatically on new commits. Configure here.