Skip to content

blockdeveth/stake_mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prototype for stake mail

Demo video: https://youtu.be/P1rUBsEHTM4

kleros/dapp-ideas#21

It has 2 contracts:

  • SafeMail(sol): through which users can send message via contract events.
  • Stake(sol): When user sends a mail, their 1 MAIL token is locked in Stake contract.

Receiver can [reportSpam](https://github.com/blockdeveth/stake_mail/blob/main/contracts/SafeMail.sol#L75) the mail, and Kleros court will take a decision. If the mail is judged to be spam, then sender's 1 MAIL token is sent from Stake contract to receiver, otherwise, it is returned to sender.

Contracts are deployed on Kovan:

UI

  • Start a local server: yarn react-app:start
  • It shows the interface to send a mail.

Screen Shot 2021-07-25 at 3 25 45 PM

Screen Shot 2021-07-25 at 3 33 55 PM

  • Using the mailId, report it from the interface, and head over to https://centralizedarbitrator.kleros.io/

  • Use 0x4d733181b675bb56de1b516fc6cbf0015c7cf1f1 as the Arbitrator (or deploy your own and add the new address in this code).

Screen Shot 2021-07-25 at 3 16 35 PM

  • It will load all the current disputes.

  • You can vote and check the subsequent balance of sender and receiver based on your vote.

Future Work

  • There is no privacy in the mechanism. All the mails can be seen by anyone. Use private and public key encryption.
  • Add a timeout so that receiver can report a mail within a day of receiving it.

Components used

The app was bootstrapped from create-eth-app, and Kleros documentation.