forked from enzymefinance/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
118 lines (112 loc) · 2.83 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
import 'dotenv/config';
import 'hardhat-deploy';
import 'hardhat-deploy-ethers';
import 'hardhat-contract-sizer';
import '@crestproject/hardhat/plugin';
import { utils } from 'ethers';
import { HardhatUserConfig } from 'hardhat/types';
function node(networkName: string) {
const fallback = 'http://localhost:8545';
const uppercase = networkName.toUpperCase();
const uri = process.env[`ETHEREUM_NODE_${uppercase}`] || process.env.ETHEREUM_NODE || fallback;
return uri.replace('{{NETWORK}}', networkName);
}
function accounts(networkName: string) {
const uppercase = networkName.toUpperCase();
const accounts = process.env[`ETHEREUM_ACCOUNTS_${uppercase}`] || process.env.ETHEREUM_ACCOUNTS || '';
return accounts
.split(',')
.map((account) => account.trim())
.filter(Boolean);
}
const mnemonic = 'test test test test test test test test test test test junk';
const config: HardhatUserConfig = {
solidity: {
version: '0.6.12',
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: false,
},
},
},
},
networks: {
hardhat: {
accounts: {
mnemonic,
count: 10,
accountsBalance: utils.parseUnits('1', 36).toString(),
},
forking: {
url: node('mainnet'),
blockNumber: 11621050, // Jan 9, 2021
},
},
mainnet: {
url: node('mainnet'),
accounts: accounts('mainnet'),
},
kovan: {
url: node('kovan'),
accounts: accounts('kovan'),
},
},
namedAccounts: {
deployer: 0,
},
contractSizer: {
disambiguatePaths: false,
},
codeGenerator: {
enabled: true,
clear: true,
bytecode: {
path: './packages/protocol/artifacts',
},
abi: {
path: './packages/protocol/artifacts',
},
typescript: {
path: './packages/protocol/src/codegen',
},
include: [
// Explicitly allow inclusion of core release interfaces.
'IDerivativePriceFeed',
'IExtension',
'IIntegrationAdapter',
'IFee',
'IPolicy',
'IPrimitivePriceFeed',
// TODO: Re-evaluate whether we should include these at all.
'IMigrationHookHandler',
'IMigratableVault',
'IChainlinkAggregator',
'IMakerDaoPot',
'IUniswapV2Factory',
'IUniswapV2Pair',
'IUniswapV2Router2',
'IKyberNetworkProxy',
'ICERC20',
'ICEther',
'IChai',
'ISynthetix',
'ISynthetixAddressResolver',
'ISynthetixDelegateApprovals',
'ISynthetixExchangeRates',
'ISynthetixExchanger',
'ISynthetixProxyERC20',
'ISynthetixSynth',
],
options: {
ignoreContractsWithoutAbi: true,
ignoreContractsWithoutBytecode: true,
},
},
codeCoverage: {
exclude: ['/mock/i'], // Ignore anything with the word "mock" in it.
},
};
export default config;