code-423n4 / 2021-09-wildcredit-findings

0 stars 0 forks source link

InterestRateModel: Low rate can be lower than min rate #17

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

itsmeSTYJ

Vulnerability details

Impact

If low rate is lower than min rate, the calculation of interestRatePerBlock will not be accurate.

Recommended Mitigation Steps

function setLowRate(uint _value) external onlyOwner { // ok
    require(_value < highRate, "InterestRateModel: _value < lowRate");
    require(_value > minRate, "InterestRateModel: _value > minRate"); // added this.
    lowRate = _timeRateToBlockRate(_value);
    emit NewLowRate(_value);
}
talegift commented 2 years ago

Duplicate #63