ApeWorX / eip712

Message classes for typed structured data hashing and signing in Ethereum
Apache License 2.0
42 stars 19 forks source link

Missing `salt` field member in `EIP712_DOMAIN_FIELDS` constant #10

Closed axeolotal closed 2 years ago

axeolotal commented 2 years ago

Elevator pitch:

EIP712_DOMAIN_FIELDS constant is missing a field member salt as defined in the EIP712 specification.

Value:

In an increasingly multi-chain world, salt is needed to prevent signatures being used inappropriately on other chains. For example, deploying a contract at the same address on Ethereum and Harmony which utilizes EIP-2612, could result in malicious reuse of signatures. This is due to the fact that the CHAIN_ID opcode returns a value of 1 on Harmony, the same as Ethereum. Adding this field member to the EIP712_DOMAIN_FIELDS constant will allow for the creation of valid signatures using this library for contracts which utilize the salt field.

Dependencies:

N/A

Design approach:

N/A

Task list:

Estimated completion date:

Soon

Design review:

Do not signoff unless: 1) agreed the tasks and design approach will achieve acceptance and 2) the work can be completed by one person within the SLA. Design reviewers should consider simpler approaches to achieve goals.

(Please leave a comment to sign off)