Skip to content

Commit

Permalink
partial loan payback under minOpeningMargin
Browse files Browse the repository at this point in the history
  • Loading branch information
kree-dotcom committed Dec 15, 2022
1 parent 4322e27 commit 6b0879e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/Vault_Synths.sol
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ contract Vault_Synths is Vault_Base_ERC20 {
_USDToVault = isoUSDdebt;
}
uint256 outstandingisoUSD = isoUSDdebt - _USDToVault;
if(outstandingisoUSD > 0){ //check for leftover debt
if((outstandingisoUSD > 0) && (_collateralToUser > 0)){ //check for leftover debt
uint256 collateralLeft = collateralPosted[_collateralAddress][msg.sender] - _collateralToUser;
uint256 colInUSD = priceCollateralToUSD(currencyKey, collateralLeft);
uint256 borrowMargin = (outstandingisoUSD * minOpeningMargin) / LOAN_SCALE;
Expand Down

0 comments on commit 6b0879e

Please sign in to comment.