Skip to content

feat(recurring): add 0.2.0 cancel, hash, and sign helpers - #1765

Open
LeoSlrRf wants to merge 1 commit into
feat/req-429-lib-batch-triggerfrom
feat/req-429-lib-cancel-hash-sign
Open

feat(recurring): add 0.2.0 cancel, hash, and sign helpers#1765
LeoSlrRf wants to merge 1 commit into
feat/req-429-lib-batch-triggerfrom
feat/req-429-lib-cancel-hash-sign

Conversation

@LeoSlrRf

@LeoSlrRf LeoSlrRf commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Add EIP-712 signing, schedule cancellation, and batch key lookup for ERC20 recurring payment proxy v0.2.0

Adds several new capabilities to the ERC20 recurring payment proxy v0.2.0 integration:

  • cancelScheduleBatch / encodeCancelScheduleBatch: Allows a permit subscriber to cancel an existing schedule by sending a cancelScheduleBatch transaction to the proxy.
  • hashScheduleBatch: Computes the off-chain EIP-712 digest of a SchedulePermitBatch using the ERC20RecurringPaymentProxy / 1 domain, matching the on-chain contract domain.
  • signSchedulePermitBatch: Signs a SchedulePermitBatch with EIP-712 typed data, falling back from eth_signTypedData RPC to _signTypedData when the provider does not support the RPC method directly.
  • scheduleKeyFromBatch: Calls the scheduleKeyFromBatch view function on the deployed v0.2.0 proxy contract to retrieve the on-chain schedule key for a given permit.

Extracts a shared sendToRecurringProxyV2 helper to deduplicate transaction dispatch logic across triggerRecurringPaymentBatch and cancelScheduleBatch.

LeoSlrRf commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds helpers for encoding and submitting recurring-payment cancellation, deriving schedule hashes and keys, and signing v0.2.0 batch permits.

  • Centralizes v0.2.0 transaction submission through a shared proxy sender.
  • Adds EIP-712 domain construction, hashing, and signer support.
  • Adds tests for cancellation encoding/submission, hashing, key lookup, and typed-data fallback signing.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issue identified.

The new helpers use the v0.2.0 ABI and deployment lookup consistently, and their EIP-712 domain and permit field ordering match the corresponding contract implementation and shared types.

Important Files Changed

Filename Overview
packages/payment-processor/src/payment/erc20-recurring-payment-proxy.ts Adds v0.2.0 cancellation, hash, key, and typed-data signing helpers aligned with the contract domain, ABI, and shared permit type.
packages/payment-processor/test/payment/erc-20-recurring-payment.test.ts Adds focused unit coverage for each new helper, including unsupported deployment handling and typed-data fallback signing.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P[SchedulePermitBatch] --> E[Encode cancellation]
  P --> H[EIP-712 hash]
  P --> S[Typed-data signature]
  P --> K[On-chain schedule key]
  E --> T[Submit to v0.2.0 proxy]
  H --> V[Permit verification]
  S --> V
Loading

Reviews (1): Last reviewed commit: "feat(recurring): add 0.2.0 cancel, hash,..." | Re-trigger Greptile

@LeoSlrRf
LeoSlrRf marked this pull request as ready for review August 25, 2026 13:17
@LeoSlrRf
LeoSlrRf requested review from a team, aimen74 and rodrigopavezi and removed request for a team August 25, 2026 13:17
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.

2 participants