New to blockchain software development? Read my beginners guide here

Where you can store data in Solidity

Created on August 2022 β€’ Tags: solidityethereumguides

There are a few place you can store data in your Solidity apps, this guide will explain what they are


Table of Contents for Where you can store data in Solidity


Main 3 types of storing values/data in Solidity smart contracts

Memory

  • temporarily stored in memory, only there while your functions are running
  • not stored in blockchain
  • mutatable

Calldata

Storage

  • storage data is stored on blockchain
  • Mutable
  • costs quite a bit in gas to store new data. Costs a bit less to update existing data. Can get a gas refund for deleting (setting slot to zero value)

Other ways of storing data

  • Logs
  • Stack

This post is incomplete and a work-in-progress
I'll update it soon and flesh it out with more info!

Spotted a typo or have a suggestion to make this crypto dev article better? Please let me know!

See all posts (70+ more)

See all posts (70+ more)

Was this post helpful? πŸ“§

If you liked this content and want to receive emails about future posts like this, enter your email. I'll never spam you.

Or follow me on @CryptoGuide_Dev on twitter

By using this site, you agree that you have read and understand its Privacy Policy and Terms of Use.
Use any information on this site at your own risk, I take no responsibility for the accuracy of safety of the information on this site.