Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use address for subscriber #405

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .forge-snapshots/positionDescriptor bytecode size.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24108
24177
18 changes: 7 additions & 11 deletions src/base/Notifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,32 +96,28 @@ abstract contract Notifier is INotifier {
uint256 liquidity,
BalanceDelta feesAccrued
) internal {
ISubscriber _subscriber = subscriber[tokenId];
address _subscriber = address(subscriber[tokenId]);

// remove the subscriber
delete subscriber[tokenId];

bool success = _call(
address(_subscriber), abi.encodeCall(ISubscriber.notifyBurn, (tokenId, owner, info, liquidity, feesAccrued))
);
bool success =
_call(_subscriber, abi.encodeCall(ISubscriber.notifyBurn, (tokenId, owner, info, liquidity, feesAccrued)));

if (!success) {
address(_subscriber).bubbleUpAndRevertWith(
ISubscriber.notifyBurn.selector, BurnNotificationReverted.selector
);
_subscriber.bubbleUpAndRevertWith(ISubscriber.notifyBurn.selector, BurnNotificationReverted.selector);
}
}

function _notifyModifyLiquidity(uint256 tokenId, int256 liquidityChange, BalanceDelta feesAccrued) internal {
ISubscriber _subscriber = subscriber[tokenId];
address _subscriber = address(subscriber[tokenId]);

bool success = _call(
address(_subscriber),
abi.encodeCall(ISubscriber.notifyModifyLiquidity, (tokenId, liquidityChange, feesAccrued))
_subscriber, abi.encodeCall(ISubscriber.notifyModifyLiquidity, (tokenId, liquidityChange, feesAccrued))
);

if (!success) {
address(_subscriber).bubbleUpAndRevertWith(
_subscriber.bubbleUpAndRevertWith(
ISubscriber.notifyModifyLiquidity.selector, ModifyLiquidityNotificationReverted.selector
);
}
Expand Down