Inspiration

Starting work can feel overwhelming, especially when studying alone. I wanted to make that first step feel more welcoming through a friendly dinosaur companion and the encouragement of working alongside a friend.

I also wanted to explore an everyday use for blockchain: shared accountability through refundable deposits.

What it does

Focus Companion offers two ways to work:

  • Solo sessions: enter a task, choose a duration, focus with your dinosaur, and check in afterward. No wallet is required.
  • Buddy pacts: invite a specific wallet and each deposit an equal amount of Sepolia test ETH. Once the buddy joins, the shared session begins. After the session, both participants can confirm completion, unlocking their deposits for separate withdrawal.

Completion is self-reported, and task descriptions stay on the user's device. If someone does not confirm, a timeout allows both original deposits to be recovered. There are no rewards or forfeitures; transaction fees are separate.

How I built it

I built the frontend with HTML, CSS, and JavaScript, using local storage for task descriptions and session recovery. The dinosaur artwork changes to match the session state.

The blockchain integration uses ethers.js, MetaMask, and a Solidity contract deployed on Ethereum Sepolia. The contract manages invitations, matching deposits, session timing, completion confirmations, cancellations, timeout refunds, and withdrawals.

The application is hosted on GitHub Pages, with source code and technical documentation in a public GitHub repository. I used AI assistance for implementation and dinosaur image creation.

Challenges I ran into

The biggest challenge was coordinating the interface with asynchronous wallet approvals and blockchain confirmations. Switching between two wallet accounts also required careful testing so each participant saw the appropriate actions.

I designed cancellation and timeout paths so an absent participant would not leave deposits locked indefinitely. Wallet onboarding remains an area for improvement. MetaMask also displayed a security warning for the hosted site during demo preparation; the cause remains unresolved.

Accomplishments I'm proud of

I deployed a working application and completed a real Sepolia test with two wallet accounts: creating a pact, joining with a matching deposit, confirming completion from both accounts, and withdrawing both deposits.

All 11 contract integration test groups and all 6 app-state test groups passed locally. The hosted application also successfully loaded the completed pact from Sepolia.

I'm proud of combining a playful interface with a working smart-contract flow for an everyday activity.

What I learned

I learned how wallet connections, transaction approvals, contract execution, and frontend updates fit together. I also learned why successful interface states must follow confirmed transactions.

Building this project showed me that a consumer blockchain application needs both reliable contract behavior and understandable onboarding. The technology should support the activity people came to do.

What's next for Focus Companion

Next, I would investigate the hosted-site wallet warning, improve account-switching feedback, and simplify onboarding with embedded wallets and sponsored gas.

I would also test the experience with students to understand whether the companion and shared commitment help them start and maintain focus sessions.

Built With

Share this project:

Updates

Submission history