Last active
July 6, 2022 00:23
-
-
Save blutarche/1381b0f1f7fd9239b01fc7146cd61d17 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
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
import "hardhat/console.sol"; | |
contract LoveLetter { | |
uint256 public totalLetters; | |
mapping(uint256 => address) public senders; | |
mapping(uint256 => address) public receivers; | |
struct Letter { | |
string message; | |
uint256 etherAmount; | |
bool opened; | |
} | |
mapping(uint256 => Letter) public letters; | |
event Sent( | |
address indexed from, | |
address indexed to, | |
uint256 indexed id, | |
uint256 amount | |
); | |
event Opened( | |
address indexed from, | |
address indexed to, | |
uint256 indexed id, | |
uint256 amount | |
); | |
constructor() { | |
totalLetters = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment