metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Add third party details for offchain signatures

Open 409H opened this issue 1 year ago • 2 comments

Description

This enhancement will add third party details to the "View third-party details" popup for offchain signatures, like we have for onchain signatures (such as setApprovalForAll).

For example: when a permit signature is requesting spending on a users ERC20 balance, MetaMask UI shows only the ERC20 token contract in the third-party details popup when it should show the spender as well. Arguably, the third party in these types of messages is the spender and not the verifyingContract.

We already have this breakdown of contract and spender for onchain signatures, such as setApprovalForAll() - see screenshot below Screenshot 2024-03-06 at 20 32 40

This change will modify the popup to extract relevant keys from structured sign typed data standards (such as permit or 0x orders) and show the user the third-party beneficiary.

Screenshot 2024-03-06 at 20 34 00 Screenshot 2024-03-06 at 20 34 13

Related issues

Fixes:

Manual testing steps

  1. Go to this page https://metamask.github.io/test-dapp/
  2. Test various signatures that give some sort of third-party spending approval

Screenshots/Recordings

Before

Screenshot 2024-03-06 at 20 38 11 Screenshot 2024-03-06 at 20 38 23

After

Screenshot 2024-03-06 at 20 34 00 Screenshot 2024-03-06 at 20 34 13

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.

409H avatar Mar 06 '24 20:03 409H

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.

github-actions[bot] avatar Mar 06 '24 20:03 github-actions[bot]

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

github-actions[bot] avatar May 24 '24 18:05 github-actions[bot]

we will rework insights from this PR into another PR

digiwand avatar Jun 07 '24 11:06 digiwand

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

github-actions[bot] avatar Aug 06 '24 12:08 github-actions[bot]

This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions.

github-actions[bot] avatar Aug 20 '24 12:08 github-actions[bot]