RioLRTOperatorDelegator

RioLRTOperatorDelegator

Inherits: IRioLRTOperatorDelegator, RioLRTCore

State Variables

PUBLIC_KEY_LENGTH

The length of a BLS12-381 public key.

uint256 internal constant PUBLIC_KEY_LENGTH = 48;

SIGNATURE_LENGTH

The length of a BLS12-381 signature.

uint256 internal constant SIGNATURE_LENGTH = 96;

DEPOSIT_SIZE

The per-validator deposit amount.

uint256 internal constant DEPOSIT_SIZE = 32 ether;

DEPOSIT_SIZE_IN_GWEI_LE64

The deposit amount in gwei, converted to little endian. DEPOSIT_SIZE_IN_GWEI_LE64 = toLittleEndian64(32 ether / 1 gwei)

uint64 internal constant DEPOSIT_SIZE_IN_GWEI_LE64 = 0x0040597307000000;

WITHDRAWALS_ENABLED_PREFIX

The withdrawal credentials prefix, which signals that withdrawals are enabled.

bytes1 internal constant WITHDRAWALS_ENABLED_PREFIX = 0x01;

strategyManager

The primary entry and exit-point for funds into and out of EigenLayer.

IStrategyManager public immutable strategyManager;

eigenPodManager

The contract used for creating and managing EigenPods.

IEigenPodManager public immutable eigenPodManager;

delegationManager

The primary delegation contract for EigenLayer.

IDelegationManager public immutable delegationManager;

eigenPod

The operator delegator's EigenPod.

IEigenPod public eigenPod;

withdrawalCredentials

Credentials to withdraw ETH on Consensus Layer via the EigenPod.

bytes32 public withdrawalCredentials;

Functions

onlyCoordinatorOrOperatorRegistry

Require that the caller is the LRT's coordinator or the operator registry.

modifier onlyCoordinatorOrOperatorRegistry();

constructor

constructor(address issuer_, address strategyManager_, address eigenPodManager_, address delegationManager_)
    RioLRTCore(issuer_);

Parameters

NameTypeDescription

issuer_

address

The issuer of the LRT instance that this contract is deployed for.

strategyManager_

address

The primary entry and exit-point for funds into and out of EigenLayer.

eigenPodManager_

address

The contract used for creating and managing EigenPods.

delegationManager_

address

The primary delegation contract for EigenLayer.

initialize

Initializes the contract by delegating to the provided EigenLayer operator.

function initialize(address token_, address operator) external initializer;

Parameters

NameTypeDescription

token_

address

The address of the liquid restaking token.

operator

address

The operator's address.

getEigenPodShares

Returns the number of shares in the operator delegator's EigenPod.

function getEigenPodShares() public view returns (int256);

getETHUnderManagement

Returns the total amount of ETH under management by the operator delegator.

This includes EigenPod shares (verified validator balances minus queued withdrawals) and ETH in the operator delegator's EigenPod.

function getETHUnderManagement() external view returns (uint256);

verifyWithdrawalCredentials

Verifies withdrawal credentials of validator(s) owned by this operator. It also verifies the effective balance of the validator(s).

function verifyWithdrawalCredentials(
    uint64 oracleTimestamp,
    IBeaconChainProofs.StateRootProof calldata stateRootProof,
    uint40[] calldata validatorIndices,
    bytes[] calldata validatorFieldsProofs,
    bytes32[][] calldata validatorFields
) external onlyOperatorRegistry;

Parameters

NameTypeDescription

oracleTimestamp

uint64

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

stateRootProof

IBeaconChainProofs.StateRootProof

Proves a beaconStateRoot against a block root fetched from the oracle.

validatorIndices

uint40[]

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

validatorFieldsProofs

bytes[]

Proofs against the beaconStateRoot for each validator in validatorFields.

validatorFields

bytes32[][]

The fields of the "Validator Container", refer to consensus specs.

scrapeEigenPodETHBalanceToRewardDistributor

Scrapes ETH sitting in the operator delegator's EigenPod to the reward distributor.

Anyone can call this function.

function scrapeEigenPodETHBalanceToRewardDistributor() external;

stakeERC20

Approve EigenLayer to spend an ERC20 token, then stake it into an EigenLayer strategy.

function stakeERC20(address strategy, address token, uint256 amount)
    external
    onlyDepositPool
    returns (uint256 shares);

Parameters

NameTypeDescription

strategy

address

The strategy to stake the tokens into.

token

address

The token to stake.

amount

uint256

The amount of tokens to stake.

stakeETH

Stake ETH via the operator delegator's EigenPod, using the provided validator information.

function stakeETH(uint256 validatorCount, bytes calldata pubkeyBatch, bytes calldata signatureBatch)
    external
    payable
    onlyDepositPool;

Parameters

NameTypeDescription

validatorCount

uint256

The number of validators to deposit into.

pubkeyBatch

bytes

Batched validator public keys.

signatureBatch

bytes

Batched validator signatures.

queueWithdrawal

Queue a withdrawal of the given amount of shares to the withdrawer from the provided strategy.

function queueWithdrawal(address strategy, uint256 shares, address withdrawer)
    external
    onlyCoordinatorOrOperatorRegistry
    returns (bytes32 root);

Parameters

NameTypeDescription

strategy

address

The strategy to withdraw from.

shares

uint256

The amount of shares to withdraw.

withdrawer

address

The address who has permission to complete the withdrawal.

receive

Forwards ETH rewards to the reward distributor. This includes partial withdrawals and any amount in excess of 32 ETH for full withdrawals.

receive() external payable;

_computeWithdrawalCredentials

Compute withdrawal credentials for the given EigenPod.

function _computeWithdrawalCredentials(address pod) internal pure returns (bytes32);

Parameters

NameTypeDescription

pod

address

The EigenPod to compute the withdrawal credentials for.

_computeDepositDataRoot

Computes the deposit_root_hash required by the Beacon Deposit contract.

function _computeDepositDataRoot(bytes32 withdrawalCredentials_, bytes memory publicKey, bytes memory signature)
    internal
    pure
    returns (bytes32);

Parameters

NameTypeDescription

withdrawalCredentials_

bytes32

Credentials to withdraw ETH on Consensus Layer.

publicKey

bytes

A BLS12-381 public key.

signature

bytes

A BLS12-381 signature.

Last updated