bugs resolved

This commit is contained in:
Samyak Jain 2019-06-24 03:49:33 +05:30
parent fffdf35a93
commit dd62faa009

View File

@ -498,7 +498,9 @@ contract SaveResolver is GetDetails {
function saveSwap(uint srcAmt, uint daiDebt) internal returns (uint destAmt) { function saveSwap(uint srcAmt, uint daiDebt) internal returns (uint destAmt) {
(,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt); (,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt);
if (isBest == 0) { if (isBest == 0) {
TokenInterface(getAddressWETH()).deposit.value(srcAmt)(); TokenInterface weth = TokenInterface(getAddressWETH());
weth.deposit.value(srcAmt)();
setAllowance(weth, getAddressEth2Dai());
destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount( destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount(
getAddressWETH(), getAddressWETH(),
srcAmt, srcAmt,
@ -528,6 +530,7 @@ contract SaveResolver is GetDetails {
function loopSwap(uint srcAmt) internal returns (uint destAmt) { function loopSwap(uint srcAmt) internal returns (uint destAmt) {
(,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt); (,uint isBest) = getBest(getAddressETH(), getAddressDAI(), srcAmt);
if (isBest == 0) { if (isBest == 0) {
setAllowance(TokenInterface(getAddressDAI()), getAddressEth2Dai());
destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount( destAmt = Eth2DaiInterface(getAddressEth2Dai()).sellAllAmount(
getAddressDAI(), getAddressDAI(),
srcAmt, srcAmt,