Skip to content

Commit

Permalink
feat(vaultsConnectedBound): calc leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
solidovic committed Feb 24, 2025
1 parent 34e7ead commit 06be0a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contracts/0.8.25/vaults/VaultHubViewerV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ contract VaultHubViewerV1 {
uint256 resultVaultsCount = _to - _from;
IVault[] memory resultVaults = new IVault[](resultVaultsCount);
uint256 resultIndex = 0;
uint256 skip = 0;


uint256 allVaultsCount = vaultHub.vaultsCount();
for (uint256 i = 0; i < allVaultsCount; i++) {
Expand All @@ -171,13 +173,13 @@ contract VaultHubViewerV1 {
}

if (resultIndex >= resultVaultsCount) {
skip = i + 1;
break;
}
}

// It does not take into account that there may be disconnected volts
// uint256 leftover = cycleIndex > _to ? cycleIndex - _to : 0;
uint256 leftover = 0;
uint256 leftover = allVaultsCount - skip;
return (resultVaults, leftover);
}

Expand Down

0 comments on commit 06be0a5

Please sign in to comment.