| File | Type | Proxy |
|---|---|---|
ServiceManagerBase.sol |
Singleton | Transparent proxy |
Libraries and Mixins:
| File | Notes |
|---|---|
BitmapUtils.sol |
bitmap manipulation |
LibMergeSort.sol |
sorting utilities |
The ServiceManagerBase contract is an abstract contract that serves as a minimal implementation for a ServiceManager contract that AVSs will deploy. This document will view this contract through the lens of an implementation of the ServiceManagerBase. AVSs are encouraged to extend this contract to meet their own functionality, such as implementing allowlisting for operator sets.
The ServiceManager is the AVS's identity within EigenLayer and is responsible for:
- Manages callbacks from the
SlashingRegsitryCoordinatorfor operator registration for the AVS and operator sets. Calls will be forwarded to theAVSDirectory - Handling rewards submissions to EigenLayer's
RewardsCoordinator - Managing access permissions via the
PermissionController
The ServiceManagerBase implements User Access Management (UAM) as defined in ELIP-003, allowing fine-grained control over which addresses can perform various actions on behalf of the AVS. UAM functions are primarily used by the contract owner to delegate permissions. For further information on the suggested UAM patterns, refer to the AVS quick start guide.
Methods:
function addPendingAdmin(
address admin
) external onlyOwnerThis function allows the contract owner to add a pending admin for the AVS. The new admin must accept adminhood via the PermissionController contract to become active.
Effects:
- Calls
addPendingAdminon thePermissionControllercontract to setadminas a pending admin for this AVS
Requirements:
- Caller MUST be the owner of the contract
function removePendingAdmin(
address pendingAdmin
) external onlyOwnerThis function allows the contract owner to remove an address from the list of pending admins.
Effects:
- Calls
removePendingAdminon thePermissionControllercontract to removependingAdminfrom the list of pending admins
Requirements:
- Caller MUST be the owner of the contract
function removeAdmin(
address admin
) external onlyOwnerThis function allows the contract owner to remove an admin from the AVS.
Effects:
- Calls
removeAdminon thePermissionControllercontract to removeadminfrom the list of admins
Requirements:
- Caller MUST be the owner of the contract
- There MUST be at least one admin remaining after removal
function setAppointee(
address appointee,
address target,`
bytes4 selector
) external onlyOwnerThis function allows the contract owner to delegate specific function permissions to an appointee.
Effects:
- Calls
setAppointeeon thePermissionControllercontract to grantappointeepermission to call the function identified bytargetandselector
Requirements:
- Caller MUST be the owner of the contract
function removeAppointee(
address appointee,
address target,
bytes4 selector
) external onlyOwnerThis function allows the contract owner to revoke delegated permissions from an appointee.
Effects:
- Calls
removeAppointeeon thePermissionControllercontract to revokeappointee's permission to call the function identified bytargetandselector
Requirements:
- Caller MUST be the owner of the contract
The ServiceManagerBase propagates state updates to the AVSDirectory (for backward compatibility).
Methods:
function registerOperatorToAVS(
address operator,
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
)
public
virtual
onlyRegistryCoordinatorThis function is called by the SlashingRegistryCoordinator when an operator registers for the AVS. It forwards the call to the EigenLayer core AVSDirectory.
Effects:
- Forwards the call to
AVSDirectory.registerOperatorToAVSwith the operator's address and signature
Requirements:
- Caller MUST be the
SlashingRegistryCoordinator
function deregisterOperatorFromAVS(
address operator
)
public
virtual
onlyRegistryCoordinatorThis function is called by the SlashingRegistryCoordinator when an operator deregisters from the AVS. It forwards the call to the EigenLayer core AVSDirectory contract to maintain backward compatibility.
Effects:
- Forwards the call to
AVSDirectory.deregisterOperatorFromAVSwith the operator's address
Requirements:
- Caller MUST be the
SlashingRegistryCoordinator
function deregisterOperatorFromOperatorSets(
address operator,
uint32[] memory operatorSetIds
)
public
virtual
onlyRegistryCoordinatorThis function is called by the SlashingRegistryCoordinator to deregister an operator from specific operator.
Effects:
- Creates a
DeregisterParamsstruct with the operator's address, the AVS address, and the operator set IDs - Calls
AllocationManager.deregisterFromOperatorSetswith the constructed parameters
Requirements:
- Caller MUST be the
SlashingRegistryCoordinator
The ServiceManagerBase allows the AVS to submit rewards to EigenLayer's RewardsCoordinator contract.
Methods:
createAVSRewardsSubmissioncreateOperatorDirectedAVSRewardsSubmissionsetClaimerForsetRewardsInitiator
function createAVSRewardsSubmission(
IRewardsCoordinator.RewardsSubmission[] calldata rewardsSubmissions
)
public
virtual
onlyRewardsInitiatorThis function allows the rewards initiator to create rewards submissions for the AVS. This submission will send rewards to all eligible operators according to stake weight.
Effects:
- For each
RewardsSubmission:- Transfers tokens from caller to the ServiceManager
- Approves the
RewardsCoordinatorto spend these tokens
- Calls
RewardsCoordinator.createAVSRewardsSubmissionwith the provided submissions
Requirements:
- Caller MUST be the designated rewards initiator
- Token transfers and approvals MUST succeed
function createOperatorDirectedAVSRewardsSubmission(
IRewardsCoordinator.OperatorDirectedRewardsSubmission[] calldata
operatorDirectedRewardsSubmissions
)
public
virtual
onlyRewardsInitiatorThis function allows the rewards initiator to create operator-directed rewards submissions, which provide more control over how rewards are distributed to specific operators.
Effects:
- For each
OperatorDirectedRewardsSubmission:- Calculates the total token amount across all operator rewards
- Transfers tokens from caller to the ServiceManager
- Approves the
RewardsCoordinatorto spend these tokens
- Calls
RewardsCoordinator.createOperatorDirectedAVSRewardsSubmissionwith the provided submissions
Requirements:
- Caller MUST be the designated rewards initiator
- Token transfers and approvals MUST succeed
function setClaimerFor(
address claimer
)
public
virtual
onlyOwnerThis function allows the owner to set an address that can claim rewards on behalf of the AVS.
Effects:
- Calls
RewardsCoordinator.setClaimerForto set the claimer address
Requirements:
- Caller MUST be the owner
function setRewardsInitiator(
address newRewardsInitiator
)
external
onlyOwnerThis function allows the owner to update the address that is permitted to submit rewards submissions on behalf of the AVS.
Effects:
- Updates the
rewardsInitiatorstorage variable - Emits a
RewardsInitiatorUpdatedevent
Requirements:
- Caller MUST be the owner
Methods:
function updateAVSMetadataURI(
string memory _metadataURI
)
public
virtual
onlyOwnerThis function allows the owner to update the metadata URI associated with the AVS.
Effects:
- Calls
AVSDirectory.updateAVSMetadataURIwith the provided URI
Requirements:
- Caller MUST be the owner
Methods:
function getRestakeableStrategies()
external
view
virtual
returns (address[] memory)This function returns a list of strategy addresses that the AVS supports for restaking. This is intended to be called off-chain by the rewards calculation system.
Returns:
- An array of strategy addresses that the AVS supports for restaking across all quorums
function getOperatorRestakedStrategies(
address operator
)
external
view
virtual
returns (address[] memory)This function returns a list of strategy addresses that a specific operator has potentially restaked with the AVS. This is intended to be called off-chain by the rewards calculation system.
Returns:
- An array of strategy addresses that the operator has potentially restaked with the AVS across all quorums they are registered for
function avsDirectory()
external
view
override
returns (address)This function returns the address of the EigenLayer AVSDirectory contract.
Returns:
- The address of the EigenLayer AVSDirectory contract