Address escrow scheme spec review feedback#18
Conversation
- Enforce strict amount equality (=== not >=) in verification - Add authorization.to === tokenCollector check - Make scheme_escrow.md network-agnostic (remove EVM-specific references) - Clarify charge path refund mechanics Co-Authored-By: Claude Opus 4.6 <[email protected]>
Document how clients track post-settlement payment status using nonce and escrowAddress from their original request. Co-Authored-By: Claude Opus 4.6 <[email protected]>
e6263f5 to
c8e63d9
Compare
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Addresses PR feedback: spec now defines what the PAYMENT-RESPONSE header contains for escrow settlements. Includes full paymentInfo so clients can track payment state and initiate post-settlement actions without retaining client-side state. Network-agnostic spec defers struct details to EVM doc. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Remove EVM/commerce-payments specific language (operator, on-chain). Clarify charge refund path: explain that refunds require a trusted party since funds are already with the receiver, and the tradeoff vs authorize. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Simulate operator.authorize/charge via eth_call before spending gas. Catches balance issues, consumed nonces, domain mismatches, and contract errors. Falls back to balanceOf for actionable diagnostics. Extract buildPaymentInfo helper shared between verify and settle. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Notes (below the review threshold, but worth considering):
🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Also clarify simulation hard-reject rationale in code comment. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Thanks for the review! Step 5 is fixed in 92d5b88. Re: simulation hard reject — this is intentional. Both pending simulation PRs for the exact scheme also hard reject on any simulation failure (including transient RPC errors). The reasoning: if the RPC is down for simulation, the facilitator also can't submit the settlement transaction, so accepting the payment would just defer the failure. A false-negative (rejecting a valid payment) is safer than a false-positive (accepting one that reverts on-chain and wastes gas). |
|
|
||
| This scheme reuses audited commerce-payments contracts deployed on Base and other EVM chains. | ||
| Unlike `exact`, which transfers funds immediately and irrevocably, `escrow` supports refundable payments across both settlement paths. | ||
|
|
There was a problem hiding this comment.
Looks good to me, but make sure wording is what you expecting. The md file might have unnecessary information
There was a problem hiding this comment.
Acknowledged — the escrow abstract spec is longer than exact's, but escrow has more moving parts (two settlement paths, expiry tiers, fee system, post-settlement actions). I think the current content is justified. Happy to trim if you spot anything specific that feels redundant though.
Summary
Addresses reviewer feedback on the escrow scheme spec and implementation.
Spec changes
scheme_escrow.md: Removed EVM-specific references (Commerce Payments, ERC-3009, Solidity function names). EVM details live exclusively inscheme_escrow_evm.mdPAYMENT-RESPONSEcontents — includes fullpaymentInfoso clients can track payment state without retaining client-side state===not>=),authorization.to === tokenCollectorcheck, settlement simulation stepImplementation changes
operator.authorize/chargeviaeth_callbefore spending gas — catches balance issues, consumed nonces, domain mismatches, and contract errorsbalanceOfcheck for actionable error messagesbuildPaymentInfo()used by both verify and settleTest plan
pnpm test)pnpm build)pnpm format:check)🤖 Generated with Claude Code