solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Add `hashStruct()` for EIP-712 struct hash computation

Open k06a opened this issue 2 years ago • 10 comments

Opening new issue as discussed here: https://github.com/ethereum/solidity/issues/14157#issuecomment-1537226011

Abstract

Let's add function type(S).hashStruct(s) to compute bytes32 hash from S memory s or S calldata s argument where S is struct compatible with EIP-712.

Motivation

EIP-712 is pretty popular among Solidity projects, recently typehash() function were requested to be implemented here: https://github.com/ethereum/solidity/issues/14157. Having function to compute struct instance hash would be one more adoption step for this EIP.

Specification

Implementation details could be borrowed form here: https://eips.ethereum.org/EIPS/eip-712

Backwards Compatibility

Not required

k06a avatar May 10 '23 13:05 k06a

This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.

github-actions[bot] avatar Aug 09 '23 12:08 github-actions[bot]

This is still relevant.

pcaversaccio avatar Aug 09 '23 12:08 pcaversaccio

it is.

vseehausen avatar Sep 29 '23 21:09 vseehausen

This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.

github-actions[bot] avatar Dec 29 '23 12:12 github-actions[bot]

This is still relevant. Don't close.

pcaversaccio avatar Dec 29 '23 12:12 pcaversaccio

Would love to see this!

sebastiantf avatar Mar 09 '24 08:03 sebastiantf

This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.

github-actions[bot] avatar Jun 07 '24 12:06 github-actions[bot]

This is still relevant. Don't close.

pcaversaccio avatar Jun 07 '24 13:06 pcaversaccio

This issue has been marked as stale due to inactivity for the last 90 days. It will be automatically closed in 7 days.

github-actions[bot] avatar Sep 06 '24 12:09 github-actions[bot]

Please dont

sebastiantf avatar Sep 06 '24 12:09 sebastiantf