Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/dylan751/near-app-vote-sc
- Owner: dylan751
- Created: 2022-06-22T14:19:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-05T15:48:37.000Z (over 2 years ago)
- Last Synced: 2024-09-25T16:09:20.796Z (5 months ago)
- Topics: blockchain, near-blockchain, nearprotocol, smart-contracts
- Language: Rust
- Homepage:
- Size: 1010 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-rust-list - dylan751/near-app-vote-sc - app-vote-sc?style=social"/> : Voting App using Near-Rust and implement ZKP. (Web3 and ZKP Framework)
- awesome-rust-list - dylan751/near-app-vote-sc - app-vote-sc?style=social"/> : Voting App using Near-Rust and implement ZKP. (Web3 and ZKP Framework)
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 |