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

https://github.com/zmisgod/guess-number-contract

a small ethereum contract
https://github.com/zmisgod/guess-number-contract

dapp eth-contract ethereum game-contracts solidity solidity-contracts

Last synced: about 2 months ago
JSON representation

a small ethereum contract

Awesome Lists containing this project

README

          

# lottery game contract
let we guess a number between 1 and 6

## environment
- node v14.0
- ganache
- `npm install -g truffle`
- `metamask` -- chrome extension

## run
add some contract code
- `npm install` will install dependencies from openzeppelin
- `truffle compile` will compile the contract
- `truffle migrate` will deploy the contract to the current network
- `truffle test` will test the contract test file

change web code
- `cd web && npm insatll && npm run dev`

## config
change `contractAddress(your contract address)` and `adminAddress(your wallet address)` in `web/lib/web3.js`