diff --git a/src/CSFeeDistributor.sol b/src/CSFeeDistributor.sol index c9a1b28f..f6043d7b 100644 --- a/src/CSFeeDistributor.sol +++ b/src/CSFeeDistributor.sol @@ -82,7 +82,7 @@ contract CSFeeDistributor is } STETH.transferShares(ACCOUNTING, sharesToDistribute); - emit FeeDistributed(nodeOperatorId, sharesToDistribute); + emit OperatorFeeDistributed(nodeOperatorId, sharesToDistribute); } /// @inheritdoc ICSFeeDistributor @@ -121,6 +121,8 @@ contract CSFeeDistributor is ); } + emit ModuleFeeDistributed(distributed); + // NOTE: Make sure off-chain tooling provides a distinct CID of a log even for empty reports, e.g. by mixing // in a frame identifier such as reference slot to a file. if (bytes(_logCid).length == 0) revert InvalidLogCID(); diff --git a/src/interfaces/ICSFeeDistributor.sol b/src/interfaces/ICSFeeDistributor.sol index 438db952..928373af 100644 --- a/src/interfaces/ICSFeeDistributor.sol +++ b/src/interfaces/ICSFeeDistributor.sol @@ -8,7 +8,10 @@ pragma solidity 0.8.24; interface ICSFeeDistributor is IAssetRecovererLib { /// @dev Emitted when fees are distributed - event FeeDistributed(uint256 indexed nodeOperatorId, uint256 shares); + event OperatorFeeDistributed( + uint256 indexed nodeOperatorId, + uint256 shares + ); /// @dev Emitted when distribution data is updated event DistributionDataUpdated( @@ -20,6 +23,9 @@ interface ICSFeeDistributor is IAssetRecovererLib { /// @dev Emitted when distribution log is updated event DistributionLogUpdated(string logCid); + /// @dev It logs how many shares were distributed in the latest report + event ModuleFeeDistributed(uint256 shares); + error ZeroAccountingAddress(); error ZeroStEthAddress(); error ZeroAdminAddress(); diff --git a/test/CSFeeDistributor.t.sol b/test/CSFeeDistributor.t.sol index 79037a95..34ab111f 100644 --- a/test/CSFeeDistributor.t.sol +++ b/test/CSFeeDistributor.t.sol @@ -161,7 +161,7 @@ contract CSFeeDistributorTest is CSFeeDistributorTestBase { ); vm.expectEmit(true, true, true, true, address(feeDistributor)); - emit ICSFeeDistributor.FeeDistributed(nodeOperatorId, shares); + emit ICSFeeDistributor.OperatorFeeDistributed(nodeOperatorId, shares); vm.prank(address(accounting)); feeDistributor.distributeFees({ @@ -419,6 +419,9 @@ contract CSFeeDistributorTest is CSFeeDistributorTestBase { treeCid ); + vm.expectEmit(true, true, true, true, address(feeDistributor)); + emit ICSFeeDistributor.ModuleFeeDistributed(shares); + vm.expectEmit(true, true, true, true, address(feeDistributor)); emit ICSFeeDistributor.DistributionLogUpdated(logCid);