Clear revert#2092
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughRemoves Vercel docs preview/prod GitHub Actions workflows, updates vercel-prod workflow to use branch/environment target v4, changes rounding/overflow handling in OrderBook withdraw and clear logic, updates subgraph contract addresses/startBlocks for Base and Arbitrum One, and adds new rounding-focused tests for clear2 and withdraw2. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User (caller)
participant OB as OrderBook
participant Tok as ERC20
Note over OB: withdraw2 (saturating rescale)
User->>OB: withdraw2(token, vaultId, targetAmount, tasks)
OB->>OB: Rescale targetAmount with FLAG_SATURATE
OB-->>User: Emits Withdraw (adjusted amount)
OB->>Tok: transfer(to, amount)
sequenceDiagram
participant Carol as clearer
participant OB as OrderBook
participant Alice as Alice Order
participant Bob as Bob Order
Note over OB: clear2 (Alice rounding-aware correction)
Carol->>OB: clear2(Alice, Bob, clearConfig, …)
OB->>OB: Compute aliceInputUp (18d) and aliceInput (token d)
OB->>OB: If diff, adjust aliceOutputMax18 via IORatio (ceil div)
OB-->>Carol: Clear result/events
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Motivation
Clear revert
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
Bug Fixes
Chores
Tests