Giter VIP home page Giter VIP logo

token-snapshot's Introduction

Token Snapshot

Create ERC20 Token Snapshots on any EVM chains!

Stargazers Issues License



This command-line utility creates a snapshot of any ERC20 token in JSON or CSV format. Use your own fully synced Ethereum node or any Ethereum node as a service like Infura.

  • Works without a local Ethereum node.
  • Automatically resumes the next time upon failure.
  • Tested to work with Infura / QuickNode / Alchemy.

Important Notes

This package is based on the little outdated erc20-snapshot package. Here is the list of the main modifications compared to the initial package:

  • Upgraded all dependencies to their latest version;
  • Switched from web3 to ethers;
  • Switched to ES6 modules;
  • Added prettier in addition to eslint;
  • Group the snapshot output files into a result folder for clarity;

Getting Started

npm install token-snapshot -g

CLI Arguments

None. Prompts for user input and produces a configuration file on the first run.

How to Use Token Snapshot?

Navigate to a directory where you'd like to save the token snapshot to.

cd path/to/a/directory

Run the program:

snapshot

Configuration File / Prompt Parameters

{
  "provider": "https://mainnet.infura.io/v3/<key>",
  "contractAddress": "",
  "fromBlock": 0,
  "toBlock": "latest",
  "format": "json",
  "blocksPerBatch": 2500,
  "delay": 0,
  "checkIfContract": "yes"
}

provider

Enter your fully synced Ethereum node. Could be a local node or remote services like Infura.

contractAddress

Address of your ERC20 token.

fromBlock

The block height to scan from. To save time, enter the block number of the transaction your token was created on.

toBlock

The block height to end the scan at.

format

The format of the output file(s), either CSV or JSON. both is selected by default.

blocksPerBatch

The number of blocks to query per batch.

If you are using remote service like Infura, keep this number relative low (2000-5000) to avoid rate limits. If you are using a dedicated Ethereum node, you can increase this number to suit your needs.

delay

The delay (in ms) between each request in the loop. Tweak this if you are experiencing rate limit from your provider.

checkIfContract

Checks each address to determine whether it is a smart contract or an Ethereum wallet.

Result

You will get your snapshot files in the newly created result/balances folder. You can also check the detail of each block in which a tx was found in result/tx/{token Symbol}

Aknowlegements

Binod Nirvan (@binodp):
> https://github.com/binodnp/erc20-snapshot

token-snapshot's People

Contributors

pedrojok01 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.