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

Exposure.sortVaultsByDelta does not work for N_COINS != 3 #101

Open
code423n4 opened this issue Jul 7, 2021 · 2 comments
Open

Exposure.sortVaultsByDelta does not work for N_COINS != 3 #101

code423n4 opened this issue Jul 7, 2021 · 2 comments

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Vulnerability Details

The Exposure.sortVaultsByDelta function computes the missing vault index from the min and max vault indices by:

vaultIndexes[1] = N_COINS - maxIndex - minIndex;

This only works for N_COINS = 3.

Impact

If any new stablecoin is ever removed or added, this function will break.

Recommended Mitigation Steps

Never change the number of stablecoins and consider adding an assert(N_COINS == 3) here.

@kitty-the-kat
Copy link
Collaborator

non-critical: By its nature, exposure and allocations should be redeployed if any fundamental changes are done to the underlying exposure types

@ghoul-sol
Copy link
Collaborator

In summary, works as designed. Non-critical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants