A learning project for Web3 development featuring a Solidity smart contract (with upgradeable pattern) and a React frontend that allows users to verify domain ownership on the Ethereum blockchain.
🔗 Live Demo: https://web3-verifier.netlify.app/
web3-verifier/
├── hardhat/ # Smart contract development
│ ├── contracts/ # Solidity contracts
│ ├── scripts/ # Deployment scripts
│ ├── test/ # Contract tests
│ └── ignition/ # Hardhat Ignition modules
│
└── frontend/ # React frontend
├── src/ # React components & utilities
└── public/ # Static assets
- Solidity Smart Contracts: Writing, compiling, and deploying contracts
- Upgradeable Contracts: Using OpenZeppelin's upgradeable patterns
- Hardhat Development: Testing, deploying, and interacting with contracts
- React + Ethers.js: Building a dApp frontend
- MetaMask Integration: Wallet connection and transaction signing
- Domain Verification: On-chain proof of domain ownership
cd hardhat
npm installnpx hardhat compileThis generates the ABI (Application Binary Interface) in:
hardhat/artifacts/contracts/DomainVerifierV2.sol/DomainVerifierV2.json
Copy the "abi" array from this JSON file to frontend/src/utils/abi.ts for your frontend to interact with the contract.
npx hardhat testnpx hardhat nodeThis creates 20 test accounts with 10,000 ETH each. You'll see output like:
Account #0: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 (10000 ETH)
Private Key: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
💡 These are Hardhat's well-known test accounts - safe to use for local development only.
npx hardhat run scripts/deploy.ts --network localhostnpx hardhat run scripts/deploy.ts --network sepolia
⚠️ Create a.envfile with your private key and RPC URL for testnet deployment.
Use any of Hardhat's test accounts shown when running npx hardhat node.
- Open MetaMask → Click on account name → "Account details"
- Click "Show private key"
- Enter your password and copy the key
Create a .env file in the hardhat/ folder:
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_PROJECT_ID
PRIVATE_KEY=your_private_key_here_without_0x_prefixGet a free RPC URL from:
Get free test ETH from:
Never commit .env files or share your private key! |
| Never use a wallet with real funds for development! |
cd frontend
npm install
npm run devThe app will be available at http://localhost:5173
Basic domain verification contract:
verifyDomain(domain)- Add a domain to your verified listgetDomains(owner)- Get all domains verified by an addressremoveDomain(domain)- Remove a domain from your list
Enhanced version with additional features:
- Timestamps: Track when each domain was verified
- Global Ownership: Prevent duplicate domain verification across users
getDomainOwner(domain)- Check who owns a domaingetDomainTimestamp(domain)- Get verification timestampgetDomainsWithTimestamps(owner)- Get domains with their timestamps
- Solidity - Smart contract language
- Hardhat - Development environment
- OpenZeppelin Contracts - Secure, audited contract libraries
- TypeChain - TypeScript bindings for contracts
- React 19 - UI framework
- Vite - Build tool
- Ethers.js - Ethereum library
- TailwindCSS - Styling
- FontAwesome - Icons
- Hardhat Documentation
- Solidity Documentation
- OpenZeppelin Docs
- Ethers.js Documentation
- Ethereum Development Tutorial
⚠️ This is a learning project. Do NOT use in production without proper auditing.
- Never commit private keys or
.envfiles - Always test on testnets before mainnet
- Consider gas optimization for production contracts
- Implement proper access control for sensitive functions
MIT License - Feel free to use this for learning purposes!