Solidity – a refresher
Note
This is by no means a comprehensive tutorial on Solidity. This section will give you enough knowledge to build a fully functional Truffle Dapp. For more information on Solidity, the documentation is very handy; check it out here: https://solidity.readthedocs.io/en/v0.4.21/. If you already have a good grasp of Solidity, you can skip the rest of this chapter and move on to Chapter 3, Choosing an Ethereum Client for Your Dapp.
In this section, we will cover Solidity basics. Further, you will find subsections for important components of Solidity. Let's start with our first component—data types.
Data types
Solidity, just like any other language, has some data types. Of them, let's first take a look at some value types. The value types in Solidity are as follows:
- bool
- int (defaults at 256 bits)
- uint (defaults at 256 bits)
- address (defaults at 160 bits); it includes, but is not limited to, the following functions:
- balance
- transfer (uint)
To hold groups of data, there are also arrays...