@@ -6,14 +6,17 @@ import {PositionInfo} from "../libraries/PositionInfoLibrary.sol";
6
6
7
7
/// @notice Interface that a Subscriber contract should implement to receive updates from the v4 position manager
8
8
interface ISubscriber {
9
+ /// @notice Called when a position subscribes to this subscriber contract
9
10
/// @param tokenId the token ID of the position
10
11
/// @param data additional data passed in by the caller
11
12
function notifySubscribe (uint256 tokenId , bytes memory data ) external ;
13
+
12
14
/// @notice Called when a position unsubscribes from the subscriber
13
15
/// @dev This call's gas is capped at `unsubscribeGasLimit` (set at deployment)
14
16
/// @dev Because of EIP-150, solidity may only allocate 63/64 of gasleft()
15
17
/// @param tokenId the token ID of the position
16
18
function notifyUnsubscribe (uint256 tokenId ) external ;
19
+
17
20
/// @notice Called when a position is burned
18
21
/// @param tokenId the token ID of the position
19
22
/// @param owner the current owner of the tokenId
@@ -22,8 +25,13 @@ interface ISubscriber {
22
25
/// @param feesAccrued the fees accrued by the position if liquidity was decreased
23
26
function notifyBurn (uint256 tokenId , address owner , PositionInfo info , uint256 liquidity , BalanceDelta feesAccrued )
24
27
external ;
28
+
29
+ /// @notice Called when a position modifies its liquidity or collects fees
25
30
/// @param tokenId the token ID of the position
26
31
/// @param liquidityChange the change in liquidity on the underlying position
27
32
/// @param feesAccrued the fees to be collected from the position as a result of the modifyLiquidity call
33
+ /// @dev Note that feesAccrued can be artificially inflated by a malicious user
34
+ /// Pools with a single liquidity position can inflate feeGrowthGlobal (and consequently feesAccrued) by donating to themselves;
35
+ /// atomically donating and collecting fees within the same unlockCallback may further inflate feeGrowthGlobal/feesAccrued
28
36
function notifyModifyLiquidity (uint256 tokenId , int256 liquidityChange , BalanceDelta feesAccrued ) external ;
29
37
}
0 commit comments