An open API service indexing awesome lists of open source software.

https://github.com/thedefibat/lottery-dapp

A decentralized Lottery System build using Smart Contracts along a UI using React
https://github.com/thedefibat/lottery-dapp

Last synced: 12 months ago
JSON representation

A decentralized Lottery System build using Smart Contracts along a UI using React

Awesome Lists containing this project

README

          

# Lottery DApp

This repository contains all code for the smart contracts and front-end.

## Requirements / Dependencies
* Node
* NPM
* Truffle
* React.js

## Instructions

* Clone the repo `cd into the repo
* Run the following:
```
npm i -g truffle
npm install
cd app
npm install
```
* Start the truffle local network:
```
truffle develop
```
* Inside the network, compile the contracts and deploy them:
```
compile
migrate
```
* Open new terminal
* Run:
```
cd app
npm start
```

A browser window should open where you can interact with the contract

## Unit test
* Solidity unit tests are written in the tests directory, see the demo [test](./test/simpleContract.test.js);
* React unit tests can be written in there relavent compondents

## Solidity Unit test
* to run solidity test
```
truffle test
```