Skip to content

Natspec is sometimes not explicative #5563

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

Open
vittominacori opened this issue Mar 7, 2025 · 2 comments · May be fixed by #5636
Open

Natspec is sometimes not explicative #5563

vittominacori opened this issue Mar 7, 2025 · 2 comments · May be fixed by #5636

Comments

@vittominacori
Copy link
Contributor

🧐 Motivation
Using natspec, the @dev specification is sometimes not useful because it redirects to the interface or to other contracts. Users should explore the source code to see what the function does.

Like this (verified contract on etherscan):

Image

Image

📝 Details
It could be useful to use the @inheritdoc specification and then add a @custom:something specification to list additional details. The custom specification should also be used in docs generation.

i.e.

    /**
     * @inheritdoc IERC20
     *
     * @custom:requirements
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }
@arr00
Copy link
Contributor

arr00 commented Mar 13, 2025

Most contracts using the See {IERC...} syntax were written before the introduction of @inheritdoc. Feel free to create a PR to shift to @inheritdoc--we'll migrate over time but it's not a priority right now.

@vittominacori vittominacori linked a pull request Apr 12, 2025 that will close this issue
@vittominacori
Copy link
Contributor Author

@arr00 I would like to know your feedback on the PR #5636

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 a pull request may close this issue.

2 participants