evm-contracts-tools 0.0.55 → 0.0.62
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 +9 -1
- 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 +463 -102
- 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 +594 -31
- package/libevm-contract-deployment +153 -35
- package/libevm-contract-deployment-address +304 -66
- package/libevm-contract-deployments-dir +2 -1
- package/package.json +14 -12
package/lib/deployer-verify
CHANGED
|
@@ -29,18 +29,43 @@
|
|
|
29
29
|
|
|
30
30
|
const
|
|
31
31
|
_libcrash =
|
|
32
|
-
|
|
33
|
-
"
|
|
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;
|
|
34
44
|
/* global
|
|
35
45
|
_cmdline_check */
|
|
36
46
|
const
|
|
37
47
|
_cmdline_check =
|
|
38
48
|
_libcrash._cmdline_check;
|
|
49
|
+
/* global
|
|
50
|
+
_echo */
|
|
51
|
+
const
|
|
52
|
+
_echo =
|
|
53
|
+
_libcrash._echo;
|
|
39
54
|
/* global
|
|
40
55
|
_exit */
|
|
41
56
|
const
|
|
42
57
|
_exit =
|
|
43
58
|
_libcrash._exit;
|
|
59
|
+
/* global
|
|
60
|
+
_get */
|
|
61
|
+
const
|
|
62
|
+
_get =
|
|
63
|
+
_libcrash._get;
|
|
64
|
+
/* global
|
|
65
|
+
_global_get */
|
|
66
|
+
const
|
|
67
|
+
_global_get =
|
|
68
|
+
_libcrash._global_get;
|
|
44
69
|
/* global
|
|
45
70
|
_msg_info */
|
|
46
71
|
const
|
|
@@ -52,13 +77,23 @@ const
|
|
|
52
77
|
_msg_error =
|
|
53
78
|
_libcrash._msg_error;
|
|
54
79
|
/* global
|
|
55
|
-
|
|
80
|
+
_override_set */
|
|
81
|
+
const
|
|
82
|
+
_override_set =
|
|
83
|
+
_libcrash._override_set;
|
|
84
|
+
/* global
|
|
85
|
+
_printf */
|
|
56
86
|
const
|
|
57
87
|
_printf =
|
|
58
88
|
_libcrash._printf;
|
|
89
|
+
/* global
|
|
90
|
+
_set */
|
|
91
|
+
const
|
|
92
|
+
_set =
|
|
93
|
+
_libcrash._set;
|
|
59
94
|
const
|
|
60
95
|
_deployer_get_module =
|
|
61
|
-
|
|
96
|
+
await import(
|
|
62
97
|
'./deployer-get');
|
|
63
98
|
/* global
|
|
64
99
|
_deployer_get */
|
|
@@ -71,57 +106,81 @@ function
|
|
|
71
106
|
/* global
|
|
72
107
|
app_name:
|
|
73
108
|
writable */
|
|
74
|
-
|
|
75
|
-
"
|
|
109
|
+
_set(
|
|
110
|
+
"app",
|
|
111
|
+
"name",
|
|
112
|
+
"deployer-verify");
|
|
76
113
|
/* global
|
|
77
114
|
wallet_seed:
|
|
78
115
|
writable */
|
|
79
|
-
|
|
80
|
-
""
|
|
116
|
+
_set(
|
|
117
|
+
"wallet",
|
|
118
|
+
"seed",
|
|
119
|
+
"");
|
|
81
120
|
/* global
|
|
82
121
|
retries_max:
|
|
83
122
|
writable */
|
|
84
|
-
|
|
85
|
-
""
|
|
123
|
+
_set(
|
|
124
|
+
"retries",
|
|
125
|
+
"max",
|
|
126
|
+
"");
|
|
86
127
|
/* global
|
|
87
128
|
api_key_path:
|
|
88
129
|
writable */
|
|
89
|
-
|
|
90
|
-
""
|
|
130
|
+
_set(
|
|
131
|
+
"api_key",
|
|
132
|
+
"path",
|
|
133
|
+
"");
|
|
91
134
|
/* global
|
|
92
135
|
chain_id:
|
|
93
136
|
writable */
|
|
94
|
-
|
|
95
|
-
""
|
|
137
|
+
_set(
|
|
138
|
+
"chain",
|
|
139
|
+
"id",
|
|
140
|
+
"");
|
|
96
141
|
/* global
|
|
97
142
|
chain_name:
|
|
98
143
|
writable */
|
|
99
|
-
|
|
100
|
-
""
|
|
144
|
+
_set(
|
|
145
|
+
"chain",
|
|
146
|
+
"name",
|
|
147
|
+
"");
|
|
101
148
|
/* global
|
|
102
149
|
target_network:
|
|
103
150
|
writable */
|
|
104
|
-
|
|
105
|
-
""
|
|
151
|
+
_set(
|
|
152
|
+
"target",
|
|
153
|
+
"network",
|
|
154
|
+
"");
|
|
106
155
|
/* global
|
|
107
156
|
contract_address:
|
|
108
157
|
writable */
|
|
109
|
-
|
|
110
|
-
""
|
|
158
|
+
_set(
|
|
159
|
+
"contract",
|
|
160
|
+
"address",
|
|
161
|
+
"");
|
|
111
162
|
/* global
|
|
112
163
|
contract_deployer:
|
|
113
164
|
writable */
|
|
114
|
-
|
|
115
|
-
""
|
|
165
|
+
_set(
|
|
166
|
+
"contract",
|
|
167
|
+
"deployer",
|
|
168
|
+
"");
|
|
116
169
|
/* global
|
|
117
170
|
transaction_deployment:
|
|
118
171
|
writable */
|
|
119
|
-
|
|
120
|
-
""
|
|
172
|
+
_set(
|
|
173
|
+
"transaction",
|
|
174
|
+
"deployment",
|
|
175
|
+
"");
|
|
176
|
+
const
|
|
177
|
+
_global =
|
|
178
|
+
_global_get();
|
|
121
179
|
/* global
|
|
122
180
|
quiet:
|
|
123
181
|
writable */
|
|
124
|
-
|
|
182
|
+
_global[
|
|
183
|
+
"quiet"] =
|
|
125
184
|
"";
|
|
126
185
|
}
|
|
127
186
|
|
|
@@ -182,19 +241,24 @@ function
|
|
|
182
241
|
_config_show() {
|
|
183
242
|
let
|
|
184
243
|
_line;
|
|
244
|
+
const
|
|
245
|
+
_program =
|
|
246
|
+
_basename(
|
|
247
|
+
_argv[
|
|
248
|
+
0]);
|
|
185
249
|
const
|
|
186
250
|
_text = [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
251
|
+
`${_program} configuration:`,
|
|
252
|
+
` Wallet seed: ${wallet_seed}`,
|
|
253
|
+
` Max retries: ${retries_max}`,
|
|
254
|
+
` API Key path: ${api_key_path}`,
|
|
255
|
+
` Chain ID: ${chain_id}`,
|
|
256
|
+
` Chain Name: ${chain_name}`,
|
|
257
|
+
` Target network: ${target_network}`,
|
|
258
|
+
` Contract address: ${contract_address}`,
|
|
259
|
+
` Contract deployer: ${contract_deployer}`,
|
|
260
|
+
` Deployment transaction: ${transaction_deployment}`
|
|
261
|
+
];
|
|
198
262
|
for (_line of _text) {
|
|
199
263
|
_msg_info(
|
|
200
264
|
_line);
|
|
@@ -205,47 +269,52 @@ function
|
|
|
205
269
|
_usage(
|
|
206
270
|
_exit_code) {
|
|
207
271
|
let
|
|
208
|
-
_line
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
"
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
272
|
+
_line;
|
|
273
|
+
const
|
|
274
|
+
_program =
|
|
275
|
+
_basename(
|
|
276
|
+
_argv[
|
|
277
|
+
0]);
|
|
278
|
+
const
|
|
279
|
+
_text = [
|
|
280
|
+
"Given a deployment transaction hash",
|
|
281
|
+
"and a contract address, determines",
|
|
282
|
+
"if an input address is the",
|
|
283
|
+
"contract deployer.",
|
|
284
|
+
"",
|
|
285
|
+
"Usage:",
|
|
286
|
+
` ${_program}`,
|
|
287
|
+
" <quiet>",
|
|
288
|
+
" <wallet-seed>",
|
|
289
|
+
" <retries-max>",
|
|
290
|
+
" <api-key-path>",
|
|
291
|
+
" <chain-id>",
|
|
292
|
+
" <chain-name>",
|
|
293
|
+
" <target-network>",
|
|
294
|
+
" <contract-address>",
|
|
295
|
+
" <contract-deployer>",
|
|
296
|
+
" <transaction-deployment>",
|
|
297
|
+
"",
|
|
298
|
+
"Args:",
|
|
299
|
+
" <quiet> Can be 'y' or 'n'",
|
|
300
|
+
" Default: y",
|
|
301
|
+
" <wallet-seed> Path of the file containing",
|
|
302
|
+
" the seed phrase.",
|
|
303
|
+
" <retries-max> Maximum number of retries before",
|
|
304
|
+
" failing.",
|
|
305
|
+
" <api-key-path> Path of the API key for the",
|
|
306
|
+
" contract ABI provider service",
|
|
307
|
+
" <target-network> Network on which the contract",
|
|
308
|
+
" resides.",
|
|
309
|
+
" <contract-address> Address of the contract.",
|
|
310
|
+
" <contract-deployer> Address of the supposed deployer.",
|
|
311
|
+
" <transaction-deployment> Contract deployment transaction.",
|
|
312
|
+
"",
|
|
313
|
+
" Options:",
|
|
314
|
+
" -h This help."
|
|
315
|
+
];
|
|
247
316
|
for (_line of _text) {
|
|
248
|
-
|
|
317
|
+
_echo(
|
|
249
318
|
_line);
|
|
250
319
|
}
|
|
251
320
|
_exit(
|
|
@@ -254,62 +323,84 @@ function
|
|
|
254
323
|
|
|
255
324
|
function
|
|
256
325
|
_overrides_set() {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
326
|
+
_override_set(
|
|
327
|
+
"retries",
|
|
328
|
+
"max",
|
|
329
|
+
10);
|
|
261
330
|
}
|
|
262
331
|
|
|
263
332
|
function
|
|
264
333
|
_cmdline_parse() {
|
|
265
334
|
let
|
|
266
335
|
_msg;
|
|
267
|
-
|
|
336
|
+
const
|
|
337
|
+
_global =
|
|
338
|
+
_global_get();
|
|
339
|
+
_global[
|
|
340
|
+
"quiet"] =
|
|
268
341
|
"y";
|
|
269
|
-
|
|
342
|
+
_argv.forEach(
|
|
270
343
|
function (
|
|
271
344
|
_value,
|
|
272
|
-
_index
|
|
273
|
-
_array) {
|
|
345
|
+
_index) {
|
|
274
346
|
if ( _index == 2 ) {
|
|
275
|
-
|
|
347
|
+
_global[
|
|
348
|
+
"quiet"] =
|
|
276
349
|
_value;
|
|
277
350
|
}
|
|
278
351
|
if ( _index == 3 ) {
|
|
279
|
-
|
|
280
|
-
|
|
352
|
+
_set(
|
|
353
|
+
"wallet",
|
|
354
|
+
"seed",
|
|
355
|
+
_value);
|
|
281
356
|
}
|
|
282
357
|
if ( _index == 4 ) {
|
|
283
|
-
|
|
284
|
-
|
|
358
|
+
_set(
|
|
359
|
+
"retries",
|
|
360
|
+
"max",
|
|
361
|
+
_value);
|
|
285
362
|
}
|
|
286
363
|
if ( _index == 5 ) {
|
|
287
|
-
|
|
288
|
-
|
|
364
|
+
_set(
|
|
365
|
+
"api_key",
|
|
366
|
+
"path",
|
|
367
|
+
_value);
|
|
289
368
|
}
|
|
290
369
|
if ( _index == 6 ) {
|
|
291
|
-
|
|
292
|
-
|
|
370
|
+
_set(
|
|
371
|
+
"chain",
|
|
372
|
+
"id",
|
|
373
|
+
_value);
|
|
293
374
|
}
|
|
294
375
|
if ( _index == 7 ) {
|
|
295
|
-
|
|
296
|
-
|
|
376
|
+
_set(
|
|
377
|
+
"chain",
|
|
378
|
+
"name",
|
|
379
|
+
_value);
|
|
297
380
|
}
|
|
298
381
|
if ( _index == 8 ) {
|
|
299
|
-
|
|
300
|
-
|
|
382
|
+
_set(
|
|
383
|
+
"target",
|
|
384
|
+
"network",
|
|
385
|
+
_value);
|
|
301
386
|
}
|
|
302
387
|
if ( _index == 9 ) {
|
|
303
|
-
|
|
304
|
-
|
|
388
|
+
_set(
|
|
389
|
+
"contract",
|
|
390
|
+
"address",
|
|
391
|
+
_value);
|
|
305
392
|
}
|
|
306
393
|
if ( _index == 10 ) {
|
|
307
|
-
|
|
308
|
-
|
|
394
|
+
_set(
|
|
395
|
+
"contract",
|
|
396
|
+
"deployer",
|
|
397
|
+
_value);
|
|
309
398
|
}
|
|
310
399
|
if ( _index == 11 ) {
|
|
311
|
-
|
|
312
|
-
|
|
400
|
+
_set(
|
|
401
|
+
"transaction",
|
|
402
|
+
"deployment",
|
|
403
|
+
_value);
|
|
313
404
|
}
|
|
314
405
|
if ( _value == "-h" ||
|
|
315
406
|
_value == "--help" ) {
|
|
@@ -318,37 +409,55 @@ function
|
|
|
318
409
|
}
|
|
319
410
|
}
|
|
320
411
|
);
|
|
321
|
-
|
|
412
|
+
const
|
|
413
|
+
_contract_address =
|
|
414
|
+
_get(
|
|
415
|
+
"contract",
|
|
416
|
+
"address");
|
|
417
|
+
if ( _contract_address == "" ) {
|
|
322
418
|
_msg =
|
|
323
419
|
"No contract address specified.";
|
|
324
420
|
_msg_error(
|
|
325
421
|
_msg,
|
|
326
422
|
0);
|
|
327
|
-
|
|
423
|
+
_global[
|
|
424
|
+
"quiet"] =
|
|
328
425
|
"n";
|
|
329
426
|
_overrides_set();
|
|
330
427
|
_usage(
|
|
331
428
|
1);
|
|
332
429
|
}
|
|
333
|
-
|
|
430
|
+
const
|
|
431
|
+
_contract_deployer =
|
|
432
|
+
_get(
|
|
433
|
+
"contract",
|
|
434
|
+
"deployer");
|
|
435
|
+
if ( _contract_deployer == "" ) {
|
|
334
436
|
_msg =
|
|
335
437
|
"No contract deployer specified.";
|
|
336
438
|
_msg_error(
|
|
337
439
|
_msg,
|
|
338
440
|
0);
|
|
339
|
-
|
|
441
|
+
_global[
|
|
442
|
+
"quiet"] =
|
|
340
443
|
"n";
|
|
341
444
|
_overrides_set();
|
|
342
445
|
_usage(
|
|
343
446
|
1);
|
|
344
447
|
}
|
|
345
|
-
|
|
448
|
+
const
|
|
449
|
+
_transaction_deployment =
|
|
450
|
+
_get(
|
|
451
|
+
"transaction",
|
|
452
|
+
"deployment");
|
|
453
|
+
if ( _transaction_deployment == "" ) {
|
|
346
454
|
_msg =
|
|
347
455
|
"No deployement transaction specified.";
|
|
348
456
|
_msg_error(
|
|
349
457
|
_msg,
|
|
350
458
|
0);
|
|
351
|
-
|
|
459
|
+
_global[
|
|
460
|
+
"quiet"] =
|
|
352
461
|
"n";
|
|
353
462
|
_overrides_set();
|
|
354
463
|
_usage(
|
|
@@ -386,7 +495,7 @@ async function
|
|
|
386
495
|
}
|
|
387
496
|
}
|
|
388
497
|
|
|
389
|
-
if ( _cmdline_check(
|
|
498
|
+
if ( await _cmdline_check(
|
|
390
499
|
"deployer-verify") ) {
|
|
391
500
|
_global_variables();
|
|
392
501
|
_cmdline_parse();
|
|
@@ -407,7 +516,11 @@ if ( _cmdline_check(
|
|
|
407
516
|
app_opts);
|
|
408
517
|
}
|
|
409
518
|
|
|
410
|
-
|
|
411
|
-
_deployer_verify
|
|
412
|
-
_deployer_verify
|
|
519
|
+
export {
|
|
520
|
+
_deployer_verify
|
|
413
521
|
};
|
|
522
|
+
|
|
523
|
+
// module.exports = {
|
|
524
|
+
// _deployer_verify:
|
|
525
|
+
// _deployer_verify
|
|
526
|
+
// };
|