mirror of
https://github.com/Instadapp/smart-contract.git
synced 2024-07-29 22:08:07 +00:00
Fixed dydx proxy withdraw arg
This commit is contained in:
parent
67835fa68c
commit
f186a17ae3
|
|
@ -157,7 +157,7 @@ contract Helpers is DSMath {
|
||||||
tokenAmt
|
tokenAmt
|
||||||
);
|
);
|
||||||
bytes memory empty;
|
bytes memory empty;
|
||||||
address otherAddr = marketId == 0 ? getSoloPayableAddress() : address(this);
|
address otherAddr = (marketId == 0 && sign) ? getSoloPayableAddress() : address(this);
|
||||||
SoloMarginContract.ActionType action = sign ? SoloMarginContract.ActionType.Deposit : SoloMarginContract.ActionType.Withdraw;
|
SoloMarginContract.ActionType action = sign ? SoloMarginContract.ActionType.Deposit : SoloMarginContract.ActionType.Withdraw;
|
||||||
actions[0] = SoloMarginContract.ActionArgs(
|
actions[0] = SoloMarginContract.ActionArgs(
|
||||||
action,
|
action,
|
||||||
|
|
@ -243,6 +243,8 @@ 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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user