@@ -214,7 +214,7 @@ contract AllocationManager is
214214 for (uint256 i = 0 ; i < params.operatorSetIds.length ; i++ ) {
215215 // Check the operator set exists and the operator is registered to it
216216 OperatorSet memory operatorSet = OperatorSet (params.avs, params.operatorSetIds[i]);
217- require (_operatorSets[operatorSet .avs].contains (operatorSet.id), InvalidOperatorSet ());
217+ require (_operatorSets[params .avs].contains (operatorSet.id), InvalidOperatorSet ());
218218 require (registrationStatus[params.operator][operatorSet.key ()].registered, NotMemberOfSet ());
219219
220220 // Remove operator from operator set
@@ -287,7 +287,7 @@ contract AllocationManager is
287287 IStrategy[] calldata strategies
288288 ) external checkCanCall (avs) {
289289 OperatorSet memory operatorSet = OperatorSet (avs, operatorSetId);
290- require (_operatorSets[operatorSet. avs].contains (operatorSet.id), InvalidOperatorSet ());
290+ require (_operatorSets[avs].contains (operatorSet.id), InvalidOperatorSet ());
291291 for (uint256 i = 0 ; i < strategies.length ; i++ ) {
292292 _addStrategyToOperatorSet (
293293 operatorSet, strategies[i], isRedistributingOperatorSet (OperatorSet (avs, operatorSetId))
@@ -302,7 +302,7 @@ contract AllocationManager is
302302 IStrategy[] calldata strategies
303303 ) external checkCanCall (avs) {
304304 OperatorSet memory operatorSet = OperatorSet (avs, operatorSetId);
305- require (_operatorSets[operatorSet. avs].contains (operatorSet.id), InvalidOperatorSet ());
305+ require (_operatorSets[avs].contains (operatorSet.id), InvalidOperatorSet ());
306306 bytes32 operatorSetKey = operatorSet.key ();
307307 for (uint256 i = 0 ; i < strategies.length ; i++ ) {
308308 require (_operatorSetStrategies[operatorSetKey].remove (address (strategies[i])), StrategyNotInOperatorSet ());
@@ -315,6 +315,14 @@ contract AllocationManager is
315315 * INTERNAL FUNCTIONS
316316 *
317317 */
318+
319+ /**
320+ * @dev Slashes an operator.
321+ * @param params The slashing parameters. See IAllocationManager.sol#slashOperator for specifics.
322+ * @param operatorSet The operator set from which the operator is being slashed.
323+ * @return slashId The operator set's unique identifier for the slash.
324+ * @return shares The number of shares to be burned or redistributed for each strategy that was slashed.
325+ */
318326 function _slashOperator (
319327 SlashingParams calldata params ,
320328 OperatorSet memory operatorSet
@@ -323,7 +331,7 @@ contract AllocationManager is
323331 shares = new uint256 [](params.strategies.length );
324332
325333 // Increment the slash count for the operator set.
326- slashId = ++ _slashCount [operatorSet.key ()];
334+ slashId = ++ _slashIds [operatorSet.key ()];
327335
328336 // For each strategy in the operator set, slash any existing allocation
329337 for (uint256 i = 0 ; i < params.strategies.length ; i++ ) {
@@ -1001,15 +1009,17 @@ contract AllocationManager is
10011009 function getSlashCount (
10021010 OperatorSet memory operatorSet
10031011 ) external view returns (uint256 ) {
1004- return _slashCount [operatorSet.key ()];
1012+ return _slashIds [operatorSet.key ()];
10051013 }
10061014
10071015 /// @inheritdoc IAllocationManager
10081016 function isOperatorRedistributable (
10091017 address operator
10101018 ) external view returns (bool ) {
10111019 // Get the registered and allocated sets for the operator.
1012- // We get both sets, since upon deregistration the operator is removed from RegisteredSets, but is still allocated.
1020+ // We get both sets, since:
1021+ // - Upon registration the operator allocation will be pending to a redistributing operator set, and as such not yet in RegisteredSets.
1022+ // - Upon deregistration the operator is removed from RegisteredSets, but is still allocated.
10131023 OperatorSet[] memory registeredSets = getRegisteredSets (operator);
10141024 OperatorSet[] memory allocatedSets = getAllocatedSets (operator);
10151025
0 commit comments