1

This question already has an answer here:

When we use built-in library in solidity smart contract, why we need to use @dev and @title annotation?

My code is like below:

/**


*@title SafeMath

*@dev Math operations with safety checks that throw on error

 */

library SafeMath {



  /**

  *@dev Multiplies two numbers, throws on overflow.

  */

  function mul(uint256 a, uint256 b) internal pure returns (uint256) {

        if (a == 0) {

            return 0;
        }

marked as duplicate by Richard Horrocks, Ismael, Achala Dissanayake, Roman Frolov, flygoing Feb 15 '18 at 15:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

See the Solidity Natural Specification (NatSpec) format github for details

Solidity contracts can have a special form of comments that form the basis of the Ethereum Natural Specification Format. For a usage example please check here.

1

When we use built-in library in solidity smart contract, why we need to use @dev and @title annotation?

For generating documentation like other programming languages. Documentation parser's will read the annotations and generate corresponding html, CSS files. I'll recommend to write documentation for libraries and contracts because that will help another developer to understand methods and its functionality, instead of jumping in to the code.

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