Browse all Cairo Smart Contracts articles.
26 min read
Syscalls in Starknet In Solidity, low-level operations like reading/writing to storage, contract to contract calls, or sending messages are performed directly through inline assembly using Yul...
12 min read
Switchboard On-chain programs can’t access off-chain data directly. They rely on oracles to bring in information such as asset prices, event outcomes, or API responses. Without these oracles,...
4 min read
Formally Verifying Nonces.Sol in OpenZeppelin Nonces, which stands for "number used once" are used in digital signature schemes to prevent replay attacks. For the purposes of this article, we assume...
10 min read
Introduction to Formal Verification Formal verification is the process of mathematically proving a program adheres to a specification. This article introduces conceptually how formal verification...
3 min read
FFT Friendly Finite Fields In order to carry out the FFT algorithm in a finite field (the Number Theoretic Transform), there needs to be $k$-th roots of unity such that $k$ is a power of 2. Ideally,...
15 min read
ERC-20 Token on Starknet ERC-20 tokens on Starknet work the same way as on Ethereum. In fact, STRK (Starknet's fee token) is itself an ERC-20 token; there's no special "native" token at the protocol...
9 min read
Constructors in Cairo A constructor is a one-time-call function executed during contract deployment to initialize state variables, perform contract setup tasks, make cross-contract interactions and...
10 min read
Type Casting Type casting in Cairo is the process of converting values from one data type to another. This becomes necessary when working with Cairo's strict type system, where explicit type matching...
17 min read
Cheatcodes in Starknet Foundry A "cheatcode" in Foundry is a mechanism that allows contract tests to control environment variables such as caller address, the current timestamp, and so on. In this...
11 min read
Integers in Cairo Cairo doesn’t offer the full range of integer sizes found in Solidity. While Solidity provides integer types for every multiple of 8 bits up to 256, Cairo supports only the...
8 min read
Cairo Components Part 1 Components in Cairo behave like abstract contracts in Solidity. They can define and work with storage, events, and functions, but they can’t be deployed on their own. The...
7 min read
Function Visibility in Cairo Cairo does not have "internal" and "pure" modifiers (or any other modifiers for that matter) like Solidity does. Recall that marking an block with tells Cairo to include...