0
0
Blockchain / Solidityprogramming~5 mins

Sending Ether (transfer, send, call) in Blockchain / Solidity - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the transfer function do when sending Ether in Solidity?
The transfer function sends a fixed amount of Ether to an address and throws an error if the transfer fails, reverting the transaction.
Click to reveal answer
beginner
How does send differ from transfer when sending Ether?
send sends Ether but returns a boolean indicating success or failure instead of throwing an error. It requires manual error handling.
Click to reveal answer
intermediate
What is the main advantage of using call to send Ether?
call is more flexible and forwards all available gas, allowing interaction with contracts that require more gas. It also returns success status and data.
Click to reveal answer
advanced
Why should you be careful when using call to send Ether?
Because call forwards all gas by default, it can lead to reentrancy attacks if not handled properly. Always use checks-effects-interactions pattern.
Click to reveal answer
beginner
What happens if transfer or send fails to send Ether?
transfer throws an error and reverts the transaction, while send returns false and requires manual error handling.
Click to reveal answer
Which function automatically reverts the transaction if sending Ether fails?
Atransfer
Bsend
Ccall
Dapprove
Which function returns a boolean indicating success or failure when sending Ether?
Asend
Btransfer
Ccall
Dmint
Which method is recommended for sending Ether when you need to forward all gas and handle complex interactions?
Atransfer
Bsend
Cdelegatecall
Dcall
What is a major security risk when using call to send Ether?
AGas limit exceeded
BReentrancy attack
CInteger overflow
DStack overflow
If you want to send Ether and handle failure manually without reverting, which function should you use?
Acall
Btransfer
Csend
Dselfdestruct
Explain the differences between transfer, send, and call when sending Ether in Solidity.
Think about error handling and gas forwarding.
You got /4 concepts.
    Describe a safe pattern to send Ether using call to avoid security risks.
    Focus on security best practices.
    You got /4 concepts.