Skip to content

Fixed bank borrow bug#33

Open
mikeghen wants to merge 2 commits into
masterfrom
borrow-bug-fix
Open

Fixed bank borrow bug#33
mikeghen wants to merge 2 commits into
masterfrom
borrow-bug-fix

Conversation

@mikeghen

Copy link
Copy Markdown
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

Comment thread contracts/Bank.sol
reserve.collateralizationRatio) * 100;
maxBorrow *= debt.priceGranularity;
maxBorrow /= collateral.priceGranularity;
maxBorrow -= vaults[msg.sender].debtAmount;

Copy link
Copy Markdown
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