Sitemap
Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Follow publication

Member-only story

Hitchhikers Guide to the EVM

Alex Roan
7 min readAug 24, 2021

--

This article is a write-up of a talk presented at SmartCon #1.

Gas golfing is the process of optimizing the existing functionality of a smart contract without actually changing what it does. Specifically, optimising a contract’s use of storage is where some of the biggest wins can be found. With that being said…

What is storage in Solidity?

Storage is any data that is persistent between transactions. It is often stored for extended periods of time and can be accessed in future transactions. In other languages, we might call these “Instance Variables” or “Class Variables”.

s_index is a storage variable

There is a catch with storage variables, though. They are, in fact, one of the most expensive things that a contract can play around with.

Why is Storage Expensive?

To explain why this is the case in a decentralized world, let’s first imagine a centralized one.

On a centralized server, storage is stored in a single place, usually a database. It’s predictable, so as more users use this…

--

--

Alex Roan
Alex Roan

Written by Alex Roan

CoFounder at Cyfrin. Previously: Chainlink Labs.