A Solana-based marketplace for freelance gigs built using the Anchor framework.
The Gig Marketplace is a decentralized platform where users can post gigs. Each gig includes:
- A unique ID
- Description of the work to be done
- Stake amount (in lamports)
- Deadline for completion
- Status tracking (Open, InProgress, Completed, Failed)
The program is built using Anchor 0.31.1 and includes the following components:
- Gig account: Stores all gig data on-chain
- PostGig instruction: Creates a new gig with all required parameters
- Program Derived Addresses (PDAs) for gig accounts, created using the gig ID as a seed
The main smart contract logic is in lib.rs and includes:
- Account structures and data validation
- Instruction handler for posting gigs
- PDA generation for account creation
The program includes comprehensive tests that verify:
- Creating gigs with valid data
- Preventing duplicate gig IDs
- Multiple users creating gigs
- Querying gigs by owner
- Retrieving all gigs in the program
To run the tests:
anchor test- Solana CLI
- Anchor CLI (v0.31.1 or higher)
- Rust and Cargo
- Node.js and Yarn
- Clone the repository
- Install dependencies:
yarn install
- Build the program:
anchor build
- Test the program:
anchor test
- Add functionality for accepting gigs
- Implement staking and payment mechanisms
- Add rating system for gig posters and workers
- Create frontend interface to interact with the program
