Early rate$2,400 of senior audit time for $500. Early members keep the rate as it climbs.$2,400 of senior audit time for $500See how →
F-2025-0015·gas-optimization

Redundant initialization of uint to zero

Acknowledgedstakingnft-boostrewards
TL;DR

Constructor explicitly initialises currentPositionId to zero; Solidity zero-initialises uint by default, so the assignment is redundant gas.

Severity
INFO
Impact
LOW
Likelihood
LOW
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

In the constructor, currentPositionId is explicitly initialised to 0:

solidity
constructor(
address _stakingToken,
address _nftContract,
uint _rewardBoostMultiplier
) {
currentPositionId = 0; // Redundant initialization
// ...
}

In Solidity, all state variables are automatically initialised to their default values. For uint, this default value is 0, making this initialisation redundant and consuming unnecessary gas.

F-2025-0015