Address-related functions
Chapter 3, Introducing Solidity focused on introducing major data types in Solidity, including the ubiquitous address type. This is probably one of the most used data types in smart contracts. Address types provide multiple methods, which were not discussed in Chapter 3, because of their close association with contracts and functions. It is time to introduce all methods and properties supported by the address
type.
The address
data type provides five functions and a single property. The only property provided by address
is the balance
property, which provides the balance available in an account (contract or individual) in wei denomination, as shown in the following code snippet:
<<account>>.balance ;
It is important to note the preceding code should be modified while getting the balance from the contract address, as shown next. this
is a special keyword in Solidity and refers to the current contract. It can only be used within a contract...