15,000 USDC
View results
Submission Details
Severity: high
Valid

Denial of service for tokens with decimals different than 18

Summary

By hardcoding PRECISION = 18, the protocol assume all tokens have 18 decimals places, this could create a denial of service for tokens that have different of amount decimals.

Vulnerability Details

If a user deposits 1 WBTC (1e8), the USD value for this collateral is 0.0000001 dollars, which doesn't represent the actual market value of WBTC.

Due to this low amount of USD value, the health factor for this user is 0.00000005, which will not allow the user to use DSCEngine::mintDsc or DSCEngine::depositCollateralAndMintDsc to mint tokens.

Tools Used

Manual verification.

Recommendations

Don't hardcode the precision, instead dynamically query the token contracts for the amount of decimals to properly handle the precision.

Support

FAQs

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