From 5b48d1e409da1f4745e6101fbd69ca49b8b37782 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 6 Feb 2024 16:26:52 +0400 Subject: [PATCH] auto lint --- data/addresses.mainnet.json | 32 ++++++------- data/addresses.testnet.json | 84 +++++++++++++++++------------------ lib/types.d.ts | 44 ++++++++++++++++-- scripts/generate_addresses.sh | 4 +- tasks/addresses.mainnet.json | 14 +++--- tasks/addresses.testnet.json | 34 +++++++------- tasks/addresses.ts | 5 +-- 7 files changed, 127 insertions(+), 90 deletions(-) diff --git a/data/addresses.mainnet.json b/data/addresses.mainnet.json index 55072278..104a4b29 100644 --- a/data/addresses.mainnet.json +++ b/data/addresses.mainnet.json @@ -1,23 +1,23 @@ [ { "address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", - "chain_name": "eth_mainnet", - "chain_id": 1, "category": "messaging", + "chain_id": 1, + "chain_name": "eth_mainnet", "type": "uniswapV2Factory" }, { "address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", - "chain_name": "eth_mainnet", - "chain_id": 1, "category": "messaging", + "chain_id": 1, + "chain_name": "eth_mainnet", "type": "uniswapV2Router02" }, { "address": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "chain_name": "eth_mainnet", - "chain_id": 1, "category": "messaging", + "chain_id": 1, + "chain_name": "eth_mainnet", "type": "uniswapV3Router" }, { @@ -154,31 +154,31 @@ "type": "zrc20" }, { + "address": "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c", "category": "omnichain", "chain_id": 7000, "chain_name": "zeta_mainnet", - "address": "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c", "type": "uniswapV2Factory" }, { + "address": "0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf", "category": "omnichain", "chain_id": 7000, "chain_name": "zeta_mainnet", - "address": "0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf", "type": "zetaToken" }, { + "address": "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe", "category": "omnichain", "chain_id": 7000, "chain_name": "zeta_mainnet", - "address": "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe", "type": "uniswapV2Router02" }, { + "address": "0x735b14BB79463307AAcBED86DAf3322B1e6226aB", "category": "omnichain", "chain_id": 7000, "chain_name": "zeta_mainnet", - "address": "0x735b14BB79463307AAcBED86DAf3322B1e6226aB", "type": "fungibleModule" }, { @@ -238,17 +238,17 @@ "type": "tssUpdater" }, { - "address": "0xaeB6dDB7708467814D557e340283248be8E43124", + "address": "0xaf28a257D292e7f0E531073f70a175b57E0261a8", "category": "messaging", - "chain_id": "1", - "chain_name": "eth_mainnet", + "chain_id": "56", + "chain_name": "bsc_mainnet", "type": "pauser" }, { - "address": "0xaf28a257D292e7f0E531073f70a175b57E0261a8", + "address": "0xaeB6dDB7708467814D557e340283248be8E43124", "category": "messaging", - "chain_id": "56", - "chain_name": "bsc_mainnet", + "chain_id": "1", + "chain_name": "eth_mainnet", "type": "pauser" }, { diff --git a/data/addresses.testnet.json b/data/addresses.testnet.json index b8be25e1..2e5de1e6 100644 --- a/data/addresses.testnet.json +++ b/data/addresses.testnet.json @@ -1,65 +1,65 @@ [ { "address": "0x8eAc517b92eeE82177a83851268F13109878f8c4", - "chain_name": "goerli_testnet", - "chain_id": 5, "category": "messaging", + "chain_id": 5, + "chain_name": "goerli_testnet", "type": "zetaTokenConsumerUniV2" }, { "address": "0x7e792f3736751e168864106AdbAC50152641A927", - "chain_name": "mumbai_testnet", "category": "messaging", "chain_id": 80001, + "chain_name": "mumbai_testnet", "type": "zetaTokenConsumerUniV3" }, { "address": "0xFB2fCE3CCca19F0f764Ed8aa26C62181E3dA04C5", - "chain_name": "bsc_testnet", "category": "messaging", "chain_id": 97, + "chain_name": "bsc_testnet", "type": "zetaTokenConsumerUniV3" }, { "address": "0x8954AfA98594b838bda56FE4C12a09D7739D179b", - "chain_name": "mumbai_testnet", - "chain_id": 80001, "category": "messaging", + "chain_id": 80001, + "chain_name": "mumbai_testnet", "type": "uniswapV2Router02" }, { "address": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "chain_name": "mumbai_testnet", - "chain_id": 80001, "category": "messaging", + "chain_id": 80001, + "chain_name": "mumbai_testnet", "type": "uniswapV3Router" }, { "address": "0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3", - "chain_name": "bsc_testnet", - "chain_id": 97, "category": "messaging", + "chain_id": 97, + "chain_name": "bsc_testnet", "type": "uniswapV2Router02" }, { "address": "0x9a489505a00cE272eAa5e07Dba6491314CaE3796", - "chain_name": "bsc_testnet", - "chain_id": 97, "category": "messaging", + "chain_id": 97, + "chain_name": "bsc_testnet", "type": "uniswapV3Router" }, { "address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", - "chain_name": "goerli_testnet", - "chain_id": 5, "category": "messaging", + "chain_id": 5, + "chain_name": "goerli_testnet", "type": "uniswapV2Router02" }, { "address": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "chain_name": "goerli_testnet", - "chain_id": 5, "category": "messaging", + "chain_id": 5, + "chain_name": "goerli_testnet", "type": "uniswapV3Router" }, { @@ -196,52 +196,52 @@ "type": "zrc20" }, { + "address": "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c", "category": "omnichain", "chain_id": 7001, "chain_name": "zeta_testnet", - "address": "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c", "type": "uniswapV2Factory" }, { + "address": "0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf", "category": "omnichain", "chain_id": 7001, "chain_name": "zeta_testnet", - "address": "0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf", "type": "zetaToken" }, { + "address": "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe", "category": "omnichain", "chain_id": 7001, "chain_name": "zeta_testnet", - "address": "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe", "type": "uniswapV2Router02" }, { + "address": "0x735b14BB79463307AAcBED86DAf3322B1e6226aB", "category": "omnichain", "chain_id": 7001, "chain_name": "zeta_testnet", - "address": "0x735b14BB79463307AAcBED86DAf3322B1e6226aB", "type": "fungibleModule" }, { "address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f", "category": "messaging", - "chain_id": "80001", - "chain_name": "mumbai_testnet", + "chain_id": "97", + "chain_name": "bsc_testnet", "type": "zetaToken" }, { "address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1", "category": "messaging", - "chain_id": "80001", - "chain_name": "mumbai_testnet", + "chain_id": "97", + "chain_name": "bsc_testnet", "type": "connector" }, { "address": "0x0000a7db254145767262c6a81a7ee1650684258e", "category": "omnichain", - "chain_id": "80001", - "chain_name": "mumbai_testnet", + "chain_id": "97", + "chain_name": "bsc_testnet", "type": "erc20Custody" }, { @@ -268,57 +268,57 @@ { "address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f", "category": "messaging", - "chain_id": "97", - "chain_name": "bsc_testnet", + "chain_id": "80001", + "chain_name": "mumbai_testnet", "type": "zetaToken" }, { "address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1", "category": "messaging", - "chain_id": "97", - "chain_name": "bsc_testnet", + "chain_id": "80001", + "chain_name": "mumbai_testnet", "type": "connector" }, { "address": "0x0000a7db254145767262c6a81a7ee1650684258e", "category": "omnichain", - "chain_id": "97", - "chain_name": "bsc_testnet", + "chain_id": "80001", + "chain_name": "mumbai_testnet", "type": "erc20Custody" }, { "address": "0x55122f7590164Ac222504436943FAB17B62F5d7d", "category": "omnichain", - "chain_id": "80001", - "chain_name": "mumbai_testnet", + "chain_id": "97", + "chain_name": "bsc_testnet", "type": "tssUpdater" }, { "address": "0x55122f7590164Ac222504436943FAB17B62F5d7d", "category": "omnichain", - "chain_id": "5", - "chain_name": "goerli_testnet", + "chain_id": "80001", + "chain_name": "mumbai_testnet", "type": "tssUpdater" }, { "address": "0x55122f7590164Ac222504436943FAB17B62F5d7d", "category": "omnichain", - "chain_id": "97", - "chain_name": "bsc_testnet", + "chain_id": "5", + "chain_name": "goerli_testnet", "type": "tssUpdater" }, { "address": "0x55122f7590164Ac222504436943FAB17B62F5d7d", "category": "messaging", - "chain_id": "80001", - "chain_name": "mumbai_testnet", + "chain_id": "5", + "chain_name": "goerli_testnet", "type": "pauser" }, { "address": "0x55122f7590164Ac222504436943FAB17B62F5d7d", "category": "messaging", - "chain_id": "5", - "chain_name": "goerli_testnet", + "chain_id": "80001", + "chain_name": "mumbai_testnet", "type": "pauser" }, { diff --git a/lib/types.d.ts b/lib/types.d.ts index da57fc45..6dbc5594 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -1,4 +1,40 @@ -export type ParamSymbol = "USDC.BSC" | "USDC.ETH" | "BTC.BTC" | "BNB.BSC" | "USDT.ETH" | "USDT.BSC" | "ETH.ETH" | "USDC" | "gETH" | "tMATIC" | "tBTC" | "tBNB"; -export type ParamChainName = "eth_mainnet" | "bsc_mainnet" | "btc_mainnet" | "zeta_mainnet" | "goerli_testnet" | "mumbai_testnet" | "bsc_testnet" | "btc_testnet" | "zeta_testnet"; -export type ParamType = "uniswapV2Factory" | "uniswapV2Router02" | "uniswapV3Router" | "tss" | "systemContract" | "connector" | "zrc20" | "zetaToken" | "fungibleModule" | "erc20Custody" | "tssUpdater" | "pauser" | "weth9" | "uniswapV3Factory" | "zetaTokenConsumerUniV2" | "zetaTokenConsumerUniV3"; - +export type ParamSymbol = + | "BNB.BSC" + | "BTC.BTC" + | "ETH.ETH" + | "gETH" + | "tBNB" + | "tBTC" + | "tMATIC" + | "USDC.BSC" + | "USDC.ETH" + | "USDC" + | "USDT.BSC" + | "USDT.ETH"; +export type ParamChainName = + | "bsc_mainnet" + | "bsc_testnet" + | "btc_mainnet" + | "btc_testnet" + | "eth_mainnet" + | "goerli_testnet" + | "mumbai_testnet" + | "zeta_mainnet" + | "zeta_testnet"; +export type ParamType = + | "connector" + | "erc20Custody" + | "fungibleModule" + | "pauser" + | "systemContract" + | "tss" + | "tssUpdater" + | "uniswapV2Factory" + | "uniswapV2Router02" + | "uniswapV3Factory" + | "uniswapV3Router" + | "weth9" + | "zetaToken" + | "zetaTokenConsumerUniV2" + | "zetaTokenConsumerUniV3" + | "zrc20"; diff --git a/scripts/generate_addresses.sh b/scripts/generate_addresses.sh index 62e81086..2c767fa5 100755 --- a/scripts/generate_addresses.sh +++ b/scripts/generate_addresses.sh @@ -7,4 +7,6 @@ npx hardhat addresses --network zeta_mainnet > ./data/addresses.mainnet.json echo "Generating protocol addresses types..." -npx ts-node scripts/generate_addresses_types.ts > ./lib/types.d.ts \ No newline at end of file +npx ts-node scripts/generate_addresses_types.ts > ./lib/types.d.ts + +yarn lint:fix \ No newline at end of file diff --git a/tasks/addresses.mainnet.json b/tasks/addresses.mainnet.json index e718513d..fe76c7f5 100644 --- a/tasks/addresses.mainnet.json +++ b/tasks/addresses.mainnet.json @@ -1,23 +1,23 @@ [ { "address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", - "chain_name": "eth_mainnet", - "chain_id": 1, "category": "messaging", + "chain_id": 1, + "chain_name": "eth_mainnet", "type": "uniswapV2Factory" }, { "address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", - "chain_name": "eth_mainnet", - "chain_id": 1, "category": "messaging", + "chain_id": 1, + "chain_name": "eth_mainnet", "type": "uniswapV2Router02" }, { "address": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "chain_name": "eth_mainnet", - "chain_id": 1, "category": "messaging", + "chain_id": 1, + "chain_name": "eth_mainnet", "type": "uniswapV3Router" } -] \ No newline at end of file +] diff --git a/tasks/addresses.testnet.json b/tasks/addresses.testnet.json index e1575e64..7793f0c8 100644 --- a/tasks/addresses.testnet.json +++ b/tasks/addresses.testnet.json @@ -1,65 +1,65 @@ [ { "address": "0x8eAc517b92eeE82177a83851268F13109878f8c4", - "chain_name": "goerli_testnet", - "chain_id": 5, "category": "messaging", + "chain_id": 5, + "chain_name": "goerli_testnet", "type": "zetaTokenConsumerUniV2" }, { "address": "0x7e792f3736751e168864106AdbAC50152641A927", - "chain_name": "mumbai_testnet", "category": "messaging", "chain_id": 80001, + "chain_name": "mumbai_testnet", "type": "zetaTokenConsumerUniV3" }, { "address": "0xFB2fCE3CCca19F0f764Ed8aa26C62181E3dA04C5", - "chain_name": "bsc_testnet", "category": "messaging", "chain_id": 97, + "chain_name": "bsc_testnet", "type": "zetaTokenConsumerUniV3" }, { "address": "0x8954AfA98594b838bda56FE4C12a09D7739D179b", - "chain_name": "mumbai_testnet", - "chain_id": 80001, "category": "messaging", + "chain_id": 80001, + "chain_name": "mumbai_testnet", "type": "uniswapV2Router02" }, { "address": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "chain_name": "mumbai_testnet", - "chain_id": 80001, "category": "messaging", + "chain_id": 80001, + "chain_name": "mumbai_testnet", "type": "uniswapV3Router" }, { "address": "0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3", - "chain_name": "bsc_testnet", - "chain_id": 97, "category": "messaging", + "chain_id": 97, + "chain_name": "bsc_testnet", "type": "uniswapV2Router02" }, { "address": "0x9a489505a00cE272eAa5e07Dba6491314CaE3796", - "chain_name": "bsc_testnet", - "chain_id": 97, "category": "messaging", + "chain_id": 97, + "chain_name": "bsc_testnet", "type": "uniswapV3Router" }, { "address": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", - "chain_name": "goerli_testnet", - "chain_id": 5, "category": "messaging", + "chain_id": 5, + "chain_name": "goerli_testnet", "type": "uniswapV2Router02" }, { "address": "0xE592427A0AEce92De3Edee1F18E0157C05861564", - "chain_name": "goerli_testnet", - "chain_id": 5, "category": "messaging", + "chain_id": 5, + "chain_name": "goerli_testnet", "type": "uniswapV3Router" } -] \ No newline at end of file +] diff --git a/tasks/addresses.ts b/tasks/addresses.ts index bc40c890..cb33d1b7 100644 --- a/tasks/addresses.ts +++ b/tasks/addresses.ts @@ -1,3 +1,4 @@ +import uniswapV2Router from "@uniswap/v2-periphery/build/IUniswapV2Router02.json"; import { getEndpoints } from "@zetachain/networks"; import axios, { AxiosResponse } from "axios"; import { task } from "hardhat/config"; @@ -6,10 +7,8 @@ import { HardhatRuntimeEnvironment } from "hardhat/types"; import { ZetaConnectorBase__factory } from "../typechain-types"; import { ERC20Custody__factory } from "../typechain-types/factories/contracts/evm/ERC20Custody__factory"; import { SystemContract__factory } from "../typechain-types/factories/contracts/zevm/SystemContract.sol/SystemContract__factory"; -import uniswapV2Router from "@uniswap/v2-periphery/build/IUniswapV2Router02.json"; - -import zeta_testnet_addresses from "./addresses.testnet.json"; import zeta_mainnet_addresses from "./addresses.mainnet.json"; +import zeta_testnet_addresses from "./addresses.testnet.json"; declare const hre: any;