Skip to content

dylan751/near-app-vote-sc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

App Vote Project

Useful Links

  1. App Vote Domain
  2. App Vote Repository

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

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

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
cargo install
  1. Compile code to .wasm file
./build
  1. Deploy to NEAR testnet
near dev-deploy ./out/app-vote-contract.wasm
  1. Use smart contract id in neardev/dev-account to call in near-cli
near call dev-1660616028365-78983722768651 <command> <arguments>

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

Network

development

Contracts

CONTRACT ADDRESS
App Vote app-vote.btcs.testnet

About

Voting App using Near-Rust and implement ZKP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •