Files
semaphore/packages/contracts/scripts/utils.ts
2024-01-24 15:10:13 +00:00

16 lines
378 B
TypeScript

import { readFileSync } from "fs"
export type DeployedContracts = {
Poseidon: string
Semaphore: string
Verifier: string
}
export function getDeployedContracts(network: string | undefined): DeployedContracts | null {
try {
return JSON.parse(readFileSync(`./deployed-contracts/${network}.json`, "utf8"))
} catch (error) {
return null
}
}