@@ -684,37 +684,37 @@ contract DelegationManager is
684684 uint64 newMaxMagnitude
685685 ) internal returns (uint256 totalDepositSharesToBurn ) {
686686 // Avoid emitting events if nothing has changed for sanitization.
687- if (prevMaxMagnitude != newMaxMagnitude) {
688- uint256 operatorSharesSlashed = SlashingLib.calcSlashedAmount ({
689- operatorShares: operatorShares[operator][strategy],
690- prevMaxMagnitude: prevMaxMagnitude,
691- newMaxMagnitude: newMaxMagnitude
692- });
687+ if (prevMaxMagnitude == newMaxMagnitude) return 0 ;
693688
694- uint256 scaledSharesSlashedFromQueue = _getSlashableSharesInQueue ({
695- operator: operator,
696- strategy: strategy,
697- prevMaxMagnitude: prevMaxMagnitude,
698- newMaxMagnitude: newMaxMagnitude
699- });
689+ uint256 operatorSharesSlashed = SlashingLib.calcSlashedAmount ({
690+ operatorShares: operatorShares[operator][strategy],
691+ prevMaxMagnitude: prevMaxMagnitude,
692+ newMaxMagnitude: newMaxMagnitude
693+ });
700694
701- // Calculate the total deposit shares to burn - slashed operator shares plus still-slashable
702- // shares sitting in the withdrawal queue.
703- totalDepositSharesToBurn = operatorSharesSlashed + scaledSharesSlashedFromQueue;
695+ uint256 scaledSharesSlashedFromQueue = _getSlashableSharesInQueue ({
696+ operator: operator,
697+ strategy: strategy,
698+ prevMaxMagnitude: prevMaxMagnitude,
699+ newMaxMagnitude: newMaxMagnitude
700+ });
704701
705- // Remove shares from operator
706- _decreaseDelegation ({
707- operator: operator,
708- staker: address (0 ), // we treat this as a decrease for the 0-staker (only used for events)
709- strategy: strategy,
710- sharesToDecrease: operatorSharesSlashed
711- });
702+ // Calculate the total deposit shares to burn - slashed operator shares plus still-slashable
703+ // shares sitting in the withdrawal queue.
704+ totalDepositSharesToBurn = operatorSharesSlashed + scaledSharesSlashedFromQueue;
712705
713- // Emit event for operator shares being slashed
714- emit OperatorSharesSlashed (operator, strategy, totalDepositSharesToBurn);
706+ // Remove shares from operator
707+ _decreaseDelegation ({
708+ operator: operator,
709+ staker: address (0 ), // we treat this as a decrease for the 0-staker (only used for events)
710+ strategy: strategy,
711+ sharesToDecrease: operatorSharesSlashed
712+ });
715713
716- _getShareManager (strategy).increaseBurnableShares (operatorSet, slashId, strategy, totalDepositSharesToBurn);
717- }
714+ // Emit event for operator shares being slashed
715+ emit OperatorSharesSlashed (operator, strategy, totalDepositSharesToBurn);
716+
717+ _getShareManager (strategy).increaseBurnableShares (operatorSet, slashId, strategy, totalDepositSharesToBurn);
718718
719719 return totalDepositSharesToBurn;
720720 }
0 commit comments