-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
34 lines (31 loc) · 890 Bytes
/
hardhat.config.ts
File metadata and controls
34 lines (31 loc) · 890 Bytes
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
import { HardhatUserConfig, task } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "dotenv/config"; // Imports dotenv to load environment variables
// Safely load the private key
const privateKey = process.env.PRIVATE_KEY;
const config: HardhatUserConfig = {
solidity: {
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
// Configuration for the Avalanche Fuji testnet
fuji: {
url: process.env.FUJI_RPC_URL || "https://api.avax-test.network/ext/bc/C/rpc",
// Only add accounts if a private key is provided in the .env file
accounts: privateKey !== undefined ? [privateKey] : [],
chainId: 43113,
},
},
etherscan: {
apiKey: {
avalancheFujiTestnet: "snowtrace", // Placeholder is sufficient
},
},
};
export default config;