clear3: run NegativeBounty guard before any vault settlement (#2671)#2732
clear3: run NegativeBounty guard before any vault settlement (#2671)#2732thedavidmeister wants to merge 1 commit into
Conversation
In clear3 the NegativeBounty guard ran after vault settlement (recordVaultOutput / recordVaultInput / pushVaultZeroInput). A spread with a vault-0 input against an orderbook with zero ambient balance reverts ERC20InsufficientBalance from the vault-0 push before the explicit guard, so the opaque ERC20 error pre-empts NegativeBounty(). Move the guard to immediately after calculateClearStateChange, before any settlement, so a negative bounty always reverts with the explicit NegativeBounty() error. Behaviour is otherwise unchanged: the same spread that reverted before still reverts, just with the typed error. Item 2 of #2671; split out of the bundled #2692 for independent review and re-implemented on current main (post-#2701). Adds testClearNegativeBountyVaultZeroRevertsNegativeBounty to RaindexV6.takeOrder.vaultZeroInput.t.sol: both orders take and give via vault 0 against a zero-ambient-balance orderbook and cross into a -0.5 bounty; the guard must revert NegativeBounty() ahead of the vault-0 push. Regenerated RaindexV6 pointers + dependent arb/flash-borrower pointers + test_fixtures ABI for the new bytecode. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 37 minutes and 57 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Split out of #2692 for independent review (issue #2671). Re-implemented on current main post-#2701. Note: testProdDeploy*/start-block/constant-suite tests are red pending the serial deploy at land time.