From 7a7c1a302c3b01d9aa1b6146f351977dc85489d0 Mon Sep 17 00:00:00 2001 From: Samyak Jain <34437877+KaymasJain@users.noreply.github.com> Date: Mon, 11 May 2020 11:30:15 +1000 Subject: [PATCH] code restructuring --- contracts/protocols/1split.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/protocols/1split.sol b/contracts/protocols/1split.sol index 03413a6..377f990 100644 --- a/contracts/protocols/1split.sol +++ b/contracts/protocols/1split.sol @@ -52,7 +52,7 @@ contract DSMath { contract Helpers is DSMath { - + /** * @dev get Ethereum address */ @@ -85,13 +85,13 @@ contract OneSplitHelpers is Helpers { function getBuyUnitAmt( TokenInterface buyAddr, + uint expectedAmt, TokenInterface sellAddr, uint sellAmt, - uint buyAmt, uint slippage ) internal view returns (uint unitAmt) { uint _sellAmt = convertTo18(sellAddr.decimals(), sellAmt); - uint _buyAmt = convertTo18(buyAddr.decimals(), buyAmt); + uint _buyAmt = convertTo18(buyAddr.decimals(), expectedAmt); unitAmt = wdiv(_buyAmt, _sellAmt); unitAmt = wmul(unitAmt, sub(WAD, slippage)); } @@ -118,11 +118,11 @@ contract Resolver is OneSplitHelpers { distribution, disableDexes ); - unitAmt = getBuyUnitAmt(_buyAddr, _sellAddr, sellAmt, buyAmt, slippage); + unitAmt = getBuyUnitAmt(_buyAddr, buyAmt, _sellAddr, sellAmt, slippage); } } contract InstaOneSplitResolver is Resolver { - string public constant name = "1split-Resolver-v1"; + string public constant name = "1Split-Resolver-v1"; } \ No newline at end of file