If a variable is not set/initialized, it is assumed to have the default value (0, false, 0x0 etc depending on the data type). Explicitly initializing it with its default value is an anti-pattern and wastes gas.
Proof of Concept
Instances include:
ConvexStakingWrapper.sol:54: bool private constant _NOT_ENTERED = false;
ConvexStakingWrapper.sol:172: for (uint256 u = 0; u < accountsLength; u++) {
ConvexStakingWrapper.sol:227: for (uint256 u = 0; u < accountsLength; u++) {
ConvexStakingWrapper.sol:271: for (uint256 i = 0; i < rewardCount; i++) {
ConvexStakingWrapper.sol:287: for (uint256 i = 0; i < rewardCount; i++) {
ConvexStakingWrapper.sol:315: for (uint256 i = 0; i < rewardCount; i++) {
ConvexYieldWrapper.sol:63: for (uint256 i = 0; i < vaultsLength; i++) {
ConvexYieldWrapper.sol:80: for (uint256 i = 0; i < vaultsLength; i++) {
ConvexYieldWrapper.sol:111: for (uint256 i = 0; i < userVaultLength; i++) {
Tools Used
Manual Analysis
Recommended Mitigation Steps
Remove explicit initialization for default values.
Handle
Dravee
Vulnerability details
Impact
If a variable is not set/initialized, it is assumed to have the default value (0, false, 0x0 etc depending on the data type). Explicitly initializing it with its default value is an anti-pattern and wastes gas.
Proof of Concept
Instances include:
Tools Used
Manual Analysis
Recommended Mitigation Steps
Remove explicit initialization for default values.