feat(recurring): add 0.2.0 cancel, hash, and sign helpers - #1765
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 adds helpers for encoding and submitting recurring-payment cancellation, deriving schedule hashes and keys, and signing v0.2.0 batch permits.
Confidence Score: 5/5The 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
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
Reviews (1): Last reviewed commit: "feat(recurring): add 0.2.0 cancel, hash,..." | Re-trigger Greptile |

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 acancelScheduleBatchtransaction to the proxy.hashScheduleBatch: Computes the off-chain EIP-712 digest of aSchedulePermitBatchusing theERC20RecurringPaymentProxy/1domain, matching the on-chain contract domain.signSchedulePermitBatch: Signs aSchedulePermitBatchwith EIP-712 typed data, falling back frometh_signTypedDataRPC to_signTypedDatawhen the provider does not support the RPC method directly.scheduleKeyFromBatch: Calls thescheduleKeyFromBatchview function on the deployed v0.2.0 proxy contract to retrieve the on-chain schedule key for a given permit.Extracts a shared
sendToRecurringProxyV2helper to deduplicate transaction dispatch logic acrosstriggerRecurringPaymentBatchandcancelScheduleBatch.