Skip to main content

Writing a Smart Contract

A Mazzaroth Smart Contract is a WebAssembly binary that defines the functions that may be called by transactions submitted to the channel and how data is stored in state for that channel. There are many different ways to write code that can be compiled to WebAssembly. The requirement for it to be considered a Mazzaroth Smart Contract is that it includes a main function and handles the input object correctly.

We currently support Mazzaroth Smart Contracts written in Rust by leveraging the mazzaroth-rs library with support for more languages on the horizon.

You can easily get started by using Mazzaroth Studio, the online IDE. It allows you to start a new project from a template and then build and download the compiled WASM module that can be deployed as a Smart Contract.

After selecting a template, such as "Hello World", clicking the Build button will compile the contract to a binary wasm file and provide an abi.json for your contract.

The Download button can be used to download all working files, including the built files in the target directory.

Interacting with a Node

This guide will walk you through interacting with a Mazzaroth node. Standalone and Gateway nodes use HTTP to handle requests and can be used to deploy contracts, submit transactions, or lookup information from the ledger.

m8 is a command line tool to allow users to easily interact with Mazzaroth nodes.