Skip to content

Missing permissions in @metamask/permissions-kernel-snap #149

@oed

Description

@oed

This issue was uncovered as I was working on a submission for the https://www.hackquest.io/hackathons/MetaMask-Delegation-Toolkit-DTK-Dev-Cook-Off hackathon.

The project

I wanted to create a simple cli tool + webapp that allows you to delegate the ability to update your ENS contenthash from the command line securely.
Design

Design was simple:

  1. create an account in the

  2. Copy the account address from (1) to the webapp and create a delegation with the following delegations to it:

    • 'allowed-targets': the resolver of the ENS domain

    • 'allowed-methods': 'setContenthash'

    • 'allowed-calldata': the ens name (first param of (2))

  3. Display delegation and allow user to copy it into the cli tool

  4. Cli tool can now at any time update the contenthash for the given ENS name, but can not change anything else about the ENS name

Uncovered issues

The main problem I discovered was that the 7715 implementation doesn't support the caveat enforces mentioned above. By analysing the '@metamask/permissions-kernel-snap' bundle code with Gemini it looks like only the following permissions are allowed:

native-token-stream

native-token-transfer

erc20-token-transfer

erc721-token-transfer

erc1155-token-transfer

Only using these permissions it seems impossible to achieve my goal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions