Conversation
Includes per-hop slippage for single swaps and flipped output/input ratio formula with 1e36 precision.
🤖 Claude Code Review
SummaryThis PR adds two major features to the Universal Router:
AnalysisPer-hop Slippage ImplementationThe implementation correctly handles the complex ordering of exact-output swaps where trading hops execute in reverse order:
The Breaking Change ConsiderationsThe ABI for V2 and V3 swap commands has changed - all calls now require a 6th parameter ( Test CoverageThe foundry tests (
Code QualityThe implementation is clean:
VerdictThe implementation is correct and well-tested. The features are additive with sensible defaults (empty array = disabled). No bugs, security issues, or data corruption risks identified. 💡 Want a fresh review? Add a comment containing |
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
Superseded by new review after PR update
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
Superseded by new review after PR update
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
Superseded by new review after PR update
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
🤖 Claude Code ReviewStatus: The review was completed but there was an error posting inline comments. Raw Review OutputPlease check the workflow logs for details. |
🤖 Claude Code ReviewStatus: ❌ Error
|
🤖 Claude Code ReviewStatus: The review was completed but there was an error posting inline comments. Raw Review OutputPlease check the workflow logs for details. |
🤖 Claude Code ReviewStatus: ❌ Error
|
🤖 Claude Code ReviewStatus: The review was completed but there was an error posting inline comments. Raw Review OutputPlease check the workflow logs for details. |
🤖 Claude Code ReviewStatus: ❌ Error
|
🤖 Claude Code ReviewStatus: The review was completed but there was an error posting inline comments. Raw Review OutputPlease check the workflow logs for details. |
🤖 Claude Code ReviewStatus: ❌ Error
|
Summary
0x07): New payment command with 1e18 precision (vs 10,000 bips), enabling exact fractional payments like 1/3uint256[] maxHopSlippageparameter to all 4 V2/V3 swap commands (V3_SWAP_EXACT_IN,V3_SWAP_EXACT_OUT,V2_SWAP_EXACT_IN,V2_SWAP_EXACT_OUT), matching V4's convention whereprice = amountOut * 1e36 / amountInmaxHopSlippagein V4 single-swap structsTest Plan
✨ Claude-Generated Content
Summary
Universal Router v2.1.1 introduces high-precision payment commands and per-hop slippage protection for V2/V3 swaps.
Changes
New Commands
0x07): Payment command with 1e18 precision (vs 10,000 bips), enabling exact fractional payments like 1/3Per-hop Slippage Protection
uint256[] maxHopSlippageparameter to all V2/V3 swap commands:V3_SWAP_EXACT_IN,V3_SWAP_EXACT_OUTV2_SWAP_EXACT_IN,V2_SWAP_EXACT_OUTamountOut * 1e36 / amountInNew Errors
V2TooLittleReceivedPerHop,V2InvalidHopSlippageLengthin V2SwapRouterV3TooLittleReceivedPerHop,V3TooMuchRequestedPerHop,V3InvalidHopSlippageLengthin V3SwapRouterInvalidPortionin Payments moduleLibrary Updates
toUint256Arrayhelper in BytesLib for decoding hop slippage arraysSLIPPAGE_PRECISIONconstant (1e36) in ConstantsINCREASE_LIQUIDITY_FROM_DELTASaction check in V3ToV4MigratorBuild Configuration
bytecode_hash = "none"in foundry.tomlDependencies
maxHopSlippagein V4 single-swap structsTest Plan