RioLRTWithdrawalQueue

RioLRTWithdrawalQueue

Inherits: IRioLRTWithdrawalQueue, OwnableUpgradeable, UUPSUpgradeable, RioLRTCore

State Variables

delegationManager

The primary delegation contract for EigenLayer.

IDelegationManager public immutable delegationManager;

currentEpochsByAsset

Current asset withdrawal epochs. Incoming withdrawals are included in the current epoch, which will be processed by the asset manager.

mapping(address asset => uint256 epoch) internal currentEpochsByAsset;

epochWithdrawalsByAsset

The amount of assets owed to users in a given epoch, as well as the state of the epoch's withdrawals.

mapping(address asset => mapping(uint256 epoch => EpochWithdrawals withdrawals)) internal epochWithdrawalsByAsset;

Functions

constructor

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

Parameters

NameTypeDescription

issuer_

address

The LRT issuer that's authorized to deploy this contract.

delegationManager_

address

The EigenLayer delegation manager.

initialize

Initializes the contract.

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

Parameters

NameTypeDescription

initialOwner

address

The initial owner of the contract.

token_

address

The address of the liquid restaking token.

getCurrentEpoch

Retrieve the current withdrawal epoch for a given asset.

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

Parameters

NameTypeDescription

asset

address

The asset to retrieve the current epoch for.

getSharesOwedInCurrentEpoch

Get the amount of strategy shares owed to withdrawers in the current epoch for asset.

function getSharesOwedInCurrentEpoch(address asset) external view returns (uint256 sharesOwed);

Parameters

NameTypeDescription

asset

address

The withdrawal asset.

getEpochWithdrawalSummary

Retrieve withdrawal epoch information for a given asset and epoch.

function getEpochWithdrawalSummary(address asset, uint256 epoch)
    external
    view
    returns (EpochWithdrawalSummary memory);

Parameters

NameTypeDescription

asset

address

The withdrawal asset.

epoch

uint256

The epoch for which to retrieve the information.

getUserWithdrawalSummary

Retrieve a user's withdrawal information for a given asset and epoch.

function getUserWithdrawalSummary(address asset, uint256 epoch, address user)
    external
    view
    returns (UserWithdrawalSummary memory);

Parameters

NameTypeDescription

asset

address

The withdrawal asset.

epoch

uint256

The epoch for which to retrieve the information.

user

address

The address of the user for which to retrieve the information.

claimWithdrawalsForEpoch

Withdraws all asset owed to the caller in a given epoch.

function claimWithdrawalsForEpoch(ClaimRequest calldata request) public returns (uint256 amountOut);

Parameters

NameTypeDescription

request

ClaimRequest

The asset claim request.

claimWithdrawalsForManyEpochs

Withdraws owed assets owed to the caller from many withdrawal requests.

function claimWithdrawalsForManyEpochs(ClaimRequest[] calldata requests)
    external
    returns (uint256[] memory amountsOut);

Parameters

NameTypeDescription

requests

ClaimRequest[]

The withdrawal claim request.

queueWithdrawal

Queue sharesOwed of asset to withdrawer in the current epoch. These owed shares can be claimed as the underlying asset by the withdrawer once the current epoch is settled.

function queueWithdrawal(address withdrawer, address asset, uint256 sharesOwed, uint256 amountIn)
    external
    onlyCoordinator;

Parameters

NameTypeDescription

withdrawer

address

The address requesting the withdrawal.

asset

address

The address of the asset being withdrawn.

sharesOwed

uint256

The amount of shares owed to the withdrawer.

amountIn

uint256

The amount of restaking tokens pulled from the withdrawer.

settleCurrentEpoch

Settle the current epoch for asset using assetsReceived from the deposit pool.

function settleCurrentEpoch(address asset, uint256 assetsReceived, uint256 shareValueOfAssetsReceived)
    external
    onlyCoordinator;

Parameters

NameTypeDescription

asset

address

The address of the withdrawal asset.

assetsReceived

uint256

The amount of assets received to settle the epoch.

shareValueOfAssetsReceived

uint256

The value of the assets received in EigenLayer shares.

queueCurrentEpochSettlement

Queues the current epoch for asset settlement via EigenLayer and record the amount of assets received from the deposit pool.

function queueCurrentEpochSettlement(
    address asset,
    uint256 assetsReceived,
    uint256 shareValueOfAssetsReceived,
    bytes32 aggregateRoot
) external onlyCoordinator;

Parameters

NameTypeDescription

asset

address

The address of the withdrawal asset.

assetsReceived

uint256

The amount of assets received from the deposit pool.

shareValueOfAssetsReceived

uint256

The value of the assets received in EigenLayer shares.

aggregateRoot

bytes32

The aggregate root of the queued EigenLayer withdrawals.

settleEpochFromEigenLayer

Settle epoch for asset using queuedWithdrawals from EigenLayer.

function settleEpochFromEigenLayer(
    address asset,
    uint256 epoch,
    IDelegationManager.Withdrawal[] calldata queuedWithdrawals,
    uint256[] calldata middlewareTimesIndexes
) external;

Parameters

NameTypeDescription

asset

address

The address of the withdrawal asset.

epoch

uint256

The epoch to settle.

queuedWithdrawals

IDelegationManager.Withdrawal[]

The queued withdrawals from EigenLayer.

middlewareTimesIndexes

uint256[]

The middleware times indexes for the queued withdrawals.

receive

Receives ETH for withdrawals.

receive() external payable;

_computeWithdrawalRoot

Returns the keccak256 hash of withdrawal.

function _computeWithdrawalRoot(IDelegationManager.Withdrawal memory withdrawal) public pure returns (bytes32);

Parameters

NameTypeDescription

withdrawal

IDelegationManager.Withdrawal

The withdrawal.

_getEpochWithdrawals

function _getEpochWithdrawals(address asset, uint256 epoch) internal view returns (EpochWithdrawals storage);

_authorizeUpgrade

Allows the owner to upgrade the withdrawal queue implementation.

function _authorizeUpgrade(address newImplementation) internal override onlyOwner;

Parameters

NameTypeDescription

newImplementation

address

The implementation to upgrade to.

Last updated