Skip to content

Commit

Permalink
fix: bound methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeday committed Jan 28, 2025
1 parent 51c4ffb commit 322614a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions contracts/0.8.25/vaults/VaultHubViewerV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ contract VaultHubViewerV1 {
) public view returns (IVault[] memory, uint256) {
(IVault[] memory vaults, uint256 valid) = _vaultsByOwner(_owner);

return (_filterNonZeroVaults(vaults, _from, _to), valid > _to ? valid - _to : 0);
uint256 count = valid > _to ? _to : valid;
uint256 leftover = valid > _to ? valid - _to : 0;

return (_filterNonZeroVaults(vaults, _from, count), leftover);
}

/// @notice Returns all vaults with a given role on a given address
Expand Down Expand Up @@ -120,7 +123,10 @@ contract VaultHubViewerV1 {
) public view returns (IVault[] memory, uint256) {
(IVault[] memory vaults, uint256 valid) = _vaultsByRole(_role, _member);

return (_filterNonZeroVaults(vaults, _from, _to), valid - _to);
uint256 count = valid > _to ? _to : valid;
uint256 leftover = valid > _to ? valid - _to : 0;

return (_filterNonZeroVaults(vaults, _from, count), leftover);
}

// ==================== Internal Functions ====================
Expand Down

0 comments on commit 322614a

Please sign in to comment.