Skip to content

Commit

Permalink
refactor!: change fee distribution events
Browse files Browse the repository at this point in the history
  • Loading branch information
madlabman committed Jan 13, 2025
1 parent 846c0df commit 852d7e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/CSFeeDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contract CSFeeDistributor is
}

STETH.transferShares(ACCOUNTING, sharesToDistribute);
emit FeeDistributed(nodeOperatorId, sharesToDistribute);
emit OperatorFeeDistributed(nodeOperatorId, sharesToDistribute);
}

/// @inheritdoc ICSFeeDistributor
Expand Down Expand Up @@ -121,7 +121,7 @@ contract CSFeeDistributor is
);
}

emit LastDistributed(distributed);
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.
Expand Down
7 changes: 5 additions & 2 deletions src/interfaces/ICSFeeDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -21,7 +24,7 @@ interface ICSFeeDistributor is IAssetRecovererLib {
event DistributionLogUpdated(string logCid);

/// @dev It logs how many shares were distributed in the latest report
event LastDistributed(uint256 shares);
event ModuleFeeDistributed(uint256 shares);

error ZeroAccountingAddress();
error ZeroStEthAddress();
Expand Down
4 changes: 2 additions & 2 deletions test/CSFeeDistributor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -420,7 +420,7 @@ contract CSFeeDistributorTest is CSFeeDistributorTestBase {
);

vm.expectEmit(true, true, true, true, address(feeDistributor));
emit ICSFeeDistributor.LastDistributed(shares);
emit ICSFeeDistributor.ModuleFeeDistributed(shares);

vm.expectEmit(true, true, true, true, address(feeDistributor));
emit ICSFeeDistributor.DistributionLogUpdated(logCid);
Expand Down

0 comments on commit 852d7e0

Please sign in to comment.