forked from bobanetwork/boba_legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
134 lines (127 loc) · 3.07 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
import { HardhatUserConfig } from 'hardhat/types'
import 'solidity-coverage'
import * as dotenv from 'dotenv'
import {
DEFAULT_ACCOUNTS_HARDHAT,
RUN_OVM_TEST_GAS,
} from './test/helpers/constants'
// Hardhat plugins
// Hardhat plugins
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import '@nomiclabs/hardhat-etherscan'
import 'hardhat-deploy'
import '@typechain/hardhat'
import './tasks/deploy'
import './tasks/l2-gasprice'
import './tasks/set-owner'
import './tasks/validate-address-dictator'
import './tasks/validate-chugsplash-dictator'
import './tasks/whitelist'
import './tasks/withdraw-fees'
import 'hardhat-gas-reporter'
//import '@primitivefi/hardhat-dodoc'
import 'hardhat-output-validator'
// Load environment variables from .env
dotenv.config()
const enableGasReport = !!process.env.ENABLE_GAS_REPORT
const privateKey =
process.env.PRIVATE_KEY ||
'0x0000000000000000000000000000000000000000000000000000000000000000' // this is to avoid hardhat error
const config: HardhatUserConfig = {
networks: {
hardhat: {
accounts: DEFAULT_ACCOUNTS_HARDHAT,
blockGasLimit: RUN_OVM_TEST_GAS * 2,
live: false,
saveDeployments: false,
tags: ['local'],
hardfork: 'istanbul',
},
optimism: {
url: 'http://127.0.0.1:8545',
saveDeployments: false,
},
'optimism-kovan': {
chainId: 69,
url: 'https://kovan.optimism.io',
accounts: [privateKey],
},
'optimism-mainnet': {
chainId: 10,
url: 'https://mainnet.optimism.io',
accounts: [privateKey],
},
mainnet: {
url: process.env.L1_NODE_WEB3_URL || '',
},
},
mocha: {
timeout: 50000,
},
solidity: {
compilers: [
{
version: '0.8.9',
settings: {
optimizer: { enabled: true, runs: 10_000 },
metadata: {
bytecodeHash: 'none',
},
outputSelection: {
'*': {
'*': ['storageLayout'],
},
},
},
},
{
version: '0.5.17', // Required for WETH9
settings: {
optimizer: { enabled: true, runs: 10_000 },
outputSelection: {
'*': {
'*': ['storageLayout'],
},
},
},
},
],
},
typechain: {
outDir: 'dist/types',
target: 'ethers-v5',
},
paths: {
deploy: './deploy',
deployments: './deployments',
},
namedAccounts: {
deployer: {
default: 0,
},
},
gasReporter: {
enabled: enableGasReport,
currency: 'USD',
gasPrice: 100,
outputFile: process.env.CI ? 'gas-report.txt' : undefined,
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
}
if (
process.env.CONTRACTS_TARGET_NETWORK &&
process.env.CONTRACTS_DEPLOYER_KEY &&
process.env.CONTRACTS_RPC_URL
) {
config.networks[process.env.CONTRACTS_TARGET_NETWORK] = {
accounts: [process.env.CONTRACTS_DEPLOYER_KEY],
url: process.env.CONTRACTS_RPC_URL,
live: true,
saveDeployments: true,
tags: [process.env.CONTRACTS_TARGET_NETWORK],
}
}
export default config