Function Selector Clashes

Algorithm

Function Selector Clashes represent a critical vulnerability within smart contract architecture, particularly prevalent in decentralized finance (DeFi) protocols. These clashes arise when multiple functions within a contract share the same function selector—the first four bytes of a function’s keccak256 hash—leading to unintended function calls and potential exploitation. Effective mitigation requires meticulous contract design, employing unique selectors and robust input validation to prevent ambiguous dispatch scenarios.