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

fix: Avoid actions with debt/coll zero #146

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contracts/src/BorrowerOperations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -584,17 +584,17 @@ contract BorrowerOperations is LiquityBase, Ownable, CheckContract, IBorrowerOpe
uint256 _boldChange,
bool _isDebtIncrease
) internal {
if (_isDebtIncrease) {
if (_isDebtIncrease) { // implies _boldChange > 0
address borrower = _troveManager.ownerOf(_troveId);
_boldToken.mint(borrower, _boldChange);
} else {
} else if (_boldChange > 0 ){
_boldToken.burn(msg.sender, _boldChange);
}

if (_isCollIncrease) {
if (_isCollIncrease) { // implies _collChange > 0
// Pull ETH tokens from sender and move them to the Active Pool
_pullETHAndSendToActivePool(_activePool, _collChange);
} else {
} else if (_collChange > 0 ){
address borrower = _troveManager.ownerOf(_troveId);
// Pull ETH from Active Pool and decrease its recorded ETH balance
_activePool.sendETH(borrower, _collChange);
Expand Down
Loading