Expressions and control structures are an integral part of any programming language and they are an important element of the Solidity language as well. Solidity provides a rich infrastructure for decision and looping constructs. It provides if...else
decision control structures and the for
, do...while
, and while
loops for looping over data variables that can be iterated. Solidity also allows us to write conditions and logical, assignment, and other types of statement any that programming language supports.
The following chapter will discuss Solidity and contract functions in detail; these are core elements for writing contracts. Blockchain is about executing and storing transactions and transactions are created when contract functions are executed. Functions can change the state of Ethereum or just return the current state. Functions that change state and those that return—current state will be discussed in detail in the following chapter.