-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
40 lines (34 loc) · 1020 Bytes
/
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
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "dotenv/config";
const RSK_MAINNET_RPC_URL = process.env.RSK_MAINNET_RPC_URL;
const RSK_TESTNET_RPC_URL = process.env.RSK_TESTNET_RPC_URL;
const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY;
if (!RSK_MAINNET_RPC_URL) {
throw new Error("The RPC URL for the mainnet is not configured.");
}
if (!RSK_TESTNET_RPC_URL) {
// Fixed duplicate check for RSK_MAINNET_RPC_URL
throw new Error("The RPC URL for the testnet is not configured.");
}
if (!WALLET_PRIVATE_KEY) {
throw new Error("Private key is not configured.");
}
const config: HardhatUserConfig = {
solidity: "0.8.24",
networks: {
rskMainnet: {
url: RSK_MAINNET_RPC_URL,
chainId: 30,
gasPrice: 90000000,
accounts: [WALLET_PRIVATE_KEY],
},
rskTestnet: {
url: RSK_TESTNET_RPC_URL,
chainId: 31,
gasPrice: 90000000,
accounts: [WALLET_PRIVATE_KEY],
},
},
};
export default config;