INotifier
Git Source | Generated with forge doc
This interface is used to opt in to sending updates to external contracts about position modifications or transfers
Functions
subscriber
Returns the subscriber for a respective position
function subscriber(uint256 tokenId) external view returns (ISubscriber subscriber);
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | the ERC721 tokenId |
Returns
Name | Type | Description |
---|---|---|
subscriber | ISubscriber | the subscriber contract |
subscribe
Enables the subscriber to receive notifications for a respective position
Calling subscribe when a position is already subscribed will revert
payable so it can be multicalled with NATIVE related actions
function subscribe(uint256 tokenId, address newSubscriber, bytes calldata data) external payable;
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | the ERC721 tokenId |
newSubscriber | address | the address of the subscriber contract |
data | bytes | caller-provided data that's forwarded to the subscriber contract |
unsubscribe
Removes the subscriber from receiving notifications for a respective position
Callers must specify a high gas limit (remaining gas should be higher than unsubscriberGasLimit) such that the subscriber can be notified
payable so it can be multicalled with NATIVE related actions
Must always allow a user to unsubscribe. In the case of a malicious subscriber, a user can always unsubscribe safely, ensuring liquidity is always modifiable.
function unsubscribe(uint256 tokenId) external payable;
Parameters
Name | Type | Description |
---|---|---|
tokenId | uint256 | the ERC721 tokenId |
unsubscribeGasLimit
Returns and determines the maximum allowable gas-used for notifying unsubscribe
function unsubscribeGasLimit() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | uint256 the maximum gas limit when notifying a subscriber's notifyUnsubscribe function |
Events
Subscription
Emitted on a successful call to subscribe
event Subscription(uint256 indexed tokenId, address indexed subscriber);
Unsubscription
Emitted on a successful call to unsubscribe
event Unsubscription(uint256 indexed tokenId, address indexed subscriber);
Errors
NotSubscribed
Thrown when unsubscribing without a subscriber
error NotSubscribed();
NoCodeSubscriber
Thrown when a subscriber does not have code
error NoCodeSubscriber();
GasLimitTooLow
Thrown when a user specifies a gas limit too low to avoid valid unsubscribe notifications
error GasLimitTooLow();
Wrap__SubscriptionReverted
Wraps the revert message of the subscriber contract on a reverting subscription
error Wrap__SubscriptionReverted(address subscriber, bytes reason);
Wrap__ModifyLiquidityNotificationReverted
Wraps the revert message of the subscriber contract on a reverting modify liquidity notification
error Wrap__ModifyLiquidityNotificationReverted(address subscriber, bytes reason);
Wrap__TransferNotificationReverted
Wraps the revert message of the subscriber contract on a reverting transfer notification
error Wrap__TransferNotificationReverted(address subscriber, bytes reason);
AlreadySubscribed
Thrown when a tokenId already has a subscriber
error AlreadySubscribed(uint256 tokenId, address subscriber);