-
-
Notifications
You must be signed in to change notification settings - Fork 45
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(human-readable): parse EIP712 human-readable type signatures #166
Conversation
🦋 Changeset detectedLatest commit: e917c51 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Features
Chore
Documentation
Bug Fixes
ContributorsCommit-Lint commandsYou can trigger Commit-Lint actions by commenting on this PR:
|
Size Change: +1.5 kB (+3%) Total Size: 49.9 kB
ℹ️ View Unchanged
|
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #166 +/- ##
========================================
Coverage 99.90% 99.91%
========================================
Files 21 22 +1
Lines 2055 2281 +226
Branches 325 362 +37
========================================
+ Hits 2053 2279 +226
Misses 2 2
☔ View full report in Codecov by Sentry. |
@tmm with the restructure do you want me to re-open this PR or do you think that this doesn't make sense in having for abitype? |
6b36159
to
c706a9a
Compare
ffcd744
to
62b32d7
Compare
@Raiden1411 this PR is great work and maybe we'll add it in someday (EIP-712 isn't a burning use-case it seems right now). Going to close out for the time-being. |
Description
This PR adds support for EIP712 typed data signatures.
Essentially the typed data human readable signature is represented as a struct signature. This however differs from Abi structs, since this will follow the specifications introduced in EIP712.
The new
parseTypedData
function parses in two contexts. Either if you want to create and resolve the typed data or simply want to create it (the latter is the default behavior).This also introduces a couple of new types for consumers to use.
ParseTypedData
,ResolveTypedData
,ResolvedTypedData
andResolvedTypedDataToPrimativeTypes
.Examples were created to demonstrate this new pattern and the documentation also reflects these changes.
Additional Information
Your ENS/address:
PR-Codex overview
This PR adds human-readable EIP-712 parsing utilities and resolves typed data into corresponding Solidity primitive types.
Detailed summary
parseTypedData
function to parse human-readable typed data into EIP-712 typed data.MissingNamedParameter
error class for missing named parameters in EIP-712 typed data.