From 4e523524751213ae9656c62b81e874439f195f9d Mon Sep 17 00:00:00 2001 From: Samyak Jain Date: Thu, 12 Sep 2019 15:46:47 -0700 Subject: [PATCH] added few comments --- contracts/ProxyLogics/InstaMakerCompBridge.sol | 4 ++++ contracts/bridges/{LiquidityContract.sol => Liquidity.sol} | 0 2 files changed, 4 insertions(+) rename contracts/bridges/{LiquidityContract.sol => Liquidity.sol} (100%) diff --git a/contracts/ProxyLogics/InstaMakerCompBridge.sol b/contracts/ProxyLogics/InstaMakerCompBridge.sol index 9c0db63..8695b80 100644 --- a/contracts/ProxyLogics/InstaMakerCompBridge.sol +++ b/contracts/ProxyLogics/InstaMakerCompBridge.sol @@ -339,6 +339,7 @@ contract MakerResolver is CompoundHelper { uint daiFeeAmt = daiEx.getTokenToEthOutputPrice(mkrEx.getEthToTokenOutputPrice(mkrFee)); daiAmt = add(_wad, daiFeeAmt); + // Getting Liquidity from Liquidity Contract LiquidityInterface(getLiquidityAddr()).borrowTknAndTransfer(getDAIAddress(), getCDAIAddress(), daiAmt); if (ok && val != 0) { @@ -426,6 +427,7 @@ contract MakerResolver is CompoundHelper { tub.draw(cup, _wad); + // Returning Liquidity To Liquidity Contract require(TokenInterface(getDAIAddress()).transfer(getLiquidityAddr(), _wad), "Not-enough-DAI"); LiquidityInterface(getLiquidityAddr()).payBorrowBack(getDAIAddress(), getCDAIAddress(), _wad); } @@ -484,6 +486,7 @@ contract CompoundResolver is MakerResolver { function borrowDAIComp(uint daiAmt) internal { enterMarket(getCDAIAddress()); require(CTokenInterface(getCDAIAddress()).borrow(daiAmt) == 0, "got collateral?"); + // Returning Liquidity to Liquidity Contract require(TokenInterface(getDAIAddress()).transfer(getLiquidityAddr(), daiAmt), "Not-enough-DAI"); LiquidityInterface(getLiquidityAddr()).payBorrowBack(getDAIAddress(), getCDAIAddress(), daiAmt); emit LogBorrow( @@ -501,6 +504,7 @@ contract CompoundResolver is MakerResolver { CERC20Interface cToken = CERC20Interface(getCDAIAddress()); uint daiBorrowed = cToken.borrowBalanceCurrent(address(this)); wipeAmt = tokenAmt < daiBorrowed ? tokenAmt : daiBorrowed; + // Getting Liquidity from Liquidity Contract LiquidityInterface(getLiquidityAddr()).borrowTknAndTransfer(getDAIAddress(), getCDAIAddress(), wipeAmt); setApproval(getDAIAddress(), wipeAmt, getCDAIAddress()); require(cToken.repayBorrow(wipeAmt) == 0, "transfer approved?"); diff --git a/contracts/bridges/LiquidityContract.sol b/contracts/bridges/Liquidity.sol similarity index 100% rename from contracts/bridges/LiquidityContract.sol rename to contracts/bridges/Liquidity.sol