mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
Minor changes
This commit is contained in:
parent
56d37868f6
commit
d45ed96efb
|
@ -94,7 +94,6 @@ contract Resolver is Basic {
|
||||||
public
|
public
|
||||||
view
|
view
|
||||||
returns (
|
returns (
|
||||||
uint ethPriceInUsd,
|
|
||||||
uint[] memory tokensPriceInETH
|
uint[] memory tokensPriceInETH
|
||||||
) {
|
) {
|
||||||
tokensPriceInETH = new uint[](tokens.length);
|
tokensPriceInETH = new uint[](tokens.length);
|
||||||
|
@ -108,17 +107,12 @@ contract Resolver is Basic {
|
||||||
tokensPriceInETH[i] = 10 ** 18;
|
tokensPriceInETH[i] = 10 ** 18;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedData memory ethFeedData = chainLinkMapping[ethAddr];
|
|
||||||
ChainLinkInterface ethFeed = ChainLinkInterface(ethFeedData.feedAddress);
|
|
||||||
ethPriceInUsd = convertPrice(uint(ethFeed.latestAnswer()), ethFeedData.multiplier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPrice(address token)
|
function getPrice(address token)
|
||||||
public
|
public
|
||||||
view
|
view
|
||||||
returns (
|
returns (
|
||||||
uint ethPriceInUsd,
|
|
||||||
uint tokenPriceInETH
|
uint tokenPriceInETH
|
||||||
) {
|
) {
|
||||||
if (token != ethAddr) {
|
if (token != ethAddr) {
|
||||||
|
@ -129,11 +123,17 @@ contract Resolver is Basic {
|
||||||
} else {
|
} else {
|
||||||
tokenPriceInETH = 10 ** 18;
|
tokenPriceInETH = 10 ** 18;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEthPrice()
|
||||||
|
public
|
||||||
|
view
|
||||||
|
returns (
|
||||||
|
uint ethPriceInUsd
|
||||||
|
) {
|
||||||
FeedData memory ethFeedData = chainLinkMapping[ethAddr];
|
FeedData memory ethFeedData = chainLinkMapping[ethAddr];
|
||||||
ChainLinkInterface ethFeed = ChainLinkInterface(ethFeedData.feedAddress);
|
ChainLinkInterface ethFeed = ChainLinkInterface(ethFeedData.feedAddress);
|
||||||
ethPriceInUsd = convertPrice(uint(ethFeed.latestAnswer()), ethFeedData.multiplier);
|
ethPriceInUsd = convertPrice(uint(ethFeed.latestAnswer()), ethFeedData.multiplier);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user