VeVote is a decentralized governance platform. This repository serves as the monorepo for the VeVote project, containing all relevant components such as the frontend, smart contracts, and utilities.
Ensure your development environment is set up with the following:
- Node.js (v18 or later): Download here π₯
- Yarn: Install here π§Ά
- Docker (for containerization): Get Docker π³
- Hardhat (for smart contracts): Getting Started with Hardhat βοΈ
The main project is the apps/frontend folder. Everytime we start the frontend it will also compile the contracts (under the packages/contracts folder) and deploy them if they are not deployed yet. This will allow to have up to date ABIs, addresses and types in the frontend
A React-based application using Vite to provide a fast and efficient UI for interacting with VeVote.
- VeChain-kit: Used to manage wallet connections and blockchain interactions. Learn more
Smart contracts written in Solidity, managed with Hardhat for deployment on the VeChain Thor network.
Shared configurations and utility functions to streamline development.
Clone the repository and install dependencies:
yarnCopy the example environment file and configure it:
cp .env.example .envyarn solo-upyarn devThis command will:
- Start the frontend
- Deploy contracts if they are not already deployed
- Output logs for frontend and contract deployment
yarn contracts:deployAlternatively, clear the contract address in packages/config/local.ts and run yarn dev again.
yarn solo-downyarn solo-cleanyarn contracts:deploy:testnetyarn dev:testnetyarn contracts:deploy:mainnetyarn dev:mainnetThe VeVote smart contracts are located in packages/contracts and use Hardhat for compilation, deployment, testing, and documentation. These commands must be run from the root of the repository.
Compile all Solidity contracts:
yarn contracts:compileβ This must be run from the root directory. It compiles contracts using Hardhat and generates:
- ABI files (for the frontend)
- TypeChain TypeScript bindings
- Bytecode and metadata artifacts
To run local unit tests:
yarn contracts:testTo run tests against a Solo Thor network in Docker:
yarn contracts:test:thor-soloTests are located in packages/contracts/test/ and use Mocha + Chai.
Generate a Solidity test coverage report:
yarn test:coverage:solidityπ Coverage reports are written to
packages/contracts/coverage/.
Automatically generate Markdown docs from your contract NatSpec comments:
yarn contracts:generate-docsUseful for syncing with developer portals, GitBook, or Notion.
π Contract documentation is written to
packages/contracts/docs/.
To deploy contracts to the local Solo network:
yarn contracts:deployTo deploy to other networks:
yarn contracts:deploy:testnet
yarn contracts:deploy:mainnetπ‘ If you need to force a redeploy locally, clear the addresses in
packages/config/local.tsand re-runyarn dev.
Optionally verify your smart contracts on Sourcify. This allows 3rd parties to view and independently verify all of the following:
- Source code
- Metadata
- Contract ABI
- Contract Bytecode
- Contract transaction ID
After deploying SimpleStorage, the console will print the address of the deployed contract. You can verify the contract on sourcify.eth:
yarn contracts:verify:mainnet <contract-address> <contract-name>Read more about the verification process in the packages/contracts/scripts/verify/README.md file.