evm-contracts-tools 0.0.33 → 0.0.34
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 +223 -0
- package/dist/evm-contract-call/index.html +24 -0
- package/dist/evm-contracts-tools/index.html +24 -0
- package/dist/libevm-contract-call/fs-worker.js +1 -0
- package/dist/libevm-contract-call/index.html +24 -0
- package/evm-contract-call +7 -11
- package/evm-contracts-tools +11 -0
- package/lib/address-check +253 -0
- package/lib/bytecode-creation-get +40 -9
- package/lib/bytecode-runtime-get +9 -4
- package/libevm-contract-call +37 -18
- package/package.json +17 -7
package/Makefile
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0
|
|
2
|
+
|
|
3
|
+
# -----------------------------------------------------
|
|
4
|
+
# Copyright © 2024, 2025, 2026 Pellegrino Prevete
|
|
5
|
+
#
|
|
6
|
+
# All rights reserved
|
|
7
|
+
# -----------------------------------------------------
|
|
8
|
+
#
|
|
9
|
+
# This program is free software: you can redistribute
|
|
10
|
+
# it and/or modify it under the terms of the
|
|
11
|
+
# GNU Affero General Public License as published by
|
|
12
|
+
# the Free Software Foundation, either version 3 of
|
|
13
|
+
# the License, or (at your option) any later version.
|
|
14
|
+
#
|
|
15
|
+
# This program is distributed in the hope that it
|
|
16
|
+
# will be useful, but WITHOUT ANY WARRANTY;
|
|
17
|
+
# without even the implied warranty of
|
|
18
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
19
|
+
# See the GNU Affero General Public License for
|
|
20
|
+
# more details.
|
|
21
|
+
#
|
|
22
|
+
# You should have received a copy of the
|
|
23
|
+
# GNU Affero General Public License
|
|
24
|
+
# along with this program.
|
|
25
|
+
# If not, see <https://www.gnu.org/licenses/>.
|
|
26
|
+
|
|
27
|
+
SHELL=bash
|
|
28
|
+
PREFIX ?= /usr/local
|
|
29
|
+
_PROJECT_NPM=evm-contracts-tools
|
|
30
|
+
_PROJECT=$(_PROJECT_NPM).js
|
|
31
|
+
_NAMESPACE=themartiancompany
|
|
32
|
+
DOC_DIR=$(DESTDIR)$(PREFIX)/share/doc/$(_PROJECT_NPM)
|
|
33
|
+
USR_DIR=$(DESTDIR)$(PREFIX)
|
|
34
|
+
BIN_DIR=$(DESTDIR)$(PREFIX)/bin
|
|
35
|
+
LIB_DIR=$(DESTDIR)$(PREFIX)/lib/$(_PROJECT_NPM)
|
|
36
|
+
MAN_DIR?=$(DESTDIR)$(PREFIX)/share/man
|
|
37
|
+
NODE_DIR=$(PREFIX)/lib/node_modules/$(_PROJECT_NPM)
|
|
38
|
+
BUILD_NPM_DIR=build
|
|
39
|
+
|
|
40
|
+
_INSTALL_FILE=\
|
|
41
|
+
install \
|
|
42
|
+
-vDm644
|
|
43
|
+
_INSTALL_EXE=\
|
|
44
|
+
install \
|
|
45
|
+
-vDm755
|
|
46
|
+
_INSTALL_DIR=\
|
|
47
|
+
install \
|
|
48
|
+
-vdm755
|
|
49
|
+
|
|
50
|
+
DOC_FILES=\
|
|
51
|
+
$(wildcard \
|
|
52
|
+
*.rst) \
|
|
53
|
+
$(wildcard \
|
|
54
|
+
*.md)
|
|
55
|
+
NPM_FILES=\
|
|
56
|
+
"README.md" \
|
|
57
|
+
"COPYING" \
|
|
58
|
+
"AUTHORS.rst" \
|
|
59
|
+
"Makefile" \
|
|
60
|
+
"dist" \
|
|
61
|
+
"evm-contract-call" \
|
|
62
|
+
"evm-contract-call.webpack.config.cjs" \
|
|
63
|
+
"lib" \
|
|
64
|
+
"libevm-contract-call" \
|
|
65
|
+
"libevm-contract-call.webpack.config.cjs" \
|
|
66
|
+
"$(_PROJECT_NPM)" \
|
|
67
|
+
"eslint.config.mjs" \
|
|
68
|
+
"fs-worker.webpack.config.cjs" \
|
|
69
|
+
"package.json" \
|
|
70
|
+
"webpack.config.cjs"
|
|
71
|
+
|
|
72
|
+
MAN_FILES=\
|
|
73
|
+
evm-contract-bytecode-get \
|
|
74
|
+
evm-contract-call \
|
|
75
|
+
evm-contract-deployer-get
|
|
76
|
+
|
|
77
|
+
all: build-man build-npm build-scripts
|
|
78
|
+
|
|
79
|
+
check: eslint
|
|
80
|
+
|
|
81
|
+
eslint:
|
|
82
|
+
|
|
83
|
+
npm \
|
|
84
|
+
install \
|
|
85
|
+
--save-dev; \
|
|
86
|
+
npx \
|
|
87
|
+
eslint \
|
|
88
|
+
"."
|
|
89
|
+
|
|
90
|
+
install: install-scripts install-doc install-examples install-man
|
|
91
|
+
|
|
92
|
+
install-scripts:
|
|
93
|
+
|
|
94
|
+
$(_INSTALL_DIR) \
|
|
95
|
+
"$(LIB_DIR)/nodejs/lib"
|
|
96
|
+
for _file in $(NPM_FILES); do
|
|
97
|
+
$(_INSTALL_FILE) \
|
|
98
|
+
"$${_file}" \
|
|
99
|
+
"$(LIB_DIR)/nodejs/$${_file}"; \
|
|
100
|
+
ln \
|
|
101
|
+
-s \
|
|
102
|
+
"$(PREFIX)/lib/$(_PROJECT_NPM)/nodejs/$${_file}" \
|
|
103
|
+
"$(LIB_DIR)/$${_file}" || \
|
|
104
|
+
true; \
|
|
105
|
+
done
|
|
106
|
+
# ln \
|
|
107
|
+
# -s \
|
|
108
|
+
# "$(PREFIX)/lib/$(_PROJECT_NPM)/node/lib$(_PROJECT_NPM)" \
|
|
109
|
+
# "$(LIB_DIR)/$(_PROJECT_NPM)-js" || \
|
|
110
|
+
# true
|
|
111
|
+
|
|
112
|
+
build-man:
|
|
113
|
+
|
|
114
|
+
git \
|
|
115
|
+
submodule \
|
|
116
|
+
update \
|
|
117
|
+
--init \
|
|
118
|
+
"man" || \
|
|
119
|
+
true; \
|
|
120
|
+
_version="$$( \
|
|
121
|
+
npm \
|
|
122
|
+
view \
|
|
123
|
+
"$${PWD}" \
|
|
124
|
+
"version")"; \
|
|
125
|
+
cd \
|
|
126
|
+
"man"; \
|
|
127
|
+
make \
|
|
128
|
+
_VERSION="$${_version}" \
|
|
129
|
+
build-man
|
|
130
|
+
mkdir \
|
|
131
|
+
-p \
|
|
132
|
+
"build/man"
|
|
133
|
+
cp \
|
|
134
|
+
-r \
|
|
135
|
+
"man/build/"* \
|
|
136
|
+
"build/man"
|
|
137
|
+
|
|
138
|
+
build-npm:
|
|
139
|
+
|
|
140
|
+
make \
|
|
141
|
+
build-man
|
|
142
|
+
for _file in $(NPM_FILES); do \
|
|
143
|
+
if [[ -d "$${_file}" ]]; then \
|
|
144
|
+
mkdir \
|
|
145
|
+
-p \
|
|
146
|
+
"build/$${_file}"; \
|
|
147
|
+
cp \
|
|
148
|
+
-r \
|
|
149
|
+
"$${_file}/"* \
|
|
150
|
+
"build/$${_file}"; \
|
|
151
|
+
elif [[ -e "$${_file}" ]]; then \
|
|
152
|
+
cp \
|
|
153
|
+
"$${_file}" \
|
|
154
|
+
"build"; \
|
|
155
|
+
fi; \
|
|
156
|
+
done
|
|
157
|
+
cd \
|
|
158
|
+
"build"; \
|
|
159
|
+
_version="$$( \
|
|
160
|
+
npm \
|
|
161
|
+
view \
|
|
162
|
+
"$${PWD}" \
|
|
163
|
+
"version")"; \
|
|
164
|
+
npm \
|
|
165
|
+
install; \
|
|
166
|
+
npm \
|
|
167
|
+
run \
|
|
168
|
+
"build"; \
|
|
169
|
+
npm \
|
|
170
|
+
pack; \
|
|
171
|
+
mv \
|
|
172
|
+
"$(_PROJECT_NPM)-$${_version}.tgz" \
|
|
173
|
+
".."
|
|
174
|
+
|
|
175
|
+
install-npm:
|
|
176
|
+
|
|
177
|
+
_npm_opts=( \
|
|
178
|
+
-g \
|
|
179
|
+
--prefix \
|
|
180
|
+
'$(USR_DIR)' \
|
|
181
|
+
); \
|
|
182
|
+
_version="$$( \
|
|
183
|
+
npm \
|
|
184
|
+
view \
|
|
185
|
+
"$${PWD}" \
|
|
186
|
+
"version")"; \
|
|
187
|
+
npm \
|
|
188
|
+
install \
|
|
189
|
+
"$${_npm_opts[@]}" \
|
|
190
|
+
"$(_PROJECT_NPM)-$${_version}.tgz"; \
|
|
191
|
+
$(_INSTALL_DIR) \
|
|
192
|
+
"$(DESTDIR)$(PREFIX)/lib"; \
|
|
193
|
+
ln \
|
|
194
|
+
-s \
|
|
195
|
+
"$(NODE_DIR)" \
|
|
196
|
+
"$(LIB_DIR)" || \
|
|
197
|
+
true
|
|
198
|
+
|
|
199
|
+
publish-npm:
|
|
200
|
+
|
|
201
|
+
cd \
|
|
202
|
+
"build"; \
|
|
203
|
+
npm \
|
|
204
|
+
publish \
|
|
205
|
+
--access \
|
|
206
|
+
"public"
|
|
207
|
+
|
|
208
|
+
install-doc:
|
|
209
|
+
|
|
210
|
+
$(_INSTALL_FILE) \
|
|
211
|
+
$(DOC_FILES) \
|
|
212
|
+
-t \
|
|
213
|
+
$(DOC_DIR)
|
|
214
|
+
|
|
215
|
+
install-man:
|
|
216
|
+
|
|
217
|
+
$(_INSTALL_DIR) \
|
|
218
|
+
"$(MAN_DIR)/man1"
|
|
219
|
+
$(_INSTALL_FILE) \
|
|
220
|
+
"build/man/$(_PROJECT_NPM).1" \
|
|
221
|
+
"$(MAN_DIR)/man1/$(_PROJECT_NPM).1"
|
|
222
|
+
|
|
223
|
+
.PHONY: check build-man build-npm build-scripts install install-doc install-man install-npm install-scripts shellcheck
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
----------------------------------------------------------------------
|
|
5
|
+
Copyright © 2024, 2025, 2026 Pellegrino Prevete
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
----------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
This program is free software: you can redistribute it and/or modify
|
|
11
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
12
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
13
|
+
(at your option) any later version.
|
|
14
|
+
|
|
15
|
+
This program is distributed in the hope that it will be useful,
|
|
16
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
GNU Affero General Public License for more details.
|
|
19
|
+
|
|
20
|
+
You should have received a copy of the GNU Affero General Public License
|
|
21
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
22
|
+
-->
|
|
23
|
+
|
|
24
|
+
<script src="evm-contract-call.js"></script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
----------------------------------------------------------------------
|
|
5
|
+
Copyright © 2024, 2025, 2026 Pellegrino Prevete
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
----------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
This program is free software: you can redistribute it and/or modify
|
|
11
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
12
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
13
|
+
(at your option) any later version.
|
|
14
|
+
|
|
15
|
+
This program is distributed in the hope that it will be useful,
|
|
16
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
GNU Affero General Public License for more details.
|
|
19
|
+
|
|
20
|
+
You should have received a copy of the GNU Affero General Public License
|
|
21
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
22
|
+
-->
|
|
23
|
+
|
|
24
|
+
<script src="evm-contracts-tools.js"></script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={816(e,o,n){function t(){let e;return"undefined"==typeof window&&void 0!==n.g&&n.g.global===n.g&&"function"!=typeof n||(e=function(){let e;try{e=n(816)}catch(e){console.log(e);const o="Error importing the '@themartiancompany/opfs' module as 'opfs'. If you got this error while bundling a webpack for a project depending on this module double check its 'webpack.config.js' file or whether the 'opfs' module is listed in developer dependencies and install them.I'm sorry for this inconvenience but Node packagement system does not currently distinguish 'development' from 'build' dependencies.";throw console.error(o),e}return e}()),e}const r=t();e.exports=r,e.exports.getModule=function(e){let o;if(""==_module_name||"undefined"==typeof _module_name)o=t();else if("opfs"==_module_name)o=n(816);else{if("fs"!=_module_name){const e="Unknown file system module "+`'${_module_name}'.`.const;throw _error={msg:e},console.error(e),_error}o=n(816)}return o}},314(e,o,n){const t=n(816);_sync_agent=t.startSyncAgent,e.exports={_sync_agent},_sync_agent()}},o={};function n(t){var r=o[t];if(void 0!==r)return r.exports;var s=o[t]={exports:{}};return e[t](s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(314)})();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
----------------------------------------------------------------------
|
|
5
|
+
Copyright © 2024, 2025, 2026 Pellegrino Prevete
|
|
6
|
+
|
|
7
|
+
All rights reserved
|
|
8
|
+
----------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
This program is free software: you can redistribute it and/or modify
|
|
11
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
12
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
13
|
+
(at your option) any later version.
|
|
14
|
+
|
|
15
|
+
This program is distributed in the hope that it will be useful,
|
|
16
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
GNU Affero General Public License for more details.
|
|
19
|
+
|
|
20
|
+
You should have received a copy of the GNU Affero General Public License
|
|
21
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
22
|
+
-->
|
|
23
|
+
|
|
24
|
+
<script src="libevm-contract-call.js"></script>
|
package/evm-contract-call
CHANGED
|
@@ -141,6 +141,11 @@ const
|
|
|
141
141
|
const
|
|
142
142
|
_artifact_local_auto_detect =
|
|
143
143
|
_libevm_contract_call_module._artifact_local_auto_detect;
|
|
144
|
+
/* global
|
|
145
|
+
_address_check */
|
|
146
|
+
const
|
|
147
|
+
_address_check =
|
|
148
|
+
_libevm_contract_call_module._address_check;
|
|
144
149
|
/* global
|
|
145
150
|
_default_artifact_path_get */
|
|
146
151
|
const
|
|
@@ -260,7 +265,8 @@ function
|
|
|
260
265
|
|
|
261
266
|
async function
|
|
262
267
|
_overrides_set() {
|
|
263
|
-
|
|
268
|
+
_address_check(
|
|
269
|
+
contract_address);
|
|
264
270
|
if ( call_date == "" ||
|
|
265
271
|
typeof(
|
|
266
272
|
call_date) == "undefined" ) {
|
|
@@ -317,12 +323,10 @@ async function
|
|
|
317
323
|
}
|
|
318
324
|
}
|
|
319
325
|
}
|
|
320
|
-
console.log("this resets it", quiet);
|
|
321
326
|
await _wallet_overrides_set(
|
|
322
327
|
"evm-wallet",
|
|
323
328
|
wallet_name,
|
|
324
329
|
call_auth);
|
|
325
|
-
console.log("hello", quiet);
|
|
326
330
|
}
|
|
327
331
|
|
|
328
332
|
function
|
|
@@ -360,9 +364,6 @@ function
|
|
|
360
364
|
` Contract method: ${contract_method}`,
|
|
361
365
|
` Method arguments: ${method_args}`,
|
|
362
366
|
];
|
|
363
|
-
console.log(
|
|
364
|
-
"Hellooo");
|
|
365
|
-
console.log(quiet);
|
|
366
367
|
for ( _line of _text ) {
|
|
367
368
|
_msg_info(
|
|
368
369
|
_line);
|
|
@@ -703,7 +704,6 @@ async function
|
|
|
703
704
|
quiet =
|
|
704
705
|
"n";
|
|
705
706
|
}
|
|
706
|
-
console.log("quiet", quiet);
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
function
|
|
@@ -808,13 +808,9 @@ async function
|
|
|
808
808
|
|
|
809
809
|
async function
|
|
810
810
|
_main() {
|
|
811
|
-
console.log("quiet", quiet);
|
|
812
811
|
const
|
|
813
812
|
_overrides_set_up =
|
|
814
813
|
await _overrides_set();
|
|
815
|
-
console.log("now its reset", quiet);
|
|
816
|
-
console.log(quiet);
|
|
817
|
-
console.log(call_date);
|
|
818
814
|
_config_show();
|
|
819
815
|
app_opts = [
|
|
820
816
|
call_type,
|
package/evm-contracts-tools
CHANGED
|
@@ -36,6 +36,15 @@ const
|
|
|
36
36
|
_libcrash_module =
|
|
37
37
|
require(
|
|
38
38
|
"crash-js");
|
|
39
|
+
const
|
|
40
|
+
_address_check_module =
|
|
41
|
+
require(
|
|
42
|
+
"./lib/address-check");
|
|
43
|
+
/* global
|
|
44
|
+
_address_check */
|
|
45
|
+
const
|
|
46
|
+
_address_check =
|
|
47
|
+
_address_check_module._address_check;
|
|
39
48
|
const
|
|
40
49
|
_bytecode_creation_get_module =
|
|
41
50
|
require(
|
|
@@ -115,6 +124,8 @@ function
|
|
|
115
124
|
}
|
|
116
125
|
|
|
117
126
|
module.exports = {
|
|
127
|
+
_address_check:
|
|
128
|
+
_address_check,
|
|
118
129
|
_artifact_local_auto_detect:
|
|
119
130
|
_artifact_local_auto_detect,
|
|
120
131
|
_bytecode_creation_get:
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
|
|
5
|
+
/** ----------------------------------------------------------------------
|
|
6
|
+
* address-check
|
|
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 modify
|
|
16
|
+
* it under the terms of the GNU General Public License as published by
|
|
17
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
18
|
+
* (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. If not, see <https://www.gnu.org/licenses/>.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const
|
|
30
|
+
_libcrash =
|
|
31
|
+
require(
|
|
32
|
+
"crash-js");
|
|
33
|
+
/* global
|
|
34
|
+
_argv_get */
|
|
35
|
+
const
|
|
36
|
+
_argv_get =
|
|
37
|
+
_libcrash._argv_get;
|
|
38
|
+
/* global
|
|
39
|
+
_basename */
|
|
40
|
+
const
|
|
41
|
+
_basename =
|
|
42
|
+
_libcrash._basename;
|
|
43
|
+
/* global
|
|
44
|
+
_cmdline_check */
|
|
45
|
+
const
|
|
46
|
+
_cmdline_check =
|
|
47
|
+
_libcrash._cmdline_check;
|
|
48
|
+
/* global
|
|
49
|
+
_msg_info */
|
|
50
|
+
const
|
|
51
|
+
_msg_info =
|
|
52
|
+
_libcrash._msg_info;
|
|
53
|
+
/* global
|
|
54
|
+
_msg_error */
|
|
55
|
+
const
|
|
56
|
+
_msg_error =
|
|
57
|
+
_libcrash._msg_error;
|
|
58
|
+
/* global
|
|
59
|
+
_process_exit */
|
|
60
|
+
const
|
|
61
|
+
_process_exit =
|
|
62
|
+
_libcrash._process_exit;
|
|
63
|
+
const
|
|
64
|
+
{ ethers } =
|
|
65
|
+
require(
|
|
66
|
+
"ethers");
|
|
67
|
+
const
|
|
68
|
+
_ethers =
|
|
69
|
+
ethers;
|
|
70
|
+
/* global
|
|
71
|
+
_address_check */
|
|
72
|
+
const
|
|
73
|
+
_address_check =
|
|
74
|
+
_ethers.isAddress;
|
|
75
|
+
|
|
76
|
+
function
|
|
77
|
+
_global_variables() {
|
|
78
|
+
app_name =
|
|
79
|
+
"address-check";
|
|
80
|
+
/* global
|
|
81
|
+
target_address:
|
|
82
|
+
writable */
|
|
83
|
+
target_address =
|
|
84
|
+
"";
|
|
85
|
+
/* global
|
|
86
|
+
quiet:
|
|
87
|
+
writable */
|
|
88
|
+
quiet =
|
|
89
|
+
"";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function
|
|
93
|
+
_config_show() {
|
|
94
|
+
let
|
|
95
|
+
_line;
|
|
96
|
+
const
|
|
97
|
+
_argv =
|
|
98
|
+
_argv_get();
|
|
99
|
+
const
|
|
100
|
+
_program =
|
|
101
|
+
_basename(
|
|
102
|
+
_argv[
|
|
103
|
+
"$0"]);
|
|
104
|
+
const
|
|
105
|
+
_text = [
|
|
106
|
+
`${_program} configuration:`,
|
|
107
|
+
` Target address: ${target_address}`,
|
|
108
|
+
];
|
|
109
|
+
for (_line of _text) {
|
|
110
|
+
_msg_info(
|
|
111
|
+
_line);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function
|
|
116
|
+
_usage(
|
|
117
|
+
_exit) {
|
|
118
|
+
let
|
|
119
|
+
_display_fun,
|
|
120
|
+
_line;
|
|
121
|
+
const
|
|
122
|
+
_argv =
|
|
123
|
+
_argv_get();
|
|
124
|
+
const
|
|
125
|
+
_program =
|
|
126
|
+
_basename(
|
|
127
|
+
_argv[
|
|
128
|
+
"$0"]);
|
|
129
|
+
const
|
|
130
|
+
_text = [
|
|
131
|
+
"Checks whether an address is valid.",
|
|
132
|
+
"",
|
|
133
|
+
"usage:",
|
|
134
|
+
` ${_program}`,
|
|
135
|
+
" <target-address>",
|
|
136
|
+
" [options]",
|
|
137
|
+
"",
|
|
138
|
+
"args:",
|
|
139
|
+
" <target-address> Address to check.",
|
|
140
|
+
"",
|
|
141
|
+
" options:",
|
|
142
|
+
" -v --verbose Extended output.",
|
|
143
|
+
" -h --help This help."
|
|
144
|
+
];
|
|
145
|
+
for (_line of _text) {
|
|
146
|
+
_msg_info(
|
|
147
|
+
_line);
|
|
148
|
+
}
|
|
149
|
+
_process_exit(
|
|
150
|
+
_exit);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function
|
|
154
|
+
_overrides_set() {
|
|
155
|
+
true;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function
|
|
159
|
+
_cmdline_parse() {
|
|
160
|
+
quiet =
|
|
161
|
+
"y";
|
|
162
|
+
process.argv.forEach(
|
|
163
|
+
function (
|
|
164
|
+
_value,
|
|
165
|
+
_index,
|
|
166
|
+
_array) {
|
|
167
|
+
if ( _index == 2 ) {
|
|
168
|
+
target_address =
|
|
169
|
+
_value;
|
|
170
|
+
}
|
|
171
|
+
else if ( _value == "-v" ||
|
|
172
|
+
_value == "--verbose" ) {
|
|
173
|
+
quiet =
|
|
174
|
+
"n";
|
|
175
|
+
}
|
|
176
|
+
else if ( _value == "-h" ||
|
|
177
|
+
_value == "--help" ) {
|
|
178
|
+
quiet =
|
|
179
|
+
"n";
|
|
180
|
+
_usage(
|
|
181
|
+
0);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
if ( target_address == "" ) {
|
|
186
|
+
const
|
|
187
|
+
_msg =
|
|
188
|
+
"No target address specified.";
|
|
189
|
+
_msg_error(
|
|
190
|
+
_msg,
|
|
191
|
+
0);
|
|
192
|
+
quiet =
|
|
193
|
+
"n";
|
|
194
|
+
_usage(
|
|
195
|
+
1);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async function
|
|
199
|
+
_address_check_cmdline(
|
|
200
|
+
_app_opts) {
|
|
201
|
+
let
|
|
202
|
+
_is_address,
|
|
203
|
+
_msg;
|
|
204
|
+
try {
|
|
205
|
+
_is_address =
|
|
206
|
+
await _address_check.apply(
|
|
207
|
+
null,
|
|
208
|
+
_app_opts);
|
|
209
|
+
const
|
|
210
|
+
_return_type =
|
|
211
|
+
typeof(
|
|
212
|
+
_is_address);
|
|
213
|
+
if ( _return_type == "undefined" ) {
|
|
214
|
+
_msg =
|
|
215
|
+
"Big error.";
|
|
216
|
+
_msg_error(
|
|
217
|
+
_msg,
|
|
218
|
+
1);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
if ( ! _is_address ) {
|
|
222
|
+
_msg =
|
|
223
|
+
`Address '${target_address}' not is valid.'`;
|
|
224
|
+
throw _msg;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
} catch (
|
|
228
|
+
_error) {
|
|
229
|
+
_msg_error(
|
|
230
|
+
_error,
|
|
231
|
+
1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if ( _cmdline_check(
|
|
236
|
+
"address-check") ||
|
|
237
|
+
_cmdline_check(
|
|
238
|
+
"ethereum-address-validate") ) {
|
|
239
|
+
_global_variables();
|
|
240
|
+
_cmdline_parse();
|
|
241
|
+
_overrides_set();
|
|
242
|
+
_config_show();
|
|
243
|
+
app_opts = [
|
|
244
|
+
target_address,
|
|
245
|
+
];
|
|
246
|
+
_address_check_cmdline(
|
|
247
|
+
app_opts);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
module.exports = {
|
|
251
|
+
_address_check:
|
|
252
|
+
_address_check
|
|
253
|
+
};
|
|
@@ -28,21 +28,36 @@ const
|
|
|
28
28
|
_libcrash =
|
|
29
29
|
require(
|
|
30
30
|
"crash-js");
|
|
31
|
+
/* global
|
|
32
|
+
_cmdline_check */
|
|
31
33
|
const
|
|
32
34
|
_cmdline_check =
|
|
33
35
|
_libcrash._cmdline_check;
|
|
36
|
+
/* global
|
|
37
|
+
_error_display */
|
|
34
38
|
const
|
|
35
39
|
_error_display =
|
|
36
40
|
_libcrash._error_display;
|
|
41
|
+
/* global
|
|
42
|
+
_msg_info */
|
|
37
43
|
const
|
|
38
44
|
_msg_info =
|
|
39
45
|
_libcrash._msg_info;
|
|
46
|
+
/* global
|
|
47
|
+
_msg_error */
|
|
40
48
|
const
|
|
41
49
|
_msg_error =
|
|
42
50
|
_libcrash._msg_error;
|
|
51
|
+
/* global
|
|
52
|
+
_printf */
|
|
43
53
|
const
|
|
44
54
|
_printf =
|
|
45
55
|
_libcrash._printf;
|
|
56
|
+
/* global
|
|
57
|
+
_process_exit */
|
|
58
|
+
const
|
|
59
|
+
_process_exit =
|
|
60
|
+
_libcrash._process_exit;
|
|
46
61
|
const
|
|
47
62
|
{ ethers } =
|
|
48
63
|
require(
|
|
@@ -50,6 +65,8 @@ const
|
|
|
50
65
|
const
|
|
51
66
|
_ethers =
|
|
52
67
|
ethers;
|
|
68
|
+
/* global
|
|
69
|
+
_wei_to_ether */
|
|
53
70
|
const
|
|
54
71
|
_wei_to_ether =
|
|
55
72
|
_ethers.formatEther;
|
|
@@ -57,9 +74,13 @@ const
|
|
|
57
74
|
_evm_transactions_tools_module =
|
|
58
75
|
require(
|
|
59
76
|
"evm-transactions-tools");
|
|
77
|
+
/* global
|
|
78
|
+
_transaction_get */
|
|
60
79
|
const
|
|
61
80
|
_transaction_get =
|
|
62
81
|
_evm_transactions_tools_module._transaction_get;
|
|
82
|
+
/* global
|
|
83
|
+
_transaction_receipt_get */
|
|
63
84
|
const
|
|
64
85
|
_transaction_receipt_get =
|
|
65
86
|
_evm_transactions_tools_module._transaction_receipt_get;
|
|
@@ -67,6 +88,8 @@ const
|
|
|
67
88
|
_deployer_get_module =
|
|
68
89
|
require(
|
|
69
90
|
'./deployer-get');
|
|
91
|
+
/* global
|
|
92
|
+
_deployer_get */
|
|
70
93
|
const
|
|
71
94
|
_deployer_get =
|
|
72
95
|
_deployer_get_module._deployer_get;
|
|
@@ -327,7 +350,7 @@ function
|
|
|
327
350
|
_msg_info(
|
|
328
351
|
_line);
|
|
329
352
|
}
|
|
330
|
-
|
|
353
|
+
_process_exit(
|
|
331
354
|
_exit);
|
|
332
355
|
}
|
|
333
356
|
|
|
@@ -341,6 +364,9 @@ function
|
|
|
341
364
|
|
|
342
365
|
function
|
|
343
366
|
_cmdline_parse() {
|
|
367
|
+
let
|
|
368
|
+
_error,
|
|
369
|
+
_msg;
|
|
344
370
|
quiet =
|
|
345
371
|
"y";
|
|
346
372
|
process.argv.forEach(
|
|
@@ -397,18 +423,23 @@ function
|
|
|
397
423
|
}
|
|
398
424
|
}
|
|
399
425
|
);
|
|
426
|
+
_error =
|
|
427
|
+
false;
|
|
400
428
|
if ( transaction_deployment == "" ) {
|
|
401
|
-
|
|
402
|
-
"No deployment transaction specified."
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
"n";
|
|
406
|
-
_usage(
|
|
407
|
-
1);
|
|
429
|
+
_msg =
|
|
430
|
+
"No deployment transaction specified.";
|
|
431
|
+
_error =
|
|
432
|
+
true;
|
|
408
433
|
}
|
|
409
434
|
if ( contract_bytecode_path == "" ) {
|
|
435
|
+
_msg =
|
|
436
|
+
"No contract bytecode path specified.";
|
|
437
|
+
_error =
|
|
438
|
+
true;
|
|
439
|
+
}
|
|
440
|
+
if ( _error ) {
|
|
410
441
|
_msg_error(
|
|
411
|
-
|
|
442
|
+
_msg,
|
|
412
443
|
0);
|
|
413
444
|
quiet =
|
|
414
445
|
"n";
|
package/lib/bytecode-runtime-get
CHANGED
|
@@ -52,17 +52,22 @@ const
|
|
|
52
52
|
_msg_info */
|
|
53
53
|
const
|
|
54
54
|
_msg_info =
|
|
55
|
-
_libcrash._msg_info
|
|
55
|
+
_libcrash._msg_info;
|
|
56
56
|
/* global
|
|
57
57
|
_msg_error */
|
|
58
58
|
const
|
|
59
59
|
_msg_error =
|
|
60
|
-
_libcrash._msg_error
|
|
60
|
+
_libcrash._msg_error;
|
|
61
61
|
/* global
|
|
62
62
|
_printf */
|
|
63
63
|
const
|
|
64
64
|
_printf =
|
|
65
|
-
_libcrash._printf
|
|
65
|
+
_libcrash._printf;
|
|
66
|
+
/* global
|
|
67
|
+
_process_exit */
|
|
68
|
+
const
|
|
69
|
+
_process_exit =
|
|
70
|
+
_libcrash._process_exit;
|
|
66
71
|
const
|
|
67
72
|
_contract_get_module =
|
|
68
73
|
require(
|
|
@@ -71,7 +76,7 @@ const
|
|
|
71
76
|
_contract_get */
|
|
72
77
|
const
|
|
73
78
|
_contract_get =
|
|
74
|
-
_contract_get_module._contract_get
|
|
79
|
+
_contract_get_module._contract_get;
|
|
75
80
|
const
|
|
76
81
|
_evm_wallet_module =
|
|
77
82
|
require(
|
package/libevm-contract-call
CHANGED
|
@@ -69,56 +69,73 @@ const
|
|
|
69
69
|
_dirname */
|
|
70
70
|
/* eslint-disable-next-line
|
|
71
71
|
no-global-assign */
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
const
|
|
73
|
+
_dirname =
|
|
74
|
+
_libcrash_module._dirname;
|
|
74
75
|
/* global
|
|
75
76
|
_file_exists */
|
|
76
77
|
/* eslint-disable-next-line
|
|
77
78
|
no-global-assign */
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
const
|
|
80
|
+
_file_exists =
|
|
81
|
+
_libcrash_module._file_exists;
|
|
80
82
|
/* global
|
|
81
83
|
_homedir_get */
|
|
82
84
|
/* eslint-disable-next-line
|
|
83
85
|
no-global-assign */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
const
|
|
87
|
+
_homedir_get =
|
|
88
|
+
_libcrash_module._homedir_get;
|
|
86
89
|
/* global
|
|
87
90
|
_json_read */
|
|
88
91
|
/* eslint-disable-next-line
|
|
89
92
|
no-global-assign */
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
const
|
|
94
|
+
_json_read =
|
|
95
|
+
_libcrash_module._json_read;
|
|
92
96
|
/* global
|
|
93
97
|
_lib_get */
|
|
94
98
|
/* eslint-disable-next-line
|
|
95
99
|
no-global-assign */
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
const
|
|
101
|
+
_lib_get =
|
|
102
|
+
_libcrash_module._lib_get;
|
|
98
103
|
/* global
|
|
99
104
|
_msg_info */
|
|
100
105
|
/* eslint-disable-next-line
|
|
101
106
|
no-global-assign */
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
const
|
|
108
|
+
_msg_info =
|
|
109
|
+
_libcrash_module._msg_info;
|
|
104
110
|
/* global
|
|
105
111
|
_msg_error */
|
|
106
112
|
/* eslint-disable-next-line
|
|
107
113
|
no-global-assign */
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
const
|
|
115
|
+
_msg_error =
|
|
116
|
+
_libcrash_module._msg_error;
|
|
110
117
|
/* global
|
|
111
118
|
_path_join */
|
|
112
119
|
/* eslint-disable-next-line
|
|
113
120
|
no-global-assign */
|
|
114
|
-
|
|
115
|
-
|
|
121
|
+
const
|
|
122
|
+
_path_join =
|
|
123
|
+
_libcrash_module._path_join;
|
|
116
124
|
/* global
|
|
117
125
|
_range */
|
|
118
126
|
/* eslint-disable-next-line
|
|
119
127
|
no-global-assign */
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
const
|
|
129
|
+
_range =
|
|
130
|
+
_libcrash_module._range;
|
|
131
|
+
const
|
|
132
|
+
_evm_contracts_tools_module =
|
|
133
|
+
require("./evm-contracts-tools");
|
|
134
|
+
/* global
|
|
135
|
+
_address_check */
|
|
136
|
+
const
|
|
137
|
+
_address_check =
|
|
138
|
+
_evm_contracts_tools_module._address_check;
|
|
122
139
|
|
|
123
140
|
const
|
|
124
141
|
_ethereum_data_module =
|
|
@@ -337,6 +354,8 @@ function
|
|
|
337
354
|
}
|
|
338
355
|
|
|
339
356
|
module.exports = {
|
|
357
|
+
_address_check:
|
|
358
|
+
_address_check,
|
|
340
359
|
_artifact_local_auto_detect:
|
|
341
360
|
_artifact_local_auto_detect,
|
|
342
361
|
_call_auth_auto_detect:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{ "name": "evm-contracts-tools",
|
|
2
2
|
"version":
|
|
3
|
-
"0.0.
|
|
3
|
+
"0.0.34",
|
|
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": {
|
|
@@ -10,11 +10,17 @@
|
|
|
10
10
|
"https://patreon.com/tallero"
|
|
11
11
|
},
|
|
12
12
|
"man": [
|
|
13
|
+
"./man/ethereum-address-validate.1",
|
|
14
|
+
"./man/evm-contract-bytecode-get.1",
|
|
15
|
+
"./man/evm-contract-deployer-get.1",
|
|
16
|
+
"./man/evm-contract-deployment-address.1",
|
|
17
|
+
"./man/evm-contract-call.1",
|
|
13
18
|
"./man/evm-contract-call-dynamic.1"
|
|
14
19
|
],
|
|
15
20
|
"files": [
|
|
16
21
|
"AUTHORS.rst",
|
|
17
22
|
"COPYING",
|
|
23
|
+
"Makefile",
|
|
18
24
|
"README.md",
|
|
19
25
|
"dist",
|
|
20
26
|
"evm-contract-call",
|
|
@@ -86,9 +92,9 @@
|
|
|
86
92
|
"evm-transactions-tools":
|
|
87
93
|
"^0.0.9",
|
|
88
94
|
"evm-wallet.js":
|
|
89
|
-
"^0.0.
|
|
95
|
+
"^0.0.50",
|
|
90
96
|
"libevm":
|
|
91
|
-
"^0.0.
|
|
97
|
+
"^0.0.27",
|
|
92
98
|
"yargs":
|
|
93
99
|
"18.0.0"
|
|
94
100
|
},
|
|
@@ -96,7 +102,7 @@
|
|
|
96
102
|
"evm-contracts-tools":
|
|
97
103
|
"^0.0.32",
|
|
98
104
|
"evm-wallet.js":
|
|
99
|
-
"^0.0.
|
|
105
|
+
"^0.0.50"
|
|
100
106
|
},
|
|
101
107
|
"type":
|
|
102
108
|
"commonjs",
|
|
@@ -104,6 +110,8 @@
|
|
|
104
110
|
"evm-contracts-tools",
|
|
105
111
|
"bin":
|
|
106
112
|
{
|
|
113
|
+
"ethereum-address-validate":
|
|
114
|
+
"lib/address-check",
|
|
107
115
|
"evm-contract-call":
|
|
108
116
|
"evm-contract-call",
|
|
109
117
|
"evm-contract-call.js":
|
|
@@ -119,12 +127,14 @@
|
|
|
119
127
|
"npx webpack --mode 'production' --config 'libevm-contract-call.webpack.config.cjs' --stats-error-details && mv 'libevm-contract-call.js' 'dist/libevm-contract-call'",
|
|
120
128
|
"build-bin":
|
|
121
129
|
"npx webpack --mode 'production' --config 'evm-contract-call.webpack.config.cjs' --stats-error-details && mv 'evm-contract-call.js' 'dist/evm-contract-call' && npx webpack --mode 'production' --config 'webpack.config.cjs' --stats-error-details && mv 'evm-contracts-tools.js' 'dist/evm-contracts-tools'",
|
|
130
|
+
"build-man":
|
|
131
|
+
"make build-man",
|
|
122
132
|
"build":
|
|
123
|
-
"npm run lint && npm run build-fs-worker && npm run build-lib",
|
|
133
|
+
"npm run lint && npm run build-fs-worker && npm run build-lib && npm run build-bin",
|
|
124
134
|
"lint":
|
|
125
135
|
"npx eslint .",
|
|
126
|
-
"publish-
|
|
127
|
-
"npm run build && npm publish --access public",
|
|
136
|
+
"publish-npm":
|
|
137
|
+
"npm run build-man && npm run build && npm publish --access public",
|
|
128
138
|
"start":
|
|
129
139
|
"npx safely-serve --help # index.html --port 3000 --https --no-cache",
|
|
130
140
|
"test":
|