August 2019
Intermediate to advanced
486 pages
13h 52m
English
The first line of a Solidity contract always starts with defining the pragma solidity version. This indicates the Solidity compiler version, using which the code should be compiled. The pragma is defined as follows:
// Bad Practicepragma solidity ^0.5.0;
The preceding code signifies that the code should be compiled with any Solidity version starting from 0.5.0 to 0.5.x because the version starts with a ^ (caret sign). For example, if the latest compiler version of Solidity available is 0.5.8, then the contract can be compiled with any compiler version between 0.5.0 and 0.5.8.
It is always recommended that pragma should be fixed to the version that you are intending to deploy your contracts with. The contracts should ...