Welcome to the Merge Protocol! Merge is a decentralized gig marketplace that lets clients post jobs and escrow payments on-chain, while freelancers and contractors can securely complete work and claim payouts.
By running on-chain, Merge eliminates the need for trusted third parties, heavily reduces fees compared to traditional platforms, and provides a transparent, secure environment for both clients and freelancers.
- On-Chain Job Management: Create, manage, and browse gig listings seamlessly through the Factory and Job smart contracts.
- Secure Escrow Payments: Funds are locked in the
GigEscrowsmart contract. Payments are trustlessly released upon job completion. - Built-in Dispute Resolution: Dispute support allows for fair resolution if a disagreement occurs between client and freelancer.
- Intuitive User Interface: A modern Next.js frontend UI for creating jobs, accepting work, handling communications, and tracking payments.
- Developer-Friendly: Local development scripts and a burner wallet experience allow for rapid testing and iteration.
- Framework: Scaffold-ETH 2
- Smart Contracts: Solidity (contracts located in
packages/hardhat/contracts) - Blockchain Environment: Hardhat for local compilation, testing, and network interaction (
packages/hardhat) - Frontend: Next.js + TypeScript (
packages/nextjs) - Web3 Integration: Viem / Wagmi + RainbowKit for wallet connection and RPC integration
- Node.js (recommended >= 20)
- Yarn (classic v1 or v2+)
- Git
-
Clone the repository and install dependencies:
git clone <repo-url> cd merge yarn install
-
Start a local local blockchain:
In your first terminal window, run:
yarn chain
-
Deploy the smart contracts:
In a second terminal window, run:
yarn deploy
-
Start the Next.js frontend:
In a third terminal window, run:
yarn start
Open http://localhost:3000 to use the app locally. The Debug/Contracts page lets you interact with deployed contracts and view events.
- Contracts: Found in
packages/hardhat/contracts(check outGigEscrow.solandMergeFactory.sol). - Frontend: Found in
packages/nextjs(App router pages are underapp/, and components incomponents/). - Types: Typechain types automatically generate into
packages/hardhat/typechain-types. - Scripts: Useful deployment and utility scripts are in
packages/hardhat/scripts.
-
Run unit tests for contracts:
yarn hardhat:test
-
Format the codebase (runs across all packages):
yarn format
Add any necessary RPC or API keys to the .env file at the repository root if you plan to connect to public testnets. Never commit your private keys!
packages/hardhat: Solidity smart contracts, deployments, tests, and Hardhat configuration.packages/nextjs: React + Next.js frontend application with hooks and UI components.packages/hardhat/deploy: Custom deployment scripts used by theyarn deploycommand.
We welcome contributions, issues, and feature requests! Please open an issue or pull request. For significant changes or new features, please open an issue first to discuss your ideas and the intended design.
This project uses the repository license. See the LICENCE file at the repository root for more details.
