Skip to content

Conversation

@DengreSarthak
Copy link
Member

@DengreSarthak DengreSarthak commented Aug 29, 2025

Summary by CodeRabbit

  • New Features

    • Switched to a deposit-based prize pool (no token approvals).
    • Added Sponsor Management: view sponsors, contributions, and block/unblock.
    • Updated Deposit flow: enter ETH or custom ERC20 address; clearer guidance.
    • Payouts across pages now use deposited tokens.
  • UI/Style

    • Introduced Prize Pool and Sponsor Management sections.
    • Enlarged header branding (bigger logo and title).
  • Chores

    • Updated contract interfaces and network address to support sponsor/deposit model.

@coderabbitai
Copy link

coderabbitai bot commented Aug 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR migrates from an approved-tokens model to a deposited-tokens and sponsor-centric model across UI, state, caching, and ABI. It updates multiple clients to read getDepositedTokensList, adds sponsor management (block/unblock), revises IndexedDB schemas, updates ABIs, enlarges navigation branding, and changes a factory address.

Changes

Cohort / File(s) Summary of Changes
Token model migration (core client)
app/[hackathon]/InteractionClient.tsx
Replace approved/min token model with depositedTokens; remove token approval UI; update reads to getDepositedTokensList; adjust payouts, totals, symbols/decimals; update cache read/write fields; revise labels and deposit UI (ETH/ERC20, custom address).
Judge/My/Projects token source swap
app/[hackathon]/judge/JudgeVotingClient.tsx, app/myHackathons/page.tsx, app/projects/ProjectsClient.tsx
Swap contract read from getApprovedTokensList to getDepositedTokensList; keep existing state names and downstream logic; semantics now reflect deposited tokens.
Sponsor management + prize pool
app/manage/ManageClient.tsx
Introduce sponsor-centric UI/data: load sponsors, per-token contributions, symbols; add block/unblock actions; replace Submitted/Approved sections with Sponsor Management and Prize Pool; new types SponsorInfo and DepositedTokenInfo; remove min amounts and approval handlers.
IndexedDB extended details
lib/indexedDB.ts
Make depositedTokens/approvedTokens/tokenMinAmounts optional in get/set; conditional (de)serialization of tokenMinAmounts; persist new fields alongside existing totals/symbols/decimals/sponsors.
ABI: HackHub
utils/contractABI/HackHub.ts
Replace approval/token submission APIs with deposited-tokens and sponsor APIs; add errors; update events (ProjectSubmitted, Voted, PrizeClaimed); add sponsor block/unblock/profile and getDepositedTokensList; remove submit/approve token and transferOwnership.
ABI: SponsorshipLib
utils/contractABI/SponsorshipLib.ts
Shift to sponsor-centric ABI: remove token submission/approval, add SponsorBlocked/Unblocked events, SponsorNotFound error; introduce block/unblock sponsor, getDepositedTokensList, getSponsorProfile; rename isTokenApproved → isSponsorBlocked.
ABI: Ownable interfaces
utils/contractABI/Interfaces.ts
Add _checkOwner() and _transferOwnership(address) to OwnableABI.
Navigation branding size
components/navigation.tsx
Increase logo container and image size; enlarge title text.
Factory address map
utils/contractAddress.ts
Update HackHubFactoryAddress for chainId 534351.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Client UI
  participant C as Contract (HackHub)
  participant DB as IndexedDB Cache

  rect rgb(240,248,255)
  note over UI,DB: Initial load
  UI->>DB: getExtendedHackathonDetails()
  DB-->>UI: depositedTokens?, tokenTotals, sponsors?
  UI->>C: getDepositedTokensList()
  C-->>UI: [tokenAddrs]
  UI->>C: getTokenTotal/symbol/decimals (per token)
  C-->>UI: totals/symbols/decimals
  UI->>DB: setExtendedHackathonDetails(..., depositedTokens, ...)
  end

  rect rgb(245,255,240)
  note over User,C: Sponsor deposit (on-chain, out of scope here)
  end

  rect rgb(255,248,240)
  note over User,UI: Sponsor management
  User->>UI: Block/Unblock sponsor
  UI->>C: blockSponsor(s) / unblockSponsor(s)
  C-->>UI: tx result
  UI->>C: getAllSponsors / getSponsorProfile / getSponsorTokenAmount
  C-->>UI: sponsors + contributions
  UI->>DB: setExtendedHackathonDetails(..., sponsors)
  end
Loading
sequenceDiagram
  autonumber
  actor Judge
  participant JC as Judge Client
  participant C as Contract (HackHub)

  note over JC,C: Payout breakdown source
  JC->>C: getDepositedTokensList()
  C-->>JC: [tokenAddrs]
  JC->>C: getTokenTotal/symbol (per token)
  C-->>JC: totals/symbols
  JC-->>Judge: Render payouts based on deposited tokens
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Possibly related PRs

Poem

A thump of paws, a ledger anew,
We hop from “approved” to “deposited” true.
Sponsors unburrow, toggled with care,
Prize pools gleam with symbols to share.
Cache burrows deeper, ABIs align—
Carrots for contracts, and payouts divine. 🥕✨


📜 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 sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 606b878 and e977402.

📒 Files selected for processing (11)
  • app/[hackathon]/InteractionClient.tsx (10 hunks)
  • app/[hackathon]/judge/JudgeVotingClient.tsx (1 hunks)
  • app/manage/ManageClient.tsx (7 hunks)
  • app/myHackathons/page.tsx (1 hunks)
  • app/projects/ProjectsClient.tsx (1 hunks)
  • components/navigation.tsx (1 hunks)
  • lib/indexedDB.ts (4 hunks)
  • utils/contractABI/HackHub.ts (2 hunks)
  • utils/contractABI/Interfaces.ts (1 hunks)
  • utils/contractABI/SponsorshipLib.ts (5 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 @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit 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 @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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 2b69516 into main Aug 29, 2025
1 check was pending
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