Skip to content

oasisprotocol/dapp-votee

Repository files navigation

Oasis voTEE

CI build status CI lint status


The Community Vote gives ROSE holders the power to choose the Oasis Network’s first mascot, a character that will appear in new communications from the Oasis Network. This project aligns with our mission to build a decentralized internet defined by privacy, security, and usability.
Learn more »

View voTEE dAppReport BugRequest Feature

About The Project

voTEE dApp

This project pertains to a voting campaign for the selection of a mascot for the Oasis Network. The campaign involves a contract and a decentralized application (dApp) specifically designed to facilitate the voting process. This dApp harnesses the power of Oasis Sapphire ParaTime to enable confidential voting.

The poll, created by the contract, provides three mascots for participants to vote for. Each mascot symbolizes a different aspect of the Oasis Network as follows:

  • Capybara symbolizes Interoperability
  • Desert Owl represents Knowledge
  • Fennec Fox stands for Privacy

(back to top)

Roadmap

VoTEE dApp is conceptualized as a dApp allowing for participatory voting on a myriad of decisions related to Oasis, with the Oasis mascot vote serving merely as one such instance out of many potential future ones. As per the envisaged evolution of this project, this repository is subject to change in the future.

Stay tuned for future updates.

(back to top)

Getting Started

This project depends on Node.js, therefore please confirm your system has it installed.

Prerequisites

This project utilizes pnpm as its package manager. We recommend using npm for a hassle-free installation of pnpm.

npm install -g @pnpm/exe

Installation

This project is structured into two subprojects. The frontend dApp is found within the 'frontend' subdirectory, whereas the contract resides within the 'backend' subdirectory.

To install all necessary dependencies, execute the following command in the root of this project:

pnpm install

Contract

Contracts are developed using Hardhat. To ensure that the contract's confidentiality features function correctly, it is necessary to deploy the contract to the Oasis Sapphire network. The network may be a localnet, testnet, or mainnet.

To compile contracts in the Hardhat project, execute the following command inside 'backend' folder:

pnpm run build

The above step, is also required for frontend dApp development and build process.

Deployment Process

For the deployment of the contract, please execute the following command:

# Upon successful deployment of the contract, this script will automatically generate a poll.
npx hardhat deploy --network sapphire-testnet

Please confirm that the PRIVATE_KEY environment variable is set. This is because the Hardhat configuration defaults to this variable. Failing to set the PRIVATE_KEY will result in the use of the default Hardhat node localnet private key/s - it is strongly advised not to utilize those in a testnet or production environment.

Scripts

There are 2 scripts available for poll manipulation after the contract has been successfully deployed.

  • create poll
# Example usage of create poll script
HARDHAT_NETWORK=sapphire-testnet \
HARDHAT_POLL_MANAGER_CONTRACT=0xdAB5845136b3102E63023BB2A2405cb71608605d \
HARDHAT_ACL_NATIVE_BALANCE_CONTRACT=0x8e29375FE5Db7eBb1b5eF24B7D397bBF0B01De09 \
npx hardhat run ./scripts/create.ts
  • close poll
# Example usage of close poll script
HARDHAT_NETWORK=sapphire-testnet \
HARDHAT_POLL_MANAGER_CONTRACT=0xdAB5845136b3102E63023BB2A2405cb71608605d \
HARDHAT_PROPOSAL_ID=0x91a86550e12752aac5353d3dae5f59867acb9058055bc9e9331db99f7e7f5627 \
npx hardhat run ./scripts/close.ts

Important

The poll needs to be manually closed, after the closeTimestamp condition has been met.

Frontend

A prerequisite for running the frontend dApp entails executing the build command within the 'backend' directory. Please verify that the 'abis', 'artifacts', and 'src' folders have been created. If these folders are not generated, please refer back to the previous section for guidance on how to auto generate those folders.

To start a local server for the dApp, please execute the following command within the 'frontend' directory:

pnpm run dev

(back to top)

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

(back to top)