Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Hotfix 1.10.4 - Fix network switch hard error #2498

Merged
merged 1 commit into from
Feb 25, 2022
Merged

Conversation

W3stside
Copy link
Contributor

Summary

Closes issue discovered in #2426 by @elena-zh
On network switch price for USDC was returning 0 breaking the price sdk

Error in prod:
image

To Test

  1. Claim for 0x3A184b6f604d5bb98d224367641D62d8ca8C072d
  2. switch to gnosis chain
  3. click the banner saying there are claims on Ethereum!
  4. it shouldn't error
  5. it SHOULD error in prod

@W3stside W3stside requested review from a team February 25, 2022 12:47
@github-actions
Copy link
Contributor

  • 🔭 GP Swap: CoW Protocol v2 Swap UI

Copy link

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -966,7 +966,7 @@ function _enhanceClaimData(claim: UserClaimData, chainId: SupportedChainId, pric

// Free claims will have tokenAndAmount === undefined
// If it's not a free claim, store the price and calculate cost in investment token
if (tokenAndAmount?.amount) {
if (tokenAndAmount?.amount && Number(tokenAndAmount.amount) > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Approving, although i don't get why price would be 0. It is hardcoded in the contract, so unless they haven't been loaded yet, i don't get how can they be zero.

Can this be hiding some other issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like a lag between switching from Gnosis Chain, where USDC price is 0

@W3stside W3stside merged commit 1e7b7ca into master Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants