Clear rounding revert#2090
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 two Vercel docs workflows, updates the remaining Vercel production workflow to target branch/env “v4,” modifies OrderBook.sol rounding logic in withdraw2 and clear2, updates subgraph network addresses and start blocks for OrderBook on Base and Arbitrum One, and adds new tests covering rounding behaviors in withdraw and clear. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant OrderBook
participant Token
participant Interpreter
User->>OrderBook: withdraw2(token, vaultId, targetAmount, tasks)
OrderBook->>OrderBook: Rescale targetAmount to 18-decimals (saturate on overflow)
OrderBook->>Interpreter: Execute tasks (if any)
OrderBook->>Token: transfer to User (up to available balance)
Token-->>OrderBook: transfer result
OrderBook-->>User: Emit Withdraw, return
sequenceDiagram
participant Alice
participant OrderBook
participant Bob
Alice->>OrderBook: clear2(aliceOrder, bobOrder, config, ctx)
OrderBook->>OrderBook: Compute aliceInputUp and aliceInput (scale up/down)
OrderBook->>OrderBook: If mismatch, adjust aliceOutputMax18 via OIRatio
OrderBook->>OrderBook: Scale aliceOutputMax18 down to aliceOutput
OrderBook-->>Alice: Settlement based on adjusted amounts
OrderBook-->>Bob: Settlement counterpart
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
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 rounding revert
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Tests