Complete the code to send 1 ether using the transfer method.
payable(msg.sender).[1](1 ether);
The transfer method sends Ether and reverts on failure.
Complete the code to send 0.5 ether using the send method and check success.
bool success = payable(receiver).[1](0.5 ether);
The send method returns a boolean indicating success or failure.
Fix the error in sending Ether using call and check for success.
(bool sent, ) = payable(receiver).[1]{value: amount}(''); require(sent, 'Failed to send Ether');
The call method is the recommended way to send Ether with gas forwarding and returns success status.
Fill both blanks to send Ether safely using call and handle failure.
([1], ) = payable(receiver).[2]{value: msg.value}(''); require([1], 'Send failed');
Use call to send Ether and store the success boolean in sent.
Fill all three blanks to create a function that sends Ether using call and reverts on failure.
function sendEther(address payable receiver) public payable { (bool [1], bytes memory [2]) = receiver.[3]{value: msg.value}(''); require([1], 'Failed to send Ether'); }Use call to send Ether, capture success and data, and require success.
