-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.config.ts
57 lines (54 loc) · 1.31 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
import 'dotenv/config';
import '@nomicfoundation/hardhat-toolbox';
import '@nomicfoundation/hardhat-foundry';
import { HardhatUserConfig } from 'hardhat/config';
import chalk from 'chalk';
import console from 'console';
import process from 'process';
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 10000
}
}
}
]
},
paths: {
sources: './contracts',
tests: './test',
cache: './build/cache',
artifacts: './build/artifacts'
},
gasReporter: {
enabled: true,
outputFile: './test/gas-report.txt',
noColors: true
},
networks: {
localhost: {
chainId: 31337,
url: 'http://localhost:8545'
},
sepolia: {
url: 'https://ethereum-sepolia-rpc.publicnode.com',
chainId: 11155111,
accounts: getSepoliaPrivateKeys()
}
}
};
function getSepoliaPrivateKeys(): string[] {
const sepoliaPrivateKeysEnv = process.env.SEPOLIA_PRIVATE_KEYS;
if (sepoliaPrivateKeysEnv === undefined) {
console.log(chalk.red('Env variable SEPOLIA_PRIVATE_KEY is not set'));
process.exit();
}
const sepoliaPrivateKeys = sepoliaPrivateKeysEnv.split(',');
return sepoliaPrivateKeys;
}
export default config;