All Projects → iotaledger → wasplib

iotaledger / wasplib

Licence: Apache-2.0 License
No description, website, or topics provided.

Programming Languages

go
31211 projects - #10 most used programming language
rust
11053 projects
java
68154 projects - #9 most used programming language
Batchfile
5799 projects

WasmLib for Rust/Go

NOTE 1: This library allows us to compare identical Rust/Go/Java smart contracts
        to highlight the simplicity and consistency of our programming model
        along different programming languages.
      
NOTE 2: We currently use TinyGo to compile the Go smart contracts into
        functioning Wasm code. The resulting Wasm files are still about double
        the size of their Rust equivalent, and one must avoid a few unsupported
        packages for now. Having said that, all the smart contracts provided
        work 100% identical to their Rust equivalents.

WasmLib allows developers to create Rust or Go smart contracts that compile into Wasm. The interface provided by WasmLib hides the underlying complexities of the Iota Smart Contract Protocol (ISCP) as implemented by Iota's ISCP-enabled Wasp nodes. WasmLib treats the programming of smart contracts as simple access to a key/value data storage where smart contract properties, request parameters, and the smart contract state can be accessed in a universal, consistent way.

The wasmlib folder provides the interface to the ISCP through ScFuncContext and ScViewContext.

The contracts folder contains a number of example smart contracts that can be used to learn how to use ScFuncContext and ScViewContext properly. For more information on how to go about creating your own smart contracts see the README.md in this folder.

Prerequisites for using TinyGo

  • Install Go version 1.15.8. Do NOT install Go version 1.16, because it is not yet supported by TinyGo.
  • Install the latest TinyGo. You can find instructions on the TinyGo website.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].