Skill based on Cairo (starkware-libs/cairo), generated from sources/cairo. Doc path: sources/cairo/docs/reference/src/components/cairo/modules/.
Cairo is a Turing-complete language for provable programs (Starknet, general computation). It uses a Rust-like syntax, Sierra as an intermediate representation, and compiles to CASM. Use this skill for writing and compiling Cairo programs and Starknet contracts, and for understanding types, traits, and linear semantics.
Core References
| Topic | Description | Reference |
|---|
| Modules and crates | Crates, modules, use, super, file layout | core-modules-and-crates |
| Functions | Signatures, mut/ref, methods, implicits, nopanic, local compilability | core-functions |
| Structs and enums | Definitions, instantiation, destructuring, match | core-structs-and-enums |
| Traits and impls | Traits, named impls (of), impl generics, dispatch | core-traits-and-impls |
| Types and generics | Type system, generics, Array, Felt252Dict, fixed arrays | core-types-and-generics |
| Linear types | Move, Copy, Drop, Destruct, Clone, snapshot (@) | core-linear-types |
| Derive and prelude | Derive macro, common traits, prelude | core-derive-and-prelude |
Features
Starknet
Tooling
Best Practices