BriVault

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

`eventStartDate::BriVault` should be immutable

Root + Impact : eventStartDate:BriVault parameter should be made immutable, reducing the gas cost

Description

  • eventStartDate::BriVault is a public state variable, but is never updated and is only initialized once in the constructor, hence these kinds of variables should be made immutable which are only initialized once and then never changed.

  • This variable is expensive as they are state variables and hence is increasing the gas fee, so it should be made immutable to reduce the gas fee.

contract BriVault is ERC4626, Ownable {
...
@> uint256 public eventStartDate;
...
}

Risk

Likelihood: Low

Impact: Low/Gas

Recommended Mitigation

  • Add the keyword immutable at the time of declaration as the variable is only initialized once.

contract BriVault is ERC4626, Ownable {
...
- uint256 public eventStartDate;
+ uint256 public immutable eventStartDate;
...
}
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!