Fixed bug

This commit is contained in:
Thrilok Kumar 2020-05-15 21:22:24 +05:30
parent 55116532e7
commit 84e1e8a02c

View File

@ -165,7 +165,7 @@ contract BasicResolver is DydxHelpers {
TokenInterface tokenContract = TokenInterface(getWETHAddr());
_amt = _amt == uint(-1) ? address(this).balance : _amt;
tokenContract.deposit.value(_amt)();
TokenInterface(token).approve(getDydxAddress(), _amt);
tokenContract.approve(getDydxAddress(), _amt);
} else {
TokenInterface tokenContract = TokenInterface(token);
_amt = _amt == uint(-1) ? tokenContract.balanceOf(address(this)) : _amt;
@ -261,7 +261,7 @@ contract BasicResolver is DydxHelpers {
TokenInterface tokenContract = TokenInterface(getWETHAddr());
require(address(this).balance >= _amt, "not-enough-eth");
tokenContract.deposit.value(_amt)();
TokenInterface(token).approve(getDydxAddress(), _amt);
tokenContract.approve(getDydxAddress(), _amt);
} else {
TokenInterface tokenContract = TokenInterface(token);
require(tokenContract.balanceOf(address(this)) >= _amt, "not-enough-token");