MultiHopOracle.sol in the function _getData price of a pair is gotten through looping oracles checking price of the pair then returning the data and timestamp. But the issue arises on how return is used. Lets say we have 2 pairs to check price. and during construction we passed the two pairs. so when _getData is called we are supposed to receive two price of the corresponding pair. but we shall receive only one. this is because how solidity works under the hood. return can only be used once. in function calling. thus it will return only the price of the last pair in the array of oraclesplace the test in MultiHopOracle.t.sol
we see when calling getData() we shall only receive the last pair price in the test.
Possibilility of wrong price to be returned leading, to wrong calculation of weights.
foundry
refactor the code to use a mapping where we can pass a pair . and the oracle returns the price.
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.