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.
Learn how Cairo’s range_check builtin lets you prove a felt fits in an unsigned range with fewer constraints, plus a runnable example.
Learn how to implement persistent state in Cairo using the Storage trait and StorageMap. This guide covers the implementation of a counter contract and the verification process using Scarb and Starkli.
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
Assuming a recent Cairo compiler and StarkNet sequencer version, storage access to the same key under concurrent requests introduces latency that is absent in single-request execution because StarkNet orders transactions sequentially. The language specification does not define isolation levels for concurrent transactions, leaving unclear whether competing st
Cairo 1.x storage schema change and unresolved rollback safety The goal is to determine whether contract storage can be safely rolled back to a previous layout after a storage schema change in Cairo 1.x. Sierra compilation enforces memory safety and bounded computation, but it does not define database-style schema migration or transactional rollback of contr