Cairo Declare and Deploy: Separating Contract Logic from State on StarkNet
Cairo on StarkNet separates publishing bytecode from creating a contract instance. Learn how declare and deploy work, why class hashes matter, and how to verify the result.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Cairo on StarkNet separates publishing bytecode from creating a contract instance. Learn how declare and deploy work, why class hashes matter, and how to verify the result.
Cairo range checks prevent silent overflows by constraining field elements to specific bit-widths. Learn how to use fixed-size types to enforce bounds and verify them in Sierra.
Learn how to define persistent state in Cairo contracts using the storage trait, avoid common pitfalls, and verify state changes with a simple counter example.
A decision guide for Cairo 1 StarkNet contracts: when to use the declarative #[storage] struct versus manual StoragePointer access, with trade-offs, example code, and validation steps.
The goal is to enable a transaction to be gracefully aborted or bounded when execution time exceeds a safe limit. In Starknet, the Cairo‑VM enforces a gas‑based metering system, but gas limits are not a direct proxy for wall‑clock time. Moreover, once a transaction is included in a block, cancellation is only possible by failing the gas check, which is a har