give pledging contract approval on receiving token
This commit is contained in:
parent
3a59696d94
commit
c63da28dd6
|
@ -137,7 +137,7 @@ contract SwapProxy is Pausable, SafeToken {
|
|||
uint maxDestinationAmount = getMaxDestinationAmount(expectedRate, amount);
|
||||
uint receiverAmount = kyberProxy.trade(token, amount, receiverToken, address(this), maxDestinationAmount, slippageRate, vault);
|
||||
require(receiverAmount > 0);
|
||||
require(EIP20Interface(token).approve(address(liquidPledging), receiverAmount));
|
||||
require(EIP20Interface(receiverToken).approve(address(liquidPledging), receiverAmount));
|
||||
liquidPledging.addGiverAndDonate(idReceiver, msg.sender, receiverToken, receiverAmount);
|
||||
Swap(msg.sender, token, receiverToken, amount, receiverAmount);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue