Created
December 3, 2015 20:30
-
-
Save anonymous/0260d44a01f47bbf854c to your computer and use it in GitHub Desktop.
Created using soleditor: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity?gist=
This file contains 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
// s4 : Swarm | |
contract swarm { | |
struct Member { bool exists; } | |
struct Claim { | |
uint unproven; | |
address[] refutors; | |
} | |
uint public totalMembers; | |
mapping( address => Member ) public members; | |
mapping( bytes32 => Claim ) public claims; | |
modifier onlyMember { if (members[msg.sender].exists) _ } | |
function join() public { | |
members[msg.sender].exists = true; | |
} | |
function claim(bytes32 mapDataIPFSHash, uint unproven) public onlyMember { | |
claims[mapDataIPFSHash].unproven = unproven; | |
} | |
function refute(bytes32 mapDataIPFSHash) public onlyMember { | |
claims[mapDataIPFSHash].refutors.push(msg.sender); | |
} | |
function void(bytes32 mapDataIPFSHash, address refutor, uint v, uint r, uint s) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment