Skip to content

minhtran241/lottery-contract-truffle-react

Repository files navigation

Truffle and React.js Template - Lottery Contract


comet

Rapid Ethereum Dapp Development

made for ethereum MIT license


You can explore this contract on TESTNET Goerli (GTH) Blockchain Explorer (Etherscan) at here


Smart Contract Lottery Development with Create-React-App

How does this differ from the official React Truffle Box?

  • No ejection required;
  • React frontend is located in its own separate folder (i.e. /client);
  • Babel is included so you can use ES6 module import statements;
  • Uses Truffle 5.6
  • Uses Web3 1.6

If you have Truffle installed, run the following to get started (more detailed instructions below):


Install Truffle globally

npm install -g truffle

Testing

First, make sure Ganache is running

yarn ganache

Compile

yarn compile

Run all tests

yarn test

To run tests in a specific file, run

yarn test [path/to/file]

Deploy by connecting to Infura node (specific provider)

Note: You have to set up all the environment variables before doing this step

yarn deploy