Welcome to BlockCity Hub π
This is a complete Web3 dApp built during the BlockCity Workshop.
It connects to 4 Smart Contracts deployed on Sepolia Testnet:
- City Foundation (Base Contract)
- Treasury (ERC-20 Token)
- Identity (NFT Badges)
- Council (On-chain Voting / DAO)
BLOCKCITY/
β
βββ index.html
β
βββ assets/
β βββ css/
β β βββ styles.css
β β
β βββ js/
β βββ app.js
|---canvas.js
β β
β βββ config/
β β βββ contracts.js
β β
β βββ core/
β β βββ connect.js
β β βββ helpers.js
β β βββ loader.js
β β βββ state.js
β β
β βββ rooms/
β βββ room1.foundation.js
β βββ room2.treasury.js
β βββ room3.identity.js
β βββ room4.council.js
Download: https://code.visualstudio.com/
In VS Code:
- Go to Extensions
- Search for Live Server
- Install it
Download: https://metamask.io/
- Create a wallet
- Save your Secret Recovery Phrase safely
In MetaMask:
- Click Network dropdown
- Enable "Show test networks"
- Select Sepolia
Use a faucet:
Paste your wallet address and request ETH.
You need Sepolia ETH to:
- Mint tokens
- Create proposals
- Vote
- Mint NFTs
Open the BLOCKCITY folder in VS Code.
Right-click index.html.
Click "Open with Live Server"
Do NOT open with file://
Modules require a local server.
This project uses modular structure:
Contains contract addresses and ABIs.
Contains:
- Wallet connection
- Global state
- Shared helper functions
- Data loader
Each smart contract has its own JS file.
Room files contain:
- Read functions
- Write functions
- UI interaction logic
Main entry file that connects everything together.
- View platform name
- Update city name
- Mint tokens
- Reward users
- View balance
- Mint badge NFT
- Lookup owner
- View metadata URI
- Create proposal
- Vote YES / NO
- Check results
- Execute proposal
Make sure:
- You are using Live Server
- styles.css exists in
assets/css/ - No red errors in DevTools console (F12)
Make sure:
- MetaMask extension installed
- Using Chrome or Brave
- MetaMask unlocked
Get more Sepolia ETH from faucet.
Make sure:
- You pasted correct contract addresses
- Contracts are deployed on Sepolia
- MetaMask is connected to Sepolia
- Add a new function in Solidity (Remix)
- Recompile
- Copy updated ABI
- Paste ABI into contracts.js
- Add new function in corresponding room file
- Add button in HTML
No other changes required.
- HTML
- CSS
- JavaScript (ES Modules)
- Ethers.js v6
- MetaMask
- Sepolia Testnet
No frameworks. No backend. Fully client-side Web3 dApp.
By completing this project, you understand:
- How frontend connects to smart contracts
- How to use Ethers.js
- How to structure Web3 projects
- How to deploy dApps
- How DAOs work
- How NFTs work
- How ERC-20 tokens work
This is not just a workshop demo.
This is real Web3 architecture.
You can expand this into:
- A marketplace
- A DAO governance system
- A token economy
- A student certificate system
- A voting app
- A startup MVP
Build boldly π
---
# β
What This README Covers
β Folder structure
β Beginner setup
β MetaMask setup
β Sepolia faucet
β Live Server instructions
β Common errors
β Deployment
β Architecture explanation
β Expansion guide