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

onlyOwner modifier might be considered for getPassword

Summary

The onlyOwner modifier is more readable and is considered a good practice to use in such functions.

Vulnerability Details

Code readability will be better using onlyOwner modifier.

Impact

Better code readability.

Tools Used

Manual codebase analysis.

Recommendations

+ modifier onlyOwner() {
+ require(msg.sender == owner, "Not owner");
+ _;
+ }
- function getPassword() external view returns (string memory) {
- if (msg.sender != s_owner) {
- revert PasswordStore__NotOwner();
- }
+ function getPassword() onlyOwner external view returns (string memory) {
return s_password;
}
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.