Skip to content
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

Add support for natspec #2501

Closed
fvictorio opened this issue Oct 27, 2017 · 4 comments
Closed

Add support for natspec #2501

fvictorio opened this issue Oct 27, 2017 · 4 comments

Comments

@fvictorio
Copy link

Solidity allows using natspec comments to provide a confirmation text to a user when they attempt to call a function of a contract. Right now, it seems like MetaMask doesn't support this. It would be nice to have it added.

See:

@WopKatan
Copy link

+1

@danfinlay
Copy link
Contributor

This would be really cool, but the docs are awful. It's unclear how to parse these natspec comments, and it's unclear if these comments are even published with the bytecode with Solidity. I'm actually pretty sure these are not published by the bytecode, they seem to only be output as a metadata file:
https://github.com/ethereum/wiki/wiki/Natspec-Example

I would love for NatSpec definitions to be published with smart contracts, but if they aren't, there's an open question for how we can trust any documents associated with a smart contract.

Closing until a solution is available for securely retrieving natspec documents from a published bytecode.

@guylando
Copy link

guylando commented May 19, 2019

@danfinlay the natspec is inside a metadata file which can be published to swarm and it IS always embedded in the contract bytecode, see:
https://solidity.readthedocs.io/en/v0.5.8/metadata.html#encoding-of-the-metadata-hash-in-the-bytecode
https://solidity.readthedocs.io/en/v0.5.8/metadata.html#usage-for-automatic-interface-generation-and-natspec
https://blog.zeppelin.solutions/deconstructing-a-solidity-contract-part-vi-the-swarm-hash-70f069e22aef
reopen?

@CJentzsch
Copy link

@danfinlay I think this is the solution to the problem: https://sourcify.dev/

MM could check whether they find a verified contract there, and if so, use the NatSpec comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants