Recall & Review
beginner
What is storage in blockchain smart contracts?
Storage is a persistent place where data is saved on the blockchain. It keeps data between function calls and transactions, but it costs more gas to use.
Click to reveal answer
beginner
What does memory mean in smart contract functions?
Memory is a temporary place to hold data during a function call. It is erased after the function finishes and costs less gas than storage.
Click to reveal answer
intermediate
Explain calldata in the context of smart contracts.
Calldata is a special read-only area where function arguments are stored. It is cheaper than memory and storage and cannot be changed inside the function.
Click to reveal answer
beginner
Which data location is the most expensive to use in terms of gas?
Storage is the most expensive because it saves data permanently on the blockchain.
Click to reveal answer
intermediate
When should you use memory instead of storage?
Use memory when you only need data temporarily inside a function and don't want to save it permanently. This saves gas.
Click to reveal answer
Which data location is read-only and cheaper than memory?
✗ Incorrect
Calldata is read-only and cheaper than memory because it holds function arguments without copying them.
Where is data stored permanently in a smart contract?
✗ Incorrect
Storage saves data permanently on the blockchain, unlike memory or calldata.
Which data location is erased after a function call ends?
✗ Incorrect
Memory is temporary and erased after the function finishes.
Why should you avoid using storage for temporary data?
✗ Incorrect
Storage costs more gas because it writes data permanently to the blockchain.
Which data location is best for passing function arguments without modification?
✗ Incorrect
Calldata is ideal for passing arguments because it is read-only and cheaper.
Describe the differences between storage, memory, and calldata in smart contracts.
Think about cost, lifetime, and mutability of data.
You got /4 concepts.
Explain why choosing the right data location matters for gas costs in blockchain programming.
Consider how long data lives and how often it changes.
You got /4 concepts.