Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

feat: add ERC-1271 support for smart wallets - #5

Merged
coffee-the-dev merged 3 commits into
mainfrom
feat/erc-1271
Mar 25, 2026
Merged

coffee-the-dev merged 3 commits into
mainfrom
feat/erc-1271

Conversation

@coffee-the-dev

Copy link
Copy Markdown
Contributor

Summary

This PR adds smart-wallet compatibility across the Abstract MPP flows and updates the stream channel defaults to the newly deployed
contract on both Abstract testnet and mainnet.

What Changed

  • Added ERC-1271-compatible charge verification on the server side.
  • Added support for USDC.e ERC-3009 bytes signatures for charge settlement.
  • Updated session voucher verification to support contract-wallet signatures.
  • Updated AbstractStreamChannel to verify vouchers with SignatureCheckerLib instead of raw ECDSA recovery.
  • Added test coverage for ERC-1271 payer settle/close flows.
  • Updated MPP defaults to use 0x29635C384f451a72ED2e2a312BCeb8b0bDC0923c for AbstractStreamChannel on both testnet and mainnet.
  • Wired the demo session flow to honor NEXT_PUBLIC_ESCROW_CONTRACT.

Why

Previously:

  • charge assumed a 65-byte ECDSA signature and failed for smart wallets.
  • session vouchers were verified with ECDSA.recover, so ERC-1271 wallets could not sign directly as the payer.
  • The repo defaults still pointed at the older stream channel deployment.

This PR fixes those gaps so AGW / ERC-1271 wallets can use both charge and session flows, assuming the updated stream channel
deployment is used.

Contract / Address Updates

  • AbstractStreamChannel:
    • 0x29635C384f451a72ED2e2a312BCeb8b0bDC0923c on Abstract testnet
    • 0x29635C384f451a72ED2e2a312BCeb8b0bDC0923c on Abstract mainnet

@changeset-bot

changeset-bot Bot commented Mar 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bf5772b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@abstract-foundation/mpp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Mar 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mpp-abstract-mpp-demo Ready Ready Preview, Comment Mar 25, 2026 10:37pm

Request Review

@cursor

cursor Bot commented Mar 25, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
High risk because it changes signature verification and settlement paths for both server-side ERC-3009 charges and on-chain AbstractStreamChannel voucher validation, which are security- and funds-critical. Incorrect verification or ABI selection could enable failed settlements or acceptance of invalid authorizations.

Overview
Adds smart-wallet compatibility across Abstract payments by switching server-side signature verification to contract-aware verifyTypedData and supporting ERC-3009 bytes signatures when broadcasting transferWithAuthorization (falling back to v/r/s only for 65-byte ECDSA).

Updates AbstractStreamChannel to validate vouchers via SignatureCheckerLib (ERC-1271 compatible) and extends Foundry tests with an ERC-1271 mock wallet covering settle and close flows.

Refreshes default AbstractStreamChannel addresses to 0x29635C...0923c (docs + DEFAULT_ESCROW split per chain) and allows the demo to override the escrow contract via NEXT_PUBLIC_ESCROW_CONTRACT.

Written by Cursor Bugbot for commit bf5772b. This will update automatically on new commits. Configure here.

@coffee-the-dev coffee-the-dev changed the title Feat/erc 1271 feat: add ERC-1271 support for smart wallets Mar 25, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread packages/mpp/src/server/charge.ts
@coffee-the-dev
coffee-the-dev merged commit 0c3ac45 into main Mar 25, 2026
6 checks passed
@coffee-the-dev
coffee-the-dev deleted the feat/erc-1271 branch March 25, 2026 22:30

This branch was successfully deployed

1 active deployment
Preview — bf5772b2 Deployed Mar 25, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant