Skip to content

Commit 4ecc5f8

Browse files
committed
refactor: return slashId for instant slasher
1 parent f490b03 commit 4ecc5f8

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/interfaces/IInstantSlasher.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ interface IInstantSlasher is ISlasher {
1212
/// @notice Immediately executes a slashing request
1313
/// @param params Parameters defining the slashing request including operator and amount
1414
/// @dev Can only be called by the authorized slasher
15+
/// @return slashId The ID of the slashing request
1516
function fulfillSlashingRequest(
1617
IAllocationManager.SlashingParams memory params
17-
) external;
18+
) external returns (uint256 slashId);
1819

1920
/// @notice Immediately executes a slashing request and burns or redistributes shares
2021
/// @param params Parameters defining the slashing request including operator and amount
2122
/// @dev Can only be called by the authorized slasher
23+
/// @return slashId The ID of the slashing request
2224
function fulfillSlashingRequestAndBurnOrRedistribute(
2325
IAllocationManager.SlashingParams memory params
24-
) external;
26+
) external returns (uint256 slashId);
2527
}

src/slashers/InstantSlasher.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ contract InstantSlasher is IInstantSlasher, SlasherBase {
2323
/// @inheritdoc IInstantSlasher
2424
function fulfillSlashingRequest(
2525
IAllocationManager.SlashingParams calldata params
26-
) external virtual override(IInstantSlasher) onlySlasher {
27-
_fulfillSlashingRequest(params);
26+
) external virtual override(IInstantSlasher) onlySlasher returns (uint256 slashId) {
27+
slashId = _fulfillSlashingRequest(params);
2828
}
2929

3030
/// @inheritdoc IInstantSlasher
3131
function fulfillSlashingRequestAndBurnOrRedistribute(
3232
IAllocationManager.SlashingParams calldata params
33-
) external virtual override onlySlasher {
34-
_fulfillSlashingRequestAndBurnOrRedistribute(params);
33+
) external virtual override onlySlasher returns (uint256 slashId) {
34+
slashId = _fulfillSlashingRequestAndBurnOrRedistribute(params);
3535
}
3636
}

0 commit comments

Comments
 (0)