feat(recurring): accept EIP-1271 smart-account signatures - #1752
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Greptile SummaryThe PR extends recurring-payment schedule authorization to EIP-1271 smart accounts while preserving EOA signature support.
Confidence Score: 5/5The 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
Sequence DiagramsequenceDiagram
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
Reviews (1): Last reviewed commit: "feat(recurring): accept EIP-1271 smart-a..." | Re-trigger Greptile |

Add EIP-1271 Smart Account Signature Support to ERC20RecurringPaymentProxy
Replaces the
ECDSA.recoversignature verification inERC20RecurringPaymentProxywith OpenZeppelin'sSignatureChecker.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
_assertSignerhelper that callsSignatureChecker.isValidSignatureNowand reverts withERC20RecurringPaymentProxy__BadSignatureon failure.A
MockERC1271test contract is introduced to simulate a minimal smart account wallet. It implementsisValidSignatureby recovering the signer viaecrecoverand comparing against a stored owner address, and exposes anapproveTokenhelper so the owner can grant token allowances on behalf of the wallet.Tests cover three scenarios:
SignatureChecker