Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dylan751/near-app-vote-sc

Voting App using Near-Rust and implement ZKP
https://github.com/dylan751/near-app-vote-sc

blockchain near-blockchain nearprotocol smart-contracts

Last synced: about 1 month ago
JSON representation

Voting App using Near-Rust and implement ZKP

Awesome Lists containing this project

README

        

# App Vote Project

## Useful Links

1. [App Vote Domain](https://app-vote-git-developphase2-app-vote-front-end.vercel.app/)
2. [App Vote Repository](https://github.com/btc-studio/app-vote-smart-contract)

## What is App Vote?

A NEAR smart contract for the Near Protocol based voting app.

- Allow users/organizations to create voting Poll for anything
- Allow users/organizations to create criterias for each Poll
- Allow users/organizations to create answer options
- Allow users/organizations to vote for their Polls

## Built with

- [NEAR](https://near.org/)
- [Rust Programming Language](https://www.rust-lang.org/)

## Prerequisites

### Rust toolchain

- Install Rust toolchain:
- Install rustup: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
- Configure the current shell: `source $HOME/.cargo/env`
- Add the wasm target to the blockchain network: `rustup target add wasm32-unknown-unknown`

### A NEAR account

- Create a NEAR account: https://wallet.testnet.near.org/create

### NEAR command-line interface (near-cli)

- Install near-cli: `npm install -g near-cli`

## App Vote Repository

### Overview

app-vote-smart-contract
├── Cargo.toml
├── README.md
├── build.sh
├── neardev
├ ├── dev-account
├   └── dev-account.env
├── notes
├   ├── DAO.md
├   ├── build-test-stable.md
├   ├── build-test.md
├   └── build.md
├── out
├   └── app-vote-contract.wasm
├── scripts
├   ├── create-data.sh
├   ├── log-deposit.sh
├   └── log-deposit.txt
├── src
├ ├── criterias.rs
├ ├── custom_struct.rs
├ ├── event.rs
├ ├── is_user_votes.rs
├ ├── lib.rs
├ ├── poll_options.rs
├ ├── polls.rs
├ ├── results.rs
├ ├── tests.rs
├ ├── users.rs
└ └── utils.rs

### Directory Details

- **build.sh** - Contains the build script
- **neardev** - The folder contains dev account which the Smart Contract being deployed to
- **out** - Contains .wasm file to push to blockchain
- **scripts** - Contains scripts
- **src** - Contains all the Smart Contract logic for App Vote

## Interacting with the App Vote contracts locally

### Deploy to testnet for usable API

1. Install dependencies

```shell
cargo install
```

2. Compile code to .wasm file

```shell
./build
```

3. Deploy to NEAR testnet

```shell
near dev-deploy ./out/app-vote-contract.wasm
```

4. Use smart contract id in **neardev/dev-account** to call in near-cli

```
near call dev-1660616028365-78983722768651
```

> For more information, see: `/notes/build-test.md`

## Network

development

## Contracts

| CONTRACT | ADDRESS |
| :----------: | :-------------------: |
| **App Vote** | app-vote.btcs.testnet |