whatisgithub

What is b20-benchmark?

fahimahmedx/b20-benchmark — explained in plain English

Analysis updated 2026-05-18

1SolidityAudience · developerComplexity · 4/5Setup · hard

In one sentence

A gas-cost benchmark comparing Base's native B20 token standard against a standard Solidity ERC-20 implementation across common token operations.

Mindmap

mindmap
  root((B20 Gas Benchmark))
    What it does
      Compares gas costs
      Native vs Solidity B20
      OpenZeppelin reference
    Tech stack
      Solidity
      Foundry
      Base
    Use cases
      Token standard comparison
      Gas optimization research
      Benchmark reproduction
    Audience
      Blockchain developers
      Base ecosystem builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Compare gas costs between Base's native B20 token standard and a Solidity reference implementation.

USE CASE 2

Decide whether to use native B20 or a custom Solidity token contract for a project on Base.

USE CASE 3

Study how zero-to-nonzero versus nonzero-to-nonzero storage writes affect gas costs on Base.

USE CASE 4

Reproduce the benchmark's methodology to test other token operations or configurations.

What is it built with?

SolidityFoundryBase

How does it compare?

fahimahmedx/b20-benchmark0xlocker/d17-contractsagus-ops/amphi
Stars110
LanguageSoliditySoliditySolidity
Setup difficultyhardhardhard
Complexity4/55/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires Base's custom Foundry build with native B20 dispatch enabled, not standard Forge, to run the native comparisons.

So what is it?

This repository is a benchmarking project that answers one specific technical question: how much computational cost, measured in a blockchain unit called gas, does Base's native B20 token standard use compared to a standard Solidity-based token implementation. B20 is a token standard built into the Base blockchain itself, an alternative to writing token logic entirely in Solidity smart contract code the way most tokens, such as the widely used ERC-20 standard, are built. The project measures four common token operations, transferring tokens, approving another address to spend them, transferring on someone else's behalf, and minting new tokens, each under several different starting conditions, such as whether the recipient already has a balance or not. It compares three implementations: Native B20 running through Base's built-in precompiled code, Base's own official Solidity reference implementation of B20, and a simple OpenZeppelin-based ERC-20 contract included as a familiar point of comparison, though it has fewer features than B20 and is not treated as a direct competitor. The results, presented as charts and tables, show that Native B20 used less gas than the Solidity reference implementation in every tested scenario, with savings ranging from about three to seventeen percent depending on the operation. The README is careful to list what this benchmark does not cover, including token creation costs, optional B20 features like pausing or permits, and real network transaction fees, and it explains in detail the technical steps taken to make sure each implementation was measured fairly using the same underlying testing tool. This is a specialized research and tooling repository for blockchain developers evaluating Base's token standards, built using Solidity and Foundry testing tools, with raw and summarized benchmark data included as CSV and JSON files.

Copy-paste prompts

Prompt 1
Walk me through running this benchmark's test commands for Native B20 and MockB20 modes.
Prompt 2
Explain why Native B20 uses less gas than the Solidity MockB20 reference implementation for transfers.
Prompt 3
Help me understand the limitations section and what this benchmark does not measure.
Prompt 4
Show me how the raw.csv and summary.csv result files in this repository are structured.

Frequently asked questions

What is b20-benchmark?

A gas-cost benchmark comparing Base's native B20 token standard against a standard Solidity ERC-20 implementation across common token operations.

What language is b20-benchmark written in?

Mainly Solidity. The stack also includes Solidity, Foundry, Base.

How hard is b20-benchmark to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is b20-benchmark for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.