Skip to content

Enhance EIP-1271 signature support in SafeTestTools#17

Open
arawrdn wants to merge 2 commits intocolinnielsen:mainfrom
arawrdn:feature/eip1271-enhancement
Open

Enhance EIP-1271 signature support in SafeTestTools#17
arawrdn wants to merge 2 commits intocolinnielsen:mainfrom
arawrdn:feature/eip1271-enhancement

Conversation

@arawrdn
Copy link

@arawrdn arawrdn commented Oct 5, 2025

Summary

This PR enhances the EIP-1271 signature verification capabilities in SafeTestTools, allowing more flexible and robust testing of contract signatures.

Changes

  1. Added EIP1271Utils.sol helper library to verify signatures from any contract implementing EIP-1271.
  2. Supported multiple signature formats (eth_sign, personal_sign, and EIP712) for testing purposes.
  3. Added eip1271.test.js to validate signature verification logic with mock contracts.
  4. Provided example usage in scripts/testEIP1271.js to demonstrate integration in tests.

Why

Currently, SafeTestTools only supports basic EIP-1271 verification. These changes enable developers to:

  • Verify signatures from any contract implementing EIP-1271.
  • Test multiple signature formats.
  • Simplify writing tests involving Safe contracts with different signers.

Test Plan

  • Run npx hardhat test to ensure all new tests pass.
  • Verify example script executes without errors on local fork.

@colinnielsen
Copy link
Owner

hey thanks for contributing. this project does not use hardhat on purpose - can you please update your tests to use foundry?

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