State variables that are updated but never read cost the protocol gas without providing any functionality.
The previousWinner variable is set during selectWinner but is never utilized anywhere else in the contract.
Likelihood:
Every time selectWinner is called, an expensive SSTORE operation takes place to update this variable.
Always present on contract deployment.
Impact:
Unnecessary gas expenditures for all participants/callers.
Not applicable - Gas Optimization
Remove the previousWinner variable completely.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.