April 2018
Intermediate to advanced
222 pages
5h 28m
English
Variables in programming refer to storage location that can contain values. These values can be changed during runtime. The variable can be used at multiple places within code and they will all refer to the value stored within it. Solidity provides two types of variable—state and memory variables. In this section, we will introduce state variables.
One of the most important aspects of Solidity contracts is state variables. It is these state variables that are permanently stored in a blockchain/Ethereum ledger by miners. Variables declared in a contract that are not within any function are called state variables. State variables store the current values of the contract. The allocated memory for a state variable is statically ...