This is a application to implement voting in solidity smart contract using ReactJS and deployed it in CosVM. Links about the project : One Pager doc , Security Analysis , System Architecture
Install the packages using
npm install
In deploy.js file, Make sure to feed the
- Record of voters mapped to their respective wallet public keys
- Record of candidates participating in the election so that the vote can be cast appropriately
- Voting time
Compile the contract and upload it to the blockchain network. Run the following commands to compile and upload the contract.
To copy the contents of .env.example into a new file .env,
cp .env.example .env
And add the private key of your wallet here which offers gas fee as CVM for deploying the smart contract
npx hardhat compile
npx hardhat run --network cosvm scripts/deploy.js
Once the contract is uploaded to the blockchain, copy the contract address and copy it in the .env file. You can also use another blockchain by writing the blockchain's endpoint in hardhat-config.
Steps before running the frontend
- Paste the Private key in .env file
- Paste the contract address once depolyed in constant.js file
Once setup, simply run the command :
npm start
CONTRIBUTORS: Ashwin Rajagopal, Vishrudh Raj, Lok Visnu , Akshay (Myself).