Skip to content
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

fix ETH price on sepolia network showing 0 #532

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

technophile-04
Copy link
Collaborator

Description

It seems wagmi chain sepolia has nativeCurrencySymbol as "SEP" instead of "ETH" and we had this guard condition in fetchPriceUniswap :

if (configuredNetwork.nativeCurrency.symbol !== "ETH" && !configuredNetwork.nativeCurrencyTokenAddress) {
    return 0;
  }

Which was returning the price as 0 for Sepolia chain originally encountered here -> scaffold-eth/se-2-challenges#84 (comment)

@technophile-04
Copy link
Collaborator Author

Tysm Rinat for review, Merging this 🙌

@technophile-04 technophile-04 merged commit e3b4bd2 into main Sep 15, 2023
1 check passed
@technophile-04 technophile-04 deleted the fix/sepolia-price-fetch branch September 15, 2023 10:46
@carletex
Copy link
Member

If we have to add another symbol in the future, we might want to use an array to store them ["ETH", "SEP", etc] with a good descriptive name + use !includes in the condition.

Thanks for fixing this!

@github-actions github-actions bot mentioned this pull request Oct 5, 2023
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