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

[CLAIM - Approve] - Tweak useApproveCallbackFromClaim + wire into app #2230

Merged
merged 3 commits into from
Jan 20, 2022

Conversation

W3stside
Copy link
Contributor

Summary

Wires in the new useApproveCallbackFromClaim - which has been tweaked to better handle how the claim flow works.

Testing

  1. Use an account that has GNO/USDC & NO APPROVALS
  2. Using same account, approve GNO/USDC and note that in MM the approve amount is huge
  3. reload app, see that it is approved
  4. Using same connected account, hit "Change account" and paste an account with paid claims GNO/USDC (fresh address that doesn't have approvals)
  5. See that tokens are approved because you are using the connected account from step 1 which is approved
  6. ETH is already approved

@W3stside W3stside requested review from anxolin, alfetopito and a team January 20, 2022 12:03
@github-actions
Copy link
Contributor

  • 🔭 GP Swap: Gnosis 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.

Great!

// Claim only approves GNO and USDC (GnoOption & Investor, respectively.)
const approveAmounts = useMemo(() => {
if (supportedChain && (claimType === ClaimType.GnoOption || claimType === ClaimType.Investor)) {
const investmentCurrency = claimTypeToToken(claimType, supportedChain) as Token
Copy link
Contributor

Choose a reason for hiding this comment

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

Just out of curiosity, could we also use claim.currencyAmount?.currency from the claim object here?

@W3stside
Copy link
Contributor Author

merging to consolidate branches then will rebase the base

@W3stside W3stside merged commit d77208e into claim-approve-optional-param Jan 20, 2022
maria-vslvn pushed a commit that referenced this pull request Jan 25, 2022
redux-devtools-extension integration is already provided through @reduxjs/toolkit.
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