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

Use airdrop claim end date #2178

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Use airdrop claim end date #2178

merged 1 commit into from
Jan 18, 2022

Conversation

alfetopito
Copy link
Contributor

Summary

Follow up to #2158 adding the claim deadline to airdrop only claims
Screen Shot 2022-01-17 at 14 21 46

@biocom please style as you see fit. Feel free to adjust also the format used, or if you want to show the countdown here or not

To Test

  1. Load one account that has no PAID claims and has not been claimed yet (list at the bottom)
  2. The claim time deadline should be shown (see pic)

Accounts

  • 0xa4848704A3B3f61bDC42c40CA964eA7295eD101C
  • 0x22F54D79ba28A31686eB22E1b0d7Cf5B9A4D5e99
  • 0x43fe583631F9DDd118f904E4897ede77b698E0b0
  • 0x96514697A5d343e75AA19eb72594030945f9c25a
  • 0x146Ab012B49fAFeD35B4FF645fC48C50fD53eAD6
  • 0x8CCbC8E2A82Aa7D7AbE95E455482Df5f197722f0
  • 0xE82AA47bAedbE3B2453350f559068e0377dC504b
  • 0x7340F8a2601FEeeB51cdED50a47ed7e06C258618
  • 0x8E467C5D9a6C388A8AA27D6AA0411d50601409C4
  • 0x122671322dd9Cf0F4da2d61F51729C50a6263f55

@alfetopito alfetopito self-assigned this Jan 17, 2022
@alfetopito alfetopito requested a review from a team January 17, 2022 22:24
@github-actions
Copy link
Contributor

  • 🔭 GP Swap: Gnosis Protocol v2 Swap UI

@fairlighteth
Copy link
Contributor

Looks good. Couple of things we could review in this PR:

@@ -24,7 +26,7 @@ export default function CanUserClaimMessage({ hasClaims, isAirdropOnly }: ClaimI
<Trans>
Thank you for being a supporter of CowSwap and the CoW protocol. As an important member of the CowSwap
Community you may claim vCOW to be used for voting and governance. You can claim your tokens until{' '}
<i>XX-XX-XXXX - XX:XX GMT</i>
<i>{end && new Date(end).toLocaleString()}</i>
Copy link
Contributor

Choose a reason for hiding this comment

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

If end (useAirdropDeadline) has reached the deadline, does hasClaims return false? Just to see what we'd return in different scenarios:

  • Deadline ended > but user has unclaimed claims.
  • Deadlined ended > User has claimed all claims.
  • Deadline still open > but user has claimed all their claims.

Copy link
Contributor

@W3stside W3stside Jan 18, 2022

Choose a reason for hiding this comment

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

i agree with @biocom - we should create another fn to handle states:

function _getHumanReadableClaimDeadline(end: number) {
    const now = Date.now()

    if (end > now) {
        contextString = 'Unfortunately your claim opportunity time is in the past. Your free claim opportunities expired on'
    } else {
        contextString = 'As an important member of the CowSwap Community you may claim vCOW to be used for voting and governance. You can claim your tokens until'
    }

    return contextString + ' ' + new Date(end).toLocaleString()
}

Copy link
Contributor

@anxolin anxolin Jan 18, 2022

Choose a reason for hiding this comment

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

If end (useAirdropDeadline) has reached the deadline, does hasClaims return false? Just to see what we'd return in different scenarios:

Yes (eventually). We are currently removing the claimable options from the list. So this flag would be reevaluated every block. Its possible theres a brief moment users see this flag to true, and the time expired. However, is not too important in this case

Deadline ended > but user has unclaimed claims.

hasClaims = false

Deadlined ended > User has claimed all claims.

hasClaims = false

Deadline still open > but user has claimed all their claims.

hasClaims = false

@W3stside
Copy link
Contributor

W3stside commented Jan 18, 2022

@anxolin and @alfetopito approving and merging but let's consider #2183

@W3stside W3stside self-requested a review January 18, 2022 10:53
@W3stside W3stside merged commit 6277b03 into claim Jan 18, 2022
@elena-zh
Copy link

Changes under the current PR LGTM!

@alfetopito alfetopito deleted the 2120/airdrop-claim-time branch January 18, 2022 14:12
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.

5 participants