In Chapter 3, Introducing Solidity, you learned about Solidity data types in detail. Data types can be value or reference types. Some reference types such as structs and arrays also have data locations—memory and storage associated with them. Variables could be state variables or variables defined locally within functions. This chapter will focus on variables, their scoping rules, declaration and initialization, conversion rules hoisting, and variables available globally to all contracts. Some global functions will also be discussed in this chapter.
We will cover the following topics in this chapter:
- The var data type
- Variable scoping
- Variable conversion
- Variable hoisting
- Block related global variables
- Transaction related global variables
- Mathematical and cryptographic global functions
- Addressing related global variables and functions...