evm-contracts-tools 0.0.6 → 0.0.8
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/evm-contract-call +181 -93
- package/lib/contract-get +131 -77
- package/libevm-contracts-tools +5 -5
- package/package.json +3 -1
package/evm-contract-call
CHANGED
|
@@ -70,40 +70,55 @@ const
|
|
|
70
70
|
_process_exit =
|
|
71
71
|
_libcrash._process_exit;
|
|
72
72
|
|
|
73
|
+
|
|
74
|
+
const
|
|
75
|
+
_libevm_module =
|
|
76
|
+
require(
|
|
77
|
+
"libevm");
|
|
78
|
+
/* global
|
|
79
|
+
_libevm_global_variables */
|
|
80
|
+
const
|
|
81
|
+
_libevm_global_variables =
|
|
82
|
+
_libevm_module._libevm_global_variables;
|
|
83
|
+
/* global
|
|
84
|
+
_wallet_overrides_set */
|
|
85
|
+
const
|
|
86
|
+
_wallet_overrides_set =
|
|
87
|
+
_libevm_module._wallet_overrides_set;
|
|
73
88
|
const
|
|
74
|
-
|
|
89
|
+
_libevm_chains_info_module =
|
|
75
90
|
require(
|
|
76
|
-
"
|
|
91
|
+
"libevm-chains-info");
|
|
77
92
|
/* global
|
|
78
93
|
_evm_chains_db_path_get */
|
|
79
94
|
const
|
|
80
95
|
_evm_chains_db_path_get =
|
|
81
|
-
|
|
96
|
+
_libevm_chains_info_module._evm_chains_db_path_get;
|
|
82
97
|
/* global
|
|
83
98
|
_evm_chains_info_get */
|
|
84
99
|
const
|
|
85
100
|
_evm_chain_info_get =
|
|
86
|
-
|
|
101
|
+
_libevm_chains_info_module._evm_chain_info_get;
|
|
87
102
|
/* global
|
|
88
103
|
_rpc_backends_get */
|
|
89
104
|
const
|
|
90
105
|
_rpc_backend_get =
|
|
91
|
-
|
|
106
|
+
_libevm_chains_info_module._rpc_backend_get;
|
|
92
107
|
/* global
|
|
93
108
|
_evm_chains_info */
|
|
94
109
|
const
|
|
95
110
|
_evm_chains_info =
|
|
96
|
-
|
|
111
|
+
_libevm_chains_info_module._evm_chains_info;
|
|
97
112
|
/* global
|
|
98
113
|
_db_paths_auto_detect */
|
|
99
114
|
const
|
|
100
115
|
_db_paths_auto_detect =
|
|
101
|
-
|
|
116
|
+
_libevm_chains_info_module._db_paths_auto_detect;
|
|
102
117
|
/* global
|
|
103
118
|
_input_type_auto_detect */
|
|
104
119
|
const
|
|
105
120
|
_input_type_auto_detect =
|
|
106
|
-
|
|
121
|
+
_libevm_chains_info_module._input_type_auto_detect;
|
|
107
122
|
|
|
108
123
|
function
|
|
109
124
|
_global_variables() {
|
|
@@ -128,54 +143,54 @@ function
|
|
|
128
143
|
call_date =
|
|
129
144
|
"";
|
|
130
145
|
/* global
|
|
131
|
-
|
|
146
|
+
call_type:
|
|
132
147
|
writable */
|
|
133
|
-
|
|
148
|
+
call_type =
|
|
134
149
|
"";
|
|
135
150
|
/* global
|
|
136
|
-
|
|
151
|
+
index_retrieve:
|
|
137
152
|
writable */
|
|
138
|
-
|
|
153
|
+
index_retrieve =
|
|
139
154
|
"";
|
|
140
155
|
/* global
|
|
141
|
-
|
|
156
|
+
contract_address:
|
|
142
157
|
writable */
|
|
143
|
-
|
|
158
|
+
contract_address =
|
|
144
159
|
"";
|
|
145
160
|
/* global
|
|
146
|
-
|
|
161
|
+
contract_bytecode:
|
|
147
162
|
writable */
|
|
148
|
-
|
|
163
|
+
contract_bytecode =
|
|
149
164
|
"";
|
|
150
165
|
/* global
|
|
151
|
-
|
|
166
|
+
contract_compiler_output:
|
|
152
167
|
writable */
|
|
153
|
-
|
|
168
|
+
contract_compiler_output =
|
|
154
169
|
"";
|
|
155
170
|
/* global
|
|
156
|
-
|
|
171
|
+
contract_abi:
|
|
157
172
|
writable */
|
|
158
|
-
|
|
159
|
-
|
|
173
|
+
contract_abi =
|
|
174
|
+
"";
|
|
160
175
|
/* global
|
|
161
|
-
|
|
176
|
+
contract_method:
|
|
162
177
|
writable */
|
|
163
|
-
|
|
178
|
+
contract_method =
|
|
164
179
|
"";
|
|
165
180
|
/* global
|
|
166
|
-
|
|
181
|
+
method_args:
|
|
167
182
|
writable */
|
|
168
|
-
|
|
169
|
-
|
|
183
|
+
method_args =
|
|
184
|
+
[];
|
|
170
185
|
/* global
|
|
171
|
-
|
|
186
|
+
price_gas:
|
|
172
187
|
writable */
|
|
173
|
-
|
|
188
|
+
price_gas =
|
|
174
189
|
"";
|
|
175
190
|
/* global
|
|
176
|
-
|
|
191
|
+
measure_unit:
|
|
177
192
|
writable */
|
|
178
|
-
|
|
193
|
+
measure_unit =
|
|
179
194
|
"";
|
|
180
195
|
/* global
|
|
181
196
|
quiet:
|
|
@@ -195,6 +210,7 @@ function
|
|
|
195
210
|
call_date =
|
|
196
211
|
_get_date_human();
|
|
197
212
|
}
|
|
213
|
+
_wallet_overrides_set();
|
|
198
214
|
if ( target_command == "" ) {
|
|
199
215
|
target_command =
|
|
200
216
|
"get";
|
|
@@ -322,9 +338,19 @@ function
|
|
|
322
338
|
let
|
|
323
339
|
_help_display,
|
|
324
340
|
_msg;
|
|
341
|
+
const
|
|
342
|
+
_argv_args = {
|
|
343
|
+
"booleans": [
|
|
344
|
+
"h",
|
|
345
|
+
"help",
|
|
346
|
+
"v",
|
|
347
|
+
"verbose"
|
|
348
|
+
]
|
|
349
|
+
};
|
|
325
350
|
const
|
|
326
351
|
_argv =
|
|
327
|
-
_argv_get(
|
|
352
|
+
_argv_get(
|
|
353
|
+
_argv_args);
|
|
328
354
|
const
|
|
329
355
|
_options =
|
|
330
356
|
_argv[
|
|
@@ -333,16 +359,25 @@ function
|
|
|
333
359
|
"y";
|
|
334
360
|
runtime_environment =
|
|
335
361
|
"node";
|
|
336
|
-
if (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
362
|
+
if ( _argv["h"] == true ) {
|
|
363
|
+
_help_display =
|
|
364
|
+
true;
|
|
365
|
+
}
|
|
366
|
+
if ( _argv["help"] == true ) {
|
|
367
|
+
_help_display =
|
|
368
|
+
true;
|
|
369
|
+
}
|
|
370
|
+
if ( ( _options.indexOf(
|
|
371
|
+
"--help") > -1 ||
|
|
372
|
+
_options.indexOf(
|
|
373
|
+
"-h") > -1) ) {
|
|
340
374
|
_help_display =
|
|
341
375
|
true;
|
|
342
376
|
}
|
|
343
377
|
if ( _help_display ) {
|
|
344
378
|
quiet =
|
|
345
379
|
"n";
|
|
380
|
+
_overrides_set();
|
|
346
381
|
_usage(
|
|
347
382
|
0);
|
|
348
383
|
}
|
|
@@ -351,112 +386,164 @@ function
|
|
|
351
386
|
_argv[
|
|
352
387
|
"_"].length < 1 ) {
|
|
353
388
|
_msg =
|
|
354
|
-
"
|
|
389
|
+
"Contract address argument required.";
|
|
355
390
|
_msg_error(
|
|
356
391
|
_msg,
|
|
357
392
|
0);
|
|
358
393
|
_usage(
|
|
359
394
|
1);
|
|
360
395
|
}
|
|
361
|
-
|
|
396
|
+
contract_address =
|
|
362
397
|
_argv[
|
|
363
398
|
"_"][
|
|
364
399
|
0];
|
|
365
|
-
if (
|
|
366
|
-
|
|
400
|
+
if ( typeof(
|
|
401
|
+
_argv) == "undefined" ||
|
|
402
|
+
_argv[
|
|
403
|
+
"_"].length < 2 ) {
|
|
404
|
+
_msg =
|
|
405
|
+
"Contract method argument required.";
|
|
406
|
+
_msg_error(
|
|
407
|
+
_msg,
|
|
408
|
+
0);
|
|
409
|
+
_usage(
|
|
410
|
+
1);
|
|
411
|
+
}
|
|
412
|
+
contract_method =
|
|
413
|
+
_argv[
|
|
414
|
+
"_"][
|
|
415
|
+
0];
|
|
416
|
+
const
|
|
417
|
+
method_args =
|
|
418
|
+
_out.slice(
|
|
419
|
+
2,
|
|
420
|
+
_argv[
|
|
421
|
+
"_"].length - 2);
|
|
422
|
+
if ( "t" in _argv ) {
|
|
423
|
+
call_type =
|
|
367
424
|
_argv[
|
|
368
|
-
"
|
|
425
|
+
"t"];
|
|
369
426
|
}
|
|
370
|
-
if ( "
|
|
371
|
-
|
|
427
|
+
if ( "call-type" in _argv ) {
|
|
428
|
+
call_type =
|
|
372
429
|
_argv[
|
|
373
|
-
"
|
|
430
|
+
"call-type"];
|
|
374
431
|
}
|
|
375
|
-
if ( "
|
|
376
|
-
|
|
432
|
+
if ( "T" in _argv ) {
|
|
433
|
+
call_timeout =
|
|
377
434
|
_argv[
|
|
378
|
-
"
|
|
435
|
+
"t"];
|
|
379
436
|
}
|
|
380
|
-
if ( "
|
|
381
|
-
|
|
437
|
+
if ( "call-timeout" in _argv ) {
|
|
438
|
+
call_timeout =
|
|
382
439
|
_argv[
|
|
383
|
-
"
|
|
440
|
+
"call-timeout"];
|
|
384
441
|
}
|
|
385
|
-
if ( "
|
|
386
|
-
|
|
442
|
+
if ( "I" in _argv ) {
|
|
443
|
+
index_retrieve =
|
|
387
444
|
_argv[
|
|
388
|
-
"
|
|
445
|
+
"I"];
|
|
389
446
|
}
|
|
390
|
-
if ( "
|
|
391
|
-
|
|
447
|
+
if ( "index_retrieve" in _argv ) {
|
|
448
|
+
index_retrieve =
|
|
392
449
|
_argv[
|
|
393
|
-
"
|
|
450
|
+
"index-retrieve"];
|
|
394
451
|
}
|
|
395
|
-
if ( "
|
|
396
|
-
|
|
452
|
+
if ( "P" in _argv ) {
|
|
453
|
+
price_gas =
|
|
397
454
|
_argv[
|
|
398
|
-
"
|
|
455
|
+
"P"];
|
|
399
456
|
}
|
|
400
|
-
if ( "
|
|
401
|
-
|
|
457
|
+
if ( "price-gas" in _argv ) {
|
|
458
|
+
price_gas =
|
|
402
459
|
_argv[
|
|
403
|
-
"
|
|
460
|
+
"price-gas"];
|
|
404
461
|
}
|
|
405
462
|
if ( "u" in _argv ) {
|
|
406
|
-
|
|
463
|
+
measure_unit =
|
|
407
464
|
_argv[
|
|
408
465
|
"u"];
|
|
409
466
|
}
|
|
410
|
-
if ( "
|
|
411
|
-
|
|
467
|
+
if ( "measure-unit" in _argv ) {
|
|
468
|
+
measure_unit =
|
|
412
469
|
_argv[
|
|
413
|
-
"
|
|
470
|
+
"measure-unit"];
|
|
414
471
|
}
|
|
415
|
-
if ( "
|
|
416
|
-
|
|
472
|
+
if ( "V" in _argv ) {
|
|
473
|
+
msg_value =
|
|
417
474
|
_argv[
|
|
418
|
-
"
|
|
475
|
+
"V"];
|
|
419
476
|
}
|
|
420
|
-
if ( "
|
|
421
|
-
|
|
477
|
+
if ( "msg-value" in _argv ) {
|
|
478
|
+
msg_value =
|
|
422
479
|
_argv[
|
|
423
|
-
"
|
|
480
|
+
"msg-value"];
|
|
424
481
|
}
|
|
425
|
-
if ( "
|
|
426
|
-
|
|
482
|
+
if ( "r" in _argv ) {
|
|
483
|
+
retries_max =
|
|
427
484
|
_argv[
|
|
428
|
-
"
|
|
485
|
+
"r"];
|
|
429
486
|
}
|
|
430
|
-
if ( "
|
|
431
|
-
|
|
487
|
+
if ( "retries-max" in _argv ) {
|
|
488
|
+
retries_max =
|
|
432
489
|
_argv[
|
|
433
|
-
"
|
|
490
|
+
"retries-max"];
|
|
434
491
|
}
|
|
435
|
-
if ( "
|
|
436
|
-
|
|
437
|
-
|
|
492
|
+
if ( "S" in _argv ) {
|
|
493
|
+
rpc_selection =
|
|
494
|
+
_argv[
|
|
495
|
+
"S"];
|
|
438
496
|
}
|
|
439
|
-
if ( "
|
|
440
|
-
|
|
441
|
-
|
|
497
|
+
if ( "rpc-selection" in _argv ) {
|
|
498
|
+
rpc_selection =
|
|
499
|
+
_argv[
|
|
500
|
+
"rpc-selection"];
|
|
501
|
+
}
|
|
502
|
+
if ( "A" in _argv ) {
|
|
503
|
+
contract_abi =
|
|
504
|
+
_argv[
|
|
505
|
+
"A"];
|
|
506
|
+
}
|
|
507
|
+
if ( "contract-abi" in _argv ) {
|
|
508
|
+
contract_abi =
|
|
509
|
+
_argv[
|
|
510
|
+
"contract-abi"];
|
|
511
|
+
}
|
|
512
|
+
if ( "C" in _argv ) {
|
|
513
|
+
contract_compiler_output =
|
|
514
|
+
_argv[
|
|
515
|
+
"C"];
|
|
516
|
+
}
|
|
517
|
+
if ( "contract-compiler-output" in _argv ) {
|
|
518
|
+
contract_compiler_output =
|
|
519
|
+
_argv[
|
|
520
|
+
"contract-compiler-output"];
|
|
442
521
|
}
|
|
443
522
|
if ( "a" in _argv ) {
|
|
444
|
-
|
|
523
|
+
call_auth =
|
|
445
524
|
"y";
|
|
446
525
|
}
|
|
447
|
-
if ( "
|
|
448
|
-
|
|
526
|
+
if ( "call-auth" in _argv ) {
|
|
527
|
+
call_auth =
|
|
449
528
|
"y";
|
|
450
529
|
}
|
|
530
|
+
if ( "n" in _argv ) {
|
|
531
|
+
target_networks.push(
|
|
532
|
+
_argv[
|
|
533
|
+
"n"]);
|
|
534
|
+
}
|
|
535
|
+
if ( "network" in _argv ) {
|
|
536
|
+
target_networks.push(
|
|
537
|
+
_argv[
|
|
538
|
+
"network"]);
|
|
539
|
+
}
|
|
451
540
|
if ( "v" in _argv ) {
|
|
452
541
|
verbose =
|
|
453
|
-
|
|
454
|
-
"v"];
|
|
542
|
+
true;
|
|
455
543
|
}
|
|
456
544
|
if ( "verbose" in _argv ) {
|
|
457
545
|
verbose =
|
|
458
|
-
|
|
459
|
-
"verbose"];
|
|
546
|
+
true;
|
|
460
547
|
}
|
|
461
548
|
if ( verbose ) {
|
|
462
549
|
quiet =
|
|
@@ -522,13 +609,13 @@ function
|
|
|
522
609
|
}
|
|
523
610
|
|
|
524
611
|
function
|
|
525
|
-
|
|
612
|
+
_evm_contract_call_cmdline(
|
|
526
613
|
_app_opts) {
|
|
527
614
|
let
|
|
528
615
|
_result;
|
|
529
616
|
const
|
|
530
617
|
_results =
|
|
531
|
-
|
|
618
|
+
_evm_contract_call.apply(
|
|
532
619
|
null,
|
|
533
620
|
app_opts);
|
|
534
621
|
for ( _result of _results ) {
|
|
@@ -538,6 +625,7 @@ function
|
|
|
538
625
|
}
|
|
539
626
|
|
|
540
627
|
_global_variables();
|
|
628
|
+
_libevm_global_variables();
|
|
541
629
|
if ( _cmdline_check(
|
|
542
630
|
"evm-contract-call.js") == true ||
|
|
543
631
|
_cmdline_check(
|
|
@@ -560,5 +648,5 @@ app_opts = [
|
|
|
560
648
|
target_chain,
|
|
561
649
|
db_paths
|
|
562
650
|
];
|
|
563
|
-
|
|
651
|
+
_evm_contract_call_cmdline(
|
|
564
652
|
app_opts);
|
package/lib/contract-get
CHANGED
|
@@ -28,80 +28,135 @@ const
|
|
|
28
28
|
{ ethers } =
|
|
29
29
|
require(
|
|
30
30
|
"ethers");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const
|
|
32
|
+
_ethers =
|
|
33
|
+
ethers;
|
|
34
|
+
const
|
|
35
|
+
_contract_factory =
|
|
36
|
+
_ethers.ContractFactory;
|
|
37
|
+
const
|
|
38
|
+
_base_contract =
|
|
39
|
+
_ethers.BaseContract;
|
|
37
40
|
const
|
|
38
41
|
_libcrash =
|
|
39
42
|
require(
|
|
40
43
|
"crash-js");
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_dirname =
|
|
44
|
-
_libcrash._dirname;
|
|
45
|
-
_file_read =
|
|
46
|
-
_libcrash._file_read;
|
|
47
|
-
_json_read =
|
|
48
|
-
_libcrash._json_read;
|
|
49
|
-
_path_join =
|
|
50
|
-
_libcrash._path_join;
|
|
51
|
-
_msg_info =
|
|
52
|
-
_libcrash._msg_info;
|
|
53
|
-
_msg_error =
|
|
54
|
-
_libcrash._msg_error;
|
|
44
|
+
/* global
|
|
45
|
+
_file_read */
|
|
55
46
|
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
_cmdline_check =
|
|
48
|
+
_libcrash._cmdline_check;
|
|
49
|
+
/* global
|
|
50
|
+
_file_read */
|
|
51
|
+
const
|
|
52
|
+
_dirname =
|
|
53
|
+
_libcrash._dirname;
|
|
54
|
+
/* global
|
|
55
|
+
_file_read */
|
|
56
|
+
const
|
|
57
|
+
_file_read =
|
|
58
|
+
_libcrash._file_read;
|
|
59
|
+
/* global
|
|
60
|
+
_json_read */
|
|
61
|
+
const
|
|
62
|
+
_json_read =
|
|
63
|
+
_libcrash._json_read;
|
|
64
|
+
/* global
|
|
65
|
+
_path_join */
|
|
66
|
+
const
|
|
67
|
+
_path_join =
|
|
68
|
+
_libcrash._path_join;
|
|
69
|
+
/* global
|
|
70
|
+
_msg_info */
|
|
71
|
+
const
|
|
72
|
+
_msg_info =
|
|
73
|
+
_libcrash._msg_info;
|
|
74
|
+
/* global
|
|
75
|
+
_msg_error */
|
|
61
76
|
const
|
|
62
|
-
|
|
77
|
+
_msg_error =
|
|
78
|
+
_libcrash._msg_error;
|
|
79
|
+
const
|
|
80
|
+
_evm_wallet_module =
|
|
63
81
|
require(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
82
|
+
"evm-wallet.js");
|
|
83
|
+
/* global
|
|
84
|
+
_wallet_get */
|
|
85
|
+
const
|
|
86
|
+
_wallet_get =
|
|
87
|
+
_evm_wallet_module._wallet_get;
|
|
88
|
+
/* global
|
|
89
|
+
_provider_get */
|
|
90
|
+
const
|
|
91
|
+
_provider_get =
|
|
92
|
+
_network_provider_module._provider_get;
|
|
67
93
|
|
|
68
94
|
|
|
69
95
|
function
|
|
70
96
|
_global_variables() {
|
|
97
|
+
/* global
|
|
98
|
+
app_name:
|
|
99
|
+
writable */
|
|
71
100
|
app_name =
|
|
72
101
|
"contract-get"
|
|
102
|
+
/* global
|
|
103
|
+
wallet_seed:
|
|
104
|
+
writable */
|
|
73
105
|
wallet_seed =
|
|
74
106
|
"";
|
|
107
|
+
/* global
|
|
108
|
+
wallet_password_path:
|
|
109
|
+
writable */
|
|
75
110
|
wallet_password_path =
|
|
76
111
|
"";
|
|
112
|
+
/* global
|
|
113
|
+
contract_address:
|
|
114
|
+
writable */
|
|
77
115
|
contract_address =
|
|
78
116
|
"";
|
|
117
|
+
/* global
|
|
118
|
+
contract_abi_path:
|
|
119
|
+
writable */
|
|
79
120
|
contract_abi_path =
|
|
80
121
|
"";
|
|
122
|
+
/* global
|
|
123
|
+
contract_bytecode_path:
|
|
124
|
+
writable */
|
|
81
125
|
contract_bytecode_path =
|
|
82
126
|
"";
|
|
127
|
+
/* global
|
|
128
|
+
contract_compiler_output_path:
|
|
129
|
+
writable */
|
|
83
130
|
contract_compiler_output_path =
|
|
84
131
|
"";
|
|
132
|
+
/* global
|
|
133
|
+
target_network:
|
|
134
|
+
writable */
|
|
85
135
|
target_network =
|
|
86
136
|
"";
|
|
137
|
+
/* global
|
|
138
|
+
api_key_path:
|
|
139
|
+
writable */
|
|
87
140
|
api_key_path =
|
|
88
141
|
"";
|
|
142
|
+
/* global
|
|
143
|
+
quiet:
|
|
144
|
+
writable */
|
|
89
145
|
quiet =
|
|
90
146
|
"";
|
|
91
147
|
}
|
|
92
148
|
|
|
93
149
|
function
|
|
94
150
|
_msg_error_no_input_data() {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
" ");
|
|
151
|
+
const
|
|
152
|
+
_text = [
|
|
153
|
+
"You need to provide either",
|
|
154
|
+
"the bytecode or the data"
|
|
155
|
+
];
|
|
156
|
+
const
|
|
157
|
+
_msg =
|
|
158
|
+
_text.join(
|
|
159
|
+
" ");
|
|
105
160
|
_msg_error(
|
|
106
161
|
_msg,
|
|
107
162
|
1);
|
|
@@ -110,15 +165,9 @@ function
|
|
|
110
165
|
function
|
|
111
166
|
_msg_info_wallet_selected(
|
|
112
167
|
_wallet) {
|
|
113
|
-
|
|
114
|
-
_msg
|
|
115
|
-
|
|
116
|
-
_template =
|
|
117
|
-
"Wallet is '{_wallet}'.";
|
|
118
|
-
_msg =
|
|
119
|
-
_template.replaceAll(
|
|
120
|
-
"{_wallet}",
|
|
121
|
-
_wallet);
|
|
168
|
+
const
|
|
169
|
+
_msg =
|
|
170
|
+
`Wallet is '${_wallet}'.`;
|
|
122
171
|
_msg_info(
|
|
123
172
|
_msg);
|
|
124
173
|
}
|
|
@@ -128,18 +177,17 @@ async function
|
|
|
128
177
|
_wallet,
|
|
129
178
|
_contract_address,
|
|
130
179
|
_contract_abi_path) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
_wallet);
|
|
180
|
+
const
|
|
181
|
+
_contract_abi =
|
|
182
|
+
_json_read(
|
|
183
|
+
_contract_abi_path);
|
|
184
|
+
const
|
|
185
|
+
_contract = new
|
|
186
|
+
_base_contract(
|
|
187
|
+
_contract_address,
|
|
188
|
+
_contract_abi,
|
|
189
|
+
runner =
|
|
190
|
+
_wallet);
|
|
143
191
|
return _contract;
|
|
144
192
|
}
|
|
145
193
|
|
|
@@ -153,7 +201,7 @@ async function
|
|
|
153
201
|
_contract,
|
|
154
202
|
_contract_abi,
|
|
155
203
|
_contract_bytecode,
|
|
156
|
-
|
|
204
|
+
_msg;
|
|
157
205
|
if ( _contract_abi_path == "" ) {
|
|
158
206
|
_contract_abi = [];
|
|
159
207
|
}
|
|
@@ -167,11 +215,12 @@ async function
|
|
|
167
215
|
_file_read(
|
|
168
216
|
_contract_bytecode_path);
|
|
169
217
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
218
|
+
const
|
|
219
|
+
_factory =
|
|
220
|
+
new _contract_factory(
|
|
221
|
+
_contract_abi,
|
|
222
|
+
_contract_bytecode,
|
|
223
|
+
_wallet);
|
|
175
224
|
if ( _contract_address != "" ) {
|
|
176
225
|
_contract =
|
|
177
226
|
_factory.attach(
|
|
@@ -182,8 +231,14 @@ async function
|
|
|
182
231
|
_contract =
|
|
183
232
|
_factory.getDeployTransaction();
|
|
184
233
|
} catch (e) {
|
|
234
|
+
const
|
|
235
|
+
_msg =
|
|
236
|
+
`Encountered the above error.`;
|
|
185
237
|
console.error(
|
|
186
238
|
e);
|
|
239
|
+
_msg_error(
|
|
240
|
+
_msg,
|
|
241
|
+
0);
|
|
187
242
|
}
|
|
188
243
|
}
|
|
189
244
|
return _contract;
|
|
@@ -195,16 +250,16 @@ async function
|
|
|
195
250
|
_contract_address,
|
|
196
251
|
_contract_compiler_output_path) {
|
|
197
252
|
let
|
|
198
|
-
_contract
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
253
|
+
_contract;
|
|
254
|
+
const
|
|
255
|
+
_contract_compiler_output =
|
|
256
|
+
_file_read(
|
|
257
|
+
_contract_compiler_output_path);
|
|
258
|
+
const
|
|
259
|
+
_factory =
|
|
260
|
+
_contract_factory.fromSolidity(
|
|
261
|
+
_contract_compiler_output,
|
|
262
|
+
_wallet);
|
|
208
263
|
if ( _contract_address != "" ) {
|
|
209
264
|
_contract =
|
|
210
265
|
_factory.attach(
|
|
@@ -217,7 +272,6 @@ async function
|
|
|
217
272
|
return _contract;
|
|
218
273
|
}
|
|
219
274
|
|
|
220
|
-
|
|
221
275
|
async function
|
|
222
276
|
_contract_get(
|
|
223
277
|
_wallet_seed,
|
package/libevm-contracts-tools
CHANGED
|
@@ -39,7 +39,7 @@ const
|
|
|
39
39
|
const
|
|
40
40
|
_bytecode_creation_get_module =
|
|
41
41
|
require(
|
|
42
|
-
"./lib/
|
|
42
|
+
"./lib/bytecode-creation-get");
|
|
43
43
|
/* global
|
|
44
44
|
_bytecode_creation_get */
|
|
45
45
|
const
|
|
@@ -48,7 +48,7 @@ const
|
|
|
48
48
|
const
|
|
49
49
|
_bytecode_runtime_get_module =
|
|
50
50
|
require(
|
|
51
|
-
"./lib/
|
|
51
|
+
"./lib/bytecode-runtime-get");
|
|
52
52
|
/* global
|
|
53
53
|
_bytecode_runtime_get */
|
|
54
54
|
const
|
|
@@ -58,7 +58,7 @@ const
|
|
|
58
58
|
const
|
|
59
59
|
_contract_get_module =
|
|
60
60
|
require(
|
|
61
|
-
"./lib/
|
|
61
|
+
"./lib/contract-get");
|
|
62
62
|
/* global
|
|
63
63
|
_contract_get */
|
|
64
64
|
const
|
|
@@ -67,7 +67,7 @@ const
|
|
|
67
67
|
const
|
|
68
68
|
_deployer_get_module =
|
|
69
69
|
require(
|
|
70
|
-
"./lib/
|
|
70
|
+
"./lib/deployer-get");
|
|
71
71
|
/* global
|
|
72
72
|
_deployer_get */
|
|
73
73
|
const
|
|
@@ -76,7 +76,7 @@ const
|
|
|
76
76
|
const
|
|
77
77
|
_deployer_verify_module =
|
|
78
78
|
require(
|
|
79
|
-
"./lib/
|
|
79
|
+
"./lib/deployer-verify");
|
|
80
80
|
/* global
|
|
81
81
|
_deployer_verify */
|
|
82
82
|
const
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{ "name": "evm-contracts-tools",
|
|
2
2
|
"version":
|
|
3
|
-
"0.0.
|
|
3
|
+
"0.0.8",
|
|
4
4
|
"description":
|
|
5
5
|
"JavaScript programs and libraries to enable seamless development of native computer applications designed to interact with Ethereum Virtual Machine-compatible networks.",
|
|
6
6
|
"funding": {
|
|
@@ -96,6 +96,8 @@
|
|
|
96
96
|
"libevm-contracts-tools",
|
|
97
97
|
"bin":
|
|
98
98
|
{
|
|
99
|
+
"evm-contract-call":
|
|
100
|
+
"evm-contract-call",
|
|
99
101
|
"evm-contract-call.js":
|
|
100
102
|
"evm-contract-call",
|
|
101
103
|
"evm-contract-call-dynamic.js":
|