@@ -338,6 +338,10 @@ contract IntegrationCheckUtils is IntegrationBase {
338338 ALLOCATION MANAGER CHECKS
339339 *******************************************************************************/
340340
341+ function _calculateSlippage (uint256 x , uint256 y , uint256 z ) internal pure returns (uint256 r ) {
342+ return mulmod (x, y, z) > 0 ? 1 : 0 ;
343+ }
344+
341345 function check_Withdrawal_AsTokens_State_AfterSlash (
342346 User staker ,
343347 User operator ,
@@ -348,19 +352,23 @@ contract IntegrationCheckUtils is IntegrationBase {
348352 ) internal {
349353 IERC20 [] memory tokens = new IERC20 [](withdrawal.strategies.length );
350354
351- for (uint256 i; i < withdrawal.strategies.length ; i++ ) {
355+ for (uint i; i < withdrawal.strategies.length ; i++ ) {
352356 IStrategy strat = withdrawal.strategies[i];
353357
354358 bool isBeaconChainETHStrategy = strat == beaconChainETHStrategy;
355359
356360 tokens[i] = isBeaconChainETHStrategy ? NATIVE_ETH : withdrawal.strategies[i].underlyingToken ();
357361
358362 if (slashingParams.strategies.contains (strat)) {
359- uint256 wadToSlash = slashingParams.wadsToSlash[slashingParams.strategies.indexOf (strat)];
363+ uint wadToSlash = slashingParams.wadsToSlash[slashingParams.strategies.indexOf (strat)];
360364
361365 expectedTokens[i] -= expectedTokens[i]
362366 .mulWadRoundUp (allocateParams.newMagnitudes[i].mulWadRoundUp (wadToSlash));
363367
368+ uint256 max = allocationManager.getMaxMagnitude (address (operator), strat);
369+
370+ withdrawal.scaledShares[i] -= withdrawal.scaledShares[i].calcSlashedAmount (WAD, max);
371+
364372 // Round down to the nearest gwei for beaconchain ETH strategy.
365373 if (isBeaconChainETHStrategy) {
366374 expectedTokens[i] -= expectedTokens[i] % 1 gwei ;
0 commit comments