-
Notifications
You must be signed in to change notification settings - Fork 49
/
hardhat.config.ts
155 lines (150 loc) · 4.68 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
import { task } from "hardhat/config";
import "@nomiclabs/hardhat-waffle";
import "hardhat-contract-sizer";
import "hardhat-log-remover";
import "hardhat-deploy";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-etherscan";
import "solidity-coverage";
import "hardhat-gas-reporter";
import exportDeployments from "./scripts/tasks/exportDeployments";
import verifyContracts from "./scripts/tasks/verifyContracts";
import { BLOCK_NUMBER } from "./constants/constants";
import { TEST_URI } from "./scripts/helpers/getDefaultEthersProvider";
require("dotenv").config();
process.env.TEST_MNEMONIC =
"test test test test test test test test test test test junk";
// Defaults to CHAINID=1 so things will run with mainnet fork if not specified
const CHAINID = process.env.CHAINID ? Number(process.env.CHAINID) : 1;
export default {
accounts: {
mnemonic: process.env.TEST_MNEMONIC,
},
paths: {
deploy: "scripts/deploy",
deployments: "deployments",
},
solidity: {
version: "0.8.4",
settings: {
optimizer: {
runs: 200,
enabled: true,
},
},
},
networks: {
hardhat: {
accounts: {
mnemonic: process.env.TEST_MNEMONIC,
},
chainId: CHAINID,
forking: {
url: TEST_URI[CHAINID],
blockNumber: BLOCK_NUMBER[CHAINID],
gasLimit: 8e6,
},
},
mainnet: {
url: process.env.TEST_URI,
chainId: 1,
accounts: {
mnemonic: process.env.MAINNET_MNEMONIC,
},
},
kovan: {
url: process.env.KOVAN_URI,
chainId: 42,
accounts: {
mnemonic: process.env.KOVAN_MNEMONIC,
},
},
goerli: {
url: process.env.GOERLI_URI,
chainId: 5,
accounts: {
mnemonic: process.env.GOERLI_MNEMONIC,
},
},
avax: {
url: process.env.AVAX_URI,
chainId: 43114,
accounts: {
mnemonic: process.env.AVAX_MNEMONIC,
},
},
fuji: {
url: process.env.FUJI_URI,
chainId: 43113,
accounts: {
mnemonic: process.env.FUJI_MNEMONIC,
},
},
},
namedAccounts: {
deployer: {
default: 0,
1: "0xF8368119Bb1073Cf01B841848725d81b542A4c19",
5: "0xF8368119Bb1073Cf01B841848725d81b542A4c19",
42: "0x422f7Bb366608723c8fe61Ac6D923023dCCBC3d7",
43114: "0x422f7Bb366608723c8fe61Ac6D923023dCCBC3d7",
43113: "0x422f7Bb366608723c8fe61Ac6D923023dCCBC3d7",
1313161554: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
1313161555: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
},
owner: {
default: 0,
1: "0x77DA011d5314D80BE59e939c2f7EC2F702E1DCC4",
5: "0xF8368119Bb1073Cf01B841848725d81b542A4c19",
42: "0x92Dd37fbc36cB7260F0d2BD09F9672525a028fB8",
43114: "0x939cbb6BaBAad2b0533C2CACa8a4aFEc3ae06492",
43113: "0x004FCF8052D3c7eCb7558ac0068882425a055528",
1313161554: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
1313161555: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
},
keeper: {
default: 0,
1: "0x691c87dc570563D1D0AD7Fd0bb099ED367858863",
5: "0xF8368119Bb1073Cf01B841848725d81b542A4c19",
42: "0x691c87dc570563D1D0AD7Fd0bb099ED367858863",
43114: "0x422f7Bb366608723c8fe61Ac6D923023dCCBC3d7",
43113: "0x004FCF8052D3c7eCb7558ac0068882425a055528",
1313161554: "0xA4290C9EAe274c7A8FbC57A1E68AdC3E95E7C67e",
1313161555: "0xA4290C9EAe274c7A8FbC57A1E68AdC3E95E7C67e",
},
admin: {
default: 0,
1: "0x43a43D3404eaC5fA1ec4F4BB0879495D500e390b",
5: "0x43a43D3404eaC5fA1ec4F4BB0879495D500e390b",
42: "0x422f7Bb366608723c8fe61Ac6D923023dCCBC3d7",
43114: "0x31351f2BD9e94813BCf0cA04B5E6e2b7ceAFC7c6",
43113: "0x004FCF8052D3c7eCb7558ac0068882425a055528",
1313161554: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
1313161555: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
},
feeRecipient: {
default: 0,
1: "0xdaeada3d210d2f45874724beea03c7d4bbd41674", // Ribbon DAO
5: "0xF8368119Bb1073Cf01B841848725d81b542A4c19",
42: "0x92Dd37fbc36cB7260F0d2BD09F9672525a028fB8",
43114: "0x939cbb6BaBAad2b0533C2CACa8a4aFEc3ae06492",
43113: "0x004FCF8052D3c7eCb7558ac0068882425a055528",
1313161554: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
1313161555: "0x46B4E6143Fb6ded2e5FBd87887Ef4f50f716dcA0",
},
},
mocha: {
timeout: 500000,
},
etherscan: {
apiKey:
CHAINID === 1 || CHAINID === 42
? process.env.ETHERSCAN_API_KEY
: process.env.SNOWTRACE_API_KEY,
},
gasReporter: {
enabled: true,
},
};
task("export-deployments", "Exports deployments into JSON", exportDeployments);
task("verify-contracts", "Verify solidity source", verifyContracts);