@@ -11,7 +11,8 @@ import { EpochManager } from '@graphprotocol/contracts/dist/types/EpochManager'
11
11
import { GNS } from '@graphprotocol/contracts/dist/types/GNS'
12
12
import { RewardsManager } from '@graphprotocol/contracts/dist/types/RewardsManager'
13
13
import { ServiceRegistry } from '@graphprotocol/contracts/dist/types/ServiceRegistry'
14
- import { Staking } from '@graphprotocol/contracts/dist/types/Staking'
14
+ import { IL1Staking } from '@graphprotocol/contracts/dist/types/IL1Staking'
15
+ import { IL2Staking } from '@graphprotocol/contracts/dist/types/IL2Staking'
15
16
import { GraphToken } from '@graphprotocol/contracts/dist/types/GraphToken'
16
17
import { Controller } from '@graphprotocol/contracts/dist/types/Controller'
17
18
import { AllocationExchange } from '@graphprotocol/contracts/dist/types/AllocationExchange'
@@ -30,7 +31,8 @@ import { EpochManager__factory } from '@graphprotocol/contracts/dist/types/facto
30
31
import { GNS__factory } from '@graphprotocol/contracts/dist/types/factories/GNS__factory'
31
32
import { RewardsManager__factory } from '@graphprotocol/contracts/dist/types/factories/RewardsManager__factory'
32
33
import { ServiceRegistry__factory } from '@graphprotocol/contracts/dist/types/factories/ServiceRegistry__factory'
33
- import { Staking__factory } from '@graphprotocol/contracts/dist/types/factories/Staking__factory'
34
+ import { IL1Staking__factory } from '@graphprotocol/contracts/dist/types/factories/IL1Staking__factory'
35
+ import { IL2Staking__factory } from '@graphprotocol/contracts/dist/types/factories/IL2Staking__factory'
34
36
import { GraphToken__factory } from '@graphprotocol/contracts/dist/types/factories/GraphToken__factory'
35
37
import { Controller__factory } from '@graphprotocol/contracts/dist/types/factories/Controller__factory'
36
38
import { AllocationExchange__factory } from '@graphprotocol/contracts/dist/types/factories/AllocationExchange__factory'
@@ -51,7 +53,7 @@ export interface NetworkContracts {
51
53
gns : GNS
52
54
rewardsManager : RewardsManager
53
55
serviceRegistry : ServiceRegistry
54
- staking : Staking
56
+ staking : IL1Staking | IL2Staking
55
57
token : GraphToken | L2GraphToken
56
58
controller : Controller
57
59
allocationExchange : AllocationExchange
@@ -81,6 +83,10 @@ export const connectContracts = async (
81
83
? deployedContracts . GraphToken . address
82
84
: deployedContracts . L2GraphToken . address
83
85
86
+ const staking = GraphChain . isL1 ( chainId )
87
+ ? IL1Staking__factory . connect ( deployedContracts . L1Staking . address , providerOrSigner )
88
+ : IL2Staking__factory . connect ( deployedContracts . L2Staking . address , providerOrSigner )
89
+
84
90
const contracts : NetworkContracts = {
85
91
curation : Curation__factory . connect (
86
92
deployedContracts . Curation . address ,
@@ -103,10 +109,7 @@ export const connectContracts = async (
103
109
deployedContracts . ServiceRegistry . address ,
104
110
providerOrSigner ,
105
111
) ,
106
- staking : Staking__factory . connect (
107
- deployedContracts . Staking . address ,
108
- providerOrSigner ,
109
- ) ,
112
+ staking : staking ,
110
113
token : GraphTokenFactory . connect ( graphTokenAddress , providerOrSigner ) ,
111
114
controller : Controller__factory . connect (
112
115
deployedContracts . Controller . address ,
0 commit comments