/CoinFlip

Primary LanguageJavaScriptMIT LicenseMIT

CoinFlip - Double up your ETH!

Stargazers Issues MIT License LinkedIn Netlify Status Donate with Bitcoin

Dapp built on the Ethereum Network as a part of the programming course: Ethereum201 on academy.ivanontech.com.

Try it yourself: coinflip-double-up-your-eth.netlify.app/

Preview

Decentralized application built with Truffle/Infura and React for the Ethereum Network, and part of the programming course: Ethereum201 on academy.ivanontech.com.

Installation

Make sure you have the following ready:

  • npm installed
  • Truffle installed globally via npm install -g truffle (developped on v5.3.2).
  • Run a local blockchain via Ganache, or Ganache-cli, or register on Infura.io to deploy on an Ethereum network.
  • MetaMask installed in your browser
  • Cloned the repo via git clone

Development

Contracts

In your terminal, go to the COINFLIP 2.0 repo and type: cd blockchain npm install

To deploy your smart-contracts:

  • Run truffle migrate --network <<network name here>> to deploy to the network of your choice. So for Kovan, type truffle migrate --network kovan
  • Replace the contract address in client/constants
  • Replace the abi file in client/abis/coinFlip.json
  • Make sure to fund the contract in both ETH and LINK (Faucet for the Kovan network)

Client

Next, move back into the COINFLIP 2.0 repo (cd ../), then type: cd client npm install

Config

On each deploy, make sure to:

  • Change the COINFLIP_ADDRESS in /client/constants.js to your deployed contracts address
  • Copy the new abi file into /abis folder
  • Enable/disable, and update the suitable networks in truffle-config.js
  • Get your mnemonic seed phrase add it to blockchain/.secret

Use

You are now set to start your local server. Make sure you're still in COINFLIP 2.0/client and type: npm start

If you like it, a donation is always welcome!
Donate with Bitcoin