Prepare for the Blockchain Developer Certification. Master blockchain concepts with flashcards and multiple choice questions. Explanation-based learning for your success!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What distinguishes storage from memory in Solidity?

  1. Storage is temporary; memory is permanent

  2. Storage holds data only during execution

  3. Storage is a key-value store; memory is a byte-array

  4. Memory is limited to public variables

The correct answer is: Storage is a key-value store; memory is a byte-array

The correct answer highlights a fundamental difference between how data is managed in Solidity, specifically regarding storage and memory. In Solidity, storage refers to a more permanent type of data storage located on the blockchain, where all state variables are kept between function calls and transactions. This means that the data stored in storage persists indefinitely on-chain. On the other hand, memory is a temporary, volatile type of data storage that is used during the execution of a function. The data stored in memory is cleared after the function call ends. The assertion that storage is a key-value store reflects how data in the blockchain is organized. In storage, each variable is stored at a persistent location and can be accessed by its identifier, much like a key-value store. Meanwhile, memory is organized as a contiguous area of bytes where variables can be allocated temporarily during function execution. Both storage and memory are critical in Solidity programming but serve different purposes in terms of data persistence and organization. Understanding these distinctions helps developers manage resources more effectively when designing smart contracts.