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
| Step | Who | Tool |
|---|---|---|
| Store code | Deployer | safrochaind tx wasm store |
| Instantiate | Deployer | instantiate / instantiate2 |
| Execute | Users / dApps | MsgExecuteContract |
| Query | Anyone | REST smart query |
Real on-chain examples
| Contract | Use |
|---|---|
| SafHandle registry | @name → address |
| FeePay | Sponsored transaction fees |
| Clock | Time-based contract logic |