Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Wrong documentation of the function `getPassword()` about the parameter `newPassword`

Summary

  • Wrong documentation of the function getPassword() about the parameter newPassword must be removed because it is not taking any parameter and it is misleading the reader.

Vulnerability Details

/*
* @notice This allows only the owner to retrieve the password.
@> * @param newPassword The new password to set.
*/
function getPassword() external view returns (string memory) {
if (msg.sender != s_owner) {
revert PasswordStore__NotOwner();
}
return s_password;
}
  • In this function, we are not giving the parameters. but, documentation mention above the function shows that it takes the parameter newPassword .

Impact

  • Can cause the misleading information and blur the understanding of the code.

Tools Used

  • Manual review

Recommendations

/*
* @notice This allows only the owner to retrieve the password.
- * @param newPassword The new password to set.
*/
function getPassword() external view returns (string memory) {
if (msg.sender != s_owner) {
revert PasswordStore__NotOwner();
}
return s_password;
}
  • Remove the documentation of the parameter newPassword from the function getPassword().

Updates

Lead Judging Commences

inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.