Skip to content
Smart Contracts in Practice: Building GigX
Web32025-02-148 min read

Smart Contracts in Practice: Building GigX


Smart Contracts in Practice: Building GigX


GigX is a decentralized freelance marketplace where smart contracts handle escrow, dispute resolution, and payment release. No intermediary. No platform taking 20%. Trustless by design.


The Core Escrow Contract


The central mechanic: client deposits ETH, freelancer delivers work, client approves, funds release. Disputes go to a 2-of-3 arbiter vote.


The key security lesson: always update state before making external calls (checks-effects-interactions pattern). Re-entrancy attacks exploit contracts that transfer funds before marking a transaction complete.


Gas Costs: The Real UX Killer


Creating a gig costs ~80,000 gas. At 20 gwei with ETH at $3000, that is $4.80 per transaction — nearly 10% overhead on a $50 gig, worse than Upwork.


The solution: Layer 2. Deploying to Polygon reduced costs by ~100x. For any consumer-facing dApp, mainnet Ethereum is the wrong environment. Start on Arbitrum, Polygon, or Base.


Dispute Resolution Without an Oracle


Pure on-chain work verification requires an oracle, which reintroduces centralized trust. GigX uses a 2-of-3 multi-signature scheme: any two of client, freelancer, and platform arbiter agreeing releases funds. Simple, effective, auditable.


Frontend: Wagmi v2 + Viem


Wagmi v2 is the correct Web3 React stack in 2025. Type-safe, hooks-based, handles wallet state and transaction lifecycle without the ceremony of ethers.js or web3.js.


What I Would Do Differently


Start on L2 immediately. Use TheGraph for event indexing from day one. Keep only trust-critical logic on-chain. Run Slither static analysis before any deployment touching real value.


The blockchain constraint forces you to think about trust at a systems level in a way nothing else does.


---


*GigX is pinned on GitHub (AppXcess-GigX). Contracts deployed on Sepolia testnet.*


© 2024 Bharat Singh Parihar