@gooddollar/goodprotocol 1.0.22 → 1.0.23-beta.0
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,5 +1,6 @@
|
|
|
1
1
|
import { countBy, chunk, difference, flatten, sortBy } from "lodash";
|
|
2
2
|
import fs from "fs";
|
|
3
|
+
import fetch from "node-fetch";
|
|
3
4
|
import { network, ethers, upgrades } from "hardhat";
|
|
4
5
|
import { Contract, Provider, setMulticallAddress } from "ethers-multicall";
|
|
5
6
|
import Identity from "../../artifacts/contracts/Interfaces.sol/IIdentity.json";
|
|
@@ -8,7 +9,8 @@ setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
|
|
|
8
9
|
const CLAIM_START_BLOCK = 17896430;
|
|
9
10
|
|
|
10
11
|
const fuseProvider = new ethers.providers.JsonRpcBatchProvider(
|
|
11
|
-
"https://
|
|
12
|
+
"https://explorer-node.fuse.io/"
|
|
13
|
+
// "https://rpc.fuse.io"
|
|
12
14
|
);
|
|
13
15
|
const ethcallProvider = new Provider(fuseProvider, 122);
|
|
14
16
|
|
|
@@ -45,15 +47,33 @@ const hasBalanceToRefund = async wallets => {
|
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
const hasRefunded = async wallets => {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
const curBlock = (await gd.provider.getBlockNumber()) - 1;
|
|
51
|
+
console.log({ curBlock });
|
|
52
|
+
let toBlock = CLAIM_START_BLOCK + 50000;
|
|
53
|
+
let refunded = [];
|
|
54
|
+
let startBlock = CLAIM_START_BLOCK;
|
|
55
|
+
while (startBlock <= curBlock) {
|
|
56
|
+
const events = await gd.queryFilter(
|
|
57
|
+
gd.filters.Transfer(
|
|
58
|
+
undefined,
|
|
59
|
+
"0xd253A5203817225e9768C05E5996d642fb96bA86"
|
|
60
|
+
),
|
|
61
|
+
startBlock,
|
|
62
|
+
toBlock
|
|
63
|
+
);
|
|
64
|
+
const accounts = events
|
|
65
|
+
.filter(e => e.args.amount >= 9622260)
|
|
66
|
+
.map(_ => _.args.from.toLowerCase());
|
|
67
|
+
refunded.push(...accounts);
|
|
68
|
+
console.log("has refunded:", {
|
|
69
|
+
startBlock,
|
|
70
|
+
toBlock,
|
|
71
|
+
accounts: accounts.length
|
|
72
|
+
});
|
|
73
|
+
toBlock = Math.min(curBlock, toBlock + 50000);
|
|
74
|
+
startBlock += 50000;
|
|
75
|
+
}
|
|
76
|
+
return refunded;
|
|
57
77
|
};
|
|
58
78
|
|
|
59
79
|
const whereIsTheMoney = async noBalance => {
|