-
Notifications
You must be signed in to change notification settings - Fork 20
refactor(tangle-dapp): fixes for restaking, liquid staking, and migration flows #3092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Normalize vault asset addresses to lowercase for proper indexer matching - Add TokenIcon to vault selection in deposit/redeem pages - Improve vault display names (use underlying asset symbol) - Simplify redeem page UI with cleaner shares display - Show approximate asset value on pending redeem claims - Fix TransactionInputCard max amount handling for small values - Update local Anvil contract and token addresses 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…staking pages - Use getRoundedAmountString for consistent amount formatting in tables - Add proper icons and avatars for selected operator/asset in create vault - Use OperatorListItem and AssetListItem components for better list rendering - Show approximate asset value inline with shares in redeem page 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…osit/redeem forms When clicking Deposit/Redeem buttons in Vaults/Positions tables, the vault is now automatically pre-selected in the corresponding form based on the ?vault= query parameter. Also unified the Redeem button style to match the Deposit button. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…k length separately
…ain collisions Token metadata cache and lookups were not chain-aware, causing incorrect metadata to be returned when users switched between networks (e.g., same address could represent different tokens on different chains). Changes: - Restructure KNOWN_TOKEN_ADDRESSES to be keyed by chainId - Update metadataCache key format from "address" to "chainId:address" - Add chainId parameter to getCachedTokenMetadata, cacheTokenMetadata, and resolveTokenMetadata functions - Update all consumers to pass chainId from wagmi/viem 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ing operations Add txName and txDetails to liquid staking hooks so transactions display meaningful information in the TxHistoryDrawer: - Deposit: shows token address and amount with correct symbol - Request redeem: shows asset address and shares count - Redeem: shows asset address and shares count Also fix shares formatting to display without a token symbol suffix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…earer labels - Rename share columns for clarity: "Your Shares" vs "Total Shares" - Add optimistic redeem request display to avoid waiting for indexer - Refetch user position after redeem/claim for immediate UI updates - Fix TxConfirmationModal to not append token symbol to share amounts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Apply code formatting fixes across multiple files (dependency arrays, type annotations) - Remove approximate asset value display from liquid staking redeem page to reduce confusion - Convert ABI files from JSON-style to JavaScript object-style formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The commit 15279a9 synced ABIs from tnt-core with a new diamond pattern contract architecture, but the dapp code still expects the old function signatures (delegate, deposit, claimDelegatorRewards, etc.). - Revert multiAssetDelegation.ts, tangle.ts, blueprintServiceManager.ts, and operatorStatusRegistry.ts to pre-sync versions - Fix parseEventLogs type assertion in useServiceRequest.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Conflicts resolved: - tokenMetadata.ts: kept chain-separated structure, merged v2 addresses - claim-relayer: accepted deletion - multiAssetDelegation.ts: accepted v2 ABI - tangle.ts: accepted v2 ABI 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix NetworkType usage in processLeaderboardRecord.ts (use string literal) - Add chainId parameter to getCachedTokenMetadata call in RestakingAssetsTable - Import EIP1193Provider from viem in useViemWalletClient - Update Deposit button in VaultsTable to match Redeem button style 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Critical fixes: - Replace incorrect useRef with useMemo for static Icon objects - Fix memory leak from uncleaned setTimeout in redeem form - Fix optimistic requests claimable check by filtering out unindexed requests - Sync form state with useAllBlueprints in create-vault - Add timestamp tolerance to optimistic request cleanup to prevent race conditions Important fixes: - Remove fragile error string matching for ERC20 approval retry - Fix auto-close timer to check tx hash before closing modal - Limit dismissedHashes Set size to prevent memory growth - Standardize isNumericString to use faster regex implementation Suggestions: - Remove dead code exports from tokenMetadata.ts - Create useFormSetValue hook to consolidate setValue wrapper pattern - Standardize number formatting to use addCommasToNumber 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolved ABI conflict by taking v2 version 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Display an orange warning banner and update button text to inform users when the relayer fails and they need to pay gas fees directly from their wallet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Expand the TangleMigration contract ABI to include all functions, events, and error types. Add Base Sepolia chain icon for network selection UI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove attempt counter from the progress message to provide a cleaner user experience during proof generation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Prefer on-chain data over indexer for pending unstake and withdraw requests - Derive selectedAssetItem from depositedAssets in delegate page to ensure it updates when metadata loads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Renamed all unstake-related terminology to undelegate throughout the restaking codebase for clearer naming. This includes renaming the unstake directory, types, hooks, and variables. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Vaults tab was showing stale delegatedAmount values because RestakeContext only fetched from the GraphQL indexer. This fix adds useOnChainDelegator and merges its data with GraphQL, using on-chain as source of truth for asset positions (same pattern as useRestakingData used by Dashboard). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously clicking the delegate button on an operator would incorrectly navigate to the deposit flow. Now it navigates to the delegate flow with the operator pre-selected via query parameter. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Display the number of pending undelegate/withdraw requests on the expand button to improve UX visibility. The badge only appears when there is at least 1 request and stays in sync with the requests table data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The useRestakingAssets and useRestakingAssetMap hooks were only using wagmi's chainId, ignoring the network store. This caused the hooks to not respond to chain changes via the UI when the user wasn't connected to a wallet. Now uses the same pattern as other hooks (useOperators, useDelegatorCount): - When connected: use wagmi's chainId - When not connected: use networkChainId from the store 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@claude review |
|
Claude finished @drewstone's task —— View job I'm reviewing this comprehensive PR covering restaking, liquid staking, and migration flow improvements. Review Progress
🎯 Code Review SummaryThis PR implements significant QA improvements across multiple domains with strong architectural decisions. The changes demonstrate good engineering practices with proper data flow management, consistent terminology, and user experience enhancements. ✅ Strengths1. Excellent RestakeContext ArchitectureThe
2. Consistent Terminology MigrationThe
3. Smart Chain-Aware InfrastructureThe token metadata caching improvements prevent cross-chain collisions:
4. User Experience Enhancements
|
|
You fixing anything else up here @vutuanlinh2k2 ? |
No more pushes for this PR other minor fixes I can make based on Claude's suggestions. I uploaded the demo video on Restaking on Slack |
- Use EVMChainId enum instead of hardcoded chain IDs (84532, 31337, 1) - Create shared parseTransactionError utility for user-friendly error messages - Add safeParseAddress utilities to reduce unsafe `as Address` type assertions - Update useDelegator to use address validation helpers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Summary
This PR contains comprehensive QA fixes and improvements across the restaking, liquid staking, and migration claim flows:
Restaking Improvements
RestakeContextnow merges GraphQL data with on-chain delegator data to ensure accurate deposit/delegation amounts, fixing issues where the indexer could have stale dataunstake/toundelegate/)Liquid Staking Improvements
?vault=<address>from the URL to pre-select the vaultMigration Claim Improvements
Infrastructure
useFormSetValuehook to reduce duplication across formsTest plan
?vault=<address>URL parameter🤖 Generated with Claude Code