Skip to content

Commit

Permalink
fix compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant authored and ypatil12 committed Sep 24, 2024
1 parent 20370a0 commit 9be27cc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion script/deploy/devnet/operatorSets/PopulateSRC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/core/AllocationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src/contracts/core/DelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/core/StakeRootCompendium.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/interfaces/IDelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9be27cc

Please sign in to comment.