WithdrawalVault
- Source Code
- Deployed Contract
- Inherits WithdrawalVaultEIP7002. Interface that implements basic EIP-7002 functionality.
What is WithdrawalVault
A simple contract that accumulates partial and full withdrawals that come from the Beacon Chain. Its address corresponds to the type-0x01 Lido withdrawal credentials. During the accounting oracle report, the vault is emptied by Lido into the internal buffer; see Lido contract docs for details.
The vault is recoverable, so the DAO can transfer any ERC-20 and ERC-721 tokens to the treasury.
WithdrawalVault supports EIP-7002 - execution-layer triggered partial and full withdrawals.
The currently deployed version is upgradable because of anticipated Ethereum withdrawal mechanics changes.
View methods
getContractVersion()
Returns the current contract version.
function getContractVersion() returns (uint256)
Methods
withdrawWithdrawals()
Transfers the _amount of accumulated withdrawals to the Lido contract.
It can be called only by the Lido contract.
function withdrawWithdrawals(uint256 _amount)
recoverERC20()
Transfers the given amount of the ERC20-token (defined by the provided token contract address) currently belonging to the vault contract address to the Lido treasury address.
Emits a ERC20Recovered event.
function recoverERC20(address _token, uint256 _amount) external
Parameters:
| Name | Type | Description |
|---|---|---|
_token | address | ERC20-compatible token |
_amount | uint256 | token amount to recover |
recoverERC721()
Transfers the given tokenId of the ERC721-compatible NFT (defined by the provided token contract address) currently belonging to the vault contract address to the Lido treasury address.
Emits an ERC721Recovered event.
function recoverERC721(address _token, uint256 _tokenId) external
Parameters:
| Name | Type | Description |
|---|---|---|
_token | address | ERC721-compatible token |
_tokenId | uint256 | minted token id |
getWithdrawalRequestFee
Returns fee amount required per withdrawal request.
function getWithdrawalRequestFee() public view returns (uint256);
Returns:
| Name | Type | Description |
|---|---|---|
withdrawalRequestFee | uint256 | Current withdrawal request fee. |