mirror of
				https://github.com/Instadapp/dsa-resolvers-deprecated.git
				synced 2024-07-29 22:38:16 +00:00 
			
		
		
		
	Compound resolver update
This commit is contained in:
		
							parent
							
								
									289290c391
								
							
						
					
					
						commit
						12222cea47
					
				|  | @ -50,7 +50,8 @@ contract Helpers { | |||
| 
 | ||||
| 
 | ||||
| contract Resolver is Helpers { | ||||
|     function getCompTokensData(address owner, address[] memory cAddress) public view returns (CompData[] memory) { | ||||
| 
 | ||||
|     function getPosition(address owner, address[] memory cAddress) public view returns (CompData[] memory) { | ||||
|         CompData[] memory tokensData = new CompData[](cAddress.length); | ||||
|         for (uint i = 0; i < cAddress.length; i++) { | ||||
|             CTokenInterface cToken = CTokenInterface(cAddress[i]); | ||||
|  | @ -66,23 +67,6 @@ contract Resolver is Helpers { | |||
|         return tokensData; | ||||
|     } | ||||
| 
 | ||||
|     function getCompTokenData(address owner, address cAddress) public view returns ( | ||||
|         uint tokenPrice, | ||||
|         uint exRate, | ||||
|         uint userBalance, | ||||
|         uint userBorrowBalance, | ||||
|         uint supplyRate, | ||||
|         uint borrowRate | ||||
|     ) | ||||
|     { | ||||
|         tokenPrice = OrcaleComp(getOracleAddress()).getUnderlyingPrice(cAddress); | ||||
|         CTokenInterface cToken = CTokenInterface(cAddress); | ||||
|         exRate = cToken.exchangeRateStored(); | ||||
|         userBalance = cToken.balanceOf(owner); | ||||
|         userBorrowBalance = cToken.borrowBalanceStored(owner); | ||||
|         supplyRate = cToken.supplyRatePerBlock(); | ||||
|         borrowRate = cToken.borrowRatePerBlock(); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Samyak Jain
						Samyak Jain