generated from MiguelLZPF/hardhat-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.ts
189 lines (183 loc) · 4.58 KB
/
configuration.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import {
ContractName,
CONTRACT_NAMES,
CONTRACT_OZ_NAMES,
Hardfork,
IContract,
INetwork,
NetworkName,
} from "models/Configuration";
/**
* The KEYSTORE environment constant group is used to agrupate the constants related to the Encryped JSON wallets
* @param root the root directory
* @param default default constants if no specific ones defined
* @param default.password to be used to symetric encryption & decryption of the Encryped JSON wallets
* @param default.batchSize the number of Encryped JSON wallets to generate in batch mode
* @param test constants related to tests
* @param test.userNumber number of users to create in tests
*/
export const KEYSTORE = {
root: "keystore",
default: {
accountNumber: 10, // Ganache server default account number
balance: "0x2710", // infinite balance
password: "PaSs_W0Rd", // should use another password for real things
privateKey:
"0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d",
mnemonic: {
phrase:
"myth like bonus scare over problem client lizard pioneer submit female collect",
path: "m/44'/60'/0'/0/0",
basePath: "m/44'/60'/0'/0",
locale: "en",
},
batchSize: 2, // hardhat task default wallets to add to the keystore in batch mode
},
};
/**
* The BLOCKCHAIN environment constant group is used to agrupate the constants related to the blockchain network
*/
export const BLOCKCHAIN = {
default: {
solVersion: "0.8.19",
evm: "london" as Hardfork,
gasLimit: 800000,
gasPrice: 0,
maxFeePerGas: 900000000,
maxPriorityFeePerGas: 100,
initialBaseFeePerGas: 7,
},
networks: new Map<NetworkName | undefined, INetwork>([
[
undefined,
{
chainId: 31337,
name: "hardhat",
protocol: "http",
hostname: "127.0.0.1",
port: 8545,
},
],
[
"hardhat",
{
chainId: 31337,
name: "hardhat",
protocol: "http",
hostname: "localhost",
port: 8545,
},
],
[
"ganache",
{
chainId: 1337,
name: "ganache",
protocol: "http",
hostname: "localhost",
port: 8545,
dbPath: ".ganache-db",
},
],
[
"mainTest",
{
chainId: 1666,
name: "mainTest",
protocol: "http",
hostname: "192.168.12.207",
port: 8545,
dbPath: ".ganache-db",
},
],
]),
};
// default gas options to be used when sending Tx. It aims to zero gas price networks
export const GAS_OPT = {
max: {
gasLimit: BLOCKCHAIN.default.gasLimit,
// gasPrice: BLOCKCHAIN.default.gasPrice,
maxPriorityFeePerGas: BLOCKCHAIN.default.maxPriorityFeePerGas,
maxFeePerGas: BLOCKCHAIN.default.maxFeePerGas,
},
};
export const DEPLOY = {
deploymentsPath: "deployments.json",
};
export const CONTRACTS = new Map<ContractName, IContract>([
[
CONTRACT_OZ_NAMES[0],
{
name: CONTRACT_OZ_NAMES[0],
artifact: `node_modules/@openzeppelin/contracts/build/contracts/${CONTRACT_OZ_NAMES[0]}.json`,
address: new Map([
["hardhat", ""],
["ganache", ""],
["mainTest", ""],
]),
},
],
[
CONTRACT_OZ_NAMES[1],
{
name: CONTRACT_OZ_NAMES[1],
artifact: `node_modules/@openzeppelin/contracts/build/contracts/${CONTRACT_OZ_NAMES[1]}.json`,
address: new Map([
["hardhat", ""],
["ganache", ""],
["mainTest", ""],
]),
},
],
[
CONTRACT_NAMES[0],
{
name: CONTRACT_NAMES[0],
artifact: `artifacts/contracts/${CONTRACT_NAMES[0]}.sol/${CONTRACT_NAMES[0]}.json`,
address: new Map([
["hardhat", ""],
["ganache", ""],
["mainTest", ""],
]),
},
],
[
CONTRACT_NAMES[1],
{
name: CONTRACT_NAMES[1],
artifact: `artifacts/contracts/${CONTRACT_NAMES[1]}.sol/${CONTRACT_NAMES[1]}.json`,
address: new Map([
["hardhat", ""],
["ganache", ""],
["mainTest", ""],
]),
},
],
[
CONTRACT_NAMES[2],
{
name: CONTRACT_NAMES[2],
artifact: `artifacts/contracts/${CONTRACT_NAMES[2]}.sol/${CONTRACT_NAMES[2]}.json`,
address: new Map([
["hardhat", ""],
["ganache", ""],
["mainTest", ""],
]),
},
],
[
CONTRACT_NAMES[3],
{
name: CONTRACT_NAMES[3],
artifact: `artifacts/contracts/${CONTRACT_NAMES[3]}.sol/${CONTRACT_NAMES[3]}.json`,
address: new Map([
["hardhat", ""],
["ganache", ""],
["mainTest", ""],
]),
},
],
]);
export const TEST = {
accountNumber: 2,
};