From 92abbccd61feb75520358a8a703b1a0c5d9f35a4 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Sat, 18 Feb 2023 13:45:45 -0500 Subject: [PATCH] Fixed inverted assert in duplicate name detection for ABI encoding (#3792). --- src.ts/abi/coders/array.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src.ts/abi/coders/array.ts b/src.ts/abi/coders/array.ts index 6d311549d0..3270713df8 100644 --- a/src.ts/abi/coders/array.ts +++ b/src.ts/abi/coders/array.ts @@ -26,7 +26,7 @@ export function pack(writer: Writer, coders: ReadonlyArray, values: Array assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(unique[name], "cannot encode object for signature with duplicate names", + assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); unique[name] = true;