1
contract MyContract {
  /// @dev Total number of coins
  public uint256 totalSupply;
}

Solc automatically creates a totaSupply() function, however the natspec comment doesn't come through. How can I do that?

1

According to the official documentation:

NatSpec currently does NOT apply to public state variables (see solidity#3418), even if they are declared public and therefore do affect the ABI.

2

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.