IRioLRTWithdrawalQueue

Git Source

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.

getRestakingTokensInCurrentEpoch

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

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

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.

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;

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 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.

settleCurrentEpochFromDepositPool

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

function settleCurrentEpochFromDepositPool(address asset, uint256 assetsReceived) external;

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;

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.

Events

WithdrawalQueued

Emitted when a user withdrawal is queued.

event WithdrawalQueued(uint256 indexed epoch, address asset, address withdrawer, 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.

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 totalShareValueAtRebalance,
    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.

totalShareValueAtRebalance

uint256

The total epoch share value at the time of rebalance.

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_AMOUNT_IN

Thrown when the amount in is zero.

error NO_AMOUNT_IN();

NOTHING_TO_CLAIM

Thrown when there is nothing to claim.

error NOTHING_TO_CLAIM();

NO_WITHDRAWALS_IN_EPOCH

Thrown when attempting an operation on an epoch with no withdrawals.

error NO_WITHDRAWALS_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 amountIn;
}

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 sharesOutstanding;
    uint120 amountIn;
    uint120 amountToBurnAtSettlement;
    bytes32 aggregateRoot;
    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 amountIn;
    uint120 assetsReceived;
    uint120 sharesOutstanding;
    uint120 amountToBurnAtSettlement;
    bytes32 aggregateRoot;
}

ClaimRequest

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

struct ClaimRequest {
    address asset;
    uint256 epoch;
}

Last updated