-
-
Notifications
You must be signed in to change notification settings - Fork 350
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
feat: add Wallet Connect support #284
Conversation
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is network access?This module accesses the network. Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use. What is new author?A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package. Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights. What's wrong with native code?Contains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs. Ensure that native code bindings are expected. Consumers may consider pure JS and functionally similar alternatives to avoid the challenges and risks associated with native code bindings. What is an install script?Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts. Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
@@ -364,6 +366,32 @@ const initialConnectedButtons = [ | |||
maliciousSeaport, | |||
]; | |||
|
|||
// Buttons that are available after connecting via Wallet Connect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the same as the ones with Extension, as we don't allow to deploy contracts for now (more logic might be needed for getting deployed contract address)
description: 'This is the E2e Test Dapp', | ||
url: 'https://metamask.github.io/test-dapp/', | ||
icons: ['https://avatars.mywebsite.com/'], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rdns: 'io.metamask', | ||
}, | ||
provider, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1075,7 +1187,7 @@ const initializeFormElements = () => { | |||
watchNFTButton.onclick = async () => { | |||
let watchNftsResult; | |||
try { | |||
watchNftsResult = await ethereum.request({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in some places, we were using ethereum.request
instead of provider. We need to make sure that we are using the provider (whichever is selected)
LGTM! |
@Gudahtt do you think we can proceed to merge the PR despite the security warnings? My evaluation is:
Thank you in advance 🙏 |
To re-evaluate due to the supply chain attack issue |
[Updates]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🚢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yis
Context
Needed for testing the PPOM module in Mobile + Wallet Connect
What
Adds wallet connect support to the test dapp.
How
?contract
URI param on the URL, all the buttons (except deploy contracts) are also enabled for Wallet Connect to use, in the same was as it's done for ExtensionScreenshots
wc-test-dapp.mp4
Future Work
Manual Testing Steps
yarn
andyarn start
Testing the Connection
Testing tx/signatures with WC
Testing Network switch handling
Testing switching providers back and forth (Extension-Mobile)
Testing the old functionality
Furthermore, you can check that the old functionality is 100% preserved when using MetaMask Extension provider.