forked from stargate-protocol/stargate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
155 lines (138 loc) · 4.05 KB
/
hardhat.config.js
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
require("dotenv").config();
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-solhint");
require("@nomiclabs/hardhat-web3");
require("hardhat-gas-reporter");
require("solidity-coverage");
require("hardhat-contract-sizer");
require("hardhat-tracer");
require("@primitivefi/hardhat-dodoc");
require("hardhat-deploy");
require("hardhat-deploy-ethers");
require("hardhat-spdx-license-identifier");
// const infuraProjectId = process.env.INFURA_PROJECT_ID;
// console.log(`infuraProjectId: ${infuraProjectId}`);
// custom helper tasks
require("./tasks/addLiquidity");
require("./tasks/sendCredits");
require("./tasks/swap");
require("./tasks/createChainPath");
require("./tasks/setWeightForChainPath");
require("./tasks/setBridge");
require("./tasks/getBridge");
require("./tasks/mintTokens");
require("./tasks/getPool");
require("./tasks/addLPStakingPool");
require("./tasks/createPools");
require("./tasks/createChainPaths");
require("./tasks/activateChainPath");
require("./tasks/activateChainPaths");
require("./tasks/deployToken");
require("./tasks/testnetSwap");
require("./tasks/wireBridges");
require("./tasks/wireStargateTokens");
require("./tasks/sendStargateTokens");
require("./tasks/sendCreditsAll");
require("./tasks/getChainPath");
require("./tasks/getFeeVersion")
require("./tasks")
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more4
function getMnemonic(networkName) {
if (networkName) {
const mnemonic = process.env['MNEMONIC_' + networkName.toUpperCase()]
if (mnemonic && mnemonic !== '') {
return mnemonic
}
}
const mnemonic = process.env.MNEMONIC
if (!mnemonic || mnemonic === '') {
return 'test test test test test test test test test test test junk'
}
return mnemonic
}
function accounts(chainKey) {
return { mnemonic: getMnemonic(chainKey) }
}
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: "0.7.6",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
contractSizer: {
alphaSort: false,
runOnCompile: true,
disambiguatePaths: false,
},
// for hardhat-deploy
namedAccounts: {
deployer: 0,
},
defaultNetwork: "hardhat",
networks: {
ethereum: {
url: "https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161", // public infura endpoint
chainId: 1,
accounts: accounts(),
},
avalanche: {
url: "https://api.avax.network/ext/bc/C/rpc",
chainId: 43114,
accounts: accounts(),
},
rinkeby: {
url: "https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161", // public infura endpoint
chainId: 4,
accounts: accounts(),
},
'bsc-testnet': {
url: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
chainId: 97,
accounts: accounts(),
},
fuji: {
url: `https://api.avax-test.network/ext/bc/C/rpc`,
chainId: 43113,
accounts: accounts(),
},
mumbai: {
url: "https://rpc-mumbai.maticvigil.com/",
chainId: 80001,
accounts: accounts(),
},
'arbitrum-rinkeby': {
url: `https://rinkeby.arbitrum.io/rpc`,
chainId: 421611,
accounts: accounts(),
},
'optimism-kovan': {
url: `https://kovan.optimism.io/`,
chainId: 69,
accounts: accounts(),
},
'fantom-testnet': {
url: `https://rpc.testnet.fantom.network/`,
chainId: 4002,
accounts: accounts(),
}
},
mocha: {
timeout: 500000,
},
gasReporter: {
enabled: process.env.REPORT_GAS === "true",
currency: "USD",
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
};