Platform: Code4rena
Start Date: 23/09/2021
Pot Size: $50,000 USDC
Total HM: 5
Participants: 14
Period: 7 days
Judge: ghoulsol
Total Solo HM: 3
Id: 32
League: ETH
Rank: 8/14
Findings: 1
Award: $594.74
🌟 Selected for report: 1
🚀 Solo Findings: 0
594.7412 USDC - $594.74
gpersoon
If _timeRateToBlockRate would be called with a relative low value for _uint, a rounding error could occur. This is because _uint is divided by 365 and 86400 first and solidity doesn't have floating points. Generally its better to first multiply and then divide, unless an overflow could occur, which doesn't seem relevant here.
https://github.com/code-423n4/2021-09-wildcredit/blob/main/contracts/InterestRateModel.sol#L104 function _timeRateToBlockRate(uint _uint) private view returns(uint) { return _uint / 365 / 86400 * BLOCK_TIME / 1e18; }
replace return _uint / 365 / 86400 * BLOCK_TIME / 1e18; with return _uint * BLOCK_TIME / ( 365 * 86400 * 1e18);