Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev posm internal calls #142

Closed
wants to merge 71 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6c63e1f
initial thoughts lock and batch
snreynolds Dec 5, 2023
ad39d19
update safecallback with constructor
snreynolds Dec 5, 2023
64fc40a
simple batch under lock
snreynolds Dec 6, 2023
a707c20
oops
snreynolds Dec 6, 2023
1d0e566
misc version bump; will conflict but can resolve later
saucepoint Feb 23, 2024
4f8bbd2
defining types and different levels of abstractions
saucepoint Feb 23, 2024
c4c9dcd
merge in main; resolve conflicts
saucepoint Mar 1, 2024
187fc3d
merge in main?
saucepoint Mar 1, 2024
ee27f4f
wip
saucepoint Mar 2, 2024
30ac060
merge in main
saucepoint Mar 2, 2024
d1c5897
misc fixes with main:latest
saucepoint Mar 2, 2024
7a134a5
basic mint
saucepoint Mar 3, 2024
7bd2996
begin moving tests to fuzz
saucepoint Mar 4, 2024
307f4bb
test for slippage
saucepoint Mar 5, 2024
109caf4
burning
saucepoint Mar 6, 2024
1bf080f
decrease liquidity
saucepoint Mar 6, 2024
40f042c
mint transfer burn, liquidityOf accounting
saucepoint Mar 7, 2024
6b1c7cb
wip
saucepoint Mar 8, 2024
fa511d0
refactor to use CurrencySettleTake
saucepoint Mar 12, 2024
a0e0a44
basic fee collection
saucepoint Mar 12, 2024
0d936d4
wip
saucepoint Mar 16, 2024
4be3c2a
misc fix
saucepoint Mar 19, 2024
7fa4c54
fee collection for independent same-range parties
saucepoint Mar 19, 2024
aae9697
LiquidityPosition -> LiquidityRange
saucepoint Mar 19, 2024
5dec534
erc20 fee collection
saucepoint Mar 19, 2024
1196c6a
decrease liquidity with fee collection
saucepoint Mar 25, 2024
3d317e8
wip test decrease liquidity on same range
saucepoint Mar 26, 2024
31a70cb
reworked fuzzers; more testing on fee claims for liquidity decreasing
saucepoint Mar 26, 2024
f844687
merge in main; update flipped deltas; update lockAcquired signature
saucepoint Mar 27, 2024
666faf8
forge fmt
saucepoint Mar 27, 2024
714913e
Merge remote-tracking branch 'parent/lock-and-batch-call' into positi…
saucepoint Mar 27, 2024
ddf5771
Merge branch 'position-manager' of github.com:saucepoint/v4-periphery…
saucepoint Mar 27, 2024
3c56d48
test fixes for flipped deltas
saucepoint Mar 27, 2024
f4275cc
wip
saucepoint Apr 3, 2024
245cc3e
test coverage for increase liquidity cases
saucepoint Apr 5, 2024
f971b3d
preliminary gas benchmarks
saucepoint Apr 5, 2024
0f9936e
merge in main; fix breaking changes
saucepoint Jun 3, 2024
41619f9
merge in changes
saucepoint Jun 3, 2024
0165be5
Position manager refactor (#2)
saucepoint Jun 7, 2024
d86a8c2
fix conflicts
saucepoint Jun 9, 2024
52b304e
cleanup: TODOs and imports
saucepoint Jun 12, 2024
af67661
Position manager Consolidate (#3)
saucepoint Jun 12, 2024
48f38c4
use currency settler syntax
saucepoint Jun 12, 2024
c8ce67b
use v4-core's gas snapshot
saucepoint Jun 13, 2024
da91136
use snapLastCall and isolate for posm benchmarks
saucepoint Jun 13, 2024
18600bd
Update contracts/libraries/CurrencySettleTake.sol
saucepoint Jun 14, 2024
f52adcf
use v4-core's solmate its more recent
saucepoint Jun 14, 2024
07cc628
use v4-core's openzeppelin-contracts
saucepoint Jun 17, 2024
240c8e1
add ERC721Permit
saucepoint Jun 17, 2024
1cb1948
feedback: memory hookData
saucepoint Jun 17, 2024
227683b
initial refactor. stack too deep
saucepoint Jun 19, 2024
a19636f
passing tests
saucepoint Jun 19, 2024
ea56ec2
merge in main
saucepoint Jun 19, 2024
fc04651
gutted LockAndBatchCall
saucepoint Jun 19, 2024
e1d55f8
cleanup diff
saucepoint Jun 19, 2024
b73a240
renaming vanilla functions
saucepoint Jun 19, 2024
2227265
sanitize
saucepoint Jun 20, 2024
0cff6ef
change add liq accounting (#126)
snreynolds Jun 26, 2024
e21e847
create compatibility with arbitrary execute handler
saucepoint Jun 26, 2024
1e52f82
being supporting batched ops on vanilla functions
saucepoint Jun 26, 2024
97080cb
some initial tests to drive TDD
saucepoint Jun 26, 2024
80b5185
gas with isolate
saucepoint Jun 26, 2024
93f012e
mint to recipient
saucepoint Jun 27, 2024
cc031aa
refactor for external call and code reuse (#134)
saucepoint Jun 27, 2024
1995c9e
updated interface with unlockAndExecute
saucepoint Jun 28, 2024
0d6ab0b
update decrease (#133)
snreynolds Jun 28, 2024
635ebe3
merge in posm-batch and fix
saucepoint Jun 28, 2024
406506f
fix bubbling different return types because of recursive calls
saucepoint Jun 28, 2024
fae83dc
all operations only return a BalanceDelta type (#136)
saucepoint Jun 29, 2024
7db4e14
temp-dev-update (#135)
saucepoint Jul 9, 2024
916cbaa
using internal calls, first pass
snreynolds Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reworked fuzzers; more testing on fee claims for liquidity decreasing
  • Loading branch information
saucepoint committed Mar 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 31a70cbaeb7d086061ad109e1703b83b09340468
19 changes: 0 additions & 19 deletions contracts/NonfungiblePositionManager.sol
Original file line number Diff line number Diff line change
@@ -31,25 +31,6 @@ contract NonfungiblePositionManager is BaseLiquidityManagement, INonfungiblePosi

constructor(IPoolManager _poolManager) BaseLiquidityManagement(_poolManager) ERC721("Uniswap V4 LP", "LPT") {}

// details about the uniswap position
struct Position {
// the nonce for permits
uint96 nonce;
// the address that is approved for spending this token
address operator;
LiquidityRange range;
// the liquidity of the position
// NOTE: this value will be less than BaseLiquidityManagement.liquidityOf, if the user
// owns multiple positions with the same range
uint128 liquidity;
// the fee growth of the aggregate position as of the last action on the individual position
uint256 feeGrowthInside0LastX128;
uint256 feeGrowthInside1LastX128;
// how many uncollected tokens are owed to the position, as of the last computation
uint128 tokensOwed0;
uint128 tokensOwed1;
}

mapping(uint256 tokenId => Position position) public positions;

// NOTE: more gas efficient as LiquidityAmounts is used offchain
19 changes: 19 additions & 0 deletions contracts/interfaces/INonfungiblePositionManager.sol
Original file line number Diff line number Diff line change
@@ -7,6 +7,25 @@ import {LiquidityRange} from "../types/LiquidityRange.sol";
import {IBaseLiquidityManagement} from "./IBaseLiquidityManagement.sol";

interface INonfungiblePositionManager is IBaseLiquidityManagement {
// details about the uniswap position
struct Position {
// the nonce for permits
uint96 nonce;
// the address that is approved for spending this token
address operator;
LiquidityRange range;
// the liquidity of the position
// NOTE: this value will be less than BaseLiquidityManagement.liquidityOf, if the user
// owns multiple positions with the same range
uint128 liquidity;
// the fee growth of the aggregate position as of the last action on the individual position
uint256 feeGrowthInside0LastX128;
uint256 feeGrowthInside1LastX128;
// how many uncollected tokens are owed to the position, as of the last computation
uint128 tokensOwed0;
uint128 tokensOwed1;
}

struct MintParams {
LiquidityRange range;
uint256 amount0Desired;
194 changes: 151 additions & 43 deletions test/position-managers/FeeCollection.t.sol
Original file line number Diff line number Diff line change
@@ -36,24 +36,30 @@ contract FeeCollectionTest is Test, Deployers, GasSnapshot, LiquidityFuzzers {
address alice = makeAddr("ALICE");
address bob = makeAddr("BOB");

uint256 constant STARTING_USER_BALANCE = 10_000_000 ether;

// unused value for the fuzz helper functions
uint128 constant DEAD_VALUE = 6969.6969 ether;

// expresses the fee as a wad (i.e. 3000 = 0.003e18)
uint256 FEE_WAD;

function setUp() public {
Deployers.deployFreshManagerAndRouters();
Deployers.deployMintAndApprove2Currencies();

(key, poolId) = initPool(currency0, currency1, IHooks(address(0)), 3000, SQRT_RATIO_1_1, ZERO_BYTES);
FEE_WAD = uint256(key.fee).mulDivDown(FixedPointMathLib.WAD, 1_000_000);

lpm = new NonfungiblePositionManager(manager);
IERC20(Currency.unwrap(currency0)).approve(address(lpm), type(uint256).max);
IERC20(Currency.unwrap(currency1)).approve(address(lpm), type(uint256).max);

// Give tokens to Alice and Bob, with approvals
IERC20(Currency.unwrap(currency0)).transfer(alice, 10_000_000 ether);
IERC20(Currency.unwrap(currency1)).transfer(alice, 10_000_000 ether);
IERC20(Currency.unwrap(currency0)).transfer(bob, 10_000_000 ether);
IERC20(Currency.unwrap(currency1)).transfer(bob, 10_000_000 ether);
IERC20(Currency.unwrap(currency0)).transfer(alice, STARTING_USER_BALANCE);
IERC20(Currency.unwrap(currency1)).transfer(alice, STARTING_USER_BALANCE);
IERC20(Currency.unwrap(currency0)).transfer(bob, STARTING_USER_BALANCE);
IERC20(Currency.unwrap(currency1)).transfer(bob, STARTING_USER_BALANCE);
vm.startPrank(alice);
IERC20(Currency.unwrap(currency0)).approve(address(lpm), type(uint256).max);
IERC20(Currency.unwrap(currency1)).approve(address(lpm), type(uint256).max);
@@ -82,9 +88,7 @@ contract FeeCollectionTest is Test, Deployers, GasSnapshot, LiquidityFuzzers {

assertEq(delta.amount0(), 0);

// express key.fee as wad (i.e. 3000 = 0.003e18)
uint256 feeWad = uint256(key.fee).mulDivDown(FixedPointMathLib.WAD, 1_000_000);
assertApproxEqAbs(uint256(int256(delta.amount1())), swapAmount.mulWadDown(feeWad), 1 wei);
assertApproxEqAbs(uint256(int256(delta.amount1())), swapAmount.mulWadDown(FEE_WAD), 1 wei);

assertEq(uint256(int256(delta.amount1())), manager.balanceOf(address(this), currency1.toId()));
}
@@ -108,8 +112,7 @@ contract FeeCollectionTest is Test, Deployers, GasSnapshot, LiquidityFuzzers {
assertEq(delta.amount0(), 0);

// express key.fee as wad (i.e. 3000 = 0.003e18)
uint256 feeWad = uint256(key.fee).mulDivDown(FixedPointMathLib.WAD, 1_000_000);
assertApproxEqAbs(uint256(int256(delta.amount1())), swapAmount.mulWadDown(feeWad), 1 wei);
assertApproxEqAbs(uint256(int256(delta.amount1())), swapAmount.mulWadDown(FEE_WAD), 1 wei);

assertEq(uint256(int256(delta.amount1())), currency1.balanceOfSelf() - balance1Before);
}
@@ -126,10 +129,8 @@ contract FeeCollectionTest is Test, Deployers, GasSnapshot, LiquidityFuzzers {
liquidityDeltaAlice = uint128(bound(liquidityDeltaAlice, 100e18, 100_000e18)); // require nontrivial amount of liquidity
liquidityDeltaBob = uint128(bound(liquidityDeltaBob, 100e18, 100_000e18));

(tickLower, tickUpper, liquidityDeltaAlice) =
createFuzzyLiquidityParams(key, tickLower, tickUpper, liquidityDeltaAlice);
(tickLower, tickUpper) = createFuzzyLiquidityParams(key, tickLower, tickUpper, liquidityDeltaAlice);
vm.assume(tickLower < -60 && 60 < tickUpper); // require two-sided liquidity
(,, liquidityDeltaBob) = createFuzzyLiquidityParams(key, tickLower, tickUpper, liquidityDeltaBob);

vm.prank(alice);
(tokenIdAlice,) = lpm.mint(
@@ -180,19 +181,26 @@ contract FeeCollectionTest is Test, Deployers, GasSnapshot, LiquidityFuzzers {
) public {
liquidityDeltaAlice = uint128(bound(liquidityDeltaAlice, 100e18, 100_000e18)); // require nontrivial amount of liquidity
liquidityDeltaBob = uint128(bound(liquidityDeltaBob, 100e18, 100_000e18));

uint256 tokenIdAlice;
vm.startPrank(alice);
(tokenIdAlice, tickLower, tickUpper, liquidityDeltaAlice,) =
createFuzzyLiquidity(lpm, alice, key, tickLower, tickUpper, liquidityDeltaAlice, ZERO_BYTES);
vm.stopPrank();

uint256 tokenIdBob;
(tokenIdAlice, tokenIdBob, tickLower, tickUpper,,) = createFuzzySameRange(
lpm,
alice,
bob,
LiquidityRange({key: key, tickLower: tickLower, tickUpper: tickUpper}),
liquidityDeltaAlice,
liquidityDeltaBob,
ZERO_BYTES
);
vm.startPrank(bob);
(tokenIdBob,,,,) = createFuzzyLiquidity(lpm, bob, key, tickLower, tickUpper, liquidityDeltaBob, ZERO_BYTES);
vm.stopPrank();

vm.assume(tickLower < -key.tickSpacing && key.tickSpacing < tickUpper); // require two-sided liquidity

// confirm the positions are same range
(,, LiquidityRange memory rangeAlice,,,,,) = lpm.positions(tokenIdAlice);
(,, LiquidityRange memory rangeBob,,,,,) = lpm.positions(tokenIdBob);
assertEq(rangeAlice.tickLower, rangeBob.tickLower);
assertEq(rangeAlice.tickUpper, rangeBob.tickUpper);

// swap to create fees
uint256 swapAmount = 0.01e18;
swap(key, false, int256(swapAmount), ZERO_BYTES);
@@ -237,36 +245,35 @@ contract FeeCollectionTest is Test, Deployers, GasSnapshot, LiquidityFuzzers {
) public {
liquidityDeltaAlice = uint128(bound(liquidityDeltaAlice, 100e18, 100_000e18)); // require nontrivial amount of liquidity
liquidityDeltaBob = uint128(bound(liquidityDeltaBob, 100e18, 100_000e18));

uint256 tokenIdAlice;
BalanceDelta lpDeltaAlice;
vm.startPrank(alice);
(tokenIdAlice, tickLower, tickUpper, liquidityDeltaAlice, lpDeltaAlice) =
createFuzzyLiquidity(lpm, alice, key, tickLower, tickUpper, liquidityDeltaAlice, ZERO_BYTES);
vm.stopPrank();

uint256 tokenIdBob;
uint128 liquidityAlice;
uint128 liquidityBob;
(tokenIdAlice, tokenIdBob, tickLower, tickUpper, liquidityAlice, liquidityBob) = createFuzzySameRange(
lpm,
alice,
bob,
LiquidityRange({key: key, tickLower: tickLower, tickUpper: tickUpper}),
liquidityDeltaAlice,
liquidityDeltaBob,
ZERO_BYTES
);
BalanceDelta lpDeltaBob;
vm.startPrank(bob);
(tokenIdBob,,,, lpDeltaBob) =
createFuzzyLiquidity(lpm, bob, key, tickLower, tickUpper, liquidityDeltaBob, ZERO_BYTES);
vm.stopPrank();

vm.assume(tickLower < -key.tickSpacing && key.tickSpacing < tickUpper); // require two-sided liquidity

// swap to create fees
uint256 swapAmount = 0.01e18;
uint256 swapAmount = 0.001e18;
swap(key, true, int256(swapAmount), ZERO_BYTES);

// alice removes all of her liquidity
uint256 balance0AliceBefore = manager.balanceOf(alice, currency0.toId());
uint256 balance1AliceBefore = manager.balanceOf(alice, currency1.toId());
console2.log(lpm.ownerOf(tokenIdAlice));
console2.log(alice);
console2.log(address(this));
// uint256 balance0AliceBefore = manager.balanceOf(alice, currency0.toId());
// uint256 balance1AliceBefore = manager.balanceOf(alice, currency1.toId());
vm.prank(alice);
BalanceDelta aliceDelta = lpm.decreaseLiquidity(
INonfungiblePositionManager.DecreaseLiquidityParams({
tokenId: tokenIdAlice,
liquidityDelta: liquidityAlice,
liquidityDelta: liquidityDeltaAlice,
amount0Min: 0,
amount1Min: 0,
deadline: block.timestamp + 1,
@@ -275,10 +282,111 @@ contract FeeCollectionTest is Test, Deployers, GasSnapshot, LiquidityFuzzers {
ZERO_BYTES,
true
);
uint256 balance0AliceAfter = manager.balanceOf(alice, currency0.toId());
uint256 balance1AliceAfter = manager.balanceOf(alice, currency1.toId());
assertEq(uint256(uint128(-aliceDelta.amount0())), manager.balanceOf(alice, currency0.toId()));
assertEq(uint256(uint128(-aliceDelta.amount1())), manager.balanceOf(alice, currency1.toId()));

assertEq(uint256(uint128(aliceDelta.amount0())), balance0AliceAfter - balance0AliceBefore);
assertEq(uint256(uint128(aliceDelta.amount1())), balance1AliceAfter - balance1AliceBefore);
// bob removes half of his liquidity
vm.prank(bob);
BalanceDelta bobDelta = lpm.decreaseLiquidity(
INonfungiblePositionManager.DecreaseLiquidityParams({
tokenId: tokenIdBob,
liquidityDelta: liquidityDeltaBob / 2,
amount0Min: 0,
amount1Min: 0,
deadline: block.timestamp + 1,
recipient: bob
}),
ZERO_BYTES,
true
);
assertEq(uint256(uint128(-bobDelta.amount0())), manager.balanceOf(bob, currency0.toId()));
assertEq(uint256(uint128(-bobDelta.amount1())), manager.balanceOf(bob, currency1.toId()));

// position manager holds no fees now
assertApproxEqAbs(manager.balanceOf(address(lpm), currency0.toId()), 0, 1 wei);
assertApproxEqAbs(manager.balanceOf(address(lpm), currency1.toId()), 0, 1 wei);
}

/// @dev Alice and bob create liquidity on the same range
/// when alice decreases liquidity, she should only collect her fees
function test_decreaseLiquidity_sameRange_exact() public {
// alice and bob create liquidity on the same range [-120, 120]
LiquidityRange memory range = LiquidityRange({key: key, tickLower: -120, tickUpper: 120});

// alice provisions 3x the amount of liquidity as bob
uint256 liquidityAlice = 3000e18;
uint256 liquidityBob = 1000e18;
vm.prank(alice);
(uint256 tokenIdAlice, BalanceDelta lpDeltaAlice) =
lpm.mint(range, liquidityAlice, block.timestamp + 1, alice, ZERO_BYTES);

vm.prank(bob);
(uint256 tokenIdBob, BalanceDelta lpDeltaBob) =
lpm.mint(range, liquidityBob, block.timestamp + 1, bob, ZERO_BYTES);

// swap to create fees
uint256 swapAmount = 0.001e18;
swap(key, true, int256(swapAmount), ZERO_BYTES);
swap(key, false, int256(swapAmount), ZERO_BYTES); // move the price back

// alice decreases liquidity
vm.prank(alice);
BalanceDelta aliceDelta = lpm.decreaseLiquidity(
INonfungiblePositionManager.DecreaseLiquidityParams({
tokenId: tokenIdAlice,
liquidityDelta: uint128(liquidityAlice),
amount0Min: 0,
amount1Min: 0,
deadline: block.timestamp + 1,
recipient: alice
}),
ZERO_BYTES,
true
);

uint256 tolerance = 0.000000001 ether;

// alice claims original principal + her fees
assertApproxEqAbs(
manager.balanceOf(alice, currency0.toId()),
uint256(int256(lpDeltaAlice.amount0()))
+ swapAmount.mulWadDown(FEE_WAD).mulDivDown(liquidityAlice, liquidityAlice + liquidityBob),
tolerance
);
assertApproxEqAbs(
manager.balanceOf(alice, currency1.toId()),
uint256(int256(lpDeltaAlice.amount1()))
+ swapAmount.mulWadDown(FEE_WAD).mulDivDown(liquidityAlice, liquidityAlice + liquidityBob),
tolerance
);

// bob decreases half of his liquidity
vm.prank(bob);
BalanceDelta bobDelta = lpm.decreaseLiquidity(
INonfungiblePositionManager.DecreaseLiquidityParams({
tokenId: tokenIdBob,
liquidityDelta: uint128(liquidityBob / 2),
amount0Min: 0,
amount1Min: 0,
deadline: block.timestamp + 1,
recipient: bob
}),
ZERO_BYTES,
true
);

// bob claims half of the original principal + his fees
assertApproxEqAbs(
manager.balanceOf(bob, currency0.toId()),
uint256(int256(lpDeltaBob.amount0()) / 2)
+ swapAmount.mulWadDown(FEE_WAD).mulDivDown(liquidityBob, liquidityAlice + liquidityBob),
tolerance
);
assertApproxEqAbs(
manager.balanceOf(bob, currency1.toId()),
uint256(int256(lpDeltaBob.amount1()) / 2)
+ swapAmount.mulWadDown(FEE_WAD).mulDivDown(liquidityBob, liquidityAlice + liquidityBob),
tolerance
);
}
}
10 changes: 5 additions & 5 deletions test/position-managers/NonfungiblePositionManager.t.sol
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ contract NonfungiblePositionManagerTest is Test, Deployers, GasSnapshot, Liquidi
}

function test_mint_withLiquidityDelta(int24 tickLower, int24 tickUpper, uint128 liquidityDelta) public {
(tickLower, tickUpper, liquidityDelta) = createFuzzyLiquidityParams(key, tickLower, tickUpper, liquidityDelta);
(tickLower, tickUpper) = createFuzzyLiquidityParams(key, tickLower, tickUpper, liquidityDelta);
LiquidityRange memory position = LiquidityRange({key: key, tickLower: tickLower, tickUpper: tickUpper});

uint256 balance0Before = currency0.balanceOfSelf();
@@ -69,7 +69,7 @@ contract NonfungiblePositionManagerTest is Test, Deployers, GasSnapshot, Liquidi
}

function test_mint(int24 tickLower, int24 tickUpper, uint256 amount0Desired, uint256 amount1Desired) public {
(tickLower, tickUpper,) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
(tickLower, tickUpper) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
(amount0Desired, amount1Desired) =
createFuzzyAmountDesired(key, tickLower, tickUpper, amount0Desired, amount1Desired);

@@ -132,7 +132,7 @@ contract NonfungiblePositionManagerTest is Test, Deployers, GasSnapshot, Liquidi
function test_mint_recipient(int24 tickLower, int24 tickUpper, uint256 amount0Desired, uint256 amount1Desired)
public
{
(tickLower, tickUpper,) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
(tickLower, tickUpper) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
(amount0Desired, amount1Desired) =
createFuzzyAmountDesired(key, tickLower, tickUpper, amount0Desired, amount1Desired);

@@ -155,7 +155,7 @@ contract NonfungiblePositionManagerTest is Test, Deployers, GasSnapshot, Liquidi
function test_mint_slippageRevert(int24 tickLower, int24 tickUpper, uint256 amount0Desired, uint256 amount1Desired)
public
{
(tickLower, tickUpper,) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
(tickLower, tickUpper) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
vm.assume(tickLower < 0);
vm.assume(tickUpper > 0);

@@ -308,7 +308,7 @@ contract NonfungiblePositionManagerTest is Test, Deployers, GasSnapshot, Liquidi
function test_mintTransferBurn(int24 tickLower, int24 tickUpper, uint256 amount0Desired, uint256 amount1Desired)
public
{
(tickLower, tickUpper,) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
(tickLower, tickUpper) = createFuzzyLiquidityParams(key, tickLower, tickUpper, DEAD_VALUE);
(amount0Desired, amount1Desired) =
createFuzzyAmountDesired(key, tickLower, tickUpper, amount0Desired, amount1Desired);

Loading