eip712HashType
Signature
Section titled “Signature”function eip712HashType( string calldata typeNameOrDefinition) external pure returns (bytes32);Description
Section titled “Description”Returns keccak256(bytes(canonicalTypeString)) for the given EIP-712 type.
The argument can be a registered struct name (e.g. "Mail") or a full EIP-712 type definition string.
Note: Requires the
test.solidity.eip712Typesconfiguration. See the EIP-712 type hashing guide for setup.
Examples
Section titled “Examples”// Look up by registered namebytes32 hash = cheats.eip712HashType("Mail");
// Or pass a full type definition directlybytes32 hash2 = cheats.eip712HashType( "Mail(Person from,Person to,string contents)Person(address wallet,string name)");
assertEq(hash, hash2);