Skip to content

fix: use withdraw4 for Orderbook V6 in intra-orderbook calldata#437

Open
Siddharth2207 wants to merge 2 commits into2026-02-12-sushi-price-impactfrom
2026-03-27-v6-calldata-fix
Open

fix: use withdraw4 for Orderbook V6 in intra-orderbook calldata#437
Siddharth2207 wants to merge 2 commits into2026-02-12-sushi-price-impactfrom
2026-03-27-v6-calldata-fix

Conversation

@Siddharth2207
Copy link
Copy Markdown
Collaborator

@Siddharth2207 Siddharth2207 commented Mar 27, 2026

Summary

  • getCalldata was routing all V4 orders to getCalldataForV4Order, which hardcodes withdraw3 (Orderbook V5)
  • Orderbook V6 replaced withdraw3 with withdraw4, causing a revert in the multicall
  • Added getCalldataForV4OrderV6 using ABI.Orderbook.V6.Primary.Orderbook with withdraw4 and clear3
  • Updated dispatch to check Pair.isV4OrderbookV6 before falling through to the V5 path
  • Bumped lib/sushiswap submodule to 1b2b675 (add cbBTC to Base routing bases sushiswap#44) — adds cbBTC to Base routing bases so tokens only paired with cbBTC on Hydrex (e.g. wtMSTR) can be priced in ETH terms

The getCalldata dispatch was falling through to getCalldataForV4Order
for all V4 orders, which hardcodes withdraw3 (V5). V6 replaced withdraw3
with withdraw4, causing a revert. Added getCalldataForV4OrderV6 using
the V6 ABI and updated the dispatch to route V6 pairs correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6e062f60-8672-42a2-91b5-f57a55d45401

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-03-27-v6-calldata-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Picks up rainlanguage/sushiswap#44 so wtMSTR (and other tokens only
paired with cbBTC on Hydrex) can be priced in ETH terms by the solver.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Siddharth2207 Siddharth2207 requested a review from hardyjosh April 2, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants