accrueInterest method is not called before updating reserveFactor of a market
Summary
In the softDelistMarket method, the accrueInterest method is not called before updating the reserveFactor of a market's configuration.
Vulnerability Detail
In the function, adjustMarketReserveFactor we see that the function accrueInterest is called before the reserve factor is updated to a new value. This is done to conclude the current accumulated interest with the original reserve factor. This logic is also seen in changeMarketInterestRateModel.
But, in the softDelistMarket method we do not call the accrueInterest method before updating the reserveFactor to MAX_RESERVE_FACTOR.
Impact
If accrueInterest is not called, the accumulated interest with the previous reserve factor is not taken into account.
ni8mare
medium
accrueInterest
method is not called before updatingreserveFactor
of a marketSummary
In the
softDelistMarket
method, theaccrueInterest
method is not called before updating thereserveFactor
of a market's configuration.Vulnerability Detail
In the function,
adjustMarketReserveFactor
we see that the functionaccrueInterest
is called before the reserve factor is updated to a new value. This is done to conclude the current accumulated interest with the original reserve factor. This logic is also seen inchangeMarketInterestRateModel
.But, in the
softDelistMarket
method we do not call theaccrueInterest
method before updating thereserveFactor
toMAX_RESERVE_FACTOR
.Impact
If
accrueInterest
is not called, the accumulated interest with the previous reserve factor is not taken into account.Code Snippet
In
softDelistMarket
:Tool used
Manual Review
Recommendation
Please update the code so that the
accrueInterest
method is called before updating thereserveFactor
variable.