brainchain-verify 0.2.2 → 0.3.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/README.md +1 -1
- package/dist/abi.d.ts +487 -3
- package/dist/abi.js +33 -3
- package/dist/deployments.js +8 -0
- package/dist/verify.js +12 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ Each line is one check. `ok` passed and `FAIL` means the record and the chain di
|
|
|
72
72
|
| `second-grader` | On a decision graded twice: the second grader's probability of paying recomputes from its probabilities, and the receipt id it carries is shown. |
|
|
73
73
|
| `brief` | The question quotes the task's brief, fetched from its `Posted` event and checked against `briefHash`. |
|
|
74
74
|
| `levels` | A grade or ruling used the brief's own quality levels and pass level. |
|
|
75
|
-
| `threshold` | The threshold fixed when the task was posted, applied as `TaskBoard.hire`, `grade` and `
|
|
75
|
+
| `threshold` | The threshold fixed when the task was posted, applied as `TaskBoard.hire`, `grade`, `rule` and `ruleAppeal` do, gives the outcome the board emitted. A ruling on appeal (set 3.5.0 and later) is checked against the board's `AppealRuled` event. A change is queued only on a yes. |
|
|
76
76
|
| `change-subject`, `change-call` | A queued change is the call the decision names and the call Jev was shown. |
|
|
77
77
|
|
|
78
78
|
Some checks skip by design:
|
package/dist/abi.d.ts
CHANGED
|
@@ -4,6 +4,106 @@ export declare const decisionLogAbi: readonly [{
|
|
|
4
4
|
readonly inputs: readonly [];
|
|
5
5
|
readonly outputs: readonly [];
|
|
6
6
|
readonly stateMutability: "nonpayable";
|
|
7
|
+
}, {
|
|
8
|
+
readonly type: "function";
|
|
9
|
+
readonly name: "allowApp";
|
|
10
|
+
readonly inputs: readonly [{
|
|
11
|
+
readonly name: "app";
|
|
12
|
+
readonly type: "bytes32";
|
|
13
|
+
readonly internalType: "bytes32";
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "allowed";
|
|
16
|
+
readonly type: "bool";
|
|
17
|
+
readonly internalType: "bool";
|
|
18
|
+
}];
|
|
19
|
+
readonly outputs: readonly [];
|
|
20
|
+
readonly stateMutability: "nonpayable";
|
|
21
|
+
}, {
|
|
22
|
+
readonly type: "function";
|
|
23
|
+
readonly name: "allowImage";
|
|
24
|
+
readonly inputs: readonly [{
|
|
25
|
+
readonly name: "image";
|
|
26
|
+
readonly type: "bytes32";
|
|
27
|
+
readonly internalType: "bytes32";
|
|
28
|
+
}, {
|
|
29
|
+
readonly name: "allowed";
|
|
30
|
+
readonly type: "bool";
|
|
31
|
+
readonly internalType: "bool";
|
|
32
|
+
}];
|
|
33
|
+
readonly outputs: readonly [];
|
|
34
|
+
readonly stateMutability: "nonpayable";
|
|
35
|
+
}, {
|
|
36
|
+
readonly type: "function";
|
|
37
|
+
readonly name: "allowedApp";
|
|
38
|
+
readonly inputs: readonly [{
|
|
39
|
+
readonly name: "";
|
|
40
|
+
readonly type: "bytes32";
|
|
41
|
+
readonly internalType: "bytes32";
|
|
42
|
+
}];
|
|
43
|
+
readonly outputs: readonly [{
|
|
44
|
+
readonly name: "";
|
|
45
|
+
readonly type: "bool";
|
|
46
|
+
readonly internalType: "bool";
|
|
47
|
+
}];
|
|
48
|
+
readonly stateMutability: "view";
|
|
49
|
+
}, {
|
|
50
|
+
readonly type: "function";
|
|
51
|
+
readonly name: "allowedImage";
|
|
52
|
+
readonly inputs: readonly [{
|
|
53
|
+
readonly name: "";
|
|
54
|
+
readonly type: "bytes32";
|
|
55
|
+
readonly internalType: "bytes32";
|
|
56
|
+
}];
|
|
57
|
+
readonly outputs: readonly [{
|
|
58
|
+
readonly name: "";
|
|
59
|
+
readonly type: "bool";
|
|
60
|
+
readonly internalType: "bool";
|
|
61
|
+
}];
|
|
62
|
+
readonly stateMutability: "view";
|
|
63
|
+
}, {
|
|
64
|
+
readonly type: "function";
|
|
65
|
+
readonly name: "attestBrain";
|
|
66
|
+
readonly inputs: readonly [{
|
|
67
|
+
readonly name: "quote";
|
|
68
|
+
readonly type: "bytes";
|
|
69
|
+
readonly internalType: "bytes";
|
|
70
|
+
}];
|
|
71
|
+
readonly outputs: readonly [{
|
|
72
|
+
readonly name: "brain_";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
readonly internalType: "address";
|
|
75
|
+
}];
|
|
76
|
+
readonly stateMutability: "nonpayable";
|
|
77
|
+
}, {
|
|
78
|
+
readonly type: "function";
|
|
79
|
+
readonly name: "attestation";
|
|
80
|
+
readonly inputs: readonly [];
|
|
81
|
+
readonly outputs: readonly [{
|
|
82
|
+
readonly name: "";
|
|
83
|
+
readonly type: "address";
|
|
84
|
+
readonly internalType: "contract IDcapAttestation";
|
|
85
|
+
}];
|
|
86
|
+
readonly stateMutability: "view";
|
|
87
|
+
}, {
|
|
88
|
+
readonly type: "function";
|
|
89
|
+
readonly name: "attestationNonce";
|
|
90
|
+
readonly inputs: readonly [];
|
|
91
|
+
readonly outputs: readonly [{
|
|
92
|
+
readonly name: "";
|
|
93
|
+
readonly type: "bytes32";
|
|
94
|
+
readonly internalType: "bytes32";
|
|
95
|
+
}];
|
|
96
|
+
readonly stateMutability: "view";
|
|
97
|
+
}, {
|
|
98
|
+
readonly type: "function";
|
|
99
|
+
readonly name: "attestations";
|
|
100
|
+
readonly inputs: readonly [];
|
|
101
|
+
readonly outputs: readonly [{
|
|
102
|
+
readonly name: "";
|
|
103
|
+
readonly type: "uint256";
|
|
104
|
+
readonly internalType: "uint256";
|
|
105
|
+
}];
|
|
106
|
+
readonly stateMutability: "view";
|
|
7
107
|
}, {
|
|
8
108
|
readonly type: "function";
|
|
9
109
|
readonly name: "brain";
|
|
@@ -139,6 +239,16 @@ export declare const decisionLogAbi: readonly [{
|
|
|
139
239
|
readonly internalType: "uint256";
|
|
140
240
|
}];
|
|
141
241
|
readonly stateMutability: "nonpayable";
|
|
242
|
+
}, {
|
|
243
|
+
readonly type: "function";
|
|
244
|
+
readonly name: "setAttestation";
|
|
245
|
+
readonly inputs: readonly [{
|
|
246
|
+
readonly name: "attestation_";
|
|
247
|
+
readonly type: "address";
|
|
248
|
+
readonly internalType: "contract IDcapAttestation";
|
|
249
|
+
}];
|
|
250
|
+
readonly outputs: readonly [];
|
|
251
|
+
readonly stateMutability: "nonpayable";
|
|
142
252
|
}, {
|
|
143
253
|
readonly type: "function";
|
|
144
254
|
readonly name: "setBrain";
|
|
@@ -149,6 +259,26 @@ export declare const decisionLogAbi: readonly [{
|
|
|
149
259
|
}];
|
|
150
260
|
readonly outputs: readonly [];
|
|
151
261
|
readonly stateMutability: "nonpayable";
|
|
262
|
+
}, {
|
|
263
|
+
readonly type: "function";
|
|
264
|
+
readonly name: "setTcbEvaluationNumber";
|
|
265
|
+
readonly inputs: readonly [{
|
|
266
|
+
readonly name: "number";
|
|
267
|
+
readonly type: "uint32";
|
|
268
|
+
readonly internalType: "uint32";
|
|
269
|
+
}];
|
|
270
|
+
readonly outputs: readonly [];
|
|
271
|
+
readonly stateMutability: "nonpayable";
|
|
272
|
+
}, {
|
|
273
|
+
readonly type: "function";
|
|
274
|
+
readonly name: "tcbEvaluationNumber";
|
|
275
|
+
readonly inputs: readonly [];
|
|
276
|
+
readonly outputs: readonly [{
|
|
277
|
+
readonly name: "";
|
|
278
|
+
readonly type: "uint32";
|
|
279
|
+
readonly internalType: "uint32";
|
|
280
|
+
}];
|
|
281
|
+
readonly stateMutability: "view";
|
|
152
282
|
}, {
|
|
153
283
|
readonly type: "function";
|
|
154
284
|
readonly name: "transferOwnership";
|
|
@@ -159,6 +289,51 @@ export declare const decisionLogAbi: readonly [{
|
|
|
159
289
|
}];
|
|
160
290
|
readonly outputs: readonly [];
|
|
161
291
|
readonly stateMutability: "nonpayable";
|
|
292
|
+
}, {
|
|
293
|
+
readonly type: "event";
|
|
294
|
+
readonly name: "AppAllowed";
|
|
295
|
+
readonly inputs: readonly [{
|
|
296
|
+
readonly name: "app";
|
|
297
|
+
readonly type: "bytes32";
|
|
298
|
+
readonly indexed: true;
|
|
299
|
+
readonly internalType: "bytes32";
|
|
300
|
+
}, {
|
|
301
|
+
readonly name: "allowed";
|
|
302
|
+
readonly type: "bool";
|
|
303
|
+
readonly indexed: false;
|
|
304
|
+
readonly internalType: "bool";
|
|
305
|
+
}];
|
|
306
|
+
readonly anonymous: false;
|
|
307
|
+
}, {
|
|
308
|
+
readonly type: "event";
|
|
309
|
+
readonly name: "AttestationSet";
|
|
310
|
+
readonly inputs: readonly [{
|
|
311
|
+
readonly name: "attestation";
|
|
312
|
+
readonly type: "address";
|
|
313
|
+
readonly indexed: true;
|
|
314
|
+
readonly internalType: "address";
|
|
315
|
+
}];
|
|
316
|
+
readonly anonymous: false;
|
|
317
|
+
}, {
|
|
318
|
+
readonly type: "event";
|
|
319
|
+
readonly name: "BrainAttested";
|
|
320
|
+
readonly inputs: readonly [{
|
|
321
|
+
readonly name: "brain";
|
|
322
|
+
readonly type: "address";
|
|
323
|
+
readonly indexed: true;
|
|
324
|
+
readonly internalType: "address";
|
|
325
|
+
}, {
|
|
326
|
+
readonly name: "image";
|
|
327
|
+
readonly type: "bytes32";
|
|
328
|
+
readonly indexed: true;
|
|
329
|
+
readonly internalType: "bytes32";
|
|
330
|
+
}, {
|
|
331
|
+
readonly name: "app";
|
|
332
|
+
readonly type: "bytes32";
|
|
333
|
+
readonly indexed: true;
|
|
334
|
+
readonly internalType: "bytes32";
|
|
335
|
+
}];
|
|
336
|
+
readonly anonymous: false;
|
|
162
337
|
}, {
|
|
163
338
|
readonly type: "event";
|
|
164
339
|
readonly name: "BrainSet";
|
|
@@ -169,6 +344,21 @@ export declare const decisionLogAbi: readonly [{
|
|
|
169
344
|
readonly internalType: "address";
|
|
170
345
|
}];
|
|
171
346
|
readonly anonymous: false;
|
|
347
|
+
}, {
|
|
348
|
+
readonly type: "event";
|
|
349
|
+
readonly name: "ImageAllowed";
|
|
350
|
+
readonly inputs: readonly [{
|
|
351
|
+
readonly name: "image";
|
|
352
|
+
readonly type: "bytes32";
|
|
353
|
+
readonly indexed: true;
|
|
354
|
+
readonly internalType: "bytes32";
|
|
355
|
+
}, {
|
|
356
|
+
readonly name: "allowed";
|
|
357
|
+
readonly type: "bool";
|
|
358
|
+
readonly indexed: false;
|
|
359
|
+
readonly internalType: "bool";
|
|
360
|
+
}];
|
|
361
|
+
readonly anonymous: false;
|
|
172
362
|
}, {
|
|
173
363
|
readonly type: "event";
|
|
174
364
|
readonly name: "OwnerSet";
|
|
@@ -239,6 +429,16 @@ export declare const decisionLogAbi: readonly [{
|
|
|
239
429
|
readonly internalType: "string";
|
|
240
430
|
}];
|
|
241
431
|
readonly anonymous: false;
|
|
432
|
+
}, {
|
|
433
|
+
readonly type: "event";
|
|
434
|
+
readonly name: "TcbEvaluationSet";
|
|
435
|
+
readonly inputs: readonly [{
|
|
436
|
+
readonly name: "number";
|
|
437
|
+
readonly type: "uint32";
|
|
438
|
+
readonly indexed: false;
|
|
439
|
+
readonly internalType: "uint32";
|
|
440
|
+
}];
|
|
441
|
+
readonly anonymous: false;
|
|
242
442
|
}];
|
|
243
443
|
export declare const taskBoardAbi: readonly [{
|
|
244
444
|
readonly type: "function";
|
|
@@ -270,6 +470,91 @@ export declare const taskBoardAbi: readonly [{
|
|
|
270
470
|
readonly internalType: "uint64";
|
|
271
471
|
}];
|
|
272
472
|
readonly stateMutability: "view";
|
|
473
|
+
}, {
|
|
474
|
+
readonly type: "function";
|
|
475
|
+
readonly name: "appeal";
|
|
476
|
+
readonly inputs: readonly [{
|
|
477
|
+
readonly name: "id";
|
|
478
|
+
readonly type: "uint256";
|
|
479
|
+
readonly internalType: "uint256";
|
|
480
|
+
}];
|
|
481
|
+
readonly outputs: readonly [];
|
|
482
|
+
readonly stateMutability: "nonpayable";
|
|
483
|
+
}, {
|
|
484
|
+
readonly type: "function";
|
|
485
|
+
readonly name: "appealBond";
|
|
486
|
+
readonly inputs: readonly [{
|
|
487
|
+
readonly name: "id";
|
|
488
|
+
readonly type: "uint256";
|
|
489
|
+
readonly internalType: "uint256";
|
|
490
|
+
}];
|
|
491
|
+
readonly outputs: readonly [{
|
|
492
|
+
readonly name: "";
|
|
493
|
+
readonly type: "uint128";
|
|
494
|
+
readonly internalType: "uint128";
|
|
495
|
+
}];
|
|
496
|
+
readonly stateMutability: "view";
|
|
497
|
+
}, {
|
|
498
|
+
readonly type: "function";
|
|
499
|
+
readonly name: "appealConfig";
|
|
500
|
+
readonly inputs: readonly [];
|
|
501
|
+
readonly outputs: readonly [{
|
|
502
|
+
readonly name: "window";
|
|
503
|
+
readonly type: "uint64";
|
|
504
|
+
readonly internalType: "uint64";
|
|
505
|
+
}, {
|
|
506
|
+
readonly name: "bondBps";
|
|
507
|
+
readonly type: "uint16";
|
|
508
|
+
readonly internalType: "uint16";
|
|
509
|
+
}];
|
|
510
|
+
readonly stateMutability: "view";
|
|
511
|
+
}, {
|
|
512
|
+
readonly type: "function";
|
|
513
|
+
readonly name: "appealOf";
|
|
514
|
+
readonly inputs: readonly [{
|
|
515
|
+
readonly name: "id";
|
|
516
|
+
readonly type: "uint256";
|
|
517
|
+
readonly internalType: "uint256";
|
|
518
|
+
}];
|
|
519
|
+
readonly outputs: readonly [{
|
|
520
|
+
readonly name: "";
|
|
521
|
+
readonly type: "tuple";
|
|
522
|
+
readonly internalType: "struct TaskBoard.Appeal";
|
|
523
|
+
readonly components: readonly [{
|
|
524
|
+
readonly name: "window";
|
|
525
|
+
readonly type: "uint64";
|
|
526
|
+
readonly internalType: "uint64";
|
|
527
|
+
}, {
|
|
528
|
+
readonly name: "bondBps";
|
|
529
|
+
readonly type: "uint16";
|
|
530
|
+
readonly internalType: "uint16";
|
|
531
|
+
}, {
|
|
532
|
+
readonly name: "ruledAt";
|
|
533
|
+
readonly type: "uint64";
|
|
534
|
+
readonly internalType: "uint64";
|
|
535
|
+
}, {
|
|
536
|
+
readonly name: "pays";
|
|
537
|
+
readonly type: "bool";
|
|
538
|
+
readonly internalType: "bool";
|
|
539
|
+
}, {
|
|
540
|
+
readonly name: "confident";
|
|
541
|
+
readonly type: "bool";
|
|
542
|
+
readonly internalType: "bool";
|
|
543
|
+
}, {
|
|
544
|
+
readonly name: "appellant";
|
|
545
|
+
readonly type: "address";
|
|
546
|
+
readonly internalType: "address";
|
|
547
|
+
}, {
|
|
548
|
+
readonly name: "bond";
|
|
549
|
+
readonly type: "uint128";
|
|
550
|
+
readonly internalType: "uint128";
|
|
551
|
+
}, {
|
|
552
|
+
readonly name: "appealedAt";
|
|
553
|
+
readonly type: "uint64";
|
|
554
|
+
readonly internalType: "uint64";
|
|
555
|
+
}];
|
|
556
|
+
}];
|
|
557
|
+
readonly stateMutability: "view";
|
|
273
558
|
}, {
|
|
274
559
|
readonly type: "function";
|
|
275
560
|
readonly name: "config";
|
|
@@ -587,6 +872,20 @@ export declare const taskBoardAbi: readonly [{
|
|
|
587
872
|
readonly internalType: "uint256";
|
|
588
873
|
}];
|
|
589
874
|
readonly stateMutability: "nonpayable";
|
|
875
|
+
}, {
|
|
876
|
+
readonly type: "function";
|
|
877
|
+
readonly name: "raiseGradeBar";
|
|
878
|
+
readonly inputs: readonly [{
|
|
879
|
+
readonly name: "id";
|
|
880
|
+
readonly type: "uint256";
|
|
881
|
+
readonly internalType: "uint256";
|
|
882
|
+
}, {
|
|
883
|
+
readonly name: "bps";
|
|
884
|
+
readonly type: "uint16";
|
|
885
|
+
readonly internalType: "uint16";
|
|
886
|
+
}];
|
|
887
|
+
readonly outputs: readonly [];
|
|
888
|
+
readonly stateMutability: "nonpayable";
|
|
590
889
|
}, {
|
|
591
890
|
readonly type: "function";
|
|
592
891
|
readonly name: "rule";
|
|
@@ -601,6 +900,39 @@ export declare const taskBoardAbi: readonly [{
|
|
|
601
900
|
}];
|
|
602
901
|
readonly outputs: readonly [];
|
|
603
902
|
readonly stateMutability: "nonpayable";
|
|
903
|
+
}, {
|
|
904
|
+
readonly type: "function";
|
|
905
|
+
readonly name: "ruleAppeal";
|
|
906
|
+
readonly inputs: readonly [{
|
|
907
|
+
readonly name: "id";
|
|
908
|
+
readonly type: "uint256";
|
|
909
|
+
readonly internalType: "uint256";
|
|
910
|
+
}, {
|
|
911
|
+
readonly name: "decisionId";
|
|
912
|
+
readonly type: "uint256";
|
|
913
|
+
readonly internalType: "uint256";
|
|
914
|
+
}];
|
|
915
|
+
readonly outputs: readonly [];
|
|
916
|
+
readonly stateMutability: "nonpayable";
|
|
917
|
+
}, {
|
|
918
|
+
readonly type: "function";
|
|
919
|
+
readonly name: "setAppealConfig";
|
|
920
|
+
readonly inputs: readonly [{
|
|
921
|
+
readonly name: "config_";
|
|
922
|
+
readonly type: "tuple";
|
|
923
|
+
readonly internalType: "struct TaskBoard.AppealConfig";
|
|
924
|
+
readonly components: readonly [{
|
|
925
|
+
readonly name: "window";
|
|
926
|
+
readonly type: "uint64";
|
|
927
|
+
readonly internalType: "uint64";
|
|
928
|
+
}, {
|
|
929
|
+
readonly name: "bondBps";
|
|
930
|
+
readonly type: "uint16";
|
|
931
|
+
readonly internalType: "uint16";
|
|
932
|
+
}];
|
|
933
|
+
}];
|
|
934
|
+
readonly outputs: readonly [];
|
|
935
|
+
readonly stateMutability: "nonpayable";
|
|
604
936
|
}, {
|
|
605
937
|
readonly type: "function";
|
|
606
938
|
readonly name: "setConfig";
|
|
@@ -772,6 +1104,95 @@ export declare const taskBoardAbi: readonly [{
|
|
|
772
1104
|
readonly internalType: "bool";
|
|
773
1105
|
}];
|
|
774
1106
|
readonly stateMutability: "view";
|
|
1107
|
+
}, {
|
|
1108
|
+
readonly type: "event";
|
|
1109
|
+
readonly name: "AppealBondSettled";
|
|
1110
|
+
readonly inputs: readonly [{
|
|
1111
|
+
readonly name: "id";
|
|
1112
|
+
readonly type: "uint256";
|
|
1113
|
+
readonly indexed: true;
|
|
1114
|
+
readonly internalType: "uint256";
|
|
1115
|
+
}, {
|
|
1116
|
+
readonly name: "to";
|
|
1117
|
+
readonly type: "address";
|
|
1118
|
+
readonly indexed: true;
|
|
1119
|
+
readonly internalType: "address";
|
|
1120
|
+
}, {
|
|
1121
|
+
readonly name: "bond";
|
|
1122
|
+
readonly type: "uint128";
|
|
1123
|
+
readonly indexed: false;
|
|
1124
|
+
readonly internalType: "uint128";
|
|
1125
|
+
}];
|
|
1126
|
+
readonly anonymous: false;
|
|
1127
|
+
}, {
|
|
1128
|
+
readonly type: "event";
|
|
1129
|
+
readonly name: "AppealConfigSet";
|
|
1130
|
+
readonly inputs: readonly [{
|
|
1131
|
+
readonly name: "config";
|
|
1132
|
+
readonly type: "tuple";
|
|
1133
|
+
readonly indexed: false;
|
|
1134
|
+
readonly internalType: "struct TaskBoard.AppealConfig";
|
|
1135
|
+
readonly components: readonly [{
|
|
1136
|
+
readonly name: "window";
|
|
1137
|
+
readonly type: "uint64";
|
|
1138
|
+
readonly internalType: "uint64";
|
|
1139
|
+
}, {
|
|
1140
|
+
readonly name: "bondBps";
|
|
1141
|
+
readonly type: "uint16";
|
|
1142
|
+
readonly internalType: "uint16";
|
|
1143
|
+
}];
|
|
1144
|
+
}];
|
|
1145
|
+
readonly anonymous: false;
|
|
1146
|
+
}, {
|
|
1147
|
+
readonly type: "event";
|
|
1148
|
+
readonly name: "AppealRuled";
|
|
1149
|
+
readonly inputs: readonly [{
|
|
1150
|
+
readonly name: "id";
|
|
1151
|
+
readonly type: "uint256";
|
|
1152
|
+
readonly indexed: true;
|
|
1153
|
+
readonly internalType: "uint256";
|
|
1154
|
+
}, {
|
|
1155
|
+
readonly name: "decisionId";
|
|
1156
|
+
readonly type: "uint256";
|
|
1157
|
+
readonly indexed: true;
|
|
1158
|
+
readonly internalType: "uint256";
|
|
1159
|
+
}, {
|
|
1160
|
+
readonly name: "paid";
|
|
1161
|
+
readonly type: "bool";
|
|
1162
|
+
readonly indexed: false;
|
|
1163
|
+
readonly internalType: "bool";
|
|
1164
|
+
}, {
|
|
1165
|
+
readonly name: "confident";
|
|
1166
|
+
readonly type: "bool";
|
|
1167
|
+
readonly indexed: false;
|
|
1168
|
+
readonly internalType: "bool";
|
|
1169
|
+
}, {
|
|
1170
|
+
readonly name: "overturned";
|
|
1171
|
+
readonly type: "bool";
|
|
1172
|
+
readonly indexed: false;
|
|
1173
|
+
readonly internalType: "bool";
|
|
1174
|
+
}];
|
|
1175
|
+
readonly anonymous: false;
|
|
1176
|
+
}, {
|
|
1177
|
+
readonly type: "event";
|
|
1178
|
+
readonly name: "Appealed";
|
|
1179
|
+
readonly inputs: readonly [{
|
|
1180
|
+
readonly name: "id";
|
|
1181
|
+
readonly type: "uint256";
|
|
1182
|
+
readonly indexed: true;
|
|
1183
|
+
readonly internalType: "uint256";
|
|
1184
|
+
}, {
|
|
1185
|
+
readonly name: "appellant";
|
|
1186
|
+
readonly type: "address";
|
|
1187
|
+
readonly indexed: true;
|
|
1188
|
+
readonly internalType: "address";
|
|
1189
|
+
}, {
|
|
1190
|
+
readonly name: "bond";
|
|
1191
|
+
readonly type: "uint128";
|
|
1192
|
+
readonly indexed: false;
|
|
1193
|
+
readonly internalType: "uint128";
|
|
1194
|
+
}];
|
|
1195
|
+
readonly anonymous: false;
|
|
775
1196
|
}, {
|
|
776
1197
|
readonly type: "event";
|
|
777
1198
|
readonly name: "BountyPaid";
|
|
@@ -909,6 +1330,26 @@ export declare const taskBoardAbi: readonly [{
|
|
|
909
1330
|
readonly internalType: "uint128";
|
|
910
1331
|
}];
|
|
911
1332
|
readonly anonymous: false;
|
|
1333
|
+
}, {
|
|
1334
|
+
readonly type: "event";
|
|
1335
|
+
readonly name: "GradeBarRaised";
|
|
1336
|
+
readonly inputs: readonly [{
|
|
1337
|
+
readonly name: "id";
|
|
1338
|
+
readonly type: "uint256";
|
|
1339
|
+
readonly indexed: true;
|
|
1340
|
+
readonly internalType: "uint256";
|
|
1341
|
+
}, {
|
|
1342
|
+
readonly name: "gradeThresholdBps";
|
|
1343
|
+
readonly type: "uint16";
|
|
1344
|
+
readonly indexed: false;
|
|
1345
|
+
readonly internalType: "uint16";
|
|
1346
|
+
}, {
|
|
1347
|
+
readonly name: "ruleThresholdBps";
|
|
1348
|
+
readonly type: "uint16";
|
|
1349
|
+
readonly indexed: false;
|
|
1350
|
+
readonly internalType: "uint16";
|
|
1351
|
+
}];
|
|
1352
|
+
readonly anonymous: false;
|
|
912
1353
|
}, {
|
|
913
1354
|
readonly type: "event";
|
|
914
1355
|
readonly name: "GradeDisputed";
|
|
@@ -1313,6 +1754,20 @@ export declare const decisionExecutorAbi: readonly [{
|
|
|
1313
1754
|
readonly internalType: "uint16";
|
|
1314
1755
|
}];
|
|
1315
1756
|
readonly stateMutability: "view";
|
|
1757
|
+
}, {
|
|
1758
|
+
readonly type: "function";
|
|
1759
|
+
readonly name: "clearVeto";
|
|
1760
|
+
readonly inputs: readonly [{
|
|
1761
|
+
readonly name: "target";
|
|
1762
|
+
readonly type: "address";
|
|
1763
|
+
readonly internalType: "address";
|
|
1764
|
+
}, {
|
|
1765
|
+
readonly name: "selector";
|
|
1766
|
+
readonly type: "bytes4";
|
|
1767
|
+
readonly internalType: "bytes4";
|
|
1768
|
+
}];
|
|
1769
|
+
readonly outputs: readonly [];
|
|
1770
|
+
readonly stateMutability: "nonpayable";
|
|
1316
1771
|
}, {
|
|
1317
1772
|
readonly type: "function";
|
|
1318
1773
|
readonly name: "decisionUsed";
|
|
@@ -1590,11 +2045,15 @@ export declare const decisionExecutorAbi: readonly [{
|
|
|
1590
2045
|
readonly stateMutability: "nonpayable";
|
|
1591
2046
|
}, {
|
|
1592
2047
|
readonly type: "function";
|
|
1593
|
-
readonly name: "
|
|
2048
|
+
readonly name: "vetoed";
|
|
1594
2049
|
readonly inputs: readonly [{
|
|
1595
2050
|
readonly name: "";
|
|
1596
|
-
readonly type: "
|
|
1597
|
-
readonly internalType: "
|
|
2051
|
+
readonly type: "address";
|
|
2052
|
+
readonly internalType: "address";
|
|
2053
|
+
}, {
|
|
2054
|
+
readonly name: "";
|
|
2055
|
+
readonly type: "bytes4";
|
|
2056
|
+
readonly internalType: "bytes4";
|
|
1598
2057
|
}];
|
|
1599
2058
|
readonly outputs: readonly [{
|
|
1600
2059
|
readonly name: "";
|
|
@@ -1727,6 +2186,21 @@ export declare const decisionExecutorAbi: readonly [{
|
|
|
1727
2186
|
readonly internalType: "uint256";
|
|
1728
2187
|
}];
|
|
1729
2188
|
readonly anonymous: false;
|
|
2189
|
+
}, {
|
|
2190
|
+
readonly type: "event";
|
|
2191
|
+
readonly name: "VetoCleared";
|
|
2192
|
+
readonly inputs: readonly [{
|
|
2193
|
+
readonly name: "target";
|
|
2194
|
+
readonly type: "address";
|
|
2195
|
+
readonly indexed: true;
|
|
2196
|
+
readonly internalType: "address";
|
|
2197
|
+
}, {
|
|
2198
|
+
readonly name: "selector";
|
|
2199
|
+
readonly type: "bytes4";
|
|
2200
|
+
readonly indexed: true;
|
|
2201
|
+
readonly internalType: "bytes4";
|
|
2202
|
+
}];
|
|
2203
|
+
readonly anonymous: false;
|
|
1730
2204
|
}, {
|
|
1731
2205
|
readonly type: "event";
|
|
1732
2206
|
readonly name: "Vetoed";
|
|
@@ -1735,6 +2209,16 @@ export declare const decisionExecutorAbi: readonly [{
|
|
|
1735
2209
|
readonly type: "uint256";
|
|
1736
2210
|
readonly indexed: true;
|
|
1737
2211
|
readonly internalType: "uint256";
|
|
2212
|
+
}, {
|
|
2213
|
+
readonly name: "target";
|
|
2214
|
+
readonly type: "address";
|
|
2215
|
+
readonly indexed: true;
|
|
2216
|
+
readonly internalType: "address";
|
|
2217
|
+
}, {
|
|
2218
|
+
readonly name: "selector";
|
|
2219
|
+
readonly type: "bytes4";
|
|
2220
|
+
readonly indexed: true;
|
|
2221
|
+
readonly internalType: "bytes4";
|
|
1738
2222
|
}];
|
|
1739
2223
|
readonly anonymous: false;
|
|
1740
2224
|
}];
|
package/dist/abi.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
// Generated by scripts/abi.mjs from usebrainchain/brainchain
|
|
1
|
+
// Generated by scripts/abi.mjs from the usebrainchain/brainchain 3.5.0 contracts. Do not edit.
|
|
2
2
|
export const decisionLogAbi = [
|
|
3
3
|
{ "type": "function", "name": "acceptOwnership", "inputs": [], "outputs": [], "stateMutability": "nonpayable" },
|
|
4
|
+
{ "type": "function", "name": "allowApp", "inputs": [{ "name": "app", "type": "bytes32", "internalType": "bytes32" }, { "name": "allowed", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
5
|
+
{ "type": "function", "name": "allowImage", "inputs": [{ "name": "image", "type": "bytes32", "internalType": "bytes32" }, { "name": "allowed", "type": "bool", "internalType": "bool" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
6
|
+
{ "type": "function", "name": "allowedApp", "inputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" },
|
|
7
|
+
{ "type": "function", "name": "allowedImage", "inputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" },
|
|
8
|
+
{ "type": "function", "name": "attestBrain", "inputs": [{ "name": "quote", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "brain_", "type": "address", "internalType": "address" }], "stateMutability": "nonpayable" },
|
|
9
|
+
{ "type": "function", "name": "attestation", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract IDcapAttestation" }], "stateMutability": "view" },
|
|
10
|
+
{ "type": "function", "name": "attestationNonce", "inputs": [], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" },
|
|
11
|
+
{ "type": "function", "name": "attestations", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" },
|
|
4
12
|
{ "type": "function", "name": "brain", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" },
|
|
5
13
|
{ "type": "function", "name": "count", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" },
|
|
6
14
|
{ "type": "function", "name": "get", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "decision", "type": "tuple", "internalType": "struct DecisionLog.Decision", "components": [{ "name": "kind", "type": "uint8", "internalType": "enum DecisionLog.Kind" }, { "name": "subject", "type": "bytes32", "internalType": "bytes32" }, { "name": "inputHash", "type": "bytes32", "internalType": "bytes32" }, { "name": "answer", "type": "bytes32", "internalType": "bytes32" }, { "name": "confidenceBps", "type": "uint16", "internalType": "uint16" }, { "name": "recordedAt", "type": "uint64", "internalType": "uint64" }] }], "stateMutability": "view" },
|
|
@@ -8,17 +16,29 @@ export const decisionLogAbi = [
|
|
|
8
16
|
{ "type": "function", "name": "owner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" },
|
|
9
17
|
{ "type": "function", "name": "pendingOwner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" },
|
|
10
18
|
{ "type": "function", "name": "record", "inputs": [{ "name": "kind", "type": "uint8", "internalType": "enum DecisionLog.Kind" }, { "name": "subject", "type": "bytes32", "internalType": "bytes32" }, { "name": "inputHash", "type": "bytes32", "internalType": "bytes32" }, { "name": "answer", "type": "bytes32", "internalType": "bytes32" }, { "name": "confidenceBps", "type": "uint16", "internalType": "uint16" }, { "name": "payloadHash", "type": "bytes32", "internalType": "bytes32" }, { "name": "payloadURI", "type": "string", "internalType": "string" }], "outputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" },
|
|
19
|
+
{ "type": "function", "name": "setAttestation", "inputs": [{ "name": "attestation_", "type": "address", "internalType": "contract IDcapAttestation" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
11
20
|
{ "type": "function", "name": "setBrain", "inputs": [{ "name": "brain_", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
21
|
+
{ "type": "function", "name": "setTcbEvaluationNumber", "inputs": [{ "name": "number", "type": "uint32", "internalType": "uint32" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
22
|
+
{ "type": "function", "name": "tcbEvaluationNumber", "inputs": [], "outputs": [{ "name": "", "type": "uint32", "internalType": "uint32" }], "stateMutability": "view" },
|
|
12
23
|
{ "type": "function", "name": "transferOwnership", "inputs": [{ "name": "pendingOwner_", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
24
|
+
{ "type": "event", "name": "AppAllowed", "inputs": [{ "name": "app", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "allowed", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false },
|
|
25
|
+
{ "type": "event", "name": "AttestationSet", "inputs": [{ "name": "attestation", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
26
|
+
{ "type": "event", "name": "BrainAttested", "inputs": [{ "name": "brain", "type": "address", "indexed": true, "internalType": "address" }, { "name": "image", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "app", "type": "bytes32", "indexed": true, "internalType": "bytes32" }], "anonymous": false },
|
|
13
27
|
{ "type": "event", "name": "BrainSet", "inputs": [{ "name": "brain", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
28
|
+
{ "type": "event", "name": "ImageAllowed", "inputs": [{ "name": "image", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "allowed", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false },
|
|
14
29
|
{ "type": "event", "name": "OwnerSet", "inputs": [{ "name": "owner", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
15
30
|
{ "type": "event", "name": "OwnershipTransferStarted", "inputs": [{ "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "pendingOwner", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
16
31
|
{ "type": "event", "name": "Recorded", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "kind", "type": "uint8", "indexed": true, "internalType": "enum DecisionLog.Kind" }, { "name": "subject", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "inputHash", "type": "bytes32", "indexed": false, "internalType": "bytes32" }, { "name": "answer", "type": "bytes32", "indexed": false, "internalType": "bytes32" }, { "name": "confidenceBps", "type": "uint16", "indexed": false, "internalType": "uint16" }, { "name": "payloadHash", "type": "bytes32", "indexed": false, "internalType": "bytes32" }, { "name": "payloadURI", "type": "string", "indexed": false, "internalType": "string" }], "anonymous": false },
|
|
32
|
+
{ "type": "event", "name": "TcbEvaluationSet", "inputs": [{ "name": "number", "type": "uint32", "indexed": false, "internalType": "uint32" }], "anonymous": false },
|
|
17
33
|
];
|
|
18
34
|
export const taskBoardAbi = [
|
|
19
35
|
{ "type": "function", "name": "MAX_DURATION", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" },
|
|
20
36
|
{ "type": "function", "name": "MAX_FEE_BPS", "inputs": [], "outputs": [{ "name": "", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" },
|
|
21
37
|
{ "type": "function", "name": "MAX_WINDOW", "inputs": [], "outputs": [{ "name": "", "type": "uint64", "internalType": "uint64" }], "stateMutability": "view" },
|
|
38
|
+
{ "type": "function", "name": "appeal", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
39
|
+
{ "type": "function", "name": "appealBond", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "uint128", "internalType": "uint128" }], "stateMutability": "view" },
|
|
40
|
+
{ "type": "function", "name": "appealConfig", "inputs": [], "outputs": [{ "name": "window", "type": "uint64", "internalType": "uint64" }, { "name": "bondBps", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" },
|
|
41
|
+
{ "type": "function", "name": "appealOf", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "tuple", "internalType": "struct TaskBoard.Appeal", "components": [{ "name": "window", "type": "uint64", "internalType": "uint64" }, { "name": "bondBps", "type": "uint16", "internalType": "uint16" }, { "name": "ruledAt", "type": "uint64", "internalType": "uint64" }, { "name": "pays", "type": "bool", "internalType": "bool" }, { "name": "confident", "type": "bool", "internalType": "bool" }, { "name": "appellant", "type": "address", "internalType": "address" }, { "name": "bond", "type": "uint128", "internalType": "uint128" }, { "name": "appealedAt", "type": "uint64", "internalType": "uint64" }] }], "stateMutability": "view" },
|
|
22
42
|
{ "type": "function", "name": "config", "inputs": [], "outputs": [{ "name": "hireThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "gradeThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "ruleThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "minDuration", "type": "uint64", "internalType": "uint64" }, { "name": "maxDuration", "type": "uint64", "internalType": "uint64" }, { "name": "gradeWindow", "type": "uint64", "internalType": "uint64" }, { "name": "disputeWindow", "type": "uint64", "internalType": "uint64" }, { "name": "ruleWindow", "type": "uint64", "internalType": "uint64" }, { "name": "minBounty", "type": "uint128", "internalType": "uint128" }], "stateMutability": "view" },
|
|
23
43
|
{ "type": "function", "name": "count", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" },
|
|
24
44
|
{ "type": "function", "name": "decisionUsed", "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" },
|
|
@@ -35,7 +55,10 @@ export const taskBoardAbi = [
|
|
|
35
55
|
{ "type": "function", "name": "owner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" },
|
|
36
56
|
{ "type": "function", "name": "paused", "inputs": [], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" },
|
|
37
57
|
{ "type": "function", "name": "post", "inputs": [{ "name": "bounty", "type": "uint128", "internalType": "uint128" }, { "name": "deadline", "type": "uint64", "internalType": "uint64" }, { "name": "briefHash", "type": "bytes32", "internalType": "bytes32" }, { "name": "briefURI", "type": "string", "internalType": "string" }], "outputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }], "stateMutability": "nonpayable" },
|
|
58
|
+
{ "type": "function", "name": "raiseGradeBar", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }, { "name": "bps", "type": "uint16", "internalType": "uint16" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
38
59
|
{ "type": "function", "name": "rule", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }, { "name": "decisionId", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
60
|
+
{ "type": "function", "name": "ruleAppeal", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }, { "name": "decisionId", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
61
|
+
{ "type": "function", "name": "setAppealConfig", "inputs": [{ "name": "config_", "type": "tuple", "internalType": "struct TaskBoard.AppealConfig", "components": [{ "name": "window", "type": "uint64", "internalType": "uint64" }, { "name": "bondBps", "type": "uint16", "internalType": "uint16" }] }], "outputs": [], "stateMutability": "nonpayable" },
|
|
39
62
|
{ "type": "function", "name": "setConfig", "inputs": [{ "name": "config_", "type": "tuple", "internalType": "struct TaskBoard.Config", "components": [{ "name": "hireThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "gradeThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "ruleThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "minDuration", "type": "uint64", "internalType": "uint64" }, { "name": "maxDuration", "type": "uint64", "internalType": "uint64" }, { "name": "gradeWindow", "type": "uint64", "internalType": "uint64" }, { "name": "disputeWindow", "type": "uint64", "internalType": "uint64" }, { "name": "ruleWindow", "type": "uint64", "internalType": "uint64" }, { "name": "minBounty", "type": "uint128", "internalType": "uint128" }] }], "outputs": [], "stateMutability": "nonpayable" },
|
|
40
63
|
{ "type": "function", "name": "setFee", "inputs": [{ "name": "feeBps_", "type": "uint16", "internalType": "uint16" }, { "name": "feeRouter_", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
41
64
|
{ "type": "function", "name": "setGuardian", "inputs": [{ "name": "guardian_", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
@@ -47,11 +70,16 @@ export const taskBoardAbi = [
|
|
|
47
70
|
{ "type": "function", "name": "submit", "inputs": [{ "name": "id", "type": "uint256", "internalType": "uint256" }, { "name": "resultHash", "type": "bytes32", "internalType": "bytes32" }, { "name": "resultURI", "type": "string", "internalType": "string" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
48
71
|
{ "type": "function", "name": "token", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract IERC20" }], "stateMutability": "view" },
|
|
49
72
|
{ "type": "function", "name": "workerAllowed", "inputs": [{ "name": "", "type": "address", "internalType": "address" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" },
|
|
73
|
+
{ "type": "event", "name": "AppealBondSettled", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "bond", "type": "uint128", "indexed": false, "internalType": "uint128" }], "anonymous": false },
|
|
74
|
+
{ "type": "event", "name": "AppealConfigSet", "inputs": [{ "name": "config", "type": "tuple", "indexed": false, "internalType": "struct TaskBoard.AppealConfig", "components": [{ "name": "window", "type": "uint64", "internalType": "uint64" }, { "name": "bondBps", "type": "uint16", "internalType": "uint16" }] }], "anonymous": false },
|
|
75
|
+
{ "type": "event", "name": "AppealRuled", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "decisionId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "paid", "type": "bool", "indexed": false, "internalType": "bool" }, { "name": "confident", "type": "bool", "indexed": false, "internalType": "bool" }, { "name": "overturned", "type": "bool", "indexed": false, "internalType": "bool" }], "anonymous": false },
|
|
76
|
+
{ "type": "event", "name": "Appealed", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "appellant", "type": "address", "indexed": true, "internalType": "address" }, { "name": "bond", "type": "uint128", "indexed": false, "internalType": "uint128" }], "anonymous": false },
|
|
50
77
|
{ "type": "event", "name": "BountyPaid", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "model", "type": "bytes32", "indexed": true, "internalType": "bytes32" }, { "name": "account", "type": "address", "indexed": true, "internalType": "address" }, { "name": "bounty", "type": "uint128", "indexed": false, "internalType": "uint128" }, { "name": "fee", "type": "uint128", "indexed": false, "internalType": "uint128" }], "anonymous": false },
|
|
51
78
|
{ "type": "event", "name": "BountyRefunded", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "poster", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint128", "indexed": false, "internalType": "uint128" }, { "name": "reason", "type": "uint8", "indexed": false, "internalType": "enum TaskBoard.RefundReason" }], "anonymous": false },
|
|
52
79
|
{ "type": "event", "name": "ConfigSet", "inputs": [{ "name": "config", "type": "tuple", "indexed": false, "internalType": "struct TaskBoard.Config", "components": [{ "name": "hireThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "gradeThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "ruleThresholdBps", "type": "uint16", "internalType": "uint16" }, { "name": "minDuration", "type": "uint64", "internalType": "uint64" }, { "name": "maxDuration", "type": "uint64", "internalType": "uint64" }, { "name": "gradeWindow", "type": "uint64", "internalType": "uint64" }, { "name": "disputeWindow", "type": "uint64", "internalType": "uint64" }, { "name": "ruleWindow", "type": "uint64", "internalType": "uint64" }, { "name": "minBounty", "type": "uint128", "internalType": "uint128" }] }], "anonymous": false },
|
|
53
80
|
{ "type": "event", "name": "FeeSet", "inputs": [{ "name": "feeBps", "type": "uint16", "indexed": false, "internalType": "uint16" }, { "name": "feeRouter", "type": "address", "indexed": false, "internalType": "address" }], "anonymous": false },
|
|
54
81
|
{ "type": "event", "name": "FeeTaken", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "recipient", "type": "address", "indexed": true, "internalType": "address" }, { "name": "fee", "type": "uint128", "indexed": false, "internalType": "uint128" }], "anonymous": false },
|
|
82
|
+
{ "type": "event", "name": "GradeBarRaised", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "gradeThresholdBps", "type": "uint16", "indexed": false, "internalType": "uint16" }, { "name": "ruleThresholdBps", "type": "uint16", "indexed": false, "internalType": "uint16" }], "anonymous": false },
|
|
55
83
|
{ "type": "event", "name": "GradeDisputed", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "opener", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
56
84
|
{ "type": "event", "name": "GuardianSet", "inputs": [{ "name": "guardian", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
57
85
|
{ "type": "event", "name": "HireHeld", "inputs": [{ "name": "id", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "decisionId", "type": "uint256", "indexed": true, "internalType": "uint256" }], "anonymous": false },
|
|
@@ -82,6 +110,7 @@ export const decisionExecutorAbi = [
|
|
|
82
110
|
{ "type": "function", "name": "changeCount", "inputs": [], "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" },
|
|
83
111
|
{ "type": "function", "name": "changeSubject", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "data", "type": "bytes", "internalType": "bytes" }], "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" },
|
|
84
112
|
{ "type": "function", "name": "changeThresholdBps", "inputs": [], "outputs": [{ "name": "", "type": "uint16", "internalType": "uint16" }], "stateMutability": "view" },
|
|
113
|
+
{ "type": "function", "name": "clearVeto", "inputs": [{ "name": "target", "type": "address", "internalType": "address" }, { "name": "selector", "type": "bytes4", "internalType": "bytes4" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
85
114
|
{ "type": "function", "name": "decisionUsed", "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" },
|
|
86
115
|
{ "type": "function", "name": "decisions", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract DecisionLog" }], "stateMutability": "view" },
|
|
87
116
|
{ "type": "function", "name": "execute", "inputs": [{ "name": "changeId", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
@@ -101,7 +130,7 @@ export const decisionExecutorAbi = [
|
|
|
101
130
|
{ "type": "function", "name": "token", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "contract IERC20" }], "stateMutability": "view" },
|
|
102
131
|
{ "type": "function", "name": "transfer", "inputs": [{ "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
103
132
|
{ "type": "function", "name": "veto", "inputs": [{ "name": "changeId", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" },
|
|
104
|
-
{ "type": "function", "name": "
|
|
133
|
+
{ "type": "function", "name": "vetoed", "inputs": [{ "name": "", "type": "address", "internalType": "address" }, { "name": "", "type": "bytes4", "internalType": "bytes4" }], "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" },
|
|
105
134
|
{ "type": "event", "name": "BoardBound", "inputs": [{ "name": "board", "type": "address", "indexed": true, "internalType": "address" }, { "name": "models", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
106
135
|
{ "type": "event", "name": "Executed", "inputs": [{ "name": "changeId", "type": "uint256", "indexed": true, "internalType": "uint256" }], "anonymous": false },
|
|
107
136
|
{ "type": "event", "name": "GuardianSet", "inputs": [{ "name": "guardian", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false },
|
|
@@ -109,5 +138,6 @@ export const decisionExecutorAbi = [
|
|
|
109
138
|
{ "type": "event", "name": "ParametersSet", "inputs": [{ "name": "changeThresholdBps", "type": "uint16", "indexed": false, "internalType": "uint16" }, { "name": "timelock", "type": "uint64", "indexed": false, "internalType": "uint64" }, { "name": "houseTasksPerDay", "type": "uint32", "indexed": false, "internalType": "uint32" }, { "name": "maxHouseBounty", "type": "uint128", "indexed": false, "internalType": "uint128" }, { "name": "houseSpendPerDay", "type": "uint128", "indexed": false, "internalType": "uint128" }], "anonymous": false },
|
|
110
139
|
{ "type": "event", "name": "Queued", "inputs": [{ "name": "changeId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "decisionId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "target", "type": "address", "indexed": true, "internalType": "address" }, { "name": "data", "type": "bytes", "indexed": false, "internalType": "bytes" }, { "name": "eta", "type": "uint64", "indexed": false, "internalType": "uint64" }], "anonymous": false },
|
|
111
140
|
{ "type": "event", "name": "Transferred", "inputs": [{ "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false },
|
|
112
|
-
{ "type": "event", "name": "
|
|
141
|
+
{ "type": "event", "name": "VetoCleared", "inputs": [{ "name": "target", "type": "address", "indexed": true, "internalType": "address" }, { "name": "selector", "type": "bytes4", "indexed": true, "internalType": "bytes4" }], "anonymous": false },
|
|
142
|
+
{ "type": "event", "name": "Vetoed", "inputs": [{ "name": "changeId", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "target", "type": "address", "indexed": true, "internalType": "address" }, { "name": "selector", "type": "bytes4", "indexed": true, "internalType": "bytes4" }], "anonymous": false },
|
|
113
143
|
];
|
package/dist/deployments.js
CHANGED
|
@@ -43,6 +43,14 @@ export const NETWORKS = {
|
|
|
43
43
|
"name": "BrainChain testnet",
|
|
44
44
|
"rpc": "https://rpc.testnet.usebrainchain.com",
|
|
45
45
|
"sets": [
|
|
46
|
+
{
|
|
47
|
+
"key": "v3-5",
|
|
48
|
+
"release": "3.5.0",
|
|
49
|
+
"fromBlock": 2288,
|
|
50
|
+
"board": "0x7A7cC5D35A642CCc268C7B263fF800bc7eBD52A4",
|
|
51
|
+
"log": "0x4E4cB48f3802bD519E0Eed896dF82197B0ecBc09",
|
|
52
|
+
"executor": "0xA3a40A2D46D54dc6e88c08a9d98Ec47785CB2366"
|
|
53
|
+
},
|
|
46
54
|
{
|
|
47
55
|
"key": "v3-4",
|
|
48
56
|
"release": "3.4.1",
|
package/dist/verify.js
CHANGED
|
@@ -385,14 +385,23 @@ async function checkTaskThreshold(ctx, c, id, task, decision, record) {
|
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
387
|
const confident = bps >= terms.ruleThresholdBps;
|
|
388
|
-
const
|
|
388
|
+
const pays = decision.answer === YES;
|
|
389
|
+
// A second ruling, after an appeal (set 3.5.0 and later), is applied by ruleAppeal.
|
|
390
|
+
const [appealRuled] = await client.getContractEvents({ ...filter, eventName: "AppealRuled" });
|
|
391
|
+
if (appealRuled) {
|
|
392
|
+
const expected = `${rule(terms.ruleThresholdBps, "ruling")}, so on appeal ${confident ? `the ruling decides: ${pays ? "pay the model" : "refund the poster"}` : "the ruling under appeal stands"}`;
|
|
393
|
+
const outcome = `${appealRuled.args.paid ? "the model was paid" : "the poster was refunded"}${appealRuled.args.overturned ? ", overturning the ruling under appeal" : ""}`;
|
|
394
|
+
c.check("threshold", appealRuled.args.confident === confident && (!confident || appealRuled.args.paid === pays), `${expected}; ${outcome}`, `${expected}, but the board ${appealRuled.args.confident ? "applied the ruling" : "kept the ruling under appeal"} and ${outcome}`);
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
const expected = `${rule(terms.ruleThresholdBps, "ruling")}, so ${confident ? `the ruling decides: ${pays ? "pay the model" : "refund the poster"}` : "the grade stands"}`;
|
|
389
398
|
const [ruled] = await client.getContractEvents({ ...filter, eventName: "Ruled" });
|
|
390
399
|
if (!ruled) {
|
|
391
400
|
c.add("threshold", "skip", `${expected}; this decision was not applied, and the ruling window closed with the grade standing`);
|
|
392
401
|
return;
|
|
393
402
|
}
|
|
394
|
-
const outcome = ruled.args.paid ? "the
|
|
395
|
-
c.check("threshold", ruled.args.confident === confident && (!confident || ruled.args.paid ===
|
|
403
|
+
const outcome = ruled.args.paid ? "the ruling pays the model" : "the ruling refunds the poster";
|
|
404
|
+
c.check("threshold", ruled.args.confident === confident && (!confident || ruled.args.paid === pays), `${expected}; ${outcome}`, `${expected}, but the board ${ruled.args.confident ? "applied the ruling" : "kept the grade"} and ${outcome.replace("the ruling ", "")}`);
|
|
396
405
|
}
|
|
397
406
|
async function checkChange(ctx, c, id, decision, record, state) {
|
|
398
407
|
const { client, network, set } = ctx;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brainchain-verify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Check a BrainChain decision against the chain: the published record, its hashes, its confidence and the thresholds the contracts applied.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "BrainChain",
|