@reality.eth/contracts 3.0.4 → 3.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reality.eth/contracts",
3
- "version": "3.0.4",
3
+ "version": "3.0.8",
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": "585f419ceedf800c2f6bfed357f31bb7fbb3bbcc",
33
+ "gitHead": "05860734d57fdc767597d230a4898a26ec1ed019",
34
34
  "dependencies": {
35
35
  "ethers": "^5.6.8"
36
36
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "decimals": 18,
3
+ "small_number": 10000000000000000,
4
+ "erc20_chains": {
5
+ "280": "0x000000000000000000000000000000000000800a"
6
+ }
7
+ }
@@ -1,52 +0,0 @@
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
- };