Leverage the power of Chainlink Functions to battle Pokémon on the blockchain. This application allows users to select two Pokémon and initiate a battle via smart contracts.
In this application, users select their favorite Pokémon to go head-to-head in a blockchain battle, with outcomes determined by Chainlink Functions.
To showcase the integration of Chainlink Functions in a gaming scenario where Pokémon engage in battles on the Ethereum blockchain.
- Familiarity with Ethereum and smart contracts.
- MetaMask or another Ethereum wallet.
- Ethereum (for gas fees) and test LINK tokens for Chainlink functions.
-
Clone the Repository
git clone https://github.com/[your-github-username]/pokemon-battle-smartcontract.git cd pokemon-battle-smartcontract
-
Install Dependencies
npm install
-
Set up Environment Variables
Create a
.env
file in the backend directory and add the necessary configurations.PRIVATE_KEY=Your_Ethereum_Wallet_Private_Key POLYGONRPC_URL=Your_Infura_Key
-
Deploy the SmartContract
Remember to create subscription through
Functions UI
. -
Run the App Locally
Go to frontend/. Update contract address and subscription id and run
npm run deb
This will launch the pokemon app on your local server, usually at
http://localhost:3000/
.
- Visit the deployed web app.
- Connect your Ethereum wallet (e.g., MetaMask).
- Select two Pokémon from the provided list.
- Click on the 'Battle on SmartContract' button.
- Approve the transaction in your Ethereum wallet.
- Watch as Chainlink Functions determine the battle outcome and display it on the app.
Contributions, issues, and feature requests are welcome. Feel free to check issues page if you want to contribute.
Distributed under the MIT License. See LICENSE
for more information.