IRioLRTOperatorRegistry

Git Source

Functions

initialize

Initializes the contract.

function initialize(address initialOwner, address token) external;

Parameters

Name
Type
Description

initialOwner

address

The initial owner of the contract.

token

address

The address of the liquid restaking token.

getOperatorDetails

Returns the operator details for the provided operator ID.

function getOperatorDetails(uint8 operatorId) external view returns (OperatorPublicDetails memory);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

getOperatorShareDetails

Returns the operator share cap and allocation for the provided operator ID and strategy.

function getOperatorShareDetails(uint8 operatorId, address strategy)
    external
    view
    returns (OperatorShareDetails memory);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

strategy

address

The strategy to get the share details for.

operatorCount

Returns the total number of operators in the registry.

function operatorCount() external view returns (uint8);

activeOperatorCount

Returns the total number of active operators in the registry.

function activeOperatorCount() external view returns (uint8);

minStakerOptOutBlocks

The minimum acceptable delay between an operator signaling intent to register

function minStakerOptOutBlocks() external view returns (uint24);

validatorKeyReviewPeriod

The amount of time (in seconds) before uploaded validator keys are considered "vetted".

function validatorKeyReviewPeriod() external view returns (uint24);

addOperator

Adds a new operator to the registry, deploying a delegator contract and delegating to the provided operator address.

function addOperator(OperatorConfig calldata config) external returns (uint8 operatorId, address delegator);

Parameters

Name
Type
Description

config

OperatorConfig

The new operator's configuration.

activateOperator

Activates an operator.

function activateOperator(uint8 operatorId) external;

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

deactivateOperator

Deactivates an operator, exiting all remaining stake to the deposit pool.

function deactivateOperator(uint8 operatorId) external;

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

addValidatorDetails

Adds pending validator details (public keys and signatures) to storage for the provided operator. Each added batch extends the timestamp at which the details will be considered confirmed.

function addValidatorDetails(
    uint8 operatorId,
    uint256 validatorCount,
    bytes calldata publicKeys,
    bytes calldata signatures
) external;

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

validatorCount

uint256

The number of validators in the batch.

publicKeys

bytes

The validator public keys.

signatures

bytes

The validator signatures.

removeValidatorDetails

Removes pending validator details (public keys and signatures) from storage for the provided operator.

function removeValidatorDetails(uint8 operatorId, uint256 fromIndex, uint256 validatorCount) external;

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

fromIndex

uint256

The index of the first validator to remove.

validatorCount

uint256

The number of validator to remove.

reportOutOfOrderValidatorExits

Reports validator exits that occur prior to instruction by the protocol.

function reportOutOfOrderValidatorExits(uint8 operatorId, uint256 fromIndex, uint256 validatorCount) external;

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

fromIndex

uint256

The index of the first validator to report.

validatorCount

uint256

The number of validators to report.

allocateStrategyShares

Allocates a specified amount of shares for the provided strategy to the operators with the lowest utilization.

function allocateStrategyShares(address strategy, uint256 sharesToAllocate)
    external
    returns (uint256 sharesAllocated, OperatorStrategyAllocation[] memory allocations);

Parameters

Name
Type
Description

strategy

address

The strategy to allocate the shares to.

sharesToAllocate

uint256

The amount of shares to allocate.

allocateETHDeposits

Allocates a specified amount of ETH deposits to the operators with the lowest utilization.

function allocateETHDeposits(uint256 depositsToAllocate)
    external
    returns (uint256 depositsAllocated, OperatorETHAllocation[] memory allocations);

Parameters

Name
Type
Description

depositsToAllocate

uint256

The amount of deposits to allocate (32 ETH each)

deallocateStrategyShares

Deallocates a specified amount of shares for the provided strategy from the operators with the highest utilization.

function deallocateStrategyShares(address strategy, uint256 sharesToDeallocate)
    external
    returns (uint256 sharesDeallocated, OperatorStrategyDeallocation[] memory deallocations);

Parameters

Name
Type
Description

strategy

address

The strategy to deallocate the shares from.

sharesToDeallocate

