Skip to content

test(recurring): accept and reject EIP-1271 batch signatures - #1759

Closed
LeoSlrRf wants to merge 1 commit into
feat/req-429-admit-cyclesfrom
feat/req-429-remove-single-path
Closed

test(recurring): accept and reject EIP-1271 batch signatures#1759
LeoSlrRf wants to merge 1 commit into
feat/req-429-admit-cyclesfrom
feat/req-429-remove-single-path

Conversation

@LeoSlrRf

@LeoSlrRf LeoSlrRf commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Remove single-fee SchedulePermit entry point and add post-settlement balance invariant check

The legacy triggerRecurringPayment function, along with its associated SchedulePermit struct, _PERMIT_TYPEHASH, hashSchedule, scheduleKeyFromPermit, cancelSchedule, and all related internal helpers have been removed. The batch-based triggerRecurringPaymentBatch is now the sole execution path.

A new ERC20RecurringPaymentProxy__UnexpectedBalance error is introduced, and a post-settlement invariant check is added at the end of triggerRecurringPaymentBatch to assert that the contract's token balance returns exactly to its pre-pull baseline after all legs and relayer fees are disbursed. This closes a potential accounting gap where tokens could be silently retained by the contract after settlement.

_pullExact now returns the pre-pull balance so the baseline can be compared against the post-settlement balance without an additional storage read.

All tests covering the removed single-fee entry point have been deleted. Pull assertion, EIP-1271, cancel, and admitCycles/revokeCycles tests have been migrated to use SchedulePermitBatch and triggerRecurringPaymentBatch exclusively.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR converts the recurring-payment contract and its tests to the batch-only schedule path while adding exact post-settlement balance validation and batch EIP-1271 coverage. The source API removal is not coordinated with the existing payment-processor helper and published artifact.

  • Removes the single-fee SchedulePermit entry points and associated tests.
  • Adds a post-settlement token-balance invariant.
  • Reworks EIP-1271 tests to accept and reject batch permit signatures.

Confidence Score: 4/5

This PR should not merge until the batch-only contract interface is coordinated with the published artifact and payment-processor API.

Existing clients still encode the removed triggerRecurringPayment selector from the registered ABI, so a deployment of this source would make recurring-payment submissions revert or make encoding fail after artifact regeneration.

Files Needing Attention: packages/smart-contracts/src/contracts/ERC20RecurringPaymentProxy.sol, packages/payment-processor/src/payment/erc20-recurring-payment-proxy.ts, packages/smart-contracts/src/lib/artifacts/ERC20RecurringPaymentProxy/0.1.0.json

Important Files Changed

Filename Overview
packages/smart-contracts/src/contracts/ERC20RecurringPaymentProxy.sol Removes the public single-schedule API and adds exact balance settlement, but leaves existing published consumers incompatible.
packages/smart-contracts/test/contracts/ERC20RecurringPaymentProxy.test.ts Replaces single-schedule coverage with batch pull, cancellation, and EIP-1271 tests; the new signature scenarios exercise the intended batch digest path.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Payment processor helper] -->|encodes triggerRecurringPayment| B[Published 0.1.0 ABI]
  B --> C[New contract deployment]
  C -->|function removed| D[Transaction reverts]
  A -. regenerated ABI .-> E[Encoding fails]
Loading

Comments Outside Diff (1)

  1. packages/smart-contracts/src/contracts/ERC20RecurringPaymentProxy.sol, line 317-321 (link)

    P1 Removed entry point breaks clients

    When clients use the existing payment-processor helper, it encodes triggerRecurringPayment, but this revision removes that entry point and retains only triggerRecurringPaymentBatch, causing calls against a deployment of this contract to revert; regenerating the ABI instead makes the helper fail during encoding.

    Knowledge Base Used: Smart contracts and deployments

Reviews (1): Last reviewed commit: "test(recurring): accept and reject EIP-1..." | 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