Skip to content

Commit 8a1cac5

Browse files
committed
WithdrawalVault contract doc
1 parent 5ab3190 commit 8a1cac5

File tree

1 file changed

+70
-1
lines changed

1 file changed

+70
-1
lines changed

docs/contracts/withdrawal-vault.md

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,78 @@
33
- [Source Code](https://github.com/lidofinance/lido-dao/blob/master/contracts/0.8.9/WithdrawalVault.sol)
44
- [Deployed Contract](https://etherscan.io/address/0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f)
55

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+
713
The currently deployed version is upgradable because of anticipated changes in Ethereum withdrawals mechanics.
814

915
:::note
1016
The contract is meant to be ossified somewhere after withdrawal credentials triggerable exits are implemented.
1117
:::
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

Comments
 (0)