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
- 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
- Install rustup:
- Create a NEAR account: https://wallet.testnet.near.org/create
- Install near-cli:
npm install -g near-cli
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
- 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
- Install dependencies
cargo install
- Compile code to .wasm file
./build
- Deploy to NEAR testnet
near dev-deploy ./out/app-vote-contract.wasm
- 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
development
CONTRACT | ADDRESS |
---|---|
App Vote | app-vote.btcs.testnet |