Skip to content
← University

Hospital sanitization tracker

An Ethereum smart contract and web DApp that record hospital cleaning operations on chain, so the history of each area can be audited and cannot be altered.

Role
Author
When
February 2026 to May 2026
Course
Blockchain and Cryptocurrencies
Stack
Solidity, Hardhat, Ethers.js, JavaScript, MetaMask

Context

Hospitals have to prove that operating rooms, wards and equipment are sanitised on schedule. Those records usually live in paper logs or internal systems where an entry can be edited after the fact. The course proposal asked for a distributed ledger application for traceability; I applied it to sanitization records, where the value of an append only history is easy to see.

What I built

Smart contract. SanitizationTracker.sol (Solidity 0.8.20) manages three things: hospital areas, authorised operators identified by their wallet address, and sanitization events. Only the deployer (the admin) can register or deactivate areas and operators. Only an active operator can record an event, which stores the area, the operator, the block timestamp, an outcome and free text notes. Anyone can read the full history of an area, its last sanitization and the number of events. Registrations and sanitizations also emit events, so external tools can follow the contract without polling.

Web DApp. A plain HTML and JavaScript frontend connects through MetaMask and Ethers.js. It detects the role of the connected account by reading the contract (admin, operator or guest) and shows only the actions that role can perform: registering areas and operators, recording a sanitization, or browsing the history.

Testing and deployment. A Hardhat test suite (14 tests) covers access control, registration and event recording, and runs in GitHub Actions. The contract is deployed and verified on the Sepolia test network at 0x679C...4517.

Limitations

A blockchain guarantees that a record was not changed after it was written; it cannot guarantee that the record was true in the first place. A real deployment would also need a permissioned network rather than a public chain, to keep transaction costs predictable and operational data private.

← All projects