The AI Voting Advisor is a smart contract that simulates an intelligent voting system. It allows users to vote on predefined options and provides a recommendation ("AI suggestion") based on the majori
# 🤖 AI Voting Advisor (Flow Testnet)
## Overview
The AI Voting Advisor is a smart contract that simulates an intelligent voting system.
It allows users to vote on predefined options and provides a recommendation ("AI suggestion") based on the majority trend.
This project is built and deployed on the Flow blockchain testnet.
---
## 🧠 Features
- Vote for one of several predefined options.
- Prevents duplicate voting (one vote per address).
- Tracks all votes on-chain with timestamps.
- Provides an AI-like recommendation — the option currently leading in votes.
- Transparent, decentralized, and open for community interactions.
---
## 🔗 Deployment Details
Network: Flow Testnet
Contract Address: 0xF73b7B899f33640fC1c327427C50B4180AFA43a9
](https://testnet.flowscan.org/account/0xF73b7B899f33640fC1c327427C50B4180AFA43a9)
### Deployed / Used Contracts:
| Contract Name | Address | Purpose |
|----------------|---------------------------------------------|--------------------------------|
| AIVotingAdvisor
| 0xF73b7B899f33640fC1c327427C50B4180AFA43a9
| Handles voting logic and AI suggestion mechanism |
---
## 🧩 Contract Summary
The contract is designed to be constructor-free and self-contained, requiring no imports or external dependencies.
### Key Functions
| Function | Description |
|-----------|--------------|
| initializeOptions()
| Initializes voting options OptionA
, OptionB
, OptionC
) once. |
| vote(string _option)
| Allows a user to cast a vote for a valid option. |
| getAISuggestion()
| Returns the currently leading option ("AI suggestion"). |
| getVotesFor(string _option)
| Returns the total votes for a given option. |
| getOptions()
| Returns all available options. |
---
## 🧪 Testing
You can interact with the contract using Flow CLI, Flow Playground, or Cadence scripts.
Make sure to connect to the Flow Testnet before execution.
Example interaction sequence:
1. Call initializeOptions()
2. Call vote("OptionA")
or another valid option
3. Query getAISuggestion()
to see the current top option
---
## ⚙️ Tech Stack
- Blockchain: Flow Testnet
- Language: Solidity (for demonstration purposes; concept adaptable to Cadence)
- Tools: Flow CLI / Flow Playground
---
## 📜 License
This project is released under the MIT License.
Feel free to modify, deploy, and build upon it.
---
Author: AI Voting Advisor Project Team
Deployed on: Flow Testnet @ 0xF73b7B899f33640fC1c327427C50B4180AFA43a9
50%
n/a