Closed code423n4 closed 2 years ago
Meta0xNull
The local variable used as for loop index need not be initialized to 0 because the default value is 0. Avoiding this anti-pattern can save a few opcodes and therefore a tiny bit of gas.
https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L152
Manual Review
Remove explicit 0 initialization of for loop index variable.
Before: for (uint256 i = 0; After: for (uint256 i;
Dup #126
Handle
Meta0xNull
Vulnerability details
Impact
The local variable used as for loop index need not be initialized to 0 because the default value is 0. Avoiding this anti-pattern can save a few opcodes and therefore a tiny bit of gas.
Proof of Concept
https://github.com/code-423n4/2021-12-vader/blob/main/contracts/tokens/USDV.sol#L152
Tools Used
Manual Review
Recommended Mitigation Steps
Remove explicit 0 initialization of for loop index variable.
Before: for (uint256 i = 0; After: for (uint256 i;