This project implements a decentralized voting system using a smart contract on the Sepolia blockchain. The contract allows voters to participate in a vote by casting their vote directly, delegating their vote to another voter, or checking the results.
(The repo's default contract Address is 0xcb883c97860e0B367bB1b3c6C4bC5CedFd1c35D6)
npx ts-node --files ./scripts/DeployWithViem.ts "arg1" "arg2" "arg3"
npx ts-node --files ./scripts/CheckProposals.ts
npx hardhat run ./scripts/CheckProposals.ts
Both commands are the same
npx ts-node --files ./scripts/GiveRightToVote.ts {address}
replace {address} by the address you want to give the right to
npx ts-node --files ./scripts/Delegate.ts {address}
replace {address} by the address you want to Delegate
Vote for Proposal 1:
npx ts-node --files ./scripts/CastVote.ts 0
Vote for Proposal 2:
npx ts-node --files ./scripts/CastVote.ts 1
Vote for Proposal 3:
npx ts-node --files ./scripts/CastVote.ts 2
npx hardhat run ./scripts/CheckWinner.ts