Skip to content

Commit

Permalink
Merge pull request #690 from lidofinance/fix/lido-reorder-burn
Browse files Browse the repository at this point in the history
Fix: Lido.handleOracleReport reorder burn and fee distribution
  • Loading branch information
TheDZhon authored Mar 16, 2023
2 parents 2ac38c7 + ac8b87d commit e6e0edc
Showing 1 changed file with 9 additions and 9 deletions.
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

0 comments on commit e6e0edc

Please sign in to comment.