@@ -470,12 +470,21 @@ contract BondingManager is ManagerProxyTarget, IBondingManager {
470
470
function setCurrentRoundTotalActiveStake () external onlyRoundsManager {
471
471
currentRoundTotalActiveStake = nextRoundTotalActiveStake;
472
472
473
+ // Apply any queued changes to the treasury cut
473
474
if (nextRoundTreasuryRewardCutRate != treasuryRewardCutRate) {
474
475
treasuryRewardCutRate = nextRoundTreasuryRewardCutRate;
475
476
// The treasury cut rate changes in a delayed fashion so we want to emit the parameter update event here
476
477
emit ParameterUpdate ("treasuryRewardCutRate " );
477
478
}
478
479
480
+ // Set the treasury cut to 0 while the treasury balance is above the ceiling
481
+ if (treasuryBalanceCeiling > 0 ) {
482
+ uint256 treasuryBalance = livepeerToken ().balanceOf (treasury ());
483
+ if (treasuryBalance >= treasuryBalanceCeiling && treasuryRewardCutRate > 0 ) {
484
+ treasuryRewardCutRate = 0 ;
485
+ }
486
+ }
487
+
479
488
bondingVotes ().checkpointTotalActiveStake (currentRoundTotalActiveStake, roundsManager ().currentRound ());
480
489
}
481
490
@@ -890,14 +899,6 @@ contract BondingManager is ManagerProxyTarget, IBondingManager {
890
899
earningsPool.setStake (t.earningsPoolPerRound[lastUpdateRound].totalStake);
891
900
}
892
901
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
902
// Create reward based on active transcoder's stake relative to the total active stake
902
903
// rewardTokens = (current mintable tokens for the round * active transcoder stake) / total active stake
903
904
IMinter mtr = minter ();
0 commit comments