Browse all Smart Contract Security articles.
13 min read
Certora Require, Assert, and Satisfy In the previous chapter, we learned that a specification is a piece of code written in CVL that describes the expected behavior of a smart contract. A...
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...
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...
17 min read
Introduction to the Cairo Language Cairo is a programming language designed for provable, verifiable computation, particularly within the context of zero-knowledge systems like Starknet, a Layer 2...
3 min read
Access Control in Cairo Access control defines who can call specific functions or modify contract behavior. This article explains how Cairo implements access control using the macro. A Review of...
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...
11 min read
Structure of a Basic Contract This article shows how to build a deployable Cairo contract for Starknet. Starting from a simple sketch, we will gradually add features to build a working contract...
13 min read
Components Part 2: OpenZeppelin ERC-20 Tutorial In Component Part 1, we learned how to create and use a component within a single file. We built a from scratch and integrated its storage, events, and...
15 min read
Cairo Storage Variable Types In Starknet, Contract Storage is the persistent memory where your smart contract's state lives. Unlike variables declared inside a function which disappear after...
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...
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...