POC Project of a Pokemon marketplace using NFT.
With this project the client will be able to:
- Create random pokemons
- Setting prices for selling pokemons
- Buying pokemons that are open for sale.
You can read more about it on this blogpost: Creating a pokemon marketplace using NFT
- Solitidy (Smart contracts)
- Node.js (Backend)
- React (Frontend)
- OpenZeppelin (Solidity Reusable smart contracts)
- Hardhat (Ethereum development environment)
- Ethers (Ethereum blackchain interaction package)
This project also uses
To run the project locally you'll need to
- Install the dependencies
- Compile the smart contracts and copy the contract to the folder that is served by the backend
- Start a network node and deploy the contract to it
- Create a Pinata account
- Fill the environment variables and Start the project's backend and frontend
- Install Node.js
- Install Yarn by running
$ npm install -g yarn
- Install the rest of the dependencies by running
$ make install-dependencies
on the project root folder
You can compile the smart contract and copy it for the backend / frontend usage with a single command
$ make compile-and-copy
To start a network node you need to execute the command below on the terminal:
$ npx hardhat node
To deploy the smart contract to this node on another terminal window, execute:
$ npx hardhat run scripts/deploy.js --network localhost
Creating a Pinata account is free and very intuitive, after doing that you'll need to create API keys in this link
Rename the files: web/client/.env.example -> web/client/.env web/.env.example -> web/.env
Fill the Pinata API Keys data on web/.env
On the web folder execute the command below to start a backend and a frontend instances on your local environment
$ yarn dev
To deploy the contract to a live network you'll need:
- An account with assets
- An Alchemy Key (Optional)
- Create a network on
hardhat.config.js
with the account's private key - Execute the deploy script pointing to the desired network e.g.
npx hardhat run scripts/deploy.js --network rinkeby
This project's hardhat.config
file has a Rinkeby Network pre configured, where you only need to set the ALCHEMY_API_URL
and the WALLET_PRIVATE_KEY
. You can read more about setting networks on https://hardhat.org/hardhat-network/
This contract is currently deployed to the Rinkeby testnet.
-
It can be checked on Etherscan https://rinkeby.etherscan.io/token/0xb7a6e62bb3b6752f4a3285fbf1a32f0394cf31ed?a=0x0bd8361d4bbd35842e6ead678cfadf59247c0188
-
The tokens can be listed on Opensea https://testnets.opensea.io/collection/poketoken-v4
- Testing
$ npx hardhat test
- Create random pokemons
- Setting prices for selling pokemons
- Buying pokemons that are open for sale.