ptantiku / EthereumWorkshop

Ethereum workshop

Home Page:https://dev.kulap.io/workshop/smartcontract/simplevote/SimpleVoting.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Second solution - use python

Third solution - use docker

#!/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 here

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!

About

Ethereum workshop

https://dev.kulap.io/workshop/smartcontract/simplevote/SimpleVoting.html


Languages

Language:JavaScript 95.5%Language:HTML 4.5%