Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 1.83 KB

File metadata and controls

68 lines (47 loc) · 1.83 KB

30 Days Of Solidity: Comments and NatSpec

Twitter Follow

Author: Vedant Chainani
June, 2022

<< Day 1 | Day 3 >>

Day X


📔 Day 2

Solidity supports both C-style and C++-style comments, Thus −

  • Any text between a // and the end of a line is treated as a comment and is ignored by Solidity Compiler.
  • Any text between the characters /and/ is treated as a comment. This may span multiple lines.
// This is a Single Line Comment
/*

This is A Multi-Line Comment
It can also Include Emojis 😃

*/

NatSpec Format

Solidity contracts can use a special form of comments to provide rich documentation for functions, return variables and more. This special form is named the Ethereum Natural Language Specification Format (NatSpec).

/// This is NatSpec Single Line Comment
/// @title This is a Title
/// @author Author Name
/// @dev Please use this in this way
/**
This is NatSpec Multi Line comment
This is Line 2
And so on....
*/

More on NatSpec - here


<< Day 1 | Day 3 >>