From cbfbe85659f827f9e5924f858fa59caae4c8d323 Mon Sep 17 00:00:00 2001 From: Shiv Bhonde Date: Wed, 1 Nov 2023 10:41:37 +0530 Subject: [PATCH] add comment for deployedContract --- packages/hardhat/deploy/99_generateTsAbis.ts | 9 ++++++++- packages/nextjs/contracts/deployedContracts.ts | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/hardhat/deploy/99_generateTsAbis.ts b/packages/hardhat/deploy/99_generateTsAbis.ts index 336718fab..90b558905 100644 --- a/packages/hardhat/deploy/99_generateTsAbis.ts +++ b/packages/hardhat/deploy/99_generateTsAbis.ts @@ -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 }) @@ -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", diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 4967ed20d..008d4eb06 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -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;