Last active
March 6, 2017 11:13
-
-
Save chfast/86556d03c97759d26fc34fd29885eb3d to your computer and use it in GitHub Desktop.
Dinder - Decentralized Tinder
This file contains hidden or 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
pragma solidity ^0.4.9; | |
contract Dinder { | |
mapping(address => mapping(address => bool)) connections; | |
mapping(address => int) thumbUps; | |
function thumbUp(address a) { | |
if (connections[a][msg.sender]) throw; | |
connections[a][msg.sender] = true; | |
thumbUps[a] += 1; | |
} | |
function getWhisperTopic(address a) constant returns (bytes32) { | |
if (connections[a][msg.sender] && connections[msg.sender][a]) { | |
uint mix = uint(a) + uint(msg.sender); | |
return sha3(mix); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment