Skip to content

Commit

Permalink
return 0 proceed if isExcess is false (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
haythem96 authored and CruzMolina committed Jun 3, 2021
1 parent 468d6e7 commit 7078ab9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/core/Controller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ contract Controller is Initializable, OwnableUpgradeSafe, ReentrancyGuardUpgrade
function getProceed(address _owner, uint256 _vaultId) external view returns (uint256) {
(MarginVault.Vault memory vault, uint256 typeVault, ) = getVault(_owner, _vaultId);

(uint256 netValue, ) = calculator.getExcessCollateral(vault, typeVault);
(uint256 netValue, bool isExcess) = calculator.getExcessCollateral(vault, typeVault);

if (!isExcess) return 0;

return netValue;
}

Expand Down

0 comments on commit 7078ab9

Please sign in to comment.