Skip to content

Instantly share code, notes, and snippets.

@blutarche
Last active July 6, 2022 00:23
Show Gist options
  • Save blutarche/1381b0f1f7fd9239b01fc7146cd61d17 to your computer and use it in GitHub Desktop.
Save blutarche/1381b0f1f7fd9239b01fc7146cd61d17 to your computer and use it in GitHub Desktop.
//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