Skip to content

Limit the number of Reserves on a Spoke #734

@Kogaroshi

Description

@Kogaroshi

In PositionStatus.sol, when not finding the next reserve the user an user is borrowing or using as collateral, we return PositionStatus.NOT_FOUND, which is type(uint256).max.
In Spoke:_calculateAndPotentiallyRefreshUserAccountData() and Spoke:_notifyRiskPremiumUpdate(), where we use PositionStatus:next() to find the next reserve, when receiving PositionStatus.NOT_FOUND we exit the loops.
But in the case type(uint256).max would be the latests Reserve listed, and so a valid ReserveId, that an user set as collateral or is borrowing, we'd exit the loop due to next() return value, instead of iterating like expected.

Solution :

Add a new condition in Spoke:addReserve() to prevent that the new listed reserve's id is type(uint256).max.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions