Skip to content

[#894] Add claim UI + proof API + campaign end state#912

Merged
realproject7 merged 4 commits intomainfrom
task/894-claim-ui
Apr 21, 2026
Merged

[#894] Add claim UI + proof API + campaign end state#912
realproject7 merged 4 commits intomainfrom
task/894-claim-ui

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Fixes #894

Summary

  • GET /api/airdrop/proof?address=0x...: returns Merkle proof, amount, and eligibility for a user's claim from pl_airdrop_proofs
  • ClaimPanel component:
    • Connect wallet prompt when disconnected
    • Shows allocated PLOT amount + USD value for eligible users
    • "Claim PLOT" button calls MerkleClaim.claim(amount, proof) on-chain
    • Reads claimed(address) from contract to show claimed status
    • Transaction confirmation with explorer link
    • "Not eligible" message for non-participants
  • Page update: conditionally renders ClaimPanel (after campaign end) or UserPoints (during campaign), based on AIRDROP_CONFIG.CAMPAIGN_END
  • MerkleClaim contract address configurable via NEXT_PUBLIC_MERKLE_CLAIM_ADDRESS env var

Test plan

  • Verify connect wallet prompt when disconnected
  • Verify eligible user sees allocated amount and claim button
  • Verify claim button triggers contract write with correct args
  • Verify claimed status shown after successful tx
  • Verify non-eligible user sees appropriate message
  • Verify already-claimed user sees "Claimed" + tx link
  • Verify proof API returns correct data for eligible address
  • Verify proof API returns eligible:false for unknown address
  • Verify page shows UserPoints during active campaign, ClaimPanel after end

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 21, 2026 6:32am

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The proof API and basic claim button are in place, but the campaign-end experience still misses required issue #894 behaviors.

Findings

  • [high] After campaign end, the page does not render the required final-results section at all. Issue #894 explicitly requires milestone achieved, distributed vs burned amounts, and a burn transaction link, but this PR only swaps UserPoints for ClaimPanel.
    • File: src/app/airdrop/page.tsx:16
    • Suggestion: Add the post-campaign results block described in the issue before or alongside ClaimPanel, including milestone outcome, distribution/burn totals, and burn tx link.
  • [medium] Already-claimed users cannot see the required transaction link unless the claim happened in the current browser session. The component derives txHash only from the current writeContract success path, so a wallet that claimed previously will show Claimed with no explorer link.
    • File: src/components/airdrop/ClaimPanel.tsx:138
    • Suggestion: Load and render the persisted claim transaction hash for already-claimed users, or extend the proof/claim-status API so the UI can show the explorer link even on a fresh page load.

Decision

Requesting changes because the post-campaign page still omits required final-results information, and the already-claimed state does not fully meet the issue requirements.

realproject7 and others added 2 commits April 21, 2026 15:28
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The previous blockers are addressed, but the new final-results section is still using the wrong source of truth for the post-campaign outcome.

Findings

  • [high] CampaignResults derives the final milestone/distribution from live /api/airdrop/status milestone flags, which reflect current status logic rather than the finalized TWAP result from the campaign finalization flow. Issue #894 requires the post-campaign page to show the final campaign results, and those should come from the finalized outcome, not from whichever milestone the live status endpoint currently marks as reached.
    • File: src/components/airdrop/ClaimPanel.tsx:43
    • Suggestion: Read the finalized campaign result (for example the stored final milestone / distribution / burn metadata produced by the finalize step) and render that, rather than recomputing from live status data.

Decision

Requesting changes because the post-campaign results can show the wrong milestone, distributed amount, and burn amount if live status diverges from the finalized TWAP-based result.

…status

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up update resolves the finalized-results source issue from my prior review. The post-campaign results block now reads from a dedicated finalized-results endpoint derived from pl_airdrop_proofs, rather than recomputing from live status milestones.

Findings

  • No remaining code-level blockers in the changed files.

Decision

Approving because the claim UI and campaign-end state I reviewed now satisfy issue #894.

@realproject7 realproject7 merged commit 8e0c9ba into main Apr 21, 2026
2 of 4 checks passed
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.

[Airdrop P5] Claim UI + burn

2 participants