Global Variables and Functions

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 ...

Get Solidity Programming Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.