#smart-contracts #virtual #machine #vm

no-std piecrust

Dusk's virtual machine for running WASM smart contracts

67 releases (28 breaking)

new 0.28.0 Mar 19, 2025
0.28.0-rc.3 Feb 11, 2025
0.27.0 Dec 18, 2024
0.27.0-rc.0 Nov 26, 2024
0.0.0 Oct 3, 2022

#336 in Magic Beans

Download history 144/week @ 2024-11-30 132/week @ 2024-12-07 258/week @ 2024-12-14 69/week @ 2024-12-21 9/week @ 2024-12-28 31/week @ 2025-01-04 138/week @ 2025-01-11 87/week @ 2025-01-18 39/week @ 2025-01-25 236/week @ 2025-02-01 313/week @ 2025-02-08 331/week @ 2025-02-15 176/week @ 2025-02-22 59/week @ 2025-03-01 72/week @ 2025-03-08 253/week @ 2025-03-15

697 downloads per month
Used in 4 crates (2 directly)

MPL-2.0 license

260KB
5.5K SLoC

π-crust

Repository Build Status Documentation

WASM virtual machine for running Dusk's smart contracts.

Usage

use piecrust::VM;
let mut vm = VM::ephemeral().unwrap();

let bytecode = /*load bytecode*/;

let mut session = vm.session(SessionData::builder())?;
let contract_id = session.deploy(bytecode).unwrap();

let result = session.call::<i16, i32>(contract_id, "function_name", &0x11)?;

// use result

Build and Test

To build and test the crate one will need a Rust toolchain, Make, and the wasm-tools binary.

sudo apt install -y make # ubuntu/debian - adapt to own system
cargo install wasm-tools
make test

Release History

To see the release history for this crate, please see the CHANGELOG file.

License

This code is licensed under the Mozilla Public License Version 2.0 (MPL-2.0). Please see the LICENSE for further details.

Contribute

If you want to contribute to this project, please check the CONTRIBUTING file.

Dependencies

~27–38MB
~702K SLoC