Skip to content

Commit

Permalink
Template for externalContracts.ts (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
moltam89 authored Oct 15, 2024
1 parent 9151c92 commit e9a969d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-dodos-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

Template for externalContracts.ts
16 changes: 0 additions & 16 deletions templates/base/packages/nextjs/contracts/externalContracts.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { withDefaults } from '../../../../utils.js'

const contents = ({ externalContracts }) =>
`import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
/**
* @example
* const externalContracts = {
* 1: {
* DAI: {
* address: "0x...",
* abi: [...],
* },
* },
* } as const;
*/
const externalContracts = ${JSON.stringify(externalContracts[0])} as const;
export default externalContracts satisfies GenericContractsDeclaration;
`

export default withDefaults(contents, {
externalContracts: {}
})

0 comments on commit e9a969d

Please sign in to comment.