Basket.sol#initialize()
Remove redundant assertion can save gas
#67
Labels
bug
Warden finding
duplicate
Another warden found this issue
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-10-defiprotocol/blob/7ca848f2779e2e64ed0b4756c02f0137ecd73e50/contracts/contracts/Basket.sol#L41-L57
factory
will never beaddress(0)
ifinitialized == true
as it's been set tomsg.sender
wheninitialize()
being called.Removing
require(address(factory) == address(0));
can make the code simpler and save some gas.Recommendation
Remove the redundant assertion.
The text was updated successfully, but these errors were encountered: