-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
52 lines (49 loc) · 1.29 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
import type { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox-viem';
import * as dotenv from 'dotenv';
dotenv.config();
const config: HardhatUserConfig = {
networks: {
localhost: {
url: 'http://127.0.0.1:8545',
// Account 0 of the default Hardhat node, funded with ETH so we can test deployment locally
accounts: ['0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'],
},
// Mainnet configuration (only used if INFURA_API_KEY and PRIVATE_KEY are set)
// Let's us still test locally without setting up mainnet
...(process.env.RPC_URL && process.env.PRIVATE_KEY
? {
mainnet: {
url: process.env.RPC_URL,
accounts: [process.env.PRIVATE_KEY],
},
}
: {}),
},
solidity: {
settings: {
optimizer: {
enabled: true,
runs: 100000,
},
},
compilers: [
{
version: '0.5.16',
},
],
},
// Etherscan configuration for mainnet deployment verification
// Optional so we can still test locally without setting up etherscan
...(process.env.ETHERSCAN_API_KEY
? {
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
}
: {}),
sourcify: {
enabled: true,
},
};
export default config;