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

maxLoanRatio calculation differs from commentary

Summary

In the documentation, the ratio is figured as (loanToken / collateralToken) * 10**18, when in reality is (loanToken * 10**18) / collateralToken.

Vulnerability Details

File: src/utils/Structs.sol
15: /// @notice the max ratio of loanToken/collateralToken (multiplied by 10**18)
16: uint256 maxLoanRatio;
File: src/Lender.sol
246: uint256 loanRatio = (debt * 10 ** 18) / collateral;

Impact

No impact.

Tools Used

Manual review.

Recommendations

Adjust the comment to be sound with the code.

Support

FAQs

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