Use of single _pairs array in TwapOracle increases costs of consult
ing
#17
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
TwapOracle
Handle
TomFrench
Vulnerability details
Impact
Gas costs
Proof of Concept
TwapOracle
stores both VADER pairs and USDV pairs in the_pairs
array. This means that inconsult
we need to filter for a particular token on every element. It would be simpler to instead have two arrays, one for each token, and then just choose one array to iterate over based on which token we're interested in.Recommended Mitigation Steps
Switch
_pairs
to_usdvPairs
and_vaderPairs
The text was updated successfully, but these errors were encountered: