diff --git a/.changeset/four-drinks-peel.md b/.changeset/four-drinks-peel.md new file mode 100644 index 000000000..d2cc189c5 --- /dev/null +++ b/.changeset/four-drinks-peel.md @@ -0,0 +1,5 @@ +--- +'@chugsplash/plugins': patch +--- + +Fix bug parsing build info metadata diff --git a/packages/plugins/src/hardhat/artifacts.ts b/packages/plugins/src/hardhat/artifacts.ts index 05314521f..e1bfce206 100644 --- a/packages/plugins/src/hardhat/artifacts.ts +++ b/packages/plugins/src/hardhat/artifacts.ts @@ -414,7 +414,11 @@ export const createDeploymentArtifacts = async ( const metadata = buildInfo.output.contracts[sourceName][contractName].metadata - const { devdoc, userdoc } = JSON.parse(metadata).output + + const { devdoc, userdoc } = + typeof metadata === 'string' + ? JSON.parse(metadata).output + : metadata.output const deploymentArtifact = { contractName,