wat dis
--
The BBC ecosystem is comprised of 5 smart contracts: the ERC20 token (BBC Game), the Staking Contract and TeamBull, TeamBear and TeamCrab.
BBC Game is an ERC20 tax token. Taxes are used to fund prizes for the game.
The staking contract is the one holders interact with, it handles staking and unstaking and contains all the betting logic.
TeamBull, TeamBear and TeamCrab are mintable, non transferable dividend paying tokens.
All the game logic is automated and handled by the smart contracts
Here is a broad overview of how the contracts interact with each other:
The supported tokens on which holders can bet are all the Uniswap V2 pools and all the coins which price feed is available from Chainlink.
The available pools are Bull, Bear and Crab. Every time a bet gets opened, a crabPercentage variable is set, which defines the percentage variation of price below which the crab pool wins. If the price increases more than the crabPercentage the bull pool wins, if it decreases more than the crabPercentage the bear pool wins.
At the end of the game, the prize is split among the stakers of the winning pool depending on their stake/size of the pool ratio
You can stake on more than 1 pool at the same time, so you can apply some game theory to the way you allocate your tokens to the pools. For example if a pool is very undersubscribed, staking in that pool could make sense just from a r/r perspective because you would get a bigger pie of the prize for a small amount of tokens staked if that pool were to win.
A game goes as follows:
- Community votes on which coin to bet next
- The contract deployer opens a bet, with its own prize and duration
- You can place your bet (stake) until the start time, while staking is closed between the start time and the end time, where you just watch and pray
- When the end time comes, the prize is sent by the staking contract to the winning pool, you can now unstake and collect your prize
Staking contract
The staking contract manages the pools and works as a proxy for them, ie holders only interact with the staking contract, which internally calls the relevant functions on the teams contracts.
When a user stakes his BBC Tokens in a pool, the Staking Contract itself calls the stake function in the pool contract, which mints new pool tokens, while the unstake function burns pool tokens. This way staking and unstaking respectively increase and decrease the size of the staking pool.
The Staking Contract also fetches prices and keeps variables up to date. Every time you interact with it, all the time and price variables are updated. This is also the case for interactions with the ERC20 token (BBC): on every transfer, the staking contract is called to keep the variables up to date.
Team Contracts
The Team Tokens are mintable, non transferable ERC20.
They handle all the prize allocation logic. They keep track of the user’s shares in that pool and allocate prize accordingly. Other than being used to redeem your BBC Tokens when you unstake, you can’t do anything with them, they act as placeholders for your staked BBC.