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

Map domainHash/messageHash to MULTISIG transactions and messages #2180

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Dec 6, 2024

Summary

The hashes of an EIP-712 domain/message can be used to verify the legitimacy of a transaction. On the Web interface, these two values are calculated dynamically for each transaction/message.

This calculates/maps a new typedData, containing domainHash and messageHash to the detailedExecutionInfo of MULTISIG transactions and messages, allowing the client to render it directly.

Note: messages can only be initially proposed with a signature so we need take into consideration whether it influences the viability of this.

Changes

  • Adds new TypedDataMapper for dynamically calculating typedData hashes.
  • Adds/maps new typedData properties to Message and MultisigExecutionDetails entities.
  • Adds/updates tests accordingly.

@iamacook iamacook self-assigned this Dec 6, 2024
@iamacook iamacook changed the title Add domainHash/messageHash to detailedExecutionInfo of MULTISIG transactions Map domainHash/messageHash to MULTISIG transactions and messages Dec 9, 2024
Comment on lines +625 to +631
it('these tests should cover up to the current version', () => {
const deployment = getSafeL2SingletonDeployment();

expect(DOMAIN_TYPEHASH_NEW_VERSIONS.at(-1)).toBe(deployment?.version);
expect(SAFE_TX_TYPEHASH_NEW_VERSIONS.at(-1)).toBe(deployment?.version);
expect(SAFE_MESSAGE_TYPEHASH_VERSIONS.at(-1)).toBe(deployment?.version);
});
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this to ensure we check new hashes match, should the typehashes be altered.

@iamacook iamacook force-pushed the domain-message-hashes branch from bb07f81 to 1a9c559 Compare December 18, 2024 06:57
@iamacook iamacook marked this pull request as ready for review December 18, 2024 07:09
@iamacook iamacook requested a review from a team as a code owner December 18, 2024 07:09
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