Skip to content

Instantly share code, notes, and snippets.

Created December 3, 2015 20:30
Show Gist options
  • Save anonymous/0260d44a01f47bbf854c to your computer and use it in GitHub Desktop.
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=
// 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