#virtual-machine #machine #virtual #smart #smart-contracts #contract

no-std piecrust

Dusk's virtual machine for running WASM smart contracts

40 releases (18 breaking)

0.18.0 Mar 27, 2024
0.17.0 Feb 28, 2024
0.14.0 Dec 13, 2023
0.13.0 Nov 22, 2023
0.0.0 Oct 3, 2022

#1588 in Magic Beans

Download history 21/week @ 2024-01-08 34/week @ 2024-01-15 16/week @ 2024-01-22 118/week @ 2024-01-29 118/week @ 2024-02-05 532/week @ 2024-02-12 837/week @ 2024-02-19 440/week @ 2024-02-26 45/week @ 2024-03-04 60/week @ 2024-03-11 168/week @ 2024-03-18 98/week @ 2024-03-25 427/week @ 2024-04-01

758 downloads per month
Used in rusk-abi

MPL-2.0 license

205KB
4.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

~25–37MB
~660K SLoC