Battle of CryptoBeasts is a PvP card game where you defy your friends or play against strangers just to have fun, you are not becoming rich by playing it.
This repository contains the smart contracts for the token (the coin), the game (the cards) and the marketplace (the shop).
It uses the OpenZeppelin framework for the smart contracts.
It also uses Brownie for testing and deployment.
Install the requirements:
pip install -r requirements.txt
Then you have to create a .env file using .env.example template
cp .env.example .env
Read the comments in the file to know what to do.
You also need to have OpenZeppelin insalled
brownie pm install OpenZeppelin/openzeppelin-contracts@4.8.2
To run the tests, you need to have ganache-cli installed
npm install -g ganache-cli
To run the tests, execute
brownie test
To deploy, you can use:
brownie run deploy --network goerli
If you want to deploy on sepolia, you have to add it to brownie using
source .env
brownie networks add sepolia sepolia chainid=11155111 host="https://sepolia.infura.io/v3/$WEB3_INFURA_PROJECT_ID" \
explorer="https://api-sepolia.etherscan.io/api"
To use deploy script as-is, you have to create an account called rinkeby_account using:
brownie accounts new rinkeby_account
Or you can edit the deploy script to use your own account.
The game is deployed on the Mumbai test network of Polygon, so it can be played for free.
To play, you need to have Metamask installed, a browser extension that allows you to interact with decentralized applications.
By default, Metamask operates on the Ethereum network, but it is compatible with other EVM-based networks, such as Polygon. To add the Polygon Mumbai test network to Metamask, you can follow the instructions shown in this Datawallet blogpost.
MATIC tokens from the Mumbai test network are essential to interact with the smart contract. You can get them at the Mumbai faucet.
We have implemented a smart contract to gift CBC tokens that allow you to play the game. (pending, create an interface to request these tokens)
Once you have CBC tokens, you can buy booster packs. You need at least 20 cards to be able to play.
Go to the "Play" option to find opponents and start a match.
This is a work in progress by LAML, MAPV and GMVS. We are a group of grad students from the Universidad Nacional de Colombia.