mirror of
				https://github.com/Instadapp/dsa-connectors.git
				synced 2024-07-29 22:37:00 +00:00 
			
		
		
		
	fixed isEth logic
Signed-off-by: pradyuman-verma <pradyumnverma27@gmail.com>
This commit is contained in:
		
							parent
							
								
									c6a6193c2a
								
							
						
					
					
						commit
						128fff7488
					
				| 
						 | 
				
			
			@ -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({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -90,4 +90,4 @@ abstract contract UniswapResolver is Helpers, Events {
 | 
			
		|||
 | 
			
		||||
contract ConnectV2UniswapV3SwapPolygon is UniswapResolver {
 | 
			
		||||
	string public constant name = "UniswapV3-Swap-v1";
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user