Skip to content

EIP712: _TYPE_HASH including salt #4318

@pcaversaccio

Description

@pcaversaccio

Since EIP-5267 got merged I wanted to raise a question. In EIP-712's definition of the domainSeparator a so-called salt is also listed:

bytes32 salt an disambiguating salt for the protocol. This can be used as a domain separator of last resort.

EIP-5267 also supports the salt parameters for retrieval via the fields parameter. Now, my question: shouldn't we adjust the EIP712 to incorporate this salt parameter?

I.e.:

- bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
+ bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)");

and

function _buildDomainSeparator(bytes32 salt) private view returns (bytes32) {
    return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this), salt));
}

The above are illustrations and not final code suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions