mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
Fixed decimal error in curve connector
This commit is contained in:
parent
9707c67d0e
commit
eb7cb3d7d4
|
@ -113,9 +113,12 @@ contract CurveProtocol is CurveHelpers {
|
|||
|
||||
uint _slippageAmt = convert18ToDec(_buyToken.decimals(), wmul(unitAmt, convertTo18(_sellToken.decimals(), _sellAmt)));
|
||||
|
||||
uint _buyAmt = curve.get_dy(getTokenI(sellAddr), getTokenI(buyAddr), _sellAmt);
|
||||
|
||||
// uint _buyAmt = curve.get_dy(getTokenI(sellAddr), getTokenI(buyAddr), _sellAmt);
|
||||
uint initalBal = _buyToken.balanceOf(address(this));
|
||||
curve.exchange(getTokenI(sellAddr), getTokenI(buyAddr), _sellAmt, _slippageAmt);
|
||||
uint finalBal = _buyToken.balanceOf(address(this));
|
||||
|
||||
uint _buyAmt = sub(finalBal, initalBal);
|
||||
|
||||
setUint(setId, _buyAmt);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user