While delegating to an operator is designed to be a simple process from the staker's perspective, a lot happens "under the hood".
In order to be delegated to, an operator must have first called DelegationManager.registerAsOperator
. If a staker tries to delegate to someone who has not previously registered as an operator, their transaction will fail.
When an operator registers in EigenLayer, the following flow of calls between contracts occurs:
- The would-be operator calls
DelegationManager.registerAsOperator
, providing either aDelegationTerms
-type contract or an EOA as input. The DelegationManager contract stores theDelegationTerms
-type contract provided by the operator, which may act as an intermediary to help facilitate the relationship between the operator and any stakers who delegate to them. All of the remaining steps (2-4) proceed as outlined in the delegation process below; the DelegationManager contract treats things as if the operator has delegated to themselves.
For a staker to delegate to an operator, the staker must either:
- Call
DelegationManager.delegateTo
directly OR - Supply an appropriate ECDSA signature, which can then be submitted by the operator (or a third party) as part of a call to
DelegationManager.delegateToBySignature
In either case, the end result is the same, and the flow of calls between contracts looks identical:
- As outlined above, either the staker themselves calls
DelegationManager.delegateTo
, or the operator (or a third party) callsDelegationManager.delegateToBySignature
, in which case the DelegationManager contract verifies the provided ECDSA signature - The DelegationManager contract calls
Slasher.isFrozen
to verify that the operator being delegated to is not frozen - The DelegationManager contract calls
StrategyManager.getDeposits
to get the full list of the staker (who is delegating)'s deposits. It then increases the delegated share amounts of operator (who is being delegated to) appropriately - The DelegationManager contract makes a call into the operator's stored
DelegationTerms
-type contract, calling theonDelegationReceived
function to inform it of the new delegation