Skip to content

fix(DelegatingWidget): Add dialog for unbonding all stake#451

Merged
ECWireless merged 4 commits intomainfrom
190-add-confirmation-dialog-for-orchestrators-unbonding-all-stake
Dec 19, 2025
Merged

fix(DelegatingWidget): Add dialog for unbonding all stake#451
ECWireless merged 4 commits intomainfrom
190-add-confirmation-dialog-for-orchestrators-unbonding-all-stake

Conversation

@thebeyondr
Copy link
Collaborator

@thebeyondr thebeyondr commented Dec 19, 2025

Description

Add confirmation dialog warning orchestrators before they unbond all stake, which would deactivate them from the active set.

Type of Change

  • feat: New feature
  • fix: Bug fix

Related Issue

Closes #190

Changes Made

  • Add pre-transaction confirmation dialog when orchestrators unbond all stake, warning about deactivation
  • Show post-transaction message confirming orchestrator deactivation in success dialog
  • Fix precision loss bug: replace lossy float conversion with BigInt for stake comparisons
  • Guard willDeactivate check to wait for pendingStake data before evaluating
  • Disable confirm button when contract simulation isn't ready
  • Add wasDeactivated flag to transaction input data for success message rendering

Testing

  • Tested locally
  • Added/updated tests
  • All tests passing

Screenshots (if applicable)

image

Checklist

  • [x ] My commits are signed (verified)
  • [ x] My commit messages follow Conventional Commits format
  • [x ] My branch name follows the naming convention
  • I have requested a review from @ECWireless
  • My code follows the project's code style
  • I have commented my code where necessary
  • [] I have updated the documentation if needed

Additional Notes

Dialog copy:

  • Title: "Unbonding all stake"
  • Message: "This will deactivate your orchestrator and remove you from the active set. You'll stop earning rewards until you stake again."
  • Buttons: Cancel | Yes, unbond my stake (destructive)

- Show confirmation dialog when unbonding all stake as an orchestrator
- Display deactivation notice in success message post-transaction
- Add willDeactivate/wasDeactivated flags to track deactivation state
…vation check

- Replace lossy float conversion with BigInt to fix precision errors on large stakes
- Wait for pendingStake to load before evaluating willDeactivate
- Disable confirm button when contract simulation isn't ready
…nt function

- Cast newPosPrev and newPosNext to the expected hex string format
@thebeyondr thebeyondr linked an issue Dec 19, 2025 that may be closed by this pull request
@vercel
Copy link
Contributor

vercel bot commented Dec 19, 2025

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

Project Deployment Review Updated (UTC)
explorer-arbitrum-one Ready Ready Preview, Comment Dec 19, 2025 7:13pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a confirmation dialog to warn orchestrators before they unbond all their stake, which would deactivate them from the active set. It also fixes a precision loss bug by replacing lossy float conversion with BigInt for stake comparisons.

Key Changes:

  • Added pre-transaction confirmation dialog with deactivation warning when orchestrators attempt to unbond all stake
  • Fixed precision loss bug by converting stake comparisons from float operations to BigInt operations
  • Added post-transaction success message showing orchestrator deactivation status

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
hooks/useExplorerStore.tsx Added wasDeactivated flag to InputData type for tracking deactivation state in transaction data
components/TxConfirmedDialog/index.tsx Updated success dialog to conditionally display orchestrator deactivation message when unbonding completes
components/DelegatingWidget/Undelegate.tsx Added confirmation dialog UI with deactivation warning, implemented conditional dialog flow based on willDeactivate flag, and added TypeScript Props interface
components/DelegatingWidget/Footer.tsx Fixed precision loss by converting stake comparison from float to BigInt, added willDeactivate calculation logic with proper guards for data loading, and passed flag to Undelegate component

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@ECWireless ECWireless left a comment

Choose a reason for hiding this comment

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

Looks great!

@ECWireless ECWireless merged commit 389be4e into main Dec 19, 2025
6 checks passed
@ECWireless ECWireless deleted the 190-add-confirmation-dialog-for-orchestrators-unbonding-all-stake branch December 19, 2025 19:41
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.

Add confirmation dialog for orchestrators unbonding all stake

3 participants