forked from KyberNetwork/dao_sc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
127 lines (108 loc) · 2.89 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
import '@nomiclabs/hardhat-truffle5';
import '@nomiclabs/hardhat-waffle';
import '@nomiclabs/hardhat-web3';
import '@nomiclabs/hardhat-etherscan';
import 'hardhat-gas-reporter';
import 'solidity-coverage';
import '@openzeppelin/hardhat-upgrades';
import 'hardhat-typechain';
import { HardhatUserConfig } from 'hardhat/types';
import * as dotenv from 'dotenv';
dotenv.config();
import './deployment/katanaDeployment.js';
import './deployment/deployInternalGovernance.js';
import './deployment/liquidityMining/deployLiquidityMining.js';
import './deployment/createBinaryProposal.js';
import './deployment/simFullProposal.js';
import './deployment/simProposalExecution.js';
import { accounts } from './test-wallets';
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
gasReporter: {
currency: 'USD',
gasPrice: 100,
},
networks: {
develop: {
url: 'http://127.0.0.1:8545',
gas: 6000000,
timeout: 20000,
},
hardhat: {
accounts: accounts,
},
},
solidity: {
compilers: [
{
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
],
},
paths: {
sources: './contracts',
tests: './test',
},
mocha: {
timeout: 0,
},
typechain: {
target: 'ethers-v5'
}
};
const INFURA_API_KEY: string = process.env.INFURA_API_KEY || '';
const PRIVATE_KEY: string = process.env.PRIVATE_KEY || '';
const ETHERSCAN_KEY: string = process.env.ETHERSCAN_KEY || '';
const POLYGONSCAN_KEY: string = process.env.POLYGONSCAN_KEY || '';
const ETH_NODE_URL: string = process.env.ETH_NODE_URL || '';
const FORK_BLOCK: string = process.env.FORK_BLOCK || ''
if (ETH_NODE_URL != '' && FORK_BLOCK != '') {
config.networks!.hardhat!.forking = {
url: ETH_NODE_URL,
blockNumber: parseInt(FORK_BLOCK)
}
}
if (INFURA_API_KEY != '' && PRIVATE_KEY != '') {
config.networks!.kovan = {
url: `https://kovan.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
timeout: 20000,
};
config.networks!.rinkeby = {
url: `https://rinkeby.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
timeout: 20000,
};
config.networks!.ropsten = {
url: `https://ropsten.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
timeout: 20000,
};
config.networks!.mainnet = {
url: `https://mainnet.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
timeout: 20000,
};
config.networks!.polygon = {
url: `https://rpc-mainnet.maticvigil.com/`,
accounts: [PRIVATE_KEY],
timeout: 20000,
};
config.networks!.mumbai = {
url: `https://rpc-mumbai.maticvigil.com/`,
accounts: [PRIVATE_KEY],
timeout: 20000,
};
}
if (ETHERSCAN_KEY != '' || POLYGONSCAN_KEY != '') {
config.etherscan = {
apiKey: ETHERSCAN_KEY == '' ? POLYGONSCAN_KEY : ETHERSCAN_KEY,
};
}
export default config;