From 9593c6d3a9baed630be159e288c00e15d36db0fe Mon Sep 17 00:00:00 2001 From: Joaquin Gonzalez Date: Tue, 13 Aug 2019 17:10:56 -0300 Subject: [PATCH] fix converter ramp --- contracts/ConverterRamp.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/ConverterRamp.sol b/contracts/ConverterRamp.sol index 4649164..11c6e73 100644 --- a/contracts/ConverterRamp.sol +++ b/contracts/ConverterRamp.sol @@ -102,7 +102,7 @@ contract ConverterRamp is Ownable { (uint256 tokenCost) = convertSafe(_converter, _fromToken, address(token), amount); /// approve token to loan manager - require(token.safeApprove(_loanManagerAddress, tokenCost), "Error approving lend token transfer"); + require(token.safeApprove(_loanManagerAddress, amount), "Error approving lend token transfer"); uint256 prevTokenBalance = token.balanceOf(address(this)); @@ -211,7 +211,7 @@ contract ConverterRamp is Ownable { uint256 prevEthBalance = (address(this).balance).sub(msg.value); /// call convert in token converter - tokenConverter.convert.value(_amount)(fromToken, toToken, _amount, _tokenCost, _etherCost); + tokenConverter.convert.value(_etherCost)(fromToken, toToken, _amount, _tokenCost, _etherCost); /// Return leftover eth uint256 surplus = (address(this).balance).sub(prevEthBalance);