@net-protocol/score 0.1.0

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 ADDED
@@ -0,0 +1,2152 @@
1
+ 'use strict';
2
+
3
+ var actions = require('viem/actions');
4
+ var core = require('@net-protocol/core');
5
+ var viem = require('viem');
6
+ var storage = require('@net-protocol/storage');
7
+
8
+ // src/client/ScoreClient.ts
9
+
10
+ // src/abis/score.json
11
+ var score_default = [
12
+ {
13
+ type: "function",
14
+ name: "appKeyScores",
15
+ inputs: [
16
+ { name: "", type: "address", internalType: "address" },
17
+ { name: "", type: "bytes32", internalType: "bytes32" }
18
+ ],
19
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
20
+ stateMutability: "view"
21
+ },
22
+ {
23
+ type: "function",
24
+ name: "appStrategyKeyScores",
25
+ inputs: [
26
+ { name: "", type: "address", internalType: "address" },
27
+ { name: "", type: "address", internalType: "address" },
28
+ { name: "", type: "bytes32", internalType: "bytes32" }
29
+ ],
30
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
31
+ stateMutability: "view"
32
+ },
33
+ {
34
+ type: "function",
35
+ name: "appStrategyTotalScores",
36
+ inputs: [
37
+ { name: "", type: "address", internalType: "address" },
38
+ { name: "", type: "address", internalType: "address" }
39
+ ],
40
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
41
+ stateMutability: "view"
42
+ },
43
+ {
44
+ type: "function",
45
+ name: "appStrategyUserKeyScores",
46
+ inputs: [
47
+ { name: "", type: "address", internalType: "address" },
48
+ { name: "", type: "address", internalType: "address" },
49
+ { name: "", type: "address", internalType: "address" },
50
+ { name: "", type: "bytes32", internalType: "bytes32" }
51
+ ],
52
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
53
+ stateMutability: "view"
54
+ },
55
+ {
56
+ type: "function",
57
+ name: "appTotalScores",
58
+ inputs: [{ name: "", type: "address", internalType: "address" }],
59
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
60
+ stateMutability: "view"
61
+ },
62
+ {
63
+ type: "function",
64
+ name: "appUserKeyScores",
65
+ inputs: [
66
+ { name: "", type: "address", internalType: "address" },
67
+ { name: "", type: "address", internalType: "address" },
68
+ { name: "", type: "bytes32", internalType: "bytes32" }
69
+ ],
70
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
71
+ stateMutability: "view"
72
+ },
73
+ {
74
+ type: "function",
75
+ name: "appUserTotalScores",
76
+ inputs: [
77
+ { name: "", type: "address", internalType: "address" },
78
+ { name: "", type: "address", internalType: "address" }
79
+ ],
80
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
81
+ stateMutability: "view"
82
+ },
83
+ {
84
+ type: "function",
85
+ name: "execute",
86
+ inputs: [
87
+ {
88
+ name: "strategy",
89
+ type: "address",
90
+ internalType: "contract IScoreStrategy"
91
+ },
92
+ {
93
+ name: "params",
94
+ type: "tuple",
95
+ internalType: "struct Score.ScoreParams",
96
+ components: [
97
+ {
98
+ name: "scoreKey",
99
+ type: "bytes32",
100
+ internalType: "bytes32"
101
+ },
102
+ {
103
+ name: "scoreDelta",
104
+ type: "int256",
105
+ internalType: "int256"
106
+ },
107
+ {
108
+ name: "originalSender",
109
+ type: "address",
110
+ internalType: "address"
111
+ },
112
+ {
113
+ name: "scoreStoredContext",
114
+ type: "bytes",
115
+ internalType: "bytes"
116
+ },
117
+ {
118
+ name: "scoreUnstoredContext",
119
+ type: "bytes",
120
+ internalType: "bytes"
121
+ }
122
+ ]
123
+ }
124
+ ],
125
+ outputs: [],
126
+ stateMutability: "payable"
127
+ },
128
+ {
129
+ type: "function",
130
+ name: "getAppKeyScores",
131
+ inputs: [
132
+ { name: "app", type: "address", internalType: "address" },
133
+ {
134
+ name: "scoreKeys",
135
+ type: "bytes32[]",
136
+ internalType: "bytes32[]"
137
+ }
138
+ ],
139
+ outputs: [
140
+ { name: "counts", type: "int256[]", internalType: "int256[]" }
141
+ ],
142
+ stateMutability: "view"
143
+ },
144
+ {
145
+ type: "function",
146
+ name: "getAppStrategyKeyScores",
147
+ inputs: [
148
+ { name: "app", type: "address", internalType: "address" },
149
+ { name: "strategy", type: "address", internalType: "address" },
150
+ {
151
+ name: "scoreKeys",
152
+ type: "bytes32[]",
153
+ internalType: "bytes32[]"
154
+ }
155
+ ],
156
+ outputs: [
157
+ { name: "counts", type: "int256[]", internalType: "int256[]" }
158
+ ],
159
+ stateMutability: "view"
160
+ },
161
+ {
162
+ type: "function",
163
+ name: "getAppStrategyTotalScores",
164
+ inputs: [
165
+ { name: "apps", type: "address[]", internalType: "address[]" },
166
+ { name: "strategy", type: "address", internalType: "address" }
167
+ ],
168
+ outputs: [
169
+ { name: "totals", type: "int256[]", internalType: "int256[]" }
170
+ ],
171
+ stateMutability: "view"
172
+ },
173
+ {
174
+ type: "function",
175
+ name: "getAppStrategyUserKeyScores",
176
+ inputs: [
177
+ { name: "app", type: "address", internalType: "address" },
178
+ { name: "strategy", type: "address", internalType: "address" },
179
+ { name: "user", type: "address", internalType: "address" },
180
+ {
181
+ name: "scoreKeys",
182
+ type: "bytes32[]",
183
+ internalType: "bytes32[]"
184
+ }
185
+ ],
186
+ outputs: [
187
+ { name: "counts", type: "int256[]", internalType: "int256[]" }
188
+ ],
189
+ stateMutability: "view"
190
+ },
191
+ {
192
+ type: "function",
193
+ name: "getAppTotalScores",
194
+ inputs: [
195
+ { name: "apps", type: "address[]", internalType: "address[]" }
196
+ ],
197
+ outputs: [
198
+ { name: "totals", type: "int256[]", internalType: "int256[]" }
199
+ ],
200
+ stateMutability: "view"
201
+ },
202
+ {
203
+ type: "function",
204
+ name: "getAppUserKeyScores",
205
+ inputs: [
206
+ { name: "app", type: "address", internalType: "address" },
207
+ { name: "user", type: "address", internalType: "address" },
208
+ {
209
+ name: "scoreKeys",
210
+ type: "bytes32[]",
211
+ internalType: "bytes32[]"
212
+ }
213
+ ],
214
+ outputs: [
215
+ { name: "counts", type: "int256[]", internalType: "int256[]" }
216
+ ],
217
+ stateMutability: "view"
218
+ },
219
+ {
220
+ type: "function",
221
+ name: "getAppUserTotalScores",
222
+ inputs: [
223
+ { name: "apps", type: "address[]", internalType: "address[]" },
224
+ { name: "user", type: "address", internalType: "address" }
225
+ ],
226
+ outputs: [
227
+ { name: "totals", type: "int256[]", internalType: "int256[]" }
228
+ ],
229
+ stateMutability: "view"
230
+ },
231
+ {
232
+ type: "function",
233
+ name: "getMultiAppMultiStrategyKeyScores",
234
+ inputs: [
235
+ { name: "apps", type: "address[]", internalType: "address[]" },
236
+ {
237
+ name: "strategies",
238
+ type: "address[]",
239
+ internalType: "address[]"
240
+ },
241
+ {
242
+ name: "scoreKeys",
243
+ type: "bytes32[]",
244
+ internalType: "bytes32[]"
245
+ }
246
+ ],
247
+ outputs: [
248
+ {
249
+ name: "counts",
250
+ type: "int256[][][]",
251
+ internalType: "int256[][][]"
252
+ }
253
+ ],
254
+ stateMutability: "view"
255
+ },
256
+ {
257
+ type: "function",
258
+ name: "getMultiAppMultiUserStrategyKeyScores",
259
+ inputs: [
260
+ { name: "apps", type: "address[]", internalType: "address[]" },
261
+ { name: "strategy", type: "address", internalType: "address" },
262
+ { name: "users", type: "address[]", internalType: "address[]" },
263
+ {
264
+ name: "scoreKeys",
265
+ type: "bytes32[]",
266
+ internalType: "bytes32[]"
267
+ }
268
+ ],
269
+ outputs: [
270
+ {
271
+ name: "counts",
272
+ type: "int256[][][]",
273
+ internalType: "int256[][][]"
274
+ }
275
+ ],
276
+ stateMutability: "view"
277
+ },
278
+ {
279
+ type: "function",
280
+ name: "getMultiAppStrategyKeyScores",
281
+ inputs: [
282
+ { name: "apps", type: "address[]", internalType: "address[]" },
283
+ { name: "strategy", type: "address", internalType: "address" },
284
+ {
285
+ name: "scoreKeys",
286
+ type: "bytes32[]",
287
+ internalType: "bytes32[]"
288
+ }
289
+ ],
290
+ outputs: [
291
+ { name: "counts", type: "int256[][]", internalType: "int256[][]" }
292
+ ],
293
+ stateMutability: "view"
294
+ },
295
+ {
296
+ type: "function",
297
+ name: "getMultiAppStrategyUserKeyScores",
298
+ inputs: [
299
+ { name: "apps", type: "address[]", internalType: "address[]" },
300
+ { name: "strategy", type: "address", internalType: "address" },
301
+ { name: "user", type: "address", internalType: "address" },
302
+ {
303
+ name: "scoreKeys",
304
+ type: "bytes32[]",
305
+ internalType: "bytes32[]"
306
+ }
307
+ ],
308
+ outputs: [
309
+ { name: "counts", type: "int256[][]", internalType: "int256[][]" }
310
+ ],
311
+ stateMutability: "view"
312
+ },
313
+ {
314
+ type: "function",
315
+ name: "getMultiAppUserKeyScores",
316
+ inputs: [
317
+ { name: "apps", type: "address[]", internalType: "address[]" },
318
+ { name: "user", type: "address", internalType: "address" },
319
+ {
320
+ name: "scoreKeys",
321
+ type: "bytes32[]",
322
+ internalType: "bytes32[]"
323
+ }
324
+ ],
325
+ outputs: [
326
+ { name: "counts", type: "int256[][]", internalType: "int256[][]" }
327
+ ],
328
+ stateMutability: "view"
329
+ },
330
+ {
331
+ type: "function",
332
+ name: "getMultiStrategyKeyScores",
333
+ inputs: [
334
+ {
335
+ name: "strategies",
336
+ type: "address[]",
337
+ internalType: "address[]"
338
+ },
339
+ {
340
+ name: "scoreKeys",
341
+ type: "bytes32[]",
342
+ internalType: "bytes32[]"
343
+ }
344
+ ],
345
+ outputs: [
346
+ { name: "counts", type: "int256[]", internalType: "int256[]" }
347
+ ],
348
+ stateMutability: "view"
349
+ },
350
+ {
351
+ type: "function",
352
+ name: "getMultiStrategyUserKeyScores",
353
+ inputs: [
354
+ {
355
+ name: "strategies",
356
+ type: "address[]",
357
+ internalType: "address[]"
358
+ },
359
+ { name: "user", type: "address", internalType: "address" },
360
+ {
361
+ name: "scoreKeys",
362
+ type: "bytes32[]",
363
+ internalType: "bytes32[]"
364
+ }
365
+ ],
366
+ outputs: [
367
+ { name: "counts", type: "int256[][]", internalType: "int256[][]" }
368
+ ],
369
+ stateMutability: "view"
370
+ },
371
+ {
372
+ type: "function",
373
+ name: "getMultiUserAppStrategyKeyScores",
374
+ inputs: [
375
+ { name: "app", type: "address", internalType: "address" },
376
+ { name: "strategy", type: "address", internalType: "address" },
377
+ { name: "users", type: "address[]", internalType: "address[]" },
378
+ {
379
+ name: "scoreKeys",
380
+ type: "bytes32[]",
381
+ internalType: "bytes32[]"
382
+ }
383
+ ],
384
+ outputs: [
385
+ { name: "counts", type: "int256[][]", internalType: "int256[][]" }
386
+ ],
387
+ stateMutability: "view"
388
+ },
389
+ {
390
+ type: "function",
391
+ name: "getMultiUserStrategyKeyScores",
392
+ inputs: [
393
+ { name: "strategy", type: "address", internalType: "address" },
394
+ { name: "users", type: "address[]", internalType: "address[]" },
395
+ {
396
+ name: "scoreKeys",
397
+ type: "bytes32[]",
398
+ internalType: "bytes32[]"
399
+ }
400
+ ],
401
+ outputs: [
402
+ { name: "counts", type: "int256[][]", internalType: "int256[][]" }
403
+ ],
404
+ stateMutability: "view"
405
+ },
406
+ {
407
+ type: "function",
408
+ name: "getStrategyKeyScores",
409
+ inputs: [
410
+ { name: "strategy", type: "address", internalType: "address" },
411
+ {
412
+ name: "scoreKeys",
413
+ type: "bytes32[]",
414
+ internalType: "bytes32[]"
415
+ }
416
+ ],
417
+ outputs: [
418
+ { name: "counts", type: "int256[]", internalType: "int256[]" }
419
+ ],
420
+ stateMutability: "view"
421
+ },
422
+ {
423
+ type: "function",
424
+ name: "getStrategyTotalScores",
425
+ inputs: [
426
+ {
427
+ name: "strategies",
428
+ type: "address[]",
429
+ internalType: "address[]"
430
+ }
431
+ ],
432
+ outputs: [
433
+ { name: "totals", type: "int256[]", internalType: "int256[]" }
434
+ ],
435
+ stateMutability: "view"
436
+ },
437
+ {
438
+ type: "function",
439
+ name: "getStrategyUserKeyScores",
440
+ inputs: [
441
+ { name: "strategy", type: "address", internalType: "address" },
442
+ { name: "user", type: "address", internalType: "address" },
443
+ {
444
+ name: "scoreKeys",
445
+ type: "bytes32[]",
446
+ internalType: "bytes32[]"
447
+ }
448
+ ],
449
+ outputs: [
450
+ { name: "counts", type: "int256[]", internalType: "int256[]" }
451
+ ],
452
+ stateMutability: "view"
453
+ },
454
+ {
455
+ type: "function",
456
+ name: "getStrategyUserTotalScores",
457
+ inputs: [
458
+ {
459
+ name: "strategies",
460
+ type: "address[]",
461
+ internalType: "address[]"
462
+ },
463
+ { name: "user", type: "address", internalType: "address" }
464
+ ],
465
+ outputs: [
466
+ { name: "totals", type: "int256[]", internalType: "int256[]" }
467
+ ],
468
+ stateMutability: "view"
469
+ },
470
+ {
471
+ type: "function",
472
+ name: "strategyKeyScores",
473
+ inputs: [
474
+ { name: "", type: "address", internalType: "address" },
475
+ { name: "", type: "bytes32", internalType: "bytes32" }
476
+ ],
477
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
478
+ stateMutability: "view"
479
+ },
480
+ {
481
+ type: "function",
482
+ name: "strategyTotalScores",
483
+ inputs: [{ name: "", type: "address", internalType: "address" }],
484
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
485
+ stateMutability: "view"
486
+ },
487
+ {
488
+ type: "function",
489
+ name: "strategyUserKeyScores",
490
+ inputs: [
491
+ { name: "", type: "address", internalType: "address" },
492
+ { name: "", type: "address", internalType: "address" },
493
+ { name: "", type: "bytes32", internalType: "bytes32" }
494
+ ],
495
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
496
+ stateMutability: "view"
497
+ },
498
+ {
499
+ type: "function",
500
+ name: "strategyUserTotalScores",
501
+ inputs: [
502
+ { name: "", type: "address", internalType: "address" },
503
+ { name: "", type: "address", internalType: "address" }
504
+ ],
505
+ outputs: [{ name: "", type: "int256", internalType: "int256" }],
506
+ stateMutability: "view"
507
+ },
508
+ {
509
+ type: "function",
510
+ name: "totalCalls",
511
+ inputs: [],
512
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
513
+ stateMutability: "view"
514
+ },
515
+ {
516
+ type: "event",
517
+ name: "ScoreUpdated",
518
+ inputs: [
519
+ {
520
+ name: "user",
521
+ type: "address",
522
+ indexed: true,
523
+ internalType: "address"
524
+ },
525
+ {
526
+ name: "app",
527
+ type: "address",
528
+ indexed: true,
529
+ internalType: "address"
530
+ },
531
+ {
532
+ name: "strategy",
533
+ type: "address",
534
+ indexed: true,
535
+ internalType: "address"
536
+ },
537
+ {
538
+ name: "scoreDelta",
539
+ type: "int256",
540
+ indexed: false,
541
+ internalType: "int256"
542
+ },
543
+ {
544
+ name: "scoreKey",
545
+ type: "bytes32",
546
+ indexed: false,
547
+ internalType: "bytes32"
548
+ }
549
+ ],
550
+ anonymous: false
551
+ },
552
+ { type: "error", name: "ReentrancyGuardReentrantCall", inputs: [] },
553
+ {
554
+ type: "error",
555
+ name: "StringsInsufficientHexLength",
556
+ inputs: [
557
+ { name: "value", type: "uint256", internalType: "uint256" },
558
+ { name: "length", type: "uint256", internalType: "uint256" }
559
+ ]
560
+ },
561
+ { type: "error", name: "ZeroScoreDelta", inputs: [] }
562
+ ];
563
+
564
+ // src/abis/upvote-app.json
565
+ var upvote_app_default = [
566
+ { type: "constructor", inputs: [], stateMutability: "nonpayable" },
567
+ {
568
+ type: "function",
569
+ name: "CORE_CONTRACT",
570
+ inputs: [],
571
+ outputs: [
572
+ { name: "", type: "address", internalType: "contract Score" }
573
+ ],
574
+ stateMutability: "view"
575
+ },
576
+ {
577
+ type: "function",
578
+ name: "LEGACY_CONTRACT",
579
+ inputs: [],
580
+ outputs: [
581
+ {
582
+ name: "",
583
+ type: "address",
584
+ internalType: "contract ILegacyUpvoteContract"
585
+ }
586
+ ],
587
+ stateMutability: "view"
588
+ },
589
+ {
590
+ type: "function",
591
+ name: "getUpvotesWithLegacy",
592
+ inputs: [
593
+ {
594
+ name: "upvoteKeys",
595
+ type: "bytes32[]",
596
+ internalType: "bytes32[]"
597
+ },
598
+ {
599
+ name: "strategies",
600
+ type: "address[]",
601
+ internalType: "address[]"
602
+ }
603
+ ],
604
+ outputs: [
605
+ { name: "counts", type: "uint256[]", internalType: "uint256[]" }
606
+ ],
607
+ stateMutability: "view"
608
+ },
609
+ {
610
+ type: "function",
611
+ name: "name",
612
+ inputs: [],
613
+ outputs: [{ name: "", type: "string", internalType: "string" }],
614
+ stateMutability: "pure"
615
+ },
616
+ {
617
+ type: "function",
618
+ name: "owner",
619
+ inputs: [],
620
+ outputs: [{ name: "", type: "address", internalType: "address" }],
621
+ stateMutability: "view"
622
+ },
623
+ {
624
+ type: "function",
625
+ name: "renounceOwnership",
626
+ inputs: [],
627
+ outputs: [],
628
+ stateMutability: "nonpayable"
629
+ },
630
+ {
631
+ type: "function",
632
+ name: "transferOwnership",
633
+ inputs: [
634
+ { name: "newOwner", type: "address", internalType: "address" }
635
+ ],
636
+ outputs: [],
637
+ stateMutability: "nonpayable"
638
+ },
639
+ {
640
+ type: "function",
641
+ name: "upvote",
642
+ inputs: [
643
+ {
644
+ name: "strategy",
645
+ type: "address",
646
+ internalType: "contract IScoreStrategy"
647
+ },
648
+ { name: "scoreKey", type: "bytes32", internalType: "bytes32" },
649
+ { name: "scoreDelta", type: "uint256", internalType: "uint256" },
650
+ {
651
+ name: "scoreStoredContext",
652
+ type: "bytes",
653
+ internalType: "bytes"
654
+ },
655
+ {
656
+ name: "scoreUnstoredContext",
657
+ type: "bytes",
658
+ internalType: "bytes"
659
+ }
660
+ ],
661
+ outputs: [],
662
+ stateMutability: "payable"
663
+ },
664
+ {
665
+ type: "function",
666
+ name: "withdrawETH",
667
+ inputs: [{ name: "to", type: "address", internalType: "address" }],
668
+ outputs: [],
669
+ stateMutability: "nonpayable"
670
+ },
671
+ {
672
+ type: "function",
673
+ name: "withdrawErc20",
674
+ inputs: [
675
+ { name: "to", type: "address", internalType: "address" },
676
+ { name: "token", type: "address", internalType: "address" },
677
+ { name: "amount", type: "uint256", internalType: "uint256" }
678
+ ],
679
+ outputs: [],
680
+ stateMutability: "nonpayable"
681
+ },
682
+ {
683
+ type: "event",
684
+ name: "OwnershipTransferred",
685
+ inputs: [
686
+ {
687
+ name: "previousOwner",
688
+ type: "address",
689
+ indexed: true,
690
+ internalType: "address"
691
+ },
692
+ {
693
+ name: "newOwner",
694
+ type: "address",
695
+ indexed: true,
696
+ internalType: "address"
697
+ }
698
+ ],
699
+ anonymous: false
700
+ },
701
+ {
702
+ type: "error",
703
+ name: "OwnableInvalidOwner",
704
+ inputs: [
705
+ { name: "owner", type: "address", internalType: "address" }
706
+ ]
707
+ },
708
+ {
709
+ type: "error",
710
+ name: "OwnableUnauthorizedAccount",
711
+ inputs: [
712
+ { name: "account", type: "address", internalType: "address" }
713
+ ]
714
+ },
715
+ { type: "error", name: "WithdrawFailed", inputs: [] }
716
+ ];
717
+
718
+ // src/abis/upvote-storage-app.json
719
+ var upvote_storage_app_default = [
720
+ { type: "constructor", inputs: [], stateMutability: "nonpayable" },
721
+ {
722
+ type: "function",
723
+ name: "CORE_CONTRACT",
724
+ inputs: [],
725
+ outputs: [
726
+ { name: "", type: "address", internalType: "contract Score" }
727
+ ],
728
+ stateMutability: "view"
729
+ },
730
+ {
731
+ type: "function",
732
+ name: "name",
733
+ inputs: [],
734
+ outputs: [{ name: "", type: "string", internalType: "string" }],
735
+ stateMutability: "pure"
736
+ },
737
+ {
738
+ type: "function",
739
+ name: "owner",
740
+ inputs: [],
741
+ outputs: [{ name: "", type: "address", internalType: "address" }],
742
+ stateMutability: "view"
743
+ },
744
+ {
745
+ type: "function",
746
+ name: "renounceOwnership",
747
+ inputs: [],
748
+ outputs: [],
749
+ stateMutability: "nonpayable"
750
+ },
751
+ {
752
+ type: "function",
753
+ name: "transferOwnership",
754
+ inputs: [
755
+ { name: "newOwner", type: "address", internalType: "address" }
756
+ ],
757
+ outputs: [],
758
+ stateMutability: "nonpayable"
759
+ },
760
+ {
761
+ type: "function",
762
+ name: "upvote",
763
+ inputs: [
764
+ {
765
+ name: "strategy",
766
+ type: "address",
767
+ internalType: "contract IScoreStrategy"
768
+ },
769
+ {
770
+ name: "storageOperatorAddress",
771
+ type: "address",
772
+ internalType: "address"
773
+ },
774
+ { name: "storageKey", type: "bytes32", internalType: "bytes32" },
775
+ { name: "scoreDelta", type: "uint256", internalType: "uint256" },
776
+ {
777
+ name: "scoreUnstoredContext",
778
+ type: "bytes",
779
+ internalType: "bytes"
780
+ }
781
+ ],
782
+ outputs: [],
783
+ stateMutability: "payable"
784
+ },
785
+ {
786
+ type: "function",
787
+ name: "withdrawETH",
788
+ inputs: [{ name: "to", type: "address", internalType: "address" }],
789
+ outputs: [],
790
+ stateMutability: "nonpayable"
791
+ },
792
+ {
793
+ type: "function",
794
+ name: "withdrawErc20",
795
+ inputs: [
796
+ { name: "to", type: "address", internalType: "address" },
797
+ { name: "token", type: "address", internalType: "address" },
798
+ { name: "amount", type: "uint256", internalType: "uint256" }
799
+ ],
800
+ outputs: [],
801
+ stateMutability: "nonpayable"
802
+ },
803
+ {
804
+ type: "event",
805
+ name: "OwnershipTransferred",
806
+ inputs: [
807
+ {
808
+ name: "previousOwner",
809
+ type: "address",
810
+ indexed: true,
811
+ internalType: "address"
812
+ },
813
+ {
814
+ name: "newOwner",
815
+ type: "address",
816
+ indexed: true,
817
+ internalType: "address"
818
+ }
819
+ ],
820
+ anonymous: false
821
+ },
822
+ {
823
+ type: "error",
824
+ name: "OwnableInvalidOwner",
825
+ inputs: [
826
+ { name: "owner", type: "address", internalType: "address" }
827
+ ]
828
+ },
829
+ {
830
+ type: "error",
831
+ name: "OwnableUnauthorizedAccount",
832
+ inputs: [
833
+ { name: "account", type: "address", internalType: "address" }
834
+ ]
835
+ },
836
+ { type: "error", name: "WithdrawFailed", inputs: [] }
837
+ ];
838
+
839
+ // src/abis/pure-alpha-strategy.json
840
+ var pure_alpha_strategy_default = [
841
+ { type: "constructor", inputs: [], stateMutability: "nonpayable" },
842
+ { type: "receive", stateMutability: "payable" },
843
+ {
844
+ type: "function",
845
+ name: "executeScoreStrategy",
846
+ inputs: [
847
+ {
848
+ name: "params",
849
+ type: "tuple",
850
+ internalType: "struct IScoreStrategy.ScoreStrategyParams",
851
+ components: [
852
+ {
853
+ name: "scoreKey",
854
+ type: "bytes32",
855
+ internalType: "bytes32"
856
+ },
857
+ {
858
+ name: "scoreDelta",
859
+ type: "int256",
860
+ internalType: "int256"
861
+ },
862
+ {
863
+ name: "originalSender",
864
+ type: "address",
865
+ internalType: "address"
866
+ },
867
+ {
868
+ name: "appAddress",
869
+ type: "address",
870
+ internalType: "address"
871
+ },
872
+ {
873
+ name: "scoreStoredContext",
874
+ type: "bytes",
875
+ internalType: "bytes"
876
+ },
877
+ {
878
+ name: "scoreUnstoredContext",
879
+ type: "bytes",
880
+ internalType: "bytes"
881
+ }
882
+ ]
883
+ }
884
+ ],
885
+ outputs: [
886
+ { name: "metadata", type: "bytes", internalType: "bytes" }
887
+ ],
888
+ stateMutability: "payable"
889
+ },
890
+ {
891
+ type: "function",
892
+ name: "feeBps",
893
+ inputs: [],
894
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
895
+ stateMutability: "view"
896
+ },
897
+ {
898
+ type: "function",
899
+ name: "owner",
900
+ inputs: [],
901
+ outputs: [{ name: "", type: "address", internalType: "address" }],
902
+ stateMutability: "view"
903
+ },
904
+ {
905
+ type: "function",
906
+ name: "renounceOwnership",
907
+ inputs: [],
908
+ outputs: [],
909
+ stateMutability: "nonpayable"
910
+ },
911
+ {
912
+ type: "function",
913
+ name: "setFeeBps",
914
+ inputs: [
915
+ { name: "newFeeBps", type: "uint256", internalType: "uint256" }
916
+ ],
917
+ outputs: [],
918
+ stateMutability: "nonpayable"
919
+ },
920
+ {
921
+ type: "function",
922
+ name: "setUpvotePrice",
923
+ inputs: [
924
+ {
925
+ name: "newUpvotePrice",
926
+ type: "uint256",
927
+ internalType: "uint256"
928
+ }
929
+ ],
930
+ outputs: [],
931
+ stateMutability: "nonpayable"
932
+ },
933
+ {
934
+ type: "function",
935
+ name: "transferOwnership",
936
+ inputs: [
937
+ { name: "newOwner", type: "address", internalType: "address" }
938
+ ],
939
+ outputs: [],
940
+ stateMutability: "nonpayable"
941
+ },
942
+ {
943
+ type: "function",
944
+ name: "upvotePrice",
945
+ inputs: [],
946
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
947
+ stateMutability: "view"
948
+ },
949
+ {
950
+ type: "function",
951
+ name: "withdrawETH",
952
+ inputs: [{ name: "to", type: "address", internalType: "address" }],
953
+ outputs: [],
954
+ stateMutability: "nonpayable"
955
+ },
956
+ {
957
+ type: "function",
958
+ name: "withdrawErc20",
959
+ inputs: [
960
+ { name: "to", type: "address", internalType: "address" },
961
+ { name: "token", type: "address", internalType: "address" },
962
+ { name: "amount", type: "uint256", internalType: "uint256" }
963
+ ],
964
+ outputs: [],
965
+ stateMutability: "nonpayable"
966
+ },
967
+ {
968
+ type: "event",
969
+ name: "OwnershipTransferred",
970
+ inputs: [
971
+ {
972
+ name: "previousOwner",
973
+ type: "address",
974
+ indexed: true,
975
+ internalType: "address"
976
+ },
977
+ {
978
+ name: "newOwner",
979
+ type: "address",
980
+ indexed: true,
981
+ internalType: "address"
982
+ }
983
+ ],
984
+ anonymous: false
985
+ },
986
+ {
987
+ type: "error",
988
+ name: "IncorrectEthAmount",
989
+ inputs: [
990
+ { name: "sent", type: "uint256", internalType: "uint256" },
991
+ { name: "expected", type: "uint256", internalType: "uint256" }
992
+ ]
993
+ },
994
+ { type: "error", name: "NegativeUpvotesNotSupported", inputs: [] },
995
+ { type: "error", name: "NoTokensToWithdraw", inputs: [] },
996
+ {
997
+ type: "error",
998
+ name: "OwnableInvalidOwner",
999
+ inputs: [
1000
+ { name: "owner", type: "address", internalType: "address" }
1001
+ ]
1002
+ },
1003
+ {
1004
+ type: "error",
1005
+ name: "OwnableUnauthorizedAccount",
1006
+ inputs: [
1007
+ { name: "account", type: "address", internalType: "address" }
1008
+ ]
1009
+ },
1010
+ { type: "error", name: "ReentrancyGuardReentrantCall", inputs: [] },
1011
+ {
1012
+ type: "error",
1013
+ name: "Slot0ReadFailed",
1014
+ inputs: [{ name: "pool", type: "address", internalType: "address" }]
1015
+ },
1016
+ {
1017
+ type: "error",
1018
+ name: "UnauthorizedCaller",
1019
+ inputs: [
1020
+ { name: "caller", type: "address", internalType: "address" },
1021
+ { name: "expected", type: "address", internalType: "address" }
1022
+ ]
1023
+ },
1024
+ { type: "error", name: "WithdrawFailed", inputs: [] }
1025
+ ];
1026
+
1027
+ // src/abis/univ234-pools-strategy.json
1028
+ var univ234_pools_strategy_default = [
1029
+ { type: "constructor", inputs: [], stateMutability: "nonpayable" },
1030
+ { type: "receive", stateMutability: "payable" },
1031
+ {
1032
+ type: "function",
1033
+ name: "executeScoreStrategy",
1034
+ inputs: [
1035
+ {
1036
+ name: "params",
1037
+ type: "tuple",
1038
+ internalType: "struct IScoreStrategy.ScoreStrategyParams",
1039
+ components: [
1040
+ {
1041
+ name: "scoreKey",
1042
+ type: "bytes32",
1043
+ internalType: "bytes32"
1044
+ },
1045
+ {
1046
+ name: "scoreDelta",
1047
+ type: "int256",
1048
+ internalType: "int256"
1049
+ },
1050
+ {
1051
+ name: "originalSender",
1052
+ type: "address",
1053
+ internalType: "address"
1054
+ },
1055
+ {
1056
+ name: "appAddress",
1057
+ type: "address",
1058
+ internalType: "address"
1059
+ },
1060
+ {
1061
+ name: "scoreStoredContext",
1062
+ type: "bytes",
1063
+ internalType: "bytes"
1064
+ },
1065
+ {
1066
+ name: "scoreUnstoredContext",
1067
+ type: "bytes",
1068
+ internalType: "bytes"
1069
+ }
1070
+ ]
1071
+ }
1072
+ ],
1073
+ outputs: [
1074
+ { name: "metadata", type: "bytes", internalType: "bytes" }
1075
+ ],
1076
+ stateMutability: "payable"
1077
+ },
1078
+ {
1079
+ type: "function",
1080
+ name: "feeBps",
1081
+ inputs: [],
1082
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
1083
+ stateMutability: "view"
1084
+ },
1085
+ {
1086
+ type: "function",
1087
+ name: "owner",
1088
+ inputs: [],
1089
+ outputs: [{ name: "", type: "address", internalType: "address" }],
1090
+ stateMutability: "view"
1091
+ },
1092
+ {
1093
+ type: "function",
1094
+ name: "renounceOwnership",
1095
+ inputs: [],
1096
+ outputs: [],
1097
+ stateMutability: "nonpayable"
1098
+ },
1099
+ {
1100
+ type: "function",
1101
+ name: "setFeeBps",
1102
+ inputs: [
1103
+ { name: "newFeeBps", type: "uint256", internalType: "uint256" }
1104
+ ],
1105
+ outputs: [],
1106
+ stateMutability: "nonpayable"
1107
+ },
1108
+ {
1109
+ type: "function",
1110
+ name: "setUpvotePrice",
1111
+ inputs: [
1112
+ {
1113
+ name: "newUpvotePrice",
1114
+ type: "uint256",
1115
+ internalType: "uint256"
1116
+ }
1117
+ ],
1118
+ outputs: [],
1119
+ stateMutability: "nonpayable"
1120
+ },
1121
+ {
1122
+ type: "function",
1123
+ name: "transferOwnership",
1124
+ inputs: [
1125
+ { name: "newOwner", type: "address", internalType: "address" }
1126
+ ],
1127
+ outputs: [],
1128
+ stateMutability: "nonpayable"
1129
+ },
1130
+ {
1131
+ type: "function",
1132
+ name: "upvotePrice",
1133
+ inputs: [],
1134
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
1135
+ stateMutability: "view"
1136
+ },
1137
+ {
1138
+ type: "function",
1139
+ name: "withdrawETH",
1140
+ inputs: [{ name: "to", type: "address", internalType: "address" }],
1141
+ outputs: [],
1142
+ stateMutability: "nonpayable"
1143
+ },
1144
+ {
1145
+ type: "function",
1146
+ name: "withdrawErc20",
1147
+ inputs: [
1148
+ { name: "to", type: "address", internalType: "address" },
1149
+ { name: "token", type: "address", internalType: "address" },
1150
+ { name: "amount", type: "uint256", internalType: "uint256" }
1151
+ ],
1152
+ outputs: [],
1153
+ stateMutability: "nonpayable"
1154
+ },
1155
+ {
1156
+ type: "event",
1157
+ name: "OwnershipTransferred",
1158
+ inputs: [
1159
+ {
1160
+ name: "previousOwner",
1161
+ type: "address",
1162
+ indexed: true,
1163
+ internalType: "address"
1164
+ },
1165
+ {
1166
+ name: "newOwner",
1167
+ type: "address",
1168
+ indexed: true,
1169
+ internalType: "address"
1170
+ }
1171
+ ],
1172
+ anonymous: false
1173
+ },
1174
+ {
1175
+ type: "error",
1176
+ name: "IncorrectEthAmount",
1177
+ inputs: [
1178
+ { name: "sent", type: "uint256", internalType: "uint256" },
1179
+ { name: "expected", type: "uint256", internalType: "uint256" }
1180
+ ]
1181
+ },
1182
+ {
1183
+ type: "error",
1184
+ name: "InvalidPoolKeyForRouting",
1185
+ inputs: [
1186
+ { name: "fee", type: "uint24", internalType: "uint24" },
1187
+ { name: "tickSpacing", type: "int24", internalType: "int24" },
1188
+ { name: "hooks", type: "address", internalType: "address" }
1189
+ ]
1190
+ },
1191
+ {
1192
+ type: "error",
1193
+ name: "InvalidTokenPair",
1194
+ inputs: [
1195
+ { name: "tokenIn", type: "address", internalType: "address" },
1196
+ { name: "tokenOut", type: "address", internalType: "address" }
1197
+ ]
1198
+ },
1199
+ { type: "error", name: "NegativeUpvotesNotSupported", inputs: [] },
1200
+ { type: "error", name: "NoTokensToWithdraw", inputs: [] },
1201
+ {
1202
+ type: "error",
1203
+ name: "OwnableInvalidOwner",
1204
+ inputs: [
1205
+ { name: "owner", type: "address", internalType: "address" }
1206
+ ]
1207
+ },
1208
+ {
1209
+ type: "error",
1210
+ name: "OwnableUnauthorizedAccount",
1211
+ inputs: [
1212
+ { name: "account", type: "address", internalType: "address" }
1213
+ ]
1214
+ },
1215
+ {
1216
+ type: "error",
1217
+ name: "PoolNotFound",
1218
+ inputs: [
1219
+ { name: "tokenA", type: "address", internalType: "address" },
1220
+ { name: "tokenB", type: "address", internalType: "address" },
1221
+ { name: "feeTier", type: "uint24", internalType: "uint24" }
1222
+ ]
1223
+ },
1224
+ { type: "error", name: "ReentrancyGuardReentrantCall", inputs: [] },
1225
+ {
1226
+ type: "error",
1227
+ name: "Slot0ReadFailed",
1228
+ inputs: [{ name: "pool", type: "address", internalType: "address" }]
1229
+ },
1230
+ {
1231
+ type: "error",
1232
+ name: "StringsInsufficientHexLength",
1233
+ inputs: [
1234
+ { name: "value", type: "uint256", internalType: "uint256" },
1235
+ { name: "length", type: "uint256", internalType: "uint256" }
1236
+ ]
1237
+ },
1238
+ {
1239
+ type: "error",
1240
+ name: "UnauthorizedCaller",
1241
+ inputs: [
1242
+ { name: "caller", type: "address", internalType: "address" },
1243
+ { name: "expected", type: "address", internalType: "address" }
1244
+ ]
1245
+ },
1246
+ { type: "error", name: "WithdrawFailed", inputs: [] }
1247
+ ];
1248
+
1249
+ // src/abis/dynamic-split-strategy.json
1250
+ var dynamic_split_strategy_default = [
1251
+ {
1252
+ type: "constructor",
1253
+ inputs: [],
1254
+ stateMutability: "nonpayable"
1255
+ },
1256
+ {
1257
+ type: "receive",
1258
+ stateMutability: "payable"
1259
+ },
1260
+ {
1261
+ type: "function",
1262
+ name: "executeScoreStrategy",
1263
+ inputs: [
1264
+ {
1265
+ name: "params",
1266
+ type: "tuple",
1267
+ internalType: "struct IScoreStrategy.ScoreStrategyParams",
1268
+ components: [
1269
+ {
1270
+ name: "scoreKey",
1271
+ type: "bytes32",
1272
+ internalType: "bytes32"
1273
+ },
1274
+ {
1275
+ name: "scoreDelta",
1276
+ type: "int256",
1277
+ internalType: "int256"
1278
+ },
1279
+ {
1280
+ name: "originalSender",
1281
+ type: "address",
1282
+ internalType: "address"
1283
+ },
1284
+ {
1285
+ name: "appAddress",
1286
+ type: "address",
1287
+ internalType: "address"
1288
+ },
1289
+ {
1290
+ name: "scoreStoredContext",
1291
+ type: "bytes",
1292
+ internalType: "bytes"
1293
+ },
1294
+ {
1295
+ name: "scoreUnstoredContext",
1296
+ type: "bytes",
1297
+ internalType: "bytes"
1298
+ }
1299
+ ]
1300
+ }
1301
+ ],
1302
+ outputs: [
1303
+ {
1304
+ name: "metadata",
1305
+ type: "bytes",
1306
+ internalType: "bytes"
1307
+ }
1308
+ ],
1309
+ stateMutability: "payable"
1310
+ },
1311
+ {
1312
+ type: "function",
1313
+ name: "feeBps",
1314
+ inputs: [],
1315
+ outputs: [
1316
+ {
1317
+ name: "",
1318
+ type: "uint256",
1319
+ internalType: "uint256"
1320
+ }
1321
+ ],
1322
+ stateMutability: "view"
1323
+ },
1324
+ {
1325
+ type: "function",
1326
+ name: "owner",
1327
+ inputs: [],
1328
+ outputs: [
1329
+ {
1330
+ name: "",
1331
+ type: "address",
1332
+ internalType: "address"
1333
+ }
1334
+ ],
1335
+ stateMutability: "view"
1336
+ },
1337
+ {
1338
+ type: "function",
1339
+ name: "renounceOwnership",
1340
+ inputs: [],
1341
+ outputs: [],
1342
+ stateMutability: "nonpayable"
1343
+ },
1344
+ {
1345
+ type: "function",
1346
+ name: "setFeeBps",
1347
+ inputs: [
1348
+ {
1349
+ name: "newFeeBps",
1350
+ type: "uint256",
1351
+ internalType: "uint256"
1352
+ }
1353
+ ],
1354
+ outputs: [],
1355
+ stateMutability: "nonpayable"
1356
+ },
1357
+ {
1358
+ type: "function",
1359
+ name: "setTokenSplitBps",
1360
+ inputs: [
1361
+ {
1362
+ name: "newTokenSplitBps",
1363
+ type: "uint256",
1364
+ internalType: "uint256"
1365
+ }
1366
+ ],
1367
+ outputs: [],
1368
+ stateMutability: "nonpayable"
1369
+ },
1370
+ {
1371
+ type: "function",
1372
+ name: "setUpvotePrice",
1373
+ inputs: [
1374
+ {
1375
+ name: "newUpvotePrice",
1376
+ type: "uint256",
1377
+ internalType: "uint256"
1378
+ }
1379
+ ],
1380
+ outputs: [],
1381
+ stateMutability: "nonpayable"
1382
+ },
1383
+ {
1384
+ type: "function",
1385
+ name: "tokenSplitBps",
1386
+ inputs: [],
1387
+ outputs: [
1388
+ {
1389
+ name: "",
1390
+ type: "uint256",
1391
+ internalType: "uint256"
1392
+ }
1393
+ ],
1394
+ stateMutability: "view"
1395
+ },
1396
+ {
1397
+ type: "function",
1398
+ name: "transferOwnership",
1399
+ inputs: [
1400
+ {
1401
+ name: "newOwner",
1402
+ type: "address",
1403
+ internalType: "address"
1404
+ }
1405
+ ],
1406
+ outputs: [],
1407
+ stateMutability: "nonpayable"
1408
+ },
1409
+ {
1410
+ type: "function",
1411
+ name: "upvotePrice",
1412
+ inputs: [],
1413
+ outputs: [
1414
+ {
1415
+ name: "",
1416
+ type: "uint256",
1417
+ internalType: "uint256"
1418
+ }
1419
+ ],
1420
+ stateMutability: "view"
1421
+ },
1422
+ {
1423
+ type: "function",
1424
+ name: "withdrawETH",
1425
+ inputs: [
1426
+ {
1427
+ name: "to",
1428
+ type: "address",
1429
+ internalType: "address"
1430
+ }
1431
+ ],
1432
+ outputs: [],
1433
+ stateMutability: "nonpayable"
1434
+ },
1435
+ {
1436
+ type: "function",
1437
+ name: "withdrawErc20",
1438
+ inputs: [
1439
+ {
1440
+ name: "to",
1441
+ type: "address",
1442
+ internalType: "address"
1443
+ },
1444
+ {
1445
+ name: "token",
1446
+ type: "address",
1447
+ internalType: "address"
1448
+ },
1449
+ {
1450
+ name: "amount",
1451
+ type: "uint256",
1452
+ internalType: "uint256"
1453
+ }
1454
+ ],
1455
+ outputs: [],
1456
+ stateMutability: "nonpayable"
1457
+ },
1458
+ {
1459
+ type: "event",
1460
+ name: "OwnershipTransferred",
1461
+ inputs: [
1462
+ {
1463
+ name: "previousOwner",
1464
+ type: "address",
1465
+ indexed: true,
1466
+ internalType: "address"
1467
+ },
1468
+ {
1469
+ name: "newOwner",
1470
+ type: "address",
1471
+ indexed: true,
1472
+ internalType: "address"
1473
+ }
1474
+ ],
1475
+ anonymous: false
1476
+ },
1477
+ {
1478
+ type: "error",
1479
+ name: "IncorrectEthAmount",
1480
+ inputs: [
1481
+ {
1482
+ name: "sent",
1483
+ type: "uint256",
1484
+ internalType: "uint256"
1485
+ },
1486
+ {
1487
+ name: "expected",
1488
+ type: "uint256",
1489
+ internalType: "uint256"
1490
+ }
1491
+ ]
1492
+ },
1493
+ {
1494
+ type: "error",
1495
+ name: "InvalidFeeBps",
1496
+ inputs: [
1497
+ {
1498
+ name: "bps",
1499
+ type: "uint256",
1500
+ internalType: "uint256"
1501
+ }
1502
+ ]
1503
+ },
1504
+ {
1505
+ type: "error",
1506
+ name: "InvalidPoolKeyForRouting",
1507
+ inputs: [
1508
+ {
1509
+ name: "fee",
1510
+ type: "uint24",
1511
+ internalType: "uint24"
1512
+ },
1513
+ {
1514
+ name: "tickSpacing",
1515
+ type: "int24",
1516
+ internalType: "int24"
1517
+ },
1518
+ {
1519
+ name: "hooks",
1520
+ type: "address",
1521
+ internalType: "address"
1522
+ }
1523
+ ]
1524
+ },
1525
+ {
1526
+ type: "error",
1527
+ name: "InvalidTokenPair",
1528
+ inputs: [
1529
+ {
1530
+ name: "tokenIn",
1531
+ type: "address",
1532
+ internalType: "address"
1533
+ },
1534
+ {
1535
+ name: "tokenOut",
1536
+ type: "address",
1537
+ internalType: "address"
1538
+ }
1539
+ ]
1540
+ },
1541
+ {
1542
+ type: "error",
1543
+ name: "InvalidTokenSplitBps",
1544
+ inputs: [
1545
+ {
1546
+ name: "bps",
1547
+ type: "uint256",
1548
+ internalType: "uint256"
1549
+ }
1550
+ ]
1551
+ },
1552
+ {
1553
+ type: "error",
1554
+ name: "NegativeUpvotesNotSupported",
1555
+ inputs: []
1556
+ },
1557
+ {
1558
+ type: "error",
1559
+ name: "NoTokensToWithdraw",
1560
+ inputs: []
1561
+ },
1562
+ {
1563
+ type: "error",
1564
+ name: "OwnableInvalidOwner",
1565
+ inputs: [
1566
+ {
1567
+ name: "owner",
1568
+ type: "address",
1569
+ internalType: "address"
1570
+ }
1571
+ ]
1572
+ },
1573
+ {
1574
+ type: "error",
1575
+ name: "OwnableUnauthorizedAccount",
1576
+ inputs: [
1577
+ {
1578
+ name: "account",
1579
+ type: "address",
1580
+ internalType: "address"
1581
+ }
1582
+ ]
1583
+ },
1584
+ {
1585
+ type: "error",
1586
+ name: "PoolNotFound",
1587
+ inputs: [
1588
+ {
1589
+ name: "tokenA",
1590
+ type: "address",
1591
+ internalType: "address"
1592
+ },
1593
+ {
1594
+ name: "tokenB",
1595
+ type: "address",
1596
+ internalType: "address"
1597
+ },
1598
+ {
1599
+ name: "feeTier",
1600
+ type: "uint24",
1601
+ internalType: "uint24"
1602
+ }
1603
+ ]
1604
+ },
1605
+ {
1606
+ type: "error",
1607
+ name: "ReentrancyGuardReentrantCall",
1608
+ inputs: []
1609
+ },
1610
+ {
1611
+ type: "error",
1612
+ name: "Slot0ReadFailed",
1613
+ inputs: [
1614
+ {
1615
+ name: "pool",
1616
+ type: "address",
1617
+ internalType: "address"
1618
+ }
1619
+ ]
1620
+ },
1621
+ {
1622
+ type: "error",
1623
+ name: "StringsInsufficientHexLength",
1624
+ inputs: [
1625
+ {
1626
+ name: "value",
1627
+ type: "uint256",
1628
+ internalType: "uint256"
1629
+ },
1630
+ {
1631
+ name: "length",
1632
+ type: "uint256",
1633
+ internalType: "uint256"
1634
+ }
1635
+ ]
1636
+ },
1637
+ {
1638
+ type: "error",
1639
+ name: "UnauthorizedCaller",
1640
+ inputs: [
1641
+ {
1642
+ name: "caller",
1643
+ type: "address",
1644
+ internalType: "address"
1645
+ },
1646
+ {
1647
+ name: "expected",
1648
+ type: "address",
1649
+ internalType: "address"
1650
+ }
1651
+ ]
1652
+ },
1653
+ {
1654
+ type: "error",
1655
+ name: "WithdrawFailed",
1656
+ inputs: []
1657
+ }
1658
+ ];
1659
+
1660
+ // src/constants.ts
1661
+ var SCORE_CONTRACT = {
1662
+ address: "0x0000000fa09b022e5616e5a173b4b67fa2fbcf28",
1663
+ abi: score_default
1664
+ };
1665
+ var UPVOTE_APP = {
1666
+ address: "0x00000001f0b8173316a016a5067ad74e8cea47bf",
1667
+ abi: upvote_app_default
1668
+ };
1669
+ var UPVOTE_STORAGE_APP = {
1670
+ address: "0x000000060CEB69D023227DF64CfB75eC37c75B62",
1671
+ abi: upvote_storage_app_default
1672
+ };
1673
+ var PURE_ALPHA_STRATEGY = {
1674
+ address: "0x00000001b1bcdeddeafd5296aaf4f3f3e21ae876",
1675
+ abi: pure_alpha_strategy_default
1676
+ };
1677
+ var UNIV234_POOLS_STRATEGY = {
1678
+ address: "0x000000063f84e07a3e7a7ee578b42704ee6d22c9",
1679
+ abi: univ234_pools_strategy_default
1680
+ };
1681
+ var DYNAMIC_SPLIT_STRATEGY = {
1682
+ address: "0x0000000869160f0b2a213adefb46a7ea7e62ac7a",
1683
+ abi: dynamic_split_strategy_default
1684
+ };
1685
+ var ALL_STRATEGY_ADDRESSES = [
1686
+ UNIV234_POOLS_STRATEGY.address,
1687
+ PURE_ALPHA_STRATEGY.address,
1688
+ DYNAMIC_SPLIT_STRATEGY.address
1689
+ ];
1690
+ var LEGACY_UPVOTE_V1_ADDRESS = "0x0ada882dbbdc12388a1f9ca85d2d847088f747df";
1691
+ var LEGACY_UPVOTE_V2_ADDRESS = "0x9027dcad0a3dca5835895e14fbc022a1e5ea909b";
1692
+ var SUPPORTED_SCORE_CHAINS = [8453];
1693
+ var encodeUpvoteKey = (tokenAddress) => {
1694
+ return `0x${BigInt(`0x${tokenAddress.slice(2)}`).toString(16).padStart(64, "0")}`;
1695
+ };
1696
+ function tokenAddressToUpvoteKeyString(tokenAddress) {
1697
+ const lower = tokenAddress.toLowerCase();
1698
+ const withoutPrefix = lower.slice(2);
1699
+ const stripped = withoutPrefix.replace(/^0+/, "") || "0";
1700
+ return "0x" + stripped;
1701
+ }
1702
+ function isStrategyMessage(topic) {
1703
+ return topic.startsWith("s") && topic.length > 43;
1704
+ }
1705
+ function isUserUpvoteMessage(topic) {
1706
+ return topic.startsWith("t");
1707
+ }
1708
+ function extractStrategyAddress(topic) {
1709
+ try {
1710
+ if (topic.startsWith("t")) {
1711
+ return topic.slice(1);
1712
+ }
1713
+ if (topic.startsWith("s")) {
1714
+ return topic.slice(1, 43);
1715
+ }
1716
+ if (topic.startsWith("t-")) {
1717
+ return topic.slice(2);
1718
+ }
1719
+ const parts = topic.split("-");
1720
+ if (parts.length >= 2) {
1721
+ return parts[0];
1722
+ }
1723
+ return "";
1724
+ } catch {
1725
+ return "";
1726
+ }
1727
+ }
1728
+ function isPureAlphaStrategy(strategyAddress) {
1729
+ return strategyAddress.toLowerCase() === PURE_ALPHA_STRATEGY.address.toLowerCase();
1730
+ }
1731
+ function isUniv234PoolsStrategy(strategyAddress) {
1732
+ return strategyAddress.toLowerCase() === UNIV234_POOLS_STRATEGY.address.toLowerCase();
1733
+ }
1734
+ function isDynamicSplitStrategy(strategyAddress) {
1735
+ return strategyAddress.toLowerCase() === DYNAMIC_SPLIT_STRATEGY.address.toLowerCase();
1736
+ }
1737
+ var decodeStrategyMetadata = (metadata, strategyAddress) => {
1738
+ try {
1739
+ if (isPureAlphaStrategy(strategyAddress)) {
1740
+ const [alphaAmount, alphaWethPrice, wethUsdcPrice, userAlphaBalance] = viem.decodeAbiParameters(
1741
+ [
1742
+ { type: "uint256" },
1743
+ { type: "uint256" },
1744
+ { type: "uint256" },
1745
+ { type: "uint256" }
1746
+ ],
1747
+ metadata
1748
+ );
1749
+ return {
1750
+ alphaAmount,
1751
+ alphaWethPrice,
1752
+ wethUsdcPrice,
1753
+ userAlphaBalance
1754
+ };
1755
+ } else if (isUniv234PoolsStrategy(strategyAddress) || isDynamicSplitStrategy(strategyAddress)) {
1756
+ const [
1757
+ tokenAmount,
1758
+ tokenWethPrice,
1759
+ wethUsdcPrice,
1760
+ alphaWethPrice,
1761
+ userTokenBalance
1762
+ ] = viem.decodeAbiParameters(
1763
+ [
1764
+ { type: "uint256" },
1765
+ { type: "uint256" },
1766
+ { type: "uint256" },
1767
+ { type: "uint256" },
1768
+ { type: "uint256" }
1769
+ ],
1770
+ metadata
1771
+ );
1772
+ return {
1773
+ tokenAmount,
1774
+ tokenWethPrice,
1775
+ wethUsdcPrice,
1776
+ alphaWethPrice,
1777
+ userTokenBalance
1778
+ };
1779
+ } else {
1780
+ return null;
1781
+ }
1782
+ } catch {
1783
+ return null;
1784
+ }
1785
+ };
1786
+ var decodeUpvoteStorageBlob = (value) => {
1787
+ try {
1788
+ const [
1789
+ scoreKey,
1790
+ scoreDelta,
1791
+ originalSender,
1792
+ appAddress,
1793
+ strategyAddress,
1794
+ timestamp,
1795
+ scoreStoredContext,
1796
+ scoreUnstoredContext,
1797
+ metadata
1798
+ ] = viem.decodeAbiParameters(
1799
+ [
1800
+ { type: "bytes32" },
1801
+ { type: "int256" },
1802
+ { type: "address" },
1803
+ { type: "address" },
1804
+ { type: "address" },
1805
+ { type: "uint256" },
1806
+ { type: "bytes" },
1807
+ { type: "bytes" },
1808
+ { type: "bytes" }
1809
+ ],
1810
+ value
1811
+ );
1812
+ const decodedMetadata = decodeStrategyMetadata(
1813
+ metadata,
1814
+ strategyAddress
1815
+ );
1816
+ return {
1817
+ scoreKey,
1818
+ scoreDelta: Number(scoreDelta),
1819
+ originalSender,
1820
+ appAddress,
1821
+ strategyAddress,
1822
+ timestamp: Number(timestamp),
1823
+ scoreStoredContext,
1824
+ scoreUnstoredContext,
1825
+ decodedMetadata
1826
+ };
1827
+ } catch {
1828
+ return null;
1829
+ }
1830
+ };
1831
+ var selectStrategy = (poolKey) => {
1832
+ if (!poolKey || !isValidPoolKey(poolKey)) {
1833
+ return PURE_ALPHA_STRATEGY.address;
1834
+ }
1835
+ return DYNAMIC_SPLIT_STRATEGY.address;
1836
+ };
1837
+ function isValidPoolKey(poolKey) {
1838
+ return poolKey.fee !== void 0 || poolKey.tickSpacing !== void 0 || poolKey.currency0 !== void 0;
1839
+ }
1840
+ function decodeUpvoteMessage(msg) {
1841
+ try {
1842
+ if (msg.topic === "t") {
1843
+ if (!msg.data || msg.data === "0x" || msg.data.length < 32) {
1844
+ return null;
1845
+ }
1846
+ try {
1847
+ const [
1848
+ numUpvotesDecoded,
1849
+ tokenWethPrice,
1850
+ wethUsdcPrice,
1851
+ alphaWethPrice,
1852
+ userTokenBalance
1853
+ ] = viem.decodeAbiParameters(
1854
+ [
1855
+ { type: "uint256" },
1856
+ { type: "uint256" },
1857
+ { type: "uint256" },
1858
+ { type: "uint256" },
1859
+ { type: "uint256" }
1860
+ ],
1861
+ msg.data
1862
+ );
1863
+ return {
1864
+ scoreDelta: Number(numUpvotesDecoded),
1865
+ tokenWethPrice: Number(tokenWethPrice),
1866
+ wethUsdcPrice: Number(wethUsdcPrice),
1867
+ alphaWethPrice: Number(alphaWethPrice),
1868
+ userTokenBalance: Number(userTokenBalance),
1869
+ tokenAddress: msg.text,
1870
+ messageType: "legacy"
1871
+ };
1872
+ } catch {
1873
+ return null;
1874
+ }
1875
+ } else if (msg.topic.startsWith("0x") && msg.topic.length === 42 || msg.topic.startsWith("p-")) {
1876
+ const [
1877
+ numUpvotesDecoded,
1878
+ tokenWethPrice,
1879
+ wethUsdcPrice,
1880
+ alphaWethPrice,
1881
+ userTokenBalance
1882
+ ] = viem.decodeAbiParameters(
1883
+ [
1884
+ { type: "uint256" },
1885
+ { type: "uint256" },
1886
+ { type: "uint256" },
1887
+ { type: "uint256" },
1888
+ { type: "uint256" }
1889
+ ],
1890
+ msg.data
1891
+ );
1892
+ return {
1893
+ scoreDelta: Number(numUpvotesDecoded),
1894
+ tokenWethPrice: Number(tokenWethPrice),
1895
+ wethUsdcPrice: Number(wethUsdcPrice),
1896
+ alphaWethPrice: Number(alphaWethPrice),
1897
+ userTokenBalance: Number(userTokenBalance),
1898
+ tokenAddress: msg.topic,
1899
+ messageType: "legacy"
1900
+ };
1901
+ } else if (msg.topic.startsWith("app-") && msg.topic.endsWith("-first")) {
1902
+ const topicParts = msg.topic.split("-");
1903
+ if (topicParts.length === 3) {
1904
+ return {
1905
+ appAddress: topicParts[1],
1906
+ messageType: "app-first"
1907
+ };
1908
+ } else if (topicParts.length === 5 && topicParts[2] === "strategy") {
1909
+ return {
1910
+ appAddress: topicParts[1],
1911
+ strategyAddress: topicParts[3],
1912
+ messageType: "app-strategy-first"
1913
+ };
1914
+ } else if (topicParts.length === 5 && topicParts[2] === "user") {
1915
+ return {
1916
+ appAddress: topicParts[1],
1917
+ userAddress: topicParts[3],
1918
+ tokenAddress: msg.text,
1919
+ messageType: "app-user-first"
1920
+ };
1921
+ } else if (topicParts.length === 7 && topicParts[2] === "strategy" && topicParts[4] === "user") {
1922
+ return {
1923
+ appAddress: topicParts[1],
1924
+ strategyAddress: topicParts[3],
1925
+ userAddress: topicParts[5],
1926
+ tokenAddress: msg.text,
1927
+ messageType: "app-strategy-user-first"
1928
+ };
1929
+ }
1930
+ }
1931
+ return null;
1932
+ } catch {
1933
+ return null;
1934
+ }
1935
+ }
1936
+
1937
+ // src/utils/scoreKeyUtils.ts
1938
+ var getTokenScoreKey = (tokenAddress) => {
1939
+ return encodeUpvoteKey(tokenAddress);
1940
+ };
1941
+ var getStorageScoreKey = (operatorAddress, storageKey) => {
1942
+ const bytes32Key = storage.getStorageKeyBytes(storageKey);
1943
+ return viem.keccak256(
1944
+ viem.encodePacked(
1945
+ ["bytes32", "address"],
1946
+ [bytes32Key, operatorAddress]
1947
+ )
1948
+ );
1949
+ };
1950
+ var getFeedContentKey = (message) => {
1951
+ return viem.keccak256(
1952
+ viem.encodePacked(
1953
+ ["address", "string", "address", "uint256", "string", "bytes"],
1954
+ [
1955
+ message.app,
1956
+ message.topic,
1957
+ message.sender,
1958
+ message.timestamp,
1959
+ message.text,
1960
+ message.data
1961
+ ]
1962
+ )
1963
+ );
1964
+ };
1965
+ var getScoreKey = (item) => {
1966
+ switch (item.type) {
1967
+ case "token":
1968
+ return getTokenScoreKey(item.tokenAddress);
1969
+ case "storage":
1970
+ return getStorageScoreKey(item.operatorAddress, item.storageKey);
1971
+ case "feed": {
1972
+ const contentKey = getFeedContentKey(item.message);
1973
+ return getStorageScoreKey(
1974
+ item.message.sender,
1975
+ contentKey
1976
+ );
1977
+ }
1978
+ }
1979
+ };
1980
+ var isTokenScoreKey = (scoreKey) => {
1981
+ return scoreKey.startsWith("0x000000000000000000000000");
1982
+ };
1983
+ var extractTokenAddressFromScoreKey = (scoreKey) => {
1984
+ if (!isTokenScoreKey(scoreKey)) {
1985
+ return null;
1986
+ }
1987
+ const tokenAddress = `0x${scoreKey.slice(26)}`;
1988
+ if (tokenAddress.startsWith("0x") && tokenAddress.length === 42) {
1989
+ try {
1990
+ return viem.getAddress(tokenAddress);
1991
+ } catch {
1992
+ return null;
1993
+ }
1994
+ }
1995
+ return null;
1996
+ };
1997
+ var getStorageUpvoteContext = (operatorAddress, storageKey) => {
1998
+ const bytes32Key = storage.getStorageKeyBytes(storageKey);
1999
+ return viem.encodeAbiParameters(
2000
+ [{ type: "bytes32" }, { type: "address" }],
2001
+ [bytes32Key, operatorAddress]
2002
+ );
2003
+ };
2004
+
2005
+ // src/client/ScoreClient.ts
2006
+ var ScoreClient = class {
2007
+ constructor(params) {
2008
+ this.client = core.getPublicClient({
2009
+ chainId: params.chainId,
2010
+ rpcUrl: params.overrides?.rpcUrls
2011
+ });
2012
+ this.scoreAddress = params.overrides?.scoreAddress ?? SCORE_CONTRACT.address;
2013
+ this.upvoteAppAddress = params.overrides?.upvoteAppAddress ?? UPVOTE_APP.address;
2014
+ }
2015
+ /**
2016
+ * Get upvote counts for score keys via UpvoteApp.getUpvotesWithLegacy.
2017
+ * Returns an array of counts, one per score key.
2018
+ */
2019
+ async getUpvotesWithLegacy({
2020
+ scoreKeys,
2021
+ strategies = ALL_STRATEGY_ADDRESSES
2022
+ }) {
2023
+ const data = await actions.readContract(this.client, {
2024
+ address: this.upvoteAppAddress,
2025
+ abi: UPVOTE_APP.abi,
2026
+ functionName: "getUpvotesWithLegacy",
2027
+ args: [scoreKeys, strategies]
2028
+ });
2029
+ if (Array.isArray(data)) {
2030
+ return data.map(Number);
2031
+ }
2032
+ return [];
2033
+ }
2034
+ /**
2035
+ * Get upvote counts for ScoreItem array.
2036
+ * Converts items to score keys, then calls getUpvotesWithLegacy.
2037
+ */
2038
+ async getUpvotesForItems({
2039
+ items,
2040
+ strategies
2041
+ }) {
2042
+ const scoreKeys = items.map((item) => getScoreKey(item));
2043
+ return this.getUpvotesWithLegacy({ scoreKeys, strategies });
2044
+ }
2045
+ /**
2046
+ * Read scores for keys from a specific strategy on the Score contract.
2047
+ * Uses the batch getAppStrategyKeyScores function for efficiency.
2048
+ */
2049
+ async getStrategyKeyScores({
2050
+ strategy,
2051
+ scoreKeys
2052
+ }) {
2053
+ const data = await actions.readContract(this.client, {
2054
+ address: this.scoreAddress,
2055
+ abi: SCORE_CONTRACT.abi,
2056
+ functionName: "getAppStrategyKeyScores",
2057
+ args: [this.upvoteAppAddress, strategy, scoreKeys]
2058
+ });
2059
+ if (Array.isArray(data)) {
2060
+ return data.map(Number);
2061
+ }
2062
+ return [];
2063
+ }
2064
+ /**
2065
+ * Read scores for keys from a specific app on the Score contract.
2066
+ * Uses the batch getAppKeyScores function for efficiency.
2067
+ */
2068
+ async getAppKeyScores({
2069
+ app,
2070
+ scoreKeys
2071
+ }) {
2072
+ const data = await actions.readContract(this.client, {
2073
+ address: this.scoreAddress,
2074
+ abi: SCORE_CONTRACT.abi,
2075
+ functionName: "getAppKeyScores",
2076
+ args: [app, scoreKeys]
2077
+ });
2078
+ if (Array.isArray(data)) {
2079
+ return data.map(Number);
2080
+ }
2081
+ return [];
2082
+ }
2083
+ };
2084
+ var encodePoolKey = (poolKey) => {
2085
+ if (!poolKey || !isValidPoolKey2(poolKey)) {
2086
+ return "0x";
2087
+ }
2088
+ try {
2089
+ return viem.encodeAbiParameters(
2090
+ [
2091
+ {
2092
+ type: "tuple",
2093
+ components: [
2094
+ { name: "currency0", type: "address" },
2095
+ { name: "currency1", type: "address" },
2096
+ { name: "fee", type: "uint24" },
2097
+ { name: "tickSpacing", type: "int24" },
2098
+ { name: "hooks", type: "address" }
2099
+ ]
2100
+ }
2101
+ ],
2102
+ [
2103
+ {
2104
+ currency0: poolKey.currency0,
2105
+ currency1: poolKey.currency1,
2106
+ fee: poolKey.fee,
2107
+ tickSpacing: poolKey.tickSpacing,
2108
+ hooks: poolKey.hooks
2109
+ }
2110
+ ]
2111
+ );
2112
+ } catch {
2113
+ return "0x";
2114
+ }
2115
+ };
2116
+ function isValidPoolKey2(poolKey) {
2117
+ return poolKey.fee !== void 0 || poolKey.tickSpacing !== void 0 || poolKey.currency0 !== void 0;
2118
+ }
2119
+
2120
+ exports.ALL_STRATEGY_ADDRESSES = ALL_STRATEGY_ADDRESSES;
2121
+ exports.DYNAMIC_SPLIT_STRATEGY = DYNAMIC_SPLIT_STRATEGY;
2122
+ exports.LEGACY_UPVOTE_V1_ADDRESS = LEGACY_UPVOTE_V1_ADDRESS;
2123
+ exports.LEGACY_UPVOTE_V2_ADDRESS = LEGACY_UPVOTE_V2_ADDRESS;
2124
+ exports.PURE_ALPHA_STRATEGY = PURE_ALPHA_STRATEGY;
2125
+ exports.SCORE_CONTRACT = SCORE_CONTRACT;
2126
+ exports.SUPPORTED_SCORE_CHAINS = SUPPORTED_SCORE_CHAINS;
2127
+ exports.ScoreClient = ScoreClient;
2128
+ exports.UNIV234_POOLS_STRATEGY = UNIV234_POOLS_STRATEGY;
2129
+ exports.UPVOTE_APP = UPVOTE_APP;
2130
+ exports.UPVOTE_STORAGE_APP = UPVOTE_STORAGE_APP;
2131
+ exports.decodeStrategyMetadata = decodeStrategyMetadata;
2132
+ exports.decodeUpvoteMessage = decodeUpvoteMessage;
2133
+ exports.decodeUpvoteStorageBlob = decodeUpvoteStorageBlob;
2134
+ exports.encodePoolKey = encodePoolKey;
2135
+ exports.encodeUpvoteKey = encodeUpvoteKey;
2136
+ exports.extractStrategyAddress = extractStrategyAddress;
2137
+ exports.extractTokenAddressFromScoreKey = extractTokenAddressFromScoreKey;
2138
+ exports.getFeedContentKey = getFeedContentKey;
2139
+ exports.getScoreKey = getScoreKey;
2140
+ exports.getStorageScoreKey = getStorageScoreKey;
2141
+ exports.getStorageUpvoteContext = getStorageUpvoteContext;
2142
+ exports.getTokenScoreKey = getTokenScoreKey;
2143
+ exports.isDynamicSplitStrategy = isDynamicSplitStrategy;
2144
+ exports.isPureAlphaStrategy = isPureAlphaStrategy;
2145
+ exports.isStrategyMessage = isStrategyMessage;
2146
+ exports.isTokenScoreKey = isTokenScoreKey;
2147
+ exports.isUniv234PoolsStrategy = isUniv234PoolsStrategy;
2148
+ exports.isUserUpvoteMessage = isUserUpvoteMessage;
2149
+ exports.selectStrategy = selectStrategy;
2150
+ exports.tokenAddressToUpvoteKeyString = tokenAddressToUpvoteKeyString;
2151
+ //# sourceMappingURL=index.js.map
2152
+ //# sourceMappingURL=index.js.map