
20 Common Solidity Beginner Mistakes
20 Common Solidity Beginner Mistakes Our intent is not to be patronizing towards developers early in their journey with this article. Having reviewed code from numerous Solidity developers, we’ve seen…

Smart Contract Foundry Upgrades with the OpenZeppelin Plugin
Smart Contract Foundry Upgrades with the OpenZeppelin Plugin Upgrading a smart contract is a multistep and error-prone process, so to minimize the chances of human error, it is desirable to…

UUPS: Universal Upgradeable Proxy Standard (ERC-1822)
UUPS: Universal Upgradeable Proxy Standard (ERC-1822) The UUPS pattern is a proxy pattern where the upgrade function resides in the implementation contract, but changes the implementation address stored in the…

Try Catch and all the ways Solidity can revert
Try Catch and all the ways Solidity can revert This article describes all the kinds of errors that can happen when a smart contract is called, and how the Solidity…

The Beacon Proxy Pattern Explained
The Beacon Proxy Pattern Explained A Beacon Proxy is a smart contract upgrade pattern where multiple proxies use the same implementation contract, and all the proxies can be upgraded in…

Storage Slots in Solidity: Storage Allocation and Low-level assembly storage operations
Storage Slots in Solidity: Storage Allocation and Low-level assembly storage operations This article examines the storage architecture of the Ethereum Smart Contracts. It explains how variables are kept in the…

Invariant Testing in Foundry
Invariant Testing in Foundry Introduction In this article, we will discuss invariants and how to perform an invariant test on solidity smart contracts using foundry test suites. Invariant testing is…

Fixed Point Arithmetic in Solidity (Using Solady, Solmate, and ABDK as Examples)
Fixed Point Arithmetic in Solidity (Using Solady, Solmate, and ABDK as Examples) A fixed-point number is an integer that stores only the numerator of a fraction — while the denominator…

transparent-upgradeable-proxy
The Transparent Upgradeable Proxy Pattern Explained in Detail The Transparent Upgradeable Proxy is a design pattern for upgrading a proxy while eliminating the possibility of a function selector clash. A…

Understanding ABI encoding for function calls
Understanding ABI encoding for function calls ABI encoding is the data format used for making function calls to smart contracts. It is also how smart contracts encode data when making…

Nodelegatecall Explained
Nodelegatecall Explained The nodelegatecall modifier prevents delegatecalls from being sent to a contract. We will first show the mechanism for how to accomplish this then later discuss the motivation for…

Delegatecall: The Detailed and Animated Guide
Delegatecall: The Detailed and Animated Guide This article explains how delegatecall works in detail. The Ethereum Virtual Machine (EVM) offers four opcodes for making calls between contracts: CALL (F1) CALLCODE…

Low Level Call vs High Level Call in Solidity
Low Level Call vs High Level Call in Solidity A contract in Solidity can call other contracts via two methods: through the contract interface, which is considered a high-level call,…

Three ways to detect if an address is a smart contract
Three ways to detect if an address is a smart contract This article describes three methods in Solidity for determining if an address is a smart contract: Check if msg.sender…

ERC-1363 Standard Explained
ERC-1363 Standard Explained ERC-1363 enables a smart contract to detect and respond to an incoming transfer of tokens. What problem does ERC-1363 Solve? Suppose a user transfers an ERC-20 token…

Understanding the Function Selector in Solidity
Understanding the Function Selector in Solidity The function selector is a 4 byte id that Solidity uses to identify functions under the hood. The function selector is how a Solidity…

How ERC721 Enumerable Works
How ERC721 Enumerable Works An Enumerable ERC721 is an ERC721 with added functionality that enables a smart contract to list all the NFTs an address owns. This article describes how…

ERC20 Votes: ERC5805 and ERC6372
ERC20 Votes: ERC5805 and ERC6372 ERC20 Votes Knowledge of ERC20 Snapshot is assumed, please refer to our article on ERC20 Snapshot for an introduction to the subject. ERC20 Votes does…

The Fallback Extension Pattern
The Fallback Extension Pattern The fallback-extension pattern is a simple way to circumvent the 24kb smart contract size limit. Suppose we have functions foo() and bar() in our primary contract…

EIP 1967 Storage Slots for Proxies
EIP 1967 Storage Slots for Proxies EIP 1967 is a standard for where to store information that proxy contracts need to execute. Both the UUPS (Universal Upgradeable Proxy Standard) and…

The second preimage attack for Merkle Trees in Solidity
The second preimage attack for Merkle Trees in Solidity The second preimage attack in Merkle trees can happen when an intermediate node in a merkle tree is presented as a…

A comprehensive guide to the ERC 721 standard and related security issues
A comprehensive guide to the ERC 721 standard and related security issues ERC721 (or ERC-721) is the most widely used Ethereum standard for nonfungible tokens. It associates a unique number…

Ten beginner project ideas after you learn Solidity
Ten beginner project ideas after you learn Solidity Now that you”ve completed our solidity tutorial, what”s next? You now have enough knowledge to build any of the following projects. Knowledge…

The RareSkills Book of Solidity Gas Optimization: 80+ Tips
The RareSkills Book of Solidity Gas Optimization: 80+ Tips TABLE OF CONTENTS The RareSkills Book of Gas Optimization Gas optimization tricks do not always work Beware of complexity and readability…

Solidity Coding Standards
Solidity Coding Standards The purpose of this article is not to rehash the official Solidity Style Guide, which you should read. Rather, it is to document the common deviations from…