daenamkim / ethereum-campaign

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KICKETHER

Live Demo

Note that this demo is only working on Rinkeby test net.

This is one of my hobby to build a DApp using Ethereum Blockchain.

Features

  • Campaign owner can create a campaign
  • Campaign owner can create requests to send Ether to a vendor
  • Each request is approved by a majority of all contributors
  • Finalize to send Ether to the vendor

App Development

  • Set $RINKEBY_API (if you don't have API url please create it through INFURA) in your local environment
$ export RINKEBY_API=https://rinkeby.infura.io/v3/e8b3e20085c348e3989fcc83c4*****
$ yarn
$ yarn start

App Deployment

  • Set NODE_ENV to production
  • Set $RINKEBY_API

And just run a command below or using a service like Heroku. If you don't use Heroku, need to build a web server to port forward or Zeit but Zeit didn't work well for me.

$ yarn start

Contract Development

You can change a /ethereum/contracts/Campaign.sol for you through Remix. Copy all contents of it to Remix and you can write solidity tests in /test/Campaign.test.js if you are sure what you want to do.

$ yarn test

Contract Deployment

$ cd ethereum
$ node deploy.js
Attempting to deploy from account 0x672b39F0D2609a6FeC23358f4b8D8c92104BAF56
Contract deployed to 0x36334DDe59be7453B82ADf8807a00713a0678D8F

You can check Campaign Factory contract through Etherscan

After command above you should copy Contract deployed to into 'HERE' as below and restart a server.

...
const instance = new web3.eth.Contract(
  JSON.parse(CampaignFactory.interface),
  'HERE'
);
...

TODO

  • Upgrade all libraries (Next.js, web3, solc, ...) to the latest version
  • Add code coverage and test automation using CI

About


Languages

Language:JavaScript 100.0%