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

Fixed bank borrow bug #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fixed bank borrow bug #33

wants to merge 2 commits into from

Conversation

mikeghen
Copy link
Contributor

The issue occured when you borrow, then try to borrow more. There was 1 line removed from vaultBorrow. A test for this scenario was added to bank.js

@@ -268,7 +244,6 @@ contract Bank is BankStorage, AccessControlEnumerable, Initializable {
reserve.collateralizationRatio) * 100;
maxBorrow *= debt.priceGranularity;
maxBorrow /= collateral.priceGranularity;
maxBorrow -= vaults[msg.sender].debtAmount;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the source of the error, subtracting the debt amount was not needed. This was missed since there was no test for the scenario that causes this to be a problem

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