Install dependencies
npm run install
Create a .env file and add your env variables
cp .env.example .env
Compile smart contract
npm run compile
Deploy with hardhat
npm run compile
npm run deploy:hardhat
Deploy with Viem
npm run compile
npm run deploy:viem <PROPOSAL_1> <PROPOSAL_N>
See your contract deployed in:
https://sepolia.etherscan.io/address/<CONTRACT_ADDRESS>
Cast vote:
npm run contract:cast-vote <CONTRACT_ADDRESS> <PROPOSAL_INDEX>
Give right to vote:
npm run contract:give-right-to-vote <CONTRACT_ADDRESS> <NEW_VOTER_ADDRESS>
Delegate vote:
npm run contract:delegate-vote <CONTRACT_ADDRESS> <DELEGATE_VOTE_ADDRESS>
Query winner name:
npm run contract:query-winner-name <CONTRACT_ADDRESS>
Query winning proposals
npm run contract:query-winning-proposals <CONTRACT_ADDRESS>