/simple_donate.sol Secret
Created
March 29, 2022 06:13
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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.7.0 <0.9.0; | |
contract donation { | |
struct Person { | |
uint id; | |
string name; | |
uint256 amount; | |
address sender_address; | |
} | |
uint256 id = 0; | |
mapping(uint => Person) public people; | |
function addPerson(string memory name) public payable { | |
id += 1; | |
people[id] = Person(id, name, msg.value, msg.sender); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment