Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Day 2 - Comments and NatSpec
Vedant Chainani
Vedant Chainani

Posted on • Edited on

     

Day 2 - Comments and NatSpec

This is Day2 of30 in Solidity Series
Today I Learned About Comments and NatSpec Format in Solidity.

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
Enter fullscreen modeExit fullscreen mode
/*This is A Multi-Line Comment It can also Include Emojis 😃*/
Enter fullscreen modeExit fullscreen mode

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
Enter fullscreen modeExit fullscreen mode
/**This is NatSpec Multi Line commentThis is Line 2And so on....*/
Enter fullscreen modeExit fullscreen mode

More on NatSpec -here

GitHub logo Envoy-VC / 30-Days-of-Solidity

30 Days of Solidity step-by-step guide to learn Smart Contract Development.

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
yongchanghe profile image
Yongchang He
An IoT and blockChain developer;interested in Cloud Computing;love coding...
  • Email
  • Location
    Saskatoon, Saskatchewan
  • Education
    Computer Science, master's, University of Saskatchewan
  • Joined

Thank you for sharing!

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Web3 Technical Writer ✍️ | ⛓️ Blockchain Enthusiast
  • Location
    India
  • Joined

More fromVedant Chainani

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp