Skip to content

Instantly share code, notes, and snippets.

@szerintedmi
Last active May 24, 2018 20:46
Show Gist options
  • Save szerintedmi/4594b5ce9f142d46d89a6b5be0d68a18 to your computer and use it in GitHub Desktop.
Save szerintedmi/4594b5ce9f142d46d89a6b5be0d68a18 to your computer and use it in GitHub Desktop.
Stability board scripts first pass
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