@reality.eth/contracts 3.0.1 → 3.0.4

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.
Files changed (55) hide show
  1. package/README.md +9 -3
  2. package/chains/chainid.network.json +7691 -1349
  3. package/chains/deployments/1/ETH/RealityETH-3.0.json +4 -1
  4. package/chains/deployments/1/SWISE/RealityETH_ERC20-3.0.json +7 -0
  5. package/chains/deployments/10/OETH/RealityETH-3.0.json +6 -0
  6. package/chains/deployments/100/GNO/RealityETH_ERC20-3.0.json +7 -0
  7. package/chains/deployments/100/SWISE/RealityETH_ERC20-3.0.json +7 -0
  8. package/chains/deployments/100/XDAI/RealityETH-3.0.json +3 -1
  9. package/chains/deployments/1337702/ETH/RealityETH-3.0.json +6 -0
  10. package/chains/deployments/4/ETH/RealityETH-3.0.json +3 -1
  11. package/chains/deployments/42/ETH/RealityETH-3.0.json +2 -1
  12. package/chains/deployments/56/DEXE/RealityETH_ERC20-3.0.json +7 -0
  13. package/chains/deployments/69/OETH/RealityETH-3.0.json +6 -0
  14. package/chains/deployments/77/XDAI/RealityETH-2.1-rc1.json +1 -3
  15. package/chains/deployments/777/CTH/RealityETH-3.0.json +6 -0
  16. package/chains/supported.json +23 -3
  17. package/development/contracts/Arbitrator.sol +7 -6
  18. package/development/contracts/BalanceHolder.sol +4 -2
  19. package/development/contracts/{BalanceHolderERC20.sol → BalanceHolder_ERC20.sol} +3 -2
  20. package/development/contracts/IArbitrator.sol +4 -7
  21. package/development/contracts/IArbitratorForeignProxy.sol +12 -0
  22. package/development/contracts/IBalanceHolder.sol +3 -1
  23. package/development/contracts/IBalanceHolder_ERC20.sol +11 -0
  24. package/development/contracts/IERC20.sol +1 -1
  25. package/development/contracts/IOwned.sol +1 -1
  26. package/development/contracts/IRealityETH.sol +63 -0
  27. package/development/contracts/IRealityETH_ERC20.sol +67 -0
  28. package/development/contracts/Owned.sol +4 -2
  29. package/development/contracts/RealityETH-3.0.sol +4 -82
  30. package/development/contracts/RealityETH_ERC20-3.0.sol +3 -3
  31. package/generated/chains.json +95 -22
  32. package/generated/contracts.json +89 -7
  33. package/generated/tokens.json +34 -2
  34. package/index.js +9 -4
  35. package/package.json +3 -3
  36. package/scripts/deploy.js +14 -3
  37. package/scripts/fetch_and_reformat_chains_json.js +31 -0
  38. package/scripts/{format_abi.js → format_json.js} +0 -0
  39. package/scripts/generate_chains_json.js +3 -0
  40. package/scripts/send_funds.js +52 -0
  41. package/tokens/CTH.json +7 -0
  42. package/tokens/DEXE.json +7 -0
  43. package/tokens/ETH.json +2 -1
  44. package/tokens/GNO.json +1 -0
  45. package/tokens/OETH.json +8 -0
  46. package/tokens/SWISE.json +8 -0
  47. package/development/contracts/IRealitio.sol +0 -44
  48. package/development/contracts/MultiSigWallet.sol +0 -391
  49. package/development/contracts/Realitio.sol +0 -756
  50. package/development/contracts/RealitioERC20.sol +0 -825
  51. package/development/contracts/RealitioSafeMath256.sol +0 -36
  52. package/development/contracts/RealitioSafeMath32.sol +0 -17
  53. package/development/contracts/Realitio_v2_1.sol +0 -819
  54. package/development/contracts/SplitterWallet.sol +0 -142
  55. package/tests/python/test_wallet.py +0 -185
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "3": {
22
22
  "chainId": "0x3",
23
- "chainName": "Ethereum Testnet Ropsten",
23
+ "chainName": "Ropsten",
24
24
  "nativeCurrency": {
25
25
  "name": "Ropsten Ether",
26
26
  "symbol": "ROP",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "4": {
38
38
  "chainId": "0x4",
39
- "chainName": "Ethereum Testnet Rinkeby",
39
+ "chainName": "Rinkeby",
40
40
  "nativeCurrency": {
41
41
  "name": "Rinkeby Ether",
42
42
  "symbol": "RIN",
@@ -52,31 +52,48 @@
52
52
  },
53
53
  "8": {
54
54
  "chainId": "0x8",
55
- "chainName": "Ubiq Network Mainnet",
55
+ "chainName": "Ubiq",
56
56
  "nativeCurrency": {
57
57
  "name": "Ubiq Ether",
58
58
  "symbol": "UBQ",
59
59
  "decimals": 18
60
60
  },
61
- "network_name": "mainnet",
62
61
  "rpcUrls": [
63
62
  "https://rpc.octano.dev",
64
63
  "https://pyrus2.ubiqscan.io"
65
64
  ],
66
65
  "hostedRPC": "https://rpc.octano.dev",
67
66
  "blockExplorerUrls": [
67
+ "https://ubiqscan.io",
68
68
  "https://ubqblockexplorer.com/"
69
69
  ]
70
70
  },
71
+ "10": {
72
+ "chainId": "0xa",
73
+ "chainName": "Optimism",
74
+ "nativeCurrency": {
75
+ "name": "Ether",
76
+ "symbol": "ETH",
77
+ "decimals": 18
78
+ },
79
+ "rpcUrls": [
80
+ "https://mainnet.optimism.io/"
81
+ ],
82
+ "hostedRPC": "https://mainnet.optimism.io",
83
+ "graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-optimism",
84
+ "blockExplorerUrls": [
85
+ "https://optimistic.etherscan.io"
86
+ ]
87
+ },
71
88
  "42": {
72
89
  "chainId": "0x2a",
73
- "chainName": "Ethereum Testnet Kovan",
90
+ "chainName": "Kovan",
74
91
  "nativeCurrency": {
75
92
  "name": "Kovan Ether",
76
93
  "symbol": "KOV",
77
94
  "decimals": 18
78
95
  },
79
- "network_name": "kovan",
96
+ "network_name": "testnet",
80
97
  "rpcUrls": [
81
98
  "https://kovan.poa.network",
82
99
  "http://kovan.poa.network:8545",
@@ -119,12 +136,29 @@
119
136
  "https://www.bscscan.com"
120
137
  ]
121
138
  },
139
+ "69": {
140
+ "chainId": "0x45",
141
+ "chainName": "Optimism Kovan",
142
+ "nativeCurrency": {
143
+ "name": "Kovan Ether",
144
+ "symbol": "KOR",
145
+ "decimals": 18
146
+ },
147
+ "network_name": "kovan",
148
+ "rpcUrls": [
149
+ "https://kovan.optimism.io/"
150
+ ],
151
+ "hostedRPC": "https://kovan.optimism.io",
152
+ "blockExplorerUrls": [
153
+ "https://kovan-optimistic.etherscan.io"
154
+ ]
155
+ },
122
156
  "77": {
123
157
  "chainId": "0x4d",
124
158
  "chainName": "POA Network Sokol",
125
159
  "nativeCurrency": {
126
160
  "name": "POA Sokol Ether",
127
- "symbol": "POA",
161
+ "symbol": "SPOA",
128
162
  "decimals": 18
129
163
  },
130
164
  "network_name": "poa-sokol",
@@ -141,7 +175,7 @@
141
175
  },
142
176
  "100": {
143
177
  "chainId": "0x64",
144
- "chainName": "xDAI Chain",
178
+ "chainName": "Gnosis",
145
179
  "nativeCurrency": {
146
180
  "name": "xDAI",
147
181
  "symbol": "xDAI",
@@ -149,45 +183,66 @@
149
183
  },
150
184
  "network_name": "xdai",
151
185
  "rpcUrls": [
152
- "https://rpc.xdaichain.com",
186
+ "https://rpc.gnosischain.com",
153
187
  "https://xdai.poanetwork.dev",
154
- "wss://rpc.xdaichain.com/wss",
155
- "wss://xdai.poanetwork.dev/wss",
156
- "http://xdai.poanetwork.dev",
157
188
  "https://dai.poa.network",
189
+ "https://rpc.ankr.com/gnosis",
190
+ "https://gnosischain-rpc.gateway.pokt.network",
191
+ "wss://rpc.gnosischain.com/wss",
192
+ "wss://xdai.poanetwork.dev/wss",
158
193
  "ws://xdai.poanetwork.dev:8546"
159
194
  ],
160
- "hostedRPC": "https://rpc.xdaichain.com",
195
+ "hostedRPC": "https://rpc.gnosischain.com",
161
196
  "iconUrls": [
162
197
  "https://gblobscdn.gitbook.com/spaces%2F-Lpi9AHj62wscNlQjI-l%2Favatar.png"
163
198
  ],
164
199
  "graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-xdai",
165
200
  "blockExplorerUrls": [
201
+ "https://blockscout.com/xdai/mainnet",
166
202
  "https://blockscout.com/poa/xdai/"
167
203
  ]
168
204
  },
169
205
  "137": {
170
206
  "chainId": "0x89",
171
- "chainName": "Matic(Polygon) Mainnet",
207
+ "chainName": "Polygon Mainnet",
172
208
  "nativeCurrency": {
173
- "name": "Matic",
209
+ "name": "MATIC",
174
210
  "symbol": "MATIC",
175
211
  "decimals": 18
176
212
  },
177
213
  "network_name": "matic",
178
214
  "rpcUrls": [
215
+ "https://polygon-rpc.com/",
179
216
  "https://rpc-mainnet.matic.network",
180
- "wss://ws-mainnet.matic.network",
217
+ "https://matic-mainnet.chainstacklabs.com",
218
+ "https://rpc-mainnet.maticvigil.com",
181
219
  "https://rpc-mainnet.matic.quiknode.pro",
182
- "https://matic-mainnet.chainstacklabs.com"
220
+ "https://matic-mainnet-full-rpc.bwarelabs.com"
183
221
  ],
184
- "hostedRPC": "https://rpc-mainnet.matic.network",
222
+ "hostedRPC": "https://polygon-rpc.com/",
185
223
  "graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-polygon",
186
224
  "blockExplorerUrls": [
187
225
  "https://polygonscan.com",
188
226
  "https://polygonscan.com/"
189
227
  ]
190
228
  },
229
+ "777": {
230
+ "chainId": "0x309",
231
+ "chainName": "cheapETH",
232
+ "nativeCurrency": {
233
+ "name": "cTH",
234
+ "symbol": "cTH",
235
+ "decimals": 18
236
+ },
237
+ "network_name": "cheapeth",
238
+ "rpcUrls": [
239
+ "https://node.cheapeth.org/rpc"
240
+ ],
241
+ "hostedRPC": "https://node.cheapeth.org/rpc",
242
+ "blockExplorerUrls": [
243
+ "https://explore.cheapswap.io/"
244
+ ]
245
+ },
191
246
  "42161": {
192
247
  "chainId": "0xa4b1",
193
248
  "chainName": "Arbitrum One",
@@ -208,7 +263,7 @@
208
263
  },
209
264
  "43114": {
210
265
  "chainId": "0xa86a",
211
- "chainName": "Avalanche Mainnet",
266
+ "chainName": "Avalanche C-Chain",
212
267
  "nativeCurrency": {
213
268
  "name": "Avalanche",
214
269
  "symbol": "AVAX",
@@ -221,12 +276,13 @@
221
276
  "hostedRPC": "https://api.avax.network/ext/bc/C/rpc",
222
277
  "graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ava",
223
278
  "blockExplorerUrls": [
279
+ "https://snowtrace.io",
224
280
  "https://cchain.explorer.avax.network/"
225
281
  ]
226
282
  },
227
283
  "421611": {
228
284
  "chainId": "0x66eeb",
229
- "chainName": "Arbitrum Testnet Rinkeby",
285
+ "chainName": "Arbitrum Rinkeby",
230
286
  "nativeCurrency": {
231
287
  "name": "Arbitrum Rinkeby Ether",
232
288
  "symbol": "ARETH",
@@ -234,12 +290,29 @@
234
290
  },
235
291
  "network_name": "arbitrum-rinkeby",
236
292
  "rpcUrls": [
237
- "https://rinkeby.arbitrum.io/rpc",
238
- "wss://rinkeby.arbitrum.io/ws"
293
+ "https://rinkeby.arbitrum.io/rpc"
239
294
  ],
240
295
  "hostedRPC": "https://rinkeby.arbitrum.io/rpc",
241
296
  "blockExplorerUrls": [
297
+ "https://testnet.arbiscan.io",
242
298
  "https://rinkeby-explorer.arbitrum.io"
243
299
  ]
300
+ },
301
+ "1337702": {
302
+ "chainId": "0x146966",
303
+ "chainName": "Kintsugi",
304
+ "nativeCurrency": {
305
+ "name": "kintsugi Ethere",
306
+ "symbol": "kiETH",
307
+ "decimals": 18
308
+ },
309
+ "network_name": "kintsugi",
310
+ "rpcUrls": [
311
+ "https://rpc.kintsugi.themerge.dev"
312
+ ],
313
+ "hostedRPC": "https://rpc.kintsugi.themerge.dev",
314
+ "blockExplorerUrls": [
315
+ "https://explorer.kintsugi.themerge.dev"
316
+ ]
244
317
  }
245
318
  }
@@ -16,7 +16,10 @@
16
16
  "address": "0x5b7dD1E86623548AF054A4985F7fc8Ccbb554E2c",
17
17
  "block": 13194676,
18
18
  "notes": null,
19
- "arbitrators": {}
19
+ "arbitrators": {
20
+ "0x728cba71a3723caab33ea416cb46e2cc9215a596": "Kleros (General Court)",
21
+ "0xf72cfd1b34a91a64f9a98537fe63fbab7530adca": "Kleros DAO Governance (Technical Court)"
22
+ }
20
23
  }
21
24
  },
22
25
  "FOX": {
@@ -46,6 +49,15 @@
46
49
  "arbitrators": {}
47
50
  }
48
51
  },
52
+ "SWISE": {
53
+ "RealityETH_ERC20-3.0": {
54
+ "address": "0x867092A32bC16816F12Fb326EfF7A2865E1ec138",
55
+ "block": 14485577,
56
+ "token_address": "0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2",
57
+ "notes": null,
58
+ "arbitrators": {}
59
+ }
60
+ },
49
61
  "TRST": {
50
62
  "RealityETH_ERC20-2.0": {
51
63
  "address": "0x3D3B51b1091d1F6491AeB1916C94BAfe57f6Cc9d",
@@ -98,7 +110,9 @@
98
110
  "address": "0xDf33060F476F8cff7511F806C72719394da1Ad64",
99
111
  "block": 9106451,
100
112
  "notes": null,
101
- "arbitrators": {}
113
+ "arbitrators": {
114
+ "0xe27768bdb76a9b742b7ddcfe1539fadaf3b89bc7": "Kleros (General Court)"
115
+ }
102
116
  }
103
117
  },
104
118
  "TRST": {
@@ -141,6 +155,16 @@
141
155
  }
142
156
  }
143
157
  },
158
+ "10": {
159
+ "OETH": {
160
+ "RealityETH-3.0": {
161
+ "address": "0x0eF940F7f053a2eF5D6578841072488aF0c7d89A",
162
+ "block": 2462149,
163
+ "notes": null,
164
+ "arbitrators": {}
165
+ }
166
+ }
167
+ },
144
168
  "42": {
145
169
  "ETH": {
146
170
  "RealityETH-2.0": {
@@ -158,7 +182,8 @@
158
182
  "block": 27103177,
159
183
  "notes": null,
160
184
  "arbitrators": {
161
- "0xb9fdd2904cbcc5543F02DB948B2CE59Ef10A950E": "Kleros"
185
+ "0x99489d7bb33539f3d1a401741e56e8f02b9ae0cf": "Kleros (General Court)",
186
+ "0xb9fdd2904cbcc5543F02DB948B2CE59Ef10A950E": "Kleros DAO Governance (Technical Court)"
162
187
  }
163
188
  }
164
189
  },
@@ -208,6 +233,25 @@
208
233
  "notes": null,
209
234
  "arbitrators": {}
210
235
  }
236
+ },
237
+ "DEXE": {
238
+ "RealityETH_ERC20-3.0": {
239
+ "address": "0x95f8fc16C7Bd5a5b24CaE629471c6cCC3916826A",
240
+ "block": 13749748,
241
+ "token_address": "0x039cb485212f996a9dbb85a9a75d898f94d38da6",
242
+ "notes": null,
243
+ "arbitrators": {}
244
+ }
245
+ }
246
+ },
247
+ "69": {
248
+ "OETH": {
249
+ "RealityETH-3.0": {
250
+ "address": "0x327543eaf65FE0D68333d4D092282cDBA0Bc37a6",
251
+ "block": 28282,
252
+ "notes": null,
253
+ "arbitrators": {}
254
+ }
211
255
  }
212
256
  },
213
257
  "77": {
@@ -217,9 +261,7 @@
217
261
  "block": 17307142,
218
262
  "token_address": null,
219
263
  "notes": "Same as 2.1 except missing an empty address check",
220
- "arbitrators": {
221
- "0x37Fcdb26F12f3FC76F2424EC6B94D434a959A0f7": "Kleros (testing)"
222
- }
264
+ "arbitrators": {}
223
265
  },
224
266
  "RealityETH-2.1": {
225
267
  "address": "0x90a617ed516ab7fAaBA56CcEDA0C5D952f294d03",
@@ -239,6 +281,24 @@
239
281
  }
240
282
  },
241
283
  "100": {
284
+ "GNO": {
285
+ "RealityETH_ERC20-3.0": {
286
+ "address": "0x95b2b2b4b66A5a47Df79bF07BEBe72E9870fceb2",
287
+ "block": 20882108,
288
+ "token_address": "0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",
289
+ "notes": null,
290
+ "arbitrators": {}
291
+ }
292
+ },
293
+ "SWISE": {
294
+ "RealityETH_ERC20-3.0": {
295
+ "address": "0xC9FbdF0df8dE06Ad8d2193F7FA28bdA78c13a102",
296
+ "block": 21371853,
297
+ "token_address": "0xfdA94F056346d2320d4B5E468D6Ad099b2277746",
298
+ "notes": null,
299
+ "arbitrators": {}
300
+ }
301
+ },
242
302
  "XDAI": {
243
303
  "RealityETH-2.1": {
244
304
  "address": "0x79e32aE03fb27B07C89c0c568F80287C01ca2E57",
@@ -255,7 +315,9 @@
255
315
  "address": "0xE78996A233895bE74a66F451f1019cA9734205cc",
256
316
  "block": 17997262,
257
317
  "notes": null,
258
- "arbitrators": {}
318
+ "arbitrators": {
319
+ "0x29f39de98d750eb77b5fafb31b2837f079fce222": "Kleros"
320
+ }
259
321
  }
260
322
  }
261
323
  },
@@ -282,6 +344,16 @@
282
344
  }
283
345
  }
284
346
  },
347
+ "777": {
348
+ "CTH": {
349
+ "RealityETH-3.0": {
350
+ "address": "0xF935d11116fA0103Bd340B663879d325673106f0",
351
+ "block": 13539397,
352
+ "notes": null,
353
+ "arbitrators": {}
354
+ }
355
+ }
356
+ },
285
357
  "42161": {
286
358
  "ARETH": {
287
359
  "Arbitrator": {
@@ -337,5 +409,15 @@
337
409
  "arbitrators": {}
338
410
  }
339
411
  }
412
+ },
413
+ "1337702": {
414
+ "ETH": {
415
+ "RealityETH-3.0": {
416
+ "address": "0x45fF90518c92C0AcF5C58784435852B5F0CBD4Be",
417
+ "block": 47012,
418
+ "notes": null,
419
+ "arbitrators": {}
420
+ }
421
+ }
340
422
  }
341
423
  }
@@ -21,13 +21,21 @@
21
21
  "56": true
22
22
  }
23
23
  },
24
+ "CTH": {
25
+ "decimals": 18,
26
+ "small_number": 10000000000000000000,
27
+ "native_chains": {
28
+ "777": true
29
+ }
30
+ },
24
31
  "ETH": {
25
32
  "decimals": 18,
26
33
  "small_number": 10000000000000000,
27
34
  "native_chains": {
28
35
  "1": true,
29
36
  "4": true,
30
- "42": true
37
+ "42": true,
38
+ "1337702": true
31
39
  }
32
40
  },
