Last active
July 6, 2022 00:24
-
-
Save blutarche/47b9794b9fb6d4902cbf32167fa09acf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract LoveLetter { | |
... | |
function send(address to, string memory message) | |
external | |
payable | |
returns (uint256 id) | |
{ | |
id = totalLetters; | |
senders[id] = msg.sender; | |
receivers[id] = to; | |
letters[id] = Letter({ | |
message: message, | |
etherAmount: msg.value, | |
opened: false | |
}); | |
console.log("[send]", id, msg.value); | |
totalLetters++; | |
emit Sent(msg.sender, to, id, msg.value); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment