20,000 USDC
View results
Submission Details
Severity: low
Valid

Possible rounding issue

Summary

Vulnerability Details

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

file: Staking.sol
68: uint256 _ratio = _diff * 1e18 / totalSupply;
88: uint256 _share = _supplied * _delta / 1e18;
file: Lender.sol
561: uint256 govFee = (borrowerFee * loan.collateral) / 10000;
650: uint256 fee = (borrowerFee * (debt - debtToPay)) / 10000;
724: interest = (l.interestRate * l.debt * timeElapsed) / 10000 / 365 days;

Impact

When dividing by large numbers,the quotient may turn out to be zero.

Tools Used

Manual

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.

Give us feedback!