@@ -285,16 +285,40 @@ contract DelegationManager is
285285 address operator ,
286286 OperatorSet calldata operatorSet ,
287287 uint256 slashId ,
288- IStrategy[] calldata strategies ,
289- uint64 [] calldata prevMaxMagnitudes ,
290- uint64 [] calldata newMaxMagnitudes
291- ) external onlyAllocationManager nonReentrant returns (uint256 [] memory totalDepositSharesToBurn ) {
292- totalDepositSharesToBurn = new uint256 [](strategies.length );
293- for (uint256 i = 0 ; i < strategies.length ; i++ ) {
294- totalDepositSharesToBurn[i] = _slashOperatorShares (
295- operator, operatorSet, slashId, strategies[i], prevMaxMagnitudes[i], newMaxMagnitudes[i]
296- );
297- }
288+ IStrategy strategy ,
289+ uint64 prevMaxMagnitude ,
290+ uint64 newMaxMagnitude
291+ ) external onlyAllocationManager nonReentrant returns (uint256 totalDepositSharesToBurn ) {
292+ uint256 operatorSharesSlashed = SlashingLib.calcSlashedAmount ({
293+ operatorShares: operatorShares[operator][strategy],
294+ prevMaxMagnitude: prevMaxMagnitude,
295+ newMaxMagnitude: newMaxMagnitude
296+ });
297+
298+ uint256 scaledSharesSlashedFromQueue = _getSlashableSharesInQueue ({
299+ operator: operator,
300+ strategy: strategy,
301+ prevMaxMagnitude: prevMaxMagnitude,
302+ newMaxMagnitude: newMaxMagnitude
303+ });
304+
305+ // Calculate the total deposit shares to burn - slashed operator shares plus still-slashable
306+ // shares sitting in the withdrawal queue.
307+ totalDepositSharesToBurn = operatorSharesSlashed + scaledSharesSlashedFromQueue;
308+
309+ // Remove shares from operator
310+ _decreaseDelegation ({
311+ operator: operator,
312+ staker: address (0 ), // we treat this as a decrease for the 0-staker (only used for events)
313+ strategy: strategy,
314+ sharesToDecrease: operatorSharesSlashed
315+ });
316+
317+ // Emit event for operator shares being slashed
318+ emit OperatorSharesSlashed (operator, strategy, totalDepositSharesToBurn);
319+
320+ _getShareManager (strategy).increaseBurnableShares (operatorSet, slashId, strategy, totalDepositSharesToBurn);
321+
298322 return totalDepositSharesToBurn;
299323 }
300324
@@ -667,54 +691,8 @@ contract DelegationManager is
667691 emit OperatorSharesDecreased (operator, staker, strategy, sharesToDecrease);
668692 }
669693
670- /// @dev Slashes operator shares and queues a redistribution for the slashable shares in the queue.
671- /// See `slashOperatorShares` for more details.
672- function _slashOperatorShares (
673- address operator ,
674- OperatorSet memory operatorSet ,
675- uint256 slashId ,
676- IStrategy strategy ,
677- uint64 prevMaxMagnitude ,
678- uint64 newMaxMagnitude
679- ) internal returns (uint256 totalDepositSharesToBurn ) {
680- // Avoid emitting events if nothing has changed for sanitization.
681- if (prevMaxMagnitude == newMaxMagnitude) return 0 ;
682-
683- uint256 operatorSharesSlashed = SlashingLib.calcSlashedAmount ({
684- operatorShares: operatorShares[operator][strategy],
685- prevMaxMagnitude: prevMaxMagnitude,
686- newMaxMagnitude: newMaxMagnitude
687- });
688-
689- uint256 scaledSharesSlashedFromQueue = _getSlashableSharesInQueue ({
690- operator: operator,
691- strategy: strategy,
692- prevMaxMagnitude: prevMaxMagnitude,
693- newMaxMagnitude: newMaxMagnitude
694- });
695-
696- // Calculate the total deposit shares to burn - slashed operator shares plus still-slashable
697- // shares sitting in the withdrawal queue.
698- totalDepositSharesToBurn = operatorSharesSlashed + scaledSharesSlashedFromQueue;
699-
700- // Remove shares from operator
701- _decreaseDelegation ({
702- operator: operator,
703- staker: address (0 ), // we treat this as a decrease for the 0-staker (only used for events)
704- strategy: strategy,
705- sharesToDecrease: operatorSharesSlashed
706- });
707-
708- // Emit event for operator shares being slashed
709- emit OperatorSharesSlashed (operator, strategy, totalDepositSharesToBurn);
710-
711- _getShareManager (strategy).increaseBurnableShares (operatorSet, slashId, strategy, totalDepositSharesToBurn);
712-
713- return totalDepositSharesToBurn;
714- }
715-
716694 /// @dev If `operator` has configured a `delegationApprover`, check that `signature` and `salt`
717- /// are a valid approval for `staker` delegating to `operator`.
695+ /// are a valid appfroval for `staker` delegating to `operator`.
718696 function _checkApproverSignature (
719697 address staker ,
720698 address operator ,
0 commit comments