generated from wighawag/template-ethereum-contracts
-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.config.ts
140 lines (133 loc) · 3.43 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
import 'dotenv/config';
import {HardhatUserConfig} from 'hardhat/types';
import {task} from 'hardhat/config';
import '@nomiclabs/hardhat-ethers';
import '@typechain/hardhat';
import 'hardhat-deploy';
import "hardhat-deploy-tenderly";
import 'hardhat-gas-reporter';
import 'solidity-coverage';
import {node_url, accounts} from './utils/network';
import {APMRegistry, Kernel} from './typechain';
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.4.24',
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
],
},
namedAccounts: {
deployer: 0,
simpleERC20Beneficiary: 1,
},
networks: {
hardhat: {
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
// this line ensure the use of the corresponding accounts
accounts: accounts(process.env.HARDHAT_FORK),
forking: process.env.HARDHAT_FORK
? {
url: node_url(process.env.HARDHAT_FORK),
blockNumber: process.env.HARDHAT_FORK_NUMBER
? parseInt(process.env.HARDHAT_FORK_NUMBER)
: undefined,
}
: undefined,
},
localhost: {
url: node_url('localhost'),
accounts: accounts(),
},
staging: {
url: node_url('rinkeby'),
accounts: accounts('rinkeby'),
},
production: {
url: node_url('mainnet'),
accounts: accounts('mainnet'),
},
mainnet: {
url: node_url('mainnet'),
accounts: accounts('mainnet'),
},
rinkeby: {
url: node_url('rinkeby'),
accounts: accounts('rinkeby'),
},
kovan: {
url: node_url('kovan'),
accounts: accounts('kovan'),
},
goerli: {
url: node_url('goerli'),
accounts: accounts('goerli'),
},
polygon: {
url: node_url('polygon'),
accounts: accounts('polygon'),
},
mumbai: {
url: node_url('mumbai'),
accounts: accounts('mumbai'),
},
arbitrum: {
url: node_url('arbitrum'),
accounts: accounts('arbitrum'),
gasPrice: 0,
},
arbtest: {
url: node_url('arbtest'),
accounts: accounts('arbtest'),
},
frame: {
url: 'http://localhost:1248',
httpHeaders: {origin: 'hardhat'},
timeout: 0,
},
},
gasReporter: {
currency: 'USD',
gasPrice: 100,
enabled: process.env.REPORT_GAS ? true : false,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
maxMethodDiff: 10,
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5',
},
mocha: {
timeout: 0,
},
external: process.env.HARDHAT_FORK
? {
deployments: {
// process.env.HARDHAT_FORK will specify the network that the fork is made from.
// these lines allow it to fetch the deployments from the network being forked from both for node and deploy task
hardhat: ['deployments/' + process.env.HARDHAT_FORK],
localhost: ['deployments/' + process.env.HARDHAT_FORK],
},
}
: undefined,
};
export default config;
task('apm', 'Get APM DAO address')
.addParam('apm', 'The APM Registry address')
.setAction(async ({apm: apmAddress}, {ethers}) => {
const apm = (await ethers.getContractAt(
'APMRegistry',
apmAddress
)) as APMRegistry;
const kernel = (await ethers.getContractAt(
'Kernel',
await apm.kernel()
)) as Kernel;
console.log(kernel.address);
});