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

Overflow bug: interest could be negative in FeeManager #245

Open
wisdant opened this issue Oct 14, 2022 · 0 comments
Open

Overflow bug: interest could be negative in FeeManager #245

wisdant opened this issue Oct 14, 2022 · 0 comments

Comments

@wisdant
Copy link
Contributor

wisdant commented Oct 14, 2022

In the logic of consuming _cr.correction, it assumed new interest is going to larger than _cr.correction, thus the forced conversion to uint256 and setting _cr.correction to 0. If the borrower made huge principal payment in the middle cycle and accumulated big negative _cr.correction and left a tiny balance, the new interest will be very small positive number, not enough to offset the accumulated big negative number, this would lead to overflow.

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

No branches or pull requests

1 participant