IRioLRTCoordinator

Git Source

Functions

initialize

Initializes the contract.

function initialize(address initialOwner, address token) external;

Parameters

Name
Type
Description

initialOwner

address

The owner of the contract.

token

address

The address of the liquid restaking token.

DEPOSIT_ROOT_TYPEHASH

Returns the EIP-712 typehash for DepositRoot message.

function DEPOSIT_ROOT_TYPEHASH() external view returns (bytes32);

ethPOS

The Ethereum POS deposit contract address.

function ethPOS() external view returns (IETHPOSDeposit);

getTVL

Returns the total value of all underlying assets in the unit of account.

function getTVL() external view returns (uint256);

convertToUnitOfAccountFromRestakingTokens

Converts an amount of restaking tokens to its equivalent value in the unit of account. The unit of account is the price feed's quote asset.

function convertToUnitOfAccountFromRestakingTokens(uint256 amount) external view returns (uint256);

Parameters

Name
Type
Description

amount

uint256

The amount of restaking tokens to convert.

convertFromUnitOfAccountToRestakingTokens

Converts the unit of account value to its equivalent in restaking tokens. The unit of account is the price feed's quote asset.

function convertFromUnitOfAccountToRestakingTokens(uint256 value) external view returns (uint256);

Parameters

Name
Type
Description

value

uint256

The restaking token's value in the unit of account.

convertFromAssetToRestakingTokens

Converts an asset amount to its equivalent value in restaking tokens.

function convertFromAssetToRestakingTokens(address asset, uint256 amount) external view returns (uint256);

Parameters

Name
Type
Description

asset

address

The address of the asset to convert.

amount

uint256

The amount of the asset to convert.

convertToAssetFromRestakingTokens

Converts an amount of restaking tokens to the equivalent in the asset.

function convertToAssetFromRestakingTokens(address asset, uint256 amount) external view returns (uint256);

Parameters

Name
Type
Description

asset

address

The address of the asset to convert to.

amount

uint256

The amount of restaking tokens to convert.

convertToSharesFromRestakingTokens

Converts an amount of restaking tokens to the equivalent in the provided asset's EigenLayer shares.

function convertToSharesFromRestakingTokens(address asset, uint256 amount) external view returns (uint256);

Parameters

Name
Type
Description

asset

address

The address of the asset whose EigenLayer shares to convert to.

amount

uint256

The amount of restaking tokens to convert.

hashTypedData

EIP-712 helper.

function hashTypedData(bytes32 structHash) external view returns (bytes32);

Parameters

Name
Type
Description

structHash

bytes32

The hash of the struct.

depositERC20

Deposits ERC20 tokens and mints restaking token(s) to the caller.

function depositERC20(address asset, uint256 amountIn) external returns (uint256);

Parameters

Name
Type
Description

asset

address

The asset being deposited.

amountIn

uint256

The amount of the asset being deposited.

depositETH

Deposits ETH and mints restaking token(s) to the caller.

function depositETH() external payable returns (uint256);

requestWithdrawal

Requests a withdrawal to asset for amountIn restaking tokens.

function requestWithdrawal(address asset, uint256 amountIn) external;

Parameters

Name
Type
Description

asset

address

The asset being withdrawn.

amountIn

uint256

The amount of restaking tokens requested for withdrawal.

rebalanceETH

Rebalances ETH by processing outstanding withdrawals and depositing remaining ETH into EigenLayer.

This function requires a guardian signature prior to depositing ETH into EigenLayer. If the guardian doesn't provide a signature within 24 hours, then the rebalance will be allowed without a signature, but only for withdrawals. In the future, this may be extended to allow a rebalance without a guardian signature without waiting 24 hours if withdrawals outnumber deposits.

function rebalanceETH(bytes32 root, bytes calldata signature) external;

Parameters

Name
Type
Description

root

bytes32

The deposit merkle root.

signature

bytes

The guardian signature.

rebalanceERC20

Rebalances the provided ERC20 token by processing outstanding withdrawals and depositing remaining tokens into EigenLayer.

function rebalanceERC20(address token) external;

Parameters

Name
Type
Description

token

address

The token to rebalance.

Events

Deposited

Emitted when a user deposits an asset into Rio.

event Deposited(address indexed user, address indexed asset, uint256 amountIn, uint256 amountOut);

Parameters

Name
Type
Description

user

address

The address of the user.

asset

address

The address of the asset.

amountIn

uint256

The amount of the asset deposited.

amountOut

uint256

The amount of restaking tokens minted.

Rebalanced

Emitted when both withdrawals and deposits succeed during a rebalance, or when withdrawals succeed and a deposit was not needed.

event Rebalanced(address indexed asset);

Parameters

Name
Type
Description

asset

address

The address of the asset.

PartiallyRebalanced

Emitted when withdrawals succeed, but deposits fail or were unable to be attempted during an asset rebalance.

event PartiallyRebalanced(address indexed asset);

Parameters

Name
Type
Description

asset

address

The address of the asset.

RebalanceDelaySet

Emitted when the rebalance delay is set.

event RebalanceDelaySet(uint24 newRebalanceDelay);

Parameters

Name
Type
Description

newRebalanceDelay

uint24

The new rebalance delay.

GuardianSignerSet

Emitted when the guardian signer is set.

event GuardianSignerSet(address newGuardianSigner);

Parameters

Name
Type
Description

newGuardianSigner

address

The address of the new guardian signer.

Errors

ASSET_NOT_SUPPORTED

Thrown when attempting an action on an unsupported asset.

error ASSET_NOT_SUPPORTED(address asset);

Parameters

Name
Type
Description

asset

address

The address of the asset.

AMOUNT_MUST_BE_GREATER_THAN_ZERO

Thrown when attempting to deposit an amount of zero.

error AMOUNT_MUST_BE_GREATER_THAN_ZERO();

DEPOSIT_CAP_REACHED

Thrown when attempting to deposit an amount that would exceed the deposit cap.

error DEPOSIT_CAP_REACHED(address asset, uint256 depositCap);

Parameters

Name
Type
Description

asset

address

The address of the asset.

depositCap

uint256

The asset's deposit cap.

INSUFFICIENT_SHARES_FOR_WITHDRAWAL

Thrown when attempting to request a withdrawal for an amount that would exceed the total share value available.

error INSUFFICIENT_SHARES_FOR_WITHDRAWAL();

CALLER_MUST_BE_EOA

Thrown when the msg.sender is a contract.

error CALLER_MUST_BE_EOA();

INVALID_TOKEN_ADDRESS

Thrown when the ETH pseudo-address is passed to the ERC20 rebalance function.

error INVALID_TOKEN_ADDRESS();

INVALID_GUARDIAN_SIGNATURE

Thrown when the guardian signer is invalid.

error INVALID_GUARDIAN_SIGNATURE();

STALE_DEPOSIT_ROOT

Thrown when the guardian deposit root is stale.

error STALE_DEPOSIT_ROOT();

REBALANCE_DELAY_NOT_MET

Thrown when attempting rebalance before the rebalance delay has elapsed.

error REBALANCE_DELAY_NOT_MET();

REBALANCE_DELAY_TOO_LONG

Thrown when attempting to set the rebalance delay to a value greater than the maximum.

error REBALANCE_DELAY_TOO_LONG();

NO_REBALANCE_NEEDED

Thrown when attempting to rebalance an asset that does not need to be rebalanced.

error NO_REBALANCE_NEEDED();

NO_OPERATOR_UNDELEGATED

Thrown when attempting to pause the coordinator due to forceful undelegation when no operator has forcefully undelegated.

error NO_OPERATOR_UNDELEGATED();

Last updated