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