BaseBattle is a fun onchain mini-game built on the Base Network.
Players can create battles and join by selecting an element — Fire 🔥, Water 🌊, or Earth 🌿.
Each battle is stored permanently onchain.
✅ Safe & secure (no gambling, no tokens, no transfers)
✅ Onchain game — fully transparent
✅ Works directly from Remix or BaseScan
✅ Ideal for Base Builder practice and personal learning
| Setting | Value |
|---|---|
| Solidity Version | 0.8.19 |
| License | MIT |
| Network | Base Mainnet (Chain ID 8453) |
| Function | Description |
|---|---|
createBattle() |
Starts a new battle |
joinBattle(battleId, choice) |
Join a battle with element: 1=Fire, 2=Water, 3=Earth |
getBattle(battleId) |
View all players in a battle |
battlePlayerCount(battleId) |
Count how many joined |
totalBattles() |
View total battles created |
- Open Remix
- Create
BaseBattle.sol - Paste the code from
/contracts/BaseBattle.sol - Compile with Solidity 0.8.19
- Deploy using MetaMask connected to Base Mainnet
This is part of my personal Base development practice.
I deploy simple, creative, and safe contracts on Base to learn and experiment with onchain development.