MetaMask / MetaMask/metamask-extension
Add metrics to permit signatures
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
## Background
From the user facing perspective, the permit signature is very similar to the erc20 approve method - with the main difference being that it's a signature instead of a transaction and therefore there's no gas fee.
Currently we have no metrics that allow us to understand how frequent permit signatures are being signed within MM and this issue is meant to address that.
One open question that @FrederikBolding raised was wether we are able to accurately differentiate the permit signature from all other signatures. Answering that should be part of the scope of this issue as well.
## Acceptance Criteria
1. Whenever a user that has opted in metametrics is **requested** a **permit** signature, a new `signature_method` property is added to the `Signature Requested` event with the value `permit`;
2. Whenever a user that has opted in metametrics **signs** a **permit** signature, a new `signature_method` property is added to the `Signature Approved` event with the value `permit`;
3. Whenever a user that has opted in metametrics **rejects** a **permit** signature, a new `signature_method` property is added to the `Signature Rejected` event with the value `permit`;
4. Whenever the user is requested, signs or rejects a signature that is not a **permit** signature, no value is passed to the `signature_method` property.
## Steps to reproduce
1. Have some small USDC balance in Polygon
2. Go to https://app.1inch.io/#/137/unified/swap/USDC/DAI
3. Click on permit and swap
## Reference
- https://eips.ethereum.org/EIPS/eip-2612
- https://twitter.com/korpi87/status/1560416694811578368
- https://twitter.com/revokecash/status/1561709329568374785?s=21&t=uRZ7zmj_s5cmMZ9bOW7h_Q
- https://belactriple9.github.io/1inchSupportedPermits/
- https://help.1inch.io/en/articles/5435386-permit-712-signed-token-approvals-and-how-they-work-on-1inch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the instrumentation for the `Signature Requested`, `Signature Approved`, and `Signature Rejected` events, then inspect the permit-signature handling described by EIP-2612. Confirm how permit signatures can be distinguished from other signatures and verify that the three events report `signature_method: permit` only for opted-in users; non-permit events should omit it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- analytics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100