-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
111 lines (99 loc) · 2.35 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
require("@nomicfoundation/hardhat-toolbox");
require('hardhat-contract-sizer');
require('solidity-coverage');
require("dotenv").config();
require("@nomiclabs/hardhat-solhint");
const { SEPOLIA_RPC_URL, GOERLI_RPC_URL, SEPOLIA_PRIVATE_KEY, GOERLI_PRIVATE_KEY, ETHERSCANAPIKEY, ETHMAIN_RPC_URL, ETHMAIN_PRIVATE_KEY, } = process.env;
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
networks: {
sepolia: {
url: SEPOLIA_RPC_URL,
accounts: [`0x${SEPOLIA_PRIVATE_KEY}`],
saveDeployments: true,
},
goerli: {
url: GOERLI_RPC_URL,
accounts: [`0x${GOERLI_PRIVATE_KEY}`],
saveDeployments: true,
},
mainnet: {
url: ETHMAIN_RPC_URL,
accounts: [`0x${ETHMAIN_PRIVATE_KEY}`],
saveDeployments: true,
},
hardhat: {
accounts: {
// mnemonic: MNEMONIC,
// path: "m/44'/60'/0'/0/",
// initialIndex: 0,
count: 10,
}
},
},
paths: {
sources: './contracts',
tests: './test',
cache: './cache',
artifacts: './artifacts'
},
mocha: {
timeout: 60000
},
etherscan: {
apiKey: {
rinkeby: ETHERSCANAPIKEY,
goerli: ETHERSCANAPIKEY,
sepolia: ETHERSCANAPIKEY,
mainnet: ETHERSCANAPIKEY,
},
customChains: [
{
network: "mainnet",
chainId: 1,
urls: {
apiURL: "https://api.etherscan.io/api",
browserURL: "https://etherscan.io"
}
},
{
network: "goerli",
chainId: 5,
urls: {
apiURL: "https://api-goerli.etherscan.io/api",
browserURL: "https://goerli.etherscan.io"
}
},
{
network: "sepolia",
chainId: 11155111,
urls: {
apiURL: "https://api-sepolia.etherscan.io/api",
browserURL: "https://sepolia.etherscan.io"
}
}
]
},
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
strict: true,
}
};
//npx hardhat accounts
task("accounts", "Prints the list of accounts", async () => {
const accounts = await ethers.getSigners();
for (const account of accounts) {
console.log({ address: account.address, balance: account.balance });
}
});