Version pragma

What is Solidity

Quoting the official documentation:

Solidity is a contract-oriented, high-level language for implementing smart contracts. It is statically typed, supports inheritance, libraries and complex user-defined types among other features.

To keep it simple, it is the underlying technology you will use to write your smart contracts. It provides a dedicated syntax to describe state and interactions between your contract and the users.

It will be the way your Spacecrypts are produced, improved, exchanged and involved in battle.


As for every software, languages do have versions. It is an iterative process, continuously adding functionalities to the language.

Amiral tip

In Solidity, release with a version matching x.0.0 or 0.x.0 may introduce breaking changes

How to use it

The last version of solidity compiler solc is 0.4.24. Version is stated at the beginning of the file with pragma solidity <version>. If you want your application to compile with the latest non-breaking version, simply add a ^ before the version number.

Amiral tip

Numbering is the same as in npm. ^ match all versions where the left-most zeros is unchanged



Change the version of this source file to match the latest version of the Solidity.
pragma solidity 0.4.20;


The last version of solidity is 0.4.24. It was written right before the exercise