1.6. Trivia#
Syntax#
Single Line Comments#
A single-line comment is terminated by any unicode line terminator (LF
, VF
, FF
, CR
, NEL
, LS
or PS
) in UTF-8 encoding. The terminator is still part of the source code after the comment, so if it is not an ASCII symbol (these are NEL
, LS
and PS
), it will lead to a parser error.
Multi-line Comments#
Comments starting with /*
and ending with */
are allowed to range multiple lines:
NatSpec Comments#
Additionally, there is another type of comment called a NatSpec comment. They are written with a triple slash ///
or a double asterisk block /**...*/
and they should be used directly above function declarations or statements. It is recommended that Solidity contracts are fully annotated using NatSpec for all public interfaces (everything in the ABI).
Please see the NatSpec Format section for further information.
Note
This section is under construction. You are more than welcome to contribute suggestions to our GitHub repository.