-
Notifications
You must be signed in to change notification settings - Fork 15
/
hardhat.config.ts
94 lines (91 loc) · 2.54 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomicfoundation/hardhat-verify";
import '@typechain/hardhat'
import * as dotenv from 'dotenv';
import deploymentConfig from "./scripts/deployment.config";
import { HardhatUserConfig } from "hardhat/config"
import 'hardhat-contract-sizer'
import 'hardhat-deploy'
import "solidity-coverage";
import "@nomicfoundation/hardhat-foundry";
dotenv.config();
function getNetworkUrl(name: string): string {
return `https://${name}.infura.io/v3/${process.env.INFURA_ID}`
// NOTE: To use WebSocket -> `wss://${name}.infura.io/ws/v3/${process.env.INFURA_ID}`
}
const config: HardhatUserConfig = {
solidity: {
version: "0.8.21",
settings: {
optimizer: {
enabled: true,
runs: 999999,
},
},
},
networks: {
local: {
url: `http://localhost:8545/rpc`
},
hardhat: {
blockGasLimit: 30_000_000,
chainId: 3604,
initialBaseFeePerGas: 10 // Putting gas to low for coverage testing
},
goerli: {
url: getNetworkUrl('goerli'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
sepolia: {
url: getNetworkUrl('sepolia'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
bscTestnet: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545",
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
polygonMumbai: {
url: getNetworkUrl('polygon-mumbai'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
polygon: {
url: getNetworkUrl('polygon-mainnet'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
optimism: {
url: getNetworkUrl('optimism-mainnet'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
arbitrum: {
url: getNetworkUrl('arbitrum-mainnet'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
zkSyncTestnet: {
url: "https://testnet.era.zksync.dev",
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
avalanche: {
url: getNetworkUrl('avalanche-mainnet'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
bsc: {
url: "https://bsc-dataseed.binance.org/",
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
opBNB: {
url: "https://opbnb-mainnet-rpc.bnbchain.org",
accounts: [deploymentConfig.PRIVATE_KEY || ""],
},
base: {
url: getNetworkUrl('base-mainnet'),
accounts: [deploymentConfig.PRIVATE_KEY || ""],
}
},
mocha: {
timeout: 10000
},
etherscan: {
apiKey: process.env.BSCSCAN_API_KEY
}
};
export default config;