The contracts calculations assumes that both the debt and collateral variables are represented in tokens with the same decimals.
lets look at an example
The borrow function in the given contract calculates a loanRatio to determine the risk associated with a loan based on the debt and collateral provided.
In scenarios where debt and collateral are tokens with different decimal precision, such as DAI (18 decimals) and USDC (6 decimals), the loanRatio can result in incorrect risk management as it is used to enforce the maximum loan-to-value ratio:
This can lead to loans with a higher actual ratio than intended, exposing lenders to higher default risks.
Manual analysis
When combining amounts of multiple tokens that may have different precision, convert all of the amounts into the same precision before any computation.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.