function checkContract(address _account) internal view {
require(_account != address(0), "Account cannot be zero address");
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(_account) }
require(size > 0, "Account code size cannot be zero");
}
Observe that require condition for 0 address check is not required as if 0 address is given then size will become 0 (code size is 0) and require(size>0) fails
@LilYeti: Need to confirm / is more clear this way. Don't really know what will be returned if that check is removed and addr 0 is used. Will change if confirmed.
Handle
csanuragjain
Vulnerability details
Impact
Gas saving
Proof of Concept
Navigate to contract at https://github.com/code-423n4/2021-12-yetifinance/blob/main/packages/contracts/contracts/Dependencies/CheckContract.sol
Observe the checkContract function