While you are storing the password as a private variable note that all blockchain transactions are public and visible to the people
The password is stored as a private variable this will make it vulnerable to unauthorized access
since all transactions are visible to the blockchain our password will be visible to the public and this will make our contract vulnerable
manual analysis
you should consider implementing password hashing to store a hashed password instead and update our getPassword to verify the get password before retrieval. Below is how i would implement the password first
set the password on deployment that means you do it on the constructor as below
now that you set the password on deployment your get password should look like below so it checks the hash before revealing the password
please note that we are using only owner for additional security to ensure only the owner is able to get the password
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.