hardhat
Version:
Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.
17 lines (14 loc) • 451 B
text/typescript
import type { HookManager } from "../../../../types/hooks.js";
import { readUtf8File } from "@nomicfoundation/hardhat-utils/fs";
export function readSourceFileFactory(
hooks: HookManager,
): (absPath: string) => Promise<string> {
return async (factoryAbsPath: string) => {
return hooks.runHandlerChain(
"solidity",
"readSourceFile",
[factoryAbsPath],
async (_context, absPath) => readUtf8File(absPath),
);
};
}