Skip to content

fix(transaction-pay-controller): fix quote validation for predict withdraw - #9891

Merged
matthewwalsh0 merged 5 commits into
mainfrom
fix/predict-withdraw-quote-validation-source-address
Aug 19, 2026
Merged

fix(transaction-pay-controller): fix quote validation for predict withdraw#9891
matthewwalsh0 merged 5 commits into
mainfrom
fix/predict-withdraw-quote-validation-source-address

Conversation

@matthewwalsh0

@matthewwalsh0matthewwalsh0 commented Aug 17, 2026

Copy link
Copy Markdown
Member

Explanation

Quote validation for Polymarket Predict withdrawals produced false errors and blocked legitimate withdrawals, because it assumed the source token lived on the user's EOA and that the withdrawal could always be simulated. This PR fixes validation per variant:

  • Deposit-wallet withdrawals — now validated (previously skipped). The placeholder Relay calldata is ignored and the real approve + unwrap batch is simulated from the CREATE2 deposit wallet that holds the funds. The batch construction is shared between the simulation and the submit so they can't drift.
  • Legacy Safe withdrawals — now skip simulation entirely (logged). The source token is produced from legacy collateral outside the controller's visible calls, so a faithful simulation isn't possible.
  • The decoded source-transfer balance check only runs for a single source-token transfer; multi-step batches are left to the full simulation.
  • Validation skip/success paths now log consistently.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Cursor Bugbot is generating a summary for commit de735eb. Configure here.

@matthewwalsh0matthewwalsh0 changed the title fix(transaction-pay-controller): fix false quote validation errors for Predict withdrawalsfix(transaction-pay-controller): fix quote validation for predict withdrawAug 17, 2026
@matthewwalsh0
matthewwalsh0 marked this pull request as ready for review August 17, 2026 02:44
@matthewwalsh0
matthewwalsh0 requested review from a team as code ownersAugust 17, 2026 02:44
… validation
Skip validation for legacy Safe withdraws, revert source-balance sender override, trim comments/JSDoc, and generalise the changelog entry.
… execute-sim changes
Revert the refundTo override in processTransactions and the cosmetic from extraction in buildRelayExecuteSimulation, both left over from the reverted source-address plumbing.
@matthewwalsh0
matthewwalsh0force-pushed the fix/predict-withdraw-quote-validation-source-address branch from de735eb to 727104cCompareAugust 19, 2026 12:41
@matthewwalsh0
matthewwalsh0 added this pull request to the merge queueAug 19, 2026
Merged via the queue into main with commit cf29895Aug 19, 2026
46 checks passed
@matthewwalsh0
matthewwalsh0 deleted the fix/predict-withdraw-quote-validation-source-address branch August 19, 2026 12:53
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@matthewwalsh0@OGPoyraz