-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.js
More file actions
53 lines (45 loc) · 1.66 KB
/
hardhat.config.js
File metadata and controls
53 lines (45 loc) · 1.66 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
require('@nomiclabs/hardhat-waffle')
const { ALCHEMY_API_KEY, PRIVATE_KEYS } = require('./.credentials')
task("balance", "Prints an account's balance")
.addParam("address", "The account's address")
.setAction(async (args) => {
const balance = await ethers.provider.getBalance(args.address)
console.log(`${args.address} = ${ethers.utils.formatEther(balance)} ETH`)
})
task("balances", "Prints balances of all configured accounts")
.setAction(async () => {
const accounts = await ethers.getSigners()
if (!accounts.length) {
console.log('No accounts detected. Configure them in your Hardhat config file.')
return
}
console.log(
`${accounts.length} accounts configured\n\n` +
'ACCOUNT BALANCE ETH\n' +
'-----------------------------------------------------------------'
)
for (const account of accounts) {
const balance = await ethers.provider.getBalance(account.address)
console.log(`${account.address} ${ethers.utils.formatEther(balance)}`)
}
})
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.8.13",
networks: {
sepolia: {
url: `https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: PRIVATE_KEYS,
},
'optimism-sepolia': {
url: 'https://sepolia.optimism.io',
accounts: PRIVATE_KEYS,
},
'arbitrum-sepolia': {
url: 'https://sepolia-rollup.arbitrum.io/rpc/',
accounts: PRIVATE_KEYS,
},
}
}