voting contract
Referral-Based Voting on Flow is a dApp built on the Flow blockchain, designed to promote community engagement through a voting mechanism enhanced by a referral-based incentives
説明
🗳️ Referral-Based Voting on Flow
This project is a decentralized voting application built on the Flow blockchain that incorporates referral-based voting power boosts. Voters can refer others to join the system and increase both their own and their referees' voting power.
🌐 Network
Blockchain: Flow
Environment: Testnet
Testnet Contract Address: 0x36251cDE0FdF148967e8dEce09Aa1F30d80dC016
📦 Contract Overview
This smart contract implements a community-driven voting system where:
Voters register with or without a referrer.
Referred users receive an additional vote power boost.
Referrers are rewarded with extra voting power as an incentive.
Each voter can vote only once, and votes are weighted by their current vote power.
📌 Deployed Contract(s) Contract Name Address Network ReferralVoting 0x36251cDE0FdF148967e8dEce09Aa1F30d80dC016 Flow Testnet 🔧 Functionality Function Description register(referrer: Address) Registers the caller as a voter. Referrer is optional. vote(candidateId: UInt) Allows a registered voter to vote for a candidate. getVotePower(voter: Address): UInt Returns the voting power of the given address. getVotes(candidateId: UInt): UInt Returns the total number of votes a candidate has received. 💡 Voting Power Mechanics
Base Power: 1
+1 if the voter was referred
+1 to the referrer when someone registers using their address
Vote power is locked in at time of voting
🚀 How to Interact (Conceptual)
You can interact with the contract using Flow tools such as:
Flow CLI
FCL (Flow Client Library)
Testnet Playground
DApp frontend (coming soon)