forked from tellor-io/tellorX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
executable file
·232 lines (194 loc) · 7.83 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/**
* @type import('hardhat/config').HardhatUserConfig
*/
require("@nomiclabs/hardhat-waffle");
require("hardhat-gas-reporter");
require("solidity-coverage");
require("hardhat-gas-reporter");
require('hardhat-contract-sizer');
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("dotenv").config();
//Run this commands to deploy tellor playground:
//npx hardhat deploy --net rinkeby --network rinkeby
//npx hardhat deploy --net mainnet --network mainnet
// task("deploy", "Deploy and verify the contracts")
// .addParam("net", "network to deploy in")
// .setAction(async taskArgs => {
// var net = taskArgs.net
// const tellorMaster = "0x88dF592F8eb5D7Bd38bFeF7dEb0fBc02cf3778a0"
// const DEV_WALLET = "0x39E419bA25196794B595B2a595Ea8E527ddC9856"
// let gfac
// let ofac
// let tfac
// let cfac
// await run("compile");
// tellorMasterInst = await ethers.getContractAt("contracts/interfaces/ITellor.sol:ITellor", tellorMaster)
// console.log("Starting deployment for governance contract...")
// gfac = await ethers.getContractFactory("contracts/testing/Governance.sol:Governance")
// governance = await gfac.deploy()
// await governance.deployed()
// if (net == "mainnet"){
// console.log("Governance contract deployed to:", "https://etherscan.io/address/" + governance.address);
// console.log(" Governance transaction hash:", "https://etherscan.io/tx/" + governance.deployTransaction.hash);
// } else if (net == "rinkeby") {
// console.log("Governance contract deployed to:", "https://rinkeby.etherscan.io/address/" + governance.address);
// console.log(" Governance transaction hash:", "https://rinkeby.etherscan.io/tx/" + governance.deployTransaction.hash);
// } else {
// console.log("Please add network explorer details")
// }
// // Wait for few confirmed transactions.
// // Otherwise the etherscan api doesn't find the deployed contract.
// console.log('waiting for governance tx confirmation...');
// await governance.deployTransaction.wait(3)
// console.log('submitting governance contract for verification...');
// await run("verify:verify",
// {
// address: governance.address,
// },
// )
// console.log("governance contract verified")
// console.log("Starting deployment for Oracle contract...")
// ofac = await ethers.getContractFactory("contracts/Oracle.sol:Oracle")
// oracle = await ofac.deploy()
// await oracle.deployed();
// if (net == "mainnet"){
// console.log("oracle contract deployed to:", "https://etherscan.io/address/" + oracle.address);
// console.log(" oracle transaction hash:", "https://etherscan.io/tx/" + oracle.deployTransaction.hash);
// } else if (net == "rinkeby") {
// console.log("oracle contract deployed to:", "https://rinkeby.etherscan.io/address/" + oracle.address);
// console.log(" oracle transaction hash:", "https://rinkeby.etherscan.io/tx/" + oracle.deployTransaction.hash);
// } else {
// console.log("Please add network explorer details")
// }
// // Wait for few confirmed transactions.
// // Otherwise the etherscan api doesn't find the deployed contract.
// console.log('waiting for Oracle tx confirmation...');
// await oracle.deployTransaction.wait(3)
// console.log('submitting Oracle contract for verification...');
// await run("verify:verify",
// {
// address: oracle.address,
// },
// )
// console.log("Oracle contract verified")
// console.log("Starting deployment for Treasury contract...")
// tfac = await ethers.getContractFactory("contracts/Treasury.sol:Treasury")
// treasury = await tfac.deploy()
// await treasury.deployed()
// if (net == "mainnet"){
// console.log("treasury contract deployed to:", "https://etherscan.io/address/" + treasury.address);
// console.log(" treasury transaction hash:", "https://etherscan.io/tx/" + treasury.deployTransaction.hash);
// } else if (net == "rinkeby") {
// console.log("treasury contract deployed to:", "https://rinkeby.etherscan.io/address/" + treasury.address);
// console.log(" treasury transaction hash:", "https://rinkeby.etherscan.io/tx/" + treasury.deployTransaction.hash);
// } else {
// console.log("Please add network explorer details")
// }
// // Wait for few confirmed transactions.
// // Otherwise the etherscan api doesn't find the deployed contract.
// console.log('waiting for treasury tx confirmation...');
// await treasury.deployTransaction.wait(3)
// console.log('submitting Treasury contract for verification...');
// await run("verify:verify", {
// address: treasury.address,
// },
// )
// console.log("treasury Contract verified")
// console.log("Starting deployment for Controller contract...")
// cfac = await ethers.getContractFactory("contracts/testing/Controller.sol:Controller")
// controller = await cfac.deploy()
// await controller.deployed()
// if (net == "mainnet"){
// console.log("The controller contract was deployed to:", "https://etherscan.io/address/" + controller.address);
// console.log(" transaction hash:", "https://etherscan.io/tx/" + controller.deployTransaction.hash);
// } else if (net == "rinkeby") {
// console.log("The controller contract was deployed to:", "https://rinkeby.etherscan.io/address/" + controller.address);
// console.log(" transaction hash:", "https://rinkeby.etherscan.io/tx/" + controller.deployTransaction.hash);
// } else {
// console.log("Please add network explorer details")
// }
// // Wait for few confirmed transactions.
// // Otherwise the etherscan api doesn't find the deployed contract.
// console.log('waiting for tx confirmation...');
// await controller.deployTransaction.wait(3)
// console.log('submitting contract for verification...');
// await run("verify:verify",
// {
// address: controller.address,
// },
// )
// console.log("Controller contract verified")
// console.log("Propose a fork to the Controller address and run the init function")
// })
module.exports = {
solidity: {
compilers: [
{
version: "0.8.3",
settings: {
optimizer: {
enabled: true,
runs: 300
}
}
},
{
version: "0.7.4",
settings: {
optimizer: {
enabled: true,
runs: 300
}
}
}
]
},
networks: {
hardhat: {
hardfork: process.env.CODE_COVERAGE ? "berlin" : "london",
initialBaseFeePerGas: 0,
accounts: {
mnemonic:
"nick lucian brenda kevin sam fiscal patch fly damp ocean produce wish",
count: 40,
},
forking: {
url: "https://eth-mainnet.alchemyapi.io/v2/7dW8KCqWwKa1vdaitq-SxmKfxWZ4yPG6"
},
allowUnlimitedContractSize: true
},
rinkeby: {
url: `${process.env.NODE_URL_RINKEBY}`,
seeds: [process.env.PRIVATE_KEY],
gas: 10000000,
gasPrice: 1000000000
},
goerli: {
url: `${process.env.NODE_URL_GOERLI}`,
seeds: [process.env.PRIVATE_KEY],
gas: 8000000,
gasPrice: 10000000000
}
// mainnet: {
// url: `${process.env.NODE_URL_MAINNET}`,
// accounts: [process.env.PRIVATE_KEY],
// gas: 10000000 ,
// gasPrice: 50000000000
// }
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://etherscan.io/
apiKey: process.env.ETHERSCAN
},
contractSizer: {
alphaSort: true,
runOnCompile: true,
disambiguatePaths: false,
},
mocha: {
grep: "@skip-on-coverage", // Find everything with this tag
invert: true // Run the grep's inverse set.
}
}