This code is part of a small personal project and is not intended for use in production environments. It has not been thoroughly tested, nor has it undergone any form of security audit. Use this code at your own risk, and be aware that it may contain bugs, vulnerabilities, or other issues that could lead to unexpected behavior.
This repo contains the smart contracts for a decentralized Coin Flip game, leveraging Chainlink's Verifiable Random Function (VRF) to ensure fairness and transparency in the game's outcome. The game allows players to bet on the outcome of a coin flip, with the smart contract generating a random result to determine winners.
CoinFlip.sol: The main contract for the Coin Flip game, implementing game logic and interactions with the Chainlink VRF for randomness.
DeployCoinFlip.s.sol: A deployment script for the Coin Flip contract, facilitating deployment to various networks.
NetworkConfigurator.s.sol: A utility contract to configure network-specific parameters, including the Chainlink VRF coordinator address and subscription ID necessary for the game's operation.
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --version
and you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)
- You'll know you did it right if you can run
Clone the repository and compile contracts
git clone https://github.com/monnidev/Coinflip
code Coinflip
Add your active Chainlink subscription ID to the NetworkConfigurator file in the appropriate section for your target network.
forge build
forge test