Focus mode
Code from video: https://solidity-by-example.org/sending-ether/
This video explains 3 ways to send ETH in Solidity: transfer, send and call.
A contract receiving Ether must have at least one of the functions below:
receive() is called if msg.data is empty, otherwise fallback() is called. If neither a receive Ether nor a payable fallback function is present, the contract cannot receive Ether through regular transactions and throws an exception.
Resources:
You can find detailed further information from Solidity Official documentation (in English):
https://docs.soliditylang.org/en/v0.8.14/contracts.html#receive-ether-function
https://docs.soliditylang.org/en/v0.8.14/contracts.html#fallback-function
https://medium.com/coinmonks/solidity-transfer-vs-send-vs-call-function-64c92cfc878a
Programs to Accelerate Your Progress in a Software Career
Join our 4-8 month intensive Patika+ bootcamps, start with the fundamentals and gain comprehensive knowledge to kickstart your software career!
You need to enroll in the course to be able to comment!