Skip to content

Commit

Permalink
fix: correct pagination, differentiate between MAX_LPS and MAX_POOLS
Browse files Browse the repository at this point in the history
  • Loading branch information
ethzoomer committed Dec 21, 2023
1 parent e779c95 commit 686bfb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contracts/LpSugar.vy
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
# Structs

MAX_FACTORIES: constant(uint256) = 10
MAX_POOLS: constant(uint256) = 500
MAX_POOLS: constant(uint256) = 2000
MAX_TOKENS: constant(uint256) = 2000
MAX_LPS: constant(uint256) = 500
MAX_EPOCHS: constant(uint256) = 200
MAX_REWARDS: constant(uint256) = 16
MAX_POSITIONS: constant(uint256) = 10
Expand Down Expand Up @@ -384,15 +385,15 @@ def _token(_address: address, _account: address) -> Token:
@external
@view
def all(_limit: uint256, _offset: uint256, _account: address) \
-> DynArray[Lp, MAX_POOLS]:
-> DynArray[Lp, MAX_LPS]:
"""
@notice Returns a collection of pool data
@param _limit The max amount of pools to return
@param _offset The amount of pools to skip
@param _account The account to check the staked and earned balances
@return Array for Lp structs
"""
col: DynArray[Lp, MAX_POOLS] = empty(DynArray[Lp, MAX_POOLS])
col: DynArray[Lp, MAX_LPS] = empty(DynArray[Lp, MAX_LPS])
pools: DynArray[address[3], MAX_POOLS] = self._pools()
pools_count: uint256 = len(pools)

Expand Down

0 comments on commit 686bfb1

Please sign in to comment.