Skip to content

feat: display correct symbol #645

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

Merged
merged 7 commits into from
May 27, 2025
Merged

Conversation

w84april
Copy link
Collaborator

Description

Display gauge asset symbol if "Deposit & Stake" is on

Related Issue

rossgalloway/ySHIP#46

Copy link

vercel bot commented Apr 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yearnfi ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2025 3:17pm

@rossgalloway rossgalloway requested a review from Copilot May 6, 2025 17:47
Copy link
Contributor

@Copilot 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 updates the vault staking data hooks and UI components to display the correct gauge asset symbol when "Deposit & Stake" is active. Key changes include:

  • Adding a new field (stakedGaugeSymbol) to the TStakingInfo type and updating data extraction in useVaultStakingData.
  • Updating the RewardsTab component to display the symbol from the newly fetched stakedGaugeSymbol.
  • Modifying the QuickActionsTo component to select the correct symbol based on the auto-staking status.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/vaults/hooks/useVaultStakingData.ts Introduces stakedGaugeSymbol and adjusts data extraction logic for staking data.
apps/vaults-v3/components/details/actions/QuickActionsTo.tsx Implements selection of the correct symbol and introduces a debug log.
apps/vaults-v3/components/details/RewardsTab.tsx Removes redundant symbol fetching and displays the new stakedGaugeSymbol.

@rossgalloway
Copy link
Collaborator

I think this is good to go. pretty simple.

murderteeth
murderteeth previously approved these changes May 7, 2025
Copy link
Collaborator

@murderteeth murderteeth left a comment

Choose a reason for hiding this comment

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

lg - note on multicalls. we should start using key-value maps instead of bare result arrays. the difference is in not having to document and use indexes on the results, we use readable named keys instead. maintainability+

@rossgalloway
Copy link
Collaborator

lg - note on multicalls. we should start using key-value maps instead of bare result arrays. the difference is in not having to document and use indexes on the results, we use readable named keys instead. maintainability+

new commit attempts to fix this. How did 04-mini do?

Copy link
Contributor

@Copilot 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 updates the vault staking data flow to include and display the gauge asset symbol when "Deposit & Stake" is active. Key changes include:

  • Adding a new property and decoding logic for stakedGaugeSymbol in the vault staking hook.
  • Updating QuickActions and Rewards components to use the new stakedGaugeSymbol.
  • Removing a redundant read contract call for symbol in the RewardsTab component.

Reviewed Changes

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

File Description
apps/vaults/hooks/useVaultStakingData.ts Added stakedGaugeSymbol support in state and contract calls to decode it.
apps/vaults-v3/components/details/actions/QuickActionsTo.tsx Updated quick actions to display stakedGaugeSymbol when auto-staking is enabled.
apps/vaults-v3/components/details/RewardsTab.tsx Modified symbol display to use stakedGaugeSymbol from vaultData.
Comments suppressed due to low confidence (1)

apps/vaults/hooks/useVaultStakingData.ts:83

  • Consider verifying the fallback logic at line 83; using 'foundVaultWithDisabledStaking || zeroAddress' might be redundant given the ternary condition. Reverting to the previous pattern could improve clarity.
const stakingAddress = foundVaultWithDisabledStaking ? toAddress(foundVaultWithDisabledStaking || zeroAddress) : toAddress(props.currentVault.staking.address);

murderteeth
murderteeth previously approved these changes May 8, 2025
@rossgalloway rossgalloway merged commit 180eaa5 into main May 27, 2025
9 checks passed
@rossgalloway rossgalloway deleted the feat/display-correct-symbol branch May 27, 2025 21:38
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.

3 participants