Giter Site home page Giter Site logo

portalnetwork / nifty-game Goto Github PK

View Code? Open in Web Editor NEW
279.0 10.0 148.0 61.1 MB

๐Ÿƒ๐ŸŽฎA NFT(ERC721) card game build on Ethereum, Truffle, Ganache and hosting on IPFS.

Home Page: http://game.portal.network

License: MIT License

JavaScript 76.50% HTML 1.22% CSS 22.28%
etheruem dapp ipfs smart-contracts serverless decentralized blockchain react redux saga

nifty-game's Introduction

Non-fungible token game

This project is a crypto card game that uses OpenZepplin.

The contract is compiled and deployed under the ERC-721 non-fungible token standard with truffle framework. After deploying onto the Ethereum blockchain, users will be able to play the game by interacting with the smart contract through DAPPโ€™s front-end interface.

Acquiring game card: Users can acquire game cards using ETH. Every game card will have a game point on it, which will be used to determine the winner later in the game.

Roles

Card Collection

Players can aquire card using ether. Each card will have a random points on it, which will be used to deternmine the winner in the card game.

Card Collection

Card Battle

Once entered the game, players will need to choose a card to play for the round. Each round, the smart contract will randomly decide either card with larger or smaller point wins the round. At the same time, the smart contract will also randomly generate a number in order to compete with the player. Winner of the game will receive the price.

Card Battle

Dashboard

You can view the card battle history about all the games you played.

Game History

ERC-721 Token

ERC-721 non-fungible token: ERC-721 is a free, open standard that describes how to build non-fungible or unique tokens on the Ethereum blockchain. While most tokens are fungible (every token is the same as every other token), ERC-721 tokens are all unique (with unique ID).

Reference

Contracts

You can find contract detail under contracts/ directory:

Technical stack

Frontend

  • React
  • Redux
  • Saga
  • Web3(MetaMask)

UI

  • Sass
  • Material-UI

Smart contract/Solidity

  • Truffle

Test environment/Private chain

  • ganache

Requirements

  • NodeJS 8.0+ recommended.
  • Windows, Linux or Mac OS X.

How To Install Dependencies

First install required dependencies:

You'll need local ethereum node, I recommend ganache-cli. You can install it from npm.

npm install -g ganache-cli

Install truffle:

npm install -g truffle

Then install contract dependencies:

npm install

How To Test

First make sure that local ethereum node is running. Execute:

ganache-cli --gasLimit 0xffffffffff -p 8545

Now you can compile and deploy contracts:

truffle compile && truffle migrate

Run contract tests:

truffle test

Playground

We already deployed contracts to Ropsten network. You can play with them RIGHT NOW.

Contract Token address Transaction hash
CryptoHerosGame 0xb4FF27d8cD1C5b1e3D4BD8A8FFEBdA9BE9517a4b 0x49bb8698e2951a0c7eb091038b500694cdf37c74ec51d6c98d91823dc9595b95
CryptoHerosToken 0xa82Bc392bF65d03A796E1666d27594fB31De4B93 0xf41868e6b59020965831aac218e1a521b283ab4975f10a44cf0908f6ce586ad7

Card List

See CARD.md for more information.

Contributing

See CONTRIBUTING.md for how to help out.

Licence

See LICENSE for details.

nifty-game's People

Contributors

ahlumin avatar billportalnetwork avatar goodvincenttu avatar mikecheng1208 avatar phyrextsai avatar seanchuangportal avatar thehollidayinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nifty-game's Issues

HiTeam

what's the problem? is there any group i can join?
image

nom start errors - please help

Failed to compile.

./node_modules/material-ui/styles/withStyles.js
Module not found: Can't resolve '@babel/runtime/core-js/map' in '/home/test/downloads/nifty-game/dapp/node_modules/material-ui/styles'
/home/test/downloads/nifty-game/dapp/scripts/start.js:11
throw err;
^


Can you help, please?

I can't get cards

in metamask use:localhost, and have run Ganachi already. but when i want to get cards, it's in loading page all the time.

How to run the front-end?

I can't figure out how to run the front-end. Everything else appears to be running though. I get a missing script: start when I try npm start.

Help?

npm start

When I run npm start,
it print error msg:

wade@wade-work:~/goWorkSpace/src/github.com/PortalNetwork/nifty-game$ npm start
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR! /home/wade/.npm/_logs/2018-12-04T07_05_17_567Z-debug.log

npm start error

./node_modules/material-ui/styles/withStyles.js
Module not found: Can't resolve '@babel/runtime/core-js/map' in '/home/wade/goWorkSpace/src/github.com/PortalNetwork/nifty-game/dapp/node_modules/material-ui/styles'

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.