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

Hotfix: Duplicate Currency in Bitmap #92

Closed
wants to merge 3 commits into from

Conversation

jeffywu
Copy link
Contributor

@jeffywu jeffywu commented Jan 9, 2022

Fixes critical issue where a bitmap currency can be duplicated in active currencies, causing free collateral to be double counted: https://blog.notional.finance/critical-bug-payout-report/

This fix will re-enable the enableBitmapCurrency method to be called by accounts. The fix here is to simply remove the functionality of changing a bitmap currency on an account once it is set. This should eliminate the potential for double counting altogether. There is no valid use case for accounts changing bitmap currencies. Furthermore, once enabled a bitmap currency also cannot be disabled.

This feature was designed with the intention that a bitmap currency was a permanent fixture of an account. If an account does set this and need to change it later they must switch to using a different address. From our perspective, this is an acceptable switching cost.

Additionally, require statements have been added to the FreeCollateral.sol file to explicitly disallow double counting across bitmap currency to active currency. Since the FreeCollateral library is compiled directly into the bytecode of multiple other contracts, this change will only take effect on a redeployment of the FreeCollateralExternal library and its associated contracts.

@jeffywu jeffywu closed this Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant