@@ -451,18 +451,6 @@ contract IntegrationCheckUtils is IntegrationBase {
451
451
assert_Snap_Unchanged_AllocatableMagnitude (operator, allStrats, "should not have updated allocatable magnitude " );
452
452
}
453
453
454
- // /// @dev Checks invariants for registration for a variety of allocation states
455
- // ///
456
- // function check_Registration_State(
457
- // User operator,
458
- // OperatorSet memory operatorSet,
459
- // IStrategy[] memory unallocated,
460
- // AllocateParams memory pending,
461
- // AllocateParams memory active
462
- // ) internal {
463
- // check_Base_Registration_State(operator, operatorSet);
464
- // }
465
-
466
454
/// @dev Check invariants for registerForOperatorSets given a set of strategies
467
455
/// for which NO allocation exists (currentMag/pendingDiff are 0)
468
456
/// @param unallocated For the given operatorSet, a list of strategies for which NO allocation exists
@@ -839,6 +827,37 @@ contract IntegrationCheckUtils is IntegrationBase {
839
827
check_ActiveModification_State (operator, deallocateParams);
840
828
}
841
829
830
+ /*******************************************************************************
831
+ ALM - SLASHING
832
+ *******************************************************************************/
833
+
834
+ function check_Base_Slashing_State (
835
+ User operator ,
836
+ AllocateParams memory allocateParams ,
837
+ SlashingParams memory slashParams
838
+ ) internal {
839
+ OperatorSet memory operatorSet = allocateParams.operatorSet;
840
+
841
+ check_MaxMag_Invariants (operator);
842
+ check_IsSlashable_State (operator, operatorSet, allocateParams.strategies);
843
+
844
+ // Slashing SHOULD change max magnitude and current allocation
845
+ assert_Snap_Slashed_MaxMagnitude (operator, slashParams, "slash should lower max magnitude " );
846
+ assert_Snap_Slashed_EncumberedMagnitude (operator, slashParams, "slash should lower max magnitude " );
847
+ assert_Snap_Slashed_AllocatedStake (operator, operatorSet, slashParams, "slash should lower allocated stake " );
848
+ assert_Snap_Slashed_SlashableStake (operator, operatorSet, slashParams, "slash should lower slashable stake " );
849
+ assert_Snap_Slashed_OperatorShares (operator, slashParams, "slash should remove operator shares " );
850
+ assert_Snap_Slashed_Allocation (operator, operatorSet, slashParams, "slash should reduce current magnitude " );
851
+ assert_Snap_Increased_BurnableShares (operator, slashParams, "slash should increase burnable shares " );
852
+
853
+ // Slashing SHOULD NOT change allocatable magnitude, registration, and slashability status
854
+ assert_Snap_Unchanged_AllocatableMagnitude (operator, allStrats, "slashing should not change allocatable magnitude " );
855
+ assert_Snap_Unchanged_Registration (operator, operatorSet, "slash should not change registration status " );
856
+ assert_Snap_Unchanged_Slashability (operator, operatorSet, "slash should not change slashability status " );
857
+ assert_Snap_Unchanged_AllocatedSets (operator, "should not have updated allocated sets " );
858
+ assert_Snap_Unchanged_AllocatedStrats (operator, operatorSet, "should not have updated allocated strategies " );
859
+ }
860
+
842
861
// TODO: improvement needed
843
862
844
863
/// @dev Run a method as if the user's allocation delay had passed
0 commit comments