code-423n4 / 2021-09-wildcredit-findings

0 stars 0 forks source link

Avoiding unnecessary SSTORE can save gas #90

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

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.