This repo contains the code for the voting app to be used at the Cardano Constitutional Convention in Buenos Aires. The development of this app was conducted by the Clear Contracts team, which is the team behind Clarity.
This project was organized and funded by Intersect. End-to-end testing was conducted by Dquadrant.
The primary functionality of this app allows a convention organizer to create polls and the delegates/alternates to vote on the created polls. This process will happen iteratively until a constitution receives enough votes to pass the winning threshold.
Anybody will have the ability to visit the app and view the polls. When the polls conclude, everybody will be able to view the results. For these observers, no wallet is required. Only the convention organizers and delegates/alternates will be required to sign-in with a wallet.
This voting app will be hosted through the end of February, to provide ample time for viewing of the poll results. All vote records for the final constitution vote will be on-chain indefinitely.
.npmrc
file with your Auth Token from the teamnpm install
npx prisma migrate dev --skip-seed
to populate the database with the proper tablesnpx prisma generate
in root of repository to create TS client for Prismaprisma/seed.ts
file, adjust the seed data so that there is a user with the stake address that you will be connecting withnpm run seed
to seed the database with testing data located in prisma/seed.ts
openssl rand -base64 32
in terminal and paste result to NEXTAUTH_SECRET
environment variableNEXT_PUBLIC_NETWORK
to testnet
or mainnet
depending on the network of the wallet you are connectingnpm run dev
in root of repositoryThis voting app relies on an additional server that is not open-source. This server is a part of the pre-existing Clarity infrastructure that was not included in the scope of this project.
This server is used to construct the transactions that the convention organizer will sign to post the vote data on-chain. The Voting App sends a request to this server, the server constructs the transactions, and the constructed transactions are sent to the convention organizer's wallet. Once the transactions are sent to the user's wallet, the involvement of this server is finished.
At this point, the convention organizer will verify the transactions and sign them to put the vote data on-chain.
When a delegate or alternate votes on a poll, they will sign a message that contains the following information:
This message and their signature will be saved to the voting app's database. At the conclusion of the final poll, the convention organizer will sign a number of transactions. Each transaction will contain the vote data for multiple delegate/alternate votes. Anybody will be able to refer to these on-chain transactions and verify the votes themselves.
schema.prisma
and necessary changes to the DB diagramnpx prisma migrate dev
remove_user_color_property
schema.prisma
and generated migration.sql
fileThis project is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).
This means:
For more details, see the AGPL License file.