Skip to content

QuillaChow/coin-flipping

Repository files navigation

Coin-Flipping

Coin-Flipping is a DApp for playing coin game online. This application allows two or more participants to play a coin-flipping game fairly and transfer funds to each other safely by using Ethereum. In the first round, each participant need to send the amount and the hash value of the bet number to the contract. In the second round, each participant need to send their initial bet number to the contract.

Requirements

ganache 2.1.2

metamask 7.1.8

truffle 5.1.20

lite-server

Usage

Start Ganache

Check truffle.js

cd coin-flipping

Set the port to you Ganache port.

module.exports = {
  // See <http://truffleframework.com/docs/advanced/configuration>
  // for more about customizing your Truffle configuration!
  networks: {
    development: {
      host: "127.0.0.1",
      port: 7545,
      network_id: "*" // Match any network id
    }
  }
};

Compile

truffle compile

Migrate

truffle compile

Start Server

lite-server

You will see the interface of the bank.

avatar

By accessing the interface of the player, go to localhost:[port]/player.html

avatar

Releases

No releases published

Packages

No packages published