-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
62 lines (57 loc) · 1.7 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
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import { NetworkUserConfig } from "hardhat/types";
import "@graphprotocol/hardhat-graph";
import "@primitivefi/hardhat-dodoc";
import "solidity-coverage";
import * as dotenv from "dotenv";
dotenv.config();
function createNetworkConfig(networkType: string, networkId: number): NetworkUserConfig {
const url: string = `https://${networkType}.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`;
// const url: string = networkType;
let networkConfig: NetworkUserConfig = {
chainId: networkId,
url,
allowUnlimitedContractSize: true,
gas: 10000000,
};
const pk: Array<string> = process.env.PRIVATE_KEY ? process.env.PRIVATE_KEY.split(" ") : [];
if (pk.length != 0) {
networkConfig.accounts = pk;
}
return networkConfig;
}
const config: HardhatUserConfig = {
solidity: {
version: "0.8.10",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
defaultNetwork: "localhost",
networks: {
hardhat: {
forking: {
url: `https://opt-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`,
},
},
localhost: {
url: "http://localhost:8545",
},
mumbai: createNetworkConfig("polygon-mumbai", 80001),
"optimism-goerli": createNetworkConfig("opt-goerli", 420),
},
subgraph: {
name: "spaceh3ad/nftpadlock",
product: "hosted-service",
indexEvents: true,
allowSimpleName: true,
},
paths: {
subgraph: "./subgraph",
},
};
export default config;