diff --git a/hardhat.config.ts b/hardhat.config.ts index d518905a..3db6b821 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -3,7 +3,7 @@ import fs from 'fs'; import { HardhatUserConfig } from 'hardhat/types'; // @ts-ignore import { accounts } from './test-wallets.js'; -import { eEthereumNetwork, iParamsPerNetwork } from './helpers/types'; +import { eEthereumNetwork, ePolygonNetwork, eXDaiNetwork } from './helpers/types'; import { BUIDLEREVM_CHAINID, COVERAGE_CHAINID } from './helpers/buidler-constants'; import { NETWORKS_RPC_URL, NETWORKS_DEFAULT_GASĀ } from './helper-hardhat-config'; @@ -41,7 +41,7 @@ if (!SKIP_LOAD) { require(`${path.join(__dirname, 'tasks/misc')}/set-bre.ts`); -const getCommonNetworkConfig = (networkName: eEthereumNetwork, networkId: number) => ({ +const getCommonNetworkConfig = (networkName: eEthereumNetwork | ePolygonNetwork | eXDaiNetwork, networkId: number) => ({ url: NETWORKS_RPC_URL[networkName], hardfork: HARDFORK, blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT, @@ -95,8 +95,9 @@ const buidlerConfig: HardhatUserConfig = { ropsten: getCommonNetworkConfig(eEthereumNetwork.ropsten, 3), main: getCommonNetworkConfig(eEthereumNetwork.main, 1), tenderlyMain: getCommonNetworkConfig(eEthereumNetwork.main, 1), - matic: getCommonNetworkConfig(eEthereumNetwork.matic, 137), - mumbai: getCommonNetworkConfig(eEthereumNetwork.mumbai, 80001), + matic: getCommonNetworkConfig(ePolygonNetwork.matic, 137), + mumbai: getCommonNetworkConfig(ePolygonNetwork.mumbai, 80001), + xdai: getCommonNetworkConfig(eXDaiNetwork.xdai, 100), hardhat: { hardfork: 'istanbul', blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT, diff --git a/helper-hardhat-config.ts b/helper-hardhat-config.ts index 159418e9..c25f7b9f 100644 --- a/helper-hardhat-config.ts +++ b/helper-hardhat-config.ts @@ -1,5 +1,5 @@ // @ts-ignore -import { eEthereumNetwork, iParamsPerNetwork } from './helpers/types'; +import { eEthereumNetwork, ePolygonNetwork, eXDaiNetwork, iParamsPerNetwork } from './helpers/types'; require('dotenv').config(); @@ -24,9 +24,9 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork = { [eEthereumNetwork.tenderlyMain]: ALCHEMY_KEY ? `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_KEY}` : `https://mainnet.infura.io/v3/${INFURA_KEY}`, - [eEthereumNetwork.mumbai]: 'https://rpc-mumbai.maticvigil.com', - [eEthereumNetwork.matic]: 'https://rpc-mainnet.matic.network', - [eEthereumNetwork.xdai]: 'https://rpc.xdaichain.com/', + [ePolygonNetwork.mumbai]: 'https://rpc-mumbai.maticvigil.com', + [ePolygonNetwork.matic]: 'https://rpc-mainnet.matic.network', + [eXDaiNetwork.xdai]: 'https://rpc.xdaichain.com/', } export const NETWORKS_DEFAULT_GAS: iParamsPerNetwork = { @@ -37,7 +37,7 @@ export const NETWORKS_DEFAULT_GAS: iParamsPerNetwork = { [eEthereumNetwork.hardhat]: 65 * GWEI , [eEthereumNetwork.buidlerevm]: 65 * GWEI , [eEthereumNetwork.tenderlyMain]: 65 * GWEI , - [eEthereumNetwork.mumbai]: 1 * GWEI , - [eEthereumNetwork.matic]: 2 * GWEI , - [eEthereumNetwork.xdai]: 1 * GWEI, + [ePolygonNetwork.mumbai]: 1 * GWEI , + [ePolygonNetwork.matic]: 2 * GWEI , + [eXDaiNetwork.xdai]: 1 * GWEI, } \ No newline at end of file