uint256

The amount of shares to deallocate.

deallocateETHDeposits

Deallocates a specified amount of ETH deposits from the operators with the highest utilization.

function deallocateETHDeposits(uint256 depositsToDeallocate)
    external
    returns (uint256 depositsDeallocated, OperatorETHDeallocation[] memory deallocations);

Parameters

Name
Type
Description

depositsToDeallocate

uint256

The amount of deposits to deallocate (32 ETH each)

Events

OperatorAdded

Emitted when a new operator is added to the registry.

event OperatorAdded(
    uint8 indexed operatorId,
    address indexed operator,
    address indexed delegator,
    address initialManager,
    address initialEarningsReceiver,
    string initialMetadataURI
);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

operator

address

The operator's contract address.

delegator

address

The operator's delegator contract address.

initialManager

address

The initial manager of the operator.

initialEarningsReceiver

address

The initial reward address of the operator.

initialMetadataURI

string

The initial metadata URI of the operator.

OperatorActivated

Emitted when an operator is activated.

event OperatorActivated(uint8 indexed operatorId);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

OperatorDeactivated

Emitted when an operator is deactivated.

event OperatorDeactivated(uint8 indexed operatorId);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

OperatorStrategyShareCapSet

Emitted when an operator's strategy share allocation cap is set.

event OperatorStrategyShareCapSet(uint8 indexed operatorId, address strategy, uint128 cap);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

strategy

address

The strategy whose cap was set.

cap

uint128

The new strategy share cap for the operator.

OperatorValidatorCapSet

Emitted when an operator's validator cap is set.

event OperatorValidatorCapSet(uint8 indexed operatorId, uint40 cap);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

cap

uint40

The new maximum active validator cap.

SecurityDaemonSet

Emitted when the security daemon is set.

event SecurityDaemonSet(address securityDaemon);

Parameters

Name
Type
Description

securityDaemon

address

The new security daemon.

ProofUploaderSet

Emitted when the proof uploader is set.

event ProofUploaderSet(address proofUploader);

Parameters

Name
Type
Description

proofUploader

address

The new proof uploader.

MinStakerOptOutBlocksSet

Emitted when the min staker opt out blocks is set.

event MinStakerOptOutBlocksSet(uint24 minStakerOptOutBlocks);

ValidatorKeyReviewPeriodSet

Emitted when the validator key review period is set.

event ValidatorKeyReviewPeriodSet(uint24 validatorKeyReviewPeriod);

Parameters

Name
Type
Description

validatorKeyReviewPeriod

uint24

The new validator key review period.

OperatorStrategyExitQueued

Emitted when a strategy exit is queued for an operator.

event OperatorStrategyExitQueued(
    uint8 indexed operatorId, address strategy, uint256 sharesToExit, bytes32 withdrawalRoot
);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

strategy

address

The strategy to exit.

sharesToExit

uint256

The number of shares to exit.

withdrawalRoot

bytes32

The withdrawal root for the exit.

OperatorEarningsReceiverSet

Emitted when an operator's earnings receiver is set.

event OperatorEarningsReceiverSet(uint8 indexed operatorId, address earningsReceiver);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

earningsReceiver

address

The new earnings receiver for the operator.

OperatorPendingManagerSet

Emitted when an operator's pending manager is set.

event OperatorPendingManagerSet(uint8 indexed operatorId, address pendingManager);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

pendingManager

address

The new pending manager of the operator.

OperatorManagerSet

Emitted when an operator's manager is set.

event OperatorManagerSet(uint8 indexed operatorId, address manager);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

manager

address

The new manager of the operator.

OperatorWithdrawalCredentialsVerified

Emitted following the verification of withdrawal credentials for one or more validators.

event OperatorWithdrawalCredentialsVerified(
    uint8 indexed operatorId, uint64 oracleTimestamp, uint40[] validatorIndices
);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

oracleTimestamp

uint64

The Beacon Chain timestamp whose state root the proof will be proven against.

validatorIndices

uint40[]

The list of indices of the validators being proven, refer to consensus specs.

