From 56c1361ee83db8b68859caf0850c95ff70e7e306 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Wed, 17 Jan 2024 20:33:38 -0500 Subject: [PATCH] Normalize EIP-712 types before computing the payload (#4541). --- src.ts/hash/typed-data.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src.ts/hash/typed-data.ts b/src.ts/hash/typed-data.ts index 5a53ab4ec..a21710782 100644 --- a/src.ts/hash/typed-data.ts +++ b/src.ts/hash/typed-data.ts @@ -607,6 +607,9 @@ export class TypedDataEncoder { const encoder = TypedDataEncoder.from(types); + // Get the normalized types + types = encoder.types; + const typesWithDomain = Object.assign({ }, types); assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types);