This project implements a simple game on the Ethereum blockchain using Solidity for the smart contract, Foundry for development, and React.js for the user interface (UI). The game allows users to connect their wallets via Metamask, create or join a game, and bet ERC-20 tokens. The game is designed for two players, and the winner takes the total bet amount. If the game ends in a draw, the bet amount is returned to each player.
- Wallet Integration: Users can connect their Ethereum wallets directly through the UI using Metamask.
- Game Creation: Users can create a new game by specifying the ERC-20 token contract address and the bet amount.
- Join Game: Other users can join an existing game by choosing the bet amount and the same ERC-20 tokens.
- Gameplay: The game requires two players. The winner takes the total bet amount, or if it's a draw, the bet amount is returned to each player.
- Token Transfer: The smart contract manages the transfer of ERC-20 tokens securely.
-
Smart Contract: Built using Solidity with Foundry for developing, testing, and deploying the game logic and token handling.
You can view the smart contract code in this repository. -
Frontend: Developed with React.js for creating the UI.