33
41
  "MATIC": {
@@ -37,6 +45,14 @@
37
45
  "137": true
38
46
  }
39
47
  },
48
+ "OETH": {
49
+ "decimals": 18,
50
+ "small_number": 10000000000000000000,
51
+ "native_chains": {
52
+ "10": true,
53
+ "69": true
54
+ }
55
+ },
40
56
  "UBQ": {
41
57
  "decimals": 18,
42
58
  "small_number": 1000000000000000000,
@@ -59,6 +75,13 @@
59
75
  "4": "0x56AE5fd086823d1892BACE27034Eb5531Fcdc3f8"
60
76
  }
61
77
  },
78
+ "DEXE": {
79
+ "decimals": 18,
80
+ "small_number": 1000000000000000000,
81
+ "erc20_chains": {
82
+ "56": "0x039cb485212f996a9dbb85a9a75d898f94d38da6"
83
+ }
84
+ },
62
85
  "FOX": {
63
86
  "decimals": 18,
64
87
  "small_number": 1000000000000000000,
@@ -70,7 +93,8 @@
70
93
  "decimals": 18,
71
94
  "small_number": 10000000,
72
95
  "erc20_chains": {
73
- "1": "0x6810e776880c02933d47db1b9fc05908e5386b96"
96
+ "1": "0x6810e776880c02933d47db1b9fc05908e5386b96",
97
+ "100": "0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb"
74
98
  }
75
99
  },
76
100
  "POLK": {
@@ -80,6 +104,14 @@
80
104
  "42": "0x222E11E134F9AB3750812b37F0DA51B4467EaA7a"
81
105
  }
82
106
  },
