From 460d8bd74d4f383bdf891e05e54192e216ec748a Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Mon, 6 May 2019 15:06:46 +0530 Subject: [PATCH] fees removed --- contracts/ProxyLogics/InstaSave.sol | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/contracts/ProxyLogics/InstaSave.sol b/contracts/ProxyLogics/InstaSave.sol index db1b67f..48daec1 100644 --- a/contracts/ProxyLogics/InstaSave.sol +++ b/contracts/ProxyLogics/InstaSave.sol @@ -378,7 +378,6 @@ contract GetDetails is MakerHelpers { colToFree = ethToSwap; } (uint expectedRate,) = KyberInterface(getAddressKyber()).getExpectedRate(getAddressETH(), getAddressDAI(), colToFree); - expectedRate = wdiv(wmul(expectedRate, 99750000000000000000), 100000000000000000000); uint expectedDAI = wmul(colToFree, expectedRate); if (expectedDAI < daiDebt) { finalEthCol = sub(ethCol, colToFree); @@ -413,7 +412,6 @@ contract GetDetails is MakerHelpers { debtToBorrow = daiToSwap; } (uint expectedRate,) = KyberInterface(getAddressKyber()).getExpectedRate(getAddressDAI(), getAddressETH(), debtToBorrow); - expectedRate = wdiv(wmul(expectedRate, 99750000000000000000), 100000000000000000000); uint expectedETH = wmul(debtToBorrow, expectedRate); if (ethCol != 0) { finalEthCol = add(ethCol, expectedETH); @@ -470,11 +468,9 @@ contract Save is GetDetails { } uint thisBalance = address(this).balance; free(cdpID, colToFree); - uint ethToSwap = wdiv(wmul(colToFree, 99750000000000000000), 100000000000000000000); - getAddressAdmin().transfer(sub(colToFree, ethToSwap)); - uint destAmt = KyberInterface(getAddressKyber()).trade.value(ethToSwap)( + uint destAmt = KyberInterface(getAddressKyber()).trade.value(colToFree)( getAddressETH(), - ethToSwap, + colToFree, getAddressDAI(), address(this), daiDebt, @@ -488,7 +484,7 @@ contract Save is GetDetails { lock(cdpID, balToLock); } - emit LogSaveCDP(cdpID, ethToSwap, destAmt); + emit LogSaveCDP(cdpID, colToFree, destAmt); emit LogTrade( 0, @@ -521,9 +517,7 @@ contract Save is GetDetails { 0, getAddressAdmin() ); - uint ethToDeposit = wdiv(wmul(destAmt, 99750000000000000000), 100000000000000000000); - getAddressAdmin().transfer(sub(destAmt, ethToDeposit)); - lock(cdpID, ethToDeposit); + lock(cdpID, destAmt); emit LogLeverageCDP(cdpID, debtToBorrow, destAmt);