fixed dydx withdraw

This commit is contained in:
Thrilok kumar 2019-10-05 22:06:46 +05:30
parent f186a17ae3
commit 7744b68170

View File

@ -243,8 +243,6 @@ contract DydxResolver is Helpers {
if (erc20Addr == getAddressETH()) { if (erc20Addr == getAddressETH()) {
PayableProxySoloMarginContract soloPayable = PayableProxySoloMarginContract(getSoloPayableAddress()); PayableProxySoloMarginContract soloPayable = PayableProxySoloMarginContract(getSoloPayableAddress());
soloPayable.operate(getAccountArgs(), getActionsArgs(marketId, toWithdraw, false), msg.sender); soloPayable.operate(getAccountArgs(), getActionsArgs(marketId, toWithdraw, false), msg.sender);
SoloMarginContract solo = SoloMarginContract(getSoloAddress());
solo.operate(getAccountArgs(), getActionsArgs(marketId, toWithdraw, false));
ERC20Interface wethContract = ERC20Interface(getAddressWETH()); ERC20Interface wethContract = ERC20Interface(getAddressWETH());
uint wethBal = wethContract.balanceOf(address(this)); uint wethBal = wethContract.balanceOf(address(this));
toWithdraw = toWithdraw < wethBal ? wethBal : toWithdraw; toWithdraw = toWithdraw < wethBal ? wethBal : toWithdraw;