-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
115 lines (109 loc) · 2.44 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
require('@nomiclabs/hardhat-waffle');
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("@openzeppelin/hardhat-upgrades");
require('hardhat-contract-sizer');
require('hardhat-docgen');
require('solidity-coverage')
require("dotenv").config({ path: "./.env" })
require('hardhat-abi-exporter');
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
function getPrivateKey(networkName) {
if (networkName) {
const privateKey = process.env['PRIVATE_KEY_' + networkName.toUpperCase()];
if (privateKey && privateKey !== '') {
return privateKey;
}
}
const privateKey = process.env.PRIVATE_KEY;
if (!privateKey || privateKey === '') {
return 'notsecureprivatekey'
}
return privateKey;
}
module.exports = {
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: true,
strict: true,
},
solidity: {
version: "0.8.19",
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: true
}
},
viaIR : false
},
},
networks: {
karios: {
chainId: 1001,
url: "https://public-en-kairos.node.kaia.io",
accounts: [getPrivateKey('karios')],
},
klaytn: {
chainId: 8217,
url: "https://public-en.node.kaia.io",
accounts: [getPrivateKey('klaytn')],
},
},
etherscan: {
apiKey: {
karios: "unnecessary",
klaytn: "unnecessary",
},
customChains: [
{
network: "karios",
chainId: 1001,
urls: {
apiURL: "https://api-baobab.klaytnscope.com/api",
browserURL: "https://kairos.kaiascope.com",
},
},
{
network: "klaytn",
chainId: 8217,
urls: {
apiURL: "https://api-cypress.klaytnscope.com/api",
browserURL: "https://kaiascope.com",
},
},
]
},
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
},
},
docgen: {
path: './docs',
clear: true,
runOnCompile: true,
},
abiExporter: [
{
path: './abi/json',
format: "json",
},
{
path: './abi/minimal',
format: "minimal",
},
{
path: './abi/fullName',
format: "fullName",
},
]
};