https://github.com/xriot45/devote-smartcontracts
The Devote Smartcontracts contains Solidity-based smart contracts developed with Hardhat, handling all on-chain voting logic and immutable vote recording.
https://github.com/xriot45/devote-smartcontracts
dapps ethereum hardhat smart-contracts solidity typescript voting-application web3
Last synced: about 2 months ago
JSON representation
The Devote Smartcontracts contains Solidity-based smart contracts developed with Hardhat, handling all on-chain voting logic and immutable vote recording.
- Host: GitHub
- URL: https://github.com/xriot45/devote-smartcontracts
- Owner: xRiot45
- Created: 2025-07-08T16:29:30.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-07-20T16:04:03.000Z (11 months ago)
- Last Synced: 2025-10-20T10:03:49.498Z (8 months ago)
- Topics: dapps, ethereum, hardhat, smart-contracts, solidity, typescript, voting-application, web3
- Language: TypeScript
- Homepage:
- Size: 160 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ณ๏ธ Devote Smartcontracts
Devote Smartcontracts is a Solidity-based smart contract developed using the Hardhat framework. It powers the on-chain voting logic for the Devote platform and records each vote immutably on the blockchain while syncing voting activity with a backend off-chain API.
## ๐ Overview
This project contains a single contract `Voting.sol` that allows Ethereum wallet users to cast votes on pre-defined proposals. Voting is directly tied to wallet addresses, making every vote traceable on-chain and synced with backend services for additional data processing.
## โ๏ธ Features
- On-chain vote recording
- Each vote is tied to a wallet address
- Off-chain syncing via backend API
- Frontend integration using wagmi, ethers.js, and RainbowKit
## ๐ Project Structure
```
contracts/
โโโ Voting.sol # Main smart contract
scripts/
โโโ deploy.ts # Deployment script
hardhat.config.ts # Hardhat configuration file
```
## ๐ฆ Getting Started
### 1. Install Dependencies
```bash
npm install
```
### 2. Compile Contracts
```bash
npx hardhat compile
```
### 3. Deploy Contract (Local Network Example)
```bash
npx hardhat run scripts/deploy.ts --network localhost
```
## ๐งช Testing
There are no unit tests included at this stage.
## ๐ป Frontend Integration
The smart contract is integrated into a frontend built with Next.js using the following libraries:
- wagmi
- ethers.js
- RainbowKit
## ๐ Voting Details
- Votes are publicly linked to the sender's Ethereum address
- Each vote is written on-chain and synced off-chain for advanced backend handling
- No role-based access control (everyone can vote, but cannot create or manage proposals via the contract)
## ๐ก Deployment
> Note: The smart contract has not been deployed to any testnet or mainnet yet. To deploy, update `hardhat.config.ts` with your preferred network (e.g., Goerli, Sepolia, Polygon).