@reality.eth/contracts 3.0.59 → 3.0.61

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.
@@ -6,6 +6,7 @@
6
6
  "arbitrators": {
7
7
  "0xe40DD83a262da3f56976038F1554Fe541Fa75ecd": "Kleros",
8
8
  "0x7202deD6f13525A8298Ea53fBFD4395fDCc8d5f1": "Reality.eth team - testing only",
9
- "0x34a8B97bd8Ac4AfBe91C71E961C3f9c1F064717F": "DXdao - Test"
9
+ "0x34a8B97bd8Ac4AfBe91C71E961C3f9c1F064717F": "DXdao - Test",
10
+ "0x5562ac605764dc4039fb6ab56a74f7321396cdf2": "Kleros with appeal support"
10
11
  }
11
12
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "address": "0xC68755Ba891A31b969764eB46C0bC7A5127A0854",
3
+ "block": 12569806,
4
+ "notes": null,
5
+ "arbitrators": {}
6
+ }
@@ -312,7 +312,8 @@
312
312
  "arbitrators": {
313
313
  "0xe40DD83a262da3f56976038F1554Fe541Fa75ecd": "Kleros",
314
314
  "0x7202deD6f13525A8298Ea53fBFD4395fDCc8d5f1": "Reality.eth team - testing only",
315
- "0x34a8B97bd8Ac4AfBe91C71E961C3f9c1F064717F": "DXdao - Test"
315
+ "0x34a8B97bd8Ac4AfBe91C71E961C3f9c1F064717F": "DXdao - Test",
316
+ "0x5562ac605764dc4039fb6ab56a74f7321396cdf2": "Kleros with appeal support"
316
317
  }
317
318
  },
318
319
  "RealityETH-3.0": {
@@ -421,6 +422,12 @@
421
422
  },
422
423
  "10200": {
423
424
  "XDAI": {
425
+ "RealityETH-2.1": {
426
+ "address": "0xC68755Ba891A31b969764eB46C0bC7A5127A0854",
427
+ "block": 12569806,
428
+ "notes": null,
429
+ "arbitrators": {}
430
+ },
424
431
  "RealityETH-3.0": {
425
432
  "address": "0x1E732a1C5e9181622DD5A931Ec6801889ce66185",
426
433
  "block": 10438389,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reality.eth/contracts",
3
- "version": "3.0.59",
3
+ "version": "3.0.61",
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": "5522786b048d9c54317fb6049040f25aa0aaed63",
37
+ "gitHead": "f6cef51640ccf3d13e5c0fd08ae418cf9a7d871f",
38
38
  "dependencies": {
39
39
  "ethers": "^5.6.8"
40
40
  }
@@ -0,0 +1,13 @@
1
+ // Script to dump out chains with no graph URL
2
+ // Used for a quick hack in the dapp, see dapp/src/scripts/index.js
3
+
4
+ const chains = require('../generated/chains.json');
5
+ let out = [];
6
+ for (const c in chains) {
7
+ const gurl = chains[c].graphURL;
8
+ if (!gurl) {
9
+ out.push(parseInt(c));
10
+ }
11
+ }
12
+
13
+ console.log(out);
@@ -0,0 +1,64 @@
1
+ const fs = require('fs');
2
+ const ethers = require('ethers');
3
+
4
+ const rc = require('../index.js');
5
+
6
+ const deployment_json = process.argv[2]; // '../chains/deployments/11155420/ETH/RealityETH-3.0.json';
7
+
8
+ if (!deployment_json) {
9
+ throw new Error("Usage: node store_template_ids <chain_token_file>");
10
+ }
11
+
12
+ const config = require(deployment_json);
13
+ const bits = deployment_json.split('/');
14
+ const chain_id = parseInt(bits[3]);
15
+ const token = bits[4];
16
+ const full_version = bits[5];
17
+ const vnum = ""+full_version.split('-')[1].replace('.json', '');
18
+
19
+ const settings = require(deployment_json);
20
+ const address = settings.address;
21
+ const chain_data = rc.chainData(chain_id);
22
+ const rpc = chain_data.hostedRPC ? chain_data.hostedRPC : chain_data.rpcUrls[0];
23
+ const start_block = config.block-1;
24
+
25
+ const provider = new ethers.providers.JsonRpcProvider(rpc);
26
+ const abi = JSON.parse(fs.readFileSync('../abi/solc-0.8.6/RealityETH-all.abi.json'));
27
+ const inst = new ethers.Contract(address, abi, provider);
28
+
29
+ const per_request = 1000;
30
+ try {
31
+ templateLoop();
32
+ } catch(e) {
33
+ fs.appendFileSync('FAILED-'+f, e.message);
34
+ }
35
+ const f = chain_id + '-' + token + '-' + vnum + '.txt';
36
+
37
+ async function templateLoop() {
38
+ const latest = await provider.getBlock('latest');
39
+ for (let i=start_block; i< latest.number; i = i + per_request) {
40
+ await queryTemplates(i, per_request);
41
+ }
42
+ }
43
+
44
+ function storeTemplateID(deployment_json, template_id, template_text) {
45
+ // Reread the template in case it change
46
+ const existing = JSON.parse(fs.readFileSync(deployment_json));
47
+ if (!existing['templates']) {
48
+ existing['templates'] = {};
49
+ }
50
+ existing['templates'][template_id] = template_text;
51
+ // TODO: Write back template
52
+ fs.writeFileSync(deployment_json, JSON.stringify(existing, null, 4));
53
+ }
54
+
55
+ async function queryTemplates(start_block, per_request) {
56
+ console.log('::', per_request, 'from ', start_block);
57
+ const template_filter = inst.filters.LogNewTemplate();
58
+ const template_arr = await inst.queryFilter(template_filter, start_block, start_block+per_request);
59
+ for(let j=0; j<template_arr.length; j++) {
60
+ // fs.appendFileSync(f, template_arr[j].args.template_id.toString() + ',' + template_arr[j].args.question_text+"\n");
61
+ storeTemplateID(deployment_json, template_arr[j].args.template_id.toString(), template_arr[j].args.question_text);
62
+ }
63
+ return;
64
+ }