test(recurring): accept and reject EIP-1271 batch signatures - #1759
test(recurring): accept and reject EIP-1271 batch signatures#1759LeoSlrRf wants to merge 1 commit into
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 SummaryThis 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.
Confidence Score: 4/5This 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 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
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]
|

Remove single-fee
SchedulePermitentry point and add post-settlement balance invariant checkThe legacy
triggerRecurringPaymentfunction, along with its associatedSchedulePermitstruct,_PERMIT_TYPEHASH,hashSchedule,scheduleKeyFromPermit,cancelSchedule, and all related internal helpers have been removed. The batch-basedtriggerRecurringPaymentBatchis now the sole execution path.A new
ERC20RecurringPaymentProxy__UnexpectedBalanceerror is introduced, and a post-settlement invariant check is added at the end oftriggerRecurringPaymentBatchto 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._pullExactnow 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/revokeCyclestests have been migrated to useSchedulePermitBatchandtriggerRecurringPaymentBatchexclusively.