From 9be27cc19c2f09a5d0d9ce09bf75872b7941e126 Mon Sep 17 00:00:00 2001 From: gpsanant Date: Fri, 20 Sep 2024 18:17:46 -0700 Subject: [PATCH] fix compile errors --- script/deploy/devnet/operatorSets/PopulateSRC.sol | 2 +- src/contracts/core/AllocationManager.sol | 2 +- src/contracts/core/DelegationManager.sol | 10 +++++----- src/contracts/core/StakeRootCompendium.sol | 2 +- src/contracts/interfaces/IDelegationManager.sol | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/script/deploy/devnet/operatorSets/PopulateSRC.sol b/script/deploy/devnet/operatorSets/PopulateSRC.sol index fee95f9127..082b98d0f7 100644 --- a/script/deploy/devnet/operatorSets/PopulateSRC.sol +++ b/script/deploy/devnet/operatorSets/PopulateSRC.sol @@ -209,7 +209,7 @@ contract OperatorFactory is Test { } function allocateForOperators(IStrategy strategy, OperatorSet calldata operatorSet, address[] memory operators, uint64 magnitudeForOperators) public { - uint64 expectedTotalMagnitude = SlashingLib.INITIAL_TOTAL_MAGNITUDE; + uint64 expectedTotalMagnitude = WAD; OperatorSet[] memory operatorSets = new OperatorSet[](1); operatorSets[0] = operatorSet; diff --git a/src/contracts/core/AllocationManager.sol b/src/contracts/core/AllocationManager.sol index c31d289768..18d2b99cf4 100644 --- a/src/contracts/core/AllocationManager.sol +++ b/src/contracts/core/AllocationManager.sol @@ -427,7 +427,7 @@ contract AllocationManager is function _getLatestTotalMagnitudeView(address operator, IStrategy strategy) internal view returns (uint64) { (bool exists,, uint224 totalMagnitude) = _totalMagnitudeUpdate[operator][strategy].latestSnapshot(); if (!exists) { - totalMagnitude = SlashingLib.INITIAL_TOTAL_MAGNITUDE; + totalMagnitude = WAD; } return uint64(totalMagnitude); diff --git a/src/contracts/core/DelegationManager.sol b/src/contracts/core/DelegationManager.sol index c41a019ebd..2833d2c218 100644 --- a/src/contracts/core/DelegationManager.sol +++ b/src/contracts/core/DelegationManager.sol @@ -854,16 +854,16 @@ contract DelegationManager is return Shares.unwrap(DelegatedShares.wrap(operatorDelegatedShares[operator][strategy]).toShares(totalMagnitude)); } - /// @notice Given array of strategies, returns array of scaled shares for the operator - function getOperatorScaledShares( + /// @notice Given array of strategies, returns array of delegated shares for the operator + function getOperatorDelegatedShares( address operator, IStrategy[] memory strategies ) external view returns (uint256[] memory) { - uint256[] memory scaledShares = new uint256[](strategies.length); + uint256[] memory delegatedShares = new uint256[](strategies.length); for (uint256 i = 0; i < strategies.length; ++i) { - scaledShares[i] = operatorScaledShares[operator][strategies[i]]; + delegatedShares[i] = operatorDelegatedShares[operator][strategies[i]]; } - return scaledShares; + return delegatedShares; } /** diff --git a/src/contracts/core/StakeRootCompendium.sol b/src/contracts/core/StakeRootCompendium.sol index ed76e16596..5f2bb0eb98 100644 --- a/src/contracts/core/StakeRootCompendium.sol +++ b/src/contracts/core/StakeRootCompendium.sol @@ -414,7 +414,7 @@ contract StakeRootCompendium is StakeRootCompendiumStorage { uint256 delegatedStake = 0; uint256 slashableStake = 0; { - uint256[] memory delegatedShares = delegationManager.getOperatorScaledShares(operator, strategies); + uint256[] memory delegatedShares = delegationManager.getOperatorDelegatedShares(operator, strategies); (uint64[] memory totalMagnitudes, uint64[] memory allocatedMagnitudes) = allocationManager.getTotalAndAllocatedMagnitudes(operator, operatorSet, strategies); diff --git a/src/contracts/interfaces/IDelegationManager.sol b/src/contracts/interfaces/IDelegationManager.sol index 607bd905c2..2114769c16 100644 --- a/src/contracts/interfaces/IDelegationManager.sol +++ b/src/contracts/interfaces/IDelegationManager.sol @@ -392,8 +392,8 @@ interface IDelegationManager is ISignatureUtils { */ function operatorDelegatedShares(address operator, IStrategy strategy) external view returns (uint256); - /// @notice Given array of strategies, returns array of scaled shares for the operator - function getOperatorScaledShares( + /// @notice Given array of strategies, returns array of delegated shares for the operator + function getOperatorDelegatedShares( address operator, IStrategy[] memory strategies ) external view returns (uint256[] memory);