Skip to content
Request an audit

‹ All findings

Hardcoded 1e18 ratio calculation regardless of decimals

Low/InfoOjo Mellow Price Feed·by the Three Sigma team·Oracles·16th October 20243S-Ojo-L01

Description

MellowPriceFeed gets the ratio by doing answer = int256(uint256(ratiosX96[0])) * 1e18 / int256(managedRatiosOracle.Q96());, hardcoding the decimals to 1e18.

However, the decimals are set in the constructor and stored in priceFeedDecimals, and could differ from 1e18.

Recommendation

answer = int256(uint256(ratiosX96[0])) * 10**priceFeedDecimals / int256(managedRatiosOracle.Q96());

Status

Addressed in #ad88fe1.