Skip to content

Commit 66a568a

Browse files
fix
1 parent 9441a7e commit 66a568a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/libraries/UniswapV4Lib.sol

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ library UniswapV4Lib {
9999

100100
_requirePoolIdMatch(poolId, poolKey);
101101

102-
// Since funds are being added to the position, the ticks of the position need to be checked
103-
// since it's possible the position was transferred to the proxy, and its tick range may not
104-
// adhere to the constraints that would have been applied if it were minted by the proxy.
102+
// When adding funds, validate the position's tick range against current tick limits.
103+
// The position may have been transferred to the proxy or minted under historical limits.
104+
// Such positions can still be decreased, but increasing liquidity is only allowed if the ticks stay within limits.
105105
_checkTickLimits(tickLimits[poolId], info.tickLower(), info.tickUpper());
106106

107107
bytes memory callData = _getIncreaseLiquidityCallData({
@@ -335,10 +335,7 @@ library UniswapV4Lib {
335335
rateLimitDecrease
336336
);
337337

338-
// Reset approval of Permit2 in token0 and token1
339-
// NOTE: It's not necessary to reset the Position Manager approval in Permit2 (as it
340-
// doesn't have allowance in the token at this point), but prudent so there isn't a
341-
// hanging unused approval.
338+
// Needed to fully clean up remaining allowances.
342339
_approveWithPermit2(proxy, token0, _POSITION_MANAGER, 0);
343340
_approveWithPermit2(proxy, token1, _POSITION_MANAGER, 0);
344341
}

0 commit comments

Comments
 (0)