Skip to main content

CosmWasm overview

Safrochain runs CosmWasm via the wasm module. App developers write contracts in Rust, compile to .wasm, and call them from CosmJS or REST.

Rust vs Go

Rust builds CosmWasm contracts. Go builds safrochaind chain modules (tokenfactory, feepay). App developers use Rust for contracts; Go docs live under Infra.

Lifecycle

StepWhoTool
Store codeDeployersafrochaind tx wasm store
InstantiateDeployerinstantiate / instantiate2
ExecuteUsers / dAppsMsgExecuteContract
QueryAnyoneREST smart query

Real on-chain examples

ContractUse
SafHandle registry@name → address
FeePaySponsored transaction fees
ClockTime-based contract logic

Curriculum

  1. Build in Rust
  2. Deploy and manage
  3. Interact from apps
  4. Local dev and testing