The 'PasswordStore::s_owner' variable is unable to be changed, and therefore should be immutable to save gas.
'''solidity
contract PasswordStore {
error PasswordStore__NotOwner();
@> address private s_owner;
string private s_password;
'''
If a variable never changes, then reading from storage is less gas efficient, and instead we should read from the bytecode. Using an immutable variable will enable the protocol to save gas on reading the 'PasswordStore::s_owner' variable.
Wastes gas.
'''...diff
address private s_owner; 542818 gas.
address private immutable s_owner; 516936 gas
'''
-slither
foundry
Set s_owner to immutable
...diff
address private s_owner;
address private immutable s_owner;
...
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.