anymal-protocol 1.0.23 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -544
- package/dist/index.mjs +7 -542
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48,545 +48,7 @@ var import_react = require("react");
|
|
|
48
48
|
var import_viem = require("viem");
|
|
49
49
|
|
|
50
50
|
// src/helpers/BlockchainAbiHelper.tsx
|
|
51
|
-
var PET_NFT_ABI = [
|
|
52
|
-
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
53
|
-
{
|
|
54
|
-
inputs: [],
|
|
55
|
-
name: "AccessControlBadConfirmation",
|
|
56
|
-
type: "error"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
inputs: [
|
|
60
|
-
{ internalType: "address", name: "account", type: "address" },
|
|
61
|
-
{
|
|
62
|
-
internalType: "bytes32",
|
|
63
|
-
name: "neededRole",
|
|
64
|
-
type: "bytes32"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
name: "AccessControlUnauthorizedAccount",
|
|
68
|
-
type: "error"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
inputs: [{ internalType: "address", name: "target", type: "address" }],
|
|
72
|
-
name: "AddressEmptyCode",
|
|
73
|
-
type: "error"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
inputs: [{ internalType: "address", name: "implementation", type: "address" }],
|
|
77
|
-
name: "ERC1967InvalidImplementation",
|
|
78
|
-
type: "error"
|
|
79
|
-
},
|
|
80
|
-
{ inputs: [], name: "ERC1967NonPayable", type: "error" },
|
|
81
|
-
{
|
|
82
|
-
inputs: [],
|
|
83
|
-
name: "EnforcedPause",
|
|
84
|
-
type: "error"
|
|
85
|
-
},
|
|
86
|
-
{ inputs: [], name: "ExpectedPause", type: "error" },
|
|
87
|
-
{
|
|
88
|
-
inputs: [],
|
|
89
|
-
name: "FailedCall",
|
|
90
|
-
type: "error"
|
|
91
|
-
},
|
|
92
|
-
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
93
|
-
{
|
|
94
|
-
inputs: [],
|
|
95
|
-
name: "NotInitializing",
|
|
96
|
-
type: "error"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
inputs: [],
|
|
100
|
-
name: "UUPSUnauthorizedCallContext",
|
|
101
|
-
type: "error"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
inputs: [{ internalType: "bytes32", name: "slot", type: "bytes32" }],
|
|
105
|
-
name: "UUPSUnsupportedProxiableUUID",
|
|
106
|
-
type: "error"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
anonymous: false,
|
|
110
|
-
inputs: [{ indexed: false, internalType: "uint64", name: "version", type: "uint64" }],
|
|
111
|
-
name: "Initialized",
|
|
112
|
-
type: "event"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
anonymous: false,
|
|
116
|
-
inputs: [
|
|
117
|
-
{
|
|
118
|
-
indexed: true,
|
|
119
|
-
internalType: "address",
|
|
120
|
-
name: "user",
|
|
121
|
-
type: "address"
|
|
122
|
-
},
|
|
123
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
124
|
-
{
|
|
125
|
-
indexed: false,
|
|
126
|
-
internalType: "string",
|
|
127
|
-
name: "nftId",
|
|
128
|
-
type: "string"
|
|
129
|
-
},
|
|
130
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
131
|
-
{
|
|
132
|
-
indexed: false,
|
|
133
|
-
internalType: "uint256",
|
|
134
|
-
name: "campaignId",
|
|
135
|
-
type: "uint256"
|
|
136
|
-
},
|
|
137
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
138
|
-
],
|
|
139
|
-
name: "MetadataApproved",
|
|
140
|
-
type: "event"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
anonymous: false,
|
|
144
|
-
inputs: [
|
|
145
|
-
{
|
|
146
|
-
indexed: true,
|
|
147
|
-
internalType: "address",
|
|
148
|
-
name: "user",
|
|
149
|
-
type: "address"
|
|
150
|
-
},
|
|
151
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
152
|
-
{
|
|
153
|
-
indexed: false,
|
|
154
|
-
internalType: "string",
|
|
155
|
-
name: "nftId",
|
|
156
|
-
type: "string"
|
|
157
|
-
},
|
|
158
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
159
|
-
{
|
|
160
|
-
indexed: false,
|
|
161
|
-
internalType: "uint256",
|
|
162
|
-
name: "campaignId",
|
|
163
|
-
type: "uint256"
|
|
164
|
-
},
|
|
165
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
166
|
-
],
|
|
167
|
-
name: "MetadataRejected",
|
|
168
|
-
type: "event"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
anonymous: false,
|
|
172
|
-
inputs: [
|
|
173
|
-
{
|
|
174
|
-
indexed: true,
|
|
175
|
-
internalType: "address",
|
|
176
|
-
name: "user",
|
|
177
|
-
type: "address"
|
|
178
|
-
},
|
|
179
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
180
|
-
{
|
|
181
|
-
indexed: false,
|
|
182
|
-
internalType: "string",
|
|
183
|
-
name: "nftId",
|
|
184
|
-
type: "string"
|
|
185
|
-
},
|
|
186
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
187
|
-
{
|
|
188
|
-
indexed: false,
|
|
189
|
-
internalType: "uint256",
|
|
190
|
-
name: "campaignId",
|
|
191
|
-
type: "uint256"
|
|
192
|
-
},
|
|
193
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
194
|
-
],
|
|
195
|
-
name: "MetadataSubmitted",
|
|
196
|
-
type: "event"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
anonymous: false,
|
|
200
|
-
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
|
|
201
|
-
name: "Paused",
|
|
202
|
-
type: "event"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
anonymous: false,
|
|
206
|
-
inputs: [
|
|
207
|
-
{
|
|
208
|
-
indexed: true,
|
|
209
|
-
internalType: "address",
|
|
210
|
-
name: "user",
|
|
211
|
-
type: "address"
|
|
212
|
-
},
|
|
213
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
214
|
-
{
|
|
215
|
-
indexed: false,
|
|
216
|
-
internalType: "string",
|
|
217
|
-
name: "nftId",
|
|
218
|
-
type: "string"
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
indexed: false,
|
|
222
|
-
internalType: "uint256",
|
|
223
|
-
name: "rewardAmount",
|
|
224
|
-
type: "uint256"
|
|
225
|
-
},
|
|
226
|
-
{ indexed: false, internalType: "uint256", name: "campaignId", type: "uint256" }
|
|
227
|
-
],
|
|
228
|
-
name: "RewardDistributed",
|
|
229
|
-
type: "event"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
anonymous: false,
|
|
233
|
-
inputs: [
|
|
234
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
235
|
-
{
|
|
236
|
-
indexed: true,
|
|
237
|
-
internalType: "bytes32",
|
|
238
|
-
name: "previousAdminRole",
|
|
239
|
-
type: "bytes32"
|
|
240
|
-
},
|
|
241
|
-
{ indexed: true, internalType: "bytes32", name: "newAdminRole", type: "bytes32" }
|
|
242
|
-
],
|
|
243
|
-
name: "RoleAdminChanged",
|
|
244
|
-
type: "event"
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
anonymous: false,
|
|
248
|
-
inputs: [
|
|
249
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
250
|
-
{
|
|
251
|
-
indexed: true,
|
|
252
|
-
internalType: "address",
|
|
253
|
-
name: "account",
|
|
254
|
-
type: "address"
|
|
255
|
-
},
|
|
256
|
-
{ indexed: true, internalType: "address", name: "sender", type: "address" }
|
|
257
|
-
],
|
|
258
|
-
name: "RoleGranted",
|
|
259
|
-
type: "event"
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
anonymous: false,
|
|
263
|
-
inputs: [
|
|
264
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
265
|
-
{
|
|
266
|
-
indexed: true,
|
|
267
|
-
internalType: "address",
|
|
268
|
-
name: "account",
|
|
269
|
-
type: "address"
|
|
270
|
-
},
|
|
271
|
-
{ indexed: true, internalType: "address", name: "sender", type: "address" }
|
|
272
|
-
],
|
|
273
|
-
name: "RoleRevoked",
|
|
274
|
-
type: "event"
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
anonymous: false,
|
|
278
|
-
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
|
|
279
|
-
name: "Unpaused",
|
|
280
|
-
type: "event"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
anonymous: false,
|
|
284
|
-
inputs: [{ indexed: true, internalType: "address", name: "implementation", type: "address" }],
|
|
285
|
-
name: "Upgraded",
|
|
286
|
-
type: "event"
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
inputs: [],
|
|
290
|
-
name: "APPROVER_ROLE",
|
|
291
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
292
|
-
stateMutability: "view",
|
|
293
|
-
type: "function"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
inputs: [],
|
|
297
|
-
name: "DEFAULT_ADMIN_ROLE",
|
|
298
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
299
|
-
stateMutability: "view",
|
|
300
|
-
type: "function"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
inputs: [],
|
|
304
|
-
name: "UPGRADE_INTERFACE_VERSION",
|
|
305
|
-
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
306
|
-
stateMutability: "view",
|
|
307
|
-
type: "function"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
inputs: [
|
|
311
|
-
{ internalType: "address", name: "_user", type: "address" },
|
|
312
|
-
{
|
|
313
|
-
internalType: "string",
|
|
314
|
-
name: "_pid",
|
|
315
|
-
type: "string"
|
|
316
|
-
},
|
|
317
|
-
{ internalType: "string", name: "_nftId", type: "string" },
|
|
318
|
-
{
|
|
319
|
-
internalType: "string",
|
|
320
|
-
name: "_metadataURL",
|
|
321
|
-
type: "string"
|
|
322
|
-
},
|
|
323
|
-
{ internalType: "uint256", name: "_campaignId", type: "uint256" }
|
|
324
|
-
],
|
|
325
|
-
name: "approveMetadata",
|
|
326
|
-
outputs: [],
|
|
327
|
-
stateMutability: "nonpayable",
|
|
328
|
-
type: "function"
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
inputs: [],
|
|
332
|
-
name: "campaignCount",
|
|
333
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
334
|
-
stateMutability: "view",
|
|
335
|
-
type: "function"
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
339
|
-
name: "campaigns",
|
|
340
|
-
outputs: [
|
|
341
|
-
{ internalType: "string", name: "name", type: "string" },
|
|
342
|
-
{
|
|
343
|
-
internalType: "uint256",
|
|
344
|
-
name: "rewardAmount",
|
|
345
|
-
type: "uint256"
|
|
346
|
-
},
|
|
347
|
-
{ internalType: "bool", name: "isActive", type: "bool" }
|
|
348
|
-
],
|
|
349
|
-
stateMutability: "view",
|
|
350
|
-
type: "function"
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
inputs: [
|
|
354
|
-
{ internalType: "string", name: "_name", type: "string" },
|
|
355
|
-
{
|
|
356
|
-
internalType: "uint256",
|
|
357
|
-
name: "_rewardAmount",
|
|
358
|
-
type: "uint256"
|
|
359
|
-
}
|
|
360
|
-
],
|
|
361
|
-
name: "createCampaign",
|
|
362
|
-
outputs: [],
|
|
363
|
-
stateMutability: "nonpayable",
|
|
364
|
-
type: "function"
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
inputs: [],
|
|
368
|
-
name: "defaultRewardAmount",
|
|
369
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
370
|
-
stateMutability: "view",
|
|
371
|
-
type: "function"
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
375
|
-
name: "getRoleAdmin",
|
|
376
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
377
|
-
stateMutability: "view",
|
|
378
|
-
type: "function"
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
inputs: [
|
|
382
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
383
|
-
{
|
|
384
|
-
internalType: "address",
|
|
385
|
-
name: "account",
|
|
386
|
-
type: "address"
|
|
387
|
-
}
|
|
388
|
-
],
|
|
389
|
-
name: "grantRole",
|
|
390
|
-
outputs: [],
|
|
391
|
-
stateMutability: "nonpayable",
|
|
392
|
-
type: "function"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
inputs: [
|
|
396
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
397
|
-
{
|
|
398
|
-
internalType: "address",
|
|
399
|
-
name: "account",
|
|
400
|
-
type: "address"
|
|
401
|
-
}
|
|
402
|
-
],
|
|
403
|
-
name: "hasRole",
|
|
404
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
405
|
-
stateMutability: "view",
|
|
406
|
-
type: "function"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
inputs: [
|
|
410
|
-
{
|
|
411
|
-
internalType: "address",
|
|
412
|
-
name: "initialOwner",
|
|
413
|
-
type: "address"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
internalType: "contract IERC20",
|
|
417
|
-
name: "_rewardToken",
|
|
418
|
-
type: "address"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
internalType: "contract IPetToken",
|
|
422
|
-
name: "_petToken",
|
|
423
|
-
type: "address"
|
|
424
|
-
},
|
|
425
|
-
{ internalType: "uint256", name: "_defaultRewardAmount", type: "uint256" }
|
|
426
|
-
],
|
|
427
|
-
name: "initialize",
|
|
428
|
-
outputs: [],
|
|
429
|
-
stateMutability: "nonpayable",
|
|
430
|
-
type: "function"
|
|
431
|
-
},
|
|
432
|
-
{
|
|
433
|
-
inputs: [],
|
|
434
|
-
name: "pause",
|
|
435
|
-
outputs: [],
|
|
436
|
-
stateMutability: "nonpayable",
|
|
437
|
-
type: "function"
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
inputs: [],
|
|
441
|
-
name: "paused",
|
|
442
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
443
|
-
stateMutability: "view",
|
|
444
|
-
type: "function"
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
inputs: [],
|
|
448
|
-
name: "petToken",
|
|
449
|
-
outputs: [{ internalType: "contract IPetToken", name: "", type: "address" }],
|
|
450
|
-
stateMutability: "view",
|
|
451
|
-
type: "function"
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
inputs: [],
|
|
455
|
-
name: "proxiableUUID",
|
|
456
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
457
|
-
stateMutability: "view",
|
|
458
|
-
type: "function"
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
inputs: [
|
|
462
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
463
|
-
{
|
|
464
|
-
internalType: "address",
|
|
465
|
-
name: "callerConfirmation",
|
|
466
|
-
type: "address"
|
|
467
|
-
}
|
|
468
|
-
],
|
|
469
|
-
name: "renounceRole",
|
|
470
|
-
outputs: [],
|
|
471
|
-
stateMutability: "nonpayable",
|
|
472
|
-
type: "function"
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
inputs: [
|
|
476
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
477
|
-
{
|
|
478
|
-
internalType: "address",
|
|
479
|
-
name: "account",
|
|
480
|
-
type: "address"
|
|
481
|
-
}
|
|
482
|
-
],
|
|
483
|
-
name: "revokeRole",
|
|
484
|
-
outputs: [],
|
|
485
|
-
stateMutability: "nonpayable",
|
|
486
|
-
type: "function"
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
inputs: [],
|
|
490
|
-
name: "rewardToken",
|
|
491
|
-
outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
|
|
492
|
-
stateMutability: "view",
|
|
493
|
-
type: "function"
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
inputs: [
|
|
497
|
-
{ internalType: "string", name: "_pid", type: "string" },
|
|
498
|
-
{
|
|
499
|
-
internalType: "string",
|
|
500
|
-
name: "_nftId",
|
|
501
|
-
type: "string"
|
|
502
|
-
},
|
|
503
|
-
{ internalType: "string", name: "_metadataURL", type: "string" },
|
|
504
|
-
{
|
|
505
|
-
internalType: "uint256",
|
|
506
|
-
name: "_campaignId",
|
|
507
|
-
type: "uint256"
|
|
508
|
-
}
|
|
509
|
-
],
|
|
510
|
-
name: "submitMetadata",
|
|
511
|
-
outputs: [],
|
|
512
|
-
stateMutability: "nonpayable",
|
|
513
|
-
type: "function"
|
|
514
|
-
},
|
|
515
|
-
{
|
|
516
|
-
inputs: [
|
|
517
|
-
{ internalType: "string", name: "_pid", type: "string" },
|
|
518
|
-
{
|
|
519
|
-
internalType: "string",
|
|
520
|
-
name: "_nftId",
|
|
521
|
-
type: "string"
|
|
522
|
-
},
|
|
523
|
-
{ internalType: "string", name: "_metadataURL", type: "string" },
|
|
524
|
-
{
|
|
525
|
-
internalType: "string",
|
|
526
|
-
name: "_campaignName",
|
|
527
|
-
type: "string"
|
|
528
|
-
}
|
|
529
|
-
],
|
|
530
|
-
name: "submitMetadataByCampaignName",
|
|
531
|
-
outputs: [],
|
|
532
|
-
stateMutability: "nonpayable",
|
|
533
|
-
type: "function"
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
537
|
-
name: "supportsInterface",
|
|
538
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
539
|
-
stateMutability: "view",
|
|
540
|
-
type: "function"
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
inputs: [],
|
|
544
|
-
name: "unpause",
|
|
545
|
-
outputs: [],
|
|
546
|
-
stateMutability: "nonpayable",
|
|
547
|
-
type: "function"
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
inputs: [
|
|
551
|
-
{
|
|
552
|
-
internalType: "uint256",
|
|
553
|
-
name: "_campaignId",
|
|
554
|
-
type: "uint256"
|
|
555
|
-
},
|
|
556
|
-
{ internalType: "uint256", name: "_rewardAmount", type: "uint256" },
|
|
557
|
-
{
|
|
558
|
-
internalType: "bool",
|
|
559
|
-
name: "_isActive",
|
|
560
|
-
type: "bool"
|
|
561
|
-
}
|
|
562
|
-
],
|
|
563
|
-
name: "updateCampaign",
|
|
564
|
-
outputs: [],
|
|
565
|
-
stateMutability: "nonpayable",
|
|
566
|
-
type: "function"
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
inputs: [{ internalType: "uint256", name: "_rewardAmount", type: "uint256" }],
|
|
570
|
-
name: "updateDefaultReward",
|
|
571
|
-
outputs: [],
|
|
572
|
-
stateMutability: "nonpayable",
|
|
573
|
-
type: "function"
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
inputs: [
|
|
577
|
-
{
|
|
578
|
-
internalType: "address",
|
|
579
|
-
name: "newImplementation",
|
|
580
|
-
type: "address"
|
|
581
|
-
},
|
|
582
|
-
{ internalType: "bytes", name: "data", type: "bytes" }
|
|
583
|
-
],
|
|
584
|
-
name: "upgradeToAndCall",
|
|
585
|
-
outputs: [],
|
|
586
|
-
stateMutability: "payable",
|
|
587
|
-
type: "function"
|
|
588
|
-
}
|
|
589
|
-
];
|
|
51
|
+
var PET_NFT_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataApproved", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "anymalTxId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataRejected", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataSubmitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "RewardDistributed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "APPROVER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "approveMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "campaignCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "campaigns", "outputs": [{ "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_name", "type": "string" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "createCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "defaultRewardAmount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }, { "internalType": "contract IPetToken", "name": "_petToken", "type": "address" }, { "internalType": "uint256", "name": "_defaultRewardAmount", "type": "uint256" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "petToken", "outputs": [{ "internalType": "contract IPetToken", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "string", "name": "_campaignName", "type": "string" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadataByCampaignName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "_isActive", "type": "bool" }], "name": "updateCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "updateDefaultReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
590
52
|
var VERIFY_ACCOUNT_ABI = [
|
|
591
53
|
{
|
|
592
54
|
inputs: [
|
|
@@ -964,6 +426,7 @@ function useFetchNotifications() {
|
|
|
964
426
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
965
427
|
var import_viem2 = require("viem");
|
|
966
428
|
var import_react10 = require("react");
|
|
429
|
+
var import_uuid = require("uuid");
|
|
967
430
|
function useMintAnymalNFT() {
|
|
968
431
|
return (0, import_react10.useCallback)(
|
|
969
432
|
async (pid, nftId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
|
|
@@ -973,6 +436,7 @@ function useMintAnymalNFT() {
|
|
|
973
436
|
message: "Missing authentication token OR NFT ID."
|
|
974
437
|
};
|
|
975
438
|
}
|
|
439
|
+
const anymalTxId = (0, import_uuid.v4)();
|
|
976
440
|
const callData = (0, import_viem2.encodeFunctionData)({
|
|
977
441
|
abi: PET_NFT_ABI,
|
|
978
442
|
functionName: "submitMetadataByCampaignName",
|
|
@@ -980,7 +444,8 @@ function useMintAnymalNFT() {
|
|
|
980
444
|
pid,
|
|
981
445
|
nftId,
|
|
982
446
|
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
983
|
-
"petastic-signup-campaign-1"
|
|
447
|
+
"petastic-signup-campaign-1",
|
|
448
|
+
anymalTxId
|
|
984
449
|
]
|
|
985
450
|
});
|
|
986
451
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
@@ -1404,22 +869,22 @@ function useApproveKibbleToken() {
|
|
|
1404
869
|
}
|
|
1405
870
|
|
|
1406
871
|
// src/helpers/NonceHelper.tsx
|
|
1407
|
-
var
|
|
872
|
+
var import_uuid2 = require("uuid");
|
|
1408
873
|
var import_viem5 = require("viem");
|
|
1409
874
|
var generateBytes32Nonce = () => {
|
|
1410
|
-
const uuid2 = (0,
|
|
875
|
+
const uuid2 = (0, import_uuid2.v4)().replace(/-/g, "");
|
|
1411
876
|
return (0, import_viem5.padHex)(`0x${uuid2}`, { size: 32 });
|
|
1412
877
|
};
|
|
1413
878
|
|
|
1414
879
|
// src/utils/application/useCreateUserAppData.ts
|
|
1415
880
|
var import_react18 = require("react");
|
|
1416
|
-
var
|
|
881
|
+
var import_uuid3 = require("uuid");
|
|
1417
882
|
function useCreateUserAppData() {
|
|
1418
883
|
return (0, import_react18.useCallback)(
|
|
1419
884
|
async (appId, pid, dbAuthToken, endpoint) => {
|
|
1420
885
|
if (!dbAuthToken || !pid || !dbAuthToken || !endpoint) return;
|
|
1421
886
|
const appValues = {
|
|
1422
|
-
id: (0,
|
|
887
|
+
id: (0, import_uuid3.v4)(),
|
|
1423
888
|
userPid: pid,
|
|
1424
889
|
appId,
|
|
1425
890
|
settings: {
|
package/dist/index.mjs
CHANGED
|
@@ -3,545 +3,7 @@ import { useCallback } from "react";
|
|
|
3
3
|
import { encodeFunctionData, parseGwei } from "viem";
|
|
4
4
|
|
|
5
5
|
// src/helpers/BlockchainAbiHelper.tsx
|
|
6
|
-
var PET_NFT_ABI = [
|
|
7
|
-
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
8
|
-
{
|
|
9
|
-
inputs: [],
|
|
10
|
-
name: "AccessControlBadConfirmation",
|
|
11
|
-
type: "error"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
inputs: [
|
|
15
|
-
{ internalType: "address", name: "account", type: "address" },
|
|
16
|
-
{
|
|
17
|
-
internalType: "bytes32",
|
|
18
|
-
name: "neededRole",
|
|
19
|
-
type: "bytes32"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
name: "AccessControlUnauthorizedAccount",
|
|
23
|
-
type: "error"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
inputs: [{ internalType: "address", name: "target", type: "address" }],
|
|
27
|
-
name: "AddressEmptyCode",
|
|
28
|
-
type: "error"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
inputs: [{ internalType: "address", name: "implementation", type: "address" }],
|
|
32
|
-
name: "ERC1967InvalidImplementation",
|
|
33
|
-
type: "error"
|
|
34
|
-
},
|
|
35
|
-
{ inputs: [], name: "ERC1967NonPayable", type: "error" },
|
|
36
|
-
{
|
|
37
|
-
inputs: [],
|
|
38
|
-
name: "EnforcedPause",
|
|
39
|
-
type: "error"
|
|
40
|
-
},
|
|
41
|
-
{ inputs: [], name: "ExpectedPause", type: "error" },
|
|
42
|
-
{
|
|
43
|
-
inputs: [],
|
|
44
|
-
name: "FailedCall",
|
|
45
|
-
type: "error"
|
|
46
|
-
},
|
|
47
|
-
{ inputs: [], name: "InvalidInitialization", type: "error" },
|
|
48
|
-
{
|
|
49
|
-
inputs: [],
|
|
50
|
-
name: "NotInitializing",
|
|
51
|
-
type: "error"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
inputs: [],
|
|
55
|
-
name: "UUPSUnauthorizedCallContext",
|
|
56
|
-
type: "error"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
inputs: [{ internalType: "bytes32", name: "slot", type: "bytes32" }],
|
|
60
|
-
name: "UUPSUnsupportedProxiableUUID",
|
|
61
|
-
type: "error"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
anonymous: false,
|
|
65
|
-
inputs: [{ indexed: false, internalType: "uint64", name: "version", type: "uint64" }],
|
|
66
|
-
name: "Initialized",
|
|
67
|
-
type: "event"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
anonymous: false,
|
|
71
|
-
inputs: [
|
|
72
|
-
{
|
|
73
|
-
indexed: true,
|
|
74
|
-
internalType: "address",
|
|
75
|
-
name: "user",
|
|
76
|
-
type: "address"
|
|
77
|
-
},
|
|
78
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
79
|
-
{
|
|
80
|
-
indexed: false,
|
|
81
|
-
internalType: "string",
|
|
82
|
-
name: "nftId",
|
|
83
|
-
type: "string"
|
|
84
|
-
},
|
|
85
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
86
|
-
{
|
|
87
|
-
indexed: false,
|
|
88
|
-
internalType: "uint256",
|
|
89
|
-
name: "campaignId",
|
|
90
|
-
type: "uint256"
|
|
91
|
-
},
|
|
92
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
93
|
-
],
|
|
94
|
-
name: "MetadataApproved",
|
|
95
|
-
type: "event"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
anonymous: false,
|
|
99
|
-
inputs: [
|
|
100
|
-
{
|
|
101
|
-
indexed: true,
|
|
102
|
-
internalType: "address",
|
|
103
|
-
name: "user",
|
|
104
|
-
type: "address"
|
|
105
|
-
},
|
|
106
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
107
|
-
{
|
|
108
|
-
indexed: false,
|
|
109
|
-
internalType: "string",
|
|
110
|
-
name: "nftId",
|
|
111
|
-
type: "string"
|
|
112
|
-
},
|
|
113
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
114
|
-
{
|
|
115
|
-
indexed: false,
|
|
116
|
-
internalType: "uint256",
|
|
117
|
-
name: "campaignId",
|
|
118
|
-
type: "uint256"
|
|
119
|
-
},
|
|
120
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
121
|
-
],
|
|
122
|
-
name: "MetadataRejected",
|
|
123
|
-
type: "event"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
anonymous: false,
|
|
127
|
-
inputs: [
|
|
128
|
-
{
|
|
129
|
-
indexed: true,
|
|
130
|
-
internalType: "address",
|
|
131
|
-
name: "user",
|
|
132
|
-
type: "address"
|
|
133
|
-
},
|
|
134
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
135
|
-
{
|
|
136
|
-
indexed: false,
|
|
137
|
-
internalType: "string",
|
|
138
|
-
name: "nftId",
|
|
139
|
-
type: "string"
|
|
140
|
-
},
|
|
141
|
-
{ indexed: false, internalType: "string", name: "metadataURL", type: "string" },
|
|
142
|
-
{
|
|
143
|
-
indexed: false,
|
|
144
|
-
internalType: "uint256",
|
|
145
|
-
name: "campaignId",
|
|
146
|
-
type: "uint256"
|
|
147
|
-
},
|
|
148
|
-
{ indexed: false, internalType: "uint256", name: "rewardAmount", type: "uint256" }
|
|
149
|
-
],
|
|
150
|
-
name: "MetadataSubmitted",
|
|
151
|
-
type: "event"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
anonymous: false,
|
|
155
|
-
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
|
|
156
|
-
name: "Paused",
|
|
157
|
-
type: "event"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
anonymous: false,
|
|
161
|
-
inputs: [
|
|
162
|
-
{
|
|
163
|
-
indexed: true,
|
|
164
|
-
internalType: "address",
|
|
165
|
-
name: "user",
|
|
166
|
-
type: "address"
|
|
167
|
-
},
|
|
168
|
-
{ indexed: false, internalType: "string", name: "pid", type: "string" },
|
|
169
|
-
{
|
|
170
|
-
indexed: false,
|
|
171
|
-
internalType: "string",
|
|
172
|
-
name: "nftId",
|
|
173
|
-
type: "string"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
indexed: false,
|
|
177
|
-
internalType: "uint256",
|
|
178
|
-
name: "rewardAmount",
|
|
179
|
-
type: "uint256"
|
|
180
|
-
},
|
|
181
|
-
{ indexed: false, internalType: "uint256", name: "campaignId", type: "uint256" }
|
|
182
|
-
],
|
|
183
|
-
name: "RewardDistributed",
|
|
184
|
-
type: "event"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
anonymous: false,
|
|
188
|
-
inputs: [
|
|
189
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
190
|
-
{
|
|
191
|
-
indexed: true,
|
|
192
|
-
internalType: "bytes32",
|
|
193
|
-
name: "previousAdminRole",
|
|
194
|
-
type: "bytes32"
|
|
195
|
-
},
|
|
196
|
-
{ indexed: true, internalType: "bytes32", name: "newAdminRole", type: "bytes32" }
|
|
197
|
-
],
|
|
198
|
-
name: "RoleAdminChanged",
|
|
199
|
-
type: "event"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
anonymous: false,
|
|
203
|
-
inputs: [
|
|
204
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
205
|
-
{
|
|
206
|
-
indexed: true,
|
|
207
|
-
internalType: "address",
|
|
208
|
-
name: "account",
|
|
209
|
-
type: "address"
|
|
210
|
-
},
|
|
211
|
-
{ indexed: true, internalType: "address", name: "sender", type: "address" }
|
|
212
|
-
],
|
|
213
|
-
name: "RoleGranted",
|
|
214
|
-
type: "event"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
anonymous: false,
|
|
218
|
-
inputs: [
|
|
219
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
220
|
-
{
|
|
221
|
-
indexed: true,
|
|
222
|
-
internalType: "address",
|
|
223
|
-
name: "account",
|
|
224
|
-
type: "address"
|
|
225
|
-
},
|
|
226
|
-
{ indexed: true, internalType: "address", name: "sender", type: "address" }
|
|
227
|
-
],
|
|
228
|
-
name: "RoleRevoked",
|
|
229
|
-
type: "event"
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
anonymous: false,
|
|
233
|
-
inputs: [{ indexed: false, internalType: "address", name: "account", type: "address" }],
|
|
234
|
-
name: "Unpaused",
|
|
235
|
-
type: "event"
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
anonymous: false,
|
|
239
|
-
inputs: [{ indexed: true, internalType: "address", name: "implementation", type: "address" }],
|
|
240
|
-
name: "Upgraded",
|
|
241
|
-
type: "event"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
inputs: [],
|
|
245
|
-
name: "APPROVER_ROLE",
|
|
246
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
247
|
-
stateMutability: "view",
|
|
248
|
-
type: "function"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
inputs: [],
|
|
252
|
-
name: "DEFAULT_ADMIN_ROLE",
|
|
253
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
254
|
-
stateMutability: "view",
|
|
255
|
-
type: "function"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
inputs: [],
|
|
259
|
-
name: "UPGRADE_INTERFACE_VERSION",
|
|
260
|
-
outputs: [{ internalType: "string", name: "", type: "string" }],
|
|
261
|
-
stateMutability: "view",
|
|
262
|
-
type: "function"
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
inputs: [
|
|
266
|
-
{ internalType: "address", name: "_user", type: "address" },
|
|
267
|
-
{
|
|
268
|
-
internalType: "string",
|
|
269
|
-
name: "_pid",
|
|
270
|
-
type: "string"
|
|
271
|
-
},
|
|
272
|
-
{ internalType: "string", name: "_nftId", type: "string" },
|
|
273
|
-
{
|
|
274
|
-
internalType: "string",
|
|
275
|
-
name: "_metadataURL",
|
|
276
|
-
type: "string"
|
|
277
|
-
},
|
|
278
|
-
{ internalType: "uint256", name: "_campaignId", type: "uint256" }
|
|
279
|
-
],
|
|
280
|
-
name: "approveMetadata",
|
|
281
|
-
outputs: [],
|
|
282
|
-
stateMutability: "nonpayable",
|
|
283
|
-
type: "function"
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
inputs: [],
|
|
287
|
-
name: "campaignCount",
|
|
288
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
289
|
-
stateMutability: "view",
|
|
290
|
-
type: "function"
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
inputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
294
|
-
name: "campaigns",
|
|
295
|
-
outputs: [
|
|
296
|
-
{ internalType: "string", name: "name", type: "string" },
|
|
297
|
-
{
|
|
298
|
-
internalType: "uint256",
|
|
299
|
-
name: "rewardAmount",
|
|
300
|
-
type: "uint256"
|
|
301
|
-
},
|
|
302
|
-
{ internalType: "bool", name: "isActive", type: "bool" }
|
|
303
|
-
],
|
|
304
|
-
stateMutability: "view",
|
|
305
|
-
type: "function"
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
inputs: [
|
|
309
|
-
{ internalType: "string", name: "_name", type: "string" },
|
|
310
|
-
{
|
|
311
|
-
internalType: "uint256",
|
|
312
|
-
name: "_rewardAmount",
|
|
313
|
-
type: "uint256"
|
|
314
|
-
}
|
|
315
|
-
],
|
|
316
|
-
name: "createCampaign",
|
|
317
|
-
outputs: [],
|
|
318
|
-
stateMutability: "nonpayable",
|
|
319
|
-
type: "function"
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
inputs: [],
|
|
323
|
-
name: "defaultRewardAmount",
|
|
324
|
-
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
325
|
-
stateMutability: "view",
|
|
326
|
-
type: "function"
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
330
|
-
name: "getRoleAdmin",
|
|
331
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
332
|
-
stateMutability: "view",
|
|
333
|
-
type: "function"
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
inputs: [
|
|
337
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
338
|
-
{
|
|
339
|
-
internalType: "address",
|
|
340
|
-
name: "account",
|
|
341
|
-
type: "address"
|
|
342
|
-
}
|
|
343
|
-
],
|
|
344
|
-
name: "grantRole",
|
|
345
|
-
outputs: [],
|
|
346
|
-
stateMutability: "nonpayable",
|
|
347
|
-
type: "function"
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
inputs: [
|
|
351
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
352
|
-
{
|
|
353
|
-
internalType: "address",
|
|
354
|
-
name: "account",
|
|
355
|
-
type: "address"
|
|
356
|
-
}
|
|
357
|
-
],
|
|
358
|
-
name: "hasRole",
|
|
359
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
360
|
-
stateMutability: "view",
|
|
361
|
-
type: "function"
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
inputs: [
|
|
365
|
-
{
|
|
366
|
-
internalType: "address",
|
|
367
|
-
name: "initialOwner",
|
|
368
|
-
type: "address"
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
internalType: "contract IERC20",
|
|
372
|
-
name: "_rewardToken",
|
|
373
|
-
type: "address"
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
internalType: "contract IPetToken",
|
|
377
|
-
name: "_petToken",
|
|
378
|
-
type: "address"
|
|
379
|
-
},
|
|
380
|
-
{ internalType: "uint256", name: "_defaultRewardAmount", type: "uint256" }
|
|
381
|
-
],
|
|
382
|
-
name: "initialize",
|
|
383
|
-
outputs: [],
|
|
384
|
-
stateMutability: "nonpayable",
|
|
385
|
-
type: "function"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
inputs: [],
|
|
389
|
-
name: "pause",
|
|
390
|
-
outputs: [],
|
|
391
|
-
stateMutability: "nonpayable",
|
|
392
|
-
type: "function"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
inputs: [],
|
|
396
|
-
name: "paused",
|
|
397
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
398
|
-
stateMutability: "view",
|
|
399
|
-
type: "function"
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
inputs: [],
|
|
403
|
-
name: "petToken",
|
|
404
|
-
outputs: [{ internalType: "contract IPetToken", name: "", type: "address" }],
|
|
405
|
-
stateMutability: "view",
|
|
406
|
-
type: "function"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
inputs: [],
|
|
410
|
-
name: "proxiableUUID",
|
|
411
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
412
|
-
stateMutability: "view",
|
|
413
|
-
type: "function"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
inputs: [
|
|
417
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
418
|
-
{
|
|
419
|
-
internalType: "address",
|
|
420
|
-
name: "callerConfirmation",
|
|
421
|
-
type: "address"
|
|
422
|
-
}
|
|
423
|
-
],
|
|
424
|
-
name: "renounceRole",
|
|
425
|
-
outputs: [],
|
|
426
|
-
stateMutability: "nonpayable",
|
|
427
|
-
type: "function"
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
inputs: [
|
|
431
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
432
|
-
{
|
|
433
|
-
internalType: "address",
|
|
434
|
-
name: "account",
|
|
435
|
-
type: "address"
|
|
436
|
-
}
|
|
437
|
-
],
|
|
438
|
-
name: "revokeRole",
|
|
439
|
-
outputs: [],
|
|
440
|
-
stateMutability: "nonpayable",
|
|
441
|
-
type: "function"
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
inputs: [],
|
|
445
|
-
name: "rewardToken",
|
|
446
|
-
outputs: [{ internalType: "contract IERC20", name: "", type: "address" }],
|
|
447
|
-
stateMutability: "view",
|
|
448
|
-
type: "function"
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
inputs: [
|
|
452
|
-
{ internalType: "string", name: "_pid", type: "string" },
|
|
453
|
-
{
|
|
454
|
-
internalType: "string",
|
|
455
|
-
name: "_nftId",
|
|
456
|
-
type: "string"
|
|
457
|
-
},
|
|
458
|
-
{ internalType: "string", name: "_metadataURL", type: "string" },
|
|
459
|
-
{
|
|
460
|
-
internalType: "uint256",
|
|
461
|
-
name: "_campaignId",
|
|
462
|
-
type: "uint256"
|
|
463
|
-
}
|
|
464
|
-
],
|
|
465
|
-
name: "submitMetadata",
|
|
466
|
-
outputs: [],
|
|
467
|
-
stateMutability: "nonpayable",
|
|
468
|
-
type: "function"
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
inputs: [
|
|
472
|
-
{ internalType: "string", name: "_pid", type: "string" },
|
|
473
|
-
{
|
|
474
|
-
internalType: "string",
|
|
475
|
-
name: "_nftId",
|
|
476
|
-
type: "string"
|
|
477
|
-
},
|
|
478
|
-
{ internalType: "string", name: "_metadataURL", type: "string" },
|
|
479
|
-
{
|
|
480
|
-
internalType: "string",
|
|
481
|
-
name: "_campaignName",
|
|
482
|
-
type: "string"
|
|
483
|
-
}
|
|
484
|
-
],
|
|
485
|
-
name: "submitMetadataByCampaignName",
|
|
486
|
-
outputs: [],
|
|
487
|
-
stateMutability: "nonpayable",
|
|
488
|
-
type: "function"
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
|
|
492
|
-
name: "supportsInterface",
|
|
493
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
494
|
-
stateMutability: "view",
|
|
495
|
-
type: "function"
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
inputs: [],
|
|
499
|
-
name: "unpause",
|
|
500
|
-
outputs: [],
|
|
501
|
-
stateMutability: "nonpayable",
|
|
502
|
-
type: "function"
|
|
503
|
-
},
|
|
504
|
-
{
|
|
505
|
-
inputs: [
|
|
506
|
-
{
|
|
507
|
-
internalType: "uint256",
|
|
508
|
-
name: "_campaignId",
|
|
509
|
-
type: "uint256"
|
|
510
|
-
},
|
|
511
|
-
{ internalType: "uint256", name: "_rewardAmount", type: "uint256" },
|
|
512
|
-
{
|
|
513
|
-
internalType: "bool",
|
|
514
|
-
name: "_isActive",
|
|
515
|
-
type: "bool"
|
|
516
|
-
}
|
|
517
|
-
],
|
|
518
|
-
name: "updateCampaign",
|
|
519
|
-
outputs: [],
|
|
520
|
-
stateMutability: "nonpayable",
|
|
521
|
-
type: "function"
|
|
522
|
-
},
|
|
523
|
-
{
|
|
524
|
-
inputs: [{ internalType: "uint256", name: "_rewardAmount", type: "uint256" }],
|
|
525
|
-
name: "updateDefaultReward",
|
|
526
|
-
outputs: [],
|
|
527
|
-
stateMutability: "nonpayable",
|
|
528
|
-
type: "function"
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
inputs: [
|
|
532
|
-
{
|
|
533
|
-
internalType: "address",
|
|
534
|
-
name: "newImplementation",
|
|
535
|
-
type: "address"
|
|
536
|
-
},
|
|
537
|
-
{ internalType: "bytes", name: "data", type: "bytes" }
|
|
538
|
-
],
|
|
539
|
-
name: "upgradeToAndCall",
|
|
540
|
-
outputs: [],
|
|
541
|
-
stateMutability: "payable",
|
|
542
|
-
type: "function"
|
|
543
|
-
}
|
|
544
|
-
];
|
|
6
|
+
var PET_NFT_ABI = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EnforcedPause", "type": "error" }, { "inputs": [], "name": "ExpectedPause", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataApproved", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "anymalTxId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataRejected", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "metadataURL", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "MetadataSubmitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "string", "name": "pid", "type": "string" }, { "indexed": false, "internalType": "string", "name": "nftId", "type": "string" }, { "indexed": false, "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "campaignId", "type": "uint256" }, { "indexed": false, "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "RewardDistributed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "APPROVER_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "approveMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "campaignCount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "campaigns", "outputs": [{ "internalType": "string", "name": "name", "type": "string" }, { "internalType": "uint256", "name": "rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "isActive", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_name", "type": "string" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "createCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "defaultRewardAmount", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "contract IERC20", "name": "_rewardToken", "type": "address" }, { "internalType": "contract IPetToken", "name": "_petToken", "type": "address" }, { "internalType": "uint256", "name": "_defaultRewardAmount", "type": "uint256" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "pause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "paused", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "petToken", "outputs": [{ "internalType": "contract IPetToken", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "rewardToken", "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadata", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "string", "name": "_pid", "type": "string" }, { "internalType": "string", "name": "_nftId", "type": "string" }, { "internalType": "string", "name": "_metadataURL", "type": "string" }, { "internalType": "string", "name": "_campaignName", "type": "string" }, { "internalType": "string", "name": "_anymalTxId", "type": "string" }], "name": "submitMetadataByCampaignName", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "unpause", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_campaignId", "type": "uint256" }, { "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }, { "internalType": "bool", "name": "_isActive", "type": "bool" }], "name": "updateCampaign", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "_rewardAmount", "type": "uint256" }], "name": "updateDefaultReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
|
|
545
7
|
var VERIFY_ACCOUNT_ABI = [
|
|
546
8
|
{
|
|
547
9
|
inputs: [
|
|
@@ -919,6 +381,7 @@ function useFetchNotifications() {
|
|
|
919
381
|
// src/utils/anymals/useMintAnymalNFT.ts
|
|
920
382
|
import { encodeFunctionData as encodeFunctionData2, parseGwei as parseGwei2 } from "viem";
|
|
921
383
|
import { useCallback as useCallback10 } from "react";
|
|
384
|
+
import { v4 as uuidv4 } from "uuid";
|
|
922
385
|
function useMintAnymalNFT() {
|
|
923
386
|
return useCallback10(
|
|
924
387
|
async (pid, nftId, dbAuthToken, validationContractAddress, smartAccount, bundlerClient) => {
|
|
@@ -928,6 +391,7 @@ function useMintAnymalNFT() {
|
|
|
928
391
|
message: "Missing authentication token OR NFT ID."
|
|
929
392
|
};
|
|
930
393
|
}
|
|
394
|
+
const anymalTxId = uuidv4();
|
|
931
395
|
const callData = encodeFunctionData2({
|
|
932
396
|
abi: PET_NFT_ABI,
|
|
933
397
|
functionName: "submitMetadataByCampaignName",
|
|
@@ -935,7 +399,8 @@ function useMintAnymalNFT() {
|
|
|
935
399
|
pid,
|
|
936
400
|
nftId,
|
|
937
401
|
`https://dev-nft.petastic.com/metadata/${nftId}`,
|
|
938
|
-
"petastic-signup-campaign-1"
|
|
402
|
+
"petastic-signup-campaign-1",
|
|
403
|
+
anymalTxId
|
|
939
404
|
]
|
|
940
405
|
});
|
|
941
406
|
const userOpHash = await bundlerClient.sendUserOperation({
|
|
@@ -1359,10 +824,10 @@ function useApproveKibbleToken() {
|
|
|
1359
824
|
}
|
|
1360
825
|
|
|
1361
826
|
// src/helpers/NonceHelper.tsx
|
|
1362
|
-
import { v4 as
|
|
827
|
+
import { v4 as uuidv42 } from "uuid";
|
|
1363
828
|
import { padHex } from "viem";
|
|
1364
829
|
var generateBytes32Nonce = () => {
|
|
1365
|
-
const uuid2 =
|
|
830
|
+
const uuid2 = uuidv42().replace(/-/g, "");
|
|
1366
831
|
return padHex(`0x${uuid2}`, { size: 32 });
|
|
1367
832
|
};
|
|
1368
833
|
|
package/package.json
CHANGED