-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
128 lines (112 loc) · 3.04 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import "@nomicfoundation/hardhat-toolbox";
import "@openzeppelin/hardhat-upgrades";
import "@typechain/hardhat";
import { config as dotenvConfig } from "dotenv";
import "hardhat-deploy";
import { HardhatUserConfig } from "hardhat/config";
import "solidity-coverage";
dotenvConfig();
const getTestnetConfig = () => {
if (!process.env.TESTNET_DEPLOYER_PRIVATE_KEY) {
throw new Error("TESTNET_DEPLOYER_PRIVATE_KEY is not set");
}
const config = {
live: true,
saveDeployments: true,
tags: ["subnet"],
url:
process.env.TESTNET_RPC_URL ||
"https://api.testnet.playa3ull.games",
accounts: [process.env.TESTNET_DEPLOYER_PRIVATE_KEY],
};
return config;
};
const getMainnetConfig = () => {
if (!process.env.MAINNET_DEPLOYER_PRIVATE_KEY) {
throw new Error("MAINNET_DEPLOYER_PRIVATE_KEY is not set");
}
const config = {
live: true,
saveDeployments: true,
tags: ["subnet"],
url:
process.env.MAINNET_RPC_URL ||
"https://api.mainnet.playa3ull.games",
accounts: [process.env.MAINNET_DEPLOYER_PRIVATE_KEY],
};
return config;
};
const getAvalancheConfig = () => {
if (!process.env.MAINNET_DEPLOYER_PRIVATE_KEY) {
throw new Error("MAINNET_DEPLOYER_PRIVATE_KEY is not set");
}
const config = {
live: true,
saveDeployments: true,
tags: ["avalanche"],
url:
process.env.AVALANCH_RPC_URL ||
"https://api.avax.network/ext/bc/C/rpc",
accounts: [process.env.MAINNET_DEPLOYER_PRIVATE_KEY],
etherscan: {
snowtrace: "snowtrace",
},
};
return config;
};
const config: HardhatUserConfig = {
gasReporter: {
currency: "3ULL",
enabled: true,
gasPrice: 0.00005,
},
etherscan: {
apiKey: "snowtrace",
},
solidity: {
compilers: [
{
version: "0.8.19",
settings: {
optimizer: {
enabled: true,
runs: 20,
},
},
},
],
},
networks: {
localhost: {
live: false,
saveDeployments: true,
tags: ["local"],
},
hardhat: {
accounts: {
mnemonic:
"test test test test test test test test test test test junk",
initialIndex: 0,
path: "m/44'/60'/0'/0",
count: 20,
accountsBalance: "10000000000000000000000000",
passphrase: "",
},
tags: ["local", "test"],
},
testnet: getTestnetConfig(),
mainnet: getMainnetConfig(),
avalanche: getAvalancheConfig(),
},
typechain: {
target: "ethers-v5",
outDir: "./typechain",
},
namedAccounts: {
deployer: {
default: 0,
hardhat: 10,
},
},
};
export default config;