Documentation | Website | Demo
bB is a mobile gaming and social dApp for Gen Z and young Millennials, incentivizing real-world community action through interactive quests. Partnering with major brands, NGOs, influencers, and research institutions, bB blends gaming with social impact.
Players complete quests across five pillars—Health & Fitness, Nutrition & Health, Environment, The Arts, and Education—earning tokenized rewards (gems) that can be traded for progression and prizes.
Before you begin, you need to install the following tools:
- Node (>= v18.17)
- Yarn (v1 or v2+)
- Git
- Rust
- asdf
- Cairo 1.0 extension for VSCode
To ensure the proper functioning of bB, your local starknet-devnet
version must be 0.2.0
. To accomplish this, first check your local starknet-devnet version:
starknet-devnet --version
If your local starknet-devnet version is not 0.2.0
, you need to install it.
- Install Starknet-devnet
0.2.0
viaasdf
(instructions).
To ensure the proper functioning of bB, your local Scarb
version must be 2.8.3
. To accomplish this, first check your local Scarb version:
scarb --version
If your local Scarb version is not 2.8.3
, you need to install it.
- Install Scarb
2.8.3
viaasdf
(instructions).
To ensure the proper functioning of the tests on bB, your Starknet Foundry version must be 0.31.0. To accomplish this, first check your Starknet Foundry version:
snforge --version
If your Starknet Foundry version is not 0.31.0
, you need to install it.
- Install Starknet Foundry
0.31.0
viaasdf
(instructions).
- Starknet-devnet - v0.2.0
- Scarb - v2.8.3
- Snforge - v0.31.0
- Cairo - v2.8.2
- Rpc - v0.7.1
To get started with bB, follow the steps below:
- Clone this repo and install dependencies
git clone https://github.com/bB-Foundation/bb-contracts.git
cd bb-contracts
yarn install
- Run a local network in the first terminal.
yarn chain
To run a fork :
yarn chain --fork-network <URL> [--fork-block <BLOCK_NUMBER>]
This command starts a local Starknet network using Devnet. The network runs on your local machine and can be used for testing and development.
- On a second terminal, deploy the sample contract:
yarn deploy
This command deploys a sample smart contract to the local network. The contract is located in contracts/src
and can be modified to suit your needs. The yarn deploy
command uses the deploy script located in scripts/deploy.ts
to deploy the contract to the network. You can also customize the deploy script.
By default bB
takes the first prefunded account from starknet-devnet
as a deployer address,
- On a third terminal, start your NextJS app:
yarn start
Visit your app on: http://localhost:3000
. You can interact with your smart contract using the Debug Contracts
page.
- Check your environment variables. We have a yarn postinstall script that helps to fill in your environment variables. If the environment variable does not exist, you can fill them it manually to get the app running!
-
Make sure you alredy cloned this repo and installed dependencies.
-
Prepare your environment variables.
Find the .env
file and fill the env variables related to Sepolia testnet with your own wallet account contract address and private key.
-
Change your default network to Sepolia testnet.
-
Get some testnet tokens
You will need to get some ETH
or STRK
Sepolia tokens to deploy your contract to Sepolia testnet.
Some popular faucets are Starknet Faucet and Blastapi Starknet Sepolia Eth
- Open a terminal, deploy the sample contract to Sepolia testnet:
yarn deploy --network sepolia
To ensure the proper functioning of the bB with Testnet or Mainnet, your RPC version must be 0.7.1
. This repository contains a .env.example
file, where we provided the default RPC URL for the Starknet Testnet: RPC_URL_SEPOLIA=https://starknet-sepolia.public.blastapi.io/rpc/v0_7
. Let's verify this RPC version is 0.7.1
by calling a POST
request in an API platform like Postman
or Insommia
. Your API endpoint should be https://starknet-sepolia.public.blastapi.io/rpc/v0_7
and the body should be:
{
"jsonrpc":"2.0",
"method":"starknet_specVersion",
"id":1
}
You have to paste the endpoint and body in the API platform and click on the Send
button. If the response is 0.7.1
, then you are good to go. Otherwise, you have to get the correct RPC URL endpoint.