generated from wslyvh/nexth
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhardhat.config.ts
78 lines (74 loc) · 2.17 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
import { HardhatUserConfig } from 'hardhat/config'
import { join } from 'path'
import dotenv from 'dotenv'
import '@nomicfoundation/hardhat-toolbox'
dotenv.config() // project root
dotenv.config({ path: join(process.cwd(), '../../.env') }) // workspace root
const deployerKey = process.env.DEPLOYER_KEY
if (!deployerKey) {
console.warn('DEPLOYER_KEY not found in .env file. Running with default config')
}
const etherscanApiKey = process.env.ETHERSCAN_API_KEY ?? ''
if (!etherscanApiKey) {
console.warn('ETHERSCAN_API_KEY not found in .env file. Will skip Etherscan verification')
}
const infuraApiKey = process.env.INFURA_API_KEY ?? ''
if (!infuraApiKey) {
console.warn('INFURA_API_KEY not found in .env file.')
}
const optimisticApiKey = process.env.OPTIMISTIC_API_KEY ?? etherscanApiKey ?? ''
if (!optimisticApiKey) {
console.warn('OPTIMISTIC_API_KEY not found in .env file. Will skip Etherscan verification')
}
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
solidity: {
version: '0.8.22',
settings: {
optimizer: {
enabled: true,
runs: 200
}
},
},
etherscan: {
apiKey: {
mainnet: etherscanApiKey,
sepolia: etherscanApiKey,
optimisticEthereum: optimisticApiKey,
"base-sepolia": etherscanApiKey
},
},
networks: {
hardhat: {
chainId: 31337,
},
localhost: {
chainId: 31337,
url: 'http://127.0.0.1:8545',
},
sepolia: {
chainId: 11155111,
url: 'https://rpc.sepolia.org/', // https://rpc-sepolia.rockx.com/ || https://rpc.sepolia.org/ || infuraApiKey ? `https://sepolia.infura.io/v3/${infuraApiKey}`
accounts: [deployerKey as string],
},
"base-sepolia": {
chainId: 84532,
url: "https://sepolia.base.org",
accounts: [deployerKey as string],
// apiURL: "https://api-sepolia.basescan.org/api",
// browserURL: "https://sepolia.basescan.org"
},
optimism: {
chainId: 10,
url: 'https://mainnet.optimism.io/',
accounts: [deployerKey as string],
},
base: {
chainId: 8453,
url: 'https://mainnet.base.org',
accounts: [deployerKey as string],
},
},
}
export default config