@@ -7,46 +7,6 @@ import "./interfaces/IUniswapV3Pool.sol";
7
7
/// @title BNBPartyFee
8
8
/// @notice This abstract contract provides internal functions for calculating fees in the BNB Party system.
9
9
abstract contract BNBPartyFee is BNBPartyState {
10
- /// @notice Internal function to retrieve the fee growth inside the position from the last observation
11
- /// @param pool Address of the Uniswap V3 pool
12
- /// @return feeGrowthInside0LastX128 Fee growth inside for token0 from the last observation
13
- /// @return feeGrowthInside1LastX128 Fee growth inside for token1 from the last observation
14
- function _getFeeGrowthInsideLastX128 (
15
- IUniswapV3Pool pool
16
- )
17
- internal
18
- view
19
- returns (
20
- uint256 feeGrowthInside0LastX128 ,
21
- uint256 feeGrowthInside1LastX128
22
- )
23
- {
24
- (feeGrowthInside0LastX128, feeGrowthInside1LastX128) = _getFeeGrowthInsideLastX128 (
25
- positionManager,
26
- pool,
27
- party.lpTicks
28
- );
29
- }
30
-
31
- /// @notice Internal function to retrieve the fee growth inside the position from the last observation
32
- /// @param pool Address of the Uniswap V3 pool
33
- function _getPartyFeeGrowthInsideLastX128 (
34
- IUniswapV3Pool pool
35
- )
36
- internal
37
- view
38
- returns (
39
- uint256 feeGrowthInside0LastX128 ,
40
- uint256 feeGrowthInside1LastX128
41
- )
42
- {
43
- (feeGrowthInside0LastX128, feeGrowthInside1LastX128) = _getFeeGrowthInsideLastX128 (
44
- BNBPositionManager,
45
- pool,
46
- party.partyTicks
47
- );
48
- }
49
-
50
10
/// @notice Internal function to retrieve the fee growth inside the position from the last observation
51
11
function _getFeeGrowthInsideLastX128 (
52
12
INonfungiblePositionManager manager ,
@@ -88,10 +48,18 @@ abstract contract BNBPartyFee is BNBPartyState {
88
48
IUniswapV3Pool pool
89
49
) internal view returns (uint256 feeGrowthGlobal ) {
90
50
if (pool.token0 () == address (WBNB)) {
91
- (uint256 feeGrowthInside0LastX128 , ) = _getPartyFeeGrowthInsideLastX128 (pool);
51
+ (uint256 feeGrowthInside0LastX128 , ) = _getFeeGrowthInsideLastX128 (
52
+ BNBPositionManager,
53
+ pool,
54
+ party.partyTicks
55
+ );
92
56
feeGrowthGlobal = pool.feeGrowthGlobal0X128 () - feeGrowthInside0LastX128;
93
57
} else {
94
- ( , uint256 feeGrowthInside1LastX128 ) = _getPartyFeeGrowthInsideLastX128 (pool);
58
+ ( , uint256 feeGrowthInside1LastX128 ) = _getFeeGrowthInsideLastX128 (
59
+ BNBPositionManager,
60
+ pool,
61
+ party.partyTicks
62
+ );
95
63
feeGrowthGlobal = pool.feeGrowthGlobal1X128 () - feeGrowthInside1LastX128;
96
64
}
97
65
}
0 commit comments