forked from Phala-Network/the-graph-phat-contract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
37 lines (33 loc) · 1.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
import "dotenv/config";
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import { ProxyAgent, setGlobalDispatcher } from 'undici';
if (process.env.http_proxy || process.env.https_proxy) {
const proxy = (process.env.http_proxy || process.env.https_proxy)!;
const proxyAgent = new ProxyAgent(proxy);
setGlobalDispatcher(proxyAgent);
}
// If not set, it uses the hardhat account 0 private key.
const DEPLOYER_PRIVATE_KEY =
process.env.DEPLOYER_PRIVATE_KEY ?? "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
// Get a free POLYGONSCAN_API_KEY at https://polygonscan.com.
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY || '';
const config: HardhatUserConfig = {
solidity: "0.8.17",
networks: {
polygon: {
// If not set, you can get your own Alchemy API key at https://dashboard.alchemyapi.io or https://infura.io
url: process.env.POLYGON_RPC_URL ?? '',
accounts: [DEPLOYER_PRIVATE_KEY],
},
mumbai: {
// If not set, you can get your own Alchemy API key at https://dashboard.alchemyapi.io or https://infura.io
url: process.env.MUMBAI_RPC_URL ?? '',
accounts: [DEPLOYER_PRIVATE_KEY],
},
},
etherscan: {
apiKey: POLYGONSCAN_API_KEY,
},
};
export default config;