This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.js
125 lines (107 loc) · 3.82 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
require("@nomiclabs/hardhat-truffle5");
require("hardhat-gas-reporter");
require('hardhat-contract-sizer');
require("solidity-coverage");
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
//npx hardhat deploy --net bsc_testnet --network bsc_testnet
task("deploy", "Deploy and verify the contracts")
.addParam("net", "network to deploy in")
.setAction(async taskArgs => {
console.log("deploy telloraccess")
var net = taskArgs.network
await run("compile");
const tellorAccess = await ethers.getContractFactory("TellorAccess");
//console.log(tellor)
let tellor = await tellorAccess.deploy();
console.log("TellorAccess deployed to:", tellor.address);
await tellor.deployed();
if (net == "mainnet"){
console.log("Tellor contract deployed to:", "https://etherscan.io/address/" + tellor.address);
console.log(" transaction hash:", "https://etherscan.io/tx/" + tellor.deployTransaction.hash);
} else if (net == "rinkeby") {
console.log("Tellor contract deployed to:", "https://rinkeby.etherscan.io/address/" + tellor.address);
console.log(" transaction hash:", "https://rinkeby.etherscan.io/tx/" + tellor.deployTransaction.hash);
} else if (net == "bsc_testnet") {
console.log("Tellor contract deployed to:", "https://testnet.bscscan.com/address/" + tellor.address);
console.log(" transaction hash:", "https://testnet.bscscan.com/tx/" + tellor.deployTransaction.hash);
} else if (net == "bsc") {
console.log("Tellor contract deployed to:", "https://bscscan.com/address/" + tellor.address);
console.log(" transaction hash:", "https://bscscan.com/tx/" + tellor.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 tellor.deployTransaction.wait(3)
console.log('submitting contract for verification...');
await run("verify:verify", {
address: tellor.address
},
)
console.log("Contract verified")
});
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: "0.7.0",
settings: {
optimizer: {
enabled: true,
runs: 999999
}
}
},
networks: {
hardhat: {
accounts: {
mnemonic:
"nick lucian brenda kevin sam fiscal patch fly damp ocean produce wish",
count: 40,
},
allowUnlimitedContractSize: true,
},
// rinkeby: {
// url: `${process.env.NODE_URL_RINKEBY}`,
// accounts: [process.env.RINKEBY_ETH_PK],
// gas: 10000000 ,
// gasPrice: 190000000000
// },
// mainnet: {
// url: `${process.env.NODE_URL_MAINNET}`,
// accounts: [process.env.ETH_PK],
// gas: 12000000 ,
// gasPrice: 190000000000
// } ,
// bsc_testnet: {
// url: "https://data-seed-prebsc-1-s1.binance.org:8545",
// chainId: 97,
// gasPrice: 20000000000,
// accounts: [process.env.BSC_PK]
// },
// bsc: {
// url: "https://bsc-dataseed.binance.org/",
// chainId: 56,
// gasPrice: 20000000000,
// accounts: [process.env.BSC_PK]
// }
},
// etherscan: {
// // Your API key for Etherscan
// // Obtain one at https://etherscan.io/
// //apiKey: process.env.ETHERSCAN
// apiKey: process.env.BSC_API
// },
contractSizer: {
alphaSort: true,
runOnCompile: true,
disambiguatePaths: false,
},
};