-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
111 lines (101 loc) · 2.95 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
import "@nomicfoundation/hardhat-toolbox";
import { HardhatUserConfig } from "hardhat/config";
import "hardhat-deploy";
import "@nomiclabs/hardhat-solhint";
import "solidity-coverage";
import "dotenv/config";
// Importing custom tasks
import "./tasks/utils/accounts";
import "./tasks/utils/balance";
import "./tasks/utils/block-number";
import "./tasks/utils/send-eth";
import "./tasks/erc721/mint";
import "./tasks/erc721/base-uri";
import "./tasks/erc721/contract-uri";
import "./tasks/erc20/mint";
import "./tasks/erc1155/mint";
import "./tasks/erc1155/base-uri";
import "./tasks/erc1155/contract-uri";
// Environment variable setup
const RSK_MAINNET_RPC_URL = process.env.RSK_MAINNET_RPC_URL;
const RSK_TESTNET_RPC_URL = process.env.RSK_TESTNET_RPC_URL;
const PRIVATE_KEY = process.env.PRIVATE_KEY;
// Ensure environment variables are configured
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 (!PRIVATE_KEY) {
throw new Error("Private key is not configured.");
}
// Hardhat configuration
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
networks: {
hardhat: {
// If you want to do some forking, uncomment this
// forking: {
// url: MAINNET_RPC_URL
// }
},
localhost: {
url: "http://127.0.0.1:8545",
},
rskMainnet: {
url: RSK_MAINNET_RPC_URL,
chainId: 30,
gasPrice: 60000000,
accounts: [PRIVATE_KEY]
},
rskTestnet: {
url: RSK_TESTNET_RPC_URL,
chainId: 31,
gasPrice: 60000000,
accounts: [PRIVATE_KEY]
},
},
etherscan: {
apiKey: {
// Is not required by blockscout. Can be any non-empty string
rsktestnet: 'your API key',
rskmainnet: 'your API key'
},
customChains: [
{
network: "rsktestnet",
chainId: 31,
urls: {
apiURL: "https://rootstock-testnet.blockscout.com/api/",
browserURL: "https://rootstock-testnet.blockscout.com/",
}
},
{
network: "rskmainnet",
chainId: 30,
urls: {
apiURL: "https://rootstock.blockscout.com/api/",
browserURL: "https://rootstock.blockscout.com/",
}
},
]
},
namedAccounts: {
deployer: {
default: 0, // Default is the first account
mainnet: 0,
},
owner: {
default: 0,
},
},
solidity: {
compilers: [
{
version: "0.8.24",
},
],
},
};
export default config;