Skip to content

Conversation

@DengreSarthak
Copy link
Member

@DengreSarthak DengreSarthak commented Aug 14, 2025

Summary by CodeRabbit

  • New Features

    • Multi‑token prize pools with per‑token payouts.
    • Sponsor deposits in ETH or ERC20, with approval flow.
    • Token submission for organizer approval.
    • Cache‑first data loading with manual Sync and last‑synced time.
    • Per‑tab/page pagination for Explorer, My Hackathons, and Organizer views.
  • UI/UX

    • New cards: Approved Tokens, Sponsors, Become a Sponsor, Submit Token.
    • Prize displays now show percentages/multi‑token pool.
    • Status sorting, results info bars, improved empty states, avatars.
    • Suspense loaders for faster perceived performance.
  • Changes

    • Hackathon creation no longer takes an upfront prize; funding via sponsorships.

@coderabbitai
Copy link

coderabbitai bot commented Aug 14, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Broad refactor switching from a single-prize model to a multi-token sponsorship/payout system, adding ERC20 approval/deposit flows, token submission/approval, and per-token payouts. Introduces IndexedDB cache-first data loading with Suspense and pagination across listings. Updates ABIs for token-centric operations and simplifies hackathon creation by removing upfront prize funding.

Changes

Cohort / File(s) Summary
Multi-token sponsorship & payouts
app/[hackathon]/InteractionClient.tsx, app/[hackathon]/judge/JudgeVotingClient.tsx, app/manage/ManageClient.tsx
Move to approved-tokens model; per-token totals/symbols/decimals; payouts array on projects; ERC20 allowance/approval and deposit flows; token submission/approval; judges via getAllJudges; UI updated for sponsors/tokens.
Hackathon creation simplification
app/createHackathon/page.tsx
Removes prize pool inputs/allowances; createHackathon call reduced (no prize token/amount); prize funding now post-creation via sponsorships.
Explorer & listings: cache-first + pagination
app/explorer/page.tsx, app/myHackathons/page.tsx, app/organizer/[address]/OrganizerClient.tsx, app/page.tsx
Adds Suspense, IndexedDB-backed cache-first loads, Sync controls, last-sync timestamps, URL/page syncing, pagination, and multi-token prize labeling.
Data layer & hooks
hooks/useHackathons.ts, lib/indexedDB.ts
Adds TokenPayout interface and optional payouts on Project; introduces HackathonDB with stores for hackathons, user/organizer data, and details; expirable get/set APIs; exports singleton hackathonDB.
Contract ABIs & addresses
utils/contractABI/HackHub.ts, .../HackHubFactory.ts, .../SponsorshipLib.ts, .../Interfaces.ts, utils/contractAddress.ts
HackHub ABI overhauled for token-centric features (new reads/events/errors, updated constructor); Factory createHackathon drops prize params; adds SponsorshipLib ABI; IERC20 adds balanceOf; updates factory address for chain 534351.
Tooling
tsconfig.json
Changes TypeScript target to ES2020.

Sequence Diagram(s)

sequenceDiagram
  participant U as User
  participant UI as InteractionClient
  participant ERC20 as ERC20 Contract
  participant HH as HackHub Contract

  U->>UI: Enter token + amount + sponsor info
  UI->>ERC20: read allowance(balanceOf)
  alt allowance < amount
    UI->>ERC20: approve(HackHub, amount)
    ERC20-->>UI: Approval tx receipt
  end
  UI->>HH: depositToToken(token, amount, sponsorName, sponsorImage)
  HH-->>UI: SponsorDeposited event
  UI-->>U: Updated totals and sponsors
Loading
sequenceDiagram
  participant V as Viewer
  participant Page as Explorer/My/Organizer/Home
  participant DB as IndexedDB (hackathonDB)
  participant PC as publicClient
  V->>Page: Load view
  Page->>DB: get(cacheKey, chainId)
  alt Cache hit & fresh
    DB-->>Page: Cached data
    Page-->>V: Render from cache
  else Cache miss/stale
    DB-->>Page: No/expired data
  end
  Page->>PC: Fetch hackathons/details
  PC-->>Page: On-chain data
  Page->>DB: set(cacheKey, chainId, data)
  Page-->>V: Render updated data
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90 minutes

Possibly related PRs

Poem

A rabbit taps the ledger, hop-hop-hurray,
Tokens now mingle in a multicolored array.
Caches keep secrets, swift on the draw,
Judges and sponsors comply with the law.
Approve, deposit—thump of delight—
Prize pools in chorus, shining bright. 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e0fe4e1 and 64371f0.

📒 Files selected for processing (16)
  • app/[hackathon]/InteractionClient.tsx (17 hunks)
  • app/[hackathon]/judge/JudgeVotingClient.tsx (9 hunks)
  • app/createHackathon/page.tsx (11 hunks)
  • app/explorer/page.tsx (16 hunks)
  • app/manage/ManageClient.tsx (11 hunks)
  • app/myHackathons/page.tsx (19 hunks)
  • app/organizer/[address]/OrganizerClient.tsx (10 hunks)
  • app/page.tsx (4 hunks)
  • hooks/useHackathons.ts (1 hunks)
  • lib/indexedDB.ts (1 hunks)
  • tsconfig.json (1 hunks)
  • utils/contractABI/HackHub.ts (1 hunks)
  • utils/contractABI/HackHubFactory.ts (0 hunks)
  • utils/contractABI/Interfaces.ts (2 hunks)
  • utils/contractABI/SponsorshipLib.ts (1 hunks)
  • utils/contractAddress.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sarthak

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@DengreSarthak DengreSarthak merged commit cdc9a6e into main Aug 14, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 15, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants