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

Incorrect Function Call in Natspec Documentation

Summary

The Natspec documentation for the getNonce function suggests calling entrypoint.getNonce(address(this), 0), but the actual code in the function body calls i_entryPoint.getNonce(address(this), 0). This inconsistency between the documentation and the code may cause confusion for developers trying to understand how to use the function correctly.

Vulnerability Details

  • Refer to the Natspec documentation for the getNonce function.

  • Observe the suggested function call entrypoint.getNonce(address(this), 0).

  • Look at the actual implementation of the getNonce function and see that it calls i_entryPoint.getNonce(address(this), 0).

Expected code:
The Natspec documentation should accurately reflect the function call required to retrieve the account nonce.

Actual code:
The Natspec documentation suggests calling entrypoint.getNonce(address(this), 0), but the actual implementation in the function calls i_entryPoint.getNonce(address(this), 0).

Impact

This inconsistency may lead to confusion among developers, especially those who rely on Natspec documentation to understand how to interact with the contract. Developers may attempt to use the incorrect function call provided in the documentation, resulting in unexpected behavior or errors.

Tools Used

Manual

Recommendations

Update the Natspec documentation to reflect the correct function call required to retrieve the account nonce, which is i_entryPoint.getNonce(address(this), 0). Ensuring consistency between the documentation and the actual implementation will help developers understand how to use the function correctly without confusion.

Code
function getNonce() public view virtual returns (uint256) {
-> return i_entryPoint.getNonce(address(this), 0);
+> return entryPoint.getNonce(address(this), 0);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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