IRioLRTAssetRegistry

Git Source

Functions

initialize

Initializes the asset registry contract.

function initialize(address initialOwner, address token, uint8 priceFeedDecimals, AssetConfig[] calldata initialAssets)
    external;

Parameters

NameTypeDescription

initialOwner

address

The initial owner of the contract.

token

address

The address of the liquid restaking token.

priceFeedDecimals

uint8

The number of decimals that all price feeds must use.

initialAssets

AssetConfig[]

The initial supported asset configurations.

getTVL

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

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

getTVLForAsset

Returns the total value of the underlying asset in the unit of account.

function getTVLForAsset(address asset) external view returns (uint256);

Parameters

NameTypeDescription

asset

address

The address of the asset.

getTotalBalanceForAsset

Returns the total balance of the asset, including the deposit pool and EigenLayer.

function getTotalBalanceForAsset(address asset) external view returns (uint256);

Parameters

NameTypeDescription

asset

address

The address of the asset.

isSupportedAsset

Checks if a given asset is supported.

function isSupportedAsset(address asset) external view returns (bool);

Parameters

NameTypeDescription

asset

address

The address of the asset to check.

getAssetInfoByAddress

Returns information about an asset.

function getAssetInfoByAddress(address asset) external view returns (AssetInfo memory);

Parameters

NameTypeDescription

asset

address

The address of the asset.

getAssetStrategy

Returns the asset's EigenLayer strategy.

function getAssetStrategy(address asset) external view returns (address);

Parameters

NameTypeDescription

asset

address

The address of the asset.

getAssetSharesHeld

Returns the amount of EigenLayer shares held for an asset.

function getAssetSharesHeld(address asset) external view returns (uint256);

Parameters

NameTypeDescription

asset

address

The address of the asset.

getAssetDepositCap

Returns the asset's current deposit cap.

function getAssetDepositCap(address asset) external view returns (uint256);

Parameters

NameTypeDescription

asset

address

The address of the asset.

getSupportedAssets

Returns an array of all supported assets.

function getSupportedAssets() external view returns (address[] memory);

getAssetStrategies

Returns the EigenLayer strategies for all supported assets.

function getAssetStrategies() external view returns (address[] memory);

increaseSharesHeldForAsset

Increases the number of EigenLayer shares held for an asset.

function increaseSharesHeldForAsset(address asset, uint256 amount) external;

Parameters

NameTypeDescription

asset

address

The address of the asset.

amount

uint256

The amount of EigenLayer shares to increase.

decreaseSharesHeldForAsset

Decreases the number of EigenLayer shares held for an asset.

function decreaseSharesHeldForAsset(address asset, uint256 amount) external;

Parameters

NameTypeDescription

asset

address

The address of the asset.

amount

uint256

The amount of EigenLayer shares to decrease.

increaseUnverifiedValidatorETHBalance

Increases the unverified validator ETH balance.

function increaseUnverifiedValidatorETHBalance(uint256 amount) external;

Parameters

NameTypeDescription

amount

uint256

The amount of ETH to increase.

decreaseUnverifiedValidatorETHBalance

Decreases the unverified validator ETH balance.

function decreaseUnverifiedValidatorETHBalance(uint256 amount) external;

Parameters

NameTypeDescription

amount

uint256

The amount of ETH to decrease.

convertToUnitOfAccountFromAsset

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

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

Parameters

NameTypeDescription

asset

address

The address of the asset to convert.

amount

uint256

The amount of the asset to convert.

convertFromUnitOfAccountToAsset

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

function convertFromUnitOfAccountToAsset(address asset, uint256 value) external view returns (uint256);

Parameters

NameTypeDescription

asset

address

The address of the asset to convert to.

value

uint256

The asset's value in the unit of account.

convertToSharesFromAsset

Converts an amount of an asset to the equivalent amount of EigenLayer shares.

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

Parameters

NameTypeDescription

asset

address

The address of the asset to convert.

amount

uint256

The amount of the asset to convert.

convertFromSharesToAsset

Converts an amount of EigenLayer shares to the equivalent amount of an asset.

function convertFromSharesToAsset(address strategy, uint256 shares) external view returns (uint256 amount);

