Code Monkey home page Code Monkey logo

coinflip_2.0's Introduction

CoinFlip - Double up your ETH!

Stargazers Issues MIT License LinkedIn Netlify Status

Updates

  • 2022/07 - Switch to Chainlink VRF v2 & Update solidity compiler version to 0.8.7;
  • 2022/12 - Switch to Goerli network v2 & upgrade all deps & Update solc to 0.8.16;

Description

Decentralized application (Dapp), EVM compatible, built as a part of the programming course: Ethereum201 on academy.moralis.com.

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

Preview

Built With

  • React
  • web3.js
  • solidity
  • chainlink
  • truffle
  • ganache

Getting Started

Prerequisites

Make sure you have the following ready:

  • yarn installed
  • Truffle installed globally via npm install -g truffle (developped on v5.4.17).
  • 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

Smart-Contracts Deployment

In your terminal, make sure you are in the COINFLIP_2.0 repo, and type:

yarn install

To deploy your smart-contracts:

truffle migrate --network <<network name here>>

So for Goerli, type:

truffle migrate --network goerli
  • Replace the contract address in src/constants.js
  • Replace the abi file in src/abis/coinFlip.js
  • Make sure to fund the contract with some ETH ( Faucet for the Goerli network )

Config & Client

Before each deploy, make sure to:

  • Change the COINFLIP_ADDRESS in /src/constants.js to your deployed contracts address;
  • Copy the new abi file into the src/abis folder if you've made any changes to the contracts;
  • Enable/disable, and update the suitable networks in truffle-config.js;
  • In the blockchain/ repo, create a file called .secret and paste your mnemonic seed phrase inside; (Make sure you add this file in your .gitignore!!!)

Acknowledgments

Use

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


# Enjoy!!!

⭐️ ... and don't forget to leave a star if you like it! ⭐️

(back to top)

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.