Restaking Smart Contract Developer (Testnet)
The following instructions include an overview of the changes to Smart Contract Restaking per the Slashing and Operator Set release. All existing instructions on Restaking Smart Contract Developer remain unchanged for this update, except where noted below.
The following is not a complete description of the Slashing and Operator Sets upgrade and is qualified in its entirety by reference to the Unique Stake Allocation & Deallocation ELIP-002.
Key EigenLayer Protocol references for this guide:
- Source Code: for all the following references to EigenLayer core contracts and functions, please see the src/contracts folder for their source code.
- Developer Documentation (specifications): detailed protocol specifications for restaking smart contract integration developers.
- Deployed Contract Addresses: deployed contract addresses for Mainnet and Testnet.
- Integration Tests: tests that serve as examples on how to interact with the EigenLayer core contracts.
Withdraw (Unstake) Liquid Tokens
- Invoke
DelegationManager.getWithdrawableShares()
to determine the Staker’s withdrawable shares, which represent deposited shares minus slashed shares. withdrawable shares, which represent deposited shares minus slashed shares. - Prepare the 'depositShares' parameter for the queueWithdrawals() function.
- Pass the number of withdrawable shares as input to the
convertToDepositShares()
function. - The resulting value represents the amount to be used in the 'depositShares' parameter in the queueWithdrawals() function.
- Pass the number of withdrawable shares as input to the
- Queue Withdrawal: invoke DelegationManager.queueWithdrawals() to trigger the escrow period.
- Please see the
QueuedWithdrawalParams
struct documentation for more details on how to construct the input parameters. - Please see further detail here on the escrow period.
- Please see the
- Complete Withdrawal as Tokens: invoke DelegationManager.completeQueuedWithdrawal() to complete the withdrawal and return assets to the withdrawer's wallet.
Delegation
The Delegation steps remain unchanged for the Slashing and Operator Set release.
Note: For a given asset, if the Operator has been slashed 100% for that Strategy, then no new Stakers can delegate to the Operator if they hold this Strategy asset. This was designed to avoid smart contract division by zero (0) errors.
Withdraw Native ETH Balance
This process is intended to allow users to withdraw their Native beacon chain balance from the EigenPod.
- Validator Exit
- Fully exit the Validator. You may monitor its activity via beaconcha.in/validator/[yourvalidatorid] .
- Wait for the final beacon chain withdrawal to be deposited to your EigenPod. There can be a lag of up to 24 hours to 7 days between the validator appearing as "exited" and the withdrawal amount deposited to EigenPod. Please see the "Withdrawals" tab and "Time" column for your validator via beaconcha.in/validator/[yourvalidatorid]#withdrawals . The ETH will then be recognized in the EigenPod.
- Generate checkpoint proof via eigenpod-proofs-generation CLI in order to initiate and complete a checkpoint.
- Determine the number of withdrawable shares.
- Invoke
DelegationManager.getWithdrawableShares()
to determine the Staker’s withdrawable shares, which represent deposited shares minus slashed shares. - Invoke
[YourEigenPod].withdrawableRestakedExecutionLayerGwei()
to get the amount of withdrawable execution layer ETH in gwei. Convert the gwei to wei (multiply by by 10^9 or 1,000,000,000). - Confirm the number of withdrawable shares is less than withdrawableRestakedExecutionLayerGwei. Otherwise, the withdrawal will not be completable after it is queued.
- Invoke
- Prepare the
depositShares
parameter for the queueWithdrawals() function.- Pass the number of withdrawable shares as input to the
convertToDepositShares()
function. - The resulting value represents the amount to be used in the
depositShares
parameter in the queueWithdrawals() function.
- Pass the number of withdrawable shares as input to the
- Invoke the DelegationManager.queueWithdrawals() function.
- This function can only be invoked by the EigenPod Owner wallet.
- Please see the
QueuedWithdrawalParams
struct documentation for more details on how to construct the input parameters. - strategies - use the Beacon chain ETH strategy (0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0).
- Wait for the Escrow Period to complete.
- Invoke
DelegationManager.completeQueuedWithdrawal()
.
Withdraw Yield Only
This process is intended to allow users to withdraw yield (beacon chain consensus rewards, execution fees, and ETH) from the EigenPod.
- Generate checkpoint proof via eigenpod-proofs-generation CLI in order to initiate and complete a checkpoint.
- Determine the number of withdrawable shares.
- Invoke
DelegationManager.getWithdrawableShares()
to determine the Staker’s withdrawable shares, which represent deposited shares minus slashed shares. - Invoke
[YourEigenPod].withdrawableRestakedExecutionLayerGwei()
to get the amount of withdrawable execution layer ETH in gwei. Convert the gwei to wei (multiply by by 10^9 or 1,000,000,000). - Confirm the number of withdrawable shares is less than withdrawableRestakedExecutionLayerGwei. Otherwise, the withdrawal will not be completable after it is queued.
- Invoke
- Prepare the
depositShares
parameter for the queueWithdrawals() function.- Pass the number of withdrawable shares as input to the
convertToDepositShares()
function. - The resulting value represents the amount to be used in the
depositShares
parameter in the queueWithdrawals() function.
- Pass the number of withdrawable shares as input to the
- Invoke the DelegationManager.queueWithdrawals() function.
- This function can only be invoked by the EigenPod Owner wallet.
- Please see the
QueuedWithdrawalParams
struct documentation for more details on how to construct the input parameters. - strategies - use the Beacon chain ETH strategy (0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0).
- Wait for the Escrow Period to complete.
- Invoke DelegationManager.completeQueuedWithdrawal().