Skip to content

Implement EIP712Signature module#145

Merged
akru merged 3 commits intoairalab:masterfrom
jinchui-crypto:feature-eip712-sign
Nov 27, 2025
Merged

Implement EIP712Signature module#145
akru merged 3 commits intoairalab:masterfrom
jinchui-crypto:feature-eip712-sign

Conversation

@jinchui-crypto
Copy link
Contributor

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

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
Copy link
Member

@akru akru left a comment

Choose a reason for hiding this comment

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

Great work, thank you!

@akru akru requested a review from Copilot November 19, 2025 23:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, and hashStruct
  • 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>
@akru
Copy link
Member

akru commented Nov 22, 2025

@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.

@akru akru merged commit 505698d into airalab:master Nov 27, 2025
0 of 3 checks passed
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.

2 participants

Comments