
Lido · Acts onchain
Queues stETH for withdrawal through Lido's queue and receives a claimable request NFT. The socket approves the withdrawal queue and requests the withdrawal; the queue mints a request NFT whose id is returned and tagged as a position. Amounts above the 1000 stETH per-request cap are split into a batch of requests, each returning its own id. ETH is paid later, once finalized and claimed. Set the amount to max to queue the full balance. Reach for it as the first half of an unstake, storing the request id so a later run can claim it.
Unstake From Lido, Claim It When It Clears, Restake It



1·Take
Declares unstake_amount as a caller-supplied parameter, the quantity of stETH to queue for withdrawal at execution time.
2·Read stored value
Reads the stored unstake_request value from this plug's own storage, pulling whatever request identifier a prior run may have saved.
3·Predicate
Comparing the stored unstake_request against 0 with an equality operator, control branches on whether no request is currently outstanding.
4·Request withdrawal
When no request exists, the unstake_amount of stETH at 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 is queued for withdrawal through Lido, yielding a claimable request NFT.
5·Set stored value
Writing the resulting request identifier back into plug storage under unstake_request, this persists the open claim for the next run to find.
6·Else branch
Opening the else branch, this defines what runs when a request identifier was already stored.
7·Claim withdrawal
On that branch, the stored unstake_request is claimed from Lido, and once the request has finalized the socket receives native ETH.
8·Set stored value
Resetting the stored unstake_request to 0 clears the marker, so a future run starts a fresh withdrawal.
9·Get token balance
Reading the ETH balance held by the socket at 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE, this measures the native ETH now on hand.
10·Stake
Staking that measured ETH balance with Lido returns stETH at 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84, restaking the claimed proceeds.
11·End block
Closing the innermost open block, this ends the else branch.