File | Type | Proxy |
---|---|---|
AVSDirectory.sol |
Singleton | Transparent proxy |
The AVSDirectory
handles interactions between AVSs and the EigenLayer core contracts. Once registered as an Operator in EigenLayer core (via the DelegationManager
), Operators can register with one or more AVSs (via the AVS's contracts) to begin providing services to them offchain. As a part of registering with an AVS, the AVS will record this registration in the core contracts by calling into the AVSDirectory
.
For more information on AVS contracts, see the middleware repo.
Currently, the only interactions between AVSs and the core contracts is to track whether Operators are currently registered for the AVS. This is handled by two methods:
In a future release, this contract will implement additional interactions that relate to (i) rewarding Operators for the services they provide and (ii) slashing Operators that misbehave. Currently, these features are not implemented.
function registerOperatorToAVS(
address operator,
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
)
external
onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS)
Allows the caller (an AVS) to register an operator
with itself, given the provided signature is valid.
Effects:
- Sets the
operator's
status toREGISTERED
for the AVS
Requirements:
- Pause status MUST NOT be set:
PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS
operator
MUST already be a registered Operator (via theDelegationManager
)operator
MUST NOT already be registered with the AVSoperatorSignature
must be a valid, unused, unexpired signature from theoperator
. The signature is an ECDSA signature by the operator over theOPERATOR_AVS_REGISTRATION_TYPEHASH
. Expiry is a utc timestamp in seconds. Salt is used only once per signature to prevent replay attacks.
As of M2:
- Operator registration/deregistration does not have any sort of consequences for the Operator or its shares. Eventually, this will tie into rewards for services and slashing for misbehavior.
function deregisterOperatorFromAVS(
address operator
)
external
onlyWhenNotPaused(PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS)
Allows the caller (an AVS) to deregister an operator
with itself
Effects:
- Sets the
operator's
status toUNREGISTERED
for the AVS
Requirements:
- Pause status MUST NOT be set:
PAUSED_OPERATOR_REGISTER_DEREGISTER_TO_AVS
operator
MUST already be registered with the AVS
As of M2:
- Operator registration/deregistration does not have any sort of consequences for the Operator or its shares. Eventually, this will tie into rewards for services and slashing for misbehavior.
function cancelSalt(bytes32 salt) external
Allows the caller (an Operator) to cancel a signature salt before it is used to register for an AVS.
Effects:
- Sets
operatorSaltIsSpent[msg.sender][salt]
totrue
Requirements:
- Salt MUST NOT already be cancelled