@reality.eth/contracts 3.0.0 → 3.0.3
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 +28 -6
- package/chains/chainid.network.json +2708 -174
- package/chains/deployments/1/ETH/RealityETH-3.0.json +4 -1
- package/chains/deployments/1/SWISE/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/10/OETH/RealityETH-3.0.json +6 -0
- package/chains/deployments/100/GNO/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/100/SWISE/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/100/XDAI/RealityETH-3.0.json +3 -1
- package/chains/deployments/1337702/ETH/RealityETH-3.0.json +6 -0
- package/chains/deployments/4/ETH/RealityETH-3.0.json +3 -1
- package/chains/deployments/42/ETH/RealityETH-3.0.json +4 -1
- package/chains/deployments/56/DEXE/RealityETH_ERC20-3.0.json +7 -0
- package/chains/deployments/69/OETH/RealityETH-3.0.json +6 -0
- package/chains/deployments/77/XDAI/RealityETH-2.1-rc1.json +1 -3
- package/chains/deployments/777/CTH/RealityETH-3.0.json +6 -0
- package/chains/supported.json +25 -4
- package/development/contracts/Arbitrator.sol +7 -6
- package/development/contracts/BalanceHolder.sol +4 -2
- package/development/contracts/{BalanceHolderERC20.sol → BalanceHolder_ERC20.sol} +3 -2
- package/development/contracts/IArbitrator.sol +4 -7
- package/development/contracts/IArbitratorForeignProxy.sol +12 -0
- package/development/contracts/IBalanceHolder.sol +3 -1
- package/development/contracts/IBalanceHolder_ERC20.sol +11 -0
- package/development/contracts/IERC20.sol +1 -1
- package/development/contracts/IOwned.sol +1 -1
- package/development/contracts/IRealityETH.sol +63 -0
- package/development/contracts/IRealityETH_ERC20.sol +67 -0
- package/development/contracts/Owned.sol +4 -2
- package/development/contracts/RealityETH-3.0.sol +4 -82
- package/development/contracts/RealityETH_ERC20-3.0.sol +3 -3
- package/example.js +66 -0
- package/generated/chains.json +103 -12
- package/generated/contracts.json +91 -7
- package/generated/tokens.json +34 -2
- package/index.js +9 -3
- package/meta/RealityETH-2.0.json +1 -0
- package/meta/RealityETH-2.1.json +1 -0
- package/meta/RealityETH-3.0.json +7 -0
- package/meta/RealityETH_ERC20-2.0.json +1 -0
- package/meta/RealityETH_ERC20-3.0.json +7 -0
- package/package.json +3 -3
- package/scripts/deploy.js +14 -3
- package/scripts/fetch_and_reformat_chains_json.js +31 -0
- package/scripts/{format_abi.js → format_json.js} +0 -0
- package/scripts/generate_chains_json.js +3 -0
- package/tokens/CTH.json +7 -0
- package/tokens/DEXE.json +7 -0
- package/tokens/ETH.json +2 -1
- package/tokens/GNO.json +1 -0
- package/tokens/OETH.json +8 -0
- package/tokens/SWISE.json +8 -0
- package/development/contracts/IRealitio.sol +0 -44
- package/development/contracts/MultiSigWallet.sol +0 -391
- package/development/contracts/Realitio.sol +0 -756
- package/development/contracts/RealitioERC20.sol +0 -825
- package/development/contracts/RealitioSafeMath256.sol +0 -36
- package/development/contracts/RealitioSafeMath32.sol +0 -17
- package/development/contracts/Realitio_v2_1.sol +0 -819
- package/development/contracts/SplitterWallet.sol +0 -142
- package/tests/python/test_wallet.py +0 -185
package/example.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const realityeth_contracts = require('./index.js'); // Outside this module you would instead use:
|
|
2
|
+
// const realityeth_contracts = require('@reality.eth/contracts')
|
|
3
|
+
|
|
4
|
+
// In this example we'll use ethersjs to interact with the contract
|
|
5
|
+
const ethers = require('ethers');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// The chain ID is usually either specified by the user or detected from metamask etc.
|
|
9
|
+
const chain_id = 1;
|
|
10
|
+
console.log('Using chain ID', chain_id)
|
|
11
|
+
|
|
12
|
+
// We provide some basic information about chains we support.
|
|
13
|
+
// This will include an RPC node and a Graph endpoint where available.
|
|
14
|
+
const chain_info = realityeth_contracts.chainData(chain_id);
|
|
15
|
+
console.log('Loaded chain info', chain_info);
|
|
16
|
+
|
|
17
|
+
// With ethers.js we might use that to set up a provider like this:
|
|
18
|
+
const provider = new ethers.providers.JsonRpcProvider(chain_info.hostedRPC);
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
// The tokens are specified under tokens/
|
|
22
|
+
// If you don't know which token to use you can list the tokens on the current chain to let the user choose
|
|
23
|
+
const available_tokens = realityeth_contracts.chainTokenList(chain_id);
|
|
24
|
+
console.log('Available tokens on this chain are', available_tokens);
|
|
25
|
+
|
|
26
|
+
// Alternatively you can get the name of the default for the network, which will normally be the chain's native token (eg on XDAI, the XDAI token).
|
|
27
|
+
const default_token = realityeth_contracts.defaultTokenForChain(chain_id);
|
|
28
|
+
console.log('Default token is', default_token);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Once you know your chain ID and token you can get the configuration information for reality.eth on that chain.
|
|
32
|
+
// The following will get you the currently recommended version, which will be the latest stable version:
|
|
33
|
+
const default_config = realityeth_contracts.realityETHConfig(chain_id, 'ETH')
|
|
34
|
+
console.log('Default config is', default_config);
|
|
35
|
+
|
|
36
|
+
// If you want to specify the version, you can add a third parameter:
|
|
37
|
+
const version = '2.0';
|
|
38
|
+
const config = realityeth_contracts.realityETHConfig(chain_id, 'ETH', version)
|
|
39
|
+
console.log('Config for version', version, config);
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// Some features are only supported on some versions.
|
|
43
|
+
// You can check whether the current version has a feature with:
|
|
44
|
+
const has_min_bond = realityeth_contracts.versionHasFeature(version, 'min-bond');
|
|
45
|
+
console.log('Version support for minimum bonds?', has_min_bond);
|
|
46
|
+
const has_reopen_question = realityeth_contracts.versionHasFeature(version, 'reopen-question');
|
|
47
|
+
console.log('Version support for reopening questions?', has_reopen_question);
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// You can get an instance of the contract with
|
|
51
|
+
const contract = realityeth_contracts.realityETHInstance(config);
|
|
52
|
+
// console.log('Contract is', contract);
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// For ethers.js we can then instantiate a contract like this:
|
|
56
|
+
const ethers_instance = new ethers.Contract(contract.address, contract.abi, provider);
|
|
57
|
+
// console.log('ethers', ethers_instance);
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// Now we can query the contract. Here's the ID of a question that's already on mainnet:
|
|
61
|
+
const question_id = '0xa8fc96981fe9010d7ab5649af6a454202c7053b370f9ab84023277b5bfaf268e'
|
|
62
|
+
|
|
63
|
+
console.log('Querying the default RPC node', chain_info.hostedRPC);
|
|
64
|
+
ethers_instance.resultFor(question_id).then(function(result) {
|
|
65
|
+
console.log('The result for question', question_id, 'is', result);
|
|
66
|
+
});
|
package/generated/chains.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"https://api.mycryptoapi.com/eth",
|
|
13
13
|
"https://cloudflare-eth.com"
|
|
14
14
|
],
|
|
15
|
-
"hostedRPC": "https://mainnet.
|
|
15
|
+
"hostedRPC": "https://eth-mainnet.alchemyapi.io/v2/c9uS--nIxEOjVjh0AJlNttMaqUXQy8gR",
|
|
16
16
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth",
|
|
17
17
|
"blockExplorerUrls": [
|
|
18
18
|
"https://etherscan.io"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"network_name": "rinkeby",
|
|
46
46
|
"rpcUrls": [],
|
|
47
|
-
"hostedRPC": "https://rinkeby.
|
|
47
|
+
"hostedRPC": "https://eth-rinkeby.alchemyapi.io/v2/m2Op-gK2G1RiwtWHr6QB_JH9-ry0A6do",
|
|
48
48
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-rinkeby",
|
|
49
49
|
"blockExplorerUrls": [
|
|
50
50
|
"https://rinkeby.etherscan.io"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"8": {
|
|
54
54
|
"chainId": "0x8",
|
|
55
|
-
"chainName": "Ubiq
|
|
55
|
+
"chainName": "Ubiq",
|
|
56
56
|
"nativeCurrency": {
|
|
57
57
|
"name": "Ubiq Ether",
|
|
58
58
|
"symbol": "UBQ",
|
|
@@ -65,9 +65,28 @@
|
|
|
65
65
|
],
|
|
66
66
|
"hostedRPC": "https://rpc.octano.dev",
|
|
67
67
|
"blockExplorerUrls": [
|
|
68
|
+
"https://ubiqscan.io",
|
|
68
69
|
"https://ubqblockexplorer.com/"
|
|
69
70
|
]
|
|
70
71
|
},
|
|
72
|
+
"10": {
|
|
73
|
+
"chainId": "0xa",
|
|
74
|
+
"chainName": "Optimistic Ethereum",
|
|
75
|
+
"nativeCurrency": {
|
|
76
|
+
"name": "Ether",
|
|
77
|
+
"symbol": "OETH",
|
|
78
|
+
"decimals": 18
|
|
79
|
+
},
|
|
80
|
+
"network_name": "mainnet",
|
|
81
|
+
"rpcUrls": [
|
|
82
|
+
"https://mainnet.optimism.io/"
|
|
83
|
+
],
|
|
84
|
+
"hostedRPC": "https://mainnet.optimism.io",
|
|
85
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-optimism",
|
|
86
|
+
"blockExplorerUrls": [
|
|
87
|
+
"https://optimistic.etherscan.io"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
71
90
|
"42": {
|
|
72
91
|
"chainId": "0x2a",
|
|
73
92
|
"chainName": "Ethereum Testnet Kovan",
|
|
@@ -119,12 +138,29 @@
|
|
|
119
138
|
"https://www.bscscan.com"
|
|
120
139
|
]
|
|
121
140
|
},
|
|
141
|
+
"69": {
|
|
142
|
+
"chainId": "0x45",
|
|
143
|
+
"chainName": "Optimistic Ethereum Testnet Kovan",
|
|
144
|
+
"nativeCurrency": {
|
|
145
|
+
"name": "Kovan Ether",
|
|
146
|
+
"symbol": "KOR",
|
|
147
|
+
"decimals": 18
|
|
148
|
+
},
|
|
149
|
+
"network_name": "kovan",
|
|
150
|
+
"rpcUrls": [
|
|
151
|
+
"https://kovan.optimism.io/"
|
|
152
|
+
],
|
|
153
|
+
"hostedRPC": "https://kovan.optimism.io",
|
|
154
|
+
"blockExplorerUrls": [
|
|
155
|
+
"https://kovan-optimistic.etherscan.io"
|
|
156
|
+
]
|
|
157
|
+
},
|
|
122
158
|
"77": {
|
|
123
159
|
"chainId": "0x4d",
|
|
124
160
|
"chainName": "POA Network Sokol",
|
|
125
161
|
"nativeCurrency": {
|
|
126
162
|
"name": "POA Sokol Ether",
|
|
127
|
-
"symbol": "
|
|
163
|
+
"symbol": "SPOA",
|
|
128
164
|
"decimals": 18
|
|
129
165
|
},
|
|
130
166
|
"network_name": "poa-sokol",
|
|
@@ -163,31 +199,50 @@
|
|
|
163
199
|
],
|
|
164
200
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-xdai",
|
|
165
201
|
"blockExplorerUrls": [
|
|
202
|
+
"https://blockscout.com/poa/xdai",
|
|
166
203
|
"https://blockscout.com/poa/xdai/"
|
|
167
204
|
]
|
|
168
205
|
},
|
|
169
206
|
"137": {
|
|
170
207
|
"chainId": "0x89",
|
|
171
|
-
"chainName": "
|
|
208
|
+
"chainName": "Polygon Mainnet",
|
|
172
209
|
"nativeCurrency": {
|
|
173
|
-
"name": "
|
|
210
|
+
"name": "MATIC",
|
|
174
211
|
"symbol": "MATIC",
|
|
175
212
|
"decimals": 18
|
|
176
213
|
},
|
|
177
214
|
"network_name": "matic",
|
|
178
215
|
"rpcUrls": [
|
|
216
|
+
"https://polygon-rpc.com/",
|
|
179
217
|
"https://rpc-mainnet.matic.network",
|
|
180
|
-
"
|
|
218
|
+
"https://matic-mainnet.chainstacklabs.com",
|
|
219
|
+
"https://rpc-mainnet.maticvigil.com",
|
|
181
220
|
"https://rpc-mainnet.matic.quiknode.pro",
|
|
182
|
-
"https://matic-mainnet.
|
|
221
|
+
"https://matic-mainnet-full-rpc.bwarelabs.com"
|
|
183
222
|
],
|
|
184
|
-
"hostedRPC": "https://rpc
|
|
223
|
+
"hostedRPC": "https://polygon-rpc.com/",
|
|
185
224
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-polygon",
|
|
186
225
|
"blockExplorerUrls": [
|
|
187
|
-
"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",
|
|
@@ -196,7 +251,7 @@
|
|
|
196
251
|
"symbol": "ETH",
|
|
197
252
|
"decimals": 18
|
|
198
253
|
},
|
|
199
|
-
"network_name": "
|
|
254
|
+
"network_name": "arbitrum-one",
|
|
200
255
|
"rpcUrls": [
|
|
201
256
|
"https://arb1.arbitrum.io/rpc",
|
|
202
257
|
"wss://arb1.arbitrum.io/ws"
|
|
@@ -206,6 +261,25 @@
|
|
|
206
261
|
"https://explorer.arbitrum.io"
|
|
207
262
|
]
|
|
208
263
|
},
|
|
264
|
+
"43114": {
|
|
265
|
+
"chainId": "0xa86a",
|
|
266
|
+
"chainName": "Avalanche Mainnet",
|
|
267
|
+
"nativeCurrency": {
|
|
268
|
+
"name": "Avalanche",
|
|
269
|
+
"symbol": "AVAX",
|
|
270
|
+
"decimals": 18
|
|
271
|
+
},
|
|
272
|
+
"network_name": "avalanche",
|
|
273
|
+
"rpcUrls": [
|
|
274
|
+
"https://api.avax.network/ext/bc/C/rpc"
|
|
275
|
+
],
|
|
276
|
+
"hostedRPC": "https://api.avax.network/ext/bc/C/rpc",
|
|
277
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ava",
|
|
278
|
+
"blockExplorerUrls": [
|
|
279
|
+
"https://snowtrace.io/",
|
|
280
|
+
"https://cchain.explorer.avax.network/"
|
|
281
|
+
]
|
|
282
|
+
},
|
|
209
283
|
"421611": {
|
|
210
284
|
"chainId": "0x66eeb",
|
|
211
285
|
"chainName": "Arbitrum Testnet Rinkeby",
|
|
@@ -214,7 +288,7 @@
|
|
|
214
288
|
"symbol": "ARETH",
|
|
215
289
|
"decimals": 18
|
|
216
290
|
},
|
|
217
|
-
"network_name": "
|
|
291
|
+
"network_name": "arbitrum-rinkeby",
|
|
218
292
|
"rpcUrls": [
|
|
219
293
|
"https://rinkeby.arbitrum.io/rpc",
|
|
220
294
|
"wss://rinkeby.arbitrum.io/ws"
|
|
@@ -223,5 +297,22 @@
|
|
|
223
297
|
"blockExplorerUrls": [
|
|
224
298
|
"https://rinkeby-explorer.arbitrum.io"
|
|
225
299
|
]
|
|
300
|
+
},
|
|
301
|
+
"1337702": {
|
|
302
|
+
"chainId": "0x146966",
|
|
303
|
+
"chainName": "Kintsugi merge testnet",
|
|
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
|
+
]
|
|
226
317
|
}
|
|
227
318
|
}
|
package/generated/contracts.json
CHANGED
|
@@ -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": {
|
|
@@ -157,7 +181,10 @@
|
|
|
157
181
|
"address": "0xcB71745d032E16ec838430731282ff6c10D29Dea",
|
|
158
182
|
"block": 27103177,
|
|
159
183
|
"notes": null,
|
|
160
|
-
"arbitrators": {
|
|
184
|
+
"arbitrators": {
|
|
185
|
+
"0x99489d7bb33539f3d1a401741e56e8f02b9ae0cf": "Kleros (General Court)",
|
|
186
|
+
"0xb9fdd2904cbcc5543F02DB948B2CE59Ef10A950E": "Kleros DAO Governance (Technical Court)"
|
|
187
|
+
}
|
|
161
188
|
}
|
|
162
189
|
},
|
|
163
190
|
"POLK": {
|
|
@@ -206,6 +233,25 @@
|
|
|
206
233
|
"notes": null,
|
|
207
234
|
"arbitrators": {}
|
|
208
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
|
+
}
|
|
209
255
|
}
|
|
210
256
|
},
|
|
211
257
|
"77": {
|
|
@@ -215,9 +261,7 @@
|
|
|
215
261
|
"block": 17307142,
|
|
216
262
|
"token_address": null,
|
|
217
263
|
"notes": "Same as 2.1 except missing an empty address check",
|
|
218
|
-
"arbitrators": {
|
|
219
|
-
"0x37Fcdb26F12f3FC76F2424EC6B94D434a959A0f7": "Kleros (testing)"
|
|
220
|
-
}
|
|
264
|
+
"arbitrators": {}
|
|
221
265
|
},
|
|
222
266
|
"RealityETH-2.1": {
|
|
223
267
|
"address": "0x90a617ed516ab7fAaBA56CcEDA0C5D952f294d03",
|
|
@@ -237,6 +281,24 @@
|
|
|
237
281
|
}
|
|
238
282
|
},
|
|
239
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
|
+
},
|
|
240
302
|
"XDAI": {
|
|
241
303
|
"RealityETH-2.1": {
|
|
242
304
|
"address": "0x79e32aE03fb27B07C89c0c568F80287C01ca2E57",
|
|
@@ -253,7 +315,9 @@
|
|
|
253
315
|
"address": "0xE78996A233895bE74a66F451f1019cA9734205cc",
|
|
254
316
|
"block": 17997262,
|
|
255
317
|
"notes": null,
|
|
256
|
-
"arbitrators": {
|
|
318
|
+
"arbitrators": {
|
|
319
|
+
"0x29f39de98d750eb77b5fafb31b2837f079fce222": "Kleros"
|
|
320
|
+
}
|
|
257
321
|
}
|
|
258
322
|
}
|
|
259
323
|
},
|
|
@@ -280,6 +344,16 @@
|
|
|
280
344
|
}
|
|
281
345
|
}
|
|
282
346
|
},
|
|
347
|
+
"777": {
|
|
348
|
+
"CTH": {
|
|
349
|
+
"RealityETH-3.0": {
|
|
350
|
+
"address": "0xF935d11116fA0103Bd340B663879d325673106f0",
|
|
351
|
+
"block": 13539397,
|
|
352
|
+
"notes": null,
|
|
353
|
+
"arbitrators": {}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
},
|
|
283
357
|
"42161": {
|
|
284
358
|
"ARETH": {
|
|
285
359
|
"Arbitrator": {
|
|
@@ -335,5 +409,15 @@
|
|
|
335
409
|
"arbitrators": {}
|
|
336
410
|
}
|
|
337
411
|
}
|
|
412
|
+
},
|
|
413
|
+
"1337702": {
|
|
414
|
+
"ETH": {
|
|
415
|
+
"RealityETH-3.0": {
|
|
416
|
+
"address": "0x45fF90518c92C0AcF5C58784435852B5F0CBD4Be",
|
|
417
|
+
"block": 47012,
|
|
418
|
+
"notes": null,
|
|
419
|
+
"arbitrators": {}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
338
422
|
}
|
|
339
423
|
}
|
package/generated/tokens.json
CHANGED
|
@@ -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
|
@@ -8,6 +8,7 @@ function realityETHInstance(config) {
|
|
|
8
8
|
const abis = {
|
|
9
9
|
'RealityETH-2.0': require('./abi/solc-0.8.6/RealityETH-2.0.abi.json'),
|
|
10
10
|
'RealityETH-2.1': require('./abi/solc-0.8.6/RealityETH-2.1.abi.json'),
|
|
11
|
+
'RealityETH-2.1-rc1': require('./abi/solc-0.8.6/RealityETH-2.1.abi.json'),
|
|
11
12
|
'RealityETH-3.0': require('./abi/solc-0.8.6/RealityETH-3.0.abi.json'),
|
|
12
13
|
'RealityETH_ERC20-2.0': require('./abi/solc-0.8.6/RealityETH_ERC20-2.0.abi.json'),
|
|
13
14
|
'RealityETH_ERC20-3.0': require('./abi/solc-0.8.6/RealityETH_ERC20-3.0.abi.json')
|
|
@@ -50,7 +51,7 @@ function erc20Instance(config) {
|
|
|
50
51
|
function chainTokenList(chain_id) {
|
|
51
52
|
let ret = {};
|
|
52
53
|
for (t in token_info) {
|
|
53
|
-
if (all_config[""+chain_id][t]) {
|
|
54
|
+
if (all_config[""+chain_id] && all_config[""+chain_id][t]) {
|
|
54
55
|
ret[t] = token_info[t];
|
|
55
56
|
ret[t].is_native = (token_info[t].native_chains && token_info[t].native_chains[""+chain_id]);
|
|
56
57
|
}
|
|
@@ -78,7 +79,7 @@ function tokenConfig(token, chain_id) {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
function realityETHConfig(chain_id, token, version) {
|
|
81
|
-
const versions = ['
|
|
82
|
+
const versions = ['3.0', '2.1', '2.1-rc1', '2.0'];
|
|
82
83
|
const token_info = chainTokenList(chain_id);
|
|
83
84
|
if (!token_info[token]) {
|
|
84
85
|
console.log("Token not found for chain");
|
|
@@ -118,7 +119,7 @@ function realityETHConfig(chain_id, token, version) {
|
|
|
118
119
|
|
|
119
120
|
function realityETHConfigs(chain_id, token) {
|
|
120
121
|
let configs = {};
|
|
121
|
-
const versions = ['
|
|
122
|
+
const versions = ['3.0', '2.1', '2.1-rc1', '2.0'];
|
|
122
123
|
const token_info = chainTokenList(chain_id);
|
|
123
124
|
if (!token_info[token]) {
|
|
124
125
|
console.log("Token not found for network");
|
|
@@ -158,6 +159,10 @@ function chainData(chain_id) {
|
|
|
158
159
|
return chain_info[""+chain_id];
|
|
159
160
|
}
|
|
160
161
|
|
|
162
|
+
function isChainSupported(chain_id) {
|
|
163
|
+
return (""+chain_id in chain_info);
|
|
164
|
+
}
|
|
165
|
+
|
|
161
166
|
function walletAddParameters(chain_id) {
|
|
162
167
|
var params = ['chainId', 'chainName', 'nativeCurrency', 'rpcUrls', 'blockExplorerUrls']
|
|
163
168
|
var ret = {};
|
|
@@ -217,3 +222,4 @@ module.exports.walletAddParameters = walletAddParameters;
|
|
|
217
222
|
module.exports.templateConfig = templateConfig;
|
|
218
223
|
module.exports.defaultTokenForChain = defaultTokenForChain;
|
|
219
224
|
module.exports.versionHasFeature = versionHasFeature;
|
|
225
|
+
module.exports.isChainSupported = isChainSupported;
|
package/meta/RealityETH-2.0.json
CHANGED
package/meta/RealityETH-2.1.json
CHANGED
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
"artifact": "truffle/build/contracts/RealitioERC20.json",
|
|
3
3
|
"commit": "https://github.com/realitio/realitio-contracts/commit/7c2096b22f7aa9bfb496f0c167ecce07108d7218",
|
|
4
4
|
"solc": "v0.4.25+commit.59dbf8f1",
|
|
5
|
+
"optimize-runs": 200,
|
|
5
6
|
"audit": "RealityETH_2.0_ERC20.txt"
|
|
6
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reality.eth/contracts",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
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": "
|
|
33
|
+
"gitHead": "b9fcb24ff3274a58c4f98c0c97b58c4d5c5b0fcd",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"ethers": "^5.
|
|
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
|
-
|
|
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) {
|