Skip to content

Commit

Permalink
fix: index for getOperatorRestakeableStrategies (#4090)
Browse files Browse the repository at this point in the history
### Description

Creates a fix for a view function an indexer on the EigenLayer side
calls into for UI display

### Drive-by changes

None

### Related issues

N/A

### Backward compatibility

Yes

### Testing

Regression test added in the Eigenlayer repo
  • Loading branch information
stevennevins authored Jul 3, 2024
1 parent d316772 commit 9cff8c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions solidity/contracts/avs/ECDSAServiceManagerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ abstract contract ECDSAServiceManagerBase is
uint256[] memory shares = IDelegationManager(delegationManager)
.getOperatorShares(_operator, strategies);

address[] memory activeStrategies = new address[](count);
uint256 activeCount;
for (uint256 i; i < count; i++) {
if (shares[i] > 0) {
Expand All @@ -258,9 +257,11 @@ abstract contract ECDSAServiceManagerBase is

// Resize the array to fit only the active strategies
address[] memory restakedStrategies = new address[](activeCount);
uint256 index;
for (uint256 j = 0; j < count; j++) {
if (shares[j] > 0) {
restakedStrategies[j] = activeStrategies[j];
restakedStrategies[index] = address(strategies[j]);
index++;
}
}

Expand Down

0 comments on commit 9cff8c2

Please sign in to comment.