This is a Soroban Smart Contract project showing how to create a proposal and have other people vote on the proposal. It is built using Soroban, Next.js and TypeScript.
The project contains a Soroban Smart Contract and a frontend project. The Soroban Smart Contract project contains the smart contract required to mmanage the proposals and keep track of the votes for and against them. It is deployed on the Stellar Soroban Network. The frontend project contains the frontend code that interacts with the smart contract. It showcases how to create a proposal and have other people vote on the proposal.
You can check out the blog post for this project here as well as a video tutorial explaining the project here.
You can check out the demo of the project here.
Use yarn to install dependecies.
yarn
Follow the steps below to set up the backend.
cd backend
Make sure to start from a clean setup:
yarn clean
-
Make sure you have soroban-cli installed, as explained above
-
Deploy the contracts and initialize them
yarn setup
This runs
./initialize.sh
behind the scenes, which will create atoken-admin
identity for you (soroban config identity create token-admin
) and deploy the vote contract, with this account as admin. -
Select the Futurenet network in your Freighter browser extension
Follow the steps beloww to setup and run the frontend for the Soroban Vote DAPP
cd frontend
You need to have deployed the smart contracts first. See above for more details
yarn dev
Open http://localhost:3000 with your browser to see the result.
The project contains backend and frontend workspaces, together with packages, that can be used to extract some logic there.
backend/
frontend/
packages/
.../
.../