Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment Of Variables To Default #105

Closed
code423n4 opened this issue Nov 14, 2021 · 0 comments
Closed

Assignment Of Variables To Default #105

code423n4 opened this issue Nov 14, 2021 · 0 comments
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

Comments

@code423n4
Copy link
Contributor

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.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Nov 14, 2021
code423n4 added a commit that referenced this issue Nov 14, 2021
@0xstormtrooper 0xstormtrooper added StakingRewards sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") and removed sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons labels Nov 15, 2021
@0xstormtrooper 0xstormtrooper added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants