Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Lido.handleOracleReport reorder burn and fee distribution #690

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions contracts/0.4.24/Lido.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1175,8 +1175,8 @@ contract Lido is Versioned, StETHPermit, AragonApp {
* 4. Pass the accounting values to sanity checker to smoothen positive token rebase
* (i.e., postpone the extra rewards to be applied during the next rounds)
* 5. Invoke finalization of the withdrawal requests
* 6. Distribute protocol fee (treasury & node operators)
* 7. Burn excess shares within the allowed limit (can postpone some shares to be burnt later)
* 6. Burn excess shares within the allowed limit (can postpone some shares to be burnt later)
* 7. Distribute protocol fee (treasury & node operators)
* 8. Complete token rebase by informing observers (emit an event and call the external receivers if any)
* 9. Sanity check for the provided simulated share rate
*/
Expand Down Expand Up @@ -1261,6 +1261,13 @@ contract Lido is Versioned, StETHPermit, AragonApp {
);

// Step 6.
// Burn the previously requested shares
if (reportContext.sharesToBurn > 0) {
IBurner(contracts.burner).commitSharesToBurn(reportContext.sharesToBurn);
_burnShares(contracts.burner, reportContext.sharesToBurn);
}

// Step 7.
// Distribute protocol fee (treasury & node operators)
reportContext.sharesMintedAsFees = _processRewards(
reportContext,
Expand All @@ -1269,13 +1276,6 @@ contract Lido is Versioned, StETHPermit, AragonApp {
elRewards
);

// Step 7.
// Burn the previously requested shares
if (reportContext.sharesToBurn > 0) {
IBurner(contracts.burner).commitSharesToBurn(reportContext.sharesToBurn);
_burnShares(contracts.burner, reportContext.sharesToBurn);
}

// Step 8.
// Complete token rebase by informing observers (emit an event and call the external receivers if any)
(
Expand Down