Skip to content

feat(recurring): accept EIP-1271 smart-account signatures - #1752

Closed
LeoSlrRf wants to merge 1 commit into
feat/req-429-batch-permit-hashfrom
feat/req-429-eip-1271
Closed

feat(recurring): accept EIP-1271 smart-account signatures#1752
LeoSlrRf wants to merge 1 commit into
feat/req-429-batch-permit-hashfrom
feat/req-429-eip-1271

Conversation

@LeoSlrRf

@LeoSlrRf LeoSlrRf commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Add EIP-1271 Smart Account Signature Support to ERC20RecurringPaymentProxy

Replaces the ECDSA.recover signature verification in ERC20RecurringPaymentProxy with OpenZeppelin's SignatureChecker.isValidSignatureNow, enabling subscribers to be smart contract wallets that implement EIP-1271 in addition to standard EOAs.

The signature check is extracted into a private _assertSigner helper that calls SignatureChecker.isValidSignatureNow and reverts with ERC20RecurringPaymentProxy__BadSignature on failure.

A MockERC1271 test contract is introduced to simulate a minimal smart account wallet. It implements isValidSignature by recovering the signer via ecrecover and comparing against a stored owner address, and exposes an approveToken helper so the owner can grant token allowances on behalf of the wallet.

Tests cover three scenarios:

  • A valid EIP-1271 smart account signature is accepted and triggers the payment
  • A malformed smart account signature is rejected
  • An existing EOA signature continues to work correctly through SignatureChecker

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR extends recurring-payment schedule authorization to EIP-1271 smart accounts while preserving EOA signature support.

  • Replaces direct ECDSA recovery with OpenZeppelin SignatureChecker.
  • Adds an ERC-1271 test wallet with owner-controlled token approval.
  • Adds coverage for valid and malformed smart-account signatures and the existing EOA flow.

Confidence Score: 5/5

The PR appears safe to merge with no concrete correctness or security defects identified.

The changed validation delegates to the compatible OpenZeppelin 4.9.6 checker, remains bound to the existing EIP-712 digest and subscriber, and retains the token allowance and transfer safeguards of the recurring-payment flow.

Important Files Changed

Filename Overview
packages/smart-contracts/src/contracts/ERC20RecurringPaymentProxy.sol Replaces EOA-only recovery with OpenZeppelin’s EOA/ERC-1271 signature checker without changing the signed digest or payment execution.
packages/smart-contracts/src/contracts/test/MockERC1271.sol Adds a narrowly scoped ERC-1271 test wallet that validates owner signatures and permits owner-controlled ERC-20 approvals.
packages/smart-contracts/test/contracts/ERC20RecurringPaymentProxy.test.ts Covers valid and malformed smart-account signatures and confirms that EOA signatures remain accepted.

Sequence Diagram

sequenceDiagram
  participant R as Authorized Relayer
  participant P as Recurring Payment Proxy
  participant W as Subscriber / ERC-1271 Wallet
  participant T as ERC-20 Token
  R->>P: triggerRecurringPayment(permit, signature, index)
  P->>P: Compute EIP-712 schedule digest
  alt Subscriber is an EOA
    P->>P: Recover and compare signer
  else Subscriber is a smart account
    P->>W: isValidSignature(digest, signature)
    W-->>P: ERC-1271 magic value
  end
  P->>T: transferFrom(subscriber, proxy, total)
  P->>T: Route payment, fee, and relayer fee
Loading

Reviews (1): Last reviewed commit: "feat(recurring): accept EIP-1271 smart-a..." | Re-trigger Greptile

@LeoSlrRf LeoSlrRf closed this Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant