From 5ef106e62dd9828c1afa5127da8954c90ce10a25 Mon Sep 17 00:00:00 2001 From: Daksh Miglani Date: Sun, 23 May 2021 19:51:59 +0530 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20priceInMatic=20->=20?= =?UTF-8?q?priceInEth,=20maticPrice=20->=20ethPrice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/powerResolver/aave_v2_matic.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/powerResolver/aave_v2_matic.sol b/contracts/powerResolver/aave_v2_matic.sol index 25e7a12..7c12b0b 100644 --- a/contracts/powerResolver/aave_v2_matic.sol +++ b/contracts/powerResolver/aave_v2_matic.sol @@ -109,7 +109,7 @@ contract Helpers is DSMath { } struct TokenPrice { - uint256 priceInMatic; + uint256 priceInEth; uint256 priceInUsd; } @@ -177,27 +177,27 @@ contract InstaAaveV2PowerResolver is Helpers { function getTokensPrices(address[] calldata tokens) external view - returns (TokenPrice[] memory tokenPrices, uint256 maticPrice) + returns (TokenPrice[] memory tokenPrices, uint256 ethPrice) { AaveAddressProvider aaveAddressProvider = AaveAddressProvider(getAaveAddressProvider()); uint256[] memory _tokenPrices = AavePriceOracle(aaveAddressProvider.getPriceOracle()) .getAssetsPrices(tokens); - maticPrice = uint256( + ethPrice = uint256( ChainLinkInterface(getChainlinkMaticFeed()).latestAnswer() ); tokenPrices = new TokenPrice[](_tokenPrices.length); for (uint256 i = 0; i < _tokenPrices.length; i++) { tokenPrices[i] = TokenPrice( _tokenPrices[i], - wmul(_tokenPrices[i], uint256(maticPrice) * 10**10) + wmul(_tokenPrices[i], uint256(ethPrice) * 10**10) ); } } - function getMaticPrice() public view returns (uint256 maticPrice) { - maticPrice = uint256( + function getEthPrice() public view returns (uint256 ethPrice) { + ethPrice = uint256( ChainLinkInterface(getChainlinkMaticFeed()).latestAnswer() ); }