@@ -13,12 +13,12 @@ abstract contract BNBPartyCreation is BNBPartySwaps {
13
13
/// @param _token Address of the token to be used in the liquidity pool
14
14
/// @return liquidityPool Address of the newly created liquidity pool
15
15
/// @dev Sets the token amounts based on the balance and initializes the pool
16
- function _createFLP (address _token ) internal returns (address liquidityPool ) {
16
+ function _createFLP (address _token ) internal returns (address liquidityPool , uint256 tokenId ) {
17
17
(address token0 , address token1 , uint160 sqrtPrice , Ticks memory ticks ) = _getTokenPairAndPrice (_token);
18
18
// Determine the token amounts
19
19
(uint256 amount0 , uint256 amount1 ) = _calculateAmounts (token0);
20
20
IERC20 (_token).safeIncreaseAllowance (address (BNBPositionManager), party.initialTokenAmount);
21
- liquidityPool = _createLP (
21
+ ( liquidityPool, tokenId) = _createLP (
22
22
BNBPositionManager,
23
23
token0,
24
24
token1,
@@ -28,8 +28,6 @@ abstract contract BNBPartyCreation is BNBPartySwaps {
28
28
party.partyLpFee,
29
29
ticks
30
30
);
31
- isParty[liquidityPool] = true ; // Mark the liquidity pool as a party pool
32
- isTokenOnPartyLP[_token] = true ; // Mark the token as part of the party LP
33
31
}
34
32
35
33
/// @notice Creates a new liquidity pool and mints liquidity positions.
@@ -51,7 +49,7 @@ abstract contract BNBPartyCreation is BNBPartySwaps {
51
49
uint160 sqrtPriceX96 ,
52
50
uint24 fee ,
53
51
Ticks memory ticks
54
- ) internal returns (address liquidityPool ) {
52
+ ) internal returns (address liquidityPool , uint256 tokenId ) {
55
53
// Create LP
56
54
liquidityPool = liquidityManager.createAndInitializePoolIfNecessary (
57
55
token0,
@@ -61,7 +59,7 @@ abstract contract BNBPartyCreation is BNBPartySwaps {
61
59
);
62
60
63
61
// Mint LP
64
- (lpToTokenId[liquidityPool] , , , ) = liquidityManager.mint (
62
+ (tokenId , , , ) = liquidityManager.mint (
65
63
INonfungiblePositionManager.MintParams ({
66
64
token0: token0,
67
65
token1: token1,
0 commit comments