evm-contracts-tools 0.0.54 → 0.0.57
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/dist/evm-contract-call/evm-contract-call.js +1 -0
- package/dist/evm-contract-call/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-abi/evm-contract-deployment-abi.js +1 -0
- package/dist/evm-contract-deployment-abi/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-address/evm-contract-deployment-address.js +1 -0
- package/dist/evm-contract-deployment-address/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-bytecode/evm-contract-deployment-bytecode.js +1 -0
- package/dist/evm-contract-deployment-bytecode/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-compiler-output/evm-contract-deployment-compiler-output.js +1 -0
- package/dist/evm-contract-deployment-compiler-output/fs-worker.js +1 -0
- package/dist/evm-contract-deployment-deployment-networks +1 -0
- package/dist/evm-contract-deployment-networks/evm-contract-deployment-networks.js +1 -0
- package/dist/evm-contract-deployment-versions/evm-contract-deployment-versions.js +1 -0
- package/dist/evm-contract-deployment-versions/fs-worker.js +1 -0
- package/dist/evm-contract-deployments-dir/evm-contract-deployments-dir.js +1 -0
- package/dist/evm-contract-deployments-dir/fs-worker.js +1 -0
- package/dist/evm-contracts-tools/evm-contracts-tools.js +1 -0
- package/dist/evm-contracts-tools/fs-worker.js +1 -0
- package/dist/libevm-contract-call/fs-worker.js +1 -0
- package/dist/libevm-contract-call/libevm-contract-call.js +1 -0
- package/dist/libevm-contract-deployment-abi/fs-worker.js +1 -0
- package/dist/libevm-contract-deployment-abi/libevm-contract-deployment-abi.js +1 -0
- package/dist/libevm-contract-deployment-address/fs-worker.js +1 -0
- package/dist/libevm-contract-deployment-address/libevm-contract-deployment-address.js +1 -0
- package/dist/libevm-contract-deployment-bytecode/fs-worker.js +1 -0
- package/dist/libevm-contract-deployment-bytecode/libevm-contract-deployment-bytecode.js +1 -0
- package/dist/libevm-contract-deployment-compiler-output/fs-worker.js +1 -0
- package/dist/libevm-contract-deployment-compiler-output/libevm-contract-deployment-compiler-output.js +1 -0
- package/dist/libevm-contract-deployment-deployment-networks +1 -0
- package/dist/libevm-contract-deployment-networks/libevm-contract-deployment-networks.js +1 -0
- package/dist/libevm-contract-deployment-versions/fs-worker.js +1 -0
- package/dist/libevm-contract-deployment-versions/libevm-contract-deployment-versions.js +1 -0
- package/dist/libevm-contract-deployments-dir/fs-worker.js +1 -0
- package/dist/libevm-contract-deployments-dir/libevm-contract-deployments-dir.js +1 -0
- package/dist/libevm-contracts-tools +1 -0
- package/evm-contract-call +133 -6
- package/lib/address-check +0 -4
- package/lib/bytecode-creation-get +74 -32
- package/lib/bytecode-runtime-get +171 -69
- package/lib/contract-get +189 -93
- package/lib/deployer-get +145 -61
- package/lib/deployer-verify +226 -113
- package/lib/evm-contract-call-dynamic +331 -194
- package/lib/evm-contract-call-static +121 -44
- package/libevm-contract-call +405 -0
- package/libevm-contract-deployment +3 -3
- package/libevm-contract-deployment-address +31 -18
- package/package.json +9 -9
package/lib/contract-get
CHANGED
|
@@ -2,32 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/** ---------------------------------------------------------------
|
|
6
|
+
* contract-get
|
|
7
|
+
* ---------------------------------------------------------------
|
|
6
8
|
* Copyright ©
|
|
7
9
|
* Pellegrino Prevete
|
|
8
10
|
* 2024, 2025, 2026
|
|
9
11
|
*
|
|
10
12
|
* All rights reserved
|
|
11
|
-
*
|
|
13
|
+
* ---------------------------------------------------------------
|
|
12
14
|
*
|
|
13
|
-
* This program is free software: you can redistribute it and/or
|
|
14
|
-
* it under the terms of the GNU General Public License as
|
|
15
|
-
* the Free Software Foundation, either version 3 of
|
|
16
|
-
* (at your option) any later version.
|
|
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.
|
|
17
19
|
*
|
|
18
20
|
* This program is distributed in the hope that it will be useful,
|
|
19
21
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
22
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
23
|
* GNU General Public License for more details.
|
|
22
24
|
*
|
|
23
|
-
* You should have received a copy of the GNU General Public
|
|
24
|
-
* along with this program.
|
|
25
|
+
* You should have received a copy of the GNU General Public
|
|
26
|
+
* License along with this program.
|
|
27
|
+
* If not, see <https://www.gnu.org/licenses/>.
|
|
25
28
|
*/
|
|
26
29
|
|
|
27
30
|
const
|
|
28
31
|
_libcrash =
|
|
29
|
-
|
|
30
|
-
"
|
|
32
|
+
await import(
|
|
33
|
+
"libcrash-js");
|
|
34
|
+
/* global
|
|
35
|
+
_argv */
|
|
36
|
+
const
|
|
37
|
+
_argv =
|
|
38
|
+
_libcrash._argv;
|
|
39
|
+
/* global
|
|
40
|
+
_basename */
|
|
41
|
+
const
|
|
42
|
+
_basename =
|
|
43
|
+
_libcrash._basename;
|
|
31
44
|
/* global
|
|
32
45
|
_cmdline_check */
|
|
33
46
|
const
|
|
@@ -38,6 +51,11 @@ const
|
|
|
38
51
|
const
|
|
39
52
|
_dirname =
|
|
40
53
|
_libcrash._dirname;
|
|
54
|
+
/* global
|
|
55
|
+
_echo */
|
|
56
|
+
const
|
|
57
|
+
_echo =
|
|
58
|
+
_libcrash._echo;
|
|
41
59
|
/* global
|
|
42
60
|
_exit */
|
|
43
61
|
const
|
|
@@ -53,6 +71,16 @@ const
|
|
|
53
71
|
const
|
|
54
72
|
_file_read =
|
|
55
73
|
_libcrash._file_read;
|
|
74
|
+
/* global
|
|
75
|
+
_global_get */
|
|
76
|
+
const
|
|
77
|
+
_global_get =
|
|
78
|
+
_libcrash._global_get;
|
|
79
|
+
/* global
|
|
80
|
+
_get */
|
|
81
|
+
const
|
|
82
|
+
_get =
|
|
83
|
+
_libcrash._get;
|
|
56
84
|
/* global
|
|
57
85
|
_json_read */
|
|
58
86
|
const
|
|
@@ -78,6 +106,11 @@ const
|
|
|
78
106
|
const
|
|
79
107
|
_require =
|
|
80
108
|
_libcrash._require;
|
|
109
|
+
/* global
|
|
110
|
+
_set */
|
|
111
|
+
const
|
|
112
|
+
_set =
|
|
113
|
+
_libcrash._set;
|
|
81
114
|
const
|
|
82
115
|
_ethers_module =
|
|
83
116
|
await _require(
|
|
@@ -117,52 +150,74 @@ function
|
|
|
117
150
|
/* global
|
|
118
151
|
app_name:
|
|
119
152
|
writable */
|
|
120
|
-
|
|
121
|
-
"
|
|
153
|
+
_set(
|
|
154
|
+
"app",
|
|
155
|
+
"name",
|
|
156
|
+
"contract-get");
|
|
122
157
|
/* global
|
|
123
158
|
wallet_seed:
|
|
124
159
|
writable */
|
|
125
|
-
|
|
126
|
-
""
|
|
160
|
+
_set(
|
|
161
|
+
"wallet",
|
|
162
|
+
"seed",
|
|
163
|
+
"");
|
|
127
164
|
/* global
|
|
128
165
|
wallet_password_path:
|
|
129
166
|
writable */
|
|
130
|
-
|
|
131
|
-
""
|
|
167
|
+
_set(
|
|
168
|
+
"wallet_password",
|
|
169
|
+
"path",
|
|
170
|
+
"");
|
|
132
171
|
/* global
|
|
133
172
|
contract_address:
|
|
134
173
|
writable */
|
|
135
|
-
|
|
136
|
-
""
|
|
174
|
+
_set(
|
|
175
|
+
"contract",
|
|
176
|
+
"address",
|
|
177
|
+
"");
|
|
137
178
|
/* global
|
|
138
179
|
contract_abi_path:
|
|
139
180
|
writable */
|
|
140
|
-
|
|
141
|
-
""
|
|
181
|
+
_set(
|
|
182
|
+
"contract_abi",
|
|
183
|
+
"path",
|
|
184
|
+
"");
|
|
142
185
|
/* global
|
|
143
186
|
contract_bytecode_path:
|
|
144
187
|
writable */
|
|
145
|
-
|
|
146
|
-
""
|
|
188
|
+
_set(
|
|
189
|
+
"contract_bytecode",
|
|
190
|
+
"path",
|
|
191
|
+
"");
|
|
147
192
|
/* global
|
|
148
193
|
contract_compiler_output_path:
|
|
149
194
|
writable */
|
|
150
|
-
|
|
151
|
-
""
|
|
195
|
+
_set(
|
|
196
|
+
"contract_compiler_output",
|
|
197
|
+
"path",
|
|
198
|
+
"");
|
|
152
199
|
/* global
|
|
153
200
|
target_network:
|
|
154
201
|
writable */
|
|
155
|
-
|
|
156
|
-
""
|
|
202
|
+
_set(
|
|
203
|
+
"target",
|
|
204
|
+
"network",
|
|
205
|
+
"");
|
|
157
206
|
/* global
|
|
158
207
|
api_key_path:
|
|
159
208
|
writable */
|
|
160
|
-
|
|
161
|
-
""
|
|
209
|
+
_set(
|
|
210
|
+
"api_key",
|
|
211
|
+
"path",
|
|
212
|
+
"");
|
|
162
213
|
/* global
|
|
163
214
|
quiet:
|
|
164
215
|
writable */
|
|
165
|
-
|
|
216
|
+
const
|
|
217
|
+
_global =
|
|
218
|
+
_global_get();
|
|
219
|
+
_global[
|
|
220
|
+
"quiet"] =
|
|
166
221
|
"";
|
|
167
222
|
}
|
|
168
223
|
|
|
@@ -456,90 +511,112 @@ function
|
|
|
456
511
|
_usage(
|
|
457
512
|
_exit_code) {
|
|
458
513
|
let
|
|
459
|
-
_line
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
514
|
+
_line;
|
|
515
|
+
const
|
|
516
|
+
_text = [
|
|
517
|
+
"Usage:",
|
|
518
|
+
" contract-get",
|
|
519
|
+
" <quiet>",
|
|
520
|
+
" <wallet-seed>",
|
|
521
|
+
" <wallet-password-path>",
|
|
522
|
+
" <contract-address>",
|
|
523
|
+
" <contract-abi-path>",
|
|
524
|
+
" <contract-bytecode-path>",
|
|
525
|
+
" <contract-compiler-output-path>",
|
|
526
|
+
" <target-network>",
|
|
527
|
+
" (<api-key-path>)",
|
|
528
|
+
"",
|
|
529
|
+
"Args:",
|
|
530
|
+
" <quiet> Can be 'y' or 'n'",
|
|
531
|
+
" Default: y",
|
|
532
|
+
" <wallet-seed> Path of the seed phrase.",
|
|
533
|
+
" <wallet-password-path> Wallet password path.",
|
|
534
|
+
" <contract-address> Contract of the address one is",
|
|
535
|
+
" getting the contract of.",
|
|
536
|
+
" <contract-abi-path> Path of the contract ABI.",
|
|
537
|
+
" <contract-bytecode-path> Path for the contract bytecode.",
|
|
538
|
+
" <contract-compiler-output-path> Path for the contract compiler",
|
|
539
|
+
" output path (the hardhat artifact).",
|
|
540
|
+
" <target-network> Network on which the contract",
|
|
541
|
+
" resides.",
|
|
542
|
+
" <api-key-path> Path of the API key for the",
|
|
543
|
+
" contract ABI provider service.",
|
|
544
|
+
"",
|
|
545
|
+
" Options:",
|
|
546
|
+
" -h This help."
|
|
547
|
+
];
|
|
493
548
|
for ( _line of _text ) {
|
|
494
|
-
|
|
549
|
+
_echo(
|
|
495
550
|
_line);
|
|
496
551
|
}
|
|
497
552
|
_exit(
|
|
498
553
|
_exit_code);
|
|
499
554
|
}
|
|
500
555
|
|
|
501
|
-
function
|
|
502
|
-
|
|
503
|
-
|
|
556
|
+
function
|
|
557
|
+
_cmdline_parse() {
|
|
558
|
+
const
|
|
559
|
+
_global =
|
|
560
|
+
_global_get();
|
|
561
|
+
_global[
|
|
562
|
+
"quiet"] =
|
|
563
|
+
"y";
|
|
564
|
+
_argv.forEach(
|
|
504
565
|
function (
|
|
505
566
|
_value,
|
|
506
|
-
_index
|
|
507
|
-
_array) {
|
|
567
|
+
_index) {
|
|
508
568
|
if ( _index == 2 ) {
|
|
509
|
-
|
|
569
|
+
_global[
|
|
570
|
+
"quiet"] =
|
|
510
571
|
_value;
|
|
511
572
|
}
|
|
512
573
|
if ( _index == 3 ) {
|
|
513
|
-
|
|
514
|
-
|
|
574
|
+
_set(
|
|
575
|
+
"wallet",
|
|
576
|
+
"seed",
|
|
577
|
+
_value);
|
|
515
578
|
}
|
|
516
579
|
if ( _index == 4 ) {
|
|
517
|
-
|
|
518
|
-
|
|
580
|
+
_set(
|
|
581
|
+
"wallet_password",
|
|
582
|
+
"path",
|
|
583
|
+
_value);
|
|
519
584
|
}
|
|
520
585
|
if ( _index == 5 ) {
|
|
521
|
-
|
|
522
|
-
|
|
586
|
+
_set(
|
|
587
|
+
"contract",
|
|
588
|
+
"address",
|
|
589
|
+
_value);
|
|
523
590
|
}
|
|
524
591
|
if ( _index == 6 ) {
|
|
525
|
-
|
|
526
|
-
|
|
592
|
+
_set(
|
|
593
|
+
"contract_abi",
|
|
594
|
+
"path",
|
|
595
|
+
_value);
|
|
527
596
|
}
|
|
528
597
|
if ( _index == 7 ) {
|
|
529
|
-
|
|
530
|
-
|
|
598
|
+
_set(
|
|
599
|
+
"contract_bytecode",
|
|
600
|
+
"path",
|
|
601
|
+
_value);
|
|
531
602
|
}
|
|
532
603
|
if ( _index == 8 ) {
|
|
533
|
-
|
|
534
|
-
|
|
604
|
+
_set(
|
|
605
|
+
"contract_compiler_output",
|
|
606
|
+
"path",
|
|
607
|
+
_value);
|
|
535
608
|
}
|
|
536
609
|
if ( _index == 9 ) {
|
|
537
|
-
|
|
538
|
-
|
|
610
|
+
_set(
|
|
611
|
+
"target",
|
|
612
|
+
"network",
|
|
613
|
+
_value);
|
|
539
614
|
}
|
|
540
615
|
if ( _index == 10 ) {
|
|
541
|
-
|
|
542
|
-
|
|
616
|
+
_set(
|
|
617
|
+
"api_key",
|
|
618
|
+
"path",
|
|
619
|
+
_value);
|
|
543
620
|
}
|
|
544
621
|
if ( _value == "-h" ||
|
|
545
622
|
_value == "--help" ) {
|
|
@@ -547,14 +624,29 @@ function _cmdline_parse() {
|
|
|
547
624
|
}
|
|
548
625
|
}
|
|
549
626
|
);
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
627
|
+
const
|
|
628
|
+
_contract_abi_path =
|
|
629
|
+
_get(
|
|
630
|
+
"contract_abi",
|
|
631
|
+
"path");
|
|
632
|
+
const
|
|
633
|
+
_contract_bytecode_path =
|
|
634
|
+
_get(
|
|
635
|
+
"contract_bytecode",
|
|
636
|
+
"path");
|
|
637
|
+
const
|
|
638
|
+
_contract_compiler_output_path =
|
|
639
|
+
_get(
|
|
640
|
+
"contract_compiler_output",
|
|
641
|
+
"path");
|
|
642
|
+
if ( _contract_abi_path == "" &&
|
|
643
|
+
_contract_bytecode_path == "" &&
|
|
644
|
+
_contract_compiler_output_path == "" ) {
|
|
553
645
|
_usage();
|
|
554
646
|
}
|
|
555
647
|
}
|
|
556
648
|
|
|
557
|
-
if ( _cmdline_check(
|
|
649
|
+
if ( await _cmdline_check(
|
|
558
650
|
"contract-get") ) {
|
|
559
651
|
_global_variables();
|
|
560
652
|
_cmdline_parse();
|
|
@@ -574,7 +666,11 @@ if ( _cmdline_check(
|
|
|
574
666
|
app_opts);
|
|
575
667
|
}
|
|
576
668
|
|
|
577
|
-
|
|
578
|
-
_contract_get
|
|
579
|
-
_contract_get
|
|
669
|
+
export {
|
|
670
|
+
_contract_get
|
|
580
671
|
};
|
|
672
|
+
|
|
673
|
+
// module.exports = {
|
|
674
|
+
// _contract_get:
|
|
675
|
+
// _contract_get
|
|
676
|
+
// };
|