2
2
pragma solidity >= 0.5.0 ;
3
3
4
4
import "./ISignatureUtils.sol " ;
5
+ import "./IStrategy.sol " ;
5
6
6
7
interface IAVSDirectory is ISignatureUtils {
7
- /// @notice Enum representing the status of an operator's registration with an AVS
8
+ /// @notice Enum representing the registration status of an operator with an AVS.
8
9
enum OperatorAVSRegistrationStatus {
9
- UNREGISTERED, // Operator not registered to AVS
10
- REGISTERED // Operator registered to AVS
10
+ UNREGISTERED, // Operator is not registered with the AVS.
11
+ REGISTERED // Operator is registered with the AVS.
12
+
13
+ }
14
+
15
+ struct OperatorSet {
16
+ address avs;
17
+ uint32 id;
18
+ }
19
+
20
+ struct StandbyParam {
21
+ OperatorSet operatorSet;
22
+ bool onStandby;
11
23
}
12
24
13
25
/**
14
- * @notice Emitted when @param avs indicates that they are updating their MetadataURI string
15
- * @dev Note that these strings are *never stored in storage* and are instead purely emitted in events for off-chain indexing
26
+ * @notice Emitted when an operator's registration status with an AVS is updated.
27
+ * Specifically, when an operator enters its first operator set for an AVS, or
28
+ * when it is removed from the last operator set.
16
29
*/
30
+ event OperatorAVSRegistrationStatusUpdated (
31
+ address indexed operator , address indexed avs , OperatorAVSRegistrationStatus status
32
+ );
33
+
34
+ /// @notice Emitted when an operator is added to an operator set.
35
+ event OperatorAddedToOperatorSet (address operator , OperatorSet operatorSet );
36
+
37
+ /// @notice Emitted when an operator is removed from an operator set.
38
+ event OperatorRemovedFromOperatorSet (address operator , OperatorSet operatorSet );
39
+
40
+ /// @notice Emitted when an AVS updates their metadata URI (Uniform Resource Identifier).
41
+ /// @dev The URI is never stored; it is simply emitted through an event for off-chain indexing.
17
42
event AVSMetadataURIUpdated (address indexed avs , string metadataURI );
18
43
19
- /// @notice Emitted when an operator's registration status for an AVS is updated
20
- event OperatorAVSRegistrationStatusUpdated (address indexed operator , address indexed avs , OperatorAVSRegistrationStatus status );
44
+ /// @notice Emitted when an operator updates their standby parameters.
45
+ event StandbyParamUpdated (address operator , OperatorSet operatorSet , bool onStandby );
21
46
22
47
/**
23
- * @notice Called by an avs to register an operator with the avs.
24
- * @param operator The address of the operator to register.
25
- * @param operatorSignature The signature, salt, and expiry of the operator's signature.
48
+ * @notice Updates the standby parameters for an operator across multiple operator sets.
49
+ * Allows the AVS to add the operator to a given operator set if they are not already registered.
50
+ *
51
+ * @param operator The address of the operator for which the standby parameters are being updated.
52
+ * @param standbyParams The new standby parameters for the operator.
53
+ * @param signature If non-empty, the signature of the operator authorizing the modification.
54
+ * If empty, the `msg.sender` must be the operator.
55
+ */
56
+ function updateStandbyParams (
57
+ address operator ,
58
+ StandbyParam[] calldata standbyParams ,
59
+ SignatureWithSaltAndExpiry calldata signature
60
+ ) external ;
61
+
62
+ /**
63
+ * @notice Called by the AVS's service manager contract to register an operator with the AVS.
64
+ *
65
+ * @param operator The address of the operator to register.
66
+ * @param operatorSignature The signature, salt, and expiry of the operator's signature.
67
+ *
68
+ * @dev msg.sender must be the AVS.
69
+ * @dev Only used by legacy M2 AVSs that have not integrated with operator sets.
26
70
*/
27
71
function registerOperatorToAVS (
28
72
address operator ,
29
73
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
30
74
) external ;
31
75
32
76
/**
33
- * @notice Called by an avs to deregister an operator with the avs.
34
- * @param operator The address of the operator to deregister.
77
+ * @notice Called by an AVS to deregister an operator from the AVS.
78
+ *
79
+ * @param operator The address of the operator to deregister.
80
+ *
81
+ * @dev Only used by legacy M2 AVSs that have not integrated with operator sets.
35
82
*/
36
83
function deregisterOperatorFromAVS (address operator ) external ;
37
84
38
85
/**
39
- * @notice Called by an AVS to emit an `AVSMetadataURIUpdated` event indicating the information has updated.
40
- * @param metadataURI The URI for metadata associated with an AVS
41
- * @dev Note that the `metadataURI` is *never stored * and is only emitted in the `AVSMetadataURIUpdated` event
86
+ * @notice Called by AVSs to add an operator to an operator set.
87
+ *
88
+ * @param operator The address of the operator to be added to the operator set.
89
+ * @param operatorSetIds The IDs of the operator sets.
90
+ * @param signature The signature of the operator on their intent to register.
91
+ *
92
+ * @dev msg.sender is used as the AVS.
93
+ * @dev The operator must not have a pending deregistration from the operator set.
94
+ * @dev If this is the first operator set in the AVS that the operator is
95
+ * registering for, a OperatorAVSRegistrationStatusUpdated event is emitted with
96
+ * a REGISTERED status.
97
+ */
98
+ function registerOperatorToOperatorSets (
99
+ address operator ,
100
+ uint32 [] calldata operatorSetIds ,
101
+ ISignatureUtils.SignatureWithSaltAndExpiry memory signature
102
+ ) external ;
103
+
104
+ /**
105
+ * @notice Called by AVSs or operators to remove an operator from an operator set.
106
+ *
107
+ * @param operator The address of the operator to be removed from the operator set.
108
+ * @param operatorSetIds The IDs of the operator sets.
109
+ *
110
+ * @dev msg.sender is used as the AVS.
111
+ * @dev The operator must be registered for the msg.sender AVS and the given operator set.
112
+ * @dev If this removes the operator from all operator sets for the msg.sender AVS,
113
+ * then an OperatorAVSRegistrationStatusUpdated event is emitted with a DEREGISTERED status.
114
+ */
115
+ function deregisterOperatorFromOperatorSets (address operator , uint32 [] calldata operatorSetIds ) external ;
116
+
117
+ // VIEW
118
+
119
+ /**
120
+ * @notice Called by an AVS to emit an `AVSMetadataURIUpdated` event indicating the information has updated.
121
+ *
122
+ * @param metadataURI The URI for metadata associated with an AVS.
123
+ *
124
+ * @dev Note that the `metadataURI` is *never stored* and is only emitted in the `AVSMetadataURIUpdated` event.
42
125
*/
43
126
function updateAVSMetadataURI (string calldata metadataURI ) external ;
44
127
45
128
/**
46
- * @notice Returns whether or not the salt has already been used by the operator.
47
- * @dev Salts is used in the `registerOperatorToAVS` function.
129
+ * @notice Returns whether the salt has already been used by the operator or not.
130
+ *
131
+ * @dev The salt is used in the `registerOperatorToAVS` function.
48
132
*/
49
133
function operatorSaltIsSpent (address operator , bytes32 salt ) external view returns (bool );
50
134
51
135
/**
52
- * @notice Calculates the digest hash to be signed by an operator to register with an AVS
53
- * @param operator The account registering as an operator
54
- * @param avs The AVS the operator is registering to
55
- * @param salt A unique and single use value associated with the approver signature.
56
- * @param expiry Time after which the approver's signature becomes invalid
136
+ * @notice Calculates the digest hash to be signed by an operator to register with an AVS.
137
+ *
138
+ * @param operator The account registering as an operator.
139
+ * @param avs The AVS the operator is registering with.
140
+ * @param salt A unique and single-use value associated with the approver's signature.
141
+ * @param expiry The time after which the approver's signature becomes invalid.
57
142
*/
58
143
function calculateOperatorAVSRegistrationDigestHash (
59
144
address operator ,
@@ -62,6 +147,24 @@ interface IAVSDirectory is ISignatureUtils {
62
147
uint256 expiry
63
148
) external view returns (bytes32 );
64
149
65
- /// @notice The EIP-712 typehash for the Registration struct used by the contract
150
+ /**
151
+ * @notice Calculates the digest hash to be signed by an operator to register with an operator set.
152
+ *
153
+ * @param avs The AVS that operator is registering to operator sets for.
154
+ * @param operatorSetIds An array of operator set IDs the operator is registering to.
155
+ * @param salt A unique and single use value associated with the approver signature.
156
+ * @param expiry Time after which the approver's signature becomes invalid.
157
+ */
158
+ function calculateOperatorSetRegistrationDigestHash (
159
+ address avs ,
160
+ uint32 [] memory operatorSetIds ,
161
+ bytes32 salt ,
162
+ uint256 expiry
163
+ ) external view returns (bytes32 );
164
+
165
+ /// @notice The EIP-712 typehash for the Registration struct used by the contract.
66
166
function OPERATOR_AVS_REGISTRATION_TYPEHASH () external view returns (bytes32 );
167
+
168
+ /// @notice The EIP-712 typehash for the OperatorSetRegistration struct used by the contract.
169
+ function OPERATOR_SET_REGISTRATION_TYPEHASH () external view returns (bytes32 );
67
170
}
0 commit comments