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

Fix avilable claims issue on rinkeby #2420

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

nenadV91
Copy link
Contributor

Summary

Fixes #2419

This scenario happens when there are no claimed or available claims but there is vCow balance, which means that user somehow has vCow balance but he didn't claim anything. So this probably shouldn't happen on Mainet or Gnosis Chain but happens on Rinkeby on accounts where you have vCow tokens from previous vCow contract deployments.

@nenadV91 nenadV91 requested review from a team February 14, 2022 15:53
@github-actions
Copy link
Contributor

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link
Contributor

  • 🔭 GP Swap: CoW Protocol v2 Swap UI

@@ -53,7 +69,7 @@ export function ClaimSummaryView({ showClaimText, totalAvailableText, totalAvail
</Trans>
</ClaimSummaryTitle>
)}
{totalAvailableAmount && (
{totalAvailableAmount && activeClaimAccount && (
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need this here, since the amount is only used as a flag.

You can control this in the parent component, as you already do.
I think it'll work the same without this extra parameter. Doesn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need this also because the totalAvailableAmount is now CurrencyAmount object by default and this happens otherwise
Screenshot from 2022-02-17 11-46-24

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright then

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

if (!hasClaimSummary) return null
if (!hasClaimSummary || !vCow) return null

let totalAvailableAmount: CurrencyAmount<Token> | undefined = CurrencyAmount.fromRawAmount(vCow, JSBI.BigInt(0))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now set to CurrencyAmount object by default because we want to show zero in this case and so that formatSmartLocaleAware and formatMax work

@nenadV91 nenadV91 merged commit e4364cb into develop Feb 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 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.

'Available to claim' tokens are displayed in Rinkeby when a user is not eligible to claim
3 participants