IRioLRTWithdrawalQueue

IRioLRTWithdrawalQueue

Functions

initialize

Initializes the contract.

function initialize(address initialOwner, address token) external;

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

Parameters

NameTypeDescription

asset

address

The asset to retrieve the current epoch for.

getSharesOwedInCurrentEpoch

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

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

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.

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;

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.

claimWithdrawalsForEpoch

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

function claimWithdrawalsForEpoch(ClaimRequest calldata request) external 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.

settleCurrentEpoch

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

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

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;

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.

Events

WithdrawalQueued

Emitted when a user withdrawal is queued.

event WithdrawalQueued(uint256 indexed epoch, address asset, address withdrawer, uint256 sharesOwed, uint256 amountIn);

Parameters

NameTypeDescription

epoch

uint256

The epoch containing the withdrawal.

asset

address

The address of the asset.

withdrawer

address

The address of the withdrawer.

sharesOwed

uint256

The amount of EigenLayer shares owed to the user.

amountIn

uint256

The amount of restaking tokens pulled from the user.

WithdrawalsClaimedForEpoch

Emitted when a user claims a withdrawal.

event WithdrawalsClaimedForEpoch(uint256 indexed epoch, address asset, address withdrawer, uint256 amountOut);

Parameters

NameTypeDescription

epoch

uint256

The epoch containing the withdrawal.

asset

address

The address of the asset.

withdrawer

address

The address of the withdrawer.

amountOut

uint256

The amount of assets received.

EpochSettledFromDepositPool

Emitted when an epoch is settled from the deposit pool.

event EpochSettledFromDepositPool(uint256 indexed epoch, address asset, uint256 assetsReceived);

Parameters

NameTypeDescription

epoch

uint256

The epoch that was settled.

asset

address

The address of the asset that was settled.

assetsReceived

uint256

The amount of assets received to settle the epoch.

EpochQueuedForSettlementFromEigenLayer

Emitted when an epoch is queued for settlement via EigenLayer.

event EpochQueuedForSettlementFromEigenLayer(
    uint256 indexed epoch,
    address asset,
    uint256 assetsReceived,
    uint256 shareValueOfAssetsReceived,
    uint256 restakingTokensBurned,
    bytes32 aggregateRoot
);

Parameters

NameTypeDescription

epoch

uint256

The epoch that was queued.

asset

address

The address of the asset that was queued.

assetsReceived

uint256

The amount of assets received from the deposit pool.

shareValueOfAssetsReceived

uint256

The value of the assets received in EigenLayer shares.

restakingTokensBurned

uint256

The amount of restaking tokens burned.

aggregateRoot

bytes32

The aggregate root of the queued EigenLayer withdrawals.

EpochSettledFromEigenLayer

Emitted when an epoch is settled from EigenLayer.

event EpochSettledFromEigenLayer(uint256 indexed epoch, address asset, uint256 assetsReceived);

Parameters

NameTypeDescription

epoch

uint256

The epoch that was settled.

asset

address

The address of the asset that was settled.

assetsReceived

uint256

The amount of assets received to settle the epoch.

Errors

NO_SHARES_OWED

Thrown when attempting to queue a withdrawal with no shares owed.

error NO_SHARES_OWED();

NO_SHARES_OWED_IN_EPOCH

Thrown when attempting an operation on an epoch in which no shares are owed.

error NO_SHARES_OWED_IN_EPOCH();

EPOCH_ALREADY_SETTLED

Thrown when attempting to settle an epoch that has already been settled.

error EPOCH_ALREADY_SETTLED();

EPOCH_NOT_SETTLED

Thrown when attempting to withdraw from an epoch that has not been settled.

error EPOCH_NOT_SETTLED();

WITHDRAWALS_ALREADY_QUEUED_FOR_EPOCH

Thrown when attempting to queue withdrawals for an epoch that has already been queued.

error WITHDRAWALS_ALREADY_QUEUED_FOR_EPOCH();

WITHDRAWALS_NOT_QUEUED_FOR_EPOCH

Thrown when attempting to settle an epoch that has not been queued from EigenLayer.

error WITHDRAWALS_NOT_QUEUED_FOR_EPOCH();

WITHDRAWAL_ALREADY_CLAIMED

Thrown when attempting to claim a withdrawal that has already been claimed.

error WITHDRAWAL_ALREADY_CLAIMED();

INVALID_AGGREGATE_WITHDRAWAL_ROOT

Thrown when the calculated aggregate withdrawal root does not match the stored root.

error INVALID_AGGREGATE_WITHDRAWAL_ROOT();

INVALID_MIDDLEWARE_TIMES_INDEXES_LENGTH

Thrown when an incorrect number of middleware times indexes are provided.

error INVALID_MIDDLEWARE_TIMES_INDEXES_LENGTH();

Structs

UserWithdrawalSummary

How many shares are owed to a user in a given epoch, as well as whether or not the user has completed the withdrawal.

struct UserWithdrawalSummary {
    bool claimed;
    uint120 sharesOwed;
}

EpochWithdrawals

How many shares owed to all users in a given epoch, as well as whether or not the epoch's withdrawals have been completed.

struct EpochWithdrawals {
    bool settled;
    uint120 assetsReceived;
    uint120 shareValueOfAssetsReceived;
    uint120 sharesOwed;
    bytes32 aggregateRoot;
    uint256 amountToBurnAtSettlement;
    mapping(address => UserWithdrawalSummary) users;
}

EpochWithdrawalSummary

Epoch withdrawal information without the mapping, which allows us to return the struct from a view function.

struct EpochWithdrawalSummary {
    bool settled;
    uint120 assetsReceived;
    uint120 shareValueOfAssetsReceived;
    uint120 sharesOwed;
    bytes32 aggregateRoot;
    uint256 amountToBurnAtSettlement;
}

ClaimRequest

The information needed to claim an owed asset in a given epoch.

struct ClaimRequest {
    address asset;
    uint256 epoch;
}

Last updated