fix: index for getOperatorRestakeableStrategies (#4090)

### 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
pull/3136/merge
steven 5 months ago committed by GitHub
parent d316772243
commit 9cff8c2d3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      solidity/contracts/avs/ECDSAServiceManagerBase.sol

@ -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) {
@ -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++;
}
}

Loading…
Cancel
Save