-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Chain Permissions #10650
feat: Add Chain Permissions #10650
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: app/core/Permissions/specifications.js
Did you find this useful? React with a 👍 or 👎 |
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. |
4256f3c
to
77fd6da
Compare
05836b4
to
0976181
Compare
Bitrise❌❌❌ Commit hash: fca7f97 Note
Tip
|
fca7f97
to
a57fd4b
Compare
Bitrise❌❌❌ Commit hash: a57fd4b Note
Tip
|
Bitrise❌❌❌ Commit hash: fbfcf03 Note
Tip
|
Bitrise❌❌❌ Commit hash: d767a31 Note
Tip
|
Bitrise❌❌❌ Commit hash: 0317ca6 Note
Tip
|
Bitrise✅✅✅ Commit hash: d9fe0be Note
|
Bitrise❌❌❌ Commit hash: 9e0e643 Note
Tip
|
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.
Lets re run the e2e 🍀 lgtm!!
Manual E2E Triggered test: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/53685350-df44-4522-a9c1-8729d07db04f |
Bitrise❌❌❌ Commit hash: 0a66b14 Note
Tip
|
Bitrise✅✅✅ Commit hash: ddea8bc Note
|
Quality Gate passedIssues Measures |
Description
This PR introduces the Chain Permissions feature, allowing users to grant dapps explicit permissions to switch to specific networks. When the
MM_CHAIN_PERMISSIONS
feature flag is enabled, dapps requesting network changes viawallet_addEthereumChain
orwallet_switchEthereumChain
will prompt the user to add permission to access the specified chain IDs and, if granted, subsequentwallet_switchEthereumChain
requests made to that chainId will not require user confirmation.endowment:permitted-chains
with the caveatrestrictNetworkSwitching
.wallet_addEthereumChain
andwallet_switchEthereumChain
methods to integrate with the new chain permissions.MM_CHAIN_PERMISSIONS
to toggle the feature.MULTICHAIN_V1
env variable toMM_PER_DAPP_SELECTED_NETWORK
(more specific/accurate name)Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2883
Manual testing steps
MM_CHAIN_PERMISSIONS
and the new UI by settingMM_MULTICHAIN_V1_ENABLED
with the watch script:MM_CHAIN_PERMISSIONS=1 MM_MULTICHAIN_V1_ENABLED=1 yarn watch:clean
Screenshots/Recordings
Before
Switch Flow:
Screen.Recording.2024-10-10.at.9.56.01.AM.mov
Add Flow
Screen.Recording.2024-10-10.at.9.57.15.AM.mov
After
Connection + Switch Flow
The initial connection flow suggests that your granting network permissions too but that is not wired up yet.
Screen.Recording.2024-10-09.at.5.23.24.PM.mov
Add Flow
Screen.Recording.2024-10-10.at.9.14.12.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist