Category: Solidity

15 October 2025
21 minutes

The Solana Token 2022 Specification

The Solana Token 2022 Specification Token-2022 is a new backward-compatible version of the SPL Token program that supports additional features in the form of extensions. The bytecode for these extensions…

Read Article
15 October 2025
21 minutes

Time Travel Testing with LiteSVM

Time Travel Testing with LiteSVM In Solana, writing test cases that depend on the passing of time is tricky. We might want to test that something happens in our code…

Read Article
14 October 2025
15 minutes

Implementing Token Metadata with Metaplex

Implementing Token Metadata with Metaplex We introduced the Metaplex metadata standard in the previous tutorial. In this one, we’ll create an SPL token and attach metadata to it using the…

Read Article
14 October 2025
12 minutes

How Metaplex Metadata for Tokens Works

How Metaplex Metadata for Tokens Works We have deployed and interacted with SPL tokens, but none of them had a name, symbol, or any metadata attached. Instead, we identified each…

Read Article
14 October 2025
18 minutes

Basic Bank Tutorial

Basic Bank Tutorial with SPL Tokens and Anchor In this tutorial, we’ll build a simple bank program on Solana with the basic features you’d expect from a regular bank. Users…

Read Article
14 October 2025
18 minutes

Token Sale with Total Supply Tutorial

Token Sale with Total Supply Tutorial A token sale program is a smart contract that sells a specific token, usually in exchange for a native token like SOL, at a…

Read Article
13 October 2025
24 minutes

Transferring SPL Tokens with Anchor and Web3.js

Transferring SPL Tokens with Anchor and Web3.js In the previous tutorial, we learned how SPL tokens work. In this tutorial, we’ll implement a full SPL token lifecycle: create, mint, transfer,…

Read Article
13 October 2025
21 minutes

How the SPL Token Works

How the SPL Token Works Solana Program Library Token (SPL Token) is Solana’s standard for tokens: how to create tokens and how they should behave. It is Solana’s equivalent to…

Read Article
06 October 2025
8 minutes

Calculating the real reserves between two prices in the Uniswap V3 codebase

Calculating the real reserves between two prices in the Uniswap V3 codebase In previous chapters, we derived formulas to calculate the real reserves of tokens X and Y between two…

Read Article
24 September 2025
13 minutes

The Fundamental Theorem of Finite Cyclic Groups

The Fundamental Theorem of Finite Cyclic Groups The Fundamental Theorem of Cyclic Groups provides guarantees about the existence of cyclic subgroups within a cyclic group. In the context of the…

Read Article
15 September 2025
12 minutes

The constant product formula in Uniswap v3

The constant product formula in Uniswap v3 Our goal is to derive the constant product formula based on real reserves for a segment, given by $$ L^2 = (x_r+\frac{L}{\sqrt{p_u}})(y_r+L\sqrt{p_l})$$ and…

Read Article
26 August 2025
24 minutes

How Ethereum address are derived (EOAs, CREATE, and CREATE2)

How Ethereum address are derived (EOAs, CREATE, and CREATE2) On Ethereum, smart contracts can be deployed in one of three ways: An Externally Owned Account (EOA) initiates the transaction where…

Read Article
26 August 2025
12 minutes

Real reserves in Uniswap v3

Real reserves in Uniswap v3 In the last chapter, we introduced two new concepts: real reserves and virtual reserves. The real reserves of a segment are the amount of tokens…

Read Article
26 August 2025
13 minutes

Real and virtual reserves in Uniswap v3

Real and virtual reserves in Uniswap v3 Uniswap v3 uses two types of reserves: real reserves and virtual reserves. Real reserves represent the actual amount of tokens present in a…

Read Article
22 July 2025
21 minutes

ERC-6551 Standard: Token Bound Accounts (TBA)

ERC-6551 Standard: Token Bound Accounts (TBA) Introduction NFTs were originally created to represent ownership of digital or physical assets, like collectibles. However, they were limited to tracking ownership of an…

Read Article
30 June 2025
10 minutes

Square and Multiply Algorithm

Square and Multiply Algorithm The square and multiply algorithm computes integer exponents in $\mathcal{O}(\log n)$ (logarithmic time). The naive way to compute an exponent $x^n$ is to multiply $x$ by…

Read Article
03 June 2025
9 minutes

Uniswap V2 Architecture: An Introduction to Automated Market Makers

Uniswap V2 Architecture: An Introduction to Automated Market Makers Uniswap is a DeFi app that enables traders to swap one token for another in a trustless manner. It was one…

Read Article
02 June 2025
18 minutes

Multiplicative Subgroups and Primitive Elements

Multiplicative Subgroups and Primitive Elements Introduction This chapter continues our study of group theory by exploring subgroups and generators. The concept of a primitive element will be introduced at the…

Read Article
25 September 2024
22 minutes

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…

Read Article
24 September 2024
24 minutes

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…

Read Article
24 September 2024
14 minutes

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…

Read Article
25 July 2024
22 minutes

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…

Read Article
20 July 2024
13 minutes

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…

Read Article
15 July 2024
13 minutes

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…

Read Article
08 July 2024
26 minutes

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…

Read Article
10 June 2024
11 minutes

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…

Read Article
04 June 2024
11 minutes

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…

Read Article
Load More Articles