bug fixing

This commit is contained in:
Samyak Jain 2019-06-03 17:25:51 +05:30
parent fdcd5e0151
commit 28060abb2d

View File

@ -167,7 +167,7 @@ contract CompoundResolver is Helpers {
setApproval(cErc20, toBurn, cErc20); setApproval(cErc20, toBurn, cErc20);
require(cToken.redeem(toBurn) == 0, "something went wrong"); require(cToken.redeem(toBurn) == 0, "something went wrong");
transferToken(erc20); transferToken(erc20);
uint tokenReturned = wmul(cToken.balanceOf(address(this)), cToken.exchangeRateCurrent()); uint tokenReturned = wmul(toBurn, cToken.exchangeRateCurrent());
emit LogRedeem( emit LogRedeem(
erc20, erc20,
cErc20, cErc20,
@ -206,7 +206,7 @@ contract CompoundResolver is Helpers {
} }
} }
if (!isEntered) { if (!isEntered) {
address[] memory toEnter; address[] memory toEnter = new address[](1);
toEnter[0] = cErc20; toEnter[0] = cErc20;
troller.enterMarkets(toEnter); troller.enterMarkets(toEnter);
} }