GithubHelp home page GithubHelp logo

voting's Introduction

Voting

๐Ÿ“ Introduce

It is a public voting platform based on the Ethereum blockchain. Users can create proposals and invite other users to vote on the proposals. The following are the front-end and back-end code and usage instructions of the platform.


๐Ÿซง Directory

  • โ”œโ”€โ”€ backend
  • โ”‚ โ”œโ”€โ”€ coin.sol
  • โ”‚ โ””โ”€โ”€ voting.sol
  • โ””โ”€โ”€ front
  • โ”œโ”€โ”€ img
  • โ”‚ โ””โ”€โ”€ index.png
  • โ”œโ”€โ”€ js
  • โ”‚ โ”œโ”€โ”€ jquery.js
  • โ”‚ โ”œโ”€โ”€ main.js
  • โ”‚ โ”œโ”€โ”€ web3.min.js
  • โ”‚ โ””โ”€โ”€ web3.min.js.map
  • โ”œโ”€โ”€ main.css
  • โ””โ”€โ”€ main.html

๐Ÿ–ฅ Running environment

  1. Start the local Ethereum blockchain or connect to a remote blockchain network.
  2. Run the application by opening the index.html file in a web browser.
  3. Connect your wallet to the application. Make sure the wallet is connected to the same blockchain network
  4. You can run the project on a variety of operating systems, including but not limited to Windows, Mac, and Linux.
  5. Node.js and npm: Make sure you have Node.js and npm installed on your system. These are tools for running JavaScript code and managing dependencies. You can do this on the official Node.js website
  6. Ethereum network: You need to connect to an Ethereum network in order to interact with the smart contract. You can choose to connect to the main Ethereum network, a test network (like Ropsten, Kovan, Rinkeby), or a local development network (like Ganache). If you don't have your own Ethereum node, you can use an Ethereum browser plugin wallet such as MetaMask to connect to the network.

๐Ÿ“ฒ Key features

  1. Create Proposals: The contract allows users to create new proposals. Proposals usually include information such as title, content, duration, and required funding. When creating a proposal, the user needs to provide these details and add the proposal to the contract.
  2. Vote: The contract allows other users to vote on proposals. The user can select a proposal to vote on based on the proposal's unique identifier (ID) and specify the amount of money used for the vote.
  3. Vote validation: The voting contract verifies that the amount of money used by the voter meets the requirements of the proposal. For example, if the proposal requires at least a certain amount of money per vote, the voting contract checks whether the voter's investment meets or exceeds that requirement.
  4. Transfer of funds: If the vote is successful, that is, the funds used for the vote meet the requirements of the proposal, the contract will automatically transfer the voter's funds to the address of the contract. This ensures transparency of the voting process and security of funds.
  5. Query proposal information: Users can query proposal details such as title, content, duration, current voting status, etc. through the unique identifier of the proposal. This enables the user to understand the situation of each proposal.

๐Ÿ“– UI Display

index

๐Ÿ“– Technology stack

  1. Ethereum blockchain: As the underlying infrastructure, it stores the voting contracts and all related data.
  2. Solidity: The programming language for Ethereum smart contracts, used to implement the logic of voting contracts.
  3. Web3.js: A JavaScript library for interacting with the Ethereum blockchain.
  4. HTML/CSS/JavaScript: front-end technologies for building user interfaces and interacting with smart contracts.

๐Ÿ“บ notice

  1. You need to have enough funds in your wallet to create a proposal or take a vote.
  2. Depending on your needs, you can customize the code and user interface to meet specific requirements.
  3. Be sure to treat the contract address and your private key information carefully and keep them secure

voting's People

Contributors

xu200 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.