Skip to content

Instantly share code, notes, and snippets.

@manabubannai
Created March 29, 2022 06:13
Show Gist options
  • Save manabubannai/e513bcfa7d607f6ad55ef39497b265b4 to your computer and use it in GitHub Desktop.
Save manabubannai/e513bcfa7d607f6ad55ef39497b265b4 to your computer and use it in GitHub Desktop.
// 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