The risk of division by zero arises when the contract attempts to perform division operations where the divisor may be zero. In the context of the _getData() function, this issue can occur when the oracle data returns zero, which could happen if:
The oracle is malfunctioning.
The data from the oracle is intentionally manipulated or corrupted.
A calculation results in zero due to certain price feeds or market conditions.
Any attempt to retrieve data will fail if any of the oracles return zero, causing the entire function execution to fail.
Users may be unable to retrieve data, leading to a poor user experience.
If this behavior isn't handled properly, users could be impacted by failed transactions, leading to losses in transaction fees and unavailable data.
Manual Code Review
In case the oracle data is zero, you may want to provide a fallback value or revert with a meaningful error message, like "Oracle returned zero price".
It's essential to ensure that any invalid or zero data returned from an oracle is caught early in the process, preventing the contract from executing further with unreliable data.
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.