Skip to content

Commit 4a1b5b4

Browse files
committed
update ticks struct and _createLP function
1 parent 2906150 commit 4a1b5b4

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

contracts/BNBPartyLiquidity.sol

+5-7
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ abstract contract BNBPartyLiquidity is BNBPartySwaps {
3131
amount1,
3232
sqrtPrice,
3333
party.partyLpFee,
34-
party.partyTicks.tickLower,
35-
party.partyTicks.tickUpper
34+
party.partyTicks
3635
);
3736
isParty[liquidityPool] = true; // Mark the liquidity pool as a party pool
3837
isTokenOnPartyLP[_token] = true; // Mark the token as part of the party LP
@@ -56,8 +55,7 @@ abstract contract BNBPartyLiquidity is BNBPartySwaps {
5655
uint256 amount1,
5756
uint160 sqrtPriceX96,
5857
uint24 fee,
59-
int24 tickLower,
60-
int24 tickUpper
58+
Ticks memory ticks
6159
) internal returns (address liquidityPool) {
6260
// Create LP
6361
liquidityPool = liquidityManager.createAndInitializePoolIfNecessary(
@@ -73,8 +71,8 @@ abstract contract BNBPartyLiquidity is BNBPartySwaps {
7371
token0: token0,
7472
token1: token1,
7573
fee: fee,
76-
tickLower: tickLower,
77-
tickUpper: tickUpper,
74+
tickLower: ticks.tickLower,
75+
tickUpper: ticks.tickUpper,
7876
amount0Desired: amount0,
7977
amount1Desired: amount1,
8078
amount0Min: 0,
@@ -140,7 +138,7 @@ abstract contract BNBPartyLiquidity is BNBPartySwaps {
140138
IERC20(token0).approve(address(positionManager), amount0);
141139
IERC20(token1).approve(address(positionManager), amount1);
142140
// Create new Liquidity Pool
143-
_createLP(positionManager, token0, token1, amount0, amount1, newSqrtPriceX96, party.lpFee, party.lpTicks.tickLower, party.lpTicks.tickUpper);
141+
_createLP(positionManager, token0, token1, amount0, amount1, newSqrtPriceX96, party.lpFee, party.lpTicks);
144142

145143
// Send bonuses
146144
_unwrapAndSendBNB(recipient, unwrapAmount);

contracts/interfaces/IBNBPartyFactory.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ interface IBNBPartyFactory {
3030
uint256 bonusTargetReach; // Bonus amount given if the party target is reached.
3131
uint256 bonusPartyCreator; // Bonus amount for the party creator.
3232
uint256 targetReachFee; // Fee charged upon reaching the target.
33-
ticks partyTicks; // The tick range for the party's liquidity pool.
34-
ticks lpTicks; // The tick range for the second liquidity pool.
33+
Ticks partyTicks; // The tick range for the party's liquidity pool.
34+
Ticks lpTicks; // The tick range for the second liquidity pool.
3535
}
3636

37-
struct ticks {
37+
struct Ticks {
3838
int24 tickLower;
3939
int24 tickUpper;
4040
}

0 commit comments

Comments
 (0)