This repository contains a project of a Pokémon Trading Card Game using ERC 721 Non-Fungible Tokens. A special token is rewarded to a lucky user using on-chain verifiable random functions.
The dapp was created using a sample project from buidler. The NFTs were created following this guide. The random number generator used to mint the special tokens was created using this Chainlink VRF tutorial.
Wanna see this project live? Try it out.
The first things you need to do are cloning this repository and installing its dependencies:
git clone https://github.com/Obalfour/CryptoPokes.git
cd CryptoPokes
npm install
Before deploying your contract you have to set the credentials in your .env file
Then, on a new terminal, go to the repository's root folder and run this to deploy PokeToken contract:
npx buidler run scripts/deploy_PokeToken.js --network kovan
Finally, we can run the frontend with:
cd frontend
npm install
npm start
Open http://localhost:3000/ to see your Dapp. You will
need to have Metamask installed and listening to
the Kovan network
.
Your environment will have everything you need to build a Dapp powered by Buidler and React.
- Buidler: An Ethereum development task runner and testing network.
- Chainlink: A library to interact with a descentralized oracle network.
- OpenZeppelin: A library of secure smart contracts.
- Mocha: A JavaScript test runner.
- Chai: A JavaScript assertion library.
- ethers.js: A JavaScript library for interacting with Ethereum.
- Waffle: To have Ethereum-specific Chai assertions/mathers.
- A sample frontend/Dapp: A Dapp which uses Create React App.
-
PokeToken: An ERC721 contract for Pokémon collectible cards. Try it on Remix.
-
RandomNumberConsumer: A contract that uses Chainlink VRF for minting a special collectible card. Try it on Remix.
Additional information about Chainlink and the database for the metadata API is available in the docs section. There is also an article on Medium.
Invalid nonce
errors: if you are seeing this error on thebuidler node
console, try resetting your Metamask account. This will reset the account's transaction history and also the nonce. Open Metamask, click on your account followed bySettings > Advanced > Reset Account
.
151 pokemon of Kanto icon set by Geovanny Gavilanes
Pokemon icons by roundicons.com
We want to thank the entire Chainlink community for the support.
I'm not affiliated with Nintendo in any way. Pokémon® is a registered trademark by Nintendo. Nintendo® is a registered trademark.