From cbd953ff5bbf613430634e7cb532025ba5573c2a Mon Sep 17 00:00:00 2001 From: saucepoint Date: Mon, 26 Aug 2024 12:57:37 -0400 Subject: [PATCH] chore: adherence to CEI in unsubscribe --- src/base/Notifier.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/Notifier.sol b/src/base/Notifier.sol index 10a501a2..59c32e8a 100644 --- a/src/base/Notifier.sol +++ b/src/base/Notifier.sol @@ -69,11 +69,11 @@ abstract contract Notifier is INotifier { _positionConfigs(tokenId).setUnsubscribe(); ISubscriber _subscriber = subscriber[tokenId]; - uint256 subscriberGasLimit = block.gaslimit.calculatePortion(BLOCK_LIMIT_BPS); + delete subscriber[tokenId]; + uint256 subscriberGasLimit = block.gaslimit.calculatePortion(BLOCK_LIMIT_BPS); try _subscriber.notifyUnsubscribe{gas: subscriberGasLimit}(tokenId, config, data) {} catch {} - delete subscriber[tokenId]; emit Unsubscribed(tokenId, address(_subscriber)); }