Created
July 7, 2016 10:51
-
-
Save LefterisJP/409a52012a209af1d20186343a22f988 to your computer and use it in GitHub Desktop.
min_quorum.py
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
#!/usr/bin/python2 | |
import argparse | |
def min_quorum(args): | |
total_supply = args.supply | |
div = args.div | |
actual_balance = args.balance | |
value = args.val | |
tok_quorum = total_supply/div + (value*total_supply) / (3*actual_balance) | |
perc_quorum = float(tok_quorum)/float(total_supply) | |
return tok_quorum, perc_quorum | |
if __name__ == "__main__": | |
p = argparse.ArgumentParser(description='minQuorum Calculation') | |
p.add_argument( | |
'--val', | |
type=int, | |
help='Value to transfer with the proposal' | |
) | |
p.add_argument( | |
'--div', | |
type=int, | |
default=5, | |
help='MinQuorum Divisor' | |
) | |
p.add_argument( | |
'--supply', | |
type=int, | |
default=11538165, | |
help='Total supply' | |
) | |
p.add_argument( | |
'--balance', | |
type=int, | |
help='Actual Balance of the DAO' | |
) | |
args = p.parse_args() | |
tok, perc = min_quorum(args) | |
print("{} wei-equivalent tokens will be required which represent " | |
"{}% of the total supply".format( | |
tok, perc*100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment