Access Control
- Caller checks. get_caller_address gates privileged functions: assert against stored owners and roles.
- Role components. Access-control components supply roles and admin transfer: audited machinery, mounted.
- Zero-address hygiene. The zero address is checked at boundaries: default values never becoming owners.
Contract Threats
- Familiar classes. Starknet inherits the classics: access flaws, oracle games, reentrancy: plus its own quirks.
- felt arithmetic care. Field arithmetic wraps differently than integers: bounded types and checks where money moves.
- L1-L2 messaging risks. Cross-layer messages arrive asynchronously: ordering and replay handled by design.
Secure Starknet Design
- Checks-effects-interactions again. The ordering discipline transfers: state settled before external calls, always.
- Upgrade governance. Class-hash upgrades sit behind timelocks and multisigs: the power users must be able to read.
- Audit process. Security remains a process: threat model, tests, review, audit: never a checkbox.
Before and after this level
- Before: Level 10: Testing: Cairo Tests, Starknet Contract Tests, Failure and Edge Cases.
- Next: Level 12: Proof-Oriented Execution: Sierra and CASM Concepts, Provable Computation, Understanding Cairo's Unique Runtime.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Cairo Level 11: Security cover?
Access Control, Contract Threats, Secure Starknet Design: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 10: Testing, which covers Cairo Tests, Starknet Contract Tests, Failure and Edge Cases.