In Solidity, uint256 variables are automatically initialized to 0. Therefore, the explicit assignment tokenCounter = 0 in the constructor is redundant, as the line uint256 public tokenCounter; already ensures a default value of 0. This assignment can be safely removed for cleaner and more efficient code.
tokenCounter is assigned a value of 0 in the constructor which is redundant as the line uint256 public tokenCounter; is already initialized with a default value of 0.
Removing the redundant tokenCounter = 0 assignment saves a small amount of gas and slightly reduces bytecode size, optimizing contract deployment.
Manual review
Remove this line tokenCounter = 0; in the constructor and update the code as shown below.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.