#smart-contracts #blockchain #cargo #odra #create #framework #manage

bin+lib cargo-odra

A cargo utility that helps to create, manage and test your smart contracts written using Odra framework

12 releases

new 0.1.2 May 23, 2024
0.1.1 Mar 1, 2024
0.1.0 Feb 6, 2024
0.0.10 Dec 13, 2023
0.0.4 Nov 23, 2022

#1554 in Magic Beans

Download history 14/week @ 2024-02-01 4/week @ 2024-02-08 7/week @ 2024-02-15 32/week @ 2024-02-22 148/week @ 2024-02-29 14/week @ 2024-03-07 14/week @ 2024-03-14 31/week @ 2024-03-28 9/week @ 2024-04-04 55/week @ 2024-05-02 36/week @ 2024-05-09

91 downloads per month

MIT license

69KB
1.5K SLoC

cargo-odra

A cargo utility that helps to create, manage and test your smart contracts written using Odra framework.

Table of Contents

Prerequisites

  • Rust toolchain installed (see rustup.rs)
  • wasm-strip tool installed (see wabt)
  • wasm-opt tool installed (see binaryen)

Install

Use cargo to install cargo-odra:

$ cargo install cargo-odra --locked

Usage

To create a new project use init or new command:

$ cargo odra new --name myproject && cd myproject

A sample contract - Flipper - will be created for you, with some sample tests. To run them against OdraVM, simply type:

$ cargo odra test

If you want to test your code using real backend VM type:

$ cargo odra test -b casper

Commands

  • new - creates a new project in a new folder,
  • init - creates a new project in an existing, empty folder,
  • build - builds the contracts, generates wasm files,
  • test - runs tests,
  • generate - generates sample contract,
  • list-templates - lists available templates,
  • clean - removes temporary files (builders and wasm files),
  • completions - generates autocomplete script for given shell

To see exact syntax of each command, type cargo odra command_name --help.

Workspaces

cargo-odra supports workspaces. To use it, simply move your Odra.toml file into root of your workspace. If you have multiple odra crates in your workspace, put all contracts in the same Odra.toml folder.

You can use a template to create a project with workspace:

$ cargo odra new --name myproject --template workspace && cd myproject

Contact

Write contact@odra.dev

Dependencies

~37–50MB
~900K SLoC