File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed
Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -117,17 +117,19 @@ library PositionValue {
117117 feeParams.tickUpper
118118 );
119119
120- amount0 = FullMath.mulDiv (
121- poolFeeGrowthInside0LastX128 - feeParams.positionFeeGrowthInside0LastX128,
122- feeParams.liquidity,
123- FixedPoint128.Q128
124- ) + feeParams.tokensOwed0;
120+ amount0 =
121+ FullMath.mulDiv (
122+ poolFeeGrowthInside0LastX128 - feeParams.positionFeeGrowthInside0LastX128,
123+ feeParams.liquidity,
124+ FixedPoint128.Q128
125+ ) + feeParams.tokensOwed0;
125126
126- amount1 = FullMath.mulDiv (
127- poolFeeGrowthInside1LastX128 - feeParams.positionFeeGrowthInside1LastX128,
128- feeParams.liquidity,
129- FixedPoint128.Q128
130- ) + feeParams.tokensOwed1;
127+ amount1 =
128+ FullMath.mulDiv (
129+ poolFeeGrowthInside1LastX128 - feeParams.positionFeeGrowthInside1LastX128,
130+ feeParams.liquidity,
131+ FixedPoint128.Q128
132+ ) + feeParams.tokensOwed1;
131133 }
132134
133135 function _getFeeGrowthInside (IUniswapV3Pool pool , int24 tickLower , int24 tickUpper )
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ interface IV4Router is IImmutableState {
1313 error V4TooLittleReceived (uint256 minAmountOutReceived , uint256 amountReceived );
1414 /// @notice Emitted when an exactOutput is asked for more than its maxAmountIn
1515 error V4TooMuchRequested (uint256 maxAmountInRequested , uint256 amountRequested );
16+ /// @notice Emitted when an exactInput swap does not receive its relative minAmountOut per hop (max price)
17+ error V4TooLittleReceivedPerHop (uint256 hopIndex , uint256 maxPrice , uint256 price );
18+ /// @notice Emitted when an exactOutput is asked for more than its relative maxAmountIn per hop (max price)
19+ error V4TooMuchRequestedPerHop (uint256 hopIndex , uint256 maxPrice , uint256 price );
20+ /// @notice Emitted when the length of the maxHopSlippage array is not zero and not equal to the path length
21+ error InvalidHopSlippageLength ();
1622
1723 /// @notice Parameters for a single-hop exact-input swap
1824 struct ExactInputSingleParams {
@@ -27,6 +33,7 @@ interface IV4Router is IImmutableState {
2733 struct ExactInputParams {
2834 Currency currencyIn;
2935 PathKey[] path;
36+ uint256 [] maxHopSlippage;
3037 uint128 amountIn;
3138 uint128 amountOutMinimum;
3239 }
@@ -44,6 +51,7 @@ interface IV4Router is IImmutableState {
4451 struct ExactOutputParams {
4552 Currency currencyOut;
4653 PathKey[] path;
54+ uint256 [] maxHopSlippage;
4755 uint128 amountOut;
4856 uint128 amountInMaximum;
4957 }
You can’t perform that action at this time.
0 commit comments