Explicit initialization with zero is not required for variable declaration because uints are 0 by default. Removing this will reduce contract size and save a bit of gas.
Proof of Concept
Instances include:
./staking-rewards/StakingRewards.sol:26: uint256 public periodFinish = 0;
./staking-rewards/StakingRewards.sol:27: uint256 public rewardRate = 0;
./tokens/USDV.sol:152: for (uint256 i = 0; i < userLocks.length; i++) {
./tokens/vesting/LinearVesting.sol:169: for (uint256 i = 0; i < vesters.length; ++i) {
Tools Used
Manual Analysis
Recommended Mitigation Steps
Remove explicit initialization with zero. It's already done at several places and in most for-loops, which means that this optimization would be consistent with the overall code style.
Handle
Dravee
Vulnerability details
Impact
Explicit initialization with zero is not required for variable declaration because uints are 0 by default. Removing this will reduce contract size and save a bit of gas.
Proof of Concept
Instances include:
Tools Used
Manual Analysis
Recommended Mitigation Steps
Remove explicit initialization with zero. It's already done at several places and in most for-loops, which means that this optimization would be consistent with the overall code style.