-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
111 lines (102 loc) · 3.6 KB
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import * as dotenv from "dotenv";
dotenv.config();
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-web3";
// import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import { HardhatUserConfig } from "hardhat/types";
import "./tasks/tasks";
const HARDHAT_FORK_URL: string = process.env.HARDHAT_FORK_URL as string;
const HARDHAT_CHAIN_ID = parseFloat(process.env.HARDHAT_CHAIN_ID as string) as number;
const AVALANCHE_MAINNET_URL: string = process.env.AVALANCHE_MAINNET_URL as string;
const AVALANCHE_CHAIN_ID = parseFloat(process.env.AVALANCHE_CHAIN_ID as string) as number;
const AVALANCHE_PRIVATE_KEY: string = process.env.AVALANCHE_PRIVATE_KEY as string;
const LOCALFORK_URL = process.env.LOCALFORK_URL as string || HARDHAT_FORK_URL
const LOCALFORK_CHAIN_ID = parseFloat(process.env.LOCALFORK_CHAIN_ID as string) as number || HARDHAT_CHAIN_ID
const LOCALFORK_PRIVATE_KEY = process.env.LOCALFORK_PRIVATE_KEY as string || AVALANCHE_PRIVATE_KEY
const BINANCE_MAINNET_URL: string = process.env.BINANCE_MAINNET_URL as string;
const FANTOM_MAINNET_URL: string = process.env.FANTOM_MAINNET_URL as string;
const BINANCE_PRIVATE_KEY: string = process.env.BINANCE_PRIVATE_KEY as string;
const FANTOM_PRIVATE_KEY: string = process.env.FANTOM_PRIVATE_KEY as string;
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
const config: HardhatUserConfig = {
defaultNetwork: "local",
// defaultNetwork: "avax_mainnet",
// defaultNetwork: "avax_testnet",
// defaultNetwork: "bnb_mainnet",
// defaultNetwork: "bnb_testnet",
// defaultNetwork: "ftm_mainnet",
// defaultNetwork: "ftm_testnet",
solidity: "0.8.4",
networks: {
hardhat: { // this is the default when executing "hardhat node"
// chainId: 31337,
chainId: HARDHAT_CHAIN_ID,
gasPrice: 225000000000,
throwOnTransactionFailures: false,
loggingEnabled: true,
forking: {
url: HARDHAT_FORK_URL,
enabled: true,
// blockNumber: 2975762
// blockNumber: 13919447
},
},
local: {
url: LOCALFORK_URL,
gasPrice: 225000000000,
chainId: LOCALFORK_CHAIN_ID,
accounts: [
LOCALFORK_PRIVATE_KEY,
]
},
// //region networks
avax_mainnet: {
url: AVALANCHE_MAINNET_URL as string,
gasPrice: "auto", // "auto" is the default (but also, don't want to overpay - same base price for each chain?)
// gasPrice: 225000000000,
chainId: 43114,
loggingEnabled: true,
accounts: [AVALANCHE_PRIVATE_KEY]
},
// avax_testnet: {
// url: "https://api.avax-test.network/ext/bc/C/rpc",
// gasPrice: 225000000000,
// chainId: 43113,
// accounts: [AVALANCHE_PRIVATE_KEY]
// },
// bnb_mainnet: {
// url: BINANCE_MAINNET_URL as string,
// chainId: 56,
// gasPrice: 20000000000,
// loggingEnabled: true,
// accounts: [BINANCE_PRIVATE_KEY]
// },
// bnb_testnet: {
// url: "https://data-seed-prebsc-1-s1.binance.org:8545",
// chainId: 97,
// gasPrice: 20000000000,
// accounts: [BINANCE_PRIVATE_KEY]
// },
// ftm_mainnet: {
// url: FANTOM_MAINNET_URL as string,
// chainId: 250,
// gasPrice: 2000000000,
// loggingEnabled: true,
// accounts: [FANTOM_PRIVATE_KEY]
// },
// ftm_testnet: {
// url: "https://rpc.testnet.fantom.network",
// chainId: 4002,
// gasPrice: 2000000000,
// accounts: [FANTOM_PRIVATE_KEY]
// }
// //endregion
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
},
};
export default config;