Lesson #0, Fundamentals of Solidity Storage

Return to Writing

~7 min read

Read on Medium
  1. Lesson #0, Fundamentals of Solidity Storage
  2. Overview

Overview

If you’re not an advanced or expert Solidity developer, there’s a chance you haven’t fully grasped how Solidity handles storage. I didn’t really bother at first, but I’m glad I took some time to understand how it actually stores, remembers, and knows how to organize data on the blockchain.

I believe this can be compared to the shelving system of a library, if you consider how a librarian needs to know where each book goes to efficiently serve the visitors. It is important as a developer to understand how data is arranged to write optimized and effective smart contracts, as well as to assess some more complex data structures as a security auditor. Especially if you deal with upgradeable contracts.

In this article, I’ll seek to expose this concept with clarity, offering practical examples of how data is meticulously stored and managed in Solidity. This is the first article in my series of learnings related to smart contracts security research.


Design shamelessly forked and modified from 5/9