diff --git a/src/TwabController.sol b/src/TwabController.sol index c1d8792..1ea3bc2 100644 --- a/src/TwabController.sol +++ b/src/TwabController.sol @@ -667,7 +667,9 @@ contract TwabController { ) = TwabLib.increaseBalances(PERIOD_LENGTH, PERIOD_OFFSET, _account, _amount, _delegateAmount); // Always emit the balance change event - emit IncreasedBalance(_vault, _user, _amount, _delegateAmount); + if (_amount != 0 || _delegateAmount != 0) { + emit IncreasedBalance(_vault, _user, _amount, _delegateAmount); + } // Conditionally emit the observation recorded event if (_isObservationRecorded) { @@ -710,7 +712,9 @@ contract TwabController { ); // Always emit the balance change event - emit DecreasedBalance(_vault, _user, _amount, _delegateAmount); + if (_amount != 0 || _delegateAmount != 0) { + emit DecreasedBalance(_vault, _user, _amount, _delegateAmount); + } // Conditionally emit the observation recorded event if (_isObservationRecorded) { @@ -752,7 +756,9 @@ contract TwabController { ); // Always emit the balance change event - emit DecreasedTotalSupply(_vault, _amount, _delegateAmount); + if (_amount != 0 || _delegateAmount != 0) { + emit DecreasedTotalSupply(_vault, _amount, _delegateAmount); + } // Conditionally emit the observation recorded event if (_isObservationRecorded) { @@ -786,7 +792,9 @@ contract TwabController { ) = TwabLib.increaseBalances(PERIOD_LENGTH, PERIOD_OFFSET, _account, _amount, _delegateAmount); // Always emit the balance change event - emit IncreasedTotalSupply(_vault, _amount, _delegateAmount); + if (_amount != 0 || _delegateAmount != 0) { + emit IncreasedTotalSupply(_vault, _amount, _delegateAmount); + } // Conditionally emit the observation recorded event if (_isObservationRecorded) {