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

Unnecessary zero check on variable which is never initialized earlier #68

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

Comments

@code423n4
Copy link
Contributor

Handle

0xRajeev

Vulnerability details

Impact

launcherInfo.unlock is only initialised in finalize() which can be called only once. So the zero check before initializing it is unnecessary and wastes gas.

Proof of Concept

https://github.com/sushiswap/miso/blob/2cdb1486a55ded55c81898b7be8811cb68cfda9e/contracts/Liquidity/PostAuctionLauncher.sol#L87-L94

https://github.com/sushiswap/miso/blob/2cdb1486a55ded55c81898b7be8811cb68cfda9e/contracts/Liquidity/PostAuctionLauncher.sol#L260-L263

Tools Used

Manual Analysis

Recommended Mitigation Steps

Remove conditional and set it unconditionally.

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