Open hats-bug-reporter[bot] opened 7 months ago
since when missing NatSpec is a medium issue? it's not even low, it's just informational
Oh it was a mistake , it is low however because missing a lot of information on code natspec is similar to missing docs for code which can cause confusion about what code does to the layman who wants to use the protocol and wants ti just get hang of the logic .
Github username: @0xumarkhatab Twitter username: 0xumarkhatab Submission hash (on-chain): 0x34dfd0b14461cad13c070e7c5de7e5e7fd112b7044b590a154f0279a839e563a Severity: medium
Description: Description\
Most of the contracts and functions in the audited code base lack documentation. This hinders reviewers’ understanding of the code’s intention, which is fundamental to correctly assess not only security, but also correctness. Additionally, docstrings improve readability and ease maintenance. They should explicitly explain the purpose or intention of the functions, the scenarios under which they can fail, the roles allowed to call them, the values returned and the events emitted.
Consider thoroughly documenting all functions (and their parameters) that are part of the contracts’ public API. Functions implementing sensitive functionality, even if not public, should be clearly documented as well. When writing docstrings, consider following the Ethereum Natural Specification Format (NatSpec).
Additionally, the OpenZeppelin team found a notable lack of comments throughout the audited code. Well-commented code not only improves audit speed and depth, but it also helps to reveal what developer intentions may be and thus helps identify issues of misalignment between intention and implementation. Without comments, identifying issues in the code is much more difficult. Aside from benefiting auditors, code comments also benefit future developers and users, by clearly defining the functionality of the code and by reducing the risk of bugs.
Consider thoroughly commenting the existing code, and adding regular commenting to the software development process. We specifically recommend commenting every line of assembly code and commenting all complex math operations.
Some are listed here for reference .
some contains documentation but missing naspec of one or tow or all params .
Attack Scenario\ Please check the detail section
Attachments
Proof of Concept (PoC) File N/A
Revised Code File (Optional) N/A