107
+ "SWISE": {
108
+ "decimals": 18,
109
+ "small_number": 1000000000000000000,
110
+ "erc20_chains": {
111
+ "1": "0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2",
112
+ "100": "0xfdA94F056346d2320d4B5E468D6Ad099b2277746"
113
+ }
114
+ },
83
115
  "TRST": {
84
116
  "decimals": 6,
85
117
  "small_number": 100000000,
package/index.js CHANGED
@@ -1,4 +1,3 @@
1
- const fs = require('fs');
2
1
  const all_config = require('./generated/contracts.json');
3
2
  const token_info = require('./generated/tokens.json');
4
3
  const chain_info = require('./generated/chains.json');
@@ -8,6 +7,7 @@ function realityETHInstance(config) {
8
7
  const abis = {
9
8
  'RealityETH-2.0': require('./abi/solc-0.8.6/RealityETH-2.0.abi.json'),
10
9
  'RealityETH-2.1': require('./abi/solc-0.8.6/RealityETH-2.1.abi.json'),
10
+ 'RealityETH-2.1-rc1': require('./abi/solc-0.8.6/RealityETH-2.1.abi.json'),
11
11
  'RealityETH-3.0': require('./abi/solc-0.8.6/RealityETH-3.0.abi.json'),
12
12
  'RealityETH_ERC20-2.0': require('./abi/solc-0.8.6/RealityETH_ERC20-2.0.abi.json'),
13
13
  'RealityETH_ERC20-3.0': require('./abi/solc-0.8.6/RealityETH_ERC20-3.0.abi.json')
@@ -50,7 +50,7 @@ function erc20Instance(config) {
50
50
  function chainTokenList(chain_id) {
51
51
  let ret = {};
52
52
  for (t in token_info) {
53
- if (all_config[""+chain_id][t]) {
53
+ if (all_config[""+chain_id] && all_config[""+chain_id][t]) {
54
54
  ret[t] = token_info[t];
55
55
  ret[t].is_native = (token_info[t].native_chains && token_info[t].native_chains[""+chain_id]);
56
56
  }
@@ -78,7 +78,7 @@ function tokenConfig(token, chain_id) {
78
78
  }
79
79
 
80
80
  function realityETHConfig(chain_id, token, version) {
81
- const versions = ['2.1', '2.1-rc1', '2.0', '3.0'];
81
+ const versions = ['3.0', '2.1', '2.1-rc1', '2.0'];
82
82
  const token_info = chainTokenList(chain_id);
83
83
  if (!token_info[token]) {
84
84
  console.log("Token not found for chain");
@@ -118,7 +118,7 @@ function realityETHConfig(chain_id, token, version) {
118
118
 
119
119
  function realityETHConfigs(chain_id, token) {
120
120
  let configs = {};
121
- const versions = ['2.1', '2.1-rc1', '2.0', '3.0'];
121
+ const versions = ['3.0', '2.1', '2.1-rc1', '2.0'];
122
122
  const token_info = chainTokenList(chain_id);
123
123
  if (!token_info[token]) {
124
124
  console.log("Token not found for network");
@@ -158,6 +158,10 @@ function chainData(chain_id) {
158
158
  return chain_info[""+chain_id];
159
159
  }
160
160
 
161
+ function isChainSupported(chain_id) {
162
+ return (""+chain_id in chain_info);
163
+ }
164
+
161
165
  function walletAddParameters(chain_id) {
162
166
  var params = ['chainId', 'chainName', 'nativeCurrency', 'rpcUrls', 'blockExplorerUrls']
163
167
  var ret = {};
@@ -217,3 +221,4 @@ module.exports.walletAddParameters = walletAddParameters;
217
221
  module.exports.templateConfig = templateConfig;
218
222
  module.exports.defaultTokenForChain = defaultTokenForChain;
219
223
  module.exports.versionHasFeature = versionHasFeature;
224
+ module.exports.isChainSupported = isChainSupported;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reality.eth/contracts",
3
- "version": "3.0.1",
3
+ "version": "3.0.4",
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",
@@ -30,8 +30,8 @@
30
30
  "url": "https://github.com/RealityETH/monorepo/issues"
31
31
  },
32
32
  "homepage": "https://reality.eth.link",
33
- "gitHead": "ec3439b604fe5fc18f20ad26cb30f2e511629a71",
33
+ "gitHead": "585f419ceedf800c2f6bfed357f31bb7fbb3bbcc",
34
34
  "dependencies": {
35
- "ethers": "^5.4.6"
35
+ "ethers": "^5.6.8"
36
36
  }
37
37
  }
package/scripts/deploy.js CHANGED
@@ -14,7 +14,10 @@ const defaultConfigs = {
14
14
  // maxFeePerGas: 61000000000,
15
15
  // maxPriorityFeePerGas: 1000000000,
16
16
  //gasPrice: 70000000000
17
- //; gasLimit: 6000000,
17
+ // gasPrice: 10000, // optimism 1000000,
18
+ gasPrice: 5000000000,
19
+ // gasLimit: 6000000, // optimism 4500000
20
+ gasLimit: 4500000,
18
21
  //etherscanApiKey: 'TPA4BFDDIH8Q7YBQ4JMGN6WDDRRPAV6G34'
19
22
  // gasLimit: 155734867 // arbitrum
20
23
  }
@@ -33,14 +36,18 @@ const chains = {
33
36
  'rinkeby': 4,
34
37
  'goerli': 5,
35
38
  'ubiq': 8,
39
+ 'optimism': 10,
36
40
  'kovan': 42,
37
41
  'bsc': 56,
38
42
  'sokol': 77,
43
+ 'cheapeth': 777,
39
44
  'xdai': 100,
40
45
  'polygon': 137,
41
46
  'ava': 43114,
42
47
  'arbitrum': 42161,
43
- 'arbitrum-rinkeby': 421611
48
+ 'arbitrum-rinkeby': 421611,
49
+ 'kovan-optimistic': 69,
50
+ 'kintsugi': 1337702,
44
51
  }
45
52
  const non_infura_chains = {
46
53
  'xdai': 'https://xdai.poanetwork.dev',
@@ -50,7 +57,11 @@ const non_infura_chains = {
50
57
  'ava': 'https://api.avax.network/ext/bc/C/rpc',
51
58
  'arbitrum': 'https://arb1.arbitrum.io/rpc',
52
59
  'arbitrum-rinkeby': 'https://rinkeby.arbitrum.io/rpc',
53
- 'ubiq': 'https://rpc.octano.dev'
60
+ 'ubiq': 'https://rpc.octano.dev',
61
+ 'cheapeth': 'https://node.cheapeth.org/rpc',
62
+ 'kovan-optimistic': 'https://kovan.optimism.io',
63
+ 'optimism': 'https://mainnet.optimism.io',
64
+ 'kintsugi': 'https://rpc.kintsugi.themerge.dev',
54
65
  }
55
66
 
56
67
  function constructContractTemplate(contract_name) {
@@ -0,0 +1,31 @@
1
+ /*
2
+ Add new lines to the abi file for more meaningful version control
3
+ */
4
+
5
+ const request = require('request');
6
+ const fs = require('fs');
7
+
8
+ const url = 'https://chainid.network/chains.json';
9
+ const out = './../chains/chainid.network.json';
10
+
11
+ let options = {json: true};
12
+
13
+ request(url, options, (error, res, body) => {
14
+ if (error) {
15
+ console.log(error)
16
+ };
17
+
18
+ if (!error && res.statusCode == 200) {
19
+ // console.log(body);
20
+ fs.writeFileSync(out, JSON.stringify(body, null, 4));
21
+ // do something with JSON, using the 'body' variable
22
+ };
23
+ });
24
+ //
25
+
26
+
27
+ /*
28
+
29
+ const file = process.argv[2]
30
+ const abi = JSON.parse(fs.readFileSync(file));
31
+ */
File without changes
@@ -42,6 +42,9 @@ for (var ci = 0; ci< chain_id_list.length; ci++) {
42
42
  if (thisr.indexOf('INFURA_API_KEY') !== -1) {
43
43
  continue;
44
44
  }
45
+ if (thisr.indexOf('ALCHEMY_API_KEY') !== -1) {
46
+ continue;
47
+ }
45
48
  rpc.push(thisr);
46
49
  }
47
50
  }