The value data returned by the Oracle in the function _getData::MultiHopOracle.sol is wrong in certain conditions due to lack of normalizing factor. The data returned by the multiple oracles could have decimals greater, lesser or equal to 18 decimals. Knowing that the data is supposed to be 18 decimals, and getting it in another number of decimals would be a disaster for the protocol.
the returned values of dataand oracleReswere not checked if they were in 18 decimals. In the case they were not, it would lead to incorrect calculations.
Incorrect calculation of the number of decimals could lead to significant malfunctioning of the protocol where the value of data (price) is been utilized. Could even lead to loss of funds
Manual review
a new variable normalizedFactor should be introduced
and be calculated as normalizedFactor = 18 - priceFeedDecimal
where priceFeedDecimal is the token decimal returned by the oracle being used. Then the normalizedFactor should be multiplied to the data
this same approach could be applied to oracleRes
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.