Assessment reports>Benqi Oracle>Discussion>The internal function BenqiPriceOracle::getFeedPrice is not used

The internal function BenqiPriceOracle::getFeedPrice is not used

The BenqiPriceOracle::getFeedPrice function is internal, but no other public or external functions can call it.

function getFeedPrice(IAggregatorV2V3Interface feed) internal view returns (uint256) {
    // Price feeds store answers at their defined decimal places
    uint256 decimalDelta = 18 - feed.decimals();
    // Ensure that we don't multiply the result by 0
    if (decimalDelta > 0) {
        return uint256(feed.latestAnswer()) * (10 ** decimalDelta);
    } else {
        return uint256(feed.latestAnswer());
    }
}

And this function uses the deprecated Chainlink's latestAnswer function. Consider deleting this function.

This issue has been acknowledged by Chaos Labs, and a fix was implemented in commit b1fa9adf.

Zellic © 2025Back to top ↑