Parameters

NameTypeDescription

strategy

address

The EigenLayer strategy.

shares

uint256

The amount of EigenLayer shares.

Events

AssetAdded

Emitted when a new asset is added.

event AssetAdded(AssetConfig config);

Parameters

NameTypeDescription

config

AssetConfig

The asset's configuration.

AssetRemoved

Emitted when an asset is removed.

event AssetRemoved(address indexed asset, bool forced);

Parameters

NameTypeDescription

asset

address

The address of the asset.

forced

bool

True if the asset was removed by force, regardless of its balance.

AssetDepositCapSet

Emitted when an asset's EigenLayer strategy is set.

event AssetDepositCapSet(address indexed asset, uint96 newDepositCap);

Parameters

NameTypeDescription

asset

address

The address of the asset.

newDepositCap

uint96

The new deposit cap.

AssetPriceFeedSet

Emitted when an asset's price feed is set.

event AssetPriceFeedSet(address indexed asset, address newPriceFeed);

Parameters

NameTypeDescription

asset

address

The address of the asset.

newPriceFeed

address

The new price feed.

AssetSharesIncreased

Emitted when the number of EigenLayer shares held for an asset is increased.

event AssetSharesIncreased(address indexed asset, uint256 amount);

Parameters

NameTypeDescription

asset

address

The address of the asset.

amount

uint256

The amount of EigenLayer shares to increase.

AssetSharesDecreased

Emitted when the number of EigenLayer shares held for an asset is decreased.

event AssetSharesDecreased(address indexed asset, uint256 amount);

Parameters

NameTypeDescription

asset

address

The address of the asset.

amount

uint256

The amount of EigenLayer shares to decrease.

UnverifiedValidatorETHBalanceIncreased

Emitted when the unverified validator ETH balance is increased.

event UnverifiedValidatorETHBalanceIncreased(uint256 amount);

Parameters

NameTypeDescription

amount

uint256

The amount of ETH to increase.

UnverifiedValidatorETHBalanceDecreased

Emitted when the unverified validator ETH balance is decreased.

event UnverifiedValidatorETHBalanceDecreased(uint256 amount);

Parameters

NameTypeDescription

amount

uint256

The amount of ETH to decrease.

Errors

ONLY_WITHDRAWAL_QUEUE_OR_DEPOSIT_POOL

Thrown when the caller is not the LRT withdrawal queue or deposit pool.

error ONLY_WITHDRAWAL_QUEUE_OR_DEPOSIT_POOL();

ASSET_NOT_SUPPORTED

Thrown when attempting an action on an unsupported asset.

error ASSET_NOT_SUPPORTED(address asset);

Parameters

NameTypeDescription

asset

address

The address of the asset.

ASSET_ALREADY_SUPPORTED

Thrown when attempting to add an asset that is already supported.

error ASSET_ALREADY_SUPPORTED(address asset);

Parameters

NameTypeDescription

asset

address

The address of the asset.

ASSET_HAS_BALANCE

Thrown when attempting to remove an asset with a non-zero balance.

error ASSET_HAS_BALANCE();

INVALID_ASSET_ADDRESS

Thrown when attempting to add an asset with an invalid address.

error INVALID_ASSET_ADDRESS();

INVALID_ASSET_DECIMALS

Thrown when an asset has greater than 18 decimals.

error INVALID_ASSET_DECIMALS();

INVALID_STRATEGY

Thrown when a srategy's underlying token does not match the asset.

error INVALID_STRATEGY();

INVALID_PRICE_FEED_DECIMALS

Thrown when a provided price feed has an unexpected amount of decimals.

error INVALID_PRICE_FEED_DECIMALS();

INVALID_PRICE_FEED

Thrown when a price feed is provided when not needed, or not provided when required.

error INVALID_PRICE_FEED();

Structs

AssetConfig

The configuration used to add a new asset.

struct AssetConfig {
    address asset;
    uint96 depositCap;
    address priceFeed;
    address strategy;
}

AssetInfo

Information about a supported asset.

struct AssetInfo {
    uint96 depositCap;
    address priceFeed;
    uint256 shares;
    address strategy;
    uint8 decimals;
}

Last updated