Suppose only owner can know/read the password. String variable are readable no matter it is public or private variable.
The variable s_password
declare as private
to prevent direct read from contract. Although the function of getPassword()
implemented checking of owner, the value is still readable from storage state or calldata.
Anyone can bypass getPassword()
, access and use the s_password
Remove the function, encrypt and store only the encrypted string, the decryption key should store safely off-chain.
Private functions and state variables are only visible for the contract they are defined in and not in derived contracts. In this case private doesn't mean secret/confidential
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.