Merged
Conversation
It expose the following: * Data types specific for EIP712 * signTypeData and signTypedData' for signing EIP712 data structures * typedDataSignHash create the hash that needs to be signed for an EIP712 data structure * encodeData, encodeType, hashStruct are exposed as intermediary functions for testing purpose
There was a problem hiding this comment.
Pull Request Overview
This PR implements the EIP712Signature module, which provides functionality for signing EIP-712 typed structured data according to the Ethereum EIP-712 specification. This enables type-safe signing of complex data structures commonly used in Ethereum smart contracts.
Key changes:
- Added comprehensive EIP712 type system with support for primitive types, arrays, and nested structs
- Implemented core EIP712 functions:
signTypedData,typedDataSignHash,encodeType,encodeData, andhashStruct - Added extensive test coverage for encoding, hashing, and Safe transaction examples
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/crypto/web3-crypto.cabal | Added new EIP712Signature module and dependencies (basement, scientific) to library and test suite |
| packages/crypto/package.yaml | Added basement and scientific package dependencies |
| packages/crypto/src/Crypto/Ethereum/Eip712Signature.hs | New module implementing EIP712 data types and encoding/signing functions |
| packages/crypto/tests/Crypto/Ethereum/Test/EIP712SignatureSpec.hs | Comprehensive test suite for EIP712 encoding with examples including Safe transactions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Member
|
@jinchui-crypto Would you kindly add headers to source files, just like in others. I guess you agree with Apache2.0 as source code license. |
a64d326 to
ba9eb05
Compare
akru
approved these changes
Nov 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It expose the following: