Skip to content

bruleeshark/LoveLetterToWhoever

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

  • features no imports or dependencies other than the EVM itself.

  • The purpose of this smart contract is to allow the owner to create and send a love letter to someone which is cryptographically private.

  • Smart contract is called "LoveLetterToWhoever" and is built using the Solidity programming language and OpenZeppelin libraries.

  • Contract implements access control using the "Ownable" library from OpenZeppelin, which ensures that only the owner of the contract can perform certain actions such as setting the message and the PIN.

  • Message is encrypted using the Keccak256 standard ethereum library, making it difficult for anyone but the intended recipient to read.

  • Contract owner sets the PIN, which is required to open the love letter.

  • Contract owner is intended to give someone they have a crush on the PIN, so they can read the message at a later time, rather than force them to guess it.

  • Alternatively, the contract owner could use a "message in a bottle" approach wherein anyone who finds the PIN receives the love letter as a reward, and the PIN remains secret.

  • To open the love letter, the recipient must provide the correct PIN, which is checked by the smart contract. If the correct PIN is entered, the smart contract returns the decrypted message.

  • included html interface featuring a red text with black background theme.

  • HTML file should interact properly with the solidity file as long as the correct contract address and ABI are provided in the HTML file.

  • The code in the HTML file uses the web3.js library to interact with the Ethereum network and the deployed contract.

  • The functions in the HTML file call the methods in the contract using the loveLetter instance created with the ABI and contract address, then display the returned values on the HTML page using JavaScript.

INSTRUCTIONS

Deploy the contract by pasting it into Remix IDE or your favourite compiler and deployer running 8.0 or higher.

insert contract ABI and address into your html file at locations specified by comments

To deploy the HTML file, you can use a static website hosting service such as GitHub Pages or Amazon S3. You would simply upload the HTML file to the hosting platform, and then access it using the URL provided by the hosting service.

For example, if you use GitHub Pages, you can follow these steps:

  • Create a GitHub account and create a new repository.
  • Commit the HTML file to the repository.
  • Go to the repository settings and enable GitHub Pages under the "GitHub Pages" section.
  • Your HTML file will now be accessible at a URL such as https://your-username.github.io/your-repository-name.
  • Note that you will also need to deploy the solidity contract to a Ethereum network such as Rinkeby or Mainnet. You can do this using a tool such as Remix, which is a browser-based Solidity IDE that can interact with Ethereum networks.

About

a contract for cryptographically storing a love letter for your beloved on an EVM / Solidity compatible blockchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors