forked from 0xSlot/erc721-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (23 loc) · 713 Bytes
/
index.js
File metadata and controls
28 lines (23 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env node
"use strict";
const Balances = require("./balances");
const Config = require("./config");
const Events = require("./events/blockchain");
const Export = require("./export");
const start = async () => {
await Config.checkConfig();
const format = Config.getConfig().format;
const result = await Events.get();
console.log("Calculating balances of %s (%s)", result.name, result.symbol);
const balances = await Balances.createBalances(result);
console.log(`Found ${balances.length} holders.`);
console.log('Exporting...');
await Export.exportBalances(result.symbol, balances, format);
};
(async () => {
try {
await start();
} catch (e) {
console.error(e);
}
})();