A simple yet powerful token bridge between Ethereum Sepolia and Base Sepolia test networks.
This project demonstrates how assets can move across chains using lock / mint / burn / unlock mechanics — powered by a backend, relayer, and frontend working together.
ASLC - ERC20 token deployed on Ethereum Sepolia
BASLC - ERC20 token deployed on Base Sepolia
- 🔒 Lock ASLC tokens on Ethereum Sepolia
- 🪄 Mint BASLC tokens on Base Sepolia (1:1 to locked ASLC)
- 🔥 Burn BASLC tokens on Base Sepolia
- 🔓 Unlock ASLC tokens back on Ethereum Sepolia
- ⚡ Supports batching: lock/burn multiple times and mint/unlock in one go
Deployed Contracts
- Ethereum Sepolia Bridge Contract
- Base Sepolia Bridge Contract
- ASLC ERC20 Token - Token on Ethereum Chain
- BASLC ERC20 Token - Bridged Token on Base Chain
⚠️ Note: For security reasons, you’ll deploy your own contracts instead of using mine.
This ensures you control the private key that signs bridge transactions.
Contracts are built with Foundry.
If you don’t already have it, install Foundry.
-
Setup environment:
cd contracts cp .env.example .envGet RPC URLs from Alchemy, Infura, or another provider. Get API keys from Etherscan and Basescan.
-
Deploy bridge contracts:
Runsource .envfirst in the terminal to load the envs.-
Ethereum Sepolia.
forge script --chain sepolia script/BridgeETH.s.sol:BridgeETHScript --rpc-url $SEPOLIA_RPC_URL --broadcast --verify -vvvv --private-key <YOUR_PRIVATE_KEY> -
Base Sepolia.
forge script script/BridgeBase.s.sol:BridgeBaseScript --rpc-url $BASE_SEPOLIA_RPC_URL --broadcast --verify -vvvv --private-key <YOUR_PRIVATE_KEY>
Record the deployed contract addresses — you’ll need them later.
-
-
Copy the root env file and fill in values. Keep the DATABASE_URL as it is.
cp .env.example .env -
Create
private-key.txtat the root and paste the private key you used for deployment.This is required so the relayer can listen to bridge events and sign unlock/mint transactions.
-
Start everything:
docker-compose up --build -
Open the app at http://localhost:3000 🎉
- Start a Postgres instance (Docker or local).
- Create .env files for backend, relayer, and frontend from their respective .env.example.
- Deploy contracts as described above.
- Run backend:
cd backend npm run start - Run relayer:
cd relayer npx prisma migrate deploy npm run start - Run the frontend:
cd frontend npm run dev
- Smart Contracts: Solidity, Foundry
- Backend: Express + Prisma + PostgreSQL
- Relayer: Node.js (polling chain events every 5s)
- Frontend: React + Vite + TypeScript
- Infra: Docker Compose
Want to make this bridge cooler? PRs and issues are welcome!
This is a learning/demo project, so experiments and improvements are encouraged 🚀.
🔥 That’s it! Now go bridge some tokens across testnets like a pro.