Skip to content

feat(predict): support deposit wallet onboarding#29635

Draft
ghgoodreau wants to merge 1 commit intomainfrom
predict/deposit-wallet-onboarding
Draft

feat(predict): support deposit wallet onboarding#29635
ghgoodreau wants to merge 1 commit intomainfrom
predict/deposit-wallet-onboarding

Conversation

@ghgoodreau
Copy link
Copy Markdown
Contributor

Route new CLOB v2 users through Polymarket deposit wallets while preserving existing Safe users, including POLY_1271 order signing and balance sync.

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Route new CLOB v2 users through Polymarket deposit wallets while preserving existing Safe users, including POLY_1271 order signing and balance sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

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.

@metamaskbotv2 metamaskbotv2 Bot added the team-swaps-and-bridge Swaps and Bridge team label May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR introduces a new "deposit wallet" account type for Polymarket, fundamentally changing how accounts are detected, orders are signed, and deposits are processed. Key changes:

  1. New depositWallet.ts: Implements a new ERC-1271-based smart contract wallet architecture with factory-based CREATE2 deployment, batch execution via a relayer, and Permit2 fee authorization. This is a new code path for Polymarket users.

  2. PolymarketProvider.ts: Major refactoring to support both 'safe' and 'deposit-wallet' wallet types. The getAccountState method now detects which wallet type to use (checking if a safe is deployed, then falling back to deposit wallet). Order signing, deposit flows, and trade preflight all have branching logic based on wallet type.

  3. orderCodec.ts: New signProtocolOrderForDepositWallet function with EIP-712 domain wrapping specific to deposit wallets.

  4. types.ts: Added POLY_1271 signature type and walletType field to AccountState.

Tag Selection:

  • SmokePredictions: Directly affected - the entire Polymarket trading flow (opening positions, cashing out, claiming winnings) is impacted by these changes to account state detection, order signing, and deposit flows.
  • SmokeWalletPlatform: Required per SmokePredictions tag description - Predictions is a section inside the Trending tab.
  • SmokeConfirmations: Required per SmokePredictions tag description - opening/closing positions are on-chain transactions that go through the confirmation flow.

The changes are high-risk because they modify core trading logic that affects all Polymarket users, with new branching paths that could break existing flows if the wallet type detection logic has bugs.

Performance Test Selection:
No performance-sensitive changes detected. The changes are focused on business logic for Polymarket's deposit wallet architecture (order signing, account state detection, deposit flows). There are no UI rendering changes, list component modifications, app startup changes, or other patterns that would impact measurable performance metrics.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
64.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant