-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathhardhat.config.ts
84 lines (76 loc) · 1.9 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
import 'ten-hardhat-plugin';
import { HardhatUserConfig, task } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "hardhat-abi-exporter";
import "@solidstate/hardhat-bytecode-exporter";
// Hardhat-deploy plugin - https://www.npmjs.com/package/hardhat-deploy
import 'hardhat-deploy';
// Hardhat ignore warnings plugin - https://www.npmjs.com/package/hardhat-ignore-warnings
import 'hardhat-ignore-warnings';
import * as abigen from './tasks/abigen';
import './tasks/obscuro-deploy';
import * as fs from "fs";
const config: HardhatUserConfig = {
paths: {
sources: "src"
},
solidity: {
version: "0.8.28",
settings: {
optimizer: {
enabled: true,
runs: 1000,
details: {
yulDetails: {
optimizerSteps: "u",
},
},
},
outputSelection: { "*": { "*": [ "*" ], "": [ "*" ] } }
},
},
abiExporter : {
path: abigen.abiExportPath,
runOnCompile: true,
clear: true,
format: "json",
},
bytecodeExporter : {
path: abigen.bytecodeExporterPath,
runOnCompile: true,
clear: true,
},
namedAccounts: {
deployer: { // Addressed used for deploying.
default: 0,
},
hocowner: {
default: 1,
},
pocowner: {
default: 2,
},
},
// For help configuring - https://www.npmjs.com/package/hardhat-ignore-warnings
warnings : {
'*' : {
default: 'error'
},
'src/testing/**/*': {
default: 'off'
}
}
};
try {
config.networks = JSON.parse(fs.readFileSync('config/networks.json', 'utf8'));
} catch (e) {
console.log(`Failed parsing "config/networks.json" with reason - ${e}`);
}
try {
if (process.env.NETWORK_JSON != null) {
config.networks = JSON.parse(process.env.NETWORK_JSON!!);
}
} catch (e) {
console.log(`Unable to parse networks configuration from environment variable. Reason is ${e}`);
}
export default config;