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

Claim hooks pt 1 - useClaimCallback #2041

Merged
merged 9 commits into from
Dec 24, 2021
Merged

Claim hooks pt 1 - useClaimCallback #2041

merged 9 commits into from
Dec 24, 2021

Conversation

alfetopito
Copy link
Contributor

@alfetopito alfetopito commented Dec 24, 2021

Summary

Updated ClaimType from a TS type to an enum, to be inline with contract
Added modified useClaimCallback

Example of a successful tx claiming 1080 https://rinkeby.etherscan.io/tx/0x90ad7c1ffc412c75286f91ae821c23397bbe0e2e75fdcf6e5961101c7b1f220e

Screenshot from 2021-12-24 07-16-03

To Test

  1. Edit this file with a different claim since I already claimed 1080 (no way to do that in the UI yet)
  2. Connect wallet to rinkeby
  3. Click on claim vCOW
  4. Click on claim in the modal
  • Your transaction should be sent

    Background

Optional: Give background information for changes you've made, that might be difficult to explain via comments

setAttempting(true)
claimCallback()
claimCallback([{ index: 1080 }])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Trying to claim the claim 1080 for account 0x0Ae21f9700eD15E1a83baa3183a67d54b1DA2086

Copy link
Contributor

Choose a reason for hiding this comment

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

use registerOnWindow and make a global index changeable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't think it's worth the effort, we'll soon wire this up with the UI

@github-actions
Copy link
Contributor

  • 🔭 GP Swap: Gnosis Protocol v2 Swap UI

Comment on lines -54 to +56
const { account, chainId } = useActiveWeb3React()
const { chainId } = useActiveWeb3React()

const account = '0x0Ae21f9700eD15E1a83baa3183a67d54b1DA2086'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Temporary hard coded changes

@@ -57,7 +57,7 @@ export const V_COW_CONTRACT_ADDRESS: Partial<Record<number, string>> = {
// [ChainId.MAINNET]: GPv2Settlement[ChainId.MAINNET].address,
// [ChainId.RINKEBY]: GPv2Settlement[ChainId.RINKEBY].address,
// [ChainId.XDAI]: GPv2Settlement[ChainId.XDAI].address,
[ChainId.RINKEBY]: '0x8f07778b703f9feb93521fc5230e859dbd032b6b',
[ChainId.RINKEBY]: '0xac17Ae2BcAF9Ed181C4Ab10B179548d6aa30C92E',
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 why it didn't work before, I was using the wrong contract address...

Copy link
Contributor

Choose a reason for hiding this comment

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

@alfetopito alfetopito self-assigned this Dec 24, 2021
@alfetopito alfetopito requested a review from a team December 24, 2021 11:33
@alfetopito alfetopito marked this pull request as ready for review December 24, 2021 11:54
@alfetopito alfetopito changed the title WIP -- doing a bunch of stuff -- will make it look nice eventually Claim hooks pt 1 - useClaimCallback Dec 24, 2021
Copy link
Contributor

@W3stside W3stside left a comment

Choose a reason for hiding this comment

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

nice

@alfetopito alfetopito merged commit d2060bb into claim Dec 24, 2021
@alfetopito alfetopito deleted the claim-hooks-1 branch December 24, 2021 15:03
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.

2 participants