Skip to content

Commit 635e6a9

Browse files
A1igatorclaude
andcommitted
authCapture: relax refundDeadline ordering to >= for contract parity
The contract's _validatePayment uses `preApprovalExp <= authorizationExp <= refundExp` (equal allowed). Spec was using strict `>` on the refund side, rejecting refundDeadline === captureDeadline configs that the contract itself accepts. Aligning to >= avoids the off-chain/on-chain divergence; the impl change ships alongside. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent daf968f commit 635e6a9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

specs/schemes/authCapture/scheme_authCapture_evm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ The facilitator performs these checks in order:
160160
3. **Network match**: `payload.accepted.network === requirements.network` and format is `eip155:<chainId>`.
161161
4. **Extra validation**: `requirements.extra` contains all required fields (`captureAuthorizer`, `captureDeadline`, `refundDeadline`, `feeRecipient`, `minFeeBps`, `maxFeeBps`, `name`, `version`).
162162
5. **Method routing**: `extra.assetTransferMethod` (default `"eip3009"`) matches the payload shape.
163-
6. **Deadline ordering**: `refundDeadline > captureDeadline`, `captureDeadline > now + 6s`, and `payload.validBefore` (EIP-3009) / `payload.deadline` (Permit2) `<= captureDeadline`.
163+
6. **Deadline ordering**: `refundDeadline >= captureDeadline`, `captureDeadline > now + 6s`, and `payload.validBefore` (EIP-3009) / `payload.deadline` (Permit2) `<= captureDeadline`. Matches the contract's `preApprovalExp <= authorizationExp <= refundExp` invariant.
164164
7. **Time window**: `payload.deadline / validBefore > now + 6s` (not expired) and `validAfter <= now` (active, EIP-3009 only).
165165
8. **Spender / collector match**: `payload.to === EIP3009_TOKEN_COLLECTOR_ADDRESS` (EIP-3009) or `payload.spender === PERMIT2_TOKEN_COLLECTOR_ADDRESS` (Permit2).
166166
9. **Token match**: `payload.permitted.token === requirements.asset` (Permit2 only — EIP-3009 binds via signing domain).
@@ -199,7 +199,7 @@ The authCapture scheme uses the standard x402 error codes plus these scheme-spec
199199
| `unsupported_asset_transfer_method` | `assetTransferMethod` is not `"eip3009"` or `"permit2"`. |
200200
| `payload_method_mismatch` | Payload shape doesn't match `assetTransferMethod`. |
201201
| `capture_deadline_expired` | `captureDeadline <= now + 6s`. |
202-
| `invalid_deadline_ordering` | `refundDeadline <= captureDeadline`. |
202+
| `invalid_deadline_ordering` | `refundDeadline < captureDeadline`. |
203203
| `authorization_expired` | EIP-3009 `validBefore` (or Permit2 `deadline`) `<= now + 6s`. |
204204
| `authorization_not_yet_valid` | EIP-3009 `validAfter > now`. |
205205
| `invalid_authCapture_signature` | Signature verification failed. |

0 commit comments

Comments
 (0)