Concept Flow - Storage vs memory vs calldata
Function Call
Parameters Passed
Calldata (Read-only, cheap)
Memory (Temporary, modifiable)
Storage (Persistent, expensive)
Function Execution
End of Execution
When a function is called, inputs come as calldata (read-only). Data can be copied to memory (temporary, modifiable). Storage holds persistent data on blockchain, which is expensive to read/write.