oasislabs / secret-ballot

Secret Ballot example dApp
Apache License 2.0
7 stars 7 forks source link

Secret Ballot dApp

This dApp demonstrates confidentiality using a voting smart contract that keeps each user's vote private and hides vote tallies until voting has ended. It serves as an example app for our Web3(c) library.

To interact with this dApp locally follow the steps below.

Initial Setup

Building & Deploying the Smart Contract

To build a new ballot, run:

You can deploy the contract with truffle. to do so:

Note the address of the deployed contract in the output

...
Saving artifacts...
Running migration: 2_deploy_contracts.js
  Replacing SecretBallot...
  ... 0x473e196528a48d27d5488dddf9bb8a351caa6bfe41a44b8e9fca0c935142db90
  SecretBallot: 0x1dd2838d8290dd83d5d060d1b3d2cc1eae0ac5f7

In this example the ballot was deployed to address 0x1dd2838d8290dd83d5d060d1b3d2cc1eae0ac5f7

Interacting with the dApp

Notes and Troubleshooting