feat(predict): add Deposit Wallet order flow#29933
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
61b290a to
4a42a4a
Compare
a0abdbe to
2da0b25
Compare
2da0b25 to
b2bf1ee
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
No other areas are affected — no shared components, no navigation changes, no controller changes, no infrastructure changes. Performance Test Selection: |
|



Description
Adds Predict order placement support for Polymarket Deposit Wallet accounts on top of the Deposit Wallet deposit foundation.
This PR:
POLY_1271Polymarket signature type.TypedDataSignwrapper.allowancesTxfor Deposit Wallet orders, so stranded pUSD/USDC.e can be swept before the backend relays the order.This PR is temporarily stacked on
predict/dw-deposit-foundationwhile PRs 1 and 2 are under review, and should be rebased/retargeted after those merge.Validation run locally:
Changelog
CHANGELOG entry: Fixed Predict order placement for Polymarket Deposit Wallet accounts
Related issues
Fixes: PRED-860
Manual testing steps
Screenshots/Recordings
Before
N/A - provider/order-signing change only.
After
N/A - provider/order-signing change only.
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes core Predict order submission/signing paths, adding a new ERC-1271 signing format and deposit-wallet preflight flows; mistakes could cause failed or incorrectly-signed orders. Legacy Safe behavior is preserved but now shares more conditional branching.
Overview
Adds end-to-end order placement support for Polymarket Deposit Wallet accounts.
Order submission now derives maker/signer from the resolved account state and, for deposit-wallet users, performs a create/allowance batch preflight before signing/submitting. Deposit-wallet orders use the new
SignatureType.POLY_1271and are signed viasignProtocolOrderusing an ERC-7739TypedDataSignwrapper, while Safe users keep legacy Safe signing.Fee collection and Safe trade preflight steps (Permit2 fee authorization + allowances tx) are skipped for deposit-wallet orders; instead an optional legacy Safe migration sweep can be attached as
allowancesTx. L2 CLOB headers are consistently signed using the EOA owner address. Tests were expanded to cover both Safe and deposit-wallet order flows and the new signing payload.Reviewed by Cursor Bugbot for commit b2bf1ee. Bugbot is set up for automated code reviews on this repo. Configure here.