What Is the Difference between a Receive and a Fallback Function in Solidity?
The receive function is specifically executed when a transaction sends Ether to the contract with no data (empty calldata ). It must be declared as payable and cannot have arguments.
The fallback function is executed when a contract is called without matching any other function, or if it receives Ether with data. Both can be entry points for a reentrancy attack, but receive is specifically for plain Ether transfers.