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

getPassword function Optimized

Summary

As i used onlyOwner modifier and ABI's encoding utility that's why i have to modify & optimize the getPassword function.

Vulnerability Details

function getPassword() external view onlyOwner returns (string memory) {
// I removed this check. Since, I'm using onlyOwner modifier. Empowering DRY. 😁
// if (msg.sender != s_owner) {
// revert PasswordStore__NotOwner();
// }
// return s_password; // I used abi's encoding that's why i first decoded password then returned it.
return abi.decode(s_password, (string));
}

Impact

Optimizes the source code and makes retrieval more secure.

Tools Used

Manually optimized.

Recommendations

We Should follow DRY and Best Practices to retrieve password securely.

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.