-
Notifications
You must be signed in to change notification settings - Fork 5
/
verifiers.js
292 lines (289 loc) · 8.27 KB
/
verifiers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
/* Verifiers file contains meta data and contract address of all used verifiers
* Data is used for searching possible verifiers in token creation process
*/
const verifierOptions = {
chain: {
values: ["On-Chain", "Off-Chain"],
description:
"Determines whether the verification is done on or off chain",
},
type: {
// Interactive: Requires Claimer to do something
// Non-Interactive: Does not require Claimer to do anything
// Social: Requires other users to do something
values: ["Non-Interactive", "Interactive", "Social"],
description:
"Determines whether the input is verified by other users, the system or both.",
},
claimerInput: {
inputType: [
"System/Sensor generated data",
"User generated data",
"Both",
"None",
],
sensorData: {
values: ["None", "Location", "Time", "Gyroscope"],
description:
"Determines if and which sensor data must be provided by the claimer.",
},
userData: {
values: ["None", "Picture", "Video", "Password", "Address", "File", "GroupID", "Text"],
description:
"Determines if and which content must be provided by the claimer.",
},
},
};
const verifiers = {
Password: {
chain: "On-Chain",
type: "Interactive",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Password",
},
description:
"Approval if the user provides the password matching the one the token creator set.",
requiredAddresses: [],
address: "",
},
PictureSelfChosenApprover: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Picture",
},
description:
"The claimer has to supply a picture, based on which the approver will decide to approve.",
requiredAddresses: [],
address: "",
},
BlockThese: {
chain: "On-Chain",
type: "Non-Interactive",
claimerInput: {
inputType: "System/Sensor generated data",
sensorData: "Address",
userData: "None",
},
description:
"The token creator defines group(s) and/or individual accounts that can not claim a token.",
requiredAddresses: ['Fin4Groups'],
address: "",
},
AllowOnlyThese: {
chain: "On-Chain",
type: "Non-Interactive",
claimerInput: {
inputType: "System/Sensor generated data",
sensorData: "Address",
userData: "None",
},
description:
"The token creator defines group(s) and/or individual accounts that can claim a token while everyone else can not",
requiredAddresses: ['Fin4Groups'],
address: "",
},
Location: {
chain: "On-Chain",
type: "Interactive",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Location",
},
description:
"A location, which is within a radius of a location the token creator defines, needs to be provided.",
requiredAddresses: [],
address: "",
},
SelfApprove: {
chain: "On-Chain",
type: "Interactive",
claimerInput: {
inputType: "None",
sensorData: "None",
userData: "None",
},
description: "Claimers approve their own claim.",
requiredAddresses: [],
address: "",
},
// verifiers that are commented out are not deployed in 2_deploy_contracts.js yet
//SensorOneTimeSignal: {
// type: "Non-Interactive",
// claimerInput: {
// inputType: "User generated data",
// sensorData: "Gyroscope",
// userData: "None",
// },
// description:
// "Approval via a sensor that sends a signal. The token creator specifies the sensor via its ID.",
// address: "",
//},
ApprovalByUsersOrGroups: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "None",
sensorData: "None",
userData: "None",
},
description:
"The token creator specifies one or more user groups, of which one member has to approve.",
requiredAddresses: ['Fin4Groups', 'Fin4Messaging'],
address: "",
},
SpecificAddress: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "None",
sensorData: "None",
userData: "Address",
},
description: "The claimer specifies an address, which has to approve.",
requiredAddresses: ['Fin4Messaging'],
address: "",
},
LimitedVoting: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "File",
},
description: "The proof is sent to the users due to a random mechanism",
requiredAddresses: ['Fin4Messaging', 'Fin4SystemParameters', 'Fin4Reputation', 'Fin4Voting'],
address: "",
},
// verifiers that are commented out are not deployed in 2_deploy_contracts.js yet
//MaximumQuantityPerInterval: {
// chain: "On-Chain",
// type: "Non-Inveractive",
// claimerInput: {
// inputType: "None",
// sensorData: "None",
// userData: "None",
// },
// description:
// "Defines the maximum quantity a user can claim within a specified time interval.",
// address: "",
//},
//MinimumInterval: {
// chain: "On-Chain",
// type: "Non-Inveractive",
// claimerInput: {
// inputType: "None",
// sensorData: "None",
// userData: "None",
// },
// description: "Defines a minimum time that has to pass between claims.",
// address: "",
//},
PictureVoting: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Picture",
},
description:
"The claimer has to supply a picture, based on which the approver will decide to approve.",
requiredAddresses: ['Fin4Messaging', 'Fin4SystemParameters', 'Fin4Reputation', 'Fin4Voting'],
address: "",
},
TokenCreatorApproval: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "None",
sensorData: "None",
userData: "None",
},
description: "The token creator has to approve.",
requiredAddresses: ['Fin4Messaging'],
address: "",
},
VideoVoting: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Video",
},
description:
"The claimer has to supply a video, based on which the approver will decide to approve.",
requiredAddresses: ['Fin4Messaging', 'Fin4SystemParameters', 'Fin4Reputation', 'Fin4Voting'],
address: "",
},
ClaimableOnlyNTimesPerUser: {
chain: "On-Chain",
type: "Non-Interactive",
claimerInput: {
inputType: "None",
sensorData: "None",
userData: "None",
},
description:
"The token creator sets a cap how many times a token can be successfully claimed",
requiredAddresses: [],
address: "",
},
Blocker: {
chain: "On-Chain",
type: "Non-Interactive",
claimerInput: {
inputType: "None",
sensorData: "None",
userData: "None",
},
description: "Reject any claim on this token immediately",
requiredAddresses: [],
address: "",
},
PictureGivenApprovers: {
chain: "On-Chain",
type: "Social",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Picture",
},
description: "Same as the \"Approval by users or groups\" verifier, but including a picture that the claimer has to upload. Approvers base their decision on this picture.",
requiredAddresses: ['Fin4Groups', 'Fin4Messaging'],
address: "",
},
HappyMoment: {
chain: "On-Chain",
type: "Interactive",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Picture",
},
description: "Submit a picture of a happy moment. Submissions will be visible on a public site.",
requiredAddresses: ['Fin4Verifying'],
address: "",
},
Statement: {
chain: "On-Chain",
type: "Interactive",
claimerInput: {
inputType: "User generated data",
sensorData: "None",
userData: "Text",
},
description: "Submit a statement. Submissions will be visible on a public site.",
requiredAddresses: ['Fin4Verifying'],
address: "",
}
};
exports.verifiers = verifiers;
exports.verifierOptions = verifierOptions;