Sol.College

Full lesson

gigentic-frontend

Decentralized platform for humans and AI agents to work together in a frictionless way implementing escrowed payments with verifiable ratings.

What it does

From the project README:

_When you merge a decentralized Upwork with an App Store for AI agents, you get Gigentic._
Original
Gigentic/gigentic-frontend
SuperStack fork
Blockchains/gigentic-frontend @ 62c0d00
Stars
6
Last push (original)
2025-04-27
Languages
TypeScript, Rust, JavaScript, CSS
Detected stack
AnchorNext.jsweb3.js
Categories
AI & AgentsPayments
Licence
MIT
Homepage
https://app.gigentic.com/

Architecture

133 source files. By extension: .tsx ×65, .ts ×45, .rs ×16, .js ×7.

Top-level directorySource files
web70
anchor36
libs24
(root)2
utils1

On-chain programs: anchor/programs/gigentic

Dapp: deploying

This fork is queued for its own live dapp on Sol.College, with a Devnet/Mainnet switch. It appears here, at /dapps/gigentic-frontend/, once it is deployed and checked on devnet. Until then, run it locally with the commands below.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

Gigentic/gigentic-frontend · anchor/programs/gigentic/src/contexts/init_service.rs L1–24 @ 62c0d00 · MIT · original
use crate::states::{service_registry::ServiceRegistry, Service};use crate::ErrorCode;use anchor_lang::prelude::*;use anchor_spl::token_interface::{Mint, TokenInterface}; #[derive(Accounts)]#[instruction(_unique_id: String)]pub struct InitializeService<'info> {    // The provider who is initializing the service    #[account(mut)]    provider: Signer<'info>,     // The service registry where the service will be registered    #[account(mut)]    service_registry: Account<'info, ServiceRegistry>,     // The service account being initialized    #[account(        init,        space = 8+Service::INIT_SPACE,        payer = provider,        seeds = [b"service", _unique_id.as_bytes(), provider.key().as_ref() ],        bump    )]
  1. Line 11 provider: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 19 init,: Creates and pays for a new account. Space and payer must be specified.
  3. Line 22 seeds = [b"service", _unique_id.as_bytes(), provider.key().as_ref() ],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  4. Line 23 bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
Gigentic/gigentic-frontend · anchor/programs/gigentic/src/contexts/sign_service.rs L1–23 @ 62c0d00 · MIT · original
use crate::states::{Escrow, Service};use crate::ErrorCode;use anchor_lang::prelude::*; #[derive(Accounts)]pub struct SignService<'info> {    #[account(mut)]    pub signer: Signer<'info>,     #[account(mut)]    pub service: Account<'info, Service>,     #[account(        mut,        close = signer, // Transfer remaining lamports to the customer when the account is closed        seeds = [b"escrow", service.key().as_ref(), service.provider.key().as_ref(), signer.key().as_ref()],        bump,    )]    pub escrow: Account<'info, Escrow>,     /// CHECK : This is an account info, not an account    #[account(mut, constraint = service_provider.key() == escrow.service_provider.key() && service_provider.key() == service.provider.key())]    pub service_provider: AccountInfo<'info>,
  1. Line 8 pub signer: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 15 close = signer, // Transfer remaining lamports to the customer when the account is closed: Closes the account at the end of the instruction and refunds its lamports.
  3. Line 16 seeds = [b"escrow", service.key().as_ref(), service.provider.key().as_ref(), signer.key().: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  4. Line 17 bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
Gigentic/gigentic-frontend · anchor/programs/gigentic/src/contexts/pay_service.rs L1–24 @ 62c0d00 · MIT · original
use crate::states::review::Review;use crate::states::service_registry::ServiceRegistry;use crate::states::{Escrow, Service};use crate::ErrorCode;use anchor_lang::prelude::*;#[derive(Accounts)]#[instruction(review_id: String)]pub struct PayService<'info> {    #[account(mut)]    pub customer: Signer<'info>,     #[account(mut)]    pub service: Account<'info, Service>,     #[account(mut)]    service_registry: Account<'info, ServiceRegistry>,     #[account(        init,        payer = customer,        space = 8+ Escrow::INIT_SPACE,        seeds = [b"escrow", service.key().as_ref(), service.provider.key().as_ref(), customer.key().as_ref()],        bump    )]
  1. Line 10 pub customer: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 19 init,: Creates and pays for a new account. Space and payer must be specified.
  3. Line 22 seeds = [b"escrow", service.key().as_ref(), service.provider.key().as_ref(), customer.key(: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  4. Line 23 bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
Gigentic/gigentic-frontend · anchor/programs/gigentic/src/contexts/customer_to_provider_rating.rs L1–24 @ 62c0d00 · MIT · original
use crate::states::review::Review;use crate::ErrorCode;use anchor_lang::prelude::*; #[derive(Accounts)]pub struct ReviewCustomerToProviderService<'info> {    // The account of the user deploying and paying for the initialization.    // Marked as `mut` because it will be charged for rent.    #[account(mut)]    pub signer: Signer<'info>,     #[account(mut, constraint = review.customer == signer.key())]    pub review: Account<'info, Review>,     pub system_program: Program<'info, System>,} impl<'info> ReviewCustomerToProviderService<'info> {    pub fn handler(&mut self, rating: u8, review: String) -> Result<()> {        require!(rating <= 5, ErrorCode::InvalidRating);        self.review.customer_to_provider_rating = rating;        self.review.customer_to_provider_review = review;        Ok(())    }
  1. Line 10 pub signer: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 20 require!(rating <= 5, ErrorCode::InvalidRating);: An explicit validation that aborts the instruction with an error.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run devnx serve web
.npm run buildnx build web
anchornpm run lintprettier */*.js "*/**/*{.js,.ts}" --check
anchoranchor buildcompile programs and generate IDLs
anchoranchor testlocal validator + test suite
anchoranchor run create-mintyarn run ts-node admin/create-mint.ts
anchoranchor run deploy-registryyarn run ts-node admin/deploy-registry.ts
anchoranchor run lintcargo dylint --all --workspace
anchoranchor run testyarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/gigentic.spec.ts
anchoranchor run write-servicesyarn run ts-node admin/write-services.ts

What you could build from it