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

Track function natspec comments #2251

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

smonicas
Copy link
Contributor

No description provided.

@montyly
Copy link
Member

montyly commented Nov 29, 2023

I think this needs more sync with the API provided by crytic-compile for the natspec.

Ex:

% cat test.sol
contract A{

        /// @dev testdev
        /// @notice testnotice
        /// @param a the parameter
	function f(uint a) public {

	}

}
slither = Slither("test.sol")

cc = slither.compilation_units[0]
a = cc.contracts[0]

filename = a.source_mapping.filename
natspec_of_a = cc.crytic_compile_compilation_unit.source_unit(filename).natspec["A"]

print(natspec_of_a) # it's a NatSpec object https://github.com/crytic/crytic-compile/blob/master/crytic_compile/utils/natspec.py#L222

print(natspec_of_a.userdoc.methods["f(uint256)"].export())

print(natspec_of_a.devdoc.methods["f(uint256)"].export())

We probably need something unified here, that can return the Natspec object (structured), and potential comments that dont follow natspec

@0xalpharush 0xalpharush marked this pull request as draft June 4, 2024 20:47
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

Successfully merging this pull request may close these issues.

None yet

2 participants