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 directory | Source files |
|---|---|
web | 70 |
anchor | 36 |
libs | 24 |
(root) | 2 |
utils | 1 |
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.
anchor/programs/gigentic/src/contexts/init_service.rs L1–24 @ 62c0d00 · MIT · originaluse 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 )]- Line 11
provider: Signer<'info>,: Requires this account to have signed the transaction. - Line 19
init,: Creates and pays for a new account. Space and payer must be specified. - 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. - Line 23
bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
anchor/programs/gigentic/src/contexts/sign_service.rs L1–23 @ 62c0d00 · MIT · originaluse 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>,- Line 8
pub signer: Signer<'info>,: Requires this account to have signed the transaction. - 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. - 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. - Line 17
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
anchor/programs/gigentic/src/contexts/pay_service.rs L1–24 @ 62c0d00 · MIT · originaluse 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 )]- Line 10
pub customer: Signer<'info>,: Requires this account to have signed the transaction. - Line 19
init,: Creates and pays for a new account. Space and payer must be specified. - 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. - Line 23
bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
anchor/programs/gigentic/src/contexts/customer_to_provider_rating.rs L1–24 @ 62c0d00 · MIT · originaluse 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(()) }- Line 10
pub signer: Signer<'info>,: Requires this account to have signed the transaction. - 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.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | nx serve web |
. | npm run build | nx build web |
anchor | npm run lint | prettier */*.js "*/**/*{.js,.ts}" --check |
anchor | anchor build | compile programs and generate IDLs |
anchor | anchor test | local validator + test suite |
anchor | anchor run create-mint | yarn run ts-node admin/create-mint.ts |
anchor | anchor run deploy-registry | yarn run ts-node admin/deploy-registry.ts |
anchor | anchor run lint | cargo dylint --all --workspace |
anchor | anchor run test | yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/gigentic.spec.ts |
anchor | anchor run write-services | yarn run ts-node admin/write-services.ts |
What you could build from it
- Fork the SuperStack copy and extend it within the AI & Agents gaps listed on the idea page.
- Learn the pattern first: AI agents on Solana
- Learn the pattern first: Building and sending transactions from a client
- Learn the pattern first: Blinks and Solana Actions