Skip to main content

ISubscriber

Git Source - Generated with forge doc

Interface that a Subscriber contract should implement to receive updates from the v4 position manager

Functions

notifySubscribe

Called when a position subscribes to this subscriber contract

function notifySubscribe(uint256 tokenId, bytes memory data) external;

Parameters

NameTypeDescription
tokenIduint256the token ID of the position
databytesadditional data passed in by the caller

notifyUnsubscribe

Called when a position unsubscribes from the subscriber

This call's gas is capped at unsubscribeGasLimit (set at deployment)

Because of EIP-150, solidity may only allocate 63/64 of gasleft()

function notifyUnsubscribe(uint256 tokenId) external;

Parameters

NameTypeDescription
tokenIduint256the token ID of the position

notifyBurn

Called when a position is burned

function notifyBurn(uint256 tokenId, address owner, PositionInfo info, uint256 liquidity, BalanceDelta feesAccrued)
external;

Parameters

NameTypeDescription
tokenIduint256the token ID of the position
owneraddressthe current owner of the tokenId
infoPositionInfoinformation about the position
liquidityuint256the amount of liquidity decreased in the position, may be 0
feesAccruedBalanceDeltathe fees accrued by the position if liquidity was decreased

notifyModifyLiquidity

Called when a position modifies its liquidity or collects fees

Note that feesAccrued can be artificially inflated by a malicious user Pools with a single liquidity position can inflate feeGrowthGlobal (and consequently feesAccrued) by donating to themselves; atomically donating and collecting fees within the same unlockCallback may further inflate feeGrowthGlobal/feesAccrued

function notifyModifyLiquidity(uint256 tokenId, int256 liquidityChange, BalanceDelta feesAccrued) external;

Parameters

NameTypeDescription
tokenIduint256the token ID of the position
liquidityChangeint256the change in liquidity on the underlying position
feesAccruedBalanceDeltathe fees to be collected from the position as a result of the modifyLiquidity call