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

Solidity standard function name

Summary

The PasswordStore.t.sol test module doesn't follow Solidity's camelCase naming convention for function names, instead using snake_case.

Details of the Vulnerability

Foundry tests, written in Solidity, should adhere to the Solidity coding style for better readability. Currently, the test functions don't conform to this style guide. The setUp() function uses camelCase, while other tests use snake_case.

Impact

Non-standard code, such as incorrect naming conventions, can obscure bugs and pose challenges for new developers accustomed to the Solidity style. This can affect readability and maintainability of the code.

Tools Used

A manual code review.

Recommendations

Adhere to the Solidity Style Guide's naming convention. Specifically, rename function test_owner_can_set_password() to function testOwnerCanSetPassword(), and function test_non_owner_reading_password_reverts() to function testNonOwnerReadingPasswordReverts().
the style guide can be found here https://docs.soliditylang.org/en/latest/style-guide.html#function-names

Updates

Lead Judging Commences

inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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