Skip to content

feat: add gas calculator, block explorer, vulnerability scanner, and issue triage minigame#847

Open
success-OG wants to merge 1 commit into
StellarDevHub:mainfrom
success-OG:feat/estimation
Open

feat: add gas calculator, block explorer, vulnerability scanner, and issue triage minigame#847
success-OG wants to merge 1 commit into
StellarDevHub:mainfrom
success-OG:feat/estimation

Conversation

@success-OG

Copy link
Copy Markdown
Contributor

closes #807
closes #809
closes #814
closes #821

Summary

Implements four MVP-critical curriculum module features across the Web3 Student Lab platform, following the established lib → hook → component → route (frontend) and service → route → test (backend) architecture.

1. Gas Estimation Calculator — Open Source Contribution Trainer

  • Route: /open-source/gas-calculator
  • API: POST /api/v1/osct/gas-estimate
  • Estimates Soroban CPU, RAM, storage, and gas from contract source
  • Compares optimization strategies (cache reads, batch writes, compact layout, hybrid)
  • Budget presets: classroom (8,500), testnet (12,000), production (18,000)
  • Files: frontend/src/lib/open-source/gasCalculator.ts, backend/src/services/gasEstimation.service.ts

2. Block Explorer Interface — Hackathon Project Idea Generator

  • Route: /hackathon-ideas/explorer
  • API: GET /api/v1/generator/explorer/snapshot, /explorer/search, /explorer/link/:hash
  • Live simulated Stellar transaction feed with search/filter UI
  • Suggests hackathon ideas from on-chain activity patterns
  • Redis-cached deterministic snapshots for backend performance
  • Link added from /hackathon-ideas hub page
  • Files: frontend/src/lib/idea-generator/blockExplorer.ts, backend/src/services/blockExplorer.service.ts

3. Security Vulnerability Scanner — Blockchain Learning Simulator

  • Route: /simulator/scanner
  • API: POST /api/v1/simulator/scan
  • Static rule engine detecting Soroban anti-patterns (std imports, missing #[contract], unchecked auth, panic!, unsafe blocks)
  • Severity-weighted security score (0–100) with remediation guidance
  • Files: frontend/src/lib/simulator/vulnerabilityScanner.ts, backend/src/services/vulnerabilityScanner.service.ts

4. Issue Triage Minigame — Smart Contract Playground

  • Route: /playground/triage
  • API: GET /api/v1/playground/triage/scenarios, POST /triage/score, GET /triage/leaderboard
  • XState-powered minigame: prioritize and label 4 maintainer issue scenarios
  • Server-side scoring with Redis-backed leaderboard via CacheService
  • Files: frontend/src/lib/playground/issueTriage.ts, issueTriageMachine.ts, backend/src/services/issueTriage.service.ts

Architecture

All features follow the project's data → derive → render separation:

  • Pure logic modules are side-effect-free and unit-testable
  • React hooks orchestrate state; components are presentational
  • Backend services encapsulate business logic; routes are thin handlers
  • Routes registered in backend/src/routes/index.ts

Documentation

  • Added docs/CURRICULUM_MODULE_FEATURES.md with routes, APIs, and test commands
  • Updated frontend/HACKATHON_IDEA_GENERATOR_README.md with block explorer sub-route

Test plan

  • cd frontend && npx vitest run src/lib/open-source/__tests__/gasCalculator.test.ts
  • cd frontend && npx vitest run src/lib/idea-generator/__tests__/blockExplorer.test.ts
  • cd frontend && npx vitest run src/lib/simulator/__tests__/vulnerabilityScanner.test.ts
  • cd frontend && npx vitest run src/lib/playground/__tests__/issueTriage.test.ts
  • cd backend && npm test -- --testPathPattern="gas-estimation|block-explorer|vulnerability-scanner|issue-triage"
  • Visit /open-source/gas-calculator — paste contract, run estimate, verify budget + strategies
  • Visit /hackathon-ideas/explorer — confirm live tx feed, filters, idea suggestions
  • Visit /simulator/scanner — scan sample contract, verify findings + score
  • Visit /playground/triage — complete minigame round, verify scoring flow
  • POST /api/v1/osct/gas-estimate with sample Soroban source returns budget analysis
  • POST /api/v1/simulator/scan with vulnerable source returns findings array
  • POST /api/v1/playground/triage/score with correct answers returns 100% accuracy

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@success-OG is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@success-OG Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant