-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
115 lines (105 loc) · 2.59 KB
/
hardhat.config.ts
File metadata and controls
115 lines (105 loc) · 2.59 KB
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
/**
* @type import('hardhat/config').HardhatUserConfig
*/
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-etherscan";
import "hardhat-abi-exporter";
import "hardhat-deploy";
import "hardhat-contract-sizer";
// import 'hardhat-gas-reporter';
// import '@typechain/hardhat';
// import 'solidity-coverage';
import { HardhatUserConfig } from "hardhat/types";
import * as fs from "fs";
import {extTask} from "./hardhat.task";
console.log("config hardhat.");
extTask.RegTasks();
//get prikeys from a json file
let buffer = fs.readFileSync("testprikeys.json");
let srcjson = JSON.parse(buffer.toString());
let namedkeys: { [id: string]: number } = srcjson["namedkeys"];
let onlykeys: string[] = srcjson["prikeys"] as string[];
let hardhat_prikeys:any[] = [];
for (var i = 0; i < onlykeys.length; i++)
hardhat_prikeys.push({ "privateKey": onlykeys[i], "balance": "99000000000000000000" });
const config: HardhatUserConfig = {
solidity: {
version: "0.8.15",
settings: {
optimizer: {
enabled: true,
runs: 20000
}
}
},
contractSizer:
{
alphaSort:true,
disambiguatePaths:false,
runOnCompile:true,
},
namedAccounts: namedkeys,//from json
paths: {
artifacts: "artifacts",
deploy: "deploy",
sources: "contracts",
tests: "test",
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
accounts: hardhat_prikeys
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: onlykeys,
chainId: 4,
live: true,
saveDeployments: true,
tags: ["staging"],
timeout: 60000
},
bscTest: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545/",
accounts: onlykeys,
chainId: 97,
live: true,
saveDeployments: true,
tags: ["staging"],
},
bscMain: {
url: "https://bsc-dataseed.binance.org/",
accounts: onlykeys,
chainId: 56,
live: true,
saveDeployments: true,
tags: ["staging"],
},
arbitrumOne: {
url: "https://arb1.arbitrum.io/rpc",
accounts: onlykeys,
chainId: 42161,
live: true,
saveDeployments: true,
tags: ["staging"],
},
arbitrumTest: {
url: "https://sepolia-rollup.arbitrum.io/rpc",
accounts: onlykeys,
chainId: 421614,
live: true,
saveDeployments: true,
tags: ["staging"],
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://bscscan.com/
apiKey: ""
},
mocha: {
timeout: 600000
}
};
export default config;