Skip to content

Commit

Permalink
use address for subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds committed Nov 28, 2024
1 parent 1ba502d commit b8409f0
Showing 1 changed file with 7 additions and 11 deletions.
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

0 comments on commit b8409f0

Please sign in to comment.