ERC-8475: ERC-20 Outgoing Window Limits

I would like feedback on ERC-8475, an opt-in ERC-20 extension combining a per-transfer cap with an aggregate outgoing cap per fixed block window.

Proposal and specification: Add ERC: ERC-20 Outgoing Window Limits by shargon · Pull Request #2130 · ethereum/ERCs · GitHub

Motivation

A compromised signing or withdrawal workflow can divide a large outflow across transactions and recipients. A per-transfer limit alone does not bound that total. This proposal defines shared token-side accounting and discoverable policy for each balance holder.

Proposed behavior

  • The holder enrolls with a maximum per transfer, a maximum per window, a window length in blocks, a cap-change delay and an independent guardian.
  • The epoch is floor(block.number / windowBlocks). Every positive outgoing movement must satisfy both the per-transfer cap and the remaining aggregate quota.
  • All debit paths share the holder counter, including transferFrom, burns, self-transfers and signature-authorized spending. Incoming transfers do not refill quota.
  • The holder or guardian can tighten caps immediately and cancel a pending change. Only the holder can schedule replacement caps, which become applicable after the immutable delay.
  • Applying or cancelling a policy change never resets usage. Enrollment, guardian, window length and change delay are immutable.
  • The proposal standardizes an interface, events and accounting semantics rather than a particular implementation.

Tradeoffs and feedback requested

These are fixed windows, not rolling windows: spending the full quota immediately before and after a boundary is possible. The guarantee is per token and holder, not a fiat-value or exchange-wide bound. The guardian can deny service by tightening caps to zero, and token upgrades or unprotected debit paths can undermine protection.

Feedback is especially welcome on fixed-window interoperability, gross outgoing accounting, cap-change semantics, immutable configuration and wallet/custodian integration.

This proposal is independent of the complementary ERC-8474 delayed-unlock proposal. A token could implement both policies.

Author: Fernando Díaz Toledano (@shargon).

Sharing one counter across every debit path is what makes this useful, a cap that only checks transfer leaves transferFrom open.

On window length: W is immutable and counted in block.number, and the same number is a very different time on each chain. 7200 blocks is about a day on mainnet and 4 hours on OP Stack chains with 2 second blocks. On Arbitrum, block.number returns an approximation of the L1 block number (the L2 one comes from ArbSys.arbBlockNumber()), so there it follows L1 time. A wallet that reuses one “daily” W across chains fixes a 6x different window forever. I’d pin the epoch to block.number as the EVM returns it, so nobody builds it on arbBlockNumber and two conforming tokens on the same chain reset at different blocks, and say wallets SHOULD show the expected wall clock length of W and of the change delay before enrollment.

For integrators, windowUsage gives remaining without the per transfer cap, and routers and exchange withdrawals mostly need one number before they build a transfer. A view returning min(maxTransfer, remaining) for the account, still ignoring balance, saves each of them the extra read and the math.

Put together 21 passing tests for shared quotas and rollback. One case: the agent’s budget allows 80, the token has 50 left, and the failed spend leaves both states untouched. Uses a test token for now; PR is a draft.