Skip to content

Commit

Permalink
add comment for deployedContract
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 committed Nov 1, 2023
1 parent f47535c commit cbfbe85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/hardhat/deploy/99_generateTsAbis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import * as fs from "fs";
import prettier from "prettier";
import { DeployFunction } from "hardhat-deploy/types";

const generatedContractComment = `
/**
* This file is autogenerated by Scaffold-ETH.
* You should not edit it manually or your changes might be overwritten.
*/
`;

function getDirectories(path: string) {
return fs
.readdirSync(path, { withFileTypes: true })
Expand Down Expand Up @@ -63,7 +70,7 @@ const generateTsAbis: DeployFunction = async function () {
fs.writeFileSync(
`${TARGET_DIR}deployedContracts.ts`,
prettier.format(
`import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; \n\n
`${generatedContractComment} import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; \n\n
const deployedContracts = {${fileContent}} as const; \n\n export default deployedContracts satisfies GenericContractsDeclaration`,
{
parser: "typescript",
Expand Down
4 changes: 4 additions & 0 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* This file is autogenerated by Scaffold-ETH.
* You should not edit it manually or your changes might be overwritten.
*/
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";

const deployedContracts = {} as const;
Expand Down

0 comments on commit cbfbe85

Please sign in to comment.