Forge
On-Chain ERC-1155 Crafting Game with Real-Time Events








Overview
Forge is an on-chain crafting game where players mint, burn, and trade ERC-1155 tokens using smart-contract enforced rules. Built with Solidity and Next.js, it features real-time UI updates via Alchemy WebSockets, 100% Foundry test coverage, and verified contracts on Sepolia. The project explores end-to-end Web3 development: contract architecture, game logic, and event-driven UI synchronization.
Key features
- On-Chain Crafting System (ERC-1155): Players mint basic tokens and forge rare items by burning combinations, enforced entirely by Solidity logic.
- Cooldown-Based Minting: Enforced minting cooldowns prevent spam and balance gameplay.
- Event-Driven UI Updates: Real-time syncing of mint, burn, forge, and trade events via Alchemy WebSockets.
- 100% Contract Test Coverage: All smart contracts tested with Foundry for full line, branch, and function coverage.
- Verified Smart Contracts: Deployed to Sepolia and automatically verified on Etherscan for transparency.
Technologies Used
- Solidity + Foundry: Implements ERC-1155 minting, forging, burning, trading logic, plus full test suite with 100% coverage.
- Next.js + Wagmi: Frontend framework with wallet integration, event listeners, and reactive state management.
- Alchemy WebSockets: Real-time synchronization for mint, forge, burn, and trade events with selective refetching.
- ERC-1155 Architecture: Efficient multi-token setup supporting crafting rules, metadata, and IPFS hosting.
Challenges and Learnings
Key challenges included encoding crafting rules, cooldowns, and burn mechanics into smart contracts. Achieving 100% Foundry test coverage required detailed scenario testing for all game logic. Real-time UI updates demanded careful handling of React Query refetching and event listeners.
Outcome
Forge is a complete on-chain game deployed on Sepolia, featuring: - ERC-1155 token crafting, trading, and real-time event syncing. - Verified contracts and a polished dApp with wallet connectivity. - Full-stack Web3 development from Solidity to event-driven UI. Built before my Bet2Gether DApp, this project strengthened my skills in contract composition, Foundry testing, and ERC-1155 design.










