From 404aeee97dc54b61bbc49b272f3f087edff613db Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Thu, 27 Jun 2019 01:04:13 +0530 Subject: [PATCH] new InstaSave completed --- contracts/ProxyLogics/InstaSave.sol | 40 +++++++++++------------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/contracts/ProxyLogics/InstaSave.sol b/contracts/ProxyLogics/InstaSave.sol index 41db5ba..bdea815 100644 --- a/contracts/ProxyLogics/InstaSave.sol +++ b/contracts/ProxyLogics/InstaSave.sol @@ -170,7 +170,7 @@ contract Helpers is DSMath { * @dev get admin address */ function getAddressSplitSwap() public pure returns (address payable splitSwap) { - splitSwap = //
; + splitSwap = 0x1E3A60112f600cb623087bd2C98c7842085a8c3F; } /** @@ -470,7 +470,13 @@ contract Save is GetDetails { ); - function save(uint cdpID, uint colToSwap, uint splitAmt) public { + function save( + uint cdpID, + uint colToSwap, + uint splitAmt, + uint slippageAmt + ) public + { bytes32 cup = bytes32(cdpID); (uint ethCol, uint daiDebt, uint usdPerEth) = getCDPStats(cup); uint colToFree = getColToFree(ethCol, daiDebt, usdPerEth); @@ -489,20 +495,15 @@ contract Save is GetDetails { } emit LogSaveCDP(cdpID, colToFree, destAmt); - - emit LogTrade( - 0, - getAddressETH(), - colToFree, - getAddressDAI(), - destAmt, - address(this), - 0, - getAddressAdmin() - ); } - function leverage(uint cdpID, uint daiToSwap) public { + function leverage( + uint cdpID, + uint daiToSwap, + uint splitAmt, + uint slippageAmt + ) public + { bytes32 cup = bytes32(cdpID); (uint ethCol, uint daiDebt, uint usdPerEth) = getCDPStats(cup); uint debtToBorrow = getDebtToBorrow(ethCol, daiDebt, usdPerEth); @@ -516,17 +517,6 @@ contract Save is GetDetails { lock(cdpID, destAmt); emit LogLeverageCDP(cdpID, debtToBorrow, destAmt); - - emit LogTrade( - 1, - getAddressDAI(), - debtToBorrow, - getAddressETH(), - destAmt, - address(this), - 0, - getAddressAdmin() - ); } function getColToFree(uint ethCol, uint daiDebt, uint usdPerEth) internal pure returns (uint colToFree) {