Member-only story
All About Solidity Data Locations — Storage
Diving into storage references and smart contract storage layout.
This is Part I of the “All About Data Locations” sub-series.
In today's article, we cover in more detail an important data location in the EVM: the smart contract storage.
We will see how the layout of the contract storage works, storage
references. how to write to the contract storage in assembly. We will also use some contracts from OpenZeppelin and Compound to learn how storage
references work in practice while learning the Solidity code behind these popular contracts and protocols along the way.
Table of Content
- Introduction
- Layout of Storage
- Basics of Storage
- Interacting with Storage
- Storage pointers in function parameters
- Storage pointers in function body
- The cost of reading storage.
- Conclusion
Introduction
Understanding the storage model in Ethereum and EVM-based chain is essential for good smart contract development.