@@ -470,9 +470,16 @@ contract BondingManager is ManagerProxyTarget, IBondingManager {
470
470
function setCurrentRoundTotalActiveStake () external onlyRoundsManager {
471
471
currentRoundTotalActiveStake = nextRoundTotalActiveStake;
472
472
473
- if (nextRoundTreasuryRewardCutRate != treasuryRewardCutRate) {
473
+ // Set the treasury cut to 0 while the treasury balance is above the ceiling
474
+ uint256 treasuryBalance = livepeerToken ().balanceOf (treasury ());
475
+ if (treasuryBalanceCeiling > 0 && treasuryBalance >= treasuryBalanceCeiling) {
476
+ if (treasuryRewardCutRate > 0 ) {
477
+ treasuryRewardCutRate = 0 ;
478
+ emit ParameterUpdate ("treasuryRewardCutRate " );
479
+ }
480
+ } else if (nextRoundTreasuryRewardCutRate != treasuryRewardCutRate) {
481
+ // Reset to the desired treasury cut rate
474
482
treasuryRewardCutRate = nextRoundTreasuryRewardCutRate;
475
- // The treasury cut rate changes in a delayed fashion so we want to emit the parameter update event here
476
483
emit ParameterUpdate ("treasuryRewardCutRate " );
477
484
}
478
485
@@ -890,14 +897,6 @@ contract BondingManager is ManagerProxyTarget, IBondingManager {
890
897
earningsPool.setStake (t.earningsPoolPerRound[lastUpdateRound].totalStake);
891
898
}
892
899
893
- if (treasuryBalanceCeiling > 0 ) {
894
- uint256 treasuryBalance = livepeerToken ().balanceOf (treasury ());
895
- if (treasuryBalance >= treasuryBalanceCeiling && nextRoundTreasuryRewardCutRate > 0 ) {
896
- // halt treasury contributions until the cut rate param is updated again
897
- _setTreasuryRewardCutRate (0 );
898
- }
899
- }
900
-
901
900
// Create reward based on active transcoder's stake relative to the total active stake
902
901
// rewardTokens = (current mintable tokens for the round * active transcoder stake) / total active stake
903
902
IMinter mtr = minter ();
0 commit comments