
AroundTheWorld
Match your way around the world
Demo
About
The problem it solves Around The World solves two key problems in casual gaming: transient player progress and the lack of real stakes. - It makes your progress permanent. Traditionally, your game data is temporary. Here, your scores, level completions, and identity are linked to your wallet, making them persistent and truly yours. - It turns skill into rewards. Most leaderboards are for bragging rights only. Our weekly leaderboard distributes real ETH to top players, transforming gameplay into a competitive and rewarding on-chain experience. - It provides a polished, fun match-3 game that respects players' time and skill by giving them permanent ownership of their achievements and the chance to earn real rewards. Smart Contract Address(es) [0x8Bb8ba7e4dC947107c6Fa88aD13da4ECCfF49651](https://basescan.org/address/0x8Bb8ba7e4dC947107c6Fa88aD13da4ECCfF49651#code) Other Onchain Proof [0x8Bb8ba7e4dC947107c6Fa88aD13da4ECCfF49651](https://basescan.org/address/0x8Bb8ba7e4dC947107c6Fa88aD13da4ECCfF49651)
How it's made
Challenges we ran into The biggest challenge was a critical bug where a player's progress would seem to erase itself. After completing a level, a user might refresh the app only to find all their newly unlocked levels were locked again. The Hurdle: Competing "Sources of Truth" The root cause was a classic but difficult state management problem. The app was using two sources of truth for player progress: 1. Local State: For a fast, responsive UI, the game would immediately update a temporary, local version of the player's progress. 2. Redis (Canonical State): The "real" progress was saved to Redis, which involved a network request and a slight delay. This created a race condition. Sometimes, the slower Redis data would load after the user had already progressed locally, overwriting their new achievements with the old, stale data. The Solution: A Single Source of Truth Fixing this required a significant architectural refactor to enforce a single, canonical source of truth. 1. Centralized Data Hook: We created a custom React hook, useGameData, which became the one and only place the application could get player data from. This hook manages all interactions with our Redis backend. 2. Removed All Local State: We meticulously removed all redundant local progress states from our components. 3. Subscribed to the Truth: Every component that needed to know about player progress (the level selector, the user profile, etc.) now subscribes directly to the useGameData hook. By ensuring the entire application reads from a single, authoritative source, we eliminated all race conditions and data inconsistency. This not only fixed the bug but also made the entire codebase more robust, predictable, and aligned with best practices for building stable applications.