docs(recurring): warn cancel does not drop allowance - #1757
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 subscriber-controlled cancellation for single-fee and batch recurring schedules while documenting that cancellation does not revoke ERC-20 allowance.
Confidence Score: 4/5The exported ABI must be updated before merging so package consumers can invoke the new cancellation entry points. The Solidity implementation and tests add cancellation successfully, but the package artifact still exposes an ABI without either cancellation function, making the feature unavailable through the published integration surface. Files Needing Attention: packages/smart-contracts/src/contracts/ERC20RecurringPaymentProxy.sol; packages/smart-contracts/src/lib/artifacts/ERC20RecurringPaymentProxy/0.1.0.json Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
S[Subscriber] --> C[cancelSchedule / cancelScheduleBatch]
C --> K[Derive schedule key]
K --> M[Mark key cancelled]
R[Relayer trigger] --> T[Derive same key]
T --> X{Cancelled?}
X -->|Yes| E[Revert Cancelled]
X -->|No| P[Continue payment checks]
Reviews (1): Last reviewed commit: "docs(recurring): warn cancel does not dr..." | Re-trigger Greptile |
| function cancelSchedule(SchedulePermit calldata p) external { | ||
| _assertSubscriber(p.subscriber); | ||
| _cancel(_scheduleKeyFromPermit(p)); | ||
| } | ||
|
|
||
| /** | ||
| * @notice Blocks further triggers for this batch schedule. | ||
| * @dev Does not revoke the subscriber's ERC-20 allowance to this contract. A relayer can | ||
| * still collect a due cycle if they include a trigger in the same block ahead of | ||
| * cancel. Also `approve` this proxy to 0 (or decrease) in the same wallet batch. | ||
| */ | ||
| function cancelScheduleBatch(SchedulePermitBatch calldata p) external { |
There was a problem hiding this comment.
Cancellation ABI remains stale
When a downstream client obtains ERC20RecurringPaymentProxy through the package's exported artifact, its committed ABI contains neither cancellation function, so the client cannot access or encode cancelSchedule or cancelScheduleBatch. Update the committed artifact alongside this public contract API.
Knowledge Base Used: Smart contracts and deployments
There was a problem hiding this comment.
Expected. The artifact will be included in a PR up the graphite stack

Add schedule cancellation for subscribers
Introduces
cancelScheduleandcancelScheduleBatchfunctions that allow a subscriber to permanently block further payment triggers on their recurring payment schedules.A new
cancelledSchedulesmapping tracks cancelled schedule keys. Both trigger entry points (triggerRecurringPaymentandtriggerRecurringPaymentBatch) now check this mapping before processing, reverting withERC20RecurringPaymentProxy__Cancelledif the schedule has been cancelled.Only the subscriber named in the permit can cancel their own schedule, enforced by
_assertSubscriber, which reverts withERC20RecurringPaymentProxy__NotSubscriberfor any other caller. Cancellation is keyed on the schedule identity (not the deadline), so re-signing a permit with a new deadline does not bypass a prior cancellation.Note: Cancellation does not revoke the subscriber's ERC-20 allowance to this contract. Subscribers should also set their token approval to zero in the same transaction. A relayer may still collect a due cycle if a trigger is included in the same block ahead of the cancellation call.