What Is the Difference between a Receive() and a Fallback() Function in Solidity?

In modern Solidity (0.6.x+), receive() is a special function designed exclusively to handle plain Ether transfers with no call data. It is declared with receive() external payable.

The fallback() function, declared with fallback() external payable , is a catch-all that executes when a function call is made to the contract that does not match any other function signature. If a contract receives plain Ether and has no receive() function, the fallback() function will be executed instead.

What Is the Conversion Factor between Ether and Gwei?
Can a Reentrancy Attack Be Performed without a Fallback Function?
What Is a Denial-of-Service (DoS) Attack Related to Fallback Functions?
Can an ECDSA Signature Be Reused for a Different Transaction?
How Do Modern Solidity Versions Recommend Handling Ether Transfers Instead of Using a Gas Stipend?
Why Are Fallback Functions Critical in a Reentrancy Scenario?
Can a Contract without a Fallback Function Still Participate in a Reentrancy Attack?
What Is the Difference between a Receive and a Fallback Function in Solidity?

Glossar