Questions tagged [natspec]

In Solidity, Natural Language Specification Format (NatSpec) is a special form of comments to provide rich documentation for functions, return variables and more.

Filter by
Sorted by
Tagged with
1 vote
1 answer

--solc --userdoc --devdoc File not found. Searched the following locations: ""

When trying to generate user documentation and developer documentation from the NatSpec of a smart contract with solc --userdoc --devdoc MarketPlaceCustodial.sol by following the official ...
Torof's user avatar
  • 551
1 vote
0 answers

Do I need to use NatSpec annotation to describe functions in interfaces?

I am using VS Code with Solidity extension. While adding NatSpec annotation I mentioned that NatSpec tags isn't highlighted in interfaces. For example I have my NatSpec description of function in the ...
Arkenstone's user avatar
1 vote
1 answer

Why do some developers make their base contract inherit its Interface?

Some protocols and developers inherit the contract's Interface inside of the base contract and then have the interface contain the actual NatSpec, is this simply for human readability/code ...
Rohan Nero's user avatar
  • 1,443
3 votes
2 answers

Do comments cost gas?

It is a simple question that I couldn't find an answer to with a quick google and stack search. I believe they won't cost gas but I just wanted to make sure if they do or don't.
MehmedB's user avatar
  • 253
1 vote
0 answers

NatSpec Format is `msg.sender` available?

Want to know if when documenting a function the msg.sender is available for NatSpec dynamic expressions contract Foo { /** * @notice This will foo the `msg.sender` */ function foo() external {...
T04435's user avatar
  • 121
1 vote
1 answer

solc --userdoc --devdoc NFTMarketplace.sol "NFTMarketplace.sol" is not found

When I tried to generate Documentation with solc --userdoc --devdoc NFTMarketplace.sol I get the error "NFTMarketplace.sol". It seems like solc cant find the path to my smart contract. I ...
Bobby's user avatar
  • 47
1 vote
1 answer

How to document events (Natspec)?

I am trying to add comments/documents following the Natspec. I didn't understand how to document events emitted inside a function. Is there a standard defined for this? I saw this GitHub issue but I ...
MehmedB's user avatar
  • 253
0 votes
2 answers

How to generate Natspec docs using version 0.6.x of the Solidity compiler

I'm trying to run solc --userdoc --devdoc myContract.sol to generate natspec. However, the compiler complains that the contract has a different pragma-version. In fact the contract pragma is at ^0.6....
Marlo's user avatar
  • 297
7 votes
1 answer

Natspec Commenting Style for Structs

Is there specific way to explain the variables of a struct using the Natspec format? I do something like: struct XYZ{ uint x; //Explain what it does uint y; } Is it this the right way for ...
Anshu Jalan's user avatar
2 votes
0 answers

DocstringParsingError when using natspec with internal or private functions

Ethereum's natspec mentions: You are welcome to use similar comments for your internal and private functions, but those will not be parsed. However, when documenting internal functions, I get ...
Daniel Que's user avatar
4 votes
1 answer

Is Natspec still used?

Is the natural specification format a real standard, or a mostly unused tool? I wonder if it is worth natspeccing my programs.
Tholoz's user avatar
  • 115
0 votes
3 answers

Convert natspec into human readable document

How do I convert Natspec into something that a human can easily read? Eg: HTML, Markdown, .PDF
Tom Hale's user avatar
  • 3,077