The governance model extends the Voting example with functionality to vote on specific changes to the ledger. This is a simple form of on-ledger governance where users decide how a given model evolves. In the example the citizens can vote to create a constitution with a given text, to change the text of an existing constitution, or to upgrade the constitution contract itself. The newer version of the constitution contract gives the government the option to create ballots directly, as opposed to going through the invite/accept inbreeding process of voters.
- The
government
creates aBallot
for one of three availableProposal
s. - It invites voters via invite/accept, creating mutually signed
VotingRight
s for the givenProposal
. - Each voter can cast a boolean
accept
vote via theCastVote
choice. - Once all voters have cast their votes the government can
Decide
theBallot
. - If the
Proposal
received moreTrue
thanFalse
votes the decision isexecute
d. - The resulting
DecisionOutCome
is:None
if the proposal got rejectedContractId Consitiution
if a proposal to create or update the text of a constitution was acceptedContractId ConsititutionV2
if a proposal to upgrade the constitution contract was executed.
- If the constitution contract was upgraded the government now has a new option to directly create
Ballot
s off the new constitution contract.
To compile the project:
daml build
To test all scenarios:
daml test --color
To load the project into the sandbox and start navigator:
daml start