Skip to main content

OperatorManager

Git Source

OperatorManager

Manages operator registration and validation for the protocol

Inherits from NetworkStorage, SlashingWindowStorage, and CaptureTimestampManager

Methods

_getOperatorManagerStorage

function _getOperatorManagerStorage() internal pure returns (OperatorManagerStorage storage $) 

Gets the storage pointer for OperatorManager state

Returns

NameTypeDescription
$OperatorManagerStorage storage$ Storage pointer to OperatorManagerStorage struct

__OperatorManager_init_private

function __OperatorManager_init_private(
address operatorRegistry,
address operatorNetOptin
) internal onlyInitializing

Initializes the OperatorManager with required parameters

Parameters

NameTypeDescription
operatorRegistryaddressThe address of the operator registry contract
operatorNetOptinaddressThe address of the operator network opt-in service

_OPERATOR_REGISTRY

function _OPERATOR_REGISTRY() internal view returns (address) 

Gets the address of the operator registry contract

Returns

NameTypeDescription
addressThe operator registry contract address

_OPERATOR_NET_OPTIN

function _OPERATOR_NET_OPTIN() internal view returns (address) 

Gets the address of the operator network opt-in service contract

Returns

NameTypeDescription
addressThe operator network opt-in service contract address

_operatorsLength

function _operatorsLength() internal view returns (uint256) 

Returns the total number of registered operators, including both active and inactive

Returns

NameTypeDescription
uint256The number of registered operators

_operatorWithTimesAt

function _operatorWithTimesAt(
uint256 pos
) internal view returns (address, uint48, uint48)

Returns the operator and their associated enabled and disabled times at a specific position

Parameters

NameTypeDescription
posuint256The index position in the operators array

Returns

NameTypeDescription
addressThe operator address
uint48The enabled timestamp
uint48The disabled timestamp

_activeOperators

function _activeOperators() internal view returns (address[] memory) 

Returns a list of active operators

Returns

NameTypeDescription
memoryaddress[]Array of addresses representing the active operators

_activeOperatorsAt

function _activeOperatorsAt(
uint48 timestamp
) internal view returns (address[] memory)

Returns a list of active operators at a specific timestamp

Parameters

NameTypeDescription
timestampuint48The timestamp to check

Returns

NameTypeDescription
memoryaddress[]Array of addresses representing the active operators at the timestamp

_operatorWasActiveAt

function _operatorWasActiveAt(uint48 timestamp, address operator) internal view returns (bool) 

Checks if a given operator was active at a specified timestamp

Parameters

NameTypeDescription
timestampuint48The timestamp to check
operatoraddressThe operator address to check

Returns

NameTypeDescription
boolTrue if the operator was active at the timestamp, false otherwise

_isOperatorRegistered

function _isOperatorRegistered(
address operator
) internal view returns (bool)

Checks if an operator is registered

Parameters

NameTypeDescription
operatoraddressThe address of the operator to check

Returns

NameTypeDescription
boolTrue if the operator is registered, false otherwise

_registerOperator

function _registerOperator(
address operator
) internal

Registers a new operator

Parameters

NameTypeDescription
operatoraddressThe address of the operator to register

_pauseOperator

function _pauseOperator(
address operator
) internal

Pauses a registered operator

Parameters

NameTypeDescription
operatoraddressThe address of the operator to pause

_unpauseOperator

function _unpauseOperator(
address operator
) internal

Unpauses a paused operator

Parameters

NameTypeDescription
operatoraddressThe address of the operator to unpause

_unregisterOperator

function _unregisterOperator(
address operator
) internal

Unregisters an operator

Parameters

NameTypeDescription
operatoraddressThe address of the operator to unregister