April 2018
Intermediate to advanced
222 pages
5h 28m
English
Any programming language provides the facility to comment code and so does Solidity. There are the following three types of comment in Solidity:
Single-line comments are denoted by a double forward slash //, while multiline comments are denoted using /* and */. Natspec has two formats: /// for single-line and a combination of /** for beginning and */ for end of multiline comments. Natspec is used for documentation purposes and it has its own specification. The entire specification is available at https://github.com/ethereum/wiki/wiki/Ethereum-Natural-Specification-Format.
Let's take a look at Solidity comments in the following code:
// This is a ...