Giter Site home page Giter Site logo

anhtuan3996 / astar-erc-tokens Goto Github PK

View Code? Open in Web Editor NEW

This project forked from subsquid/astar-erc-tokens

0.0 0.0 0.0 1.16 MB

About Squid for tracking ERC20/ERC721/ERC1155 tokens and transfers in Astar network

License: GNU General Public License v3.0

Shell 0.11% JavaScript 0.05% TypeScript 99.74% Makefile 0.04% Dockerfile 0.05%

astar-erc-tokens's Introduction

Astar ERC squid

๐Ÿ”Ž Explore publick squid in Aquarium.

This squid uses Firesquid framework version, EVM logs indexing feature and batch processing flow.

It accumulates data about ERC20, ERC721, ERC1155 tokens, such as:

  • ERC20 token details;
  • ERC721/ERC115 token details:
    • token details;
    • token URI update events;
  • account details :
    • transfers;
    • owned ERC721/ERC1155 tokens;
    • ERC20 token balances;
  • ERC20 token transfers;
  • ERC721/ERC115 token transfers;

More details about data schema you can find in schema.graphql file.

Tracked events:

  • Transfer - for ERC20 and ERC721
  • TransferSingle, TransferBatch, URI - for ERC721 and ERC1155

Particular qualities of implementation:

  1. Squid is looking for all contracts which are fit to standards ERC20, ERC721, ERC1155 and not for any specific contract by address. As result, only standard events for these contract standards are tracked (Transfer, TransferSingle, TransferBatch, URI).
  2. Some ERC721/ERC1155 token balances can be not quite accurate in current squid. Reason - some contracts has custom actions, which don't emit Transfer event. As result, squid logic cannot track token status changes in such cases. However, ERC20 contract balances are accurate.
  3. Some of ERC721 tokens can have null value of name and symbol fields during some period of time. Reason - some contracts have these particular fields as editable fields and values are changing after mint process. Squid logic checks on each Transfer | TransferSingle | TransferBatch event if interacted token has name and symbol value. If not, actual data will be requested to the appropriate contract.

Prerequisites

  • node >= 16.x
  • docker

Local running

# 1. Install dependencies
npm install

# 2. Generate types regarding spec versions from archive and configs in ./typegen/typegen.json
make typegen

# 3. Run script, which will 
#    - generate models based on schema.graphql file
#    - build project typescript source
#    - run docker container and configure Postgres DB there
npm run db:reset

# 4. Run processor
npm run processor:start

# 5. The above command will block the terminal
#    being busy with fetching the chain data, 
#    transforming and storing it in the target database.
#
#    To start the graphql server open the separate terminal
#    and run
npx squid-graphql-server

Fo more details How to develop?, check this FAQ or this project template.

astar-erc-tokens's People

Contributors

mckrava 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.