Raisebox Faucet

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

[L-9] Variables Could Be Immutable

[L-9] Variables Could Be Immutable

Description

  • Normal behavior: Variables set only in the constructor should be immutable to save gas.

  • Specific issue: faucetDrip, sepEthAmountToDrip, and dailySepEthCap are set in constructor but not declared immutable.

uint256 public faucetDrip; // @> set in constructor
uint256 public sepEthAmountToDrip; // @> set in constructor
uint256 public dailySepEthCap; // @> set in constructor

Risk

Likelihood:Low

  • These variables remain unchanged after deployment by design.

Impact:Low

  • Minor: slightly higher gas usage for reads; optimization opportunity.

Proof of Concept

// Declare as `immutable` and recompile to observe reduced gas for reads.

Recommended Mitigation

- uint256 public faucetDrip;
- uint256 public sepEthAmountToDrip;
- uint256 public dailySepEthCap;
+ uint256 public immutable faucetDrip;
+ uint256 public immutable sepEthAmountToDrip;
+ uint256 public immutable dailySepEthCap;
Updates

Lead Judging Commences

inallhonesty Lead Judge 5 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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