@reality.eth/contracts 3.2.6 → 3.2.7

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.
@@ -0,0 +1,992 @@
1
+ // SPDX-License-Identifier: GPL-3.0-only
2
+
3
+ pragma solidity ^0.8.6;
4
+
5
+ contract BalanceHolder {
6
+
7
+ mapping(address => uint256) public balanceOf;
8
+
9
+ event LogWithdraw(
10
+ address indexed user,
11
+ uint256 amount
12
+ );
13
+
14
+ function withdraw()
15
+ public {
16
+ uint256 bal = balanceOf[msg.sender];
17
+ balanceOf[msg.sender] = 0;
18
+ // payable(msg.sender).transfer(bal); This behaves badly in zksync
19
+ (bool success, ) = payable(msg.sender).call{value: bal}("");
20
+ require(success, "transfer failed");
21
+ emit LogWithdraw(msg.sender, bal);
22
+ }
23
+
24
+ }
25
+
26
+ contract RealityETH_zksync_v3_2 is BalanceHolder {
27
+
28
+ address constant NULL_ADDRESS = address(0);
29
+
30
+ // History hash when no history is created, or history has been cleared
31
+ bytes32 constant NULL_HASH = bytes32(0);
32
+
33
+ // An unitinalized finalize_ts for a question will indicate an unanswered question.
34
+ uint32 constant UNANSWERED = 0;
35
+
36
+ // An unanswered reveal_ts for a commitment will indicate that it does not exist.
37
+ uint256 constant COMMITMENT_NON_EXISTENT = 0;
38
+
39
+ // Commit->reveal timeout is 1/8 of the question timeout (rounded down).
40
+ uint32 constant COMMITMENT_TIMEOUT_RATIO = 8;
41
+
42
+ // Proportion withheld when you claim an earlier bond.
43
+ uint256 constant BOND_CLAIM_FEE_PROPORTION = 40; // One 40th ie 2.5%
44
+
45
+ // Special value representing a question that was answered too soon.
46
+ // bytes32(-2). By convention we use bytes32(-1) for "invalid", although the contract does not handle this.
47
+ bytes32 constant UNRESOLVED_ANSWER = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe;
48
+
49
+ event LogSetQuestionFee(
50
+ address arbitrator,
51
+ uint256 amount
52
+ );
53
+
54
+ event LogNewTemplate(
55
+ uint256 indexed template_id,
56
+ address indexed user,
57
+ string question_text
58
+ );
59
+
60
+ event LogNewQuestion(
61
+ bytes32 indexed question_id,
62
+ address indexed user,
63
+ uint256 template_id,
64
+ string question,
65
+ bytes32 indexed content_hash,
66
+ address arbitrator,
67
+ uint32 timeout,
68
+ uint32 opening_ts,
69
+ uint256 nonce,
70
+ uint256 created
71
+ );
72
+
73
+ event LogMinimumBond(
74
+ bytes32 indexed question_id,
75
+ uint256 min_bond
76
+ );
77
+
78
+ event LogFundAnswerBounty(
79
+ bytes32 indexed question_id,
80
+ uint256 bounty_added,
81
+ uint256 bounty,
82
+ address indexed user
83
+ );
84
+
85
+ event LogNewAnswer(
86
+ bytes32 answer,
87
+ bytes32 indexed question_id,
88
+ bytes32 history_hash,
89
+ address indexed user,
90
+ uint256 bond,
91
+ uint256 ts,
92
+ bool is_commitment
93
+ );
94
+
95
+ event LogAnswerReveal(
96
+ bytes32 indexed question_id,
97
+ address indexed user,
98
+ bytes32 indexed answer_hash,
99
+ bytes32 answer,
100
+ uint256 nonce,
101
+ uint256 bond
102
+ );
103
+
104
+ event LogNotifyOfArbitrationRequest(
105
+ bytes32 indexed question_id,
106
+ address indexed user
107
+ );
108
+
109
+ event LogCancelArbitration(
110
+ bytes32 indexed question_id
111
+ );
112
+
113
+ event LogFinalize(
114
+ bytes32 indexed question_id,
115
+ bytes32 indexed answer
116
+ );
117
+
118
+ event LogClaim(
119
+ bytes32 indexed question_id,
120
+ address indexed user,
121
+ uint256 amount
122
+ );
123
+
124
+ event LogReopenQuestion(
125
+ bytes32 indexed question_id,
126
+ bytes32 indexed reopened_question_id
127
+ );
128
+
129
+ struct Question {
130
+ bytes32 content_hash;
131
+ address arbitrator;
132
+ uint32 opening_ts;
133
+ uint32 timeout;
134
+ uint32 finalize_ts;
135
+ bool is_pending_arbitration;
136
+ uint256 bounty;
137
+ bytes32 best_answer;
138
+ bytes32 history_hash;
139
+ uint256 bond;
140
+ uint256 min_bond;
141
+ }
142
+
143
+ // Stored in a mapping indexed by commitment_id, a hash of commitment hash, question, bond.
144
+ struct Commitment {
145
+ uint32 reveal_ts;
146
+ bool is_revealed;
147
+ bytes32 revealed_answer;
148
+ }
149
+
150
+ // Only used when claiming more bonds than fits into a transaction
151
+ // Stored in a mapping indexed by question_id.
152
+ struct Claim {
153
+ address payee;
154
+ uint256 last_bond;
155
+ uint256 queued_funds;
156
+ }
157
+
158
+ uint256 nextTemplateID = 0;
159
+ mapping(uint256 => uint256) public templates;
160
+ mapping(uint256 => bytes32) public template_hashes;
161
+ mapping(bytes32 => Question) public questions;
162
+ mapping(bytes32 => Claim) public question_claims;
163
+ mapping(bytes32 => Commitment) public commitments;
164
+ mapping(address => uint256) public arbitrator_question_fees;
165
+ mapping(bytes32 => bytes32) public reopened_questions;
166
+ mapping(bytes32 => bool) public reopener_questions;
167
+
168
+
169
+ modifier onlyArbitrator(bytes32 question_id) {
170
+ require(msg.sender == questions[question_id].arbitrator, "msg.sender must be arbitrator");
171
+ _;
172
+ }
173
+
174
+ modifier stateAny() {
175
+ _;
176
+ }
177
+
178
+ modifier stateNotCreated(bytes32 question_id) {
179
+ require(questions[question_id].timeout == 0, "question must not exist");
180
+ _;
181
+ }
182
+
183
+ modifier stateOpen(bytes32 question_id) {
184
+ require(questions[question_id].timeout > 0, "question must exist");
185
+ require(!questions[question_id].is_pending_arbitration, "question must not be pending arbitration");
186
+ uint32 finalize_ts = questions[question_id].finalize_ts;
187
+ require(finalize_ts == UNANSWERED || finalize_ts > uint32(block.timestamp), "finalization deadline must not have passed");
188
+ uint32 opening_ts = questions[question_id].opening_ts;
189
+ require(opening_ts == 0 || opening_ts <= uint32(block.timestamp), "opening date must have passed");
190
+ _;
191
+ }
192
+
193
+ modifier statePendingArbitration(bytes32 question_id) {
194
+ require(questions[question_id].is_pending_arbitration, "question must be pending arbitration");
195
+ _;
196
+ }
197
+
198
+ modifier stateOpenOrPendingArbitration(bytes32 question_id) {
199
+ require(questions[question_id].timeout > 0, "question must exist");
200
+ uint32 finalize_ts = questions[question_id].finalize_ts;
201
+ require(finalize_ts == UNANSWERED || finalize_ts > uint32(block.timestamp), "finalization dealine must not have passed");
202
+ uint32 opening_ts = questions[question_id].opening_ts;
203
+ require(opening_ts == 0 || opening_ts <= uint32(block.timestamp), "opening date must have passed");
204
+ _;
205
+ }
206
+
207
+ modifier stateFinalized(bytes32 question_id) {
208
+ require(isFinalized(question_id), "question must be finalized");
209
+ _;
210
+ }
211
+
212
+ modifier bondMustDoubleAndMatchMinimum(bytes32 question_id) {
213
+ require(msg.value > 0, "bond must be positive");
214
+ uint256 current_bond = questions[question_id].bond;
215
+ if (current_bond == 0) {
216
+ require(msg.value >= (questions[question_id].min_bond), "bond must exceed the minimum");
217
+ } else {
218
+ require(msg.value >= (current_bond * 2), "bond must be double at least previous bond");
219
+ }
220
+ _;
221
+ }
222
+
223
+ modifier previousBondMustNotBeatMaxPrevious(bytes32 question_id, uint256 max_previous) {
224
+ if (max_previous > 0) {
225
+ require(questions[question_id].bond <= max_previous, "bond must exceed max_previous");
226
+ }
227
+ _;
228
+ }
229
+
230
+ /// @notice Constructor, sets up some initial templates
231
+ /// @dev Creates some generalized templates for different question types used in the DApp.
232
+ constructor() {
233
+ createTemplate('{"title": "%s", "type": "bool", "description": "%s", "lang": "%s"}');
234
+ createTemplate('{"title": "%s", "type": "uint", "decimals": 18, "description": "%s", "lang": "%s"}');
235
+ createTemplate('{"title": "%s", "type": "single-select", "outcomes": [%s], "description": "%s", "lang": "%s"}');
236
+ createTemplate('{"title": "%s", "type": "multiple-select", "outcomes": [%s], "description": "%s", "lang": "%s"}');
237
+ createTemplate('{"title": "%s", "type": "datetime", "description": "%s", "lang": "%s"}');
238
+ createTemplate('{"title": "%s", "type": "hash", "description": "%s", "lang": "%s"}');
239
+ }
240
+
241
+ /// @notice Function for arbitrator to set an optional per-question fee.
242
+ /// @dev The per-question fee, charged when a question is asked, is intended as an anti-spam measure.
243
+ /// @param fee The fee to be charged by the arbitrator when a question is asked
244
+ function setQuestionFee(uint256 fee)
245
+ stateAny()
246
+ external {
247
+ arbitrator_question_fees[msg.sender] = fee;
248
+ emit LogSetQuestionFee(msg.sender, fee);
249
+ }
250
+
251
+ /// @notice Create a reusable template, which should be a JSON document.
252
+ /// Placeholders should use gettext() syntax, eg %s.
253
+ /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
254
+ /// @param content The template content
255
+ /// @return The ID of the newly-created template, which is created sequentially.
256
+ function createTemplate(string memory content)
257
+ stateAny()
258
+ public returns (uint256) {
259
+ uint256 id = nextTemplateID;
260
+ templates[id] = block.number;
261
+ template_hashes[id] = keccak256(abi.encodePacked(content));
262
+ emit LogNewTemplate(id, msg.sender, content);
263
+ nextTemplateID = id + 1;
264
+ return id;
265
+ }
266
+
267
+ /// @notice Create a new reusable template and use it to ask a question
268
+ /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
269
+ /// @param content The template content
270
+ /// @param question A string containing the parameters that will be passed into the template to make the question
271
+ /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
272
+ /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
273
+ /// @param opening_ts If set, the earliest time it should be possible to answer the question.
274
+ /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
275
+ /// @return The ID of the newly-created template, which is created sequentially.
276
+ function createTemplateAndAskQuestion(
277
+ string memory content,
278
+ string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce
279
+ )
280
+ // stateNotCreated is enforced by the internal _askQuestion
281
+ public payable returns (bytes32) {
282
+ uint256 template_id = createTemplate(content);
283
+ return askQuestion(template_id, question, arbitrator, timeout, opening_ts, nonce);
284
+ }
285
+
286
+ /// @notice Ask a new question and return the ID
287
+ /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
288
+ /// @param template_id The ID number of the template the question will use
289
+ /// @param question A string containing the parameters that will be passed into the template to make the question
290
+ /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
291
+ /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
292
+ /// @param opening_ts If set, the earliest time it should be possible to answer the question.
293
+ /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
294
+ /// @return The ID of the newly-created question, created deterministically.
295
+ function askQuestion(uint256 template_id, string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce)
296
+ // stateNotCreated is enforced by the internal _askQuestion
297
+ public payable returns (bytes32) {
298
+
299
+ require(templates[template_id] > 0, "template must exist");
300
+
301
+ bytes32 content_hash = keccak256(abi.encodePacked(template_id, opening_ts, question));
302
+ bytes32 question_id = keccak256(abi.encodePacked(content_hash, arbitrator, timeout, uint256(0), address(this), msg.sender, nonce));
303
+
304
+ // We emit this event here because _askQuestion doesn't need to know the unhashed question. Other events are emitted by _askQuestion.
305
+ emit LogNewQuestion(question_id, msg.sender, template_id, question, content_hash, arbitrator, timeout, opening_ts, nonce, block.timestamp);
306
+ _askQuestion(question_id, content_hash, arbitrator, timeout, opening_ts, 0);
307
+
308
+ return question_id;
309
+ }
310
+
311
+ /// @notice Ask a new question and return the ID
312
+ /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
313
+ /// @param template_id The ID number of the template the question will use
314
+ /// @param question A string containing the parameters that will be passed into the template to make the question
315
+ /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
316
+ /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
317
+ /// @param opening_ts If set, the earliest time it should be possible to answer the question.
318
+ /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
319
+ /// @param min_bond The minimum bond that may be used for an answer.
320
+ /// @return The ID of the newly-created question, created deterministically.
321
+ function askQuestionWithMinBond(uint256 template_id, string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond)
322
+ // stateNotCreated is enforced by the internal _askQuestion
323
+ public payable returns (bytes32) {
324
+
325
+ require(templates[template_id] > 0, "template must exist");
326
+
327
+ bytes32 content_hash = keccak256(abi.encodePacked(template_id, opening_ts, question));
328
+ bytes32 question_id = keccak256(abi.encodePacked(content_hash, arbitrator, timeout, min_bond, address(this), msg.sender, nonce));
329
+
330
+ // We emit this event here because _askQuestion doesn't need to know the unhashed question.
331
+ // Other events are emitted by _askQuestion.
332
+ emit LogNewQuestion(question_id, msg.sender, template_id, question, content_hash, arbitrator, timeout, opening_ts, nonce, block.timestamp);
333
+ _askQuestion(question_id, content_hash, arbitrator, timeout, opening_ts, min_bond);
334
+
335
+ return question_id;
336
+ }
337
+
338
+ function _askQuestion(bytes32 question_id, bytes32 content_hash, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 min_bond)
339
+ stateNotCreated(question_id)
340
+ internal {
341
+
342
+ // A timeout of 0 makes no sense, and we will use this to check existence
343
+ require(timeout > 0, "timeout must be positive");
344
+ require(timeout < 365 days, "timeout must be less than 365 days");
345
+
346
+ uint256 bounty = msg.value;
347
+
348
+ // The arbitrator can set a fee for asking a question.
349
+ // This is intended as an anti-spam defence.
350
+ // The fee is waived if the arbitrator is asking the question.
351
+ // This allows them to set an impossibly high fee and make users proxy the question through them.
352
+ // This would allow more sophisticated pricing, question whitelisting etc.
353
+ if (arbitrator != NULL_ADDRESS && msg.sender != arbitrator) {
354
+ uint256 question_fee = arbitrator_question_fees[arbitrator];
355
+ require(bounty >= question_fee, "ETH provided must cover question fee");
356
+ bounty = bounty - question_fee;
357
+ balanceOf[arbitrator] = balanceOf[arbitrator] + question_fee;
358
+ }
359
+
360
+ questions[question_id].content_hash = content_hash;
361
+ questions[question_id].arbitrator = arbitrator;
362
+ questions[question_id].opening_ts = opening_ts;
363
+ questions[question_id].timeout = timeout;
364
+
365
+ if (bounty > 0) {
366
+ questions[question_id].bounty = bounty;
367
+ emit LogFundAnswerBounty(question_id, bounty, bounty, msg.sender);
368
+ }
369
+
370
+ if (min_bond > 0) {
371
+ questions[question_id].min_bond = min_bond;
372
+ emit LogMinimumBond(question_id, min_bond);
373
+ }
374
+
375
+ }
376
+
377
+ /// @notice Add funds to the bounty for a question
378
+ /// @dev Add bounty funds after the initial question creation. Can be done any time until the question is finalized.
379
+ /// @param question_id The ID of the question you wish to fund
380
+ function fundAnswerBounty(bytes32 question_id)
381
+ stateOpen(question_id)
382
+ external payable {
383
+ questions[question_id].bounty = questions[question_id].bounty + msg.value;
384
+ emit LogFundAnswerBounty(question_id, msg.value, questions[question_id].bounty, msg.sender);
385
+ }
386
+
387
+ /// @notice Submit an answer for a question.
388
+ /// @dev Adds the answer to the history and updates the current "best" answer.
389
+ /// May be subject to front-running attacks; Substitute submitAnswerCommitment()->submitAnswerReveal() to prevent them.
390
+ /// @param question_id The ID of the question
391
+ /// @param answer The answer, encoded into bytes32
392
+ /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
393
+ function submitAnswer(bytes32 question_id, bytes32 answer, uint256 max_previous)
394
+ stateOpen(question_id)
395
+ bondMustDoubleAndMatchMinimum(question_id)
396
+ previousBondMustNotBeatMaxPrevious(question_id, max_previous)
397
+ external payable {
398
+ _addAnswerToHistory(question_id, answer, msg.sender, msg.value, false);
399
+ _updateCurrentAnswer(question_id, answer);
400
+ }
401
+
402
+ /// @notice Submit an answer for a question, crediting it to the specified account.
403
+ /// @dev Adds the answer to the history and updates the current "best" answer.
404
+ /// May be subject to front-running attacks; Substitute submitAnswerCommitment()->submitAnswerReveal() to prevent them.
405
+ /// @param question_id The ID of the question
406
+ /// @param answer The answer, encoded into bytes32
407
+ /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
408
+ /// @param answerer The account to which the answer should be credited
409
+ function submitAnswerFor(bytes32 question_id, bytes32 answer, uint256 max_previous, address answerer)
410
+ stateOpen(question_id)
411
+ bondMustDoubleAndMatchMinimum(question_id)
412
+ previousBondMustNotBeatMaxPrevious(question_id, max_previous)
413
+ external payable {
414
+ require(answerer != NULL_ADDRESS, "answerer must be non-zero");
415
+ _addAnswerToHistory(question_id, answer, answerer, msg.value, false);
416
+ _updateCurrentAnswer(question_id, answer);
417
+ }
418
+
419
+ // @notice Verify and store a commitment, including an appropriate timeout
420
+ // @param question_id The ID of the question to store
421
+ // @param commitment The ID of the commitment
422
+ function _storeCommitment(bytes32 question_id, bytes32 commitment_id)
423
+ internal
424
+ {
425
+ require(commitments[commitment_id].reveal_ts == COMMITMENT_NON_EXISTENT, "commitment must not already exist");
426
+
427
+ uint32 commitment_timeout = questions[question_id].timeout / COMMITMENT_TIMEOUT_RATIO;
428
+ commitments[commitment_id].reveal_ts = uint32(block.timestamp) + commitment_timeout;
429
+ }
430
+
431
+ /// @notice Submit the hash of an answer, laying your claim to that answer if you reveal it in a subsequent transaction.
432
+ /// @dev Creates a hash, commitment_id, uniquely identifying this answer, to this question, with this bond.
433
+ /// The commitment_id is stored in the answer history where the answer would normally go.
434
+ /// Does not update the current best answer - this is left to the later submitAnswerReveal() transaction.
435
+ /// @param question_id The ID of the question
436
+ /// @param answer_hash The hash of your answer, plus a nonce that you will later reveal
437
+ /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
438
+ /// @param _answerer If specified, the address to be given as the question answerer. Defaults to the sender.
439
+ /// @dev Specifying the answerer is useful if you want to delegate the commit-and-reveal to a third-party.
440
+ function submitAnswerCommitment(bytes32 question_id, bytes32 answer_hash, uint256 max_previous, address _answerer)
441
+ stateOpen(question_id)
442
+ bondMustDoubleAndMatchMinimum(question_id)
443
+ previousBondMustNotBeatMaxPrevious(question_id, max_previous)
444
+ external payable {
445
+
446
+ bytes32 commitment_id = keccak256(abi.encodePacked(question_id, answer_hash, msg.value));
447
+ address answerer = (_answerer == NULL_ADDRESS) ? msg.sender : _answerer;
448
+ _storeCommitment(question_id, commitment_id);
449
+ _addAnswerToHistory(question_id, commitment_id, answerer, msg.value, true);
450
+
451
+ }
452
+
453
+ /// @notice Submit the answer whose hash you sent in a previous submitAnswerCommitment() transaction
454
+ /// @dev Checks the parameters supplied recreate an existing commitment, and stores the revealed answer
455
+ /// Updates the current answer unless someone has since supplied a new answer with a higher bond
456
+ /// msg.sender is intentionally not restricted to the user who originally sent the commitment;
457
+ /// For example, the user may want to provide the answer+nonce to a third-party service and let them send the tx
458
+ /// NB If we are pending arbitration, it will be up to the arbitrator to wait and see any outstanding reveal is sent
459
+ /// @param question_id The ID of the question
460
+ /// @param answer The answer, encoded as bytes32
461
+ /// @param nonce The nonce that, combined with the answer, recreates the answer_hash you gave in submitAnswerCommitment()
462
+ /// @param bond The bond that you paid in your submitAnswerCommitment() transaction
463
+ function submitAnswerReveal(bytes32 question_id, bytes32 answer, uint256 nonce, uint256 bond)
464
+ stateOpenOrPendingArbitration(question_id)
465
+ external {
466
+
467
+ bytes32 answer_hash = keccak256(abi.encodePacked(answer, nonce));
468
+ bytes32 commitment_id = keccak256(abi.encodePacked(question_id, answer_hash, bond));
469
+
470
+ require(!commitments[commitment_id].is_revealed, "commitment must not have been revealed yet");
471
+ require(commitments[commitment_id].reveal_ts > uint32(block.timestamp), "reveal deadline must not have passed");
472
+
473
+ commitments[commitment_id].revealed_answer = answer;
474
+ commitments[commitment_id].is_revealed = true;
475
+
476
+ if (bond == questions[question_id].bond) {
477
+ _updateCurrentAnswer(question_id, answer);
478
+ }
479
+
480
+ emit LogAnswerReveal(question_id, msg.sender, answer_hash, answer, nonce, bond);
481
+
482
+ }
483
+
484
+ function _addAnswerToHistory(bytes32 question_id, bytes32 answer_or_commitment_id, address answerer, uint256 bond, bool is_commitment)
485
+ internal
486
+ {
487
+ bytes32 new_history_hash = keccak256(abi.encodePacked(questions[question_id].history_hash, answer_or_commitment_id, bond, answerer, is_commitment));
488
+
489
+ // Update the current bond level, if there's a bond (ie anything except arbitration)
490
+ if (bond > 0) {
491
+ questions[question_id].bond = bond;
492
+ }
493
+ questions[question_id].history_hash = new_history_hash;
494
+
495
+ emit LogNewAnswer(answer_or_commitment_id, question_id, new_history_hash, answerer, bond, block.timestamp, is_commitment);
496
+ }
497
+
498
+ function _updateCurrentAnswer(bytes32 question_id, bytes32 answer)
499
+ internal {
500
+ questions[question_id].best_answer = answer;
501
+ questions[question_id].finalize_ts = uint32(block.timestamp) + questions[question_id].timeout;
502
+ }
503
+
504
+ // Like _updateCurrentAnswer but without advancing the timeout
505
+ function _updateCurrentAnswerByArbitrator(bytes32 question_id, bytes32 answer)
506
+ internal {
507
+ questions[question_id].best_answer = answer;
508
+ questions[question_id].finalize_ts = uint32(block.timestamp);
509
+ }
510
+
511
+ /// @notice Notify the contract that the arbitrator has been paid for a question, freezing it pending their decision.
512
+ /// @dev The arbitrator contract is trusted to only call this if they've been paid, and tell us who paid them.
513
+ /// @param question_id The ID of the question
514
+ /// @param requester The account that requested arbitration
515
+ /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
516
+ function notifyOfArbitrationRequest(bytes32 question_id, address requester, uint256 max_previous)
517
+ onlyArbitrator(question_id)
518
+ stateOpen(question_id)
519
+ previousBondMustNotBeatMaxPrevious(question_id, max_previous)
520
+ external {
521
+ require(questions[question_id].finalize_ts > UNANSWERED, "Question must already have an answer when arbitration is requested");
522
+ questions[question_id].is_pending_arbitration = true;
523
+ emit LogNotifyOfArbitrationRequest(question_id, requester);
524
+ }
525
+
526
+ /// @notice Cancel a previously-requested arbitration and extend the timeout
527
+ /// @dev Useful when doing arbitration across chains that can't be requested atomically
528
+ /// @param question_id The ID of the question
529
+ function cancelArbitration(bytes32 question_id)
530
+ onlyArbitrator(question_id)
531
+ statePendingArbitration(question_id)
532
+ external {
533
+ questions[question_id].is_pending_arbitration = false;
534
+ questions[question_id].finalize_ts = uint32(block.timestamp) + questions[question_id].timeout;
535
+ emit LogCancelArbitration(question_id);
536
+ }
537
+
538
+ /// @notice Submit the answer for a question, for use by the arbitrator.
539
+ /// @dev Doesn't require (or allow) a bond.
540
+ /// If the current final answer is correct, the account should be whoever submitted it.
541
+ /// If the current final answer is wrong, the account should be whoever paid for arbitration.
542
+ /// However, the answerer stipulations are not enforced by the contract.
543
+ /// @param question_id The ID of the question
544
+ /// @param answer The answer, encoded into bytes32
545
+ /// @param answerer The account credited with this answer for the purpose of bond claims
546
+ function submitAnswerByArbitrator(bytes32 question_id, bytes32 answer, address answerer)
547
+ onlyArbitrator(question_id)
548
+ statePendingArbitration(question_id)
549
+ public {
550
+
551
+ require(answerer != NULL_ADDRESS, "answerer must be provided");
552
+ emit LogFinalize(question_id, answer);
553
+
554
+ questions[question_id].is_pending_arbitration = false;
555
+ _addAnswerToHistory(question_id, answer, answerer, 0, false);
556
+ _updateCurrentAnswerByArbitrator(question_id, answer);
557
+
558
+ }
559
+
560
+ /// @notice Submit the answer for a question, for use by the arbitrator, working out the appropriate winner based on the last answer details.
561
+ /// @dev Doesn't require (or allow) a bond.
562
+ /// @param question_id The ID of the question
563
+ /// @param answer The answer, encoded into bytes32
564
+ /// @param payee_if_wrong The account to by credited as winner if the last answer given is wrong, usually the account that paid the arbitrator
565
+ /// @param last_history_hash The history hash before the final one
566
+ /// @param last_answer_or_commitment_id The last answer given, or the commitment ID if it was a commitment.
567
+ /// @param last_answerer The address that supplied the last answer
568
+ function assignWinnerAndSubmitAnswerByArbitrator(bytes32 question_id, bytes32 answer, address payee_if_wrong, bytes32 last_history_hash, bytes32 last_answer_or_commitment_id, address last_answerer)
569
+ external {
570
+ bool is_commitment = _verifyHistoryInputOrRevert(questions[question_id].history_hash, last_history_hash, last_answer_or_commitment_id, questions[question_id].bond, last_answerer);
571
+
572
+ address payee;
573
+ // If the last answer is an unrevealed commit, it's always wrong.
574
+ // For anything else, the last answer was set as the "best answer" in submitAnswer or submitAnswerReveal.
575
+ if (is_commitment && !commitments[last_answer_or_commitment_id].is_revealed) {
576
+ require(commitments[last_answer_or_commitment_id].reveal_ts < uint32(block.timestamp), "You must wait for the reveal deadline before finalizing");
577
+ payee = payee_if_wrong;
578
+ } else {
579
+ payee = (questions[question_id].best_answer == answer) ? last_answerer : payee_if_wrong;
580
+ }
581
+ submitAnswerByArbitrator(question_id, answer, payee);
582
+ }
583
+
584
+
585
+ /// @notice Report whether the answer to the specified question is finalized
586
+ /// @param question_id The ID of the question
587
+ /// @return Return true if finalized
588
+ function isFinalized(bytes32 question_id)
589
+ view public returns (bool) {
590
+ uint32 finalize_ts = questions[question_id].finalize_ts;
591
+ return ( !questions[question_id].is_pending_arbitration && (finalize_ts > UNANSWERED) && (finalize_ts <= uint32(block.timestamp)) );
592
+ }
593
+
594
+ /// @notice (Deprecated) Return the final answer to the specified question, or revert if there isn't one
595
+ /// @param question_id The ID of the question
596
+ /// @return The answer formatted as a bytes32
597
+ function getFinalAnswer(bytes32 question_id)
598
+ stateFinalized(question_id)
599
+ external view returns (bytes32) {
600
+ return questions[question_id].best_answer;
601
+ }
602
+
603
+ /// @notice Return the final answer to the specified question, or revert if there isn't one
604
+ /// @param question_id The ID of the question
605
+ /// @return The answer formatted as a bytes32
606
+ function resultFor(bytes32 question_id)
607
+ stateFinalized(question_id)
608
+ public view returns (bytes32) {
609
+ return questions[question_id].best_answer;
610
+ }
611
+
612
+ /// @notice Returns whether the question was answered before it had an answer, ie resolved to UNRESOLVED_ANSWER
613
+ /// @param question_id The ID of the question
614
+ function isSettledTooSoon(bytes32 question_id)
615
+ public view returns(bool) {
616
+ return (resultFor(question_id) == UNRESOLVED_ANSWER);
617
+ }
618
+
619
+ /// @notice Like resultFor(), but errors out if settled too soon, or returns the result of a replacement if it was reopened at the right time and settled
620
+ /// @param question_id The ID of the question
621
+ function resultForOnceSettled(bytes32 question_id)
622
+ external view returns(bytes32) {
623
+ bytes32 result = resultFor(question_id);
624
+ if (result == UNRESOLVED_ANSWER) {
625
+ // Try the replacement
626
+ bytes32 replacement_id = reopened_questions[question_id];
627
+ require(replacement_id != bytes32(0x0), "Question was settled too soon and has not been reopened");
628
+ // We only try one layer down rather than recursing to keep the gas costs predictable
629
+ result = resultFor(replacement_id);
630
+ require(result != UNRESOLVED_ANSWER, "Question replacement was settled too soon and has not been reopened");
631
+ }
632
+ return result;
633
+ }
634
+
635
+ /// @notice Asks a new question reopening a previously-asked question that was settled too soon
636
+ /// @dev A special version of askQuestion() that replaces a previous question that was settled too soon
637
+ /// @param template_id The ID number of the template the question will use
638
+ /// @param question A string containing the parameters that will be passed into the template to make the question
639
+ /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
640
+ /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
641
+ /// @param opening_ts If set, the earliest time it should be possible to answer the question.
642
+ /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
643
+ /// @param min_bond The minimum bond that can be used to provide the first answer.
644
+ /// @param reopens_question_id The ID of the question this reopens
645
+ /// @return The ID of the newly-created question, created deterministically.
646
+ function reopenQuestion(uint256 template_id, string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond, bytes32 reopens_question_id)
647
+ // stateNotCreated is enforced by the internal _askQuestion
648
+ public payable returns (bytes32) {
649
+
650
+ require(isSettledTooSoon(reopens_question_id), "You can only reopen questions that resolved as settled too soon");
651
+
652
+ bytes32 content_hash = keccak256(abi.encodePacked(template_id, opening_ts, question));
653
+
654
+ // A reopening must exactly match the original question, except for the nonce and the creator
655
+ require(content_hash == questions[reopens_question_id].content_hash, "content hash mismatch");
656
+ require(arbitrator == questions[reopens_question_id].arbitrator, "arbitrator mismatch");
657
+ require(timeout == questions[reopens_question_id].timeout, "timeout mismatch");
658
+ require(opening_ts == questions[reopens_question_id].opening_ts , "opening_ts mismatch");
659
+ require(min_bond == questions[reopens_question_id].min_bond, "min_bond mismatch");
660
+
661
+ // If the the question was itself reopening some previous question, you'll have to re-reopen the previous question first.
662
+ // This ensures the bounty can be passed on to the next attempt of the original question.
663
+ require(!reopener_questions[reopens_question_id], "Question is already reopening a previous question");
664
+
665
+ // A question can only be reopened once, unless the reopening was also settled too soon in which case it can be replaced
666
+ bytes32 existing_reopen_question_id = reopened_questions[reopens_question_id];
667
+
668
+ // Normally when we reopen a question we will take its bounty and pass it on to the reopened version.
669
+ bytes32 take_bounty_from_question_id = reopens_question_id;
670
+ // If the question has already been reopened but was again settled too soon, we can transfer its bounty to the next attempt.
671
+ if (existing_reopen_question_id != bytes32(0)) {
672
+ require(isSettledTooSoon(existing_reopen_question_id), "Question has already been reopened");
673
+ // We'll overwrite the reopening with our new question and move the bounty.
674
+ // Once that's done we'll detach the failed reopener and you'll be able to reopen that too if you really want, but without the bounty.
675
+ reopener_questions[existing_reopen_question_id] = false;
676
+ take_bounty_from_question_id = existing_reopen_question_id;
677
+ }
678
+
679
+ bytes32 question_id = askQuestionWithMinBond(template_id, question, arbitrator, timeout, opening_ts, nonce, min_bond);
680
+
681
+ reopened_questions[reopens_question_id] = question_id;
682
+ reopener_questions[question_id] = true;
683
+
684
+ questions[question_id].bounty = questions[take_bounty_from_question_id].bounty + questions[question_id].bounty;
685
+ questions[take_bounty_from_question_id].bounty = 0;
686
+
687
+ emit LogReopenQuestion(question_id, reopens_question_id);
688
+
689
+ return question_id;
690
+ }
691
+
692
+ /// @notice Return the final answer to the specified question, provided it matches the specified criteria.
693
+ /// @dev Reverts if the question is not finalized, or if it does not match the specified criteria.
694
+ /// @param question_id The ID of the question
695
+ /// @param content_hash The hash of the question content (template ID + opening time + question parameter string)
696
+ /// @param arbitrator The arbitrator chosen for the question (regardless of whether they are asked to arbitrate)
697
+ /// @param min_timeout The timeout set in the initial question settings must be this high or higher
698
+ /// @param min_bond The bond sent with the final answer must be this high or higher
699
+ /// @return The answer formatted as a bytes32
700
+ function getFinalAnswerIfMatches(
701
+ bytes32 question_id,
702
+ bytes32 content_hash, address arbitrator, uint32 min_timeout, uint256 min_bond
703
+ )
704
+ stateFinalized(question_id)
705
+ external view returns (bytes32) {
706
+ require(content_hash == questions[question_id].content_hash, "content hash must match");
707
+ require(arbitrator == questions[question_id].arbitrator, "arbitrator must match");
708
+ require(min_timeout <= questions[question_id].timeout, "timeout must be long enough");
709
+ require(min_bond <= questions[question_id].bond, "bond must be high enough");
710
+ return questions[question_id].best_answer;
711
+ }
712
+
713
+ /// @notice Assigns the winnings (bounty and bonds) to everyone who gave the accepted answer
714
+ /// Caller must provide the answer history, in reverse order
715
+ /// @dev Works up the chain and assign bonds to the person who gave the right answer
716
+ /// If someone gave the winning answer earlier, they must get paid from the higher bond
717
+ /// That means we can't pay out the bond added at n until we have looked at n-1
718
+ /// The first answer is authenticated by checking against the stored history_hash.
719
+ /// One of the inputs to history_hash is the history_hash before it, so we use that to authenticate the next entry, etc
720
+ /// Once we get to a null hash we'll know we're done and there are no more answers.
721
+ /// Usually you would call the whole thing in a single transaction, but if not then the data is persisted to pick up later.
722
+ /// @param question_id The ID of the question
723
+ /// @param history_hashes Second-last-to-first, the hash of each history entry. (Final one should be empty).
724
+ /// @param addrs Last-to-first, the address of each answerer or commitment sender
725
+ /// @param bonds Last-to-first, the bond supplied with each answer or commitment
726
+ /// @param answers Last-to-first, each answer supplied, or commitment ID if the answer was supplied with commit->reveal
727
+ function claimWinnings(
728
+ bytes32 question_id,
729
+ bytes32[] memory history_hashes, address[] memory addrs, uint256[] memory bonds, bytes32[] memory answers
730
+ )
731
+ stateFinalized(question_id)
732
+ public {
733
+
734
+ require(history_hashes.length > 0, "at least one history hash entry must be provided");
735
+
736
+ // These are only set if we split our claim over multiple transactions.
737
+ address payee = question_claims[question_id].payee;
738
+ uint256 last_bond = question_claims[question_id].last_bond;
739
+ uint256 queued_funds = question_claims[question_id].queued_funds;
740
+
741
+ // Starts as the hash of the final answer submitted. It'll be cleared when we're done.
742
+ // If we're splitting the claim over multiple transactions, it'll be the hash where we left off last time
743
+ bytes32 last_history_hash = questions[question_id].history_hash;
744
+
745
+ bytes32 best_answer = questions[question_id].best_answer;
746
+
747
+ uint256 i;
748
+ for (i = 0; i < history_hashes.length; i++) {
749
+
750
+ // Check input against the history hash, and see which of 2 possible values of is_commitment fits.
751
+ bool is_commitment = _verifyHistoryInputOrRevert(last_history_hash, history_hashes[i], answers[i], bonds[i], addrs[i]);
752
+
753
+ queued_funds = queued_funds + last_bond;
754
+ (queued_funds, payee) = _processHistoryItem(
755
+ question_id, best_answer, queued_funds, payee,
756
+ addrs[i], bonds[i], answers[i], is_commitment);
757
+
758
+ // Line the bond up for next time, when it will be added to somebody's queued_funds
759
+ last_bond = bonds[i];
760
+
761
+ // Burn (just leave in contract balance) a fraction of all bonds except the final one.
762
+ // This creates a cost to increasing your own bond, which could be used to delay resolution maliciously
763
+ if (last_bond != questions[question_id].bond) {
764
+ last_bond = last_bond - last_bond / BOND_CLAIM_FEE_PROPORTION;
765
+ }
766
+
767
+ last_history_hash = history_hashes[i];
768
+
769
+ }
770
+
771
+ if (last_history_hash != NULL_HASH) {
772
+ // We haven't yet got to the null hash (1st answer), ie the caller didn't supply the full answer chain.
773
+ // Persist the details so we can pick up later where we left off later.
774
+
775
+ // If we know who to pay we can go ahead and pay them out, only keeping back last_bond
776
+ // (We always know who to pay unless all we saw were unrevealed commits)
777
+ if (payee != NULL_ADDRESS) {
778
+ _payPayee(question_id, payee, queued_funds);
779
+ queued_funds = 0;
780
+ }
781
+
782
+ question_claims[question_id].payee = payee;
783
+ question_claims[question_id].last_bond = last_bond;
784
+ question_claims[question_id].queued_funds = queued_funds;
785
+ } else {
786
+ // There is nothing left below us so the payee can keep what remains
787
+ _payPayee(question_id, payee, queued_funds + last_bond);
788
+ delete question_claims[question_id];
789
+ }
790
+
791
+ questions[question_id].history_hash = last_history_hash;
792
+
793
+ }
794
+
795
+ function _payPayee(bytes32 question_id, address payee, uint256 value)
796
+ internal {
797
+ balanceOf[payee] = balanceOf[payee] + value;
798
+ emit LogClaim(question_id, payee, value);
799
+ }
800
+
801
+ function _verifyHistoryInputOrRevert(
802
+ bytes32 last_history_hash,
803
+ bytes32 history_hash, bytes32 answer, uint256 bond, address addr
804
+ )
805
+ internal pure returns (bool) {
806
+ if (last_history_hash == keccak256(abi.encodePacked(history_hash, answer, bond, addr, true)) ) {
807
+ return true;
808
+ }
809
+ if (last_history_hash == keccak256(abi.encodePacked(history_hash, answer, bond, addr, false)) ) {
810
+ return false;
811
+ }
812
+ revert("History input provided did not match the expected hash");
813
+ }
814
+
815
+ function _processHistoryItem(
816
+ bytes32 question_id, bytes32 best_answer,
817
+ uint256 queued_funds, address payee,
818
+ address addr, uint256 bond, bytes32 answer, bool is_commitment
819
+ )
820
+ internal returns (uint256, address) {
821
+
822
+ // For commit-and-reveal, the answer history holds the commitment ID instead of the answer.
823
+ // We look at the referenced commitment ID and switch in the actual answer.
824
+ if (is_commitment) {
825
+ bytes32 commitment_id = answer;
826
+ // If it's a commit but it hasn't been revealed, it will always be considered wrong.
827
+ if (!commitments[commitment_id].is_revealed) {
828
+ delete commitments[commitment_id];
829
+ return (queued_funds, payee);
830
+ } else {
831
+ answer = commitments[commitment_id].revealed_answer;
832
+ delete commitments[commitment_id];
833
+ }
834
+ }
835
+
836
+ if (answer == best_answer) {
837
+
838
+ if (payee == NULL_ADDRESS) {
839
+
840
+ // The entry is for the first payee we come to, ie the winner.
841
+ // They get the question bounty.
842
+ payee = addr;
843
+
844
+ if (best_answer != UNRESOLVED_ANSWER && questions[question_id].bounty > 0) {
845
+ _payPayee(question_id, payee, questions[question_id].bounty);
846
+ questions[question_id].bounty = 0;
847
+ }
848
+
849
+ } else if (addr != payee) {
850
+
851
+ // Answerer has changed, ie we found someone lower down who needs to be paid
852
+
853
+ // The lower answerer will take over receiving bonds from higher answerer.
854
+ // They should also be paid the takeover fee, which is set at a rate equivalent to their bond.
855
+ // (This is our arbitrary rule, to give consistent right-answerers a defence against high-rollers.)
856
+
857
+ // There should be enough for the fee, but if not, take what we have.
858
+ // There's an edge case involving weird arbitrator behaviour where we may be short.
859
+ uint256 answer_takeover_fee = (queued_funds >= bond) ? bond : queued_funds;
860
+ // Settle up with the old (higher-bonded) payee
861
+ _payPayee(question_id, payee, queued_funds - answer_takeover_fee);
862
+
863
+ // Now start queued_funds again for the new (lower-bonded) payee
864
+ payee = addr;
865
+ queued_funds = answer_takeover_fee;
866
+
867
+ }
868
+
869
+ }
870
+
871
+ return (queued_funds, payee);
872
+
873
+ }
874
+
875
+ /// @notice Convenience function to assign bounties/bonds for multiple questions in one go, then withdraw all your funds.
876
+ /// Caller must provide the answer history for each question, in reverse order
877
+ /// @dev Can be called by anyone to assign bonds/bounties, but funds are only withdrawn for the user making the call.
878
+ /// @param question_ids The IDs of the questions you want to claim for
879
+ /// @param lengths The number of history entries you will supply for each question ID
880
+ /// @param hist_hashes In a single list for all supplied questions, the hash of each history entry.
881
+ /// @param addrs In a single list for all supplied questions, the address of each answerer or commitment sender
882
+ /// @param bonds In a single list for all supplied questions, the bond supplied with each answer or commitment
883
+ /// @param answers In a single list for all supplied questions, each answer supplied, or commitment ID
884
+ function claimMultipleAndWithdrawBalance(
885
+ bytes32[] memory question_ids, uint256[] memory lengths,
886
+ bytes32[] memory hist_hashes, address[] memory addrs, uint256[] memory bonds, bytes32[] memory answers
887
+ )
888
+ stateAny() // The finalization checks are done in the claimWinnings function
889
+ public {
890
+
891
+ uint256 qi;
892
+ uint256 i;
893
+ for (qi = 0; qi < question_ids.length; qi++) {
894
+ bytes32 qid = question_ids[qi];
895
+ uint256 ln = lengths[qi];
896
+ bytes32[] memory hh = new bytes32[](ln);
897
+ address[] memory ad = new address[](ln);
898
+ uint256[] memory bo = new uint256[](ln);
899
+ bytes32[] memory an = new bytes32[](ln);
900
+ uint256 j;
901
+ for (j = 0; j < ln; j++) {
902
+ hh[j] = hist_hashes[i];
903
+ ad[j] = addrs[i];
904
+ bo[j] = bonds[i];
905
+ an[j] = answers[i];
906
+ i++;
907
+ }
908
+ claimWinnings(qid, hh, ad, bo, an);
909
+ }
910
+ withdraw();
911
+ }
912
+
913
+ /// @notice Returns the questions's content hash, identifying the question content
914
+ /// @param question_id The ID of the question
915
+ function getContentHash(bytes32 question_id)
916
+ public view returns(bytes32) {
917
+ return questions[question_id].content_hash;
918
+ }
919
+
920
+ /// @notice Returns the arbitrator address for the question
921
+ /// @param question_id The ID of the question
922
+ function getArbitrator(bytes32 question_id)
923
+ public view returns(address) {
924
+ return questions[question_id].arbitrator;
925
+ }
926
+
927
+ /// @notice Returns the timestamp when the question can first be answered
928
+ /// @param question_id The ID of the question
929
+ function getOpeningTS(bytes32 question_id)
930
+ public view returns(uint32) {
931
+ return questions[question_id].opening_ts;
932
+ }
933
+
934
+ /// @notice Returns the timeout in seconds used after each answer
935
+ /// @param question_id The ID of the question
936
+ function getTimeout(bytes32 question_id)
937
+ public view returns(uint32) {
938
+ return questions[question_id].timeout;
939
+ }
940
+
941
+ /// @notice Returns the timestamp at which the question will be/was finalized
942
+ /// @param question_id The ID of the question
943
+ function getFinalizeTS(bytes32 question_id)
944
+ public view returns(uint32) {
945
+ return questions[question_id].finalize_ts;
946
+ }
947
+
948
+ /// @notice Returns whether the question is pending arbitration
949
+ /// @param question_id The ID of the question
950
+ function isPendingArbitration(bytes32 question_id)
951
+ public view returns(bool) {
952
+ return questions[question_id].is_pending_arbitration;
953
+ }
954
+
955
+ /// @notice Returns the current total unclaimed bounty
956
+ /// @dev Set back to zero once the bounty has been claimed
957
+ /// @param question_id The ID of the question
958
+ function getBounty(bytes32 question_id)
959
+ public view returns(uint256) {
960
+ return questions[question_id].bounty;
961
+ }
962
+
963
+ /// @notice Returns the current best answer
964
+ /// @param question_id The ID of the question
965
+ function getBestAnswer(bytes32 question_id)
966
+ public view returns(bytes32) {
967
+ return questions[question_id].best_answer;
968
+ }
969
+
970
+ /// @notice Returns the history hash of the question
971
+ /// @param question_id The ID of the question
972
+ /// @dev Updated on each answer, then rewound as each is claimed
973
+ function getHistoryHash(bytes32 question_id)
974
+ public view returns(bytes32) {
975
+ return questions[question_id].history_hash;
976
+ }
977
+
978
+ /// @notice Returns the highest bond posted so far for a question
979
+ /// @param question_id The ID of the question
980
+ function getBond(bytes32 question_id)
981
+ public view returns(uint256) {
982
+ return questions[question_id].bond;
983
+ }
984
+
985
+ /// @notice Returns the minimum bond that can answer the question
986
+ /// @param question_id The ID of the question
987
+ function getMinBond(bytes32 question_id)
988
+ public view returns(uint256) {
989
+ return questions[question_id].min_bond;
990
+ }
991
+
992
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reality.eth/contracts",
3
- "version": "3.2.6",
3
+ "version": "3.2.7",
4
4
  "description": "Collection of smart contracts for the Realitio fact verification platform",
5
5
  "scripts": {
6
6
  "generate-chains": "node scripts/generate_chains_json.js",
@@ -34,7 +34,7 @@
34
34
  "url": "https://github.com/RealityETH/monorepo/issues"
35
35
  },
36
36
  "homepage": "https://reality.eth.link",
37
- "gitHead": "dfcc5aaac69c7afbaba97b1d567fce2997e757b1",
37
+ "gitHead": "fd724cfd4a2f28913cb940460ee4e375747ec8f1",
38
38
  "dependencies": {
39
39
  "ethers": "^5.8.0"
40
40
  }