@reality.eth/contracts 3.0.3 → 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.
- package/README.md +9 -3
- package/chains/chainid.network.json +4618 -810
- package/chains/supported.json +8 -4
- package/generated/chains.json +23 -23
- package/index.js +0 -1
- package/package.json +2 -2
- package/scripts/send_funds.js +52 -0
package/chains/supported.json
CHANGED
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
"1": {
|
|
3
3
|
"hostedRPC": "https://eth-mainnet.alchemyapi.io/v2/c9uS--nIxEOjVjh0AJlNttMaqUXQy8gR",
|
|
4
4
|
"explorerURL": "https://etherscan.io",
|
|
5
|
-
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth"
|
|
5
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth",
|
|
6
|
+
"network_name": "mainnet"
|
|
6
7
|
},
|
|
7
8
|
"3": {
|
|
8
9
|
"hostedRPC": "https://ropsten.infura.io/tSrhlXUe1sNEO5ZWhpUK",
|
|
9
10
|
"explorerURL": "https://ropsten.etherscan.io",
|
|
10
|
-
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ropsten"
|
|
11
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ropsten",
|
|
12
|
+
"network_name": "ropsten"
|
|
11
13
|
},
|
|
12
14
|
"4": {
|
|
13
15
|
"hostedRPC": "https://eth-rinkeby.alchemyapi.io/v2/m2Op-gK2G1RiwtWHr6QB_JH9-ry0A6do",
|
|
14
16
|
"explorerURL": "https://rinkeby.etherscan.io",
|
|
15
|
-
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-rinkeby"
|
|
17
|
+
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-rinkeby",
|
|
18
|
+
"network_name": "rinkeby"
|
|
16
19
|
},
|
|
17
20
|
"8": {
|
|
18
21
|
"hostedRPC": "https://rpc.octano.dev",
|
|
@@ -34,7 +37,8 @@
|
|
|
34
37
|
},
|
|
35
38
|
"69": {
|
|
36
39
|
"hostedRPC": "https://kovan.optimism.io",
|
|
37
|
-
"explorerURL": "https://kovan-optimistic.etherscan.io"
|
|
40
|
+
"explorerURL": "https://kovan-optimistic.etherscan.io",
|
|
41
|
+
"network_name": "kovan"
|
|
38
42
|
},
|
|
39
43
|
"77": {
|
|
40
44
|
"explorerURL": "https://blockscout.com/poa/sokol",
|
package/generated/chains.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"3": {
|
|
22
22
|
"chainId": "0x3",
|
|
23
|
-
"chainName": "
|
|
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": "
|
|
39
|
+
"chainName": "Rinkeby",
|
|
40
40
|
"nativeCurrency": {
|
|
41
41
|
"name": "Rinkeby Ether",
|
|
42
42
|
"symbol": "RIN",
|
|
@@ -58,7 +58,6 @@
|
|
|
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"
|
|
@@ -71,13 +70,12 @@
|
|
|
71
70
|
},
|
|
72
71
|
"10": {
|
|
73
72
|
"chainId": "0xa",
|
|
74
|
-
"chainName": "
|
|
73
|
+
"chainName": "Optimism",
|
|
75
74
|
"nativeCurrency": {
|
|
76
75
|
"name": "Ether",
|
|
77
|
-
"symbol": "
|
|
76
|
+
"symbol": "ETH",
|
|
78
77
|
"decimals": 18
|
|
79
78
|
},
|
|
80
|
-
"network_name": "mainnet",
|
|
81
79
|
"rpcUrls": [
|
|
82
80
|
"https://mainnet.optimism.io/"
|
|
83
81
|
],
|
|
@@ -89,13 +87,13 @@
|
|
|
89
87
|
},
|
|
90
88
|
"42": {
|
|
91
89
|
"chainId": "0x2a",
|
|
92
|
-
"chainName": "
|
|
90
|
+
"chainName": "Kovan",
|
|
93
91
|
"nativeCurrency": {
|
|
94
92
|
"name": "Kovan Ether",
|
|
95
93
|
"symbol": "KOV",
|
|
96
94
|
"decimals": 18
|
|
97
95
|
},
|
|
98
|
-
"network_name": "
|
|
96
|
+
"network_name": "testnet",
|
|
99
97
|
"rpcUrls": [
|
|
100
98
|
"https://kovan.poa.network",
|
|
101
99
|
"http://kovan.poa.network:8545",
|
|
@@ -140,7 +138,7 @@
|
|
|
140
138
|
},
|
|
141
139
|
"69": {
|
|
142
140
|
"chainId": "0x45",
|
|
143
|
-
"chainName": "
|
|
141
|
+
"chainName": "Optimism Kovan",
|
|
144
142
|
"nativeCurrency": {
|
|
145
143
|
"name": "Kovan Ether",
|
|
146
144
|
"symbol": "KOR",
|
|
@@ -177,7 +175,7 @@
|
|
|
177
175
|
},
|
|
178
176
|
"100": {
|
|
179
177
|
"chainId": "0x64",
|
|
180
|
-
"chainName": "
|
|
178
|
+
"chainName": "Gnosis",
|
|
181
179
|
"nativeCurrency": {
|
|
182
180
|
"name": "xDAI",
|
|
183
181
|
"symbol": "xDAI",
|
|
@@ -185,21 +183,22 @@
|
|
|
185
183
|
},
|
|
186
184
|
"network_name": "xdai",
|
|
187
185
|
"rpcUrls": [
|
|
188
|
-
"https://rpc.
|
|
186
|
+
"https://rpc.gnosischain.com",
|
|
189
187
|
"https://xdai.poanetwork.dev",
|
|
190
|
-
"wss://rpc.xdaichain.com/wss",
|
|
191
|
-
"wss://xdai.poanetwork.dev/wss",
|
|
192
|
-
"http://xdai.poanetwork.dev",
|
|
193
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",
|
|
194
193
|
"ws://xdai.poanetwork.dev:8546"
|
|
195
194
|
],
|
|
196
|
-
"hostedRPC": "https://rpc.
|
|
195
|
+
"hostedRPC": "https://rpc.gnosischain.com",
|
|
197
196
|
"iconUrls": [
|
|
198
197
|
"https://gblobscdn.gitbook.com/spaces%2F-Lpi9AHj62wscNlQjI-l%2Favatar.png"
|
|
199
198
|
],
|
|
200
199
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-xdai",
|
|
201
200
|
"blockExplorerUrls": [
|
|
202
|
-
"https://blockscout.com/
|
|
201
|
+
"https://blockscout.com/xdai/mainnet",
|
|
203
202
|
"https://blockscout.com/poa/xdai/"
|
|
204
203
|
]
|
|
205
204
|
},
|
|
@@ -223,6 +222,7 @@
|
|
|
223
222
|
"hostedRPC": "https://polygon-rpc.com/",
|
|
224
223
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-polygon",
|
|
225
224
|
"blockExplorerUrls": [
|
|
225
|
+
"https://polygonscan.com",
|
|
226
226
|
"https://polygonscan.com/"
|
|
227
227
|
]
|
|
228
228
|
},
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
},
|
|
264
264
|
"43114": {
|
|
265
265
|
"chainId": "0xa86a",
|
|
266
|
-
"chainName": "Avalanche
|
|
266
|
+
"chainName": "Avalanche C-Chain",
|
|
267
267
|
"nativeCurrency": {
|
|
268
268
|
"name": "Avalanche",
|
|
269
269
|
"symbol": "AVAX",
|
|
@@ -276,13 +276,13 @@
|
|
|
276
276
|
"hostedRPC": "https://api.avax.network/ext/bc/C/rpc",
|
|
277
277
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-ava",
|
|
278
278
|
"blockExplorerUrls": [
|
|
279
|
-
"https://snowtrace.io
|
|
279
|
+
"https://snowtrace.io",
|
|
280
280
|
"https://cchain.explorer.avax.network/"
|
|
281
281
|
]
|
|
282
282
|
},
|
|
283
283
|
"421611": {
|
|
284
284
|
"chainId": "0x66eeb",
|
|
285
|
-
"chainName": "Arbitrum
|
|
285
|
+
"chainName": "Arbitrum Rinkeby",
|
|
286
286
|
"nativeCurrency": {
|
|
287
287
|
"name": "Arbitrum Rinkeby Ether",
|
|
288
288
|
"symbol": "ARETH",
|
|
@@ -290,17 +290,17 @@
|
|
|
290
290
|
},
|
|
291
291
|
"network_name": "arbitrum-rinkeby",
|
|
292
292
|
"rpcUrls": [
|
|
293
|
-
"https://rinkeby.arbitrum.io/rpc"
|
|
294
|
-
"wss://rinkeby.arbitrum.io/ws"
|
|
293
|
+
"https://rinkeby.arbitrum.io/rpc"
|
|
295
294
|
],
|
|
296
295
|
"hostedRPC": "https://rinkeby.arbitrum.io/rpc",
|
|
297
296
|
"blockExplorerUrls": [
|
|
297
|
+
"https://testnet.arbiscan.io",
|
|
298
298
|
"https://rinkeby-explorer.arbitrum.io"
|
|
299
299
|
]
|
|
300
300
|
},
|
|
301
301
|
"1337702": {
|
|
302
302
|
"chainId": "0x146966",
|
|
303
|
-
"chainName": "Kintsugi
|
|
303
|
+
"chainName": "Kintsugi",
|
|
304
304
|
"nativeCurrency": {
|
|
305
305
|
"name": "kintsugi Ethere",
|
|
306
306
|
"symbol": "kiETH",
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
],
|
|
313
313
|
"hostedRPC": "https://rpc.kintsugi.themerge.dev",
|
|
314
314
|
"blockExplorerUrls": [
|
|
315
|
-
"https://explorer.kintsugi.themerge.dev
|
|
315
|
+
"https://explorer.kintsugi.themerge.dev"
|
|
316
316
|
]
|
|
317
317
|
}
|
|
318
318
|
}
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reality.eth/contracts",
|
|
3
|
-
"version": "3.0.
|
|
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,7 +30,7 @@
|
|
|
30
30
|
"url": "https://github.com/RealityETH/monorepo/issues"
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://reality.eth.link",
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "585f419ceedf800c2f6bfed357f31bb7fbb3bbcc",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"ethers": "^5.6.8"
|
|
36
36
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const ethers = require('ethers');
|
|
3
|
+
|
|
4
|
+
const from = process.argv[2]
|
|
5
|
+
if (!from) {
|
|
6
|
+
throw new Error("Usage: node migrate_wallet.js <from> <to> <rpc>");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const to = process.argv[3]
|
|
10
|
+
if (!to) {
|
|
11
|
+
throw new Error("Usage: node migrate_wallet.js <from> <to> <rpc>");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const rpc = process.argv[4];
|
|
15
|
+
if (!rpc) {
|
|
16
|
+
throw new Error("Usage: node migrate_wallet.js <from> <to> <rpc>");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// For infura we just pass the network name eg kovan
|
|
20
|
+
const provider = (rpc.startsWith('http')) ? new ethers.providers.JsonRpcProvider(rpc) : new ethers.providers.InfuraProvider(rpc);
|
|
21
|
+
|
|
22
|
+
const fpriv = fs.readFileSync(from, 'utf8').replace(/\n/, '')
|
|
23
|
+
const tpriv = fs.readFileSync(to, 'utf8').replace(/\n/, '')
|
|
24
|
+
|
|
25
|
+
const f = new ethers.Wallet(fpriv, provider);
|
|
26
|
+
const t = new ethers.Wallet(tpriv, provider);
|
|
27
|
+
|
|
28
|
+
//console.log(provider);
|
|
29
|
+
migrateFunds(provider, f, t);
|
|
30
|
+
|
|
31
|
+
async function migrateFunds(provider, f, t) {
|
|
32
|
+
|
|
33
|
+
const bal = await provider.getBalance(f.signingKey.address)
|
|
34
|
+
const gas_price = await provider.getGasPrice()
|
|
35
|
+
const nonce = await provider.getTransactionCount(f.signingKey.address, 'latest')
|
|
36
|
+
const gas_limit = 21000;
|
|
37
|
+
|
|
38
|
+
// console.log(f)
|
|
39
|
+
|
|
40
|
+
const txdata = {
|
|
41
|
+
to: t.signingKey.address,
|
|
42
|
+
value: bal.sub((gas_price.mul(gas_limit))),
|
|
43
|
+
nonce: nonce,
|
|
44
|
+
gasLimit: ethers.utils.hexlify(gas_limit),
|
|
45
|
+
gasPrice: gas_price,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const walletSigner = f.connect(provider)
|
|
49
|
+
const response = await walletSigner.sendTransaction(txdata);
|
|
50
|
+
console.log('sent tx', response.hash)
|
|
51
|
+
|
|
52
|
+
};
|