← all projects

kevin@portfolio:~$ cat projects/onchain-todo-dapp.md

# Web3 · Decentralized Application

On-Chain Todo List dApp

A todo list where each task lives in a Solidity smart contract and is managed from a React app through MetaMask.

Timeframe
2026
Status
Public team project
Stack
SolidityHardhatReactViteTailwind CSSethers.jsMetaMaskSepolia
Contribution
I built the Web3 integration and the tests. I wrote the wallet and contract hooks, the contract helper, the frontend wiring, the Hardhat config and the deploy script. I then expanded the tests.

Numbers

9
Contract tests I added

Problem

A course project asked for a decentralized application. The chosen idea was a todo list whose data lives in a smart contract and not in local storage.

How it works

Each todo belongs to a wallet and is stored in a Solidity contract. The React frontend uses ethers.js and MetaMask. Reads go straight to the chain without a prompt, and writes open a MetaMask request and then refresh the list after confirmation. The contract runs on a local Hardhat chain and on Sepolia.

UserReact frontendethers.jsMetaMaskHardhat local or SepoliaTodoList contractEvent listenerUserReact frontendethers.jsMetaMaskHardhat local or SepoliaTodoList contractEvent listener
  1. User Opens the React app.
  2. React frontend Shows todos, filters and transaction status.
  3. ethers.js Builds a contract instance with a provider or a signer.
  4. MetaMask The user confirms each write.
  5. Hardhat local or Sepolia Runs the transaction.
  6. TodoList contract Stores todos per wallet and emits events.
  7. Event listener The frontend refreshes when events arrive.

Key decisions

  1. 01

    Todos are stored on-chain, and only the owner can toggle, delete or reorder them.

  2. 02

    Deadlines are stored as a timestamp and the UI shows when one has passed. The contract does not act on it, because a state change needs a transaction.

  3. 03

    The public demo uses Sepolia, because outside users cannot reach a local chain.

  4. 04

    Wallet state lives in one hook that follows MetaMask account and network changes. Unsupported networks block reads and writes with a message.

  5. 05

    Reads use a provider and writes use a signer, and a write waits for the receipt before the list reloads.

  6. 06

    The frontend listens to the contract events and reloads only when the event belongs to the connected wallet. Listeners are removed on cleanup.

Results

  • Contract deployed to Sepolia and the frontend is live on Vercel.
  • Features include wallet connect, add, complete, delete, drag-and-drop reorder, deadlines and transaction feedback.
  • 26 contract tests cover create, complete, delete, reorder, per-user isolation and revert cases.