-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
159 lines (155 loc) · 4.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import 'dotenv/config';
import 'solidity-coverage';
import 'hardhat-deploy';
import 'hardhat-local-networks-config-plugin';
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-web3';
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-truffle5';
import '@nomiclabs/hardhat-waffle';
import './hardhat/tasks';
const CHAIN_IDS = {
hardhat: 31337,
kovan: 42,
goerli: 5,
mainnet: 1,
rinkeby: 4,
ropsten: 3,
dockerParity: 17,
bsctest: 97,
};
const INFURA_KEY = process.env.INFURA_KEY || '';
const DEPLOYER_PRIVATE_KEY =
process.env.DEPLOYER_PRIVATE_KEY || '0000000000000000000000000000000000000000000000000000000000000000';
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || '';
const OPTIMIZATION_ENABLE = (process.env.OPTIMIZATION_ENABLE || 'true') === 'true';
let optimizer = OPTIMIZATION_ENABLE
? {
enabled: true,
runs: 200,
details: {
yul: true,
deduplicate: true,
cse: true,
constantOptimizer: true,
},
}
: {};
export default {
networks: {
hardhat: {
chainId: CHAIN_IDS.hardhat,
// hardhat testing cannot check revert reason if optimization is enabled
allowUnlimitedContractSize: true,
},
dockerParity: {
gas: 10000000,
live: false,
chainId: CHAIN_IDS.dockerParity,
url: 'http://localhost:8545',
},
mainnet: {
chainId: CHAIN_IDS.mainnet,
url: `https://mainnet.infura.io/v3/${INFURA_KEY}`,
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
ropsten: {
chainId: CHAIN_IDS.ropsten,
url: `https://ropsten.infura.io/v3/${INFURA_KEY}`,
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
kovan: {
chainId: CHAIN_IDS.kovan,
url: `https://kovan.infura.io/v3/${INFURA_KEY}`,
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
rinkeby: {
chainId: CHAIN_IDS.rinkeby,
url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`,
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
goerli: {
chainId: CHAIN_IDS.goerli,
url: `https://goerli.infura.io/v3/${INFURA_KEY}`,
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
bsc: {
chainId: 56,
url: 'https://bsc-dataseed.binance.org',
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
bsctest: {
chainId: 97,
url: 'https://data-seed-prebsc-1-s1.binance.org:8545',
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
apothem: {
chainId: 51,
url: 'https://rpc.apothem.network',
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
polygon: {
chainId: 137,
url: 'https://polygon-rpc.com/',
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
},
mumbai: {
chainId: 80001,
url: 'https://matic-mumbai.chainstacklabs.com/',
accounts: [`0x${DEPLOYER_PRIVATE_KEY}`], // Using private key instead of mnemonic for vanity deploy
saveDeployments: true,
}
},
namedAccounts: {
deployer: {
default: 0,
},
admin: {
default: 1,
},
user1: {
default: 2,
},
user2: {
default: 3,
},
},
solidity: {
compilers: [
{
version: '0.6.12',
settings: {
optimizer,
},
},
{
version: '0.8.0',
settings: {
optimizer,
},
},
{
version: '0.5.16',
settings: {
optimizer,
},
},
],
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
paths: {
deploy: 'deployments/migrations',
deployments: 'deployments/artifacts',
},
};