Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.18 KB

Data Location.md

File metadata and controls

26 lines (23 loc) · 1.18 KB

Reference Types & Data Location: Every reference type has an additional annotation — the data location where it is stored. There are three data locations: memory, storage and calldata

  1. memory: whose lifetime is limited to an external function call

  2. storage: whose lifetime is limited to the lifetime of a contract and the location where the state variables are stored

  3. calldata: which is a non-modifiable, non-persistent area where function arguments are stored and behaves mostly like memory. It is required for parameters of external functions but can also be used for other variables.


Slide Screenshot

055.jpg


Slide Deck

  • Reference Types -> Data Location Annotation
  • memory, storage, calldata
    • memory: function
    • storage: contract
    • calldata: non-modifiable, non-persistent, external fn parameters
  • Impact -> Scope
  • Security: Persistence

References


Tags

Calldata, Memory, Storage