#pwasm #wasm

no-std bin+lib pwasm-utils

Collection of command-line utilities and corresponding Rust api for producing pwasm-compatible executables

33 releases (18 breaking)

0.19.0 Jan 17, 2022
0.18.2 Sep 7, 2021
0.18.1 Jun 10, 2021
0.17.0 Dec 12, 2020
0.1.4 Mar 27, 2018

#3 in #pwasm

Download history 3516/week @ 2023-12-14 2791/week @ 2023-12-21 1981/week @ 2023-12-28 2773/week @ 2024-01-04 4918/week @ 2024-01-11 4836/week @ 2024-01-18 4307/week @ 2024-01-25 2608/week @ 2024-02-01 4049/week @ 2024-02-08 4253/week @ 2024-02-15 4304/week @ 2024-02-22 4234/week @ 2024-02-29 6090/week @ 2024-03-07 5648/week @ 2024-03-14 5110/week @ 2024-03-21 3549/week @ 2024-03-28

21,066 downloads per month
Used in 51 crates (9 directly)

MIT/Apache

200KB
5.5K SLoC

pwasm-utils

⚠️ This repository/crate is deprecated and unmaintained: Switch to wasm-instrument in order to use wasm instrumentation (gas metering, stack height limiter) in your project. For wasm code optimization binaryen should be used.

A collection of WASM utilities used in pwasm-ethereum and substrate contract development.

This repository contains the package pwasm-utils which consists of a library crate and a collection of cli binaries that make use of this library.

Installation of cli tools

cargo install pwasm-utils --features cli

This will install the following binaries:

  • wasm-build
  • wasm-check
  • wasm-ext
  • wasm-gas
  • wasm-pack
  • wasm-prune
  • wasm-stack-height

Symbols pruning (wasm-prune)

wasm-prune <input_wasm_binary.wasm> <output_wasm_binary.wasm>

This will optimize WASM symbols tree to leave only those elements that are used by contract call function entry.

Gas counter (wasm-gas)

For development purposes, a raw WASM contract can be injected with gas counters (the same way as it done in the pwasm-ethereum/substrate runtime when running contracts)

wasm-gas <input_wasm_binary.wasm> <output_wasm_binary.wasm>

License

wasm-utils is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your choice.

See LICENSE-APACHE, and LICENSE-MIT for details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in wasm-utils by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.4–1.4MB
~25K SLoC