-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing entries in devdoc / userdoc [natspec] #1141
Comments
|
@hitchcott would you be interested in helping to design a better version of the natspec? I'm thinking a combined user/devdoc. |
Sounds good @axic, I am actively working on doxity and there's good opportunity to explore what is needed. What's the best way for me to help with this - should I draft an EIP? |
@hitchcott we could have a chat on gitter with anyone interested in this topic. Also please check https://github.com/ethereum/wiki/wiki/Ethereum-Natural-Specification-Format first as that defines the |
@axic @hitchcott After your chat on gitter, could an EIP be written to make it clear? (The wikis are mostly old.) One part I'm wary of is if returns are going to need to be named, like: For these named returns to be used wider, I think Solidity should be much stricter to prevent misuse: example #1401 |
Note that the only purpose of This means that comments applying to the contract itself should probably automatically go to the The Method parameters should probably go to both the dev docs and the user docs. |
/// @notice In the example above, it uses an explicit return 100. To convey that the 100 is balanceInmGAV, is an unused variable balanceInmGAV needed? Can we do something like this instead, where we move balanceInmGAV to be strictly a comment? I don't understand this example much, but my point is comments should remain as comments and should not require introducing an unused variable in code. |
Sometimes, you need the ability to refer to individual elements of the return tuple. The example is bad, though, I agree. |
For refering to tuple elements, just an idea:
The comment (balance, nonce, counter) is matched against the tuple (uint256, uint256, uint256). With tuples, an explicit return might even be more important for clarity:
|
Actually I think |
What's the status of this? There's an annoying problem with functions which have unused arguments because they're meant to be overriden: if you remove the argument name so as to silence the warning, it's impossible to add |
Would also like to know the status of this particularly:
|
Please add these items to the checklist in the original message:
Also, I think you can safely check off the item "parameter names." The devdoc output from v0.4.24 is showing parameter names:
And, with the merging of #4542 , it seems that you can also check off "constructor." Also, @chriseth , you mentioned above that |
The wiki is unmaintained. |
Any updates on multiple return values? Leaning towards implementing an approach where Is there any more pushback for supporting named return values as well? That way we can use them as keys instead of relying on the order of the tuple, i.e. making it easier to deal with verifying nested tuple types. |
I think we have specific issues now for everything, as well as the natspec project: https://github.com/ethereum/solidity/projects/42 Is there anything else missing from there? Can we close this issue? |
In comments above, I had asked for these things to be added to this issue:
I'd still like to see those happen (if they haven't already) but I really don't care whether they're tracked in this issue or elsewhere. |
@feuGeneA Could you please create new separate issues for them? We have found that individual issues work better nowadays. |
As an update, I think this issue can now be closed as parts are tracked elsewhere.
|
Natspec:
The text was updated successfully, but these errors were encountered: