15,000 USDC
View results
Submission Details
Severity: high

Zero Oracle price feed result

Summary

Function getTokenAmountFromUsd does not check for zero return value

Vulnerability Details

Function getTokenAmountFromUsd should affirm that the final calculated amount is more that zero before returning.

Impact

Liquidators risk getting zero collateral when the Chainlink oracle returns a zero price

Tools Used

Manual review

Recommendations

Ln 347 should first calculate the token amount then confirm that its more than zero.

uint256 tokenAmount = (usdAmountInWei * PRECISION) / (uint256(price) * ADDITIONAL_FEED_PRECISION);
require(tokenAmount > 0," Too low token amount");

Support

FAQs

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