RioLRTAssetRegistry

Git Source

Inherits: IRioLRTAssetRegistry, OwnableUpgradeable, UUPSUpgradeable, RioLRTCore

State Variables

priceFeedDecimals

The number of decimals that all asset price feeds must use.

uint8 public priceFeedDecimals;

priceScale

The price scale used for all assets (max of 18 decimals).

uint64 public priceScale;

supportedAssets

All supported assets.

address[] public supportedAssets;

assetInfo

Information about a supported asset.

mapping(address asset => AssetInfo) public assetInfo;

ethBalanceInUnverifiedValidators

The amount of ETH held in unverified validators.

uint256 public ethBalanceInUnverifiedValidators;

Functions

onlyWithdrawalQueueOrDepositPool

Require that the caller is the withdrawal queue or deposit pool.

modifier onlyWithdrawalQueueOrDepositPool();

constructor

constructor(address issuer_) RioLRTCore(issuer_);

Parameters

initialize

Initializes the asset registry contract.

function initialize(
    address initialOwner,
    address token_,
    uint8 priceFeedDecimals_,
    AssetConfig[] calldata initialAssets
) external initializer;

Parameters

getTVL

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

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

getTVLForAsset

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

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

Parameters

getTotalBalanceForAsset

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

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

Parameters

getETHBalanceInEigenLayer

Returns the ETH balance held in EigenLayer. This includes the ETH held in unverified validators, EigenPod shares, and ETH that's queued for withdrawal.

function getETHBalanceInEigenLayer() public view returns (uint256 balance);

isSupportedAsset

Checks if a given asset is supported.

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

Parameters

getAssetInfoByAddress

Returns information about an asset.

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

Parameters

getAssetStrategy

Returns the asset's EigenLayer strategy.

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

Parameters

getAssetSharesHeld

Returns the amount of EigenLayer shares held for an asset.

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

Parameters

getAssetPriceFeed

Returns the asset's current price feed.

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

Parameters

getAssetDepositCap

Returns the asset's current deposit cap.

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

Parameters

getAssetDecimals

Returns the asset's decimal precision.

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

Parameters

getAssetPrice

Returns the asset's current price.

function getAssetPrice(address asset) public view returns (uint256);

Parameters

getSupportedAssets

Returns an array of all supported assets.

function getSupportedAssets() public view returns (address[] memory assets);

getAssetStrategies

Returns the EigenLayer strategies for all supported assets.

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

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) public view returns (uint256);

Parameters

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) public view returns (uint256);

Parameters

convertToSharesFromAsset

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

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

Parameters

convertFromSharesToAsset

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

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

Parameters

getPrice

Get the current price from the provided price feed. This function performs no checks on the price feed. Its output should not be trusted unless the price feed parameter is known and trusted.

function getPrice(address priceFeed) public view returns (uint256);

Parameters

addAsset

Adds a new underlying asset to the liquid restaking token.

function addAsset(AssetConfig calldata config) external onlyOwner;

Parameters

removeAsset

Removes an underlying asset from the liquid restaking token.

function removeAsset(address asset) external onlyOwner;

Parameters

forceRemoveAsset

Force removes an underlying asset from the liquid restaking token regardless of its balance.

function forceRemoveAsset(address asset) external onlyOwner;

Parameters

setAssetDepositCap

Sets the asset's deposit cap.

function setAssetDepositCap(address asset, uint96 newDepositCap) external onlyOwner;

Parameters

setAssetPriceFeed

Sets the asset's price feed.

function setAssetPriceFeed(address asset, address newPriceFeed) external onlyOwner;

Parameters

increaseSharesHeldForAsset

Increases the number of EigenLayer shares held for an asset.

function increaseSharesHeldForAsset(address asset, uint256 amount) external onlyCoordinator;

Parameters

decreaseSharesHeldForAsset

Decreases the number of EigenLayer shares held for an asset.

function decreaseSharesHeldForAsset(address asset, uint256 amount) external onlyWithdrawalQueueOrDepositPool;

Parameters

increaseUnverifiedValidatorETHBalance

Increases the unverified validator ETH balance.

function increaseUnverifiedValidatorETHBalance(uint256 amount) external onlyCoordinator;

Parameters

decreaseUnverifiedValidatorETHBalance

Decreases the unverified validator ETH balance.

function decreaseUnverifiedValidatorETHBalance(uint256 amount) external onlyOperatorRegistry;

Parameters

_addAsset

Adds a new underlying asset to the liquid restaking token.

function _addAsset(AssetConfig calldata config) internal;

Parameters

_removeAsset

Removes an underlying asset from the liquid restaking token.

function _removeAsset(address asset, bool force) internal;

Parameters

_findAssetIndex

Returns the index of the asset in the supported assets array.

function _findAssetIndex(address asset) internal view returns (uint256);

Parameters

_normalizeDecimals

Normalizes an amount from one decimal precision to another.

function _normalizeDecimals(uint256 amount, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256);

Parameters

_authorizeUpgrade

Allows the owner to upgrade the asset registry implementation.

function _authorizeUpgrade(address newImplementation) internal override onlyOwner;

Parameters

Last updated