Assignment Of Variables To Default #105
Labels
bug
Something isn't working
G (Gas Optimization)
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
StakingRewards
Handle
ye0lde
Vulnerability details
Impact
Variables are being assigned their default value which is unnecessary.
Removing the assignment will save gas when deploying.
Proof of Concept
https://github.com/code-423n4/2021-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/staking-rewards/StakingRewards.sol#L26-L27
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Remove the assignments.
Or if you feel it is important to show the default assignment will occur then replace the assignments with a comment.
The text was updated successfully, but these errors were encountered: