Docs | Installation | Tutorials | Cargo Odra | Claude Code Plugin | Discord | Blog
This repository is the framework crate itself. You do not clone it to write contracts —
you scaffold a project with Cargo Odra and depend on
odra from crates.io.
# 1. Rust toolchain with the wasm target (see https://rustup.rs)
rustup target add wasm32-unknown-unknown
# 2. The project generator / build tool
cargo install cargo-odra --locked
# 3. A new project
cargo odra new --name my_project && cd my_project
cargo odra testFull instructions, including the wasm-strip and wasm-opt prerequisites, are in the
Installation guide. On Ubuntu or WSL, use
Ubuntu / WSL setup — the same steps with
exact commands, including the binaryen version apt is too old to give you.
If you use Claude Code, install the Odra plugin. It teaches the agent Odra's APIs, project layout and tooling, so it scaffolds, writes, tests and deploys contracts the way this framework expects instead of guessing:
/plugin marketplace add odradev/odradev-plugins
/plugin install odra-plugin@odradev-plugins
Agents without the plugin should read https://odra.dev/llms.txt first — it is an index of the whole documentation set.
Use Cargo Odra to generate, build and test you code.
use odra::prelude::*;
#[odra::module]
pub struct Flipper {
value: Var<bool>,
}
#[odra::module]
impl Flipper {
pub fn init(&mut self) {
self.value.set(false);
}
pub fn set(&mut self, value: bool) {
self.value.set(value);
}
pub fn flip(&mut self) {
self.value.set(!self.get());
}
pub fn get(&self) -> bool {
self.value.get_or_default()
}
}
#[cfg(test)]
mod tests {
use crate::flipper::Flipper;
use odra::host::{Deployer, NoArgs};
#[test]
fn flipping() {
let env = odra_test::env();
let mut contract = Flipper::deploy(&env, NoArgs);
assert!(!contract.get());
contract.flip();
assert!(contract.get());
}
}Checkout our examples. It shows most of Odra features.
Before running tests make sure you have following packages installed:
- Rust toolchain (see rustup.rs) with
wasm32-unknown-unknowntarget. cargo-odrawith its dependencies (see Cargo Odra)just(see just)
Run tests:
$ just test- Odra Book - Docs and Tutorials — source: odradev/odradev.github.io
- API Documentation
- Cargo Odra — the
cargo odraproject generator and build tool - Odra Claude Code Plugin — skills for agentic Odra development
- llms.txt — documentation index for LLM agents
- Example Contracts
Need some help? Write to contract@odra.dev.
