Skip to content

Snapshot was broken merge pull request to fix npm #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion balances.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports.createBalances = async data => {

closingBalances.push({
wallet: key,
balance: balance.div(10 ** parseInt(data.decimals)).toFixed(data.decimals)
balance: balance.div(10 ** parseInt(data.decimals)).toFixed(18)
});
}

Expand Down
5 changes: 1 addition & 4 deletions contract.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"use strict";

const Web3 = require("web3");

const Config = require("./config").getConfig();
const Parameters = require("./parameters").get();

const web3 = new Web3(new Web3.providers.HttpProvider((Config || {}).provider || "http://localhost:8545"));
const contractAddress = (Config || {}).contractAddress;

module.exports.getContract = () => {
const contract = web3.eth.Contract(Parameters.abi, contractAddress);
const contract = new web3.eth.Contract(Parameters.abi, contractAddress);
return contract;
};
1 change: 1 addition & 0 deletions events/block-by-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const range = (start, end) => {

module.exports.tryBlockByBlock = async (contract, start, end, symbol) => {
const blocks = range(start, end);
console.log('blocks: ', blocks)

let counter = 0;
for await (const i of blocks) {
Expand Down
7 changes: 2 additions & 5 deletions events/block-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ const getMinimal = pastEvents => {
transactionHash: tx.transactionHash,
from: tx.returnValues["0"],
to: tx.returnValues["1"],
value: tx.returnValues["2"]._hex
value: tx.returnValues["2"]
};
});
};

module.exports.getEvents = async symbol => {
const directory = Parameters.eventsDownloadFolder.replace(/{token}/g, symbol);
var files = await readdirAsync(directory);
files.sort((a,b) => {
return parseInt(a.split(".")[0]) - parseInt(b.split(".")[0]);
});
const files = await readdirAsync(directory);
let events = [];

console.log("Parsing files.");
Expand Down
2 changes: 1 addition & 1 deletion events/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports.get = async () => {
var fromBlock = parseInt(Config.fromBlock) || 0;
const blocksPerBatch = parseInt(Config.blocksPerBatch) || 0;
const delay = parseInt(Config.delay) || 0;
const toBlock = blockHeight;
const toBlock = parseInt(Config.toBlock) || blockHeight;

const lastDownloadedBlock = await LastDownloadedBlock.get(symbol);

Expand Down