Skip to content

Commit

Permalink
cherry picked
Browse files Browse the repository at this point in the history
  • Loading branch information
gpsanant committed Sep 23, 2024
1 parent 1507b36 commit d8f039b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 22 deletions.
5 changes: 2 additions & 3 deletions script/deploy/devnet/operatorSets/PopulateSRC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ contract PopulateSRC is Script, Test, ExistingDeploymentParser {
_delegationManager: delegationManager,
_avsDirectory: avsDirectory,
_allocationManager: allocationManager,
_maxTotalCharge: 100 ether,
_minBalanceThreshold: 0 ether,
_minProofsDuration: 20,
_minPrepaidProofs: 20,
_verifier: address(0),
_imageId: bytes32(0)
});
Expand Down Expand Up @@ -207,7 +206,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
12 changes: 0 additions & 12 deletions src/contracts/core/DelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -866,18 +866,6 @@ contract DelegationManager is
return delegatedShares;
}

/// @notice Given array of strategies, returns array of scaled shares for the operator
function getOperatorScaledShares(
address operator,
IStrategy[] memory strategies
) external view returns (uint256[] memory) {
uint256[] memory scaledShares = new uint256[](strategies.length);
for (uint256 i = 0; i < strategies.length; ++i) {
scaledShares[i] = operatorScaledShares[operator][strategies[i]];
}
return scaledShares;
}

/**
* @notice Given a staker and a set of strategies, return the shares they can queue for withdrawal.
* This value depends on which operator the staker is delegated to.
Expand Down
5 changes: 4 additions & 1 deletion src/contracts/core/StakeRootCompendium.sol
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ contract StakeRootCompendium is StakeRootCompendiumStorage {
uint256 operatorSetIndex,
uint256 startOperatorIndex,
uint256 numOperators
) external view returns (OperatorSet memory, address[] memory, OperatorLeaf[] memory) {
) external view returns (OperatorLeaf[] memory) {
require(operatorSetIndex < operatorSets.length, OperatorSetIndexOutOfBounds());
OperatorSet memory operatorSet = operatorSets[operatorSetIndex];
address[] memory operators =
Expand Down Expand Up @@ -620,6 +620,9 @@ contract StakeRootCompendium is StakeRootCompendiumStorage {
operatorLeaves.length == avsDirectory.getNumOperatorsInOperatorSet(operatorSet), InputArrayLengthMismatch()
);
uint256 totalDelegatedStake;
uint256 totalSlashableStake;
bytes32[] memory operatorLeavesHashes = new bytes32[](operatorLeaves.length);
bytes32 prevExtraData;
for (uint256 i = 0; i < operatorLeaves.length; ++i) {
require(uint256(prevExtraData) < uint256(operatorLeaves[i].extraData), ExtraDataNotSorted());
prevExtraData = operatorLeaves[i].extraData;
Expand Down
6 changes: 0 additions & 6 deletions src/contracts/interfaces/IDelegationManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,6 @@ interface IDelegationManager is ISignatureUtils {
IStrategy[] memory strategies
) external view returns (uint256[] memory);

/// @notice Given array of strategies, returns array of scaled shares for the operator
function getOperatorScaledShares(
address operator,
IStrategy[] memory strategies
) external view returns (uint256[] memory);

/**
* @notice Returns 'true' if `staker` *is* actively delegated, and 'false' otherwise.
*/
Expand Down

0 comments on commit d8f039b

Please sign in to comment.