-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
86 lines (78 loc) · 2.08 KB
/
hardhat.config.ts
File metadata and controls
86 lines (78 loc) · 2.08 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
/**
* @type import('hardhat/config').HardhatUserConfig
*/
import dotenv from 'dotenv'
import 'hardhat-gas-reporter'
import 'hardhat-contract-sizer'
import '@typechain/hardhat'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import { task } from 'hardhat/config'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { BigNumber } from 'ethers'
dotenv.config()
const reportGas = process.env.REPORT_GAS?.toLowerCase() === 'true'
const reportSize = process.env.REPORT_SIZE?.toLowerCase() === 'true'
const mainnetPrivateKey = [undefined, ''].includes(process.env.MAINNET_PRIVATE_KEY) ? [] : [process.env.MAINNET_PRIVATE_KEY]
task('balances', 'Prints the list of AVAX account balances', async (args, hre): Promise<void> => {
const accounts: SignerWithAddress[] = await hre.ethers.getSigners()
for (const account of accounts) {
const balance: BigNumber = await hre.ethers.provider.getBalance(
account.address
)
console.log(`${account.address} has balance ${hre.ethers.utils.formatUnits(balance, 18)} AVAX`)
}
})
export default {
solidity: {
compilers: [
{
version: '0.8.9',
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}
]
},
defaultNetwork: 'hardhat',
networks: {
hardhat: {
accounts: {
mnemonic: process.env.WALLET_MNEMONIC
}
},
local: {
url: process.env.LOCAL_RPC_URL,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC
}
},
fuji: {
url: process.env.FUJI_TESTNET_RPC_URL,
gasPrice: 25000000000,
chainId: 43113,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC
}
},
mainnet: {
url: process.env.AVAX_MAINNET_RPC_URL,
gasPrice: 30000000000,
chainId: 43114,
accounts: mainnetPrivateKey
}
},
gasReporter: {
currency: 'USD',
coinmarketcap: process.env.COINMARKETCAP_KEY,
enabled: reportGas
},
contractSizer: {
alphaSort: true,
runOnCompile: reportSize,
disambiguatePaths: false
}
}