Workchain is a next-generation decentralized application (DApp) that connects freelancers with clients. By leveraging Ethereum smart contracts, it eliminates intermediaries, ensures transparent escrow payments, and builds a verifiable reputation system on the blockchain.
- 🔐 Trustless Escrow: Payments are locked in smart contracts and released automatically upon task completion.
- 👥 Dual-Role System: Seamlessly switch between Client and Freelancer profiles.
- 🦊 Web3 Integration: Full MetaMask support for secure, seamless wallet connections and transactions.
- 📜 Immutable Reputation: Work history, reviews, and completed tasks are permanently recorded on the blockchain.
- 🛠 End-to-End Task Management: A complete lifecycle from task creation and bidding to delivery and review.
- Frontend/Backend: Python 3.8+, Flask
- Blockchain Interface: Web3.py
- Smart Contracts: Solidity 0.8.0
- Local Testnet: Ganache
- Wallet/Provider: MetaMask
- Database: SQLAlchemy (SQLite for local development)
Follow these steps to set up the project locally for development and testing.
Ensure you have the following installed:
- Python 3.8 or higher
- Ganache (GUI or CLI)
- MetaMask browser extension
Clone the repository and navigate into the project directory:
git clone https://github.com/tisha-varma/workchain.git
cd workchainInstall the required Python dependencies:
pip install flask flask-sqlalchemy flask-login web3 pycryptodome solcxInstall the required Solidity compiler version:
# In your Python shell or via a quick script:
from solcx import install_solc
install_solc('0.8.0')- Open Ganache and select Quickstart or create a new workspace.
- Ensure your Ganache server is running on
HTTP://127.0.0.1:7545with Chain ID 1337. - Open MetaMask in your browser:
- Go to Settings > Networks > Add a Network manually.
- Network Name: Ganache Local
- New RPC URL:
http://127.0.0.1:7545 - Chain ID:
1337 - Currency Symbol:
ETH
- Import at least two accounts from Ganache into MetaMask using the private keys provided by Ganache (one for the Client, one for the Freelancer).
Initialize the local database:
flask shell
>>> from main import db
>>> db.create_all()
>>> exit()Start the Flask server:
python main.pyThe application will be available at http://127.0.0.1:5000.
- Connect: Link your MetaMask wallet.
- Fund & Post: Create a detailed task and deposit the required ETH budget into the smart contract escrow.
- Review & Approve: Once the freelancer submits the work, review it.
- Release: Approve the work to release the funds from the smart contract directly to the freelancer's wallet.
- Browse: Search for open tasks that match your skill set.
- Accept & Work: Accept a task (verifying that funds are safely in escrow).
- Submit: Deliver the work through the platform.
- Get Paid: Receive your ETH payment automatically upon client approval.
Our Ethereum smart contracts are designed for absolute security and transparency. They handle:
- State Management: Tracking task status (Open, In Progress, Completed, Disputed).
- Escrow Mechanics: Securing client deposits and guaranteeing freelancer payouts.
- Access Control: Ensuring only authorized parties (the specific client or assigned freelancer) can execute state-changing functions.
(Note: Contracts in this repository are optimized for local demonstration. Before any mainnet deployment, a comprehensive professional security audit is strongly advised.)
- Transactions Failing/Stuck: In MetaMask, go to Settings > Advanced > "Clear activity tab data" (Reset Account). This resolves nonce mismatch issues common when restarting Ganache.
- Wrong Network: Ensure MetaMask is connected to your local Ganache RPC (
1337), not Ethereum Mainnet or a public testnet. - Contract Compilation Errors: Verify that
solcxsuccessfully downloadedv0.8.0.
We welcome contributions to make Workchain better!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.