@reality.eth/contracts 3.0.80 → 3.2.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 +4 -1
- package/abi/solc-0.4.25/RealityETH-2.2.abi.json +1 -0
- package/abi/solc-0.8.6/RealityETH-3.2.abi.json +1 -0
- package/abi/solc-0.8.6/RealityETH_ERC20-3.2.abi.json +1 -0
- package/bytecode/RealityETH-2.2.bin +1 -0
- package/bytecode/RealityETH-3.2.bin +1 -0
- package/bytecode/RealityETH_ERC20-3.2.bin +1 -0
- package/chains/deployments/100/XDAI/RealityETH-3.2.json +6 -0
- package/chains/deployments/10200/XDAI/RealityETH-3.2.json +6 -0
- package/chains/deployments/11155111/ETH/RealityETH-3.2.json +6 -0
- package/chains/deployments/88558801/ZBS/RealityETH-3.2.json +6 -0
- package/config/templates_3.2.json +18 -0
- package/flat/RealityETH-2.2.sol +895 -0
- package/flat/RealityETH-3.2.sol +990 -0
- package/flat/RealityETH_ERC20-3.2.sol +1097 -0
- package/generated/contracts.json +24 -0
- package/index.js +29 -6
- package/package.json +2 -2
- package/scripts/deploy.js +2 -2
package/generated/contracts.json
CHANGED
|
@@ -324,6 +324,12 @@
|
|
|
324
324
|
"arbitrators": {
|
|
325
325
|
"0x29f39de98d750eb77b5fafb31b2837f079fce222": "Kleros"
|
|
326
326
|
}
|
|
327
|
+
},
|
|
328
|
+
"RealityETH-3.2": {
|
|
329
|
+
"address": "0xEb51d9d9717906c981C57af09C4a3449eF30705b",
|
|
330
|
+
"block": 39142627,
|
|
331
|
+
"notes": null,
|
|
332
|
+
"arbitrators": {}
|
|
327
333
|
}
|
|
328
334
|
}
|
|
329
335
|
},
|
|
@@ -477,6 +483,12 @@
|
|
|
477
483
|
"block": 10438389,
|
|
478
484
|
"notes": null,
|
|
479
485
|
"arbitrators": {}
|
|
486
|
+
},
|
|
487
|
+
"RealityETH-3.2": {
|
|
488
|
+
"address": "0x012fb3aDce7D60672cF634e730927Fa5822b3cAb",
|
|
489
|
+
"block": 14880291,
|
|
490
|
+
"notes": null,
|
|
491
|
+
"arbitrators": {}
|
|
480
492
|
}
|
|
481
493
|
}
|
|
482
494
|
},
|
|
@@ -626,6 +638,12 @@
|
|
|
626
638
|
"arbitrators": {
|
|
627
639
|
"0x05b942faecfb3924970e3a28e0f230910cedff45": "Kleros"
|
|
628
640
|
}
|
|
641
|
+
},
|
|
642
|
+
"RealityETH-3.2": {
|
|
643
|
+
"address": "0xB7982f20CC159a40eba4b0eA86fd6cbA6Ff810e1",
|
|
644
|
+
"block": 7898415,
|
|
645
|
+
"notes": null,
|
|
646
|
+
"arbitrators": {}
|
|
629
647
|
}
|
|
630
648
|
}
|
|
631
649
|
},
|
|
@@ -652,6 +670,12 @@
|
|
|
652
670
|
"notes": null,
|
|
653
671
|
"arbitrators": {}
|
|
654
672
|
},
|
|
673
|
+
"RealityETH-3.2": {
|
|
674
|
+
"address": "0x3a9Ef99956021d545214B7021D449ACb20fCF2b3",
|
|
675
|
+
"block": 240,
|
|
676
|
+
"notes": null,
|
|
677
|
+
"arbitrators": {}
|
|
678
|
+
},
|
|
655
679
|
"RealityETH-4.0": {
|
|
656
680
|
"address": "0x74549fdf4e00C7c564bB193a911887d8C291b13C",
|
|
657
681
|
"block": 2,
|
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
let all_config = require('./generated/contracts.json');
|
|
2
2
|
let token_info = require('./generated/tokens.json');
|
|
3
3
|
const chain_info = require('./generated/chains.json');
|
|
4
|
-
const template_config = require('./config/templates.json');
|
|
5
4
|
const factory_config = require('./generated/factories.json');
|
|
6
5
|
|
|
7
6
|
function populateImports(imported_contracts, chain_id) {
|
|
@@ -28,6 +27,7 @@ function realityETHInstance(config) {
|
|
|
28
27
|
'RealityETH-2.1': require('./abi/solc-0.8.6/RealityETH-2.1.abi.json'),
|
|
29
28
|
'RealityETH-2.1-rc1': require('./abi/solc-0.8.6/RealityETH-2.1.abi.json'),
|
|
30
29
|
'RealityETH-3.0': require('./abi/solc-0.8.6/RealityETH-3.0.abi.json'),
|
|
30
|
+
'RealityETH-3.2': require('./abi/solc-0.8.6/RealityETH-3.2.abi.json'),
|
|
31
31
|
'RealityETH_ERC20-2.0': require('./abi/solc-0.8.6/RealityETH_ERC20-2.0.abi.json'),
|
|
32
32
|
'RealityETH_ERC20-3.0': require('./abi/solc-0.8.6/RealityETH_ERC20-3.0.abi.json')
|
|
33
33
|
}
|
|
@@ -97,7 +97,7 @@ function tokenConfig(token, chain_id) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
function realityETHConfig(chain_id, token, version) {
|
|
100
|
-
const versions = ['3.0', '2.1', '2.1-rc1', '2.0'];
|
|
100
|
+
const versions = ['3.0', '3.2', '2.1', '2.1-rc1', '2.0'];
|
|
101
101
|
const token_info = chainTokenList(chain_id);
|
|
102
102
|
if (!token_info[token]) {
|
|
103
103
|
console.log("Token not found for chain");
|
|
@@ -138,7 +138,7 @@ function realityETHConfig(chain_id, token, version) {
|
|
|
138
138
|
|
|
139
139
|
function realityETHConfigs(chain_id, token) {
|
|
140
140
|
let configs = {};
|
|
141
|
-
const versions = ['3.0', '2.1', '2.1-rc1', '2.0'];
|
|
141
|
+
const versions = ['3.2', '3.0', '2.1', '2.1-rc1', '2.0'];
|
|
142
142
|
const token_info = chainTokenList(chain_id);
|
|
143
143
|
if (!token_info[token]) {
|
|
144
144
|
console.log("Token not found for network");
|
|
@@ -204,8 +204,19 @@ function walletAddParameters(chain_id) {
|
|
|
204
204
|
return ret;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
function templateConfig() {
|
|
208
|
-
|
|
207
|
+
function templateConfig(vernum) {
|
|
208
|
+
const old_templates = require('./config/templates.json');
|
|
209
|
+
const new_templates = require('./config/templates_3.2.json'); // This is also backported to 2.2
|
|
210
|
+
if (vernum == 2.2 || vernum < 3.2) {
|
|
211
|
+
return old_templates;
|
|
212
|
+
} else {
|
|
213
|
+
return new_templates;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function defaultTemplateIDForType(template_type, vernum) {
|
|
218
|
+
const tc = templateConfig(vernum);
|
|
219
|
+
return tc.base_ids[template_type];
|
|
209
220
|
}
|
|
210
221
|
|
|
211
222
|
function defaultTokenForChain(chain_id) {
|
|
@@ -229,11 +240,22 @@ function defaultTokenForChain(chain_id) {
|
|
|
229
240
|
}
|
|
230
241
|
|
|
231
242
|
function versionHasFeature(vernum, feature_name) {
|
|
243
|
+
vernum = ""+vernum;
|
|
232
244
|
if (feature_name == 'min-bond' || feature_name == 'reopen-question') {
|
|
233
245
|
const min_maj = 3;
|
|
234
|
-
const bits = vernum
|
|
246
|
+
const bits = vernum.split('.');
|
|
235
247
|
const maj = parseInt(bits[0]);
|
|
236
248
|
return (maj >= min_maj);
|
|
249
|
+
} else if (feature_name == 'description' || feature_name == 'hash-type') {
|
|
250
|
+
const min_min = 2;
|
|
251
|
+
const bits = vernum.split('.');
|
|
252
|
+
const min = parseInt(bits[1]);
|
|
253
|
+
return (min >= min_min);
|
|
254
|
+
} else if (feature_name == 'category') {
|
|
255
|
+
const min_min = 2;
|
|
256
|
+
const bits = vernum.split('.');
|
|
257
|
+
const min = parseInt(bits[1]);
|
|
258
|
+
return (min < min_min);
|
|
237
259
|
} else {
|
|
238
260
|
throw new Error('Feature not known: '+feature_name);
|
|
239
261
|
}
|
|
@@ -369,6 +391,7 @@ module.exports.tokenConfig = tokenConfig
|
|
|
369
391
|
module.exports.chainData = chainData;
|
|
370
392
|
module.exports.walletAddParameters = walletAddParameters;
|
|
371
393
|
module.exports.templateConfig = templateConfig;
|
|
394
|
+
module.exports.defaultTemplateIDForType = defaultTemplateIDForType;
|
|
372
395
|
module.exports.defaultTokenForChain = defaultTokenForChain;
|
|
373
396
|
module.exports.versionHasFeature = versionHasFeature;
|
|
374
397
|
module.exports.isChainSupported = isChainSupported;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reality.eth/contracts",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
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": "
|
|
37
|
+
"gitHead": "3657381c3ba9f62bb6d3f07e59e38f7cebf8ffdd",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"ethers": "^5.8.0"
|
|
40
40
|
}
|
package/scripts/deploy.js
CHANGED
|
@@ -72,7 +72,7 @@ const chains = {
|
|
|
72
72
|
'backstopTestnet1': 88558801
|
|
73
73
|
}
|
|
74
74
|
const non_infura_chains = {
|
|
75
|
-
'gnosis': 'https://
|
|
75
|
+
'gnosis': 'https://gnosis.oat.farm',
|
|
76
76
|
'scroll-alpha-testnet': 'https://alpha-rpc.scroll.io/l2',
|
|
77
77
|
'sokol': 'https://sokol.poa.network',
|
|
78
78
|
'bsc': 'https://bsc-dataseed.binance.org',
|
|
@@ -90,7 +90,7 @@ const non_infura_chains = {
|
|
|
90
90
|
'optimism': 'https://mainnet.optimism.io',
|
|
91
91
|
'kintsugi': 'https://rpc.kintsugi.themerge.dev',
|
|
92
92
|
'mumbai': 'https://matic-mumbai.chainstacklabs.com',
|
|
93
|
-
'sepolia': 'https://rpc.sepolia.org',
|
|
93
|
+
'sepolia': 'https://sepolia.backstop.technology/', // 'https://rpc.sepolia.org',
|
|
94
94
|
'holesky': 'https://ethereum-holesky.publicnode.com',
|
|
95
95
|
'telosevm': 'https://mainnet.telos.net/evm',
|
|
96
96
|
'unichain': 'https://mainnet.unichain.org',
|