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.
11
12
12
13
}
13
14
15
+ struct OperatorSet {
16
+ address avs;
17
+ uint32 id;
18
+ }
19
+
20
+ struct StandbyParam {
21
+ OperatorSet operatorSet;
22
+ bool onStandby;
23
+ }
24
+
14
25
/**
15
- * @notice Emitted when @param avs indicates that they are updating their MetadataURI string
16
- * @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.
17
29
*/
18
- event AVSMetadataURIUpdated (address indexed avs , string metadataURI );
19
-
20
- /// @notice Emitted when an operator's registration status for an AVS is updated
21
30
event OperatorAVSRegistrationStatusUpdated (
22
31
address indexed operator , address indexed avs , OperatorAVSRegistrationStatus status
23
32
);
24
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.
42
+ event AVSMetadataURIUpdated (address indexed avs , string metadataURI );
43
+
44
+ /// @notice Emitted when an operator updates their standby parameters.
45
+ event StandbyParamUpdated (address operator , OperatorSet operatorSet , bool onStandby );
46
+
25
47
/**
26
- * @notice Called by an avs to register an operator with the avs.
27
- * @param operator The address of the operator to register.
28
- * @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.
29
70
*/
30
71
function registerOperatorToAVS (
31
72
address operator ,
32
73
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
33
74
) external ;
34
75
35
76
/**
36
- * @notice Called by an avs to deregister an operator with the avs.
37
- * @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.
38
82
*/
39
83
function deregisterOperatorFromAVS (address operator ) external ;
40
84
41
85
/**
42
- * @notice Called by an AVS to emit an `AVSMetadataURIUpdated` event indicating the information has updated.
43
- * @param metadataURI The URI for metadata associated with an AVS
44
- * @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.
45
125
*/
46
126
function updateAVSMetadataURI (string calldata metadataURI ) external ;
47
127
48
128
/**
49
- * @notice Returns whether or not the salt has already been used by the operator.
50
- * @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.
51
132
*/
52
133
function operatorSaltIsSpent (address operator , bytes32 salt ) external view returns (bool );
53
134
54
135
/**
55
- * @notice Calculates the digest hash to be signed by an operator to register with an AVS
56
- * @param operator The account registering as an operator
57
- * @param avs The AVS the operator is registering to
58
- * @param salt A unique and single use value associated with the approver signature.
59
- * @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.
60
142
*/
61
143
function calculateOperatorAVSRegistrationDigestHash (
62
144
address operator ,
@@ -65,6 +147,24 @@ interface IAVSDirectory is ISignatureUtils {
65
147
uint256 expiry
66
148
) external view returns (bytes32 );
67
149
68
- /// @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.
69
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 );
70
170
}
0 commit comments