Skip to content

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

Open
matthewwalsh0 wants to merge 6 commits into
mainfrom
fix/predict-withdraw-quote-validation-source-address
Open

fix(transaction-pay-controller): fix quote validation for predict withdraw#9891
matthewwalsh0 wants to merge 6 commits into
mainfrom
fix/predict-withdraw-quote-validation-source-address

Conversation

@matthewwalsh0

@matthewwalsh0 matthewwalsh0 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.

… validation

Skip validation for legacy Safe withdraws, revert source-balance sender override, trim comments/JSDoc, and generalise the changelog entry.
@matthewwalsh0 matthewwalsh0 changed the title fix(transaction-pay-controller): fix false quote validation errors for Predict withdrawals fix(transaction-pay-controller): fix quote validation for predict withdraw Aug 17, 2026
… 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
matthewwalsh0 marked this pull request as ready for review August 17, 2026 02:44
@matthewwalsh0
matthewwalsh0 requested review from a team as code owners August 17, 2026 02:44
@matthewwalsh0
matthewwalsh0 requested a review from OGPoyraz August 17, 2026 11:00
Sign up for free to 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.

1 participant