Friends, it's time to learn about blockchain technology again. Today, I will share with you what is the fallback function of solidity. The end of the bear market is very difficult to endure. Hei Xiazi believes that ETH will definitely reach 10,000 US dollars in the next bull market. $ETH

The fallback function, whose English name is Fallback, is a function without a name, parameters, or return value. A contract can have one fallback function. When transferring ETH to a contract, a payable fallback function is required. If no function is matched when calling the contract, the fallback function will be called.

Before solidity 0.5, the fallback function was usually used to receive ETH transfers because there was no default receiving function in the contract. After solidity 0.6, the fallback function has a new syntax and keyword. You can use the fallback keyword to explicitly declare the fallback function.

After solidity0.8, the fallback function is no longer the default function, but is replaced by the receive function. The breceive keyword function can express its purpose more clearly. In the new version of solidity, it is recommended to use the receive function to handle ETH transfer logic.