@@ -45,14 +45,14 @@ const sendEth = async (
45
45
to : signers [ i ] . address ,
46
46
value : amountEther ,
47
47
}
48
- await executeTransaction ( governor . sendTransaction ( data ) )
48
+ await executeTransaction ( governor . sendTransaction ( data ) , network )
49
49
}
50
50
for ( let i = 0 ; i < proxies . length ; i ++ ) {
51
51
const data = {
52
52
to : proxies [ i ] . address ,
53
53
value : amountEther ,
54
54
}
55
- await executeTransaction ( governor . sendTransaction ( data ) )
55
+ await executeTransaction ( governor . sendTransaction ( data ) , network )
56
56
}
57
57
}
58
58
@@ -67,8 +67,8 @@ const populateGraphToken = async (
67
67
const graphToken = new ConnectedGraphToken ( network , signers [ 0 ] ) // defaults to governor
68
68
console . log ( 'Sending GRT to indexers, curators, and proxies...' )
69
69
for ( let i = 0 ; i < signers . length ; i ++ ) {
70
- await executeTransaction ( graphToken . transferWithDecimals ( signers [ i ] . address , amount ) )
71
- await executeTransaction ( graphToken . transferWithDecimals ( proxies [ i ] . address , amount ) )
70
+ await executeTransaction ( graphToken . transferWithDecimals ( signers [ i ] . address , amount ) , network )
71
+ await executeTransaction ( graphToken . transferWithDecimals ( proxies [ i ] . address , amount ) , network )
72
72
}
73
73
}
74
74
@@ -85,6 +85,7 @@ const populateEthereumDIDRegistry = async (network: string, signers: Array<Walle
85
85
const ipfs = 'https://api.thegraph.com/ipfs/'
86
86
await executeTransaction (
87
87
edr . pinIPFSAndSetAttribute ( ipfs , accountMetadatas [ account ] as AccountMetadata ) ,
88
+ network ,
88
89
)
89
90
i ++
90
91
}
@@ -100,8 +101,8 @@ const populateENS = async (network: string, signers: Array<Wallet>) => {
100
101
// edge case - graph is only ens name that doesn't match display name in mock data
101
102
if ( name == 'The Graph' ) name = 'graphprotocol'
102
103
console . log ( `Setting ${ name } for ${ ens . configuredWallet . address } on ens ...` )
103
- await executeTransaction ( ens . setTestRecord ( name ) )
104
- await executeTransaction ( ens . setText ( name ) )
104
+ await executeTransaction ( ens . setTestRecord ( name ) , network )
105
+ await executeTransaction ( ens . setText ( name ) , network )
105
106
i ++
106
107
}
107
108
}
@@ -129,6 +130,7 @@ const populateGNS = async (network: string, signers: Array<Wallet>) => {
129
130
name ,
130
131
subgraphMetadatas [ subgraph ] as SubgraphMetadata ,
131
132
) ,
133
+ network ,
132
134
)
133
135
console . log ( `Updating version of ${ name } for ${ gns . configuredWallet . address } on GNS ...` )
134
136
await executeTransaction (
@@ -141,13 +143,14 @@ const populateGNS = async (network: string, signers: Array<Wallet>) => {
141
143
subgraphMetadatas [ subgraph ] as SubgraphMetadata ,
142
144
'0' , // TODO, only works on the first run right now, make more robust
143
145
) ,
146
+ network ,
144
147
)
145
148
i ++
146
149
}
147
150
148
151
// Deprecation one subgraph for account 5
149
152
const gns = new ConnectedGNS ( network , signers [ 5 ] )
150
- await executeTransaction ( gns . gns . deprecate ( gns . configuredWallet . address , '0' ) )
153
+ await executeTransaction ( gns . gns . deprecate ( gns . configuredWallet . address , '0' ) , network )
151
154
}
152
155
153
156
// Each GraphAccount curates on their own
@@ -164,20 +167,34 @@ const populateCuration = async (network: string, signers: Array<Wallet>) => {
164
167
console . log ( 'First calling approve() to ensure curation contract can call transferFrom()...' )
165
168
await executeTransaction (
166
169
connectedGT . approveWithDecimals ( curation . contract . address , totalAmount ) ,
170
+ network ,
167
171
)
168
172
console . log ( 'Now calling multiple signal() txs on curation...' )
169
- await executeTransaction ( curation . signalWithDecimals ( mockDeploymentIDsBytes32 [ i ] , signalAmount ) )
170
- await executeTransaction ( curation . signalWithDecimals ( mockDeploymentIDsBytes32 [ 0 ] , signalAmount ) )
171
- await executeTransaction ( curation . signalWithDecimals ( mockDeploymentIDsBytes32 [ 1 ] , signalAmount ) )
173
+ await executeTransaction (
174
+ curation . signalWithDecimals ( mockDeploymentIDsBytes32 [ i ] , signalAmount ) ,
175
+ network ,
176
+ )
177
+ await executeTransaction (
178
+ curation . signalWithDecimals ( mockDeploymentIDsBytes32 [ 0 ] , signalAmount ) ,
179
+ network ,
180
+ )
181
+ await executeTransaction (
182
+ curation . signalWithDecimals ( mockDeploymentIDsBytes32 [ 1 ] , signalAmount ) ,
183
+ network ,
184
+ )
172
185
await executeTransaction (
173
186
curation . signalWithDecimals ( mockDeploymentIDsBytes32 [ 2 ] , signalAmountBig ) ,
187
+ network ,
174
188
)
175
189
}
176
190
const redeemAmount = '1' // Redeeming SHARES/Signal, NOT tokens. 1 share can be a lot of tokens
177
191
console . log ( 'Running redeem transactions...' )
178
192
for ( let i = 0 ; i < signers . length / 2 ; i ++ ) {
179
193
const curation = new ConnectedCuration ( network , signers [ i ] )
180
- await executeTransaction ( curation . redeemWithDecimals ( mockDeploymentIDsBytes32 [ 1 ] , redeemAmount ) )
194
+ await executeTransaction (
195
+ curation . redeemWithDecimals ( mockDeploymentIDsBytes32 [ 1 ] , redeemAmount ) ,
196
+ network ,
197
+ )
181
198
}
182
199
}
183
200
@@ -217,13 +234,13 @@ const populateServiceRegistry = async (network: string, signers: Array<Wallet>)
217
234
for ( let i = 0 ; i < signers . length ; i ++ ) {
218
235
const serviceRegistry = new ConnectedServiceRegistry ( network , signers [ i ] )
219
236
console . log ( `Registering an indexer in the service registry...` )
220
- await executeTransaction ( serviceRegistry . contract . register ( urls [ i ] , geoHashes [ i ] ) )
237
+ await executeTransaction ( serviceRegistry . contract . register ( urls [ i ] , geoHashes [ i ] ) , network )
221
238
if ( i < 2 ) {
222
239
// Just need to test a few
223
240
console . log ( `Unregistering a few to test...` )
224
- await executeTransaction ( serviceRegistry . contract . unregister ( ) )
241
+ await executeTransaction ( serviceRegistry . contract . unregister ( ) , network )
225
242
console . log ( `Re-registering them...` )
226
- await executeTransaction ( serviceRegistry . contract . register ( urls [ i ] , geoHashes [ i ] ) )
243
+ await executeTransaction ( serviceRegistry . contract . register ( urls [ i ] , geoHashes [ i ] ) , network )
227
244
}
228
245
}
229
246
}
@@ -248,23 +265,29 @@ const populateStaking = async (network: string, signers: Array<Wallet>, proxies:
248
265
console . log (
249
266
'First calling approve() to ensure staking contract can call transferFrom() from the stakers...' ,
250
267
)
251
- await executeTransaction ( connectedGT . approveWithDecimals ( staking . contract . address , stakeAmount ) )
268
+ await executeTransaction (
269
+ connectedGT . approveWithDecimals ( staking . contract . address , stakeAmount ) ,
270
+ network ,
271
+ )
252
272
console . log ( 'Now calling stake()...' )
253
- await executeTransaction ( staking . stakeWithDecimals ( stakeAmount ) )
273
+ await executeTransaction ( staking . stakeWithDecimals ( stakeAmount ) , network )
254
274
}
255
275
256
276
console . log ( 'Calling governor function to set epoch length to 1...' )
257
- await executeTransaction ( epochManager . setEpochLength ( 1 ) )
277
+ await executeTransaction ( epochManager . setEpochLength ( 1 ) , network )
258
278
console . log ( 'Calling governor function to set thawing period to 0...' )
259
- await executeTransaction ( networkContracts . staking . setThawingPeriod ( 0 ) )
279
+ await executeTransaction ( networkContracts . staking . setThawingPeriod ( 0 ) , network )
260
280
console . log ( 'Approve, stake extra, initialize unstake and withdraw for 3 signers...' )
261
281
for ( let i = 0 ; i < 3 ; i ++ ) {
262
282
const staking = new ConnectedStaking ( network , signers [ i ] )
263
283
const connectedGT = new ConnectedGraphToken ( network , signers [ i ] )
264
- await executeTransaction ( connectedGT . approveWithDecimals ( staking . contract . address , stakeAmount ) )
265
- await executeTransaction ( staking . stakeWithDecimals ( stakeAmount ) )
266
- await executeTransaction ( staking . unstakeWithDecimals ( stakeAmount ) )
267
- await executeTransaction ( staking . contract . withdraw ( ) )
284
+ await executeTransaction (
285
+ connectedGT . approveWithDecimals ( staking . contract . address , stakeAmount ) ,
286
+ network ,
287
+ )
288
+ await executeTransaction ( staking . stakeWithDecimals ( stakeAmount ) , network )
289
+ await executeTransaction ( staking . unstakeWithDecimals ( stakeAmount ) , network )
290
+ await executeTransaction ( staking . contract . withdraw ( ) , network )
268
291
}
269
292
270
293
console . log ( 'Create 10 allocations...' )
@@ -278,11 +301,12 @@ const populateStaking = async (network: string, signers: Array<Wallet>, proxies:
278
301
mockDeploymentIDsBytes32 [ i ] ,
279
302
mockChannelPubKeys [ i ] ,
280
303
) ,
304
+ network ,
281
305
)
282
306
}
283
307
284
308
console . log ( 'Run Epoch....' )
285
- await executeTransaction ( epochManager . runEpoch ( ) )
309
+ await executeTransaction ( epochManager . runEpoch ( ) , network )
286
310
console . log ( 'Settle 5 allocations...' )
287
311
for ( let i = 0 ; i < 5 ; i ++ ) {
288
312
// Note that the array of proxy wallets is used, not the signers
@@ -291,16 +315,19 @@ const populateStaking = async (network: string, signers: Array<Wallet>, proxies:
291
315
console . log (
292
316
'First calling approve() to ensure staking contract can call transferFrom() from the proxies...' ,
293
317
)
294
- await executeTransaction ( connectedGT . approveWithDecimals ( staking . contract . address , stakeAmount ) )
318
+ await executeTransaction (
319
+ connectedGT . approveWithDecimals ( staking . contract . address , stakeAmount ) ,
320
+ network ,
321
+ )
295
322
console . log ( 'Settling a channel...' )
296
- await executeTransaction ( staking . settleWithDecimals ( stakeAmount ) )
323
+ await executeTransaction ( staking . settleWithDecimals ( stakeAmount ) , network )
297
324
}
298
325
const defaultThawingPeriod = 20
299
326
const defaultEpochLength = 5760
300
327
console . log ( 'Setting epoch length back to default' )
301
- await executeTransaction ( epochManager . setEpochLength ( defaultEpochLength ) )
328
+ await executeTransaction ( epochManager . setEpochLength ( defaultEpochLength ) , network )
302
329
console . log ( 'Setting back the thawing period to default' )
303
- await executeTransaction ( networkContracts . staking . setThawingPeriod ( defaultThawingPeriod ) )
330
+ await executeTransaction ( networkContracts . staking . setThawingPeriod ( defaultThawingPeriod ) , network )
304
331
}
305
332
306
333
const populateAll = async ( mnemonic : string , provider : string , network : string ) : Promise < void > => {
0 commit comments