fixed stack too deep error

This commit is contained in:
Thrilok Kumar 2020-05-08 07:51:05 +05:30
parent a80d0c1e4d
commit 74e9862e81

View File

@ -110,8 +110,7 @@ contract CurveProtocol is CurveHelpers {
_sellAmt = _sellAmt == uint(-1) ? _sellToken.balanceOf(address(this)) : _sellAmt;
_sellToken.approve(address(curve), _sellAmt);
uint _sellAmt18 = convertTo18(_sellToken.decimals(), _sellAmt);
uint _slippageAmt = convert18ToDec(_buyToken.decimals(), wmul(unitAmt, _sellAmt18));
uint _slippageAmt = convert18ToDec(_buyToken.decimals(), wmul(unitAmt, convertTo18(_sellToken.decimals(), _sellAmt)));
uint _buyAmt = curve.get_dy(getTokenI(sellAddr), getTokenI(buyAddr), _sellAmt);