generated from NomicFoundation/hardhat-ts-plugin-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
48 lines (45 loc) · 1.51 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
import "@nomicfoundation/hardhat-ethers";
import "@nomicfoundation/hardhat-ignition-ethers";
import "@nomicfoundation/hardhat-web3-v4";
import { vars } from "hardhat/config";
import { HardhatUserConfig } from "hardhat/types";
// You can get your own at https://dashboard.alchemyapi.io
const providerApiKey = vars.get("ALCHEMY_API_KEY");
// If not set, it uses the hardhat account 0 private key.
const deployerPrivateKey = vars.get(
"DEPLOYER_PRIVATE_KEY",
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
);
const etherscanApiKey = vars.get("ETHERSCAN_API_KEY");
const polygoncanApiKey = vars.get("POLYGONSCAN_API_KEY");
const config: HardhatUserConfig = {
solidity: "0.8.19",
defaultNetwork: "sepolia",
networks: {
sepolia: {
url: `https://eth-sepolia.g.alchemy.com/v2/${providerApiKey}`,
accounts: [deployerPrivateKey],
},
polygonAmoy: {
url: `https://polygon-amoy.g.alchemy.com/v2/${providerApiKey}`,
accounts: [deployerPrivateKey],
},
},
etherscan: {
apiKey: {
sepolia: etherscanApiKey,
polygonAmoy: polygoncanApiKey,
},
customChains: [
{
network: "polygonAmoy",
chainId: 80002,
urls: {
apiURL: "https://api-amoy.polygonscan.com/api",
browserURL: "https://amoy.polygonscan.com/",
},
},
],
},
};
export default config;