The Standard

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

Tokens with more than 18 decimals block liquidations

Summary

Some tokens have higher than 18 decimals, these tokens block distributeAssets function in LiquidationPool and can't be liquidated.

Vulnerability Details

in the following line asset amount is scaled to 18 decimals before calculating its price, which will revert if token decimals are higher than 18, which leads to blocking the whole liquidation transaction.

uint256 costInEuros = _portion * 10 ** (18 - asset.token.dec) * uint256(assetPriceUsd) / uint256(priceEurUsd) * _hundredPC / _collateralRate;

Since the liquidation pool uses the balance of all accepted tokens to call distributeAssets it blocks the liquidation of other collaterals as well.
admin should remove this collateral from the accepted tokens list for enabling liquidations again however removed token balance can't be accessible anymore, also liquidation is a crucial part of the protocol that shouldn't be paused, blocking liquidation harms the protocol in some situation even in short periods of time.

Impact

  • Denial of Service

  • Loss of some Collateral

Tools Used

Manual Review

Recommendations

Restrict tokens with more than 18 decimals or change decimal calculation by dividing asset amount / asset.token.dec - 18 in case of more than 18 decimals in the following line.

uint256 costInEuros = _portion * 10 ** (18 - asset.token.dec) * uint256(assetPriceUsd) / uint256(priceEurUsd) * _hundredPC / _collateralRate;

Updates

Lead Judging Commences

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.