File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/common-ts/src/contracts Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { providers , Signer } from 'ethers'
2
2
import graphChain from './chain'
3
3
4
+ // Contract addresses
5
+ import * as DEPLOYED_CONTRACTS from '@graphprotocol/contracts/addresses.json'
6
+
4
7
// Contract ABIs
5
8
import { Curation } from '@graphprotocol/contracts/dist/types/Curation'
6
9
import { DisputeManager } from '@graphprotocol/contracts/dist/types/DisputeManager'
@@ -73,9 +76,10 @@ export type AddressBook = { [key: string]: { [key: string]: { address: string }
73
76
export const connectContracts = async (
74
77
providerOrSigner : providers . Provider | Signer ,
75
78
chainId : number ,
76
- addressBook : AddressBook ,
79
+ addressBook : AddressBook | undefined ,
77
80
) : Promise < NetworkContracts > => {
78
- const deployedContracts = addressBook [ `${ chainId } ` ]
81
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
+ const deployedContracts = addressBook ? addressBook [ `${ chainId } ` ] : ( DEPLOYED_CONTRACTS as any ) [ `${ chainId } ` ]
79
83
if ( ! deployedContracts ) {
80
84
throw new Error ( `chainId: '${ chainId } ' has no deployed contracts` )
81
85
}
You can’t perform that action at this time.
0 commit comments