Skip to content

Commit

Permalink
Update abiParser.ts to work with foundry / forge output
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Andrews authored Feb 5, 2022
1 parent 4e71ad5 commit f58243c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/typechain/src/parser/abiParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f58243c

Please sign in to comment.