-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.js
87 lines (82 loc) · 2.22 KB
/
hardhat.config.js
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
require("@nomicfoundation/hardhat-toolbox");
require ('@openzeppelin/hardhat-upgrades');
require ('hardhat-preprocessor');
const fs = require("fs");
function getRemappings() {
return fs
.readFileSync("remappings.txt", "utf8")
.split("\n")
.filter(Boolean) // remove empty lines
.map((line) => line.trim().split("="));
}
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.15",
preprocess: {
eachLine: (hre) => ({
transform: (line) => {
if (line.match(/^\s*import /i)) {
for (const [from, to] of getRemappings()) {
if (line.includes(from)) {
line = line.replace(from, to);
break;
}
}
}
return line;
},
}),
},
settings: {
evmVersion: "london",
"optimizer": {
"runs": 200,
"enabled": true,
}
},
paths: { sources:"./src",
tests:"./test",
},
networks: {
"witnesschain-op": {
url: "http://65.2.30.76:8545",
chainId: 42069,
accounts: [`${process.env.PRIVATE_KEY}`],
},
"witnesschain-testnet": {
url: "https://witnesschain-testnet-rpc.eu-north-2.gateway.fm",
chainId: 250628747,
accounts: [`${process.env.PRIVATE_KEY}`],
},
"blue-orangutan": {
url: "https://blue-orangutan-rpc.eu-north-2.gateway.fm",
chainId: 1237146866,
accounts: [`${process.env.PRIVATE_KEY}`],
}
},
etherscan: {
apiKey: {
"witnesschain-testnet": process.env.ETHERSCAN_API_KEY,
"witnesschain-op": process.env.ETHERSCAN_API_KEY,
"blue-orangutan": process.env.ETHERSCAN_API_KEY
},
customChains: [
{
network: "witnesschain-testnet",
chainId: 250628747,
urls: {
apiURL: "https://witnesschain-testnet-blockscout.eu-north-2.gateway.fm/api/",
browserURL: "https://witnesschain-testnet-blockscout.eu-north-2.gateway.fm",
},
},
{
network: "blue-orangutan",
chainId: 1237146866,
urls: {
apiURL: "https://blue-orangutan-blockscout.eu-north-2.gateway.fm/api/",
browserURL: "https://blue-orangutan-blockscout.eu-north-2.gateway.fm",
},
}
],
}
};