Skip to content

Fix: corresponding Withdrawal Status fixed for Ended Auctions as done in Contracts#62

Open
aniket866 wants to merge 2 commits into
StabilityNexus:mainfrom
aniket866:fix-Withdrawal
Open

Fix: corresponding Withdrawal Status fixed for Ended Auctions as done in Contracts#62
aniket866 wants to merge 2 commits into
StabilityNexus:mainfrom
aniket866:fix-Withdrawal

Conversation

@aniket866

@aniket866 aniket866 commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues:

Problem

After an auction ends, the UI only showed claim status (isClaimed) but had no indication of whether the auctioneer had withdrawn funds or if withdrawal was still pending.

Fix

Derived withdrawal status from availableFunds (already fetched from contract) instead of adding a new on-chain field. After withdrawal, availableFunds is set to 0 atomically by the contract, so it reliably reflects state.

Logic

  • highestBid === 0 (AllPay/English) or winningBid === 0 (Vickrey) → "No bids were placed, nothing to withdraw"
  • availableFunds === 0 → "Funds have been withdrawn"
  • availableFunds > 0 → "Withdrawal pending"

Changes

  • components/detail/allpay-detail.tsx — added withdrawal status display
  • components/detail/english-detail.tsx — added withdrawal status display
  • components/detail/vickrey-detail.tsx — added withdrawal status display
  • components/detail/exponential-detail.tsx — no change needed (Dutch auctions withdraw atomically on bid)

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • New Features
    • Auction detail pages now show a two-line post-deadline status: asset claim status plus a withdrawal status (no bids → nothing to withdraw; funds drained → funds have been withdrawn; otherwise → withdrawal pending).
    • The withdrawal/claim block now appears only once the auction is fully finished, ensuring accurate end-state information.

@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Three auction detail UI components now render a two-line status block after auction end: first line shows claimed/unclaimed, second line shows withdrawal state ("nothing to withdraw", "Funds have been withdrawn", or "Withdrawal pending") derived from bid/winningBid and availableFunds. VickreyDetail also adjusts its end-condition check.

Changes

Cohort / File(s) Summary
AllPay & English UI
components/auction/auction-detail-ui/AllPayDetail.tsx, components/auction/auction-detail-ui/EnglishDetail.tsx
Replaced single post-deadline <p> status with a vertical <div className="flex flex-col gap-1"> containing two lines: (1) claimed/unclaimed based on currentAuction.isClaimed, (2) withdrawal status based on currentAuction.highestBid and currentAuction.availableFunds.
Vickrey UI (deadline check change + status)
components/auction/auction-detail-ui/VickreyDetail.tsx
Changed end-condition to getVickreyPhase(currentAuction) === "ended" (replacing the prior bidRevealEnd time check) and updated the post-end UI to the same two-line pattern: claim line plus withdrawal status derived from currentAuction.winningBid and currentAuction.availableFunds.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped to the auction, nose in the breeze,
Claimed or unclaimed — now shown with ease,
A second small line whispers funds' fate,
Nothing, withdrawn, or pending — neat and straight,
I nibble a carrot and celebrate. 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding withdrawal status UI to ended auctions across multiple auction detail components, which aligns with the PR's primary objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/auction/auction-detail-ui/VickreyDetail.tsx`:
- Around line 158-171: The UI uses the auction deadline and highestBid to decide
post-Vickrey withdrawal messaging, which is wrong; update the gating and bid
checks in VickreyDetail.tsx to use the Vickrey phase end and the winning bid:
change the outer condition from Date.now() >= Number(currentAuction.deadline) *
1000 to Date.now() >= Number(currentAuction.vickreyPhaseEnd) * 1000, and replace
checks of currentAuction.highestBid with currentAuction.winningBid (e.g.,
Number(currentAuction.winningBid) === 0) while keeping the availableFunds logic
for withdrawal vs withdrawn messaging.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6045b13a-7d09-404e-abad-0fa38d5e90ce

📥 Commits

Reviewing files that changed from the base of the PR and between 2ca42ed and c2f3f8e.

📒 Files selected for processing (3)
  • components/auction/auction-detail-ui/AllPayDetail.tsx
  • components/auction/auction-detail-ui/EnglishDetail.tsx
  • components/auction/auction-detail-ui/VickreyDetail.tsx

Comment thread components/auction/auction-detail-ui/VickreyDetail.tsx Outdated
@aniket866 aniket866 requested a review from DengreSarthak March 24, 2026 17:51
@aniket866 aniket866 changed the title Fix: Withdrawal Status UI for Ended Auctions Fix: corresponding Withdrawal Status fixed for Ended Auctions as done in Contracts Mar 24, 2026
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.

1 participant