-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
140 lines (134 loc) · 4.28 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import '@nomicfoundation/hardhat-verify';
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-waffle';
import '@typechain/hardhat';
import 'hardhat-contract-sizer';
import 'hardhat-deploy';
import 'hardhat-gas-reporter';
import '@rumblefishdev/hardhat-kms-signer';
import * as dotenv from 'dotenv';
import { HardhatUserConfig } from 'hardhat/types';
dotenv.config();
const privateKey =
process.env.DEFAULT_PRIVATE_KEY || 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';
const DEFAULT_PRIVATE_KEY = privateKey;
const goerliEndpoint = process.env.GOERLI_ENDPOINT || process.env.DEFAULT_ENDPOINT;
const goerliPrivateKey = process.env.GOERLI_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const sepoliaEndpoint = process.env.SEPOLIA_ENDPOINT || process.env.DEFAULT_ENDPOINT;
const sepoliaPrivateKey = process.env.SEPOLIA_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const bscTestEndpoint = process.env.BSC_TEST_ENDPOINT || process.env.DEFAULT_ENDPOINT;
const bscTestPrivateKey = process.env.BSC_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const avalancheTestEndpoint = process.env.AVALANCHE_TEST_ENDPOINT || process.env.DEFAULT_ENDPOINT;
const avalancheTestPrivateKey = process.env.AVALANCHE_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const holeskyEndpoint = process.env.HOLESKY_ENDPOINT || 'https://holesky.drpc.org';
const holeskyPrivateKey = process.env.HOLESKY_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const optimismEndpoint = process.env.OPTIMISM_ENDPOINT || process.env.DEFAULT_ENDPOINT;
const optimismPrivateKey = process.env.OPTIMISM_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
// Testnets
hardhat: {
blockGasLimit: 120_000_000
},
localhost: { timeout: 600000 },
goerli: {
url: goerliEndpoint || '',
accounts: [`0x${goerliPrivateKey}`]
},
sepolia: {
url: sepoliaEndpoint || '',
accounts: [`0x${sepoliaPrivateKey}`]
},
bscTest: {
url: bscTestEndpoint || '',
accounts: [`0x${bscTestPrivateKey}`]
},
avalancheTest: {
url: avalancheTestEndpoint || '',
accounts: [`0x${avalancheTestPrivateKey}`]
},
holesky: {
url: holeskyEndpoint,
accounts: [`0x${holeskyPrivateKey}`]
},
// Mainnet
linea: {
url: process.env.LINEA_ENDPOINT || '',
accounts: [`0x${privateKey}`]
},
base: {
url: process.env.BASE_ENDPOINT || '',
accounts: [`0x${privateKey}`]
},
arbitrum: {
url: process.env.ARBITRUM_ENDPOINT || 'https://arbitrum.llamarpc.com',
accounts: [`0x${privateKey}`]
},
optimism: {
url: optimismEndpoint || '',
accounts: [`0x${optimismPrivateKey}`]
}
},
namedAccounts: {
deployer: {
default: 0
}
},
solidity: {
version: '0.8.20',
settings: {
optimizer: {
enabled: true,
runs: 800
},
viaIR: true
}
},
gasReporter: {
enabled: process.env.REPORT_GAS === 'true' ? true : false,
noColors: true,
outputFile: 'reports/gas_usage/summary.txt'
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5'
},
etherscan: {
apiKey: {
goerli: process.env.ETHERSCAN_API_KEY as string,
sepolia: process.env.ETHERSCAN_API_KEY as string,
bscTestnet: process.env.BSCSCAN_API_KEY as string,
avalancheFujiTestnet: process.env.SNOWTRACE_API_KEY as string,
linea: process.env.LINEASCAN_API_KEY as string,
holesky: process.env.ETHERSCAN_API_KEY as string,
base: process.env.BASESCAN_API_KEY as string,
arbitrumOne: process.env.ARBISCAN_API_KEY as string,
optimisticEthereum: process.env.OPSCAN_API_KEY as string
},
customChains: [
{
network: 'linea',
chainId: 59144,
urls: {
apiURL: 'https://api.lineascan.build/api',
browserURL: 'https://lineascan.build/'
}
},
{
network: 'holesky',
chainId: 17000,
urls: {
apiURL: 'https://api-holesky.etherscan.io/api',
browserURL: 'https://holesky.etherscan.io/'
}
}
]
}
};
if (config.networks?.bscTest) {
config.networks.bscTest.minMaxPriorityFeePerGas = 3000000000;
config.networks.bscTest.minMaxFeePerGas = 3000000000;
config.networks.bscTest.gasPrice = 10000000000;
}
export default config;