1

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;
        }
| improve this 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.

| improve this answer | | | | |
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.

| improve this answer | | | | |

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