generated from AlexNi245/solidity-typescript-hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
hardhat.config.ts
88 lines (83 loc) · 2.22 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
/**
* @type import('hardhat/config').HardhatUserConfig
*/
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-solhint';
import '@typechain/hardhat';
import 'dotenv/config';
import { ethers } from 'ethers';
import 'hardhat-abi-exporter';
import 'hardhat-deploy';
import 'hardhat-storage-layout';
import 'hardhat-tracer';
import 'solidity-coverage';
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY;
const OPTIMISTIC_ETHERSCAN_API_KEY = process.env.OPTIMISTIC_ETHERSCAN_API_KEY;
const GOERLI_URL = process.env.GOERLI_RPC_URL ?? '';
const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY ?? ethers.Wallet.createRandom().privateKey;
const hardhat =
process.env.CI || process.env.npm_lifecycle_event !== 'test:e2e'
? {}
: {
forking: {
url: 'http://localhost:8545',
},
};
module.exports = {
defaultNetwork: 'hardhat',
networks: {
hardhat,
optimismGoerli: {
url: 'https://goerli.optimism.io',
accounts: [DEPLOYER_PRIVATE_KEY],
},
goerli: {
url: GOERLI_URL,
accounts: [DEPLOYER_PRIVATE_KEY],
},
localhost: {},
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
},
solidity: {
compilers: [
{
version: '0.8.17',
settings: {
viaIR: true,
optimizer: {
enabled: true,
details: {
yulDetails: {
optimizerSteps: 'u',
},
},
},
},
},
],
},
mocha: {
timeout: 100000,
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5',
},
abiExporter: {
path: './build/contracts',
runOnCompile: true,
clear: true,
flat: true,
except: [],
spacing: 2,
pretty: true,
},
};