mirror of
				https://github.com/Instadapp/smart-contract.git
				synced 2024-07-29 22:08:07 +00:00 
			
		
		
		
	small code refactor
This commit is contained in:
		
							parent
							
								
									39cbd004e8
								
							
						
					
					
						commit
						12ffa7dfcb
					
				|  | @ -370,6 +370,26 @@ contract GetDetails is MakerHelpers { | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     function getLeverage( | ||||||
|  |         uint cdpID, | ||||||
|  |         uint daiToSwap | ||||||
|  |     ) public view returns ( | ||||||
|  |         uint finalEthCol, | ||||||
|  |         uint finalDaiDebt, | ||||||
|  |         uint finalColToUSD, | ||||||
|  |         bool canLeverage | ||||||
|  |     ) | ||||||
|  |     { | ||||||
|  |         bytes32 cup = bytes32(cdpID); | ||||||
|  |         (uint ethCol, uint daiDebt, uint usdPerEth) = getCDPStats(cup); | ||||||
|  |         (finalEthCol, finalDaiDebt, finalColToUSD, canLeverage) = checkLeverage( | ||||||
|  |             ethCol, | ||||||
|  |             daiDebt, | ||||||
|  |             usdPerEth, | ||||||
|  |             daiToSwap | ||||||
|  |         ); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * @param isBest 0 is ETH2DAI, 1 is Kyber |      * @param isBest 0 is ETH2DAI, 1 is Kyber | ||||||
|      */ |      */ | ||||||
|  | @ -392,26 +412,6 @@ contract GetDetails is MakerHelpers { | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function getLeverage( |  | ||||||
|         uint cdpID, |  | ||||||
|         uint daiToSwap |  | ||||||
|     ) public view returns ( |  | ||||||
|         uint finalEthCol, |  | ||||||
|         uint finalDaiDebt, |  | ||||||
|         uint finalColToUSD, |  | ||||||
|         bool canLeverage |  | ||||||
|     ) |  | ||||||
|     { |  | ||||||
|         bytes32 cup = bytes32(cdpID); |  | ||||||
|         (uint ethCol, uint daiDebt, uint usdPerEth) = getCDPStats(cup); |  | ||||||
|         (finalEthCol, finalDaiDebt, finalColToUSD, canLeverage) = checkLeverage( |  | ||||||
|             ethCol, |  | ||||||
|             daiDebt, |  | ||||||
|             usdPerEth, |  | ||||||
|             daiToSwap |  | ||||||
|         ); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function checkSave( |     function checkSave( | ||||||
|         uint ethCol, |         uint ethCol, | ||||||
|         uint daiDebt, |         uint daiDebt, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Samyak Jain
						Samyak Jain