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

feat: add the 'eth_phishing_detection' logic to the connect accounts flow #8920

Merged

Conversation

omridan159
Copy link
Contributor

@omridan159 omridan159 commented Mar 13, 2024

Description

Add the 'eth_phishing_detection' logic to the connect accounts flow

eth_phishing_detection is a utility for detecting phishing domains targeting Web3 users.
For checking why a given domain was blocked, there is a third-party search tool maintained by ChainPatrol.

Now when user connects to a dapp via SDK that's url is blacklisted in our eth_phishing_detection list, MetaMask mobile app should show a warning to the user before selecting to connect or not. This will allow MetaMask to warn the user while letting user to decide what to do next.

Screenshots

WC

Screen.Recording.2024-03-14.at.9.29.37.mov

MM_SDK

Screen.Recording.2024-03-13.at.16.38.49.mov

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@omridan159 omridan159 requested a review from a team as a code owner March 13, 2024 16:49
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@omridan159 omridan159 added needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-sdk SDK team needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Mar 13, 2024
abretonc7s
abretonc7s previously approved these changes Mar 14, 2024
andreahaku
andreahaku previously approved these changes Mar 14, 2024
Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 2.63158% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 43.22%. Comparing base (bdba039) to head (905fa4f).
Report is 5 commits behind head on main.

Files Patch % Lines
...components/Views/AccountConnect/AccountConnect.tsx 2.77% 35 Missing ⚠️
...ction/EventListenersHandlers/handleClientsReady.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8920      +/-   ##
==========================================
- Coverage   43.27%   43.22%   -0.06%     
==========================================
  Files        1271     1271              
  Lines       30916    30957      +41     
  Branches     3092     3097       +5     
==========================================
+ Hits        13378    13380       +2     
- Misses      16765    16805      +40     
+ Partials      773      772       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@christopherferreira9 christopherferreira9 added the Run Smoke E2E Triggers smoke e2e on Bitrise label Mar 14, 2024
Copy link
Contributor

github-actions bot commented Mar 14, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 905fa4f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9950e888-ed94-44d1-80ee-cdd20586b4c9

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@christopherferreira9 christopherferreira9 added QA in Progress QA has started on the feature. QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) needs-qa Any New Features that needs a full manual QA prior to being added to a release. QA in Progress QA has started on the feature. labels Mar 15, 2024
@christopherferreira9 christopherferreira9 removed the QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed label Mar 18, 2024
@christopherferreira9 christopherferreira9 added the QA in Progress QA has started on the feature. label Mar 18, 2024
@christopherferreira9
Copy link
Contributor

WalletConnect example:

Screen.Recording.2024-03-18.at.19.04.07.mov

MetaMask SDK Example:

Screen.Recording.2024-03-18.at.19.04.56.mov

Verified that:

  • All links work in the modal
  • Connection to both WalletConnect and SDK are terminated once the user taps "Back to safety"
  • Tested on both iOS and Android

@christopherferreira9 christopherferreira9 added QA Passed A successful QA run through has been done and removed QA in Progress QA has started on the feature. labels Mar 18, 2024
andreahaku
andreahaku previously approved these changes Mar 19, 2024
Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@abretonc7s abretonc7s left a comment

Choose a reason for hiding this comment

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

small change to have consistent use of useCallback

Copy link

sonarcloud bot commented Mar 20, 2024

@christopherferreira9
Copy link
Contributor

Looking good for QA.

@christopherferreira9 christopherferreira9 merged commit ffc7225 into main Mar 20, 2024
29 of 30 checks passed
@christopherferreira9 christopherferreira9 deleted the feat_add-eth_phishing_detection-to-AccountConnect branch March 20, 2024 14:22
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2024
@metamaskbot metamaskbot added the release-7.20.0 Issue or pull request that will be included in release 7.20.0 label Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.20.0 Issue or pull request that will be included in release 7.20.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-sdk SDK team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants