Ref - https://docs.soliditylang.org/en/v0.8.25/contracts.html#receive-ether-function
In Ethereum, the fallback function is a special function in a smart contract that is executed when the contract receives Ether and there is no other matching function signature for the call made. It is part of the low-level function set in Solidity and is commonly used for handling Ether transfers, handling unexpected function calls, or implementing custom logic for receiving Ether.
The fallback function is invoked when:
external and payable if it needs to accept Ether.<aside> 💡
There is another function called receive that is triggered only when ether is received.
</aside>
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract FundReceiver {
event FallbackCalled();
fallback() external payable {
emit FallbackCalled();
}
}
