Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile: Add COW to Metamask: Waterfall PR[3] #378

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

fairlighteth
Copy link
Contributor

Summary

  • Adds the 'Add COW to Metamask' button
  • Adds the 'Contract' external url for vCOW.

Screen Shot 2022-04-05 at 18 28 22

@fairlighteth fairlighteth requested review from a team April 5, 2022 17:30
@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2022

CLA Assistant Lite:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger the CLA Action by commenting recheckcla in this Pull Request

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2022

  • 🔭 GP Swap: CoW Protocol v2 Swap UI

@elena-zh
Copy link

elena-zh commented Apr 6, 2022

Hey @fairlighteth , great changes!
Some notes from my side:

  1. 'Added COW' message is shifted towards all the rest links on the widget
    image

  2. 'Added COW' button is not changed to 'Add to MM' when switch accounts/change networks: https://watch.screencastify.com/v/0Dl9oGUP05nFEepQ7SiU

  3. It is an known issue, but I will report it once again: COW token is added with a broken icon to MM
    image
    Besides, it shows 'Added COW' message when I have not added the token to MM (cancelled it request)

Thank you!

@fairlighteth
Copy link
Contributor Author

@elena-zh
Thanks for reviewing. Some comments:

  1. This should already be fixed in one of the later waterfall PRs.
  2. Can you double check? I've tested it like this:
  • I connected with MetaMask: Shows 'Add Token' component
  • I switch to WalletConnect (Gnosis Safe) -> Add token is changed for the 'copy contract'. At least this happens on profile-actions-6 (a later waterfall PR...)
  1. This is outside this PR, but something we should fix for sure. I have created a PR on MetaMask (Add (v)COW tokens for Ethereum Mainnet. MetaMask/contract-metadata#1024) that got merged. That hopefully should soon fix this.

@elena-zh
Copy link

elena-zh commented Apr 6, 2022

BTW, I noticed, that 'Add to MM' button is displayed in 1Inch wallet.
image

I assume, that it might be related to the existing issue #322 , however, would be nice to fix, as the button does not work in this wallet.

@fairlighteth
Copy link
Contributor Author

@elena-zh That's definitely an issue. In this case I'm inheriting the same component. So perhaps we update the original issue, saying that the component is also used on the Profile page.

@elena-zh
Copy link

elena-zh commented Apr 6, 2022

Can you double check? I've tested it like this:
I connected with MetaMask: Shows 'Add Token' component
I switch to WalletConnect (Gnosis Safe) -> Add token is changed for the 'copy contract'. At least this happens on profile-actions-6 (a later waterfall PR...)

It is a bit another case.

  1. Connect to MM
  2. Add COW token to MM
  3. Switch a network in MM: 'added' is still displayed
  4. Switch an account in MM: 'added is still displayed.

@elena-zh
Copy link

elena-zh commented Apr 6, 2022

@fairlighteth , I have noticed that the button does not work in MM integrated browser: I press on it, it shows me that the token in added, but it does not appear in the wallet's token list

Skype_Video.mp4

@fairlighteth
Copy link
Contributor Author

@elena-zh Does it have the same behavior in the transaction modal, where we have this Add To Metamask button? If so, we should add this bug to the other issue.

@elena-zh
Copy link

elena-zh commented Apr 6, 2022

@elena-zh Does it have the same behavior in the transaction modal, where we have this Add To Metamask button? If so, we should add this bug to the other issue.

@fairlighteth , I have just retested it.. And it appears that the issue is no longer reproducible.
So, it might have been a MM glitch.
I'm sorry for the false alarm..

@fairlighteth
Copy link
Contributor Author

@elena-zh No worries. Perhaps it is a bug/glitch worth keeping an eye on.

@elena-zh
Copy link

elena-zh commented Apr 6, 2022

At least this happens on profile-actions-6

@fairlighteth , I have retested the issue on profile-actions-6 pr, it is still there.

@fairlighteth
Copy link
Contributor Author

@elena-zh We need a separate issue for this, given it touches on the AddToMetamask component.

@elena-zh
Copy link

elena-zh commented Apr 6, 2022

@fairlighteth , I have reported #389 issue for this.

@fairlighteth
Copy link
Contributor Author

@elena-zh Thank you 🙏🏼

@W3stside
Copy link
Contributor

W3stside commented Apr 6, 2022

just the chainid issue and all good

* Buy COW route

* Profile: Orange link hover and shorter Add to Metamask label: Waterfall PR[5] (#381)

* Orange link on hover.

* Add shorter label option.

* Profile: Conditional 'Add Token' vs 'Copy contract address': Waterfall PR[6] (#383)

* Detect MetaMask: conditional AddToMetaMask button

* Click to copy token contract address.

* Profile: Make elements responsive: Waterfall PR[7] (#384)

* Mobile responsive.

* Mobile responsive fix + add copy contract vCOW

* Use string directly

* Replace 1 by ChainId

* Add check

* Set default mainnet chain when deconstructing.

* Update src/custom/pages/Profile/index.tsx

Co-authored-by: dave <[email protected]>

* Remove conditional check

Co-authored-by: dave <[email protected]>

Co-authored-by: dave <[email protected]>
@fairlighteth
Copy link
Contributor Author

Tested and addressed comments. Continuing merging. Feel free to review post-merge.

@fairlighteth fairlighteth merged commit 04c8a11 into profile-actions-2 Apr 6, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2022
Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

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

approve

Contract ↗
</ExtLink>
<CopyHelper toCopy={V_COW_CONTRACT_ADDRESS[chainId]}>
<div title="Click to copy token contract address">Copy contract</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

image

Are we sure we prefer to copy the contract address over sending the user to Etherscan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case it was not added as a preference per se: You've got both options there (View Contract and Copy Contract).

Rather it was a ported action from the COW balance card, where if you are not connected with MetaMask we show you 'Copy Contract' instead of 'Add Token' as a fall back.

Discussed with @elena-zh that it might not make sense to have 'Add Token' (to MetaMask) for vCOW (given it's non transferable anyway..) but might be OK to have the 'Copy contract' action.

Let me know your thoughts.

title="View contract"
href={getBlockExplorerUrl(chainId, COW_CONTRACT_ADDRESS[chainId], 'address')}
>
Contract ↗
Copy link
Contributor

Choose a reason for hiding this comment

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

More than contract, could be View Token and send you to Etherscan Token page?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that might be a better destination. Agree View Token looks more clear. Will check how it fits with the other labels.

@fairlighteth fairlighteth deleted the profile-actions-3 branch July 4, 2024 15:06
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