From 96c7da1659c18f6aeef0a106885971cfc60349a8 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Sat, 9 May 2020 09:35:25 +0530 Subject: [PATCH] Fixed allowance issue in curve connector --- contracts/connectors/curve.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/connectors/curve.sol b/contracts/connectors/curve.sol index dd362c0..2b66583 100644 --- a/contracts/connectors/curve.sol +++ b/contracts/connectors/curve.sol @@ -166,7 +166,7 @@ contract CurveProtocol is CurveHelpers { emit LogDeposit(token, _amt, mintAmt, getId, setId); bytes32 _eventCode = keccak256("LogDeposit(address,uint256,uint256,uint256,uint256)"); - bytes memory _eventParam = abi.encode(_amt, mintAmt, getId, setId); + bytes memory _eventParam = abi.encode(token, _amt, mintAmt, getId, setId); emitEvent(_eventCode, _eventParam); } @@ -207,7 +207,9 @@ contract CurveProtocol is CurveHelpers { uint _amt18 = convertTo18(TokenInterface(token).decimals(), _amt); uint _slippageAmt = wmul(unitAmt, _amt18); + curveTokenContract.approve(address(curveSwap), 0); curveTokenContract.approve(address(curveSwap), _slippageAmt); + curveSwap.remove_liquidity_imbalance(_amts, _slippageAmt); setUint(setId, _amt);