-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
80 lines (72 loc) · 2.28 KB
/
hardhat.config.ts
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
// Get the environment configuration from .env file
//
// To make use of automatic environment setup:
// - Duplicate .env.example file and name it .env
// - Fill in the environment variables
import 'dotenv/config'
import 'hardhat-deploy'
import 'hardhat-contract-sizer'
import '@nomiclabs/hardhat-ethers'
import '@typechain/hardhat'
import '@layerzerolabs/toolbox-hardhat'
import { HardhatUserConfig, HttpNetworkAccountsUserConfig } from 'hardhat/types'
import { EndpointId } from '@layerzerolabs/lz-definitions'
// Set your preferred authentication method
//
// If you prefer using a mnemonic, set a MNEMONIC environment variable
// to a valid mnemonic
const MNEMONIC = process.env.MNEMONIC
// If you prefer to be authenticated using a private key, set a PRIVATE_KEY environment variable
const PRIVATE_KEY = process.env.PRIVATE_KEY
const accounts: HttpNetworkAccountsUserConfig | undefined = MNEMONIC
? { mnemonic: MNEMONIC }
: PRIVATE_KEY
? [PRIVATE_KEY]
: undefined
if (accounts == null) {
console.warn(
'Could not find MNEMONIC or PRIVATE_KEY environment variables. It will not be possible to execute transactions in your example.'
)
}
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.8.22',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
networks: {
sepolia: {
eid: EndpointId.SEPOLIA_V2_TESTNET,
url: process.env.SEPOLIA_RPC_URL || 'https://rpc.sepolia.org/',
accounts,
},
fuji: {
eid: EndpointId.AVALANCHE_V2_TESTNET,
url: process.env.FUJI_RPC_URL || 'https://rpc.ankr.com/avalanche_fuji',
accounts,
},
mumbai: {
eid: EndpointId.POLYGON_V2_TESTNET,
url: process.env.MUMBAI_RPC_URL || 'https://rpc.ankr.com/polygon_mumbai',
accounts,
},
},
namedAccounts: {
deployer: {
default: 0, // wallet address of index[0], of the mnemonic in .env
},
},
typechain: {
outDir: './build/typechain/',
target: 'ethers-v5',
},
}
export default config