From f58243c8dfe991c29fcd0927780d04ff17b42e3c Mon Sep 17 00:00:00 2001 From: Joe Andrews Date: Sat, 5 Feb 2022 13:18:49 +0000 Subject: [PATCH] Update abiParser.ts to work with foundry / forge output --- packages/typechain/src/parser/abiParser.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/typechain/src/parser/abiParser.ts b/packages/typechain/src/parser/abiParser.ts index 82ffdba55..02536dc23 100644 --- a/packages/typechain/src/parser/abiParser.ts +++ b/packages/typechain/src/parser/abiParser.ts @@ -395,6 +395,14 @@ export function extractBytecode(rawContents: string): BytecodeWithLinkReferences json.compilerOutput.evm.bytecode.linkReferences, ) } + + // handle json schema of @foundry/forge + if (json.bytecode?.object?.match(bytecodeRegex)) { + return extractLinkReferences( + json.bytecode.object, + json.bytecode.linkReferences, + ) + } if (json.bytecode?.match(bytecodeRegex)) { return extractLinkReferences(json.bytecode, json.linkReferences)