fixed isEth logic

Signed-off-by: pradyuman-verma <pradyumnverma27@gmail.com>
This commit is contained in:
pradyuman-verma 2022-08-02 23:25:37 +05:30
parent c6a6193c2a
commit 128fff7488
No known key found for this signature in database
GPG Key ID: E36FD6BC8923221F
5 changed files with 9 additions and 9 deletions

View File

@ -53,7 +53,7 @@ abstract contract Helpers is DSMath, Basic {
_sellAddr.decimals(),
wmul(buyData.unitAmt, convertTo18(_buyAddr.decimals(), _buyAmt))
);
bool isEth = address(_sellAddr) == wethAddr;
bool isEth = address(_sellAddr) == ethAddr;
convertEthToWeth(isEth, _sellAddr, _slippageAmt);
approve(_sellAddr, address(swapRouter), _slippageAmt);
@ -115,7 +115,7 @@ abstract contract Helpers is DSMath, Basic {
wmul(sellData.unitAmt, convertTo18(_sellAddr.decimals(), _sellAmt))
);
bool isEth = address(_sellAddr) == wethAddr;
bool isEth = address(_sellAddr) == ethAddr;
convertEthToWeth(isEth, _sellAddr, _sellAmt);
approve(_sellAddr, address(swapRouter), _sellAmt);
ExactInputSingleParams memory params = ExactInputSingleParams({

View File

@ -53,7 +53,7 @@ abstract contract Helpers is DSMath, Basic {
_sellAddr.decimals(),
wmul(buyData.unitAmt, convertTo18(_buyAddr.decimals(), _buyAmt))
);
bool isEth = address(_sellAddr) == wethAddr;
bool isEth = address(_sellAddr) == ethAddr;
convertEthToWeth(isEth, _sellAddr, _slippageAmt);
approve(_sellAddr, address(swapRouter), _slippageAmt);
@ -114,7 +114,7 @@ abstract contract Helpers is DSMath, Basic {
wmul(sellData.unitAmt, convertTo18(_sellAddr.decimals(), _sellAmt))
);
bool isEth = address(_sellAddr) == wethAddr;
bool isEth = address(_sellAddr) == ethAddr;
convertEthToWeth(isEth, _sellAddr, _sellAmt);
approve(_sellAddr, address(swapRouter), _sellAmt);
ExactInputSingleParams memory params = ExactInputSingleParams({

View File

@ -53,7 +53,7 @@ abstract contract Helpers is DSMath, Basic {
_sellAddr.decimals(),
wmul(buyData.unitAmt, convertTo18(_buyAddr.decimals(), _buyAmt))
);
bool isEth = address(_sellAddr) == wethAddr;
bool isEth = address(_sellAddr) == ethAddr;
convertEthToWeth(isEth, _sellAddr, _slippageAmt);
approve(_sellAddr, address(swapRouter), _slippageAmt);
@ -115,7 +115,7 @@ abstract contract Helpers is DSMath, Basic {
wmul(sellData.unitAmt, convertTo18(_sellAddr.decimals(), _sellAmt))
);
bool isEth = address(_sellAddr) == wethAddr;
bool isEth = address(_sellAddr) == ethAddr;
convertEthToWeth(isEth, _sellAddr, _sellAmt);
approve(_sellAddr, address(swapRouter), _sellAmt);
ExactInputSingleParams memory params = ExactInputSingleParams({

View File

@ -53,7 +53,7 @@ abstract contract Helpers is DSMath, Basic {
wmul(buyData.unitAmt, convertTo18(_buyAddr.decimals(), _buyAmt))
);
bool isMatic = address(_sellAddr) == wmaticAddr;
bool isMatic = address(_sellAddr) == maticAddr;
convertMaticToWmatic(isMatic, _sellAddr, _slippageAmt);
approve(_sellAddr, address(swapRouter), _slippageAmt);
ExactOutputSingleParams memory params = ExactOutputSingleParams({
@ -114,7 +114,7 @@ abstract contract Helpers is DSMath, Basic {
wmul(sellData.unitAmt, convertTo18(_sellAddr.decimals(), _sellAmt))
);
bool isMatic = address(_sellAddr) == wmaticAddr;
bool isMatic = address(_sellAddr) == maticAddr;
convertMaticToWmatic(isMatic, _sellAddr, _sellAmt);
approve(_sellAddr, address(swapRouter), _sellAmt);
ExactInputSingleParams memory params = ExactInputSingleParams({

View File

@ -90,4 +90,4 @@ abstract contract UniswapResolver is Helpers, Events {
contract ConnectV2UniswapV3SwapPolygon is UniswapResolver {
string public constant name = "UniswapV3-Swap-v1";
}
}