Created
October 31, 2022 19:51
-
-
Save ac12644/4456869310e81102155c0035fb11a6f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
... | |
event DonationReceived(address indexed donor, uint256 value); | |
... | |
function donate() public payable { | |
Donation memory donation = Donation({ | |
value: msg.value, | |
date: block.timestamp | |
}); | |
_donations[msg.sender].push(donation); | |
totalDonations = totalDonations.add(msg.value); | |
donationsCount++; | |
emit DonationReceived(msg.sender, msg.value); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment