1
1
// SPDX-License-Identifier: BUSL-1.1
2
2
pragma solidity ^ 0.8.27 ;
3
3
4
- import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol " ;
5
4
import {IAllocationManager} from
6
5
"eigenlayer-contracts/src/contracts/interfaces/IAllocationManager.sol " ;
7
6
8
7
interface ISlasherErrors {
9
- /// @notice Thrown when a caller without veto committee privileges attempts a restricted operation.
10
- error OnlyVetoCommittee ();
11
- /// @notice Thrown when a caller without slasher privileges attempts a restricted operation.
8
+ /// @notice Thrown when a caller without slasher privileges attempts a restricted operation
12
9
error OnlySlasher ();
13
- /// @notice Thrown when attempting to veto a slashing request after the veto period has expired.
14
- error VetoPeriodPassed ();
15
- /// @notice Thrown when attempting to execute a slashing request before the veto period has ended.
16
- error VetoPeriodNotPassed ();
17
- /// @notice Thrown when attempting to interact with a slashing request that has been cancelled.
18
- error SlashingRequestIsCancelled ();
19
- /// @notice Thrown when attempting to modify a slashing request that does not exist.
20
- error SlashingRequestNotRequested ();
21
10
}
22
11
23
12
interface ISlasherTypes {
24
- /**
25
- * @notice Represents the current status of a slashing request.
26
- * @dev The status of a slashing request can be one of the following:
27
- * - Null: Default state, no request exists.
28
- * - Requested: Slashing has been requested but not yet executed.
29
- * - Completed: Slashing has been successfully executed.
30
- * - Cancelled: Slashing request was cancelled by veto committee.
31
- */
32
- enum SlashingStatus {
33
- Null,
34
- Requested,
35
- Completed,
36
- Cancelled
37
- }
38
-
39
- /**
40
- * @notice Contains all information related to a slashing request.
41
- * @param params The slashing parameters from the allocation manager.
42
- * @param requestTimestamp The timestamp when the slashing request was created.
43
- * @param status The current status of the slashing request.
44
- */
13
+ /// @notice Structure containing details about a slashing request
45
14
struct SlashingRequest {
46
15
IAllocationManager.SlashingParams params;
47
16
uint256 requestTimestamp;
48
- SlashingStatus status;
49
17
}
50
18
}
51
19
52
20
interface ISlasherEvents is ISlasherTypes {
53
- /**
54
- * @notice Emitted when a new slashing request is created.
55
- * @param requestId The unique identifier for the slashing request (indexed).
56
- * @param operator The address of the operator to be slashed (indexed).
57
- * @param operatorSetId The ID of the operator set involved (indexed).
58
- * @param wadsToSlash The amounts to slash from each strategy.
59
- * @param description A human-readable description of the slashing reason.
60
- */
61
- event SlashingRequested (
62
- uint256 indexed requestId ,
63
- address indexed operator ,
64
- uint32 indexed operatorSetId ,
65
- uint256 [] wadsToSlash ,
66
- string description
67
- );
68
-
69
- /**
70
- * @notice Emitted when a slashing request is cancelled by the veto committee.
71
- * @param requestId The unique identifier of the cancelled request (indexed).
72
- */
73
- event SlashingRequestCancelled (uint256 indexed requestId );
74
-
75
- /**
76
- * @notice Emitted when an operator is successfully slashed.
77
- * @param slashingRequestId The ID of the executed slashing request (indexed).
78
- * @param operator The address of the slashed operator (indexed).
79
- * @param operatorSetId The ID of the operator set involved (indexed).
80
- * @param wadsToSlash The amounts slashed from each strategy.
81
- * @param description A human-readable description of why the operator was slashed.
82
- */
21
+ /// @notice Emitted when an operator is successfully slashed
83
22
event OperatorSlashed (
84
23
uint256 indexed slashingRequestId ,
85
24
address indexed operator ,
@@ -89,4 +28,9 @@ interface ISlasherEvents is ISlasherTypes {
89
28
);
90
29
}
91
30
92
- interface ISlasher is ISlasherErrors , ISlasherEvents {}
31
+ /// @title ISlasher
32
+ /// @notice Base interface containing shared functionality for all slasher implementations
33
+ interface ISlasher is ISlasherErrors , ISlasherEvents {
34
+ /// @notice Returns the address authorized to create and fulfill slashing requests
35
+ function slasher () external view returns (address );
36
+ }
0 commit comments