https://github.com/jitendragangwar123/bet-fusion
Bet Fusion is a decentralized betting game platform where players wager on CoinFlip, SpinWheel, and DiceRoll, each offering unique odds and rewards. With Chainlink VRF, every outcome is provably fair and tamper-proof, ensuring transparency and trust.
https://github.com/jitendragangwar123/bet-fusion
base-blockchain chainlink foundry nextjs onchain-gaming smart-contracts solidity
Last synced: about 2 months ago
JSON representation
Bet Fusion is a decentralized betting game platform where players wager on CoinFlip, SpinWheel, and DiceRoll, each offering unique odds and rewards. With Chainlink VRF, every outcome is provably fair and tamper-proof, ensuring transparency and trust.
- Host: GitHub
- URL: https://github.com/jitendragangwar123/bet-fusion
- Owner: jitendragangwar123
- Created: 2025-01-03T18:05:14.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-05T17:38:21.000Z (4 months ago)
- Last Synced: 2025-03-02T19:16:33.368Z (about 2 months ago)
- Topics: base-blockchain, chainlink, foundry, nextjs, onchain-gaming, smart-contracts, solidity
- Language: Solidity
- Homepage:
- Size: 1.91 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bet Fusion ๐ฐ
**Bet Fusion** is a decentralized betting game platform where players wager on **CoinFlip**, **SpinWheel**, and **DiceRoll**, each offering unique odds and rewards. With **Chainlink VRF**, every outcome is **provably fair** and **tamper-proof**, ensuring transparency and trust.---
### ๐ Features
- **Decentralized Gameplay**: Built on blockchain technology for fairness and security.
- **Provably Fair Outcomes**: Utilizes **Chainlink VRF** to ensure tamper-proof randomness.
- **Multiple Betting Options**: Choose from **coin flips**, **spins**, or **dice rolls** for diverse gameplay.
- **Dynamic Rewards**: Each game type offers unique odds and payout structures.
- **Global Leaderboards**: Compete with players worldwide and showcase your skills.
- **Immersive Experience**: Fast-paced gameplay with engaging animations and sound effects.
- **Cross-Platform Support**: Play seamlessly on **desktop** or **mobile** devices.
- **Community-Driven**: Regular updates and events driven by player feedback.
---### ๐ Requirements
Before you start, ensure that you have the following installed:
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Foundry](https://getfoundry.sh/)### โก Quickstart
Clone the repository and set up your environment:
```
$ git clone https://github.com/jitendragangwar123/Bet-Fusion.git
$ cd Bet-Fusion
$ make install
$ forge build
```### ๐ Start a Local Node
Run the following command to start your local node for testing and development:
```
$ make anvil
```### ๐ Library
If you're having a hard time installing the Chainlink library, you can optionally run this command:
```
$ forge install smartcontractkit/[email protected] --no-commit
```### ๐ Deploy
This will default to your local node. You need to have it running in another terminal in order for the deployment to work.
```
$ make deploy
```### ๐งช Testing
You can run tests in various environments:
1. **Unit Tests**
2. **Integration Tests**
3. **Forked Network Tests**
4. **Staging Tests**To run all tests, use:
```
$ forge test
```
or```
$ forge test --fork-url $SEPOLIA_RPC_URL
```### Test Coverage
```
$ forge coverage
```### ๐ Deployment to a Testnet or Mainnet
#### 1. Setup Environment Variables
You'll need to set your `SEPOLIA_RPC_URL` and `PRIVATE_KEY` as environment variables. You can add them to a `.env` file in your project directory.
Optionally, you can also add your `ETHERSCAN_API_KEY` if you want to verify your contract on [Etherscan](https://etherscan.io/).
#### 2. Get Testnet ETH
Head over to [faucets.chain.link](https://faucets.chain.link/) to get some testnet ETH. The ETH should show up in your MetaMask wallet shortly.
#### 3. Deploy to Sepolia Testnet
To deploy your contract to the **Sepolia** testnet, run:
```
$ make deploy ARGS="--network sepolia"
```This will setup a ChainlinkVRF Subscription for you. If you already have one, update it in the `scripts/HelperConfig.s.sol` file. It will also automatically add your contract as a consumer.
### โฝ Estimate Gas
You can estimate how much gas transactions will cost by running:
```
$ forge snapshot
```And you'll see an output file called `.gas-snapshot`
### ๐ Formatting
To run code formatting, use the following command:
```
$ forge fmt
```### ๐ Front-End
1. **Install the dependencies**:
```
$ npm i
```2. **Start the client**:
```
$ npm run dev
```