Skip to content

Commit

Permalink
use as const and satisfes while exporting contract data
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 committed Oct 31, 2023
1 parent 6ec07ae commit 0a6d818
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/hardhat/deploy/99_generateTsAbis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const generateTsAbis: DeployFunction = async function () {
`${TARGET_DIR}deployedContracts.ts`,
prettier.format(
`import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; \n\n
const deployedContracts = {${fileContent}} satisfies GenericContractsDeclaration | null ; \n\n export default deployedContracts `,
const deployedContracts = {${fileContent}} as const; \n\n export default deployedContracts deployedContracts satisfies GenericContractsDeclaration`,
{
parser: "typescript",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/generated/deployedContracts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";

const deployedContracts = {} satisfies GenericContractsDeclaration | null;
const deployedContracts = {} as const;

export default deployedContracts;
export default deployedContracts satisfies GenericContractsDeclaration;
6 changes: 3 additions & 3 deletions packages/nextjs/generated/externalContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
* address: "0x..."
* abi: [...],
* }
* } satisfies GenericContractsDeclaration | null;
* } as const;
*/
const externalContracts = {} satisfies GenericContractsDeclaration | null;
const externalContracts = {} as const;

export default externalContracts;
export default externalContracts satisfies GenericContractsDeclaration;

0 comments on commit 0a6d818

Please sign in to comment.