Variable Scopes and Visibility Modifiers
Get to know the different scopes and levels of visibility for variables in Solidity.
In terms of scope, Solidity supports the following three variable types:
-
State variables: Variables whose values are permanently stored in a contract’s storage. We can refer to them anywhere in the contract in which they are declared, and depending on their visibility in other contracts.
-
Local variables: Variables whose values are only stored during the execution of a function and can only be referred to within that function.
-
Globally available variables: Predefined variables that provide information about the blockchain. They can be referred to in any Solidity contract without having to declare them. ...
Types of Solidity in terms of scope