-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhardhat.config.ts
95 lines (92 loc) · 1.97 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
import fs from "fs";
// import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import { HardhatUserConfig } from "hardhat/types";
import "hardhat-deploy";
import "ethereum-waffle";
import "hardhat-preprocessor";
require("dotenv").config();
require("./tasks")
const config: HardhatUserConfig = {
networks: {
canto_testnet: {
url: "",
accounts: [process.env.PRIVATE_KEY],
tags: ["Deployment"],
},
canto_livenet: {
url: "https://mainnode.plexnode.org:8545",
accounts: [process.env.PRIVATE_KEY],
},
new_testnet: {
url: "",
accounts: [process.env.PRIVATE_KEY],
tags: ["Deployment"],
},
official_testnet: {
url: "",
accounts: [process.env.PRIVATE_KEY],
tags: ["Deployment"],
},
},
solidity: {
compilers: [
{
version: "0.8.10",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
{
version: "0.8.11",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
namedAccounts: {
deployer: 0,
user1: 1,
user2: 2,
liquidator: 3,
},
preprocess: {
eachLine: (hre) => ({
transform: (line: string) => {
if (line.match(/^\s*import /i)) {
getRemappings().forEach(([find, replace]) => {
if (line.match(find)) {
line = line.replace(find, replace);
}
});
}
return line;
},
}),
},
paths: {
deploy: "./deploy/canto_livenet",
sources: "./src",
tests: "./test/Treasury",
cache: "./cache_hardhat",
artifacts: "./artifacts",
},
mocha: {
timeout: 100000000000,
},
};
function getRemappings() {
return fs
.readFileSync("remappings.txt", "utf8")
.split("\n")
.filter(Boolean) // remove empty lines
.map((line) => line.trim().split("="));
}
export default config;