Does Solidity offer best practice to document parameters and return values of functions.

  • Similar to Java @param

  • Similar to Python Sphinx :param


Additionally, there is another type of comment called a natspec comment, for which the documentation is not yet written. They are written with a triple slash (///) or a double asterisk block(/** ... */) and they should be used directly above function declarations or statements. You can use Doxygen-style tags inside these comments to document functions, annotate conditions for formal verification, and provide a confirmation text which is shown to users when they attempt to invoke a function.


works like this:

/// @param p is a 'p' value
function init(uint p) {
| improve this answer | |

Since solidity is more Javascript/C-like I don't see why the best practices from these languages wouldn't be acceptable.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.