Fix: corresponding Withdrawal Status fixed for Ended Auctions as done in Contracts#62
Fix: corresponding Withdrawal Status fixed for Ended Auctions as done in Contracts#62aniket866 wants to merge 2 commits into
Conversation
WalkthroughThree 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
components/auction/auction-detail-ui/AllPayDetail.tsxcomponents/auction/auction-detail-ui/EnglishDetail.tsxcomponents/auction/auction-detail-ui/VickreyDetail.tsx
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,availableFundsis set to0atomically by the contract, so it reliably reflects state.Logic
highestBid === 0(AllPay/English) orwinningBid === 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 displaycomponents/detail/english-detail.tsx— added withdrawal status displaycomponents/detail/vickrey-detail.tsx— added withdrawal status displaycomponents/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:
I have used the following AI models and tools: TODO
Checklist
Summary by CodeRabbit