From 24604e94fea3ab40d287cb8e2f6ab454315864c0 Mon Sep 17 00:00:00 2001 From: Shivva Date: Thu, 26 Nov 2020 16:55:59 +0100 Subject: [PATCH] refacto --- .../gelato/conditions/ConditionDestVaultWillBeSafe.sol | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contracts/contracts/gelato/conditions/ConditionDestVaultWillBeSafe.sol b/contracts/contracts/gelato/conditions/ConditionDestVaultWillBeSafe.sol index 07acdbf..1d3375a 100644 --- a/contracts/contracts/gelato/conditions/ConditionDestVaultWillBeSafe.sol +++ b/contracts/contracts/gelato/conditions/ConditionDestVaultWillBeSafe.sol @@ -59,13 +59,15 @@ contract ConditionDestVaultWillBeSafe is GelatoConditionsStandard { ) public view returns (string memory) { uint256 wDaiToBorrow = _getRealisedDebt(_getMakerVaultDebt(_fromVaultId)); - uint256 route = _getFlashLoanRoute(DAI, wDaiToBorrow); - uint256 gasCost = _getGasCostMakerToMaker(_destVaultId == 0, route); - uint256 gasFeesPaidFromCol = _getGelatoProviderFees(gasCost); uint256 wColToDeposit = sub( _getMakerVaultCollateralBalance(_fromVaultId), - gasFeesPaidFromCol + _getGelatoProviderFees( + _getGasCostMakerToMaker( + _destVaultId == 0, + _getFlashLoanRoute(DAI, wDaiToBorrow) + ) + ) ); return