-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitelists and Blacklists #4
Comments
Consider re-using the whitelist to approve payers. Consider the 'Permission less' whitelist mechanism. |
These are my initial thoughts for designing the voting mechanism for the whitelisting operation. class ProposalInverter:
voting_mechanism = VotingMechanism()
def add_broker(self, broker):
if broker in self.whitelist:
self.brokers.add(broker)
else:
self.waitlist.add(broker)
def vote(self, voter, broker, vote):
voting_mechanism.vote(self, voter, broker, vote)
if broker in voting_mechanism.whitelist:
self.brokers.add(broker) The class VotingMechanism:
whitelist = set()
waitlist = set()
prior_votes = dict()
@abc.abstractmethod
def vote(self, proposal, voter, broker, vote):
pass
def add_broker(self, broker):
if broker in self.whitelist:
pass
elif broker not in self.waitlist:
self.waitlist.add(broker) All the specific voting mechanism will build on this base class. class WeightedVotingMechanism(VotingMechanism):
def vote(self, proposal, voter, broker, vote: bool):
self.add_broker(proposal, voter, broker, vote)
self.prior_votes[broker][voter] = vote
if sum([proposal.payers[payer] * vote for payer, vote in self.prior_votes[broker].items()]) > proposal.funds / 2:
self.whitelist.add(broker)
del self.waitlist[broker] |
Notes from today's PrimeDAO workshop:
|
This issue is addressed in pull request #7 |
The owner should be able to choose a consensus mechanism on initialization
The text was updated successfully, but these errors were encountered: