@@ -11,17 +11,17 @@ user balance using the following equation:
11
11
` balanceOf(account) = shares[account] * totalPooledEther / totalShares ` .
12
12
Therefore, burning shares (e.g. decreasing the ` totalShares ` amount) increases stETH holders' balances.
13
13
14
- It's presumed that actual shares burning happens inside the ` Lido ` contract as a part of the ` AccountingOracleReport ` .
14
+ It's presumed that actual shares burning happens inside the ` Lido ` contract as a part of the ` AccountingOracle ` report .
15
15
` Burner ` provides a safe and deterministic way to incur a positive stETH token rebase by gradually
16
16
decreasing ` totalShares ` that can be correctly handled by 3rd party protocols integrated with stETH.
17
17
18
- ` Burner ` accepts burning requests by the following two ways:
18
+ ` Burner ` accepts burning requests in the following two ways:
19
19
20
- - Locking pre-approved stETH tokens by the caller with an assigned role.
20
+ - Locking pre-approved stETH tokens by the caller with an assigned role;
21
21
- Locking caller-provided stETH tokens.
22
22
23
23
Those burn requests are initially set by the contract to a pending state.
24
- Actual burning happens as part of an oracle (` AccountinOracle ` ) report handling by ` Lido ` to prevent
24
+ Actual burning happens as part of an oracle (` AccountingOracle ` ) report handling by ` Lido ` to prevent
25
25
additional fluctuations of the existing stETH token rebase period (~ 24h).
26
26
27
27
We also distinguish two types of shares burn requests:
@@ -30,13 +30,13 @@ between the two consecutive oracle reports);
30
30
* request to burn shares for any other cases (** non-cover** ).
31
31
32
32
The contract has two separate counters for the burnt shares: cover and non-cover ones. The contract is
33
- exclusive responsible for the stETH shares burning via by ` Lido ` and burning allowed only from the contract's
33
+ exclusively responsible for the stETH shares burning by ` Lido ` and burning allowed only from the contract's
34
34
own balance only.
35
35
36
36
## Shares burnt counters
37
37
38
38
The contract keeps count of all shares ever burned by way of maintaining two internal counters:
39
- ` totalCoverSharesBurnt ` and ` totalNonCoverSharesBurnt ` for cover and non-cover burns respectively.
39
+ ` totalCoverSharesBurnt ` and ` totalNonCoverSharesBurnt ` for cover and non-cover burns, respectively.
40
40
These counters are increased when actual stETH burn is performed as part of the Lido Oracle report.
41
41
42
42
This makes it possible to split any stETH rebase into two sub-components: the rewards-induced rebase
@@ -78,12 +78,20 @@ Returns the total non-cover shares ever burnt.
78
78
function getNonCoverSharesBurnt() external view returns (uint256)
79
79
```
80
80
81
- ### function getExcessStETH
81
+ ### Function: getExcessStETH
82
82
83
83
Returns the stETH amount belonging to the burner contract address but not marked for burning.
84
84
85
85
``` sol
86
- function getExcessStETH() external view return (uint256)
86
+ function getExcessStETH() external view returns (uint256)
87
+ ```
88
+
89
+ ### Function: getSharesRequestedToBurn
90
+
91
+ Returns numbers of cover and non-cover shares requested to burn
92
+
93
+ ``` sol
94
+ function getSharesRequestedToBurn() external view returns (uint256 coverShares, uint256 nonCoverShares)
87
95
```
88
96
89
97
## Methods
@@ -95,42 +103,93 @@ Internally converts tokens amount into underlying shares amount and marks the co
95
103
for cover-backed burning by increasing the internal ` coverSharesBurnRequested ` counter.
96
104
97
105
``` sol
98
- function requestBurnMyStETHForCover(uint256 _stETH2Burn) external
106
+ function requestBurnMyStETHForCover(uint256 _stETHAmountToBurn) external
107
+ ```
108
+
109
+ ::: note
110
+ Reverts if any of the following is true:
111
+ * ` msg.sender ` is not a holder of ` REQUEST_BURN_MY_STETH_ROLE ` role;
112
+ * no stETH provided (` _stETHAmountToBurn == 0 ` );
113
+ * no stETH transferred (allowance exceeded).
114
+ :::
115
+
116
+ #### Parameters:
117
+
118
+ | Name | Type | Description |
119
+ | -------------------- | --------- | ----------------------------------------------- |
120
+ | ` _stETHAmountToBurn ` | ` uint256 ` | stETH tokens amount (not shares amount) to burn |
121
+
122
+ ### Function: requestBurnSharesForCover
123
+
124
+ Transfers stETH shares from ` _from ` and irreversibly locks these on the burner contract address.
125
+ Internally marks the shares amount for cover-backed burning by increasing the internal ` coverSharesBurnRequested ` counter.
126
+
127
+ Can be called only by a holder of ` REQUEST_BURN_SHARES_ROLE ` which after Lido V2 upgrade is either
128
+ * ` Lido ` contract (this contract actually burns shares accumulated on the ` Burner ` contract upon ` AccountingOracle ` report)
129
+ * or ` NodeOperatorsRegistry ` contract (needed for penalizing node operators rewards).
130
+
131
+ ``` sol
132
+ function requestBurnSharesForCover(address _from, uint256 _sharesAmountToBurn)
99
133
```
100
134
101
135
::: note
102
136
Reverts if any of the following is true:
103
- * ` msg.sender ` is not equal to the set upon construction ` voting ` address ;
104
- * no stETH provided (` _stETH2Burn == 0` );
137
+ * ` msg.sender ` is not a holder of ` REQUEST_BURN_SHARES_ROLE ` role ;
138
+ * no stETH provided (` _stETHAmountToBurn == 0` );
105
139
* no stETH transferred (allowance exceeded).
106
140
:::
107
141
108
142
#### Parameters:
109
143
110
- | Name | Type | Description |
111
- | ------------- | --------- | ----------------------------------------------- |
112
- | ` _stETH2Burn ` | ` uint256 ` | stETH tokens amount (not shares amount) to burn |
144
+ | Name | Type | Description |
145
+ | -------------------- | --------- | ----------------------------------------------- |
146
+ | ` _from ` | ` address ` | address to transfer shares from |
147
+ | ` _stETHAmountToBurn ` | ` uint256 ` | shares amount (not stETH tokens amount) to burn |
113
148
114
149
### Function: requestBurnMyStETH
115
150
116
151
Transfers stETH tokens from the message sender and irreversibly locks these on the burner contract address.
117
152
Internally converts tokens amount into underlying shares amount and marks the converted amount for
118
153
non-cover-backed burning by increasing the internal ` nonCoverSharesBurnRequested ` counter.
119
154
155
+ ``` sol
156
+ function requestBurnMyStETH(uint256 _stETHAmountToBurn) external
157
+ ```
158
+
120
159
::: note
121
160
Reverts if any of the following is true:
122
- * ` msg.sender ` is not equal to the set upon construction ` voting ` address ;
123
- * no stETH provided (` _stETH2Burn == 0` );
161
+ * ` msg.sender ` is not a holder of ` REQUEST_BURN_MY_STETH_ROLE ` role ;
162
+ * no stETH provided (` _stETHAmountToBurn == 0` );
124
163
* no stETH transferred (allowance exceeded).
125
164
:::
126
165
127
166
#### Parameters:
128
167
129
- | Name | Type | Description |
130
- | ------------- | --------- | ----------------------------------------------- |
131
- | ` _stETH2Burn ` | ` uint256 ` | stETH tokens amount (not shares amount) to burn |
168
+ | Name | Type | Description |
169
+ | -------------------- | --------- | ----------------------------------------------- |
170
+ | ` _stETHAmountToBurn ` | ` uint256 ` | stETH tokens amount (not shares amount) to burn |
171
+
172
+ ### Function: requestBurnShares
173
+
174
+ Transfers stETH shares from ` _from ` and irreversibly locks these on the burner contract address.
175
+ Internally marks the shares amount for non-cover backed burning by increasing the internal ` nonCoverSharesBurnRequested ` counter.
132
176
133
- ### function recoverExcessStETH
177
+ Can be called only by a holder of ` REQUEST_BURN_SHARES_ROLE ` which after Lido V2 upgrade is either
178
+ * ` Lido ` contract (this contract actually burns shares accumulated on the ` Burner ` contract upon ` AccountingOracle ` report)
179
+ * or ` NodeOperatorsRegistry ` contract (needed for penalizing node operators rewards).
180
+
181
+ ``` sol
182
+ function requestBurnShares(address _from, uint256 _sharesAmountToBurn)
183
+ ```
184
+
185
+ ::: note
186
+ Reverts if any of the following is true:
187
+ * ` msg.sender ` is not a holder of ` REQUEST_BURN_SHARES_ROLE ` role;
188
+ * no stETH provided (` _stETHAmountToBurn == 0 ` );
189
+ * no stETH transferred (allowance exceeded).
190
+ :::
191
+
192
+ ### Function: recoverExcessStETH
134
193
135
194
Transfers the excess stETH amount (e.g. belonging to the burner contract address but not marked for burning)
136
195
to the Lido treasury address (the ` DAO Agent ` contract) set upon the contract construction.
@@ -154,7 +213,7 @@ function recoverERC20(address _token, uint256 _amount) external
154
213
Reverts if any of the following is true:
155
214
* ` _amount ` value is 0 (zero);
156
215
* ` _token ` address is 0 (zero);
157
- * ` _token ` address is equal to the ` stETH ` address (use ` recoverExcessStETH ` instead).
216
+ * ` _token ` address equals to the ` stETH ` address (use ` recoverExcessStETH ` instead).
158
217
:::
159
218
160
219
#### Parameters:
@@ -166,18 +225,43 @@ Reverts if any of the following is true:
166
225
167
226
### Function: recoverERC721
168
227
169
- Transfers a given ERC721-compatible NFT (defined by the contract address) belonging to the burner contract address
170
- to the Lido treasury (the ` DAO Agent ` ) address.
228
+ Transfers a given ERC721-compatible NFT (defined by the contract address) belonging
229
+ to the burner contract address to the Lido treasury (the ` DAO Agent ` ) address.
171
230
172
231
``` sol
173
232
function recoverERC721(address _token, uint256 _tokenId) external
174
233
```
175
234
176
235
::: note
177
- Reverts if ` _token ` address is 0 (zero).
236
+ Reverts if any of the following is true:
237
+ * ` _token ` address is 0 (zero);
238
+ * ` _token ` address equals to the ` stETH ` address (use ` recoverExcessStETH ` instead).
178
239
:::
179
240
180
241
| Name | Type | Description |
181
242
| ---------- | --------- | ------------------------------------------- |
182
243
| ` _token ` | ` address ` | ERC721-compatible token address to recover |
183
244
| ` _tokenId ` | ` uint256 ` | Token id to recover |
245
+
246
+
247
+ ### Function: commitSharesToBurn
248
+
249
+ Marks previously requested to burn cover and non-cover share as burnt.
250
+ Emits ` StETHBurnt ` event for the cover and non-cover shared marked as burnt.
251
+ This function is called by the ` Lido ` contract right before performing the actual shares burning.
252
+
253
+ If ` _sharesToBurn ` is 0 does nothing.
254
+
255
+ ``` sol
256
+ function commitSharesToBurn(uint256 _sharesToBurn) external
257
+ ```
258
+
259
+ ::: note
260
+ Reverts if any of the following is true:
261
+ * ` msg.sender ` address is NOT equal to the ` stETH ` address
262
+ * ` _sharesToBurn ` is greater than the cover and non-cover shares requested to burn
263
+ :::
264
+
265
+ | Name | Type | Description |
266
+ | --------------- | --------- | ------------------------------------------------------ |
267
+ | ` _sharesToBurn ` | ` uint256 ` | Amount of cover plus non-cover shares to mark as burnt |
0 commit comments