The MultiHopOracle contract fails to validate if oracle price data is zero before performing division operations, which could lead to the transaction reverting due to division by zero errors when oracles return zero prices.
In the _getData() function, there are multiple instances where division operations are performed without checking if the divisor is zero.
One of them is when inverting the first oracle's price:
Another instance is when processing subsequent oracles:
If any oracle returns a zero price, these division operations will cause the transaction to revert with a division by zero error.
Can cause complete function failure when zero prices are encountered and could also affect critical price-dependent operations.
Manual code review
Add explicit zero-value checks with clear error messages:
Multihop will call ChainlinkOracle and the check is in it: `require(data > 0, "INVLDDATA");` MultiHop is just here to combine Chainlinks feed when there is no direct USD price feed for a token.
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.