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

Informational

Summary

The feature of ownable contract can be achieved via modifier.

Vulnerability Details

With a modifier that ensures the msg.sender is the same as the contract owner we get contract which ownability is easier to maintain.

Impact

Readable code -> Easy to maintain -> Less/No bugs!

Tools Used

Manual review was used.

No automatic tools for code analysis were used.

Standard tools described in https://book.getfoundry.sh/ were used to deploy, test and query the contract.

Recommendations

Write a modifier. I assume the s_owner was renamed to i_owner (and declared immutable):

modifier onlyOwner() {
if (msg.sender != i_owner) revert PasswordStore__NotOwner();
_;
}

The functions that are supposed to be executed only by the owner of the contract should use that modifier in their signature:

function setPassword(string memory newPassword) external onlyOwner {
s_password = newPassword;
emit SetNetPassword();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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