RioLRTWithdrawalQueue

Git Source

Inherits: IRioLRTWithdrawalQueue, OwnableUpgradeable, UUPSUpgradeable, RioLRTCore

State Variables

currentEpochsByAsset

Current asset withdrawal epochs. Incoming withdrawals are included in the current epoch.

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;

sharesOwedByAsset

The total amount of shares owed to withdrawers across all epochs for asset, excluding the current epoch.

mapping(address asset => uint256 sharesOwed) internal sharesOwedByAsset;

Functions

constructor

constructor(address issuer_) RioLRTCore(issuer_);

Parameters

NameTypeDescription

issuer_

address

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

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.

getRestakingTokensInCurrentEpoch

Get the amount of restaking tokens requested for withdrawal in the current epoch for asset.

function getRestakingTokensInCurrentEpoch(address asset) external view returns (uint256 amountIn);

Parameters

NameTypeDescription

asset

address

The address of the withdrawal asset.

getTotalSharesOwed

Get the total amount of shares owed to withdrawers across all epochs for asset.

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

Parameters

NameTypeDescription

asset

address

The address of 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 withdrawal of asset to withdrawer in the current epoch. The withdrawal can be claimed as the underlying asset by the withdrawer once the current epoch is settled.

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

Parameters

NameTypeDescription

withdrawer

address

The address requesting the withdrawal.

asset

address

The address of the asset being withdrawn.

amountIn

uint256

The amount of restaking tokens to queue for withdrawal.

settleCurrentEpochFromDepositPool

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

function settleCurrentEpochFromDepositPool(address asset, uint256 assetsReceived) external onlyCoordinator;

Parameters

NameTypeDescription

asset

address

The address of the withdrawal asset.

assetsReceived

uint256

The amount of assets received to settle the epoch.

queueCurrentEpochSettlementFromEigenLayer

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

function queueCurrentEpochSettlementFromEigenLayer(
    address asset,
    uint256 assetsReceived,
    uint256 shareValueOfAssetsReceived,
    uint256 totalShareValueAtRebalance,
    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.

totalShareValueAtRebalance

uint256

The total epoch share value at the time of rebalance.

aggregateRoot

bytes32

The aggregate root of the queued EigenLayer withdrawals.

completeEpochSettlementFromEigenLayer

Settle epoch for asset using queuedWithdrawals from EigenLayer.

function completeEpochSettlementFromEigenLayer(
    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;

_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