Introduction
Getting Started
1.
Basics of a Starknet contract
❱
1.1.
Storage
1.2.
Constructor
1.3.
Variables
1.4.
Visibility and Mutability
1.5.
Counter Example
1.6.
Mappings
1.7.
Errors
1.8.
Events
1.9.
Syscalls
1.10.
Strings and ByteArrays
1.11.
Storing Custom Types
1.12.
Custom types in entrypoints
1.13.
Documentation
2.
Deploy and interact with contracts
❱
2.1.
How to deploy
2.2.
Contract interfaces and Traits generation
2.3.
Calling other contracts
2.4.
Factory pattern
3.
Testing contracts
4.
Cairo cheatsheet
❱
4.1.
Felt
4.2.
LegacyMap
4.3.
Arrays
4.4.
loop
4.5.
while
4.6.
if let
4.7.
while let
4.8.
Enums
4.9.
Match
4.10.
Tuples
4.11.
Struct
4.12.
Type casting
4.13.
Dict
Components
5.
Components How-To
6.
Components Dependencies
7.
Storage Collisions
8.
Ownable
Applications
9.
Upgradeable Contract
10.
Defi Vault
11.
ERC20 Token
12.
NFT Dutch Auction
13.
Constant Product AMM
14.
TimeLock
15.
Staking
16.
Simple Storage with Starknet-js
17.
Crowdfunding Campaign
18.
AdvancedFactory: Crowdfunding
Advanced concepts
19.
Writing to any storage slot
20.
Storing Arrays
21.
Struct as mapping key
22.
Hashing
23.
Optimisations
❱
23.1.
Storage Optimisations
24.
Account Abstraction
❱
24.1.
Account Contract
25.
List
26.
Library Calls
27.
Plugins
28.
Signature Verification
Light
Rust
Coal
Navy
Ayu
Latte
Frappé
Macchiato
Mocha
Starknet by Example
English
Español
简体中文
Cairo Cheatsheet
This chapter aims to provide a quick reference for the most common Cairo constructs.