Use of blockhash(block.number) Returns Zero in generateSalt()
generateSalt() builds the CREATE2 salt from blockhash(block.number), which always returns zero per the EVM spec. The salt loses one of its three intended entropy sources.
Description
The generateSalt() function is intended to produce a unique salt for use with CREATE2 by combining a blockhash, the caller's address, and a nonce:
function generateSalt() internal returns (bytes32) {saltNonce++;return keccak256(abi.encodePacked(blockhash(block.number), msg.sender, saltNonce));}
However, blockhash(block.number) always returns zero per the EVM specification. The blockhash() opcode only returns a valid value for the previous 256 blocks, excluding the current block.
As a result, this line: blockhash(block.number) contributes no entropy and is effectively a constant zero.
Impact
The salt's entropy reduces to keccak256(abi.encodePacked(0, msg.sender, saltNonce)). Uniqueness is still guaranteed by saltNonce, but the intended use of blockhash entropy is silently lost.
Recommendation
Update the code to use blockhash(block.number - 1), which is valid:
function generateSalt() internal returns (bytes32) {saltNonce++;return keccak256(abi.encodePacked(blockhash(block.number - 1), msg.sender, saltNonce));}

