An open API service indexing awesome lists of open source software.

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.

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).