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

accrueInterest() before setting new rateModel #206

Merged

Conversation

haydenshively
Copy link
Member

The latest interest should be accrued using the old rateModel before updating to the new one.

One other thing -- previously, if accrued interest was causing the safe casts in _save to revert, governance could un-brick the contract by setting a new rateModel that returns 0. After this change, that wouldn't be possible, because setRateModelAndReserveFactor itself would revert. We eliminate the problem by clamping borrowIndex and totalSupply to their maximum values in _previewInterest.

Addresses

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

Successfully merging this pull request may close these issues.

1 participant