feat: support partial row settlement and weighted rewards - #34
Conversation
|
@ozwaldorf i would prefer that #33 is merged before this |
Replace the bond deposit with an EIP-712 BatchBondAuth signature gate: a bid's signature must recover to the escrow's blindedSigner and binds both the bidding EOA and the claimed transfer rows. Bidding is now free, so drop all deposit collection, the bondAmount field, and the forfeited-bond reward rollover. Add ECDSA recovery helpers, a ZeroBlindedSigner constructor guard, and the BatchBondAuth test helper.
|
@claude review |
|
Claude finished @g4titanx's task in 4m 38s —— View job Claude finished reviewing
Note: the OpenZeppelin/forge-std submodules aren't checked out in this environment (network access is unavailable to me here), so I could not run Overall this is a solid, well-tested refactor — progressive settlement, proof-item consumption, and the claim-fallback path are all covered by dedicated tests ( 1. Blinded-signer supply has no relationship to expected retries ( 2. 3. Test gap: 4. Minor: PR description is stale Nothing else stood out — proof-consumption tracking ( |
|
Review pass on the partial-settlement changes. One small fix, one doc correction. 1. Unbounded gas forwarded to a bidder-controlled address in
|
Summary
escrow-side implementation of the pricing model spec
This PR updates
EscrowBatchto accept normalized value weights and a pricing commitment supplied during deployment. Rewards and bonds are calculated using normalized row values, allowing single-row, batch, and mixed-asset escrows to distribute the reward pot consistently without comparing raw token amounts.Collection is now progressive. Successfully proved rows are permanently settled, while unfinished rows remain under the same bid and deadline. Partial settlement releases the corresponding bond, expiry forfeits only the remaining bond and reopens only unfinished rows, and consumed proof identifiers prevent the same receipt item from settling multiple rows. Failed direct payouts become withdrawable claims instead of reopening completed rows.
Cancellation cleanup can release multiple expired bids through a bounded call, and
is_bonded()now checks outstanding bid state in constant time. Pricing formulas, platform-fee accounting, DEX swaps, quote verification, blinded-signer authorization, and expiry automation remain API/Nomad responsibilities.How to review
Start with
src/EscrowBatch.sol:valueWeight,quoteCommitment, and reward-asset funding.bid(),collect(), and_settleProvedRows()together to follow proportional bond release and progressive row settlement.expireBid()/expireBids(), and claim withdrawal.test/EscrowBatch.t.solfor the 9-of-10 settlement, remainder-only retry, hybrid payout, cancellation cleanup, and outstanding-bid tests.