Crates.io | piecrust |
lib.rs | piecrust |
version | 0.27.0-rc.1 |
source | src |
created_at | 2022-10-03 09:29:53.181335 |
updated_at | 2024-12-04 08:58:05.790969 |
description | Dusk's virtual machine for running WASM smart contracts. |
homepage | |
repository | https://github.com/dusk-network/piecrust |
max_upload_size | |
id | 678870 |
size | 293,115 |
WASM virtual machine for running Dusk's smart contracts.
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
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
To see the release history for this crate, please see the CHANGELOG file.
This code is licensed under the Mozilla Public License Version 2.0 (MPL-2.0). Please see the LICENSE for further details.
If you want to contribute to this project, please check the CONTRIBUTING file.