UNPKG

@openzeppelin/hardhat-upgrades

Version:

[![Docs](https://img.shields.io/badge/docs-%F0%9F%93%84-blue)](https://docs.openzeppelin.com/upgrades-plugins/hardhat-upgrades) [![NPM Package](https://img.shields.io/npm/v/@openzeppelin/hardhat-upgrades.svg)](https://www.npmjs.org/package/@openzeppelin/h

31 lines (24 loc) • 780 B
import type { SolcOutput } from '@openzeppelin/upgrades-core'; type RecursivePartial<T> = { [k in keyof T]?: RecursivePartial<T[k]> }; type MaybeSolcOutput = RecursivePartial<SolcOutput>; export function isFullSolcOutput(output: MaybeSolcOutput | undefined): boolean { if (output?.contracts == undefined || output?.sources == undefined) { return false; } for (const file of Object.values(output.contracts)) { if (file == undefined) { return false; } for (const contract of Object.values(file)) { if (contract?.evm?.bytecode == undefined) { return false; } } } for (const file of Object.values(output.sources)) { if (file?.ast == undefined || file?.id == undefined) { return false; } } return true; }