File tree 3 files changed +52
-14
lines changed
3 files changed +52
-14
lines changed Original file line number Diff line number Diff line change 851
851
"internalType" : " address payable" ,
852
852
"name" : " _contributor" ,
853
853
"type" : " address"
854
- },
855
- {
856
- "internalType" : " enum ITruthPost.RulingOptions" ,
857
- "name" : " _ruling" ,
858
- "type" : " uint8"
859
854
}
860
855
],
861
856
"name" : " getTotalWithdrawableAmount" ,
864
859
"internalType" : " uint256" ,
865
860
"name" : " sum" ,
866
861
"type" : " uint256"
862
+ },
863
+ {
864
+ "internalType" : " uint256[][]" ,
865
+ "name" : " positions" ,
866
+ "type" : " uint256[][]"
867
867
}
868
868
],
869
869
"stateMutability" : " view" ,
1085
1085
"outputs" : [],
1086
1086
"stateMutability" : " nonpayable" ,
1087
1087
"type" : " function"
1088
+ },
1089
+ {
1090
+ "inputs" : [
1091
+ {
1092
+ "internalType" : " uint256" ,
1093
+ "name" : " _disputeID" ,
1094
+ "type" : " uint256"
1095
+ },
1096
+ {
1097
+ "internalType" : " address payable" ,
1098
+ "name" : " _contributor" ,
1099
+ "type" : " address"
1100
+ }
1101
+ ],
1102
+ "name" : " withdrawFeesAndRewardsForAllRoundsAndAllRulings" ,
1103
+ "outputs" : [],
1104
+ "stateMutability" : " nonpayable" ,
1105
+ "type" : " function"
1106
+ },
1107
+ {
1108
+ "inputs" : [
1109
+ {
1110
+ "internalType" : " uint256" ,
1111
+ "name" : " _disputeID" ,
1112
+ "type" : " uint256"
1113
+ },
1114
+ {
1115
+ "internalType" : " address payable" ,
1116
+ "name" : " _contributor" ,
1117
+ "type" : " address"
1118
+ },
1119
+ {
1120
+ "internalType" : " uint256[][]" ,
1121
+ "name" : " positions" ,
1122
+ "type" : " uint256[][]"
1123
+ }
1124
+ ],
1125
+ "name" : " withdrawFeesAndRewardsForGivenPositions" ,
1126
+ "outputs" : [],
1127
+ "stateMutability" : " nonpayable" ,
1128
+ "type" : " function"
1088
1129
}
1089
1130
]
Original file line number Diff line number Diff line change @@ -314,7 +314,7 @@ export function handleWithdrawal(event: Withdrawal): void {
314
314
}
315
315
316
316
const truthPost = TruthPost . bind ( event . address ) ;
317
- userEntity . totalWithdrawableAmount = truthPost . getTotalWithdrawableAmount ( disputeID , event . params . contributor , event . params . ruling ) ;
317
+ userEntity . totalWithdrawableAmount = truthPost . getTotalWithdrawableAmount ( disputeID , event . params . contributor ) . getSum ( ) ;
318
318
319
319
if ( userEntity . totalWithdrawableAmount . equals ( BigInt . fromI32 ( 0 ) ) ) userEntity . withdrew = true ;
320
320
userEntity . save ( ) ;
@@ -330,7 +330,6 @@ export function handleRuling(event: Ruling): void {
330
330
331
331
const contributors = disputeEntity . contributors ;
332
332
const contract = TruthPost . bind ( event . address ) ;
333
- const NUMBER_OF_RULING_OPTIONS = contract . NUMBER_OF_RULING_OPTIONS ( ) ;
334
333
335
334
const contributorsSet = new Set < string > ( ) ;
336
335
for ( let i = 0 ; i < contributors . length ; i ++ ) {
@@ -341,11 +340,9 @@ export function handleRuling(event: Ruling): void {
341
340
342
341
const user = User . load ( contributors [ i ] ) ;
343
342
if ( user ) {
344
- for ( let j = 0 ; j <= NUMBER_OF_RULING_OPTIONS . toI32 ( ) ; j ++ ) {
345
- user . totalWithdrawableAmount = user . totalWithdrawableAmount . plus (
346
- contract . getTotalWithdrawableAmount ( disputeID , Address . fromString ( contributors [ i ] ) , j )
347
- ) ;
348
- }
343
+ user . totalWithdrawableAmount = user . totalWithdrawableAmount . plus (
344
+ contract . getTotalWithdrawableAmount ( disputeID , Address . fromString ( contributors [ i ] ) ) . getSum ( )
345
+ ) ;
349
346
user . save ( ) ;
350
347
}
351
348
}
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ dataSources:
6
6
name : TruthPost
7
7
network : goerli
8
8
source :
9
- address : " 0xAA51402316075798040c2322D0361383577707ba "
9
+ address : " 0x4d4c347f102fe8c01c94d003b9e9a03f5fe67d67 "
10
10
abi : TruthPost
11
- startBlock : 8767469
11
+ startBlock : 8907143
12
12
mapping :
13
13
kind : ethereum/events
14
14
apiVersion : 0.0.6
You can’t perform that action at this time.
0 commit comments