#smart-contracts #vm #virtual

no-std piecrust

Dusk's virtual machine for running WASM smart contracts

69 releases (28 breaking)

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

#387 in Magic Beans

Download history 12/week @ 2024-12-25 25/week @ 2025-01-01 24/week @ 2025-01-08 198/week @ 2025-01-15 37/week @ 2025-01-22 80/week @ 2025-01-29 404/week @ 2025-02-05 133/week @ 2025-02-12 433/week @ 2025-02-19 65/week @ 2025-02-26 27/week @ 2025-03-05 191/week @ 2025-03-12 251/week @ 2025-03-19 114/week @ 2025-03-26 80/week @ 2025-04-02 133/week @ 2025-04-09

619 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
~694K SLoC