Last active
August 29, 2015 14:27
-
-
Save d11e9/28de415321289d06aeb2 to your computer and use it in GitHub Desktop.
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
contract AnOrg { | |
address[] members; | |
// percent of members needed for quorum | |
uint quorum = 67; | |
struct Motion { | |
string key; | |
string value; | |
uint votes; | |
} | |
mapping (uint160 => Motion) public motions; | |
function AnOrg () { | |
members.length++; | |
members[members.length - 1] = msg.sender; | |
} | |
function move (uint160 contentHash, string key, string value) { | |
if (motions[contentHash].votes > 0) { | |
motions[contentHash].votes++; | |
if (members.length / motions[contentHash].votes * 100 > quorum) { | |
// approve motion | |
} | |
} else { | |
motions[contentHash] = Motion( key, value, 1 ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment