evm-contracts-tools 0.0.55 → 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 -1
- package/dist/evm-contract-deployment-address/evm-contract-deployment-address.js +1 -1
- package/dist/evm-contracts-tools/evm-contracts-tools.js +1 -1
- package/dist/libevm-contract-call/libevm-contract-call.js +1 -1
- package/dist/libevm-contract-deployment-address/libevm-contract-deployment-address.js +1 -2
- package/dist/libevm-contract-deployment-networks/libevm-contract-deployment-networks.js +1 -1
- package/dist/libevm-contract-deployment-versions/libevm-contract-deployment-versions.js +1 -1
- package/evm-contract-call +133 -6
- 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 +5 -5
package/evm-contract-call
CHANGED
|
@@ -108,6 +108,11 @@ const
|
|
|
108
108
|
const
|
|
109
109
|
_global_get =
|
|
110
110
|
_libcrash._global_get;
|
|
111
|
+
/* global
|
|
112
|
+
_homedir_get */
|
|
113
|
+
const
|
|
114
|
+
_homedir_get =
|
|
115
|
+
_libcrash._homedir_get;
|
|
111
116
|
/* global
|
|
112
117
|
_msg_info */
|
|
113
118
|
const
|
|
@@ -176,6 +181,16 @@ const
|
|
|
176
181
|
const
|
|
177
182
|
_address_check =
|
|
178
183
|
_libevm_contract_call_module._address_check;
|
|
184
|
+
/* global
|
|
185
|
+
_cache_dir_auto_detect */
|
|
186
|
+
const
|
|
187
|
+
_cache_dir_auto_detect =
|
|
188
|
+
_libevm_contract_call_module._cache_dir_auto_detect;
|
|
189
|
+
/* global
|
|
190
|
+
_data_dir_auto_detect */
|
|
191
|
+
const
|
|
192
|
+
_data_dir_auto_detect =
|
|
193
|
+
_libevm_contract_call_module._data_dir_auto_detect;
|
|
179
194
|
/* global
|
|
180
195
|
_default_artifact_path_get */
|
|
181
196
|
const
|
|
@@ -196,6 +211,16 @@ const
|
|
|
196
211
|
const
|
|
197
212
|
_call_auth_auto_detect =
|
|
198
213
|
_libevm_contract_call_module._call_auth_auto_detect;
|
|
214
|
+
/* global
|
|
215
|
+
_target_app_auto_detect */
|
|
216
|
+
const
|
|
217
|
+
_target_app_auto_detect =
|
|
218
|
+
_libevm_contract_call_module._target_app_auto_detect;
|
|
219
|
+
/* global
|
|
220
|
+
_contract_address_auto_detect */
|
|
221
|
+
const
|
|
222
|
+
_contract_address_auto_detect =
|
|
223
|
+
_libevm_contract_call_module._contract_address_auto_detect;
|
|
199
224
|
|
|
200
225
|
function
|
|
201
226
|
_global_variables() {
|
|
@@ -227,6 +252,20 @@ function
|
|
|
227
252
|
"call",
|
|
228
253
|
"date",
|
|
229
254
|
"");
|
|
255
|
+
/* global
|
|
256
|
+
cache_dir:
|
|
257
|
+
writable */
|
|
258
|
+
_set(
|
|
259
|
+
"cache",
|
|
260
|
+
"dir",
|
|
261
|
+
"");
|
|
262
|
+
/* global
|
|
263
|
+
data_dir:
|
|
264
|
+
writable */
|
|
265
|
+
_set(
|
|
266
|
+
"data",
|
|
267
|
+
"dir",
|
|
268
|
+
"");
|
|
230
269
|
/* global
|
|
231
270
|
wallet_name:
|
|
232
271
|
writable */
|
|
@@ -262,6 +301,20 @@ function
|
|
|
262
301
|
"index",
|
|
263
302
|
"retrieve",
|
|
264
303
|
"");
|
|
304
|
+
/* global
|
|
305
|
+
target_app:
|
|
306
|
+
writable */
|
|
307
|
+
_set(
|
|
308
|
+
"target",
|
|
309
|
+
"app",
|
|
310
|
+
"");
|
|
311
|
+
/* global
|
|
312
|
+
target_contract:
|
|
313
|
+
writable */
|
|
314
|
+
_set(
|
|
315
|
+
"target",
|
|
316
|
+
"contract",
|
|
317
|
+
"");
|
|
265
318
|
/* global
|
|
266
319
|
contract_address:
|
|
267
320
|
writable */
|
|
@@ -335,6 +388,14 @@ function
|
|
|
335
388
|
async function
|
|
336
389
|
_overrides_set(
|
|
337
390
|
_help_display) {
|
|
391
|
+
_cache_dir_auto_detect();
|
|
392
|
+
_data_dir_auto_detect();
|
|
393
|
+
_override_set(
|
|
394
|
+
"call",
|
|
395
|
+
"date",
|
|
396
|
+
_get_date_human());
|
|
397
|
+
_target_app_auto_detect();
|
|
398
|
+
_contract_address_auto_detect();
|
|
338
399
|
if ( ! _help_display &&
|
|
339
400
|
typeof(_help_display) != "undefined" &&
|
|
340
401
|
_help_display != "" ) {
|
|
@@ -353,10 +414,6 @@ async function
|
|
|
353
414
|
1);
|
|
354
415
|
}
|
|
355
416
|
}
|
|
356
|
-
_override_set(
|
|
357
|
-
"call",
|
|
358
|
-
"date",
|
|
359
|
-
_get_date_human());
|
|
360
417
|
_override_set(
|
|
361
418
|
"wallet",
|
|
362
419
|
"name",
|
|
@@ -429,6 +486,9 @@ function
|
|
|
429
486
|
` Runtime environment: ${runtime_environment}`,
|
|
430
487
|
` Call type: ${call_type}`,
|
|
431
488
|
` Call authentication: ${call_auth}`,
|
|
489
|
+
` Application options:`,
|
|
490
|
+
` Cache directory: ${cache_dir}`,
|
|
491
|
+
` Data directory: ${data_dir}`,
|
|
432
492
|
` Credentials options:`,
|
|
433
493
|
` Wallet name: ${wallet_name}`,
|
|
434
494
|
` Wallet address: ${api_key}`,
|
|
@@ -443,6 +503,8 @@ function
|
|
|
443
503
|
` RPC selection method: ${rpc_selection}`,
|
|
444
504
|
` Gas price: ${price_gas}`,
|
|
445
505
|
` Contract options:`,
|
|
506
|
+
` Target application: ${target_app}`,
|
|
507
|
+
` Target contract: ${target_contract}`,
|
|
446
508
|
` Contract address: ${contract_address}`,
|
|
447
509
|
` Contract ABI: ${contract_abi}`,
|
|
448
510
|
` Contract bytecode: ${contract_bytecode}`,
|
|
@@ -549,6 +611,9 @@ function
|
|
|
549
611
|
"",
|
|
550
612
|
" libEVM options:",
|
|
551
613
|
"",
|
|
614
|
+
" -K --app Target application.",
|
|
615
|
+
` Default: '${target_app}'`,
|
|
616
|
+
"",
|
|
552
617
|
" -a --auth Call authentication.",
|
|
553
618
|
` Default: '${call_auth}'`,
|
|
554
619
|
"",
|
|
@@ -561,7 +626,15 @@ function
|
|
|
561
626
|
" <rpc-selection> 'kirsh', 'random' or 'all'.",
|
|
562
627
|
` Default: '${rpc_selection}'.`,
|
|
563
628
|
"",
|
|
629
|
+
" Application options:",
|
|
630
|
+
"",
|
|
631
|
+
" -W --cache-dir Cache directory.",
|
|
632
|
+
` Default: '${cache_dir}'`,
|
|
633
|
+
"",
|
|
634
|
+
" -D --data-dir Data directory.",
|
|
635
|
+
` Default: '${data_dir}'`,
|
|
564
636
|
" -h --help This message.",
|
|
637
|
+
"",
|
|
565
638
|
" -v --verbose Enable verbose output.",
|
|
566
639
|
""
|
|
567
640
|
];
|
|
@@ -719,6 +792,48 @@ async function
|
|
|
719
792
|
_argv[
|
|
720
793
|
"index-retrieve"]);
|
|
721
794
|
}
|
|
795
|
+
if ( "app" in _argv ) {
|
|
796
|
+
_set(
|
|
797
|
+
"target",
|
|
798
|
+
"app",
|
|
799
|
+
_argv[
|
|
800
|
+
"app"]);
|
|
801
|
+
}
|
|
802
|
+
if ( "K" in _argv ) {
|
|
803
|
+
_set(
|
|
804
|
+
"target",
|
|
805
|
+
"app",
|
|
806
|
+
_argv[
|
|
807
|
+
"K"]);
|
|
808
|
+
}
|
|
809
|
+
if ( "cache-dir" in _argv ) {
|
|
810
|
+
_set(
|
|
811
|
+
"cache",
|
|
812
|
+
"dir",
|
|
813
|
+
_argv[
|
|
814
|
+
"cache-dir"]);
|
|
815
|
+
}
|
|
816
|
+
if ( "W" in _argv ) {
|
|
817
|
+
_set(
|
|
818
|
+
"cache",
|
|
819
|
+
"dir",
|
|
820
|
+
_argv[
|
|
821
|
+
"W"]);
|
|
822
|
+
}
|
|
823
|
+
if ( "data-dir" in _argv ) {
|
|
824
|
+
_set(
|
|
825
|
+
"data",
|
|
826
|
+
"dir",
|
|
827
|
+
_argv[
|
|
828
|
+
"data-dir"]);
|
|
829
|
+
}
|
|
830
|
+
if ( "D" in _argv ) {
|
|
831
|
+
_set(
|
|
832
|
+
"data",
|
|
833
|
+
"dir",
|
|
834
|
+
_argv[
|
|
835
|
+
"D"]);
|
|
836
|
+
}
|
|
722
837
|
if ( "P" in _argv ) {
|
|
723
838
|
_set(
|
|
724
839
|
"price",
|
|
@@ -901,6 +1016,18 @@ function
|
|
|
901
1016
|
_argv_url_get(
|
|
902
1017
|
"index_retrieve")[
|
|
903
1018
|
0]);
|
|
1019
|
+
_set(
|
|
1020
|
+
"data",
|
|
1021
|
+
"dir",
|
|
1022
|
+
_argv_url_get(
|
|
1023
|
+
"data_dir")[
|
|
1024
|
+
0]);
|
|
1025
|
+
_set(
|
|
1026
|
+
"cache",
|
|
1027
|
+
"dir",
|
|
1028
|
+
_argv_url_get(
|
|
1029
|
+
"cache_dir")[
|
|
1030
|
+
0]);
|
|
904
1031
|
_set(
|
|
905
1032
|
"price",
|
|
906
1033
|
"gas",
|
|
@@ -1069,8 +1196,8 @@ else{
|
|
|
1069
1196
|
_url_parse();
|
|
1070
1197
|
_libevm_url_parse();
|
|
1071
1198
|
}
|
|
1072
|
-
_echo(
|
|
1073
|
-
|
|
1199
|
+
// _echo(
|
|
1200
|
+
// contract_address);
|
|
1074
1201
|
_main();
|
|
1075
1202
|
|
|
1076
1203
|
export {
|
|
@@ -2,26 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/** ---------------------------------------------------------------
|
|
6
|
+
* bytecode-creation-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
|
|
@@ -58,6 +61,11 @@ const
|
|
|
58
61
|
const
|
|
59
62
|
_exit =
|
|
60
63
|
_libcrash._exit;
|
|
64
|
+
/* global
|
|
65
|
+
_global_get */
|
|
66
|
+
const
|
|
67
|
+
_global_get =
|
|
68
|
+
_libcrash._global_get;
|
|
61
69
|
/* global
|
|
62
70
|
_msg_info */
|
|
63
71
|
const
|
|
@@ -83,6 +91,11 @@ const
|
|
|
83
91
|
const
|
|
84
92
|
_require =
|
|
85
93
|
_libcrash._require;
|
|
94
|
+
/* global
|
|
95
|
+
_set */
|
|
96
|
+
const
|
|
97
|
+
_set =
|
|
98
|
+
_libcrash._set;
|
|
86
99
|
const
|
|
87
100
|
_ethers_module =
|
|
88
101
|
await _require(
|
|
@@ -111,7 +124,7 @@ const
|
|
|
111
124
|
_evm_transactions_tools_module._transaction_receipt_get;
|
|
112
125
|
const
|
|
113
126
|
_deployer_get_module =
|
|
114
|
-
|
|
127
|
+
await import(
|
|
115
128
|
'./deployer-get');
|
|
116
129
|
/* global
|
|
117
130
|
_deployer_get */
|
|
@@ -121,57 +134,81 @@ const
|
|
|
121
134
|
|
|
122
135
|
function
|
|
123
136
|
_global_variables() {
|
|
124
|
-
|
|
125
|
-
"
|
|
137
|
+
_set(
|
|
138
|
+
"app",
|
|
139
|
+
"name",
|
|
140
|
+
"bytecode-creation-get");
|
|
126
141
|
/* global
|
|
127
142
|
wallet_seed:
|
|
128
143
|
writable */
|
|
129
|
-
|
|
130
|
-
""
|
|
144
|
+
_set(
|
|
145
|
+
"wallet",
|
|
146
|
+
"seed",
|
|
147
|
+
"");
|
|
131
148
|
/* global
|
|
132
149
|
retries_max:
|
|
133
150
|
writable */
|
|
134
|
-
|
|
135
|
-
""
|
|
151
|
+
_set(
|
|
152
|
+
"retries",
|
|
153
|
+
"max",
|
|
154
|
+
"");
|
|
136
155
|
/* global
|
|
137
156
|
api_key_path:
|
|
138
157
|
writable */
|
|
139
|
-
|
|
140
|
-
""
|
|
158
|
+
_set(
|
|
159
|
+
"api_key",
|
|
160
|
+
"path",
|
|
161
|
+
"");
|
|
141
162
|
/* global
|
|
142
163
|
chain_id:
|
|
143
164
|
writable */
|
|
144
|
-
|
|
145
|
-
""
|
|
165
|
+
_set(
|
|
166
|
+
"chain",
|
|
167
|
+
"id",
|
|
168
|
+
"");
|
|
146
169
|
/* global
|
|
147
170
|
chain_name:
|
|
148
171
|
writable */
|
|
149
|
-
|
|
150
|
-
""
|
|
172
|
+
_set(
|
|
173
|
+
"chain",
|
|
174
|
+
"name",
|
|
175
|
+
"");
|
|
151
176
|
/* global
|
|
152
177
|
target_network:
|
|
153
178
|
writable */
|
|
154
|
-
|
|
155
|
-
""
|
|
179
|
+
_set(
|
|
180
|
+
"target",
|
|
181
|
+
"network",
|
|
182
|
+
"");
|
|
156
183
|
/* global
|
|
157
184
|
contract_address:
|
|
158
185
|
writable */
|
|
159
|
-
|
|
160
|
-
""
|
|
186
|
+
_set(
|
|
187
|
+
"contract",
|
|
188
|
+
"address",
|
|
189
|
+
"");
|
|
161
190
|
/* global
|
|
162
191
|
transaction_deployment:
|
|
163
192
|
writable */
|
|
164
|
-
|
|
165
|
-
""
|
|
193
|
+
_set(
|
|
194
|
+
"transaction",
|
|
195
|
+
"deployment",
|
|
196
|
+
"");
|
|
166
197
|
/* global
|
|
167
198
|
contract_bytecode_path:
|
|
168
199
|
writable */
|
|
169
|
-
|
|
170
|
-
""
|
|
200
|
+
_set(
|
|
201
|
+
"contract_bytecode",
|
|
202
|
+
"path",
|
|
203
|
+
"");
|
|
171
204
|
/* global
|
|
172
205
|
quiet:
|
|
173
206
|
writable */
|
|
174
|
-
|
|
207
|
+
const
|
|
208
|
+
_global =
|
|
209
|
+
_global_get();
|
|
210
|
+
_global[
|
|
211
|
+
"quiet"] =
|
|
175
212
|
"";
|
|
176
213
|
}
|
|
177
214
|
|
|
@@ -312,6 +349,11 @@ function
|
|
|
312
349
|
_exit_code) {
|
|
313
350
|
let
|
|
314
351
|
_line;
|
|
352
|
+
const
|
|
353
|
+
_program =
|
|
354
|
+
_basename(
|
|
355
|
+
_argv[
|
|
356
|
+
1]);
|
|
315
357
|
const
|
|
316
358
|
_text = [
|
|
317
359
|
"",
|
|
@@ -498,7 +540,7 @@ async function
|
|
|
498
540
|
else {
|
|
499
541
|
_msg =
|
|
500
542
|
"It has not been possible to retrieve " +
|
|
501
|
-
|
|
543
|
+
"the bytecode from the transaction.";
|
|
502
544
|
throw _msg;
|
|
503
545
|
}
|
|
504
546
|
} catch (
|
|
@@ -509,7 +551,7 @@ async function
|
|
|
509
551
|
}
|
|
510
552
|
}
|
|
511
553
|
|
|
512
|
-
if ( _cmdline_check(
|
|
554
|
+
if ( await _cmdline_check(
|
|
513
555
|
"bytecode-creation-get") ) {
|
|
514
556
|
_global_variables();
|
|
515
557
|
_cmdline_parse();
|