Complete the code to get the address of the caller.
address caller = [1];msg.sender holds the address of the caller who invoked the function.
Complete the code to get the amount of Ether sent with the call.
uint amount = [1];msg.value holds the amount of Ether (in wei) sent with the transaction.
Fix the error in the function to correctly check if Ether was sent.
function deposit() public payable {
require([1] > 0, "Send some Ether");
}The function must check msg.value to see if Ether was sent.
Fill both blanks to create a function that returns the sender and the amount sent.
function getInfo() public view returns (address, uint) {
return ([1], [2]);
}The function returns the caller's address (msg.sender) and the Ether sent (msg.value).
Fill all three blanks to create a payable function that stores sender and amount in state variables.
address public lastSender;
uint public lastAmount;
function recordPayment() public payable {
lastSender = [1];
lastAmount = [2];
emit PaymentReceived([3]);
}
event PaymentReceived(address sender);The function saves msg.sender and msg.value to state variables, then emits an event with the sender's address.