fix(pay): deduplicate wrapped-token ops to prevent double-unwrap revert#108
Open
jeremie-olivier wants to merge 1 commit into
Open
fix(pay): deduplicate wrapped-token ops to prevent double-unwrap revert#108jeremie-olivier wants to merge 1 commit into
jeremie-olivier wants to merge 1 commit into
Conversation
Both payment legs planned identical unwrap(uint256) calls on the same LiftERC20 contract. The second unwrap reverted with 0x because the balance was already consumed by the first. Replace simulatedBalances approach (pathfinder ignored wrong token field) with post-processing deduplication: keep one unwrap per contract, collect all rewraps per (hub, avatar) group, defer them to end of batch, and merge amounts as rewrap_1 + rewrap_2 - unwrap = X - A - B. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The preview deployment for gnosis-box/-t-h-p-for--good:-dev-z8o0444888o4o0ks88kk40k4 is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-05-25 01:17:59 CET |
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.
Summary
simulatedBalancesapproach (pathfinder ignored the LiftERC20 address as thetokenfield, so both legs still planned identical unwraps)deduplicateWrappedOpspost-processing on the merged tx batch:unwrap(uint256)per LiftERC20 contract, skipping duplicateswrap(address,uint256,uint8)rewraps grouped by(hub + avatar)rewrap_merged = rewrap_1 + rewrap_2 - unwrap = X - A - BResult tx order:
[unwrap, transfer_foundation, transfer_expert, rewrap_merged]Test plan
de0e9a3eunwrap (not two)UserOperation reverted with reason: 0x🤖 Generated with Claude Code