evm-contracts-tools 0.0.37 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +12 -0
- package/dist/evm-contract-call/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-address/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-address/index.html +31 -0
- package/dist/evm-contract-deployment-deployment-networks +1 -0
- package/dist/evm-contract-deployment-networks/index.html +31 -0
- package/dist/evm-contract-deployment-versions/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-versions/index.html +33 -0
- package/dist/evm-contract-deployments-dir/fs-worker.js +1 -0
- package/dist/evm-contracts-tools/fs-worker.js +1 -0
- package/dist/libevm-contract-call/fs-worker.js +1 -1
- package/dist/libevm-contract-deployment-address/fs-worker.js +1 -0
- package/dist/libevm-contract-deployment-address/index.html +24 -0
- package/dist/libevm-contract-deployment-deployment-networks +1 -0
- package/dist/libevm-contract-deployment-networks/index.html +24 -0
- package/dist/libevm-contract-deployment-versions/fs-worker.js +1 -0
- package/dist/libevm-contract-deployment-versions/index.html +33 -0
- package/dist/libevm-contract-deployments-dir/fs-worker.js +1 -0
- package/dist/libevm-contracts-tools +1 -0
- package/evm-contract-deployment-address +453 -0
- package/evm-contract-deployment-networks +440 -0
- package/evm-contract-deployment-versions +392 -0
- package/lib/address-check +0 -0
- package/lib/evm-contract-call-dynamic +0 -0
- package/lib/evm-contract-call-static +0 -0
- package/libevm-contract-deployment-address +439 -0
- package/libevm-contract-deployment-networks +295 -0
- package/libevm-contract-deployment-versions +113 -0
- package/libevm-contract-deployments-dir +0 -81
- package/package.json +73 -23
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
|
|
5
|
+
/** ----------------------------------------------------------------
|
|
6
|
+
* evm-contract-deployment-address.js
|
|
7
|
+
* ----------------------------------------------------------------
|
|
8
|
+
* Copyright ©
|
|
9
|
+
* Pellegrino Prevete
|
|
10
|
+
* 2024, 2025, 2026
|
|
11
|
+
*
|
|
12
|
+
* All rights reserved
|
|
13
|
+
* ----------------------------------------------------------------
|
|
14
|
+
*
|
|
15
|
+
* This program is free software: you can redistribute it and/or
|
|
16
|
+
* modify it under the terms of the GNU General Public License as
|
|
17
|
+
* published by the Free Software Foundation, either version 3 of
|
|
18
|
+
* the License, or (at your option) any later version.
|
|
19
|
+
*
|
|
20
|
+
* This program is distributed in the hope that it will be useful,
|
|
21
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
23
|
+
* GNU General Public License for more details.
|
|
24
|
+
*
|
|
25
|
+
* You should have received a copy of the GNU General Public License
|
|
26
|
+
* along with this program.
|
|
27
|
+
* If not, see <https://www.gnu.org/licenses/>.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/* eslint-disable
|
|
31
|
+
no-unused-vars */
|
|
32
|
+
|
|
33
|
+
/* Crash Javascript global variables */
|
|
34
|
+
/* global
|
|
35
|
+
quiet:
|
|
36
|
+
writable */
|
|
37
|
+
|
|
38
|
+
const
|
|
39
|
+
_libcrash =
|
|
40
|
+
require(
|
|
41
|
+
"crash-js");
|
|
42
|
+
/* global
|
|
43
|
+
_argv_get */
|
|
44
|
+
const
|
|
45
|
+
_argv_get =
|
|
46
|
+
_libcrash._argv_get;
|
|
47
|
+
/* global
|
|
48
|
+
_argv_url_get */
|
|
49
|
+
const
|
|
50
|
+
_argv_url_get =
|
|
51
|
+
_libcrash._argv_url_get;
|
|
52
|
+
/* global
|
|
53
|
+
_cmdline_check */
|
|
54
|
+
const
|
|
55
|
+
_cmdline_check =
|
|
56
|
+
_libcrash._cmdline_check;
|
|
57
|
+
/* global
|
|
58
|
+
_get_date_human */
|
|
59
|
+
const
|
|
60
|
+
_get_date_human =
|
|
61
|
+
_libcrash._get_date_human;
|
|
62
|
+
/* global
|
|
63
|
+
_msg_info */
|
|
64
|
+
const
|
|
65
|
+
_msg_info =
|
|
66
|
+
_libcrash._msg_info;
|
|
67
|
+
/* global
|
|
68
|
+
_msg_error */
|
|
69
|
+
const
|
|
70
|
+
_msg_error =
|
|
71
|
+
_libcrash._msg_error;
|
|
72
|
+
/* global
|
|
73
|
+
_printf */
|
|
74
|
+
const
|
|
75
|
+
_printf =
|
|
76
|
+
_libcrash._printf;
|
|
77
|
+
/* global
|
|
78
|
+
_process_exit */
|
|
79
|
+
const
|
|
80
|
+
_process_exit =
|
|
81
|
+
_libcrash._process_exit;
|
|
82
|
+
const
|
|
83
|
+
_libevm_contract_deployment_versions_module =
|
|
84
|
+
require(
|
|
85
|
+
"./libevm-contract-deployment-versions");
|
|
86
|
+
/* global
|
|
87
|
+
_evm_contract_deployment_versions */
|
|
88
|
+
const
|
|
89
|
+
_evm_contract_deployment_versions =
|
|
90
|
+
_libevm_contract_deployment_versions_module._evm_contract_deployment_versions;
|
|
91
|
+
|
|
92
|
+
function
|
|
93
|
+
_global_variables() {
|
|
94
|
+
/* global
|
|
95
|
+
app_name:
|
|
96
|
+
writable */
|
|
97
|
+
app_name =
|
|
98
|
+
"evm-contract-deployments-versions.js";
|
|
99
|
+
/* global
|
|
100
|
+
app_opts:
|
|
101
|
+
writable */
|
|
102
|
+
app_opts =
|
|
103
|
+
[];
|
|
104
|
+
/* global
|
|
105
|
+
runtime_environment:
|
|
106
|
+
writable */
|
|
107
|
+
runtime_environment =
|
|
108
|
+
"";
|
|
109
|
+
/* global
|
|
110
|
+
resolve_date:
|
|
111
|
+
writable */
|
|
112
|
+
resolve_date =
|
|
113
|
+
"";
|
|
114
|
+
/* global
|
|
115
|
+
config_file:
|
|
116
|
+
writable */
|
|
117
|
+
config_file =
|
|
118
|
+
"";
|
|
119
|
+
/* global
|
|
120
|
+
display_highest:
|
|
121
|
+
writable */
|
|
122
|
+
display_highest =
|
|
123
|
+
"";
|
|
124
|
+
/* global
|
|
125
|
+
display_lowest:
|
|
126
|
+
writable */
|
|
127
|
+
display_lowest =
|
|
128
|
+
"";
|
|
129
|
+
quiet =
|
|
130
|
+
"";
|
|
131
|
+
/* global
|
|
132
|
+
verbose:
|
|
133
|
+
writable */
|
|
134
|
+
verbose =
|
|
135
|
+
"";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async function
|
|
139
|
+
_overrides_set(
|
|
140
|
+
_help_display) {
|
|
141
|
+
if ( resolve_date == "" ||
|
|
142
|
+
typeof(
|
|
143
|
+
resolve_date) == "undefined" ) {
|
|
144
|
+
resolve_date =
|
|
145
|
+
_get_date_human();
|
|
146
|
+
}
|
|
147
|
+
if ( display_highest == "" ) {
|
|
148
|
+
display_highest =
|
|
149
|
+
"n";
|
|
150
|
+
}
|
|
151
|
+
if ( display_lowest == "" ) {
|
|
152
|
+
display_lowest =
|
|
153
|
+
"n";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function
|
|
158
|
+
_config_show() {
|
|
159
|
+
let
|
|
160
|
+
_line;
|
|
161
|
+
const
|
|
162
|
+
_text = [
|
|
163
|
+
`${app_name} configuration:`,
|
|
164
|
+
` Resolve date: ${resolve_date}`,
|
|
165
|
+
` Configuration file: ${config_file}`,
|
|
166
|
+
` Display highest: ${display_highest}`,
|
|
167
|
+
` Display lowest: ${display_lowest}`,
|
|
168
|
+
];
|
|
169
|
+
for ( _line of _text ) {
|
|
170
|
+
_msg_info(
|
|
171
|
+
_line);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function
|
|
176
|
+
_usage(
|
|
177
|
+
_exit_code) {
|
|
178
|
+
let
|
|
179
|
+
_line;
|
|
180
|
+
const
|
|
181
|
+
_text = [
|
|
182
|
+
"",
|
|
183
|
+
"Returns available versions for contract deployments on a network",
|
|
184
|
+
"",
|
|
185
|
+
"Usage:",
|
|
186
|
+
"",
|
|
187
|
+
` ${app_name}`,
|
|
188
|
+
" [options]",
|
|
189
|
+
" <config-file>",
|
|
190
|
+
"",
|
|
191
|
+
" options:",
|
|
192
|
+
"",
|
|
193
|
+
" -H --display-highest Display highest versions available.",
|
|
194
|
+
` Default: '${display_highest}`,
|
|
195
|
+
"",
|
|
196
|
+
" -L --display-lowest Display lowest versions available.",
|
|
197
|
+
` Default: '${display_lowest}`,
|
|
198
|
+
"",
|
|
199
|
+
" -h --help This message.",
|
|
200
|
+
" -v --verbose Enable verbose output.",
|
|
201
|
+
""
|
|
202
|
+
];
|
|
203
|
+
for ( _line of _text ) {
|
|
204
|
+
console.log(
|
|
205
|
+
_line);
|
|
206
|
+
}
|
|
207
|
+
_process_exit(
|
|
208
|
+
_exit_code);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
async function
|
|
212
|
+
_cmdline_parse() {
|
|
213
|
+
let
|
|
214
|
+
_help_display,
|
|
215
|
+
_msg;
|
|
216
|
+
const
|
|
217
|
+
_argv_args = {
|
|
218
|
+
"booleans": [
|
|
219
|
+
"H",
|
|
220
|
+
"display-highest",
|
|
221
|
+
"L",
|
|
222
|
+
"display-lowest",
|
|
223
|
+
"h",
|
|
224
|
+
"help",
|
|
225
|
+
"v",
|
|
226
|
+
"verbose"
|
|
227
|
+
]
|
|
228
|
+
};
|
|
229
|
+
const
|
|
230
|
+
_argv =
|
|
231
|
+
_argv_get(
|
|
232
|
+
_argv_args);
|
|
233
|
+
const
|
|
234
|
+
_options =
|
|
235
|
+
_argv[
|
|
236
|
+
"_"];
|
|
237
|
+
quiet =
|
|
238
|
+
"y";
|
|
239
|
+
runtime_environment =
|
|
240
|
+
"node";
|
|
241
|
+
if ( _argv[
|
|
242
|
+
"h"] ) {
|
|
243
|
+
_help_display =
|
|
244
|
+
true;
|
|
245
|
+
}
|
|
246
|
+
if ( _argv[
|
|
247
|
+
"help"] ) {
|
|
248
|
+
_help_display =
|
|
249
|
+
true;
|
|
250
|
+
}
|
|
251
|
+
if ( ( _options.indexOf(
|
|
252
|
+
"--help") > -1 ||
|
|
253
|
+
_options.indexOf(
|
|
254
|
+
"-h") > -1) ) {
|
|
255
|
+
_help_display =
|
|
256
|
+
true;
|
|
257
|
+
}
|
|
258
|
+
if ( _help_display ) {
|
|
259
|
+
quiet =
|
|
260
|
+
"n";
|
|
261
|
+
await _overrides_set(
|
|
262
|
+
_help_display);
|
|
263
|
+
_usage(
|
|
264
|
+
0);
|
|
265
|
+
}
|
|
266
|
+
if ( typeof(
|
|
267
|
+
_argv) == "undefined" ||
|
|
268
|
+
_argv[
|
|
269
|
+
"_"].length < 1 ) {
|
|
270
|
+
_msg =
|
|
271
|
+
"Configuration file " +
|
|
272
|
+
"argument required.";
|
|
273
|
+
_msg_error(
|
|
274
|
+
_msg,
|
|
275
|
+
0);
|
|
276
|
+
_usage(
|
|
277
|
+
1);
|
|
278
|
+
}
|
|
279
|
+
config_file =
|
|
280
|
+
_argv[
|
|
281
|
+
"_"][
|
|
282
|
+
0];
|
|
283
|
+
if ( "H" in _argv ) {
|
|
284
|
+
display_highest =
|
|
285
|
+
_argv[
|
|
286
|
+
"H"];
|
|
287
|
+
}
|
|
288
|
+
if ( "display-highest" in _argv ) {
|
|
289
|
+
display_highest =
|
|
290
|
+
_argv[
|
|
291
|
+
"display-highest"];
|
|
292
|
+
}
|
|
293
|
+
if ( "L" in _argv ) {
|
|
294
|
+
display_lowest =
|
|
295
|
+
_argv[
|
|
296
|
+
"L"];
|
|
297
|
+
}
|
|
298
|
+
if ( "display-lowest" in _argv ) {
|
|
299
|
+
display_lowest =
|
|
300
|
+
_argv[
|
|
301
|
+
"display-lowest"];
|
|
302
|
+
}
|
|
303
|
+
if ( _argv[
|
|
304
|
+
"v"] ||
|
|
305
|
+
_argv[
|
|
306
|
+
"verbose"] ) {
|
|
307
|
+
quiet =
|
|
308
|
+
"n";
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function
|
|
313
|
+
_url_parse() {
|
|
314
|
+
let
|
|
315
|
+
_method,
|
|
316
|
+
_network;
|
|
317
|
+
runtime_environment =
|
|
318
|
+
"browser";
|
|
319
|
+
config_file =
|
|
320
|
+
_argv_url_get(
|
|
321
|
+
"config_file")[
|
|
322
|
+
0];
|
|
323
|
+
display_highest =
|
|
324
|
+
_argv_url_get(
|
|
325
|
+
"display_highest")[
|
|
326
|
+
0];
|
|
327
|
+
display_lowest =
|
|
328
|
+
_argv_url_get(
|
|
329
|
+
"display_lowest")[
|
|
330
|
+
0];
|
|
331
|
+
quiet =
|
|
332
|
+
_argv_url_get(
|
|
333
|
+
"quiet");
|
|
334
|
+
if ( quiet.length === 0 ) {
|
|
335
|
+
quiet =
|
|
336
|
+
"n";
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
async function
|
|
341
|
+
_evm_contract_deployment_versions_cmdline(
|
|
342
|
+
_app_opts) {
|
|
343
|
+
let
|
|
344
|
+
_result;
|
|
345
|
+
const
|
|
346
|
+
_results =
|
|
347
|
+
await _evm_contract_deployment_versions.apply(
|
|
348
|
+
null,
|
|
349
|
+
_app_opts);
|
|
350
|
+
const
|
|
351
|
+
_results_type =
|
|
352
|
+
typeof(
|
|
353
|
+
_results);
|
|
354
|
+
if ( _results_type == "object" ) {
|
|
355
|
+
for ( _result of _results ) {
|
|
356
|
+
console.log(
|
|
357
|
+
_result);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
else if ( _results_type == "string" ) {
|
|
361
|
+
_printf(
|
|
362
|
+
_results);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
async function
|
|
367
|
+
_main() {
|
|
368
|
+
const
|
|
369
|
+
_overrides_set_up =
|
|
370
|
+
await _overrides_set();
|
|
371
|
+
_config_show();
|
|
372
|
+
const
|
|
373
|
+
app_opts = [
|
|
374
|
+
config_file,
|
|
375
|
+
display_highest,
|
|
376
|
+
display_lowest
|
|
377
|
+
];
|
|
378
|
+
_evm_contract_deployment_versions_cmdline(
|
|
379
|
+
app_opts);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
_global_variables();
|
|
383
|
+
if ( _cmdline_check(
|
|
384
|
+
"evm-contract-deployment-versions.js") ||
|
|
385
|
+
_cmdline_check(
|
|
386
|
+
"evm-contract-deployment-versions") ) {
|
|
387
|
+
_cmdline_parse();
|
|
388
|
+
}
|
|
389
|
+
else{
|
|
390
|
+
_url_parse();
|
|
391
|
+
}
|
|
392
|
+
_main();
|
package/lib/address-check
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|