mirror of
				https://github.com/Instadapp/smart-contract.git
				synced 2024-07-29 22:08:07 +00:00 
			
		
		
		
	added new Split Swap in leverage contracts
This commit is contained in:
		
							parent
							
								
									6daab57014
								
							
						
					
					
						commit
						3ae6f7b898
					
				|  | @ -126,7 +126,7 @@ contract Helpers is DSMath { | ||||||
|      * @dev get admin address |      * @dev get admin address | ||||||
|      */ |      */ | ||||||
|     function getAddressSplitSwap() public pure returns (address payable splitSwap) { |     function getAddressSplitSwap() public pure returns (address payable splitSwap) { | ||||||
|         splitSwap = 0xa4BCA645f9cB9e6F9ad8C56D90a65b07C2f4e1Dd; |         splitSwap = 0x5D05EA343C7a13cee09b14e56FCBe985c25521b7; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function enterMarket(address cErc20) internal { |     function enterMarket(address cErc20) internal { | ||||||
|  | @ -367,7 +367,7 @@ contract CompoundSave is CompoundResolver { | ||||||
|         uint daiToSwap = getDaiRemainBorrow(borrowRemain); |         uint daiToSwap = getDaiRemainBorrow(borrowRemain); | ||||||
|         daiToSwap = daiToSwap < daiToBorrow ? daiToSwap : daiToBorrow; |         daiToSwap = daiToSwap < daiToBorrow ? daiToSwap : daiToBorrow; | ||||||
|         borrow(daiToSwap); |         borrow(daiToSwap); | ||||||
|         setApproval(getAddressDAI(), daiToSwap, getAddressSplitSwap()); |         ERC20Interface(getAddressDAI()).approve(getAddressSplitSwap(), daiToSwap); | ||||||
|         uint destAmt = SplitSwapInterface(getAddressSplitSwap()).daiToEthSwap(daiToSwap, splitAmt, slippageAmt); |         uint destAmt = SplitSwapInterface(getAddressSplitSwap()).daiToEthSwap(daiToSwap, splitAmt, slippageAmt); | ||||||
|         mintCEth(destAmt); |         mintCEth(destAmt); | ||||||
|         emit LogLeverageCompound(daiToSwap, destAmt); |         emit LogLeverageCompound(daiToSwap, destAmt); | ||||||
|  |  | ||||||
|  | @ -170,7 +170,7 @@ contract Helpers is DSMath { | ||||||
|      * @dev get admin address |      * @dev get admin address | ||||||
|      */ |      */ | ||||||
|     function getAddressSplitSwap() public pure returns (address payable splitSwap) { |     function getAddressSplitSwap() public pure returns (address payable splitSwap) { | ||||||
|         splitSwap = 0xa4BCA645f9cB9e6F9ad8C56D90a65b07C2f4e1Dd; |         splitSwap = 0x5D05EA343C7a13cee09b14e56FCBe985c25521b7; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | @ -507,7 +507,7 @@ contract Save is GetDetails { | ||||||
|             debtToBorrow = daiToSwap; |             debtToBorrow = daiToSwap; | ||||||
|         } |         } | ||||||
|         draw(cdpID, debtToBorrow); |         draw(cdpID, debtToBorrow); | ||||||
|         setAllowance(TokenInterface(getAddressDAI()), getAddressSplitSwap()); |         TokenInterface(getAddressDAI()).approve(getAddressSplitSwap(), debtToBorrow); | ||||||
|         uint destAmt = SplitSwapInterface(getAddressSplitSwap()).daiToEthSwap(debtToBorrow, splitAmt, slippageAmt); |         uint destAmt = SplitSwapInterface(getAddressSplitSwap()).daiToEthSwap(debtToBorrow, splitAmt, slippageAmt); | ||||||
|         lock(cdpID, destAmt); |         lock(cdpID, destAmt); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Samyak Jain
						Samyak Jain