Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit f6a1a6a Apr 10, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
cli fix identation Apr 9, 2019
examples add example Jan 24, 2019
src fix identation Apr 9, 2019
tests fix identation Apr 9, 2019
.editorconfig Add .editorconfig Nov 1, 2017
.gitignore Ignore .idea Feb 22, 2018
.travis.yml Test no_std build in CI May 15, 2018
Cargo.toml bump to 0.7.0 Apr 9, 2019
LICENSE-APACHE license Nov 2, 2017
LICENSE-MIT license Nov 2, 2017 also call/deploy update May 18, 2018


Build Status

Collection of WASM utilities used in Parity and WASM contract development

Build tools for cargo

Easiest way to use is to install via cargo install:

cargo install pwasm-utils-cli --bin wasm-build

Symbols pruning (wasm-prune)

cargo install pwasm-utils-cli --bin 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 puposes, raw WASM contract can be injected with gas counters (the same way as it done by Parity runtime when running contracts)

cargo install pwasm-utils-cli --bin wasm-gas
wasm-gas <input_wasm_binary.wasm> <output_wasm_binary.wasm>

Externalization (wasm-ext)

Parity WASM runtime provides some library functions that can be commonly found in libc. WASM binary size can be reduced and performance may be improved if these functions are used. This utility scans for invocations of the following functions inside the WASM binary:

  • _malloc,
  • _free,
  • _memcpy,
  • _memset,
  • _memmove

And then substitutes them with invocations of the imported ones. Should be run before wasm-opt for better results.

cargo install pwasm-utils-cli --bin wasm-ext
wasm-ext <input_wasm_binary.wasm> <output_wasm_binary.wasm>


All executables use corresponding api methods of the root crate and can be combined in other build tools.


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.


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.

You can’t perform that action at this time.