https://github.com/banknatchapol/ethereumdev
Solidity : Create Voting Webapp using Blockchain backend.
https://github.com/banknatchapol/ethereumdev
dapp sol voting
Last synced: 2 months ago
JSON representation
Solidity : Create Voting Webapp using Blockchain backend.
- Host: GitHub
- URL: https://github.com/banknatchapol/ethereumdev
- Owner: BankNatchapol
- Created: 2020-08-30T04:19:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-30T14:45:44.000Z (almost 6 years ago)
- Last Synced: 2025-03-22T15:13:13.310Z (about 1 year ago)
- Topics: dapp, sol, voting
- Language: JavaScript
- Homepage:
- Size: 534 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EthereumWorkshop

## Understand Solidity
1. Variables and Types
2. Solidity Events
3. Function Modifiers
4. Mappings and Structs
5. Inheritance & Deployment
## Deploy Simple Voting
- Copy content of file Smart contarct/SimpleVoting.sol
- Open remix ide at https://remix.ethereum.org
- New file and put the code from first step (Smart contarct/SimpleVoting.sol)
- Click run
- Expand deploy panel
- candidateNames = ["Liverpool", "Manchester United", "Manchester City", "Arsenal"]
- transact
- Done!
## Run Simple Voting
- We need webserver to run our DApp so we have 2 simple solutions here.
### First solution - Chrome extension
- Install chrome extesion https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?hl=en
- Open
- Choose folder
- Select "DApp"
- Open http://127.0.0.1:8887 (open the link on web server url)
- Click "SimpleVoting.html"
### Second solution - use python
- cd DApp/
- run: python -m SimpleHTTPServer 8080
- Open http://localhost:8080
- Click "SimpleVoting.html"
### Third solution - use docker
```sh
#!/bin/sh
set -x
docker rm -f simplevote
docker run --name simplevote -p 8080:80 -v $PWD/DApp:/usr/share/nginx/html:ro -d nginx:alpine
set +x
echo "Go to http://localhost:8080/SimpleVoting.html"
```
### Live demo ( with jQuery )
- [https://dev.kulap.io/workshop/smartcontract/simplevote/SimpleVoting.html](https://dev.kulap.io/workshop/smartcontract/simplevote/SimpleVoting.html)
### Live demo ( with Vuejs )
- [https://dev.kulap.io/workshop/vuejs/simplevote/](https://dev.kulap.io/workshop/vuejs/simplevote/)
## Deploy your own ERC-20 token
- Copy content of file Smart contarct/ERC20Token.sol
- Open remix ide at https://remix.ethereum.org
- New file and put the code from first step (Smart contarct/ERC20Token.sol)
- Click run
- Choose ERC20Token
- Expand deploy panel
- _name = YOUR_COIN_NAME
- _symbol = YOUR_COIN_SHORTNAME
- _decimals = 2
- transact
- Done!