20,000 USDC
View results
Submission Details
Severity: low

Loss of precision

Summary

Division by potentially large numbers.

Vulnerability Details

There are 5 instances of this issue.

File: src/Lender.sol
246: uint256 loanRatio = (debt * 10 ** 18) / collateral;
384: uint256 loanRatio = (totalDebt * 10 ** 18) / loan.collateral;
475: uint256 currentAuctionRate = (MAX_INTEREST_RATE * timeElapsed) /
618: uint256 loanRatio = (debt * 10 ** 18) / collateral;
File Link Instance Count Instance Links
Lender.sol 4 246,384,475,618

File: src/Staking.sol
68: uint256 _ratio = _diff * 1e18 / totalSupply;
File Link Instance Count Instance Link
Staking.sol 1 68

Impact

Division by large numbers may result in the result being zero, due to Solidity not supporting fractions.

Tools Used

baudit: a custom static code analysis tool; manual review

Recommendations

Consider requiring a minimum amount for the numerator to ensure that it is always larger than the denominator.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.