BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

[L-3] Redundant and Unused State Variables

[L-3] Redundant and Unused State Variables

Description

The contract contains several state variables that are declared but either not used or redundant with other mechanisms, increasing gas costs and code complexity.

uint256 public stakedAmount;
uint256 public totalAssetsShares;
// Both variables appear to be unused
uint256 public numberOfParticipants;
uint256 public totalParticipantShares;
// These variables are updated but never used in any logic

Recommended Mitigation

// Remove unused variables:
// uint256 public stakedAmount;
// uint256 public totalAssetsShares;
// If these variables should be used, ensure they're properly utilized:
function withdraw() external winnerSet {
// ...
// totalParticipantShares -= shares;
// numberOfParticipants--;
// ...
}
Updates

Appeal created

bube Lead Judge 19 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Gas optimizations

Gas optimizations are invalid according to the CodeHawks documentation.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!