Skip to content
Lattice

ILidoWithdrawalQueue

Git Source

Title: ILidoWithdrawalQueue

Author: Vendored minimal subset of Lido WithdrawalQueueERC721

(https://github.com/lidofinance/lido-dao/blob/master/contracts/0.8.9/WithdrawalQueueERC721.sol). Upstream license: GPL-3.0.

Minimal vendored subset of the Lido withdrawal queue. Lido withdrawals are an async queue: requesting burns stETH and mints an NFT request id that becomes claimable only after the protocol finalizes it (oracle report + buffer), at which point claiming pays out native ETH. This async leg is why the Lido adapter uses a buffer model — the synchronous IStrategy.withdraw is served from an idle WETH buffer, and the slow queue leg runs out-of-band via the adapter's keeper functions.

Only the selectors the adapter calls are declared. requestWithdrawals / claimWithdrawal move funds (non-view); getWithdrawalStatus is a view reader for the pending/finalized/claimed flags. The adapter requests with owner == address(this) and claims to itself, re-wrapping the received ETH into its WETH buffer.

Functions

requestWithdrawals

Locks amounts of stETH (pulled from the caller; the adapter approves first) and mints one withdrawal-request NFT per entry to owner.

function requestWithdrawals(uint256[] calldata amounts, address owner)
        external
        returns (uint256[] memory requestIds);

Parameters

NameTypeDescription
amountsuint256[]Per-request stETH amounts to withdraw.
owneraddressThe owner of the minted request NFTs (the claimer; the adapter passes itself).

Returns

NameTypeDescription
requestIdsuint256[]The ids of the created withdrawal requests, index-aligned with amounts.

claimWithdrawal

Claims a finalized withdrawal request, sending the owed native ETH to the request owner.

function claimWithdrawal(uint256 requestId) external;

Parameters

NameTypeDescription
requestIduint256The id of the finalized request to claim.

getWithdrawalStatus

Returns the status of each requested withdrawal id.

function getWithdrawalStatus(uint256[] calldata requestIds)
        external
        view
        returns (WithdrawalRequestStatus[] memory statuses);

Parameters

NameTypeDescription
requestIdsuint256[]The request ids to query.

Returns

NameTypeDescription
statusesWithdrawalRequestStatus[]The status struct for each id, index-aligned with requestIds.

Structs

WithdrawalRequestStatus

Per-request status returned by getWithdrawalStatus.

struct WithdrawalRequestStatus {
        uint256 amountOfStETH;
        uint256 amountOfShares;
        address owner;
        uint256 timestamp;
        bool isFinalized;
        bool isClaimed;
    }

Properties

NameTypeDescription
amountOfStETHuint256stETH that was locked for this request.
amountOfSharesuint256Lido shares locked for this request.
owneraddressThe address that owns the request (the claimer).
timestampuint256Block timestamp the request was created.
isFinalizedboolTrue once the request is finalized and claimable.
isClaimedboolTrue once the request's ETH has been claimed.