Skip to content

Latest commit

 

History

History
23 lines (13 loc) · 1.56 KB

095.md

File metadata and controls

23 lines (13 loc) · 1.56 KB

Bald Honeysuckle Urchin

High

Use of deprecated oracle function

Summary

In OracleRelay::currentValue in line 19, price is retrieved from a chainlink priceFeed using the deprecated latestAnswer. According to Chainlink’s documentation, the latestAnswer function is no longer recommended for use. Ref-Chainlink Data Feeds API Reference

Root Cause

The latestAnswer function from Chainlink’s AggregatorInterface is deprecated and should not be used in modern implementations.

Impact

The latestAnswer function may become unreliable or non-functional if it is removed or no longer supported in future Chainlink updates. Contracts depending on this function could fail to retrieve accurate prices, leading to incorrect behavior such as processing stale data, which could result in user fund losses.

Mitigation

Replace latestAnswer with the latestRoundData function available in the AggregatorV2V3Interface. This function provides the latest price along with additional metadata such as round ID, timestamp, and other relevant details. Ensure proper error handling for the additional data returned by latestRoundData, such as checking for valid timestamps to account for scenarios like L2 sequencer downtime or feed delays.