#virtual #machine #smart #contract #wasm

nightly no-std piecrust-uplink

Build smart contracts directly on top of Dusk’s piecrust virtual machine

2 releases

0.1.0 Mar 15, 2023
0.1.0-alpha Feb 6, 2023

#1942 in Magic Beans

Download history 59/week @ 2023-02-06 13/week @ 2023-02-13 13/week @ 2023-02-20 10/week @ 2023-02-27 9/week @ 2023-03-06 30/week @ 2023-03-13

67 downloads per month
Used in piecrust

MPL-2.0 license

26KB
664 lines

π-crust

Repository Build Status Documentation

WASM virtual machine handling Dusk's smart contracts.

Usage

use piecrust::{Error, VM};

let bytecode = // load module bytecode ;

let mut vm = VM::ephemeral()?;
let module_id = vm.deploy(bytecode)?;

let mut session = vm.session();
let result = session.transact::<i16, i32>(module_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

Dependencies

~1.8–2.4MB
~51K SLoC