Skip to content
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

chore: extract shared EIP712 base contract #370

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

horsefacts
Copy link
Collaborator

@horsefacts horsefacts commented Aug 23, 2023

Motivation

As we've worked on consuming these contracts from Warpcast, we've added a few EIP-712 helper views. These are useful for clients debugging their own EIP-712 signatures. This PR cleans up our EIP712-related functionality and adds consistent helper views everywhere by extracting a shared abstract base contract.

Change Summary

Refactor all contracts using EIP-712 signatures to use our own EIP712 base contract, which inherits OZ EIP712 and exposes hashTypedDataV4 and domainSeparatorV4. Expose typehashes as public constants. Remove most test harness wrappers, which are no longer needed.

Merge Checklist

Choose all relevant options below by adding an x now or at any time before submitting for review


PR-Codex overview

Detailed summary

This PR focuses on making several changes and improvements to the codebase. The notable changes include:

  • Adding a new assumption in KeyRegistry.integration.t.sol
  • Importing and using IdRegistry in IdRegistry.gas.t.sol
  • Changing the function name and adding a constant in SignedKeyRequestValidator.t.sol
  • Changing the function name and adding a constant in KeyRegistry.t.sol
  • Changing the function name and adding a constant in IdRegistry.owner.t.sol
  • Adding a new contract and importing dependencies in EIP712.sol
  • Changing the gas usage in several tests
  • Changing the imports and contracts in BundlerTestSuite.sol
  • Changing the function name and adding a constant in FnameResolver.t.sol
  • Changing the function name and adding a constant in IdRegistry.t.sol
  • Changing the imports and contracts in SignedKeyRequestValidatorTestSuite.sol
  • Changing the imports and contracts in KeyRegistryTestSuite.sol
  • Changing the imports and contracts in FnameResolverTestSuite.sol

The following files were skipped due to too many changes: test/FnameResolver/FnameResolverTestSuite.sol, src/KeyRegistry.sol, src/validators/SignedKeyRequestValidator.sol, src/FnameResolver.sol, test/IdRegistry/IdRegistryTestSuite.sol, test/Deploy/DeployL1.t.sol, test/Utils.sol, src/IdRegistry.sol

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@horsefacts horsefacts added the chore A task that is none of the other types label Aug 23, 2023
@github-actions
Copy link

Coverage after merging horsefacts/shared-eip-712-contract into main will be

98.65%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   Bundler.sol100%100%100%100%
   FnameResolver.sol100%100%100%100%
   IdRegistry.sol100%100%100%100%
   KeyRegistry.sol100%100%100%100%
   StorageRegistry.sol100%100%100%100%
src/lib
   EIP712.sol50%100%50%50%19
   Signatures.sol100%100%100%100%
   TransferHelper.sol0%0%0%0%12, 17, 20, 20, 20
   TrustedCaller.sol100%100%100%100%
src/validators
   SignedKeyRequestValidator.sol100%100%100%100%

@horsefacts horsefacts merged commit dbd82c0 into main Aug 23, 2023
2 checks passed
@horsefacts horsefacts deleted the horsefacts/shared-eip-712-contract branch August 23, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A task that is none of the other types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant