-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhardhat.config.js
135 lines (126 loc) · 3.47 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
require("dotenv").config();
const ethers = require("ethers");
require("@nomiclabs/hardhat-etherscan");
require("@nomiclabs/hardhat-waffle");
require("hardhat-gas-reporter");
require("solidity-coverage");
require("hardhat-deploy");
require("hardhat-contract-sizer");
require("hardhat-deploy-ethers");
require("@openzeppelin/hardhat-upgrades");
const { fund } = require("./tasks/fund");
const { task } = require("hardhat/config");
const mnemonic =
"replace hover unaware super where filter stone fine garlic address matrix basic";
let privateKeys = [];
//creates the list of private keys from the mnemonic
let derivePath = "m/44'/60'/0'/0/";
for (let i = 0; i <= 10; i++) {
const wallet = new ethers.Wallet.fromMnemonic(mnemonic, `${derivePath}${i}`);
privateKeys.push(wallet.privateKey);
}
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
task("fund", "Fund accounts on fork")
.addOptionalParam("amount", "Stable coin amount to fund each account with")
.addOptionalParam("fundnetwork", "forked Network")
.addOptionalParam("localaccounts", " number of first local accounts to fund")
.setAction(fund);
module.exports = {
solidity: {
version: "0.8.4",
settings: {
optimizer: {
enabled: true,
},
},
},
networks: {
hardhat: {
chainId: 1337,
initialBaseFeePerGas: 0,
},
localhost: {
url: "http://0.0.0.0:9545/",
chainId: 12345,
timeout: 6000000,
},
mainnet: {
url: `${process.env.MAINNET_PROVIDER_URL}`,
accounts: [
process.env.DEPLOYER_PRIVATE_KEY || privateKeys[2],
process.env.GOVERNOR_PRIVATE_KEY || privateKeys[1],
],
chainId: 1,
},
skale: {
url: `${process.env.SKALE_PROVIDER_URL}`,
accounts: [
process.env.DEPLOYER_PRIVATE_KEY || privateKeys[2],
process.env.GOVERNOR_PRIVATE_KEY || privateKeys[1],
],
chainId: 0xafcee83030b95,
},
polygonMumbai: {
url: `${process.env.MUMBAI_PROVIDER_URL}`,
accounts: [
process.env.DEPLOYER_PRIVATE_KEY || privateKeys[2],
process.env.GOVERNOR_PRIVATE_KEY || privateKeys[1],
],
chainId: 80001,
},
polygon: {
url: `${process.env.POLYGON_PROVIDER_URL}`,
accounts: [
process.env.DEPLOYER_PRIVATE_KEY || privateKeys[2],
process.env.GOVERNOR_PRIVATE_KEY || privateKeys[1],
],
chainId: 137,
},
bscTestnet: {
url: `${process.env.BSCTEST_PROVIDER_URL}`,
accounts: [
process.env.DEPLOYER_PRIVATE_KEY || privateKeys[2],
process.env.GOVERNOR_PRIVATE_KEY || privateKeys[1],
],
chainId: 97,
},
bsc: {
url: `${process.env.BSC_PROVIDER_URL}`,
accounts: [
process.env.DEPLOYER_PRIVATE_KEY || privateKeys[2],
process.env.GOVERNOR_PRIVATE_KEY || privateKeys[1],
],
chainId: 56,
},
},
namedAccounts: {
deployerAddr: {
default: 0,
localhost: 0,
},
governorAddr: {
default: 1,
localhost: 1,
},
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
},
contractSizer: {
alphaSort: true,
runOnCompile: true,
},
etherscan: {
apiKey: {
polygonMumbai: process.env.POLYGONSCAN_API_KEY,
bscTestnet: process.env.BSCSCAN_API_KEY,
polygon: process.env.POLYGONSCAN_API_KEY,
},
},
};