Minor change

This commit is contained in:
Thrilok Kumar 2021-01-21 23:21:01 +05:30
parent 40adca2f52
commit cd9d36b87f

View File

@ -121,8 +121,8 @@ contract Helpers is DSMath{
uint ethPrice = solo.getMarketPrice(0).value;
tokenData = new TokenData[](marketId.length);
for (uint i = 0; i < marketId.length; i++) {
uint decimals = marketId[i] == 0 ? 18 : ERC20Interface(solo.getMarketTokenAddress(marketId[i])).decimals();
tokenData[i].balance = marketId[i] == 0 ? address(solo).balance : ERC20Interface(solo.getMarketTokenAddress(marketId[i])).balanceOf(address(solo));
uint decimals = ERC20Interface(solo.getMarketTokenAddress(marketId[i])).decimals();
tokenData[i].balance = ERC20Interface(solo.getMarketTokenAddress(marketId[i])).balanceOf(address(solo));
uint price = marketId[i] == 1 ? 10 ** 18 : solo.getMarketPrice(marketId[i]).value;
tokenData[i].tokenPriceInUsd = price / 10 ** (18 - decimals);
tokenData[i].tokenPriceInEth = wdiv(tokenData[i].tokenPriceInUsd, ethPrice);