The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Dose not support token that has decimals more than 18

Summary

If any of the assets have tokens with decimals greater than 18, distributeAssets will revert.
Since distributeAssets is called from runLiquidation, liquidation cannot be performed.

Vulnerability Details

distributeAssets has the following calculation.
18 - asset.token.dec`
If the decimals of asset is greater than 18, the above calculation will cause an underflow and revert.

Therefore, distributeAssets cannot be performed and runLiquidation, which calls distributeAssets, also cannot be performed.

Impact

If any of the assets have tokens with decimals greater than 18, liquidation cannot be performed, resulting in bad debt.

Tools Used

VS Code

Recommendations

Change _portion * 10 ** (18 - asset.token.dec) to _portion * (10 ** 18) / (10 ** asset.token.dec)

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

pengun Submitter
over 1 year ago
hrishibhat Lead Judge
over 1 year ago
hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

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