Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of single _pairs array in TwapOracle increases costs of consulting #17

Closed
code423n4 opened this issue Nov 9, 2021 · 1 comment
Closed
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

Comments

@code423n4
Copy link
Contributor

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 in consult 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

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Nov 9, 2021
code423n4 added a commit that referenced this issue Nov 9, 2021
@SamSteinGG SamSteinGG added the sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons label Nov 25, 2021
@SamSteinGG
Copy link
Collaborator

The TWAP oracle module has been completely removed and redesigned from scratch as LBTwap that is subject of the new audit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants