give pledging contract approval on receiving token

This commit is contained in:
Barry Gitarts 2019-12-18 12:28:41 -05:00 committed by Barry G
parent 3a59696d94
commit c63da28dd6
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}