OperatorPendingValidatorDetailsAdded

Emitted when an operator uploads a new set of validator details (public keys and signatures).

event OperatorPendingValidatorDetailsAdded(uint8 indexed operatorId, uint256 validatorCount);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

validatorCount

uint256

The number of validator details that were added.

OperatorValidatorDetailsRemoved

Emitted when an operator removes pending or confirmed validator details (public keys and signatures).

event OperatorValidatorDetailsRemoved(uint8 indexed operatorId, uint256 validatorCount);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

validatorCount

uint256

The number of validator details that were removed.

OperatorOutOfOrderValidatorExitsReported

Emitted when out of order validator exits are reported.

event OperatorOutOfOrderValidatorExitsReported(uint8 indexed operatorId, uint256 validatorCount);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

validatorCount

uint256

The number of validators that were exited out of order.

StrategySharesSynced

Emitted when the number of shares allocated to an operator has been synced.

event StrategySharesSynced(uint8 indexed operatorId, address strategy, uint256 oldShares, uint256 newShares);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

strategy

address

The strategy that the shares were synced for.

oldShares

uint256

The previous number of shares allocated to the operator.

newShares

uint256

The new number of shares allocated to the operator.

StrategySharesAllocated

Emitted when strategy shares have been allocated to an operator.

event StrategySharesAllocated(
    uint8 indexed operatorId, address indexed strategy, uint256 sharesAllocated, uint256 tokensAllocated
);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

strategy

address

The strategy that the shares were allocated to.

sharesAllocated

uint256

The amount of shares allocated.

tokensAllocated

uint256

The token value of the allocated shares.

ETHDepositsAllocated

Emitted when ETH deposits have been allocated to an operator.

event ETHDepositsAllocated(uint8 indexed operatorId, uint256 depositsAllocated, bytes pubKeyBatch);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

depositsAllocated

uint256

The amount of deposits allocated.

pubKeyBatch

bytes

The public keys of the validators that were allocated to.

StrategySharesDeallocated

Emitted when strategy shares have been deallocated from an operator.

event StrategySharesDeallocated(
    uint8 indexed operatorId, address indexed strategy, uint256 sharesDeallocated, uint256 tokensDeallocated
);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

strategy

address

The strategy that the shares were deallocated from.

sharesDeallocated

uint256

The amount of shares deallocated.

tokensDeallocated

uint256

The token value of the deallocated shares.

ETHDepositsDeallocated

Emitted when ETH deposits have been deallocated from an operator.

event ETHDepositsDeallocated(uint8 indexed operatorId, uint256 depositsDeallocated, bytes pubKeyBatch);

Parameters

Name
Type
Description

operatorId

uint8

The operator's ID.

depositsDeallocated

uint256

The amount of deposits deallocated.

pubKeyBatch

bytes

The public keys of the validators that must be exited.

Errors

ONLY_OPERATOR_MANAGER

Thrown when the caller is not the operator's manager.

error ONLY_OPERATOR_MANAGER();

ONLY_OPERATOR_MANAGER_OR_SECURITY_DAEMON

Thrown when the caller is not the operator's manager OR the security daemon.

error ONLY_OPERATOR_MANAGER_OR_SECURITY_DAEMON();

ONLY_OPERATOR_MANAGER_OR_PROOF_UPLOADER

Thrown when the caller is not the operator's manager OR the proof uploader.

error ONLY_OPERATOR_MANAGER_OR_PROOF_UPLOADER();

ONLY_OPERATOR_PENDING_MANAGER

Thrown when the caller is not the operator's pending manager.

error ONLY_OPERATOR_PENDING_MANAGER();

INVALID_OPERATOR

Thrown when the operator is address(0).

error INVALID_OPERATOR();

INVALID_MANAGER

Thrown when the manager is address(0).

error INVALID_MANAGER();

INVALID_EARNINGS_RECEIVER

Thrown when the operator's earnings receiver is address(0).

error INVALID_EARNINGS_RECEIVER();

INVALID_OPERATOR_DELEGATOR

Thrown when an invalid (non-existent) operator delegator contract address is provided.

error INVALID_OPERATOR_DELEGATOR();

INVALID_PUBLIC_KEY_LENGTH

Thrown when a validator public key length is invalid.

error INVALID_PUBLIC_KEY_LENGTH();

INVALID_PENDING_MANAGER

Thrown when the pending manager is address(0).

error INVALID_PENDING_MANAGER();

INVALID_VALIDATOR_COUNT

Thrown when the provided validator count is invalid (zero).

error INVALID_VALIDATOR_COUNT();

INVALID_INDEX

Thrown when an invalid index is provided.

error INVALID_INDEX();

VALIDATOR_NOT_EXITED

Thrown when attempting to report an out of order exit for a validator that has not exited.

error VALIDATOR_NOT_EXITED();

MAX_OPERATOR_COUNT_EXCEEDED

Thrown when the maximum number of operators has been reached.

error MAX_OPERATOR_COUNT_EXCEEDED();

MAX_ACTIVE_OPERATOR_COUNT_EXCEEDED

Thrown when the maximum number of active operators has been reached.

error MAX_ACTIVE_OPERATOR_COUNT_EXCEEDED();

OPERATOR_ALREADY_ACTIVE

Thrown when attempting to activate an operator that is already active.

error OPERATOR_ALREADY_ACTIVE();

OPERATOR_ALREADY_INACTIVE

Thrown when attempting to deactivate an operator that is already inactive.

error OPERATOR_ALREADY_INACTIVE();

CANNOT_EXIT_ZERO_SHARES

Thrown when attempting to queue the exit of zero shares.

error CANNOT_EXIT_ZERO_SHARES();

NO_AVAILABLE_OPERATORS_FOR_DEALLOCATION

Thrown when there are no available operators for deallocation.

error NO_AVAILABLE_OPERATORS_FOR_DEALLOCATION();

Structs

OperatorConfig

The information needed to add a new operator.

struct OperatorConfig {
    address operator;
    address initialManager;
    address initialEarningsReceiver;
    string initialMetadataURI;
    StrategyShareCap[] strategyShareCaps;
    uint40 validatorCap;
}

StrategyShareCap

Configuration used to track the maximum number of shares that can be allocated to an operator for a given strategy.

struct StrategyShareCap {
    address strategy;
    uint128 cap;
}

OperatorShareDetails

Tracks both the cap and current allocation of strategy shares for an operator.

struct OperatorShareDetails {
    uint128 cap;
    uint128 allocation;
}

OperatorValidatorDetails

Aggregate validator information for a single operator.

struct OperatorValidatorDetails {
    uint40 nextConfirmationTimestamp;
    uint40 cap;
    uint40 total;
    uint40 confirmed;
    uint40 deposited;
    uint40 exited;
}

OperatorDetails

Details for a single operator.

struct OperatorDetails {
    bool active;
    address delegator;
    address manager;
    address pendingManager;
    address earningsReceiver;
    OperatorValidatorDetails validatorDetails;
    mapping(address => OperatorShareDetails) shareDetails;
}

OperatorPublicDetails

Details for a single operator, excluding the share details, so we can expose externally.

struct OperatorPublicDetails {
    bool active;
    address delegator;
    address manager;
    address pendingManager;
    address earningsReceiver;
    OperatorValidatorDetails validatorDetails;
}

OperatorStrategyAllocation

An operator address and strategy share allocation.

struct OperatorStrategyAllocation {
    address delegator;
    uint256 shares;
    uint256 tokens;
}

OperatorETHAllocation

An operator address, ETH deposit allocation, and validator details.

struct OperatorETHAllocation {
    address delegator;
    uint256 deposits;
    bytes pubKeyBatch;
    bytes signatureBatch;
}

OperatorStrategyDeallocation

An operator address and strategy share deallocation.

struct OperatorStrategyDeallocation {
    address delegator;
    uint256 shares;
    uint256 tokens;
}

OperatorETHDeallocation

An operator address and ETH deposit deallocation.

struct OperatorETHDeallocation {
    address delegator;
    uint256 deposits;
}

Last updated