@reality.eth/contracts 3.0.53 → 3.0.54
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/chains/supported.json
CHANGED
|
@@ -80,6 +80,11 @@
|
|
|
80
80
|
"graphURL": "https://api.thegraph.com/subgraphs/name/realityeth/realityeth-zksync-era",
|
|
81
81
|
"network_name": "zksync-era"
|
|
82
82
|
},
|
|
83
|
+
"690": {
|
|
84
|
+
"hostedRPC": "https://rpc.redstonechain.com",
|
|
85
|
+
"explorerURL": "https://explorer.redstone.xyz/",
|
|
86
|
+
"network_name": "redstone"
|
|
87
|
+
},
|
|
83
88
|
"777": {
|
|
84
89
|
"explorerURL": "https://explore.cheapswap.io/",
|
|
85
90
|
"network_name": "cheapeth"
|
package/generated/chains.json
CHANGED
|
@@ -367,6 +367,25 @@
|
|
|
367
367
|
"https://explorer.zksync.io/"
|
|
368
368
|
]
|
|
369
369
|
},
|
|
370
|
+
"690": {
|
|
371
|
+
"chainId": "0x2b2",
|
|
372
|
+
"chainName": "Redstone",
|
|
373
|
+
"nativeCurrency": {
|
|
374
|
+
"name": "Ether",
|
|
375
|
+
"symbol": "ETH",
|
|
376
|
+
"decimals": 18
|
|
377
|
+
},
|
|
378
|
+
"network_name": "redstone",
|
|
379
|
+
"rpcUrls": [
|
|
380
|
+
"https://rpc.redstonechain.com",
|
|
381
|
+
"wss://rpc.redstonechain.com"
|
|
382
|
+
],
|
|
383
|
+
"hostedRPC": "https://rpc.redstonechain.com",
|
|
384
|
+
"blockExplorerUrls": [
|
|
385
|
+
"https://explorer.redstone.xyz",
|
|
386
|
+
"https://explorer.redstone.xyz/"
|
|
387
|
+
]
|
|
388
|
+
},
|
|
370
389
|
"777": {
|
|
371
390
|
"chainId": "0x309",
|
|
372
391
|
"chainName": "cheapETH",
|
package/generated/contracts.json
CHANGED
|
@@ -378,6 +378,16 @@
|
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
},
|
|
381
|
+
"690": {
|
|
382
|
+
"ETH": {
|
|
383
|
+
"RealityETH-3.0": {
|
|
384
|
+
"address": "0xc716c23D75f523eF0C511456528F2A1980256a87",
|
|
385
|
+
"block": 3034954,
|
|
386
|
+
"notes": null,
|
|
387
|
+
"arbitrators": {}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
381
391
|
"777": {
|
|
382
392
|
"CTH": {
|
|
383
393
|
"RealityETH-3.0": {
|
package/generated/tokens.json
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.54",
|
|
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": "6277f6e0474a0051c6dd4531be3453bd56d7c75e",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"ethers": "^5.6.8"
|
|
40
40
|
}
|
package/scripts/deploy.js
CHANGED
|
@@ -4,6 +4,7 @@ const project_base = './../';
|
|
|
4
4
|
const build_dir = './../truffle/build/contracts/';
|
|
5
5
|
const rc = require('../index.js');
|
|
6
6
|
const { join } = require('path');
|
|
7
|
+
const chain_configs = require('./../generated/chains.json');
|
|
7
8
|
|
|
8
9
|
let secrets_dir = join(__dirname, '../secrets');
|
|
9
10
|
if (process.env.SECRETS) {
|
|
@@ -121,7 +122,23 @@ function usage_error(msg) {
|
|
|
121
122
|
throw msg;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
|
|
125
|
+
|
|
126
|
+
const isNumeric = (string) => /^[+-]?\d+(\.\d+)?$/.test(string)
|
|
127
|
+
|
|
128
|
+
let chain_id;
|
|
129
|
+
// Predefined chains (old method)
|
|
130
|
+
if (chain in chains) {
|
|
131
|
+
chain_id = chains[chain];
|
|
132
|
+
// Get the chain from the chain config
|
|
133
|
+
} else {
|
|
134
|
+
for (const c in chain_configs) {
|
|
135
|
+
const cn = chain_configs[c].chainName.toLowerCase().replace(' ', '-');
|
|
136
|
+
if (cn == chain) {
|
|
137
|
+
chain_id = c;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
125
142
|
|
|
126
143
|
if (!chain_id) {
|
|
127
144
|
usage_error("Network unknown");
|
|
@@ -195,14 +212,26 @@ function store_deployed_factory_contract(template, chain_id, out_json) {
|
|
|
195
212
|
console.log('wrote file', file);
|
|
196
213
|
}
|
|
197
214
|
|
|
215
|
+
function chain_config_for_name(chain_name) {
|
|
216
|
+
for (cc in chain_configs) {
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
}
|
|
198
220
|
|
|
199
221
|
function provider_for_chain() {
|
|
200
222
|
if (non_infura_chains[chain]) {
|
|
201
223
|
console.log('Using chain', non_infura_chains[chain]);
|
|
202
224
|
return new ethers.providers.JsonRpcProvider(non_infura_chains[chain]);
|
|
203
225
|
} else {
|
|
204
|
-
|
|
205
|
-
|
|
226
|
+
if (chains[chain]) {
|
|
227
|
+
console.log('Using infura on chain', chain);
|
|
228
|
+
return new ethers.providers.InfuraProvider(chain);
|
|
229
|
+
} else {
|
|
230
|
+
const chain_config = chain_configs[chain_id];
|
|
231
|
+
const hostedRPC = chain_config.hostedRPC;
|
|
232
|
+
console.log('Using RPC', hostedRPC);
|
|
233
|
+
return new ethers.providers.JsonRpcProvider(chain_config.hostedRPC);
|
|
234
|
+
}
|
|
206
235
|
}
|
|
207
236
|
}
|
|
208
237
|
|
|
@@ -227,6 +256,7 @@ async function waitForGas(provider) {
|
|
|
227
256
|
|
|
228
257
|
const f = await provider.getFeeData()
|
|
229
258
|
console.log('fee', f)
|
|
259
|
+
throw new Error();
|
|
230
260
|
return;
|
|
231
261
|
if (f.gasPrice.gt(ethers.BigNumber.from(defaultConfigs.maxFeePerGas))) {
|
|
232
262
|
console.log('Gas is too expensive, got', f.gasPrice.toString(), 'but you will only pay ', defaultConfigs.maxFeePerGas, ', retrying...')
|