|
3 | 3 | - [Source Code](https://github.com/lidofinance/lido-dao/blob/master/contracts/0.8.9/WithdrawalVault.sol)
|
4 | 4 | - [Deployed Contract](https://etherscan.io/address/0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f)
|
5 | 5 |
|
6 |
| -A vault that corresponds to the type-0x01 Lido withdrawal credentials. |
| 6 | +## What is WithdrawalVault |
| 7 | + |
| 8 | +A simple contract that accumulates partial and full withdrawals that comes from Beacon chain. Its address corresponds to the type-0x01 Lido withdrawal credentials. |
| 9 | +During the accounting oracle report the vault is emptied by Lido to to the internal buffer, see [here](lido.md#oracle-report) for details. |
| 10 | + |
| 11 | +Vault is recoverable, so any tokens or ether can be trasferred to the treasury by DAO. |
| 12 | + |
7 | 13 | The currently deployed version is upgradable because of anticipated changes in Ethereum withdrawals mechanics.
|
8 | 14 |
|
9 | 15 | :::note
|
10 | 16 | The contract is meant to be ossified somewhere after withdrawal credentials triggerable exits are implemented.
|
11 | 17 | :::
|
| 18 | + |
| 19 | +## View methods |
| 20 | + |
| 21 | +### getContractVersion() |
| 22 | + |
| 23 | +Returns the current contract version. |
| 24 | + |
| 25 | +```sol |
| 26 | +function getContractVersion() returns (uint256) |
| 27 | +``` |
| 28 | + |
| 29 | +## Methods |
| 30 | + |
| 31 | +### withdrawWithdrawals() |
| 32 | + |
| 33 | +Transfer `_amount` of accumulated withdrawals to the Lido contract. |
| 34 | + |
| 35 | +:::note |
| 36 | + |
| 37 | +Can be called only by the [Lido](lido.md) contract |
| 38 | + |
| 39 | +::: |
| 40 | + |
| 41 | +```sol |
| 42 | +function withdrawWithdrawals(uint256 _amount) |
| 43 | +``` |
| 44 | + |
| 45 | +### recoverERC20() |
| 46 | + |
| 47 | +Transfers the given amount of the ERC20-token (defined by the provided token contract address) |
| 48 | +currently belonging to the vault contract address to the Lido treasury address. |
| 49 | + |
| 50 | +Emits the `ERC20Recovered` event. |
| 51 | + |
| 52 | + |
| 53 | +```sol |
| 54 | +function recoverERC20(address _token, uint256 _amount) external |
| 55 | +``` |
| 56 | + |
| 57 | +#### Parameters: |
| 58 | + |
| 59 | +| Name | Type | Description | |
| 60 | +| ---------- | --------- | ----------------------- | |
| 61 | +| `_token` | `address` | ERC20-compatible token | |
| 62 | +| `_amount` | `uint256` | token amount to recover | |
| 63 | + |
| 64 | +### recoverERC721() |
| 65 | + |
| 66 | +Transfers the given tokenId of the ERC721-compatible NFT (defined by the provided token contract address) |
| 67 | +currently belonging to the vault contract address to the Lido treasury address. |
| 68 | + |
| 69 | +Emits the `ERC721Recovered` event. |
| 70 | + |
| 71 | +```sol |
| 72 | +function recoverERC721(address _token, uint256 _tokenId) external |
| 73 | +``` |
| 74 | + |
| 75 | +#### Parameters: |
| 76 | + |
| 77 | +| Name | Type | Description | |
| 78 | +| ---------- | --------- | ----------------------- | |
| 79 | +| `_token` | `address` | ERC721-compatible token | |
| 80 | +| `_tokenId` | `uint256` | minted token id | |
0 commit comments