Skip to content

Conversation

@jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented Sep 22, 2025

Description

When the GatorPermissionsSnap submits the delegation for signing via eth_signTypedData_v4, it must include metadata - the justification, and origin of the request, as part of the eip-712 payload.

Related issues

MetaMask/core#6619
MetaMask/core#6656
MetaMask/metamask-extension#36054

Manual testing steps

  1. Ensure you have a build of Extension that
    a. Has the above PRs integrated
    b. Has the GATOR_PERMISSIONS_ENABLED environment variable set to true
  2. Go through the normal process of requesting a permission
  3. After clicking "Grant" on the permission picker screen, note the justification and origin that are show are the originating dapp (probably localhost:8000 if using the site from the snap monorepo, and "This is a very important request for streaming allowance for some very important thing" if you don't change it)

Screenshots/Recordings

Before

Error would be shown, because no metadata is included in the request.

After

image

Pre-merge author checklist

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.

@jeffsmale90 jeffsmale90 force-pushed the feat/sign-typed-data-metadata branch from 699a16a to 0d593c3 Compare September 22, 2025 20:35
…d justification in metadata property on EIP-712 payload
@jeffsmale90 jeffsmale90 force-pushed the feat/sign-typed-data-metadata branch from 0d593c3 to af905fe Compare September 22, 2025 20:36
@jeffsmale90 jeffsmale90 marked this pull request as ready for review September 22, 2025 20:45
@jeffsmale90 jeffsmale90 requested a review from a team as a code owner September 22, 2025 20:45
Copy link
Contributor

@mj-kiwi mj-kiwi left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just a minor suggestion — have you considered extracting a metadata type:

export type DelegationMetadata = {
  origin: string;
  justification: string;
};

@jeffsmale90 jeffsmale90 merged commit 951a367 into main Sep 23, 2025
16 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/sign-typed-data-metadata branch September 23, 2025 21:42
@jeffsmale90
Copy link
Contributor Author

Looks good to me! Just a minor suggestion — have you considered extracting a metadata type:

Yeah, that might not be a bad idea - I left the properties of SignDelegationOptions flat to not let the shape of the signTypedData parameters leak out into the interface. We could look to tidy up in the future though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants