This example models a voting process controlled by a government entity. The government puts text-based proposals to a vote by creating a ballot. When the vote is decided a contract evidences the outcome on the ledger.
- The government creates a
Ballot
for a givenProposal
. - It invites voters via invite/accept, creating mutually signed
VotingRight
s for each. - Voters can cast a vote using their
VotingRight
contract for a givenBallot
. - Once all voters have voted the government can
Decide
the vote. - The outcome of the ballot is recorded in a
Decision
contract on the ledger.
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