Skip to content

Instantly share code, notes, and snippets.

@chfast
Last active March 6, 2017 11:13
Show Gist options
  • Save chfast/86556d03c97759d26fc34fd29885eb3d to your computer and use it in GitHub Desktop.
Save chfast/86556d03c97759d26fc34fd29885eb3d to your computer and use it in GitHub Desktop.
Dinder - Decentralized Tinder
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