DeFiHardhat
35,000 USDC
View results
Submission Details
Severity: low
Invalid

`getEthUsdPrice()` in `LibEthUsdOracle.sol` can return an outdated price because of a wrong Heartbeat

Summary

getEthUsdPrice() in LibEthUsdOracle.sol can return an outdated price because of a wrong Heartbeat.

Heartbeat that is used is hardcoded at 4 hours and the real one is at 1 hour.

Vulnerability Details

getEthUsdPrice() is a very important function that returns the price of ETH against the dollar:

function getEthUsdPrice() internal view returns (uint256) {
return LibChainlinkOracle.getPrice(ETH_USD_CHAINLINK_PRICE_AGGREGATOR, LibChainlinkOracle.FOUR_HOUR_TIMEOUT);
}

Using for Heartbeat:

uint256 constant FOUR_HOUR_TIMEOUT = 14400;

But this Heartbeat is for 4 hours and the real one we can see from the Chainlink website is updated every hour.

Reference - > https://data.chain.link/feeds/ethereum/mainnet/eth-usd

Impact

Because of wrong Heartbeat function will return outdated price of ETH/USD.

The same problem exists in the other getEthUsdPrice() function below.

Tools Used

Visual Studio Code

Recommendations

Change Heartbeat to one hour.

Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

Chainlink timeout

Support

FAQs

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