Skip to content

feat: Tighter UniswapV4 types - #220

Merged
lucas-manuel merged 2 commits into
devfrom
feat/uniswap-uint128
Jan 28, 2026
Merged

lucas-manuel merged 2 commits into
devfrom
feat/uniswap-uint128

Conversation

@deluca-mike

@deluca-mike deluca-mike commented Jan 27, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor

    • Updated parameter types for Uniswap V4 liquidity operations to use 128-bit integer types for amount values in maximum and minimum amount parameters.
    • Standardized parameter types across mint position, increase liquidity, and decrease liquidity operations.
    • Updated corresponding library functions to propagate type changes.
  • Tests

    • Updated test cases and helper functions to align with parameter type changes.

✏️ Tip: You can customize this high-level summary in your review settings.

@octane-security-app

Copy link
Copy Markdown

Summary by Octane

New Contracts

No new contracts were added.

Updated Contracts

  • MainnetController.sol: Changed amount0Max, amount1Max, amount0Min, and amount1Min data types from uint256 to uint128.
  • UniswapV4Lib.sol: The smart contract modifications have changed amount0Max, amount1Max, amount0Min, and amount1Min from uint256 to uint128.

🔗 Commit Hash: 68351e0

@octane-security-app

Copy link
Copy Markdown

Overview

Vulnerabilities found: 1                                                                                
Warnings found: 1                                                                                

🔗 Commit Hash: 68351e0
🛡️ Octane Dashboard: All vulnerabilities

@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown

Walkthrough

Parameter types narrowed from uint256 to uint128 for amount fields in Uniswap V4 functions (mintPosition, increasePosition, decreasePosition) across the MainnetController, library, and test files. Function bodies and control flow remain unchanged.

Changes

Cohort / File(s) Summary
Uniswap V4 Interface Narrowing
src/MainnetController.sol, src/libraries/UniswapV4Lib.sol
Parameter types narrowed: amount0Max, amount1Max, amount0Min, amount1Min converted from uint256 to uint128 in mintPositionUniswapV4, increaseLiquidityUniswapV4, and decreaseLiquidityUniswapV4 methods and corresponding library functions. Call sites updated to pass matching parameter types.
Test Utilities
test/mainnet-fork/Uniswapv4.t.sol
Helper function signatures updated to reflect uint128 parameters and return types (e.g., _getIncreasePositionMaxAmounts, _quoteLiquidity, _decreasePosition). Casting and variable assignments adjusted accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • supercontracts

Poem

🐰 A rabbit hops through types so grand,
Where 256 bits once did stand—
Now 128 brings tighter bounds,
Our V4 dances with cleaner rounds,
Precision whispers, math refined! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The pull request title 'feat: Tighter UniswapV4 types' follows the required format (prefix with colon), is concise, and accurately describes the main change of narrowing parameter types from uint256 to uint128 in Uniswap V4-related functions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/uniswap-uint128

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

@github-actions

Copy link
Copy Markdown

Coverage after merging feat/uniswap-uint128 into dev will be

99.40%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
deploy
   ControllerDeploy.sol100%100%100%100%
   ForeignControllerInit.sol100%100%100%100%
   MainnetControllerInit.sol97.37%93.33%100%100%152, 90
src
   ALMProxy.sol100%100%100%100%
   ALMProxyFreezable.sol100%100%100%100%
   ForeignController.sol94.90%84.62%95.65%97.22%128–129, 129, 129, 316–317, 573
   MainnetController.sol99.18%100%98.36%99.24%583–584
   OTCBuffer.sol100%100%100%100%
   RateLimitHelpers.sol100%100%100%100%
   RateLimits.sol100%100%100%100%
   WeEthModule.sol92.86%75%100%100%26, 38
src/libraries
   AaveLib.sol100%100%100%100%
   ApproveLib.sol100%100%100%100%
   CCTPLib.sol100%100%100%100%
   CurveLib.sol100%100%100%100%
   ERC4626Lib.sol96%75%100%100%108
   LayerZeroLib.sol100%100%100%100%
   PSMLib.sol100%100%100%100%
   UniswapV4Lib.sol99.32%95.65%100%100%282
   WeETHLib.sol100%100%100%100%

@lucas-manuel lucas-manuel changed the title feat: tighter UniswaV4 types feat: Tighter UniswapV4 types Jan 28, 2026
@lucas-manuel
lucas-manuel merged commit 3022326 into dev Jan 28, 2026
6 of 7 checks passed
@lucas-manuel
lucas-manuel deleted the feat/uniswap-uint128 branch January 28, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants