Skip to content

Commit

Permalink
Merge branch 'develop' into new-burner-role
Browse files Browse the repository at this point in the history
  • Loading branch information
dgusakov authored Jan 14, 2025
2 parents 0f7e17c + 9f812b3 commit d86352c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion 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,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();
Expand Down
8 changes: 7 additions & 1 deletion 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 @@ -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();
Expand Down
5 changes: 4 additions & 1 deletion 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 @@ -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);

Expand Down

0 comments on commit d86352c

Please sign in to comment.