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.
- 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.
Network: Flow Testnet
Contract Address: 0xF73b7B899f33640fC1c327427C50B4180AFA43a9
| Contract Name | Address | Purpose |
|---|---|---|
AIVotingAdvisor |
0xF73b7B899f33640fC1c327427C50B4180AFA43a9 |
Handles voting logic and AI suggestion mechanism |
The contract is designed to be constructor-free and self-contained, requiring no imports or external dependencies.
| 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. |
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:
- Call
initializeOptions() - Call
vote("OptionA")or another valid option - Query
getAISuggestion()to see the current top option
- Blockchain: Flow Testnet
- Language: Solidity (for demonstration purposes; concept adaptable to Cadence)
- Tools: Flow CLI / Flow Playground
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