(contractName: string, sourceFile?: string)
| 38 | } |
| 39 | |
| 40 | export function readForgeArtifactSync(contractName: string, sourceFile?: string): ForgeArtifact { |
| 41 | const file = sourceFile ?? `${contractName}.sol` |
| 42 | const artifactPath = path.join(FORGE_OUT_DIR, file, `${contractName}.json`) |
| 43 | const raw = JSON.parse(fs.readFileSync(artifactPath, 'utf8')) as ForgeRawArtifact |
| 44 | return { |
| 45 | abi: raw.abi, |
| 46 | bytecode: raw.bytecode.object, |
| 47 | deployedBytecode: raw.deployedBytecode.object, |
| 48 | } |
| 49 | } |
no test coverage detected