1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
/* eslint-disable prefer-arrow/prefer-arrow-functions */
// Generated by @wagmi/cli@0.1.10 on 2/26/2023 at 11:08:05 AM
import {
useNetwork,
useContract,
UseContractConfig,
useContractRead,
UseContractReadConfig,
useContractWrite,
UseContractWriteConfig,
usePrepareContractWrite,
UsePrepareContractWriteConfig,
useContractEvent,
UseContractEventConfig,
} from 'wagmi'
import {
ReadContractResult,
WriteContractMode,
PrepareWriteContractResult,
} from 'wagmi/actions'
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// AttestationStation
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export const attestationStationABI = [
{ stateMutability: 'nonpayable', type: 'constructor', inputs: [] },
{
type: 'event',
anonymous: false,
inputs: [
{
name: 'creator',
internalType: 'address',
type: 'address',
indexed: true,
},
{
name: 'about',
internalType: 'address',
type: 'address',
indexed: true,
},
{ name: 'key', internalType: 'bytes32', type: 'bytes32', indexed: true },
{ name: 'val', internalType: 'bytes', type: 'bytes', indexed: false },
],
name: 'AttestationCreated',
},
{
stateMutability: 'nonpayable',
type: 'function',
inputs: [
{
name: '_attestations',
internalType: 'struct AttestationStation.AttestationData[]',
type: 'tuple[]',
components: [
{ name: 'about', internalType: 'address', type: 'address' },
{ name: 'key', internalType: 'bytes32', type: 'bytes32' },
{ name: 'val', internalType: 'bytes', type: 'bytes' },
],
},
],
name: 'attest',
outputs: [],
},
{
stateMutability: 'nonpayable',
type: 'function',
inputs: [
{ name: '_about', internalType: 'address', type: 'address' },
{ name: '_key', internalType: 'bytes32', type: 'bytes32' },
{ name: '_val', internalType: 'bytes', type: 'bytes' },
],
name: 'attest',
outputs: [],
},
{
stateMutability: 'view',
type: 'function',
inputs: [
{ name: '', internalType: 'address', type: 'address' },
{ name: '', internalType: 'address', type: 'address' },
{ name: '', internalType: 'bytes32', type: 'bytes32' },
],
name: 'attestations',
outputs: [{ name: '', internalType: 'bytes', type: 'bytes' }],
},
{
stateMutability: 'view',
type: 'function',
inputs: [],
name: 'version',
outputs: [{ name: '', internalType: 'string', type: 'string' }],
},
] as const
/**
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export const attestationStationAddress = {
10: '0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77',
420: '0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77',
31337: '0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77',
} as const
/**
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export const attestationStationConfig = {
address: attestationStationAddress,
abi: attestationStationABI,
} as const
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// React
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Wraps __{@link useContract}__ with `abi` set to __{@link attestationStationABI}__.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStation(
config: Omit<UseContractConfig, 'abi' | 'address'> & {
chainId?: keyof typeof attestationStationAddress
} = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContract({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
...config,
})
}
/**
* Wraps __{@link useContractRead}__ with `abi` set to __{@link attestationStationABI}__.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStationRead<
TFunctionName extends string,
TSelectData = ReadContractResult<typeof attestationStationABI, TFunctionName>
>(
config: Omit<
UseContractReadConfig<
typeof attestationStationABI,
TFunctionName,
TSelectData
>,
'abi' | 'address'
> & { chainId?: keyof typeof attestationStationAddress } = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContractRead({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
...config,
} as UseContractReadConfig<typeof attestationStationABI, TFunctionName, TSelectData>)
}
/**
* Wraps __{@link useContractRead}__ with `abi` set to __{@link attestationStationABI}__ and `functionName` set to `"attestations"`.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStationAttestations<
TSelectData = ReadContractResult<typeof attestationStationABI, 'attestations'>
>(
config: Omit<
UseContractReadConfig<
typeof attestationStationABI,
'attestations',
TSelectData
>,
'abi' | 'address' | 'functionName'
> & { chainId?: keyof typeof attestationStationAddress } = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContractRead({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
functionName: 'attestations',
...config,
} as UseContractReadConfig<typeof attestationStationABI, 'attestations', TSelectData>)
}
/**
* Wraps __{@link useContractRead}__ with `abi` set to __{@link attestationStationABI}__ and `functionName` set to `"version"`.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStationVersion<
TSelectData = ReadContractResult<typeof attestationStationABI, 'version'>
>(
config: Omit<
UseContractReadConfig<typeof attestationStationABI, 'version', TSelectData>,
'abi' | 'address' | 'functionName'
> & { chainId?: keyof typeof attestationStationAddress } = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContractRead({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
functionName: 'version',
...config,
} as UseContractReadConfig<typeof attestationStationABI, 'version', TSelectData>)
}
/**
* Wraps __{@link useContractWrite}__ with `abi` set to __{@link attestationStationABI}__.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStationWrite<
TMode extends WriteContractMode,
TFunctionName extends string,
TChainId extends number = keyof typeof attestationStationAddress
>(
config: TMode extends 'prepared'
? UseContractWriteConfig<
TMode,
PrepareWriteContractResult<typeof attestationStationABI, string>['abi'],
TFunctionName
> & { address?: `0x${string}`; chainId?: TChainId }
: UseContractWriteConfig<
TMode,
typeof attestationStationABI,
TFunctionName
> & {
abi?: never
address?: never
chainId?: TChainId
} = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContractWrite<TMode, typeof attestationStationABI, TFunctionName>({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
...config,
} as any)
}
/**
* Wraps __{@link useContractWrite}__ with `abi` set to __{@link attestationStationABI}__ and `functionName` set to `"attest"`.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStationAttest<
TMode extends WriteContractMode,
TChainId extends number = keyof typeof attestationStationAddress
>(
config: TMode extends 'prepared'
? UseContractWriteConfig<
TMode,
PrepareWriteContractResult<
typeof attestationStationABI,
'attest'
>['abi'],
'attest'
> & {
address?: `0x${string}`
chainId?: TChainId
functionName?: 'attest'
}
: UseContractWriteConfig<TMode, typeof attestationStationABI, 'attest'> & {
abi?: never
address?: never
chainId?: TChainId
functionName?: 'attest'
} = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContractWrite<TMode, typeof attestationStationABI, 'attest'>({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
functionName: 'attest',
...config,
} as any)
}
/**
* Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link attestationStationABI}__.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function usePrepareAttestationStationWrite<TFunctionName extends string>(
config: Omit<
UsePrepareContractWriteConfig<typeof attestationStationABI, TFunctionName>,
'abi' | 'address'
> & { chainId?: keyof typeof attestationStationAddress } = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return usePrepareContractWrite({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
...config,
} as UsePrepareContractWriteConfig<typeof attestationStationABI, TFunctionName>)
}
/**
* Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link attestationStationABI}__ and `functionName` set to `"attest"`.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function usePrepareAttestationStationAttest(
config: Omit<
UsePrepareContractWriteConfig<typeof attestationStationABI, 'attest'>,
'abi' | 'address' | 'functionName'
> & { chainId?: keyof typeof attestationStationAddress } = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return usePrepareContractWrite({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
functionName: 'attest',
...config,
} as UsePrepareContractWriteConfig<typeof attestationStationABI, 'attest'>)
}
/**
* Wraps __{@link useContractEvent}__ with `abi` set to __{@link attestationStationABI}__.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStationEvent<TEventName extends string>(
config: Omit<
UseContractEventConfig<typeof attestationStationABI, TEventName>,
'abi' | 'address'
> & { chainId?: keyof typeof attestationStationAddress } = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContractEvent({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
...config,
} as UseContractEventConfig<typeof attestationStationABI, TEventName>)
}
/**
* Wraps __{@link useContractEvent}__ with `abi` set to __{@link attestationStationABI}__ and `eventName` set to `"AttestationCreated"`.
*
* - [__View Contract on Optimism Optimism Explorer__](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* - [__View Contract on Optimism Goerli Etherscan__](https://goerli-optimism.etherscan.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77)
* -
*/
export function useAttestationStationAttestationCreatedEvent(
config: Omit<
UseContractEventConfig<typeof attestationStationABI, 'AttestationCreated'>,
'abi' | 'address' | 'eventName'
> & { chainId?: keyof typeof attestationStationAddress } = {} as any
) {
const { chain } = useNetwork()
const chainId = config.chainId ?? chain?.id
return useContractEvent({
abi: attestationStationABI,
address:
attestationStationAddress[
chainId as keyof typeof attestationStationAddress
],
eventName: 'AttestationCreated',
...config,
} as UseContractEventConfig<typeof attestationStationABI, 'AttestationCreated'>)
}