Last active
May 24, 2018 20:46
-
-
Save szerintedmi/4594b5ce9f142d46d89a6b5be0d68a18 to your computer and use it in GitHub Desktop.
Stability board scripts first pass
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
contract StabiltyBoard { | |
address[] allSigners // all signers, even disabled ones | |
mapping(address => bool) isSigner; | |
struct Approvals { | |
bool approved; // do we want to calculate quorum at the time time of approve call | |
// or each time when isApprove called? if latter then no need for this bool | |
uint signCount; | |
mapping(address => bool) signedBy; | |
address[] signers; // do we need revoke? | |
// if not then we don't need signCount; | |
} | |
mapping(address => Approvals) scriptApprovals | |
// ... | |
addSigners(address[] signers); | |
removeSigners(address[] signers); | |
approve(address scriptAddress); | |
isApproved(address scriptAddress); | |
} | |
contract RestrictedContract | |
StabilityBoard stabilityBoard; | |
RestrictedFunction() { | |
require(stabilityBoard.isApproved(msg.sender)); // could make it a modifier | |
// ... | |
} | |
} | |
contract StablityBoardScript_00001 { | |
execute() { | |
calls to restricted contracts... | |
selfDesctruct(msg.sender); // shouldn't have balance but... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment