Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Dec 14, 2023
1 parent bc629af commit 477f9d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion helpers/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const getPools = async () => {

const poolPromises = pairs.map(async (pair: any) => {
let pool = {
pair,
t0: {},
t1: {},
pair,
} as any;
const pairContract = new ethers.Contract(pair, UniswapV2Pair.abi, provider);

Expand Down
14 changes: 7 additions & 7 deletions tasks/pools.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import { getAddress } from "@zetachain/protocol-contracts";
import { formatUnits } from "ethers/lib/utils";
import { task } from "hardhat/config";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { formatUnits } from "ethers/lib/utils";

import { getPools } from "../helpers/pools";
import { getForeignCoins } from "../helpers/balances";
import { getAddress } from "@zetachain/protocol-contracts";
import { getPools } from "../helpers/pools";

const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
const foreignCoins = await getForeignCoins();
const pools = await getPools();

const addressToInfo = foreignCoins.reduce((acc: any, coin: any) => {
acc[coin.zrc20_contract_address.toLowerCase()] = {
symbol: coin.symbol,
decimals: coin.decimals,
symbol: coin.symbol,
};
return acc;
}, {});

const wzeta = getAddress("zetaToken", "zeta_testnet");
const WZETA_ADDRESS = wzeta.toLowerCase();
addressToInfo[WZETA_ADDRESS] = { symbol: "WZETA", decimals: 18 };
addressToInfo[WZETA_ADDRESS] = { decimals: 18, symbol: "WZETA" };

const poolsWithSymbolsAndDecimals = pools.map((pool) => {
pool.t0.reserve = formatUnits(pool.t0.reserve, pool.t0.decimals);
pool.t1.reserve = formatUnits(pool.t1.reserve, pool.t1.decimals);
const t0Info = addressToInfo[pool.t0.address.toLowerCase()] || {
symbol: "Unknown",
decimals: 18,
symbol: "Unknown",
};
const t1Info = addressToInfo[pool.t1.address.toLowerCase()] || {
symbol: "Unknown",
decimals: 18,
symbol: "Unknown",
};

return {
Expand Down

0 comments on commit 477f9d9

Please sign in to comment.