Skip to content

Commit

Permalink
fix: Avoid actions with debt/coll zero
Browse files Browse the repository at this point in the history
Closes #9
  • Loading branch information
bingen committed May 2, 2024
1 parent f1c59eb commit a92840c
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit a92840c

Please sign in to comment.