Skip to content

monipigr/FlyCoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—³οΈ FlyCoin Voting System

πŸ“ Overview

FlyCoin is a ERC20 token designed to manage voting rights securely. Tokens represent votes and are burned upon use, ensuring transparency and tramper-proof decision-making.


✨ Features

πŸ›Έ Airdrop Claiming system

Users can claim their airdrop only if they are on the voters list.

πŸ” Token-based voting mechanism to control voting rights

Allowed voters can vote if they have tokens and have not already voted

πŸ”₯ Token burned after vote right used

After using the voting right, tokens are burned to control and ensure contract viability.

🀝 Vote delegation feature

Voters can delegate their vote right to other allowed voters.

πŸ‘‘ Ownership voting control

Only the smart contract owner can transfer tokens.

πŸ“’ Vote transparency

Events track votes for transparency and public verification.


πŸ›  Technical Details

  • Solidity Version: ^0.8.24
  • Inheritance:
    • ERC20: For FlyCoin token implementation.
    • Ownable: Ensures only the owner can control voting session state.
  • Key Functions:
    • claim(): Users can claim their tokens.
    • transfer(): Only the admin can transfer tokens to allowed voters.
    • transferFrom(): Transfers between users are not allowed.
    • vote(): Voters can use their voting right and tokens are burned after it.
    • delegateVote(address): Voters who has not already vote can delegate their voting right.
    • voteDelegated(): Votes with delegated votes can use their delegated voting right.

βš™οΈ How to Use

πŸš€ Deploying the Smart Contract

  1. Open Remix IDE.
  2. Create a new Solidity file and paste the contract code.
  3. Compile the contract using Solidity 0.8.24.
  4. Deploy using Remix VM for local testing.

βœ… Interacting and Testing

πŸ›Έ Claim the airdrop

  • Ensure their token balance decreases by 5 after voting.
  • Ensure they cannot vote twice, even if they have tokens.
  • Ensure they cannot delegate their vote if they have already voted.

πŸ—³οΈ Casting a Vote

  • Users with tokens can vote
  • Ensure their token balance is reduced by 5 after voting.
  • Ensure they cannot vote twice, even if they have tokens.
  • Ensure they cannot delegate their vote if they have already voted.

🀝 Delegating the voting right

  • Users with voting rights can delegate their vote.
  • Ensure they cannot delegate their vote if they have already voted.
  • Ensure they have enough tokens to delegate.
  • Ensure they cannot delegate their vote if they have alredy delegated.

πŸ—³οΈ Using a delegated vote

  • Users who received a delegated vote can vote.
  • Ensure they cannot vote twice with delegating votes.
  • Ensure they can also vote if they have claimed they airdrop.

πŸ“œ License

This project is licensed under LGPL-3.0-only.

About

A token-based voting smart contract built with Solidity that leverages an ERC20 token for on-chain governance, featuring controlled airdrop distribution, vote delegation, and automatic token burning to enforce one-vote-per-user execution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors