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

Avoiding unnecessary SSTORE can save gas #90

Open
code423n4 opened this issue Sep 29, 2021 · 0 comments
Open

Avoiding unnecessary SSTORE can save gas #90

code423n4 opened this issue Sep 29, 2021 · 0 comments

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

There is an unnecessary SSTORE by setting pendingOwner state variable to zero address, when this is not checked anywhere but only prevents multiple accepts from the same pendingOwner which is not harmful.

Proof of Concept

https://github.com/code-423n4/2021-09-wildcredit/blob/c48235289a25b2134bb16530185483e8c85507f8/contracts/external/Ownable.sol#L39

https://github.com/code-423n4/2021-09-wildcredit/blob/c48235289a25b2134bb16530185483e8c85507f8/contracts/external/Ownable.sol#L36

Tools Used

Manual Analysis

Recommended Mitigation Steps

Remove the setting of pendingOwner state variable to zero address.

@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Sep 29, 2021
code423n4 added a commit that referenced this issue Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants