Giter Site home page Giter Site logo

substreams-erc20-contracts's Introduction

ERC-20 Contracts Substreams

Extends ERC-20 Balance Changes with Token Contract information.

First block containing ERC20 Transfers

Chain Block number
ETH 913 198
Polygon 2764
BSC 64 253

Quickstart

$ gh repo clone pinax-network/substreams-erc20-contracts
$ cd substreams-erc20-contracts
$ make
$ make gui

Releases .spkg

References

Map Outputs

map_token_supply

{
  "items": [
    {
      "address": "dac17f958d2ee523a2206206994597c13d831ec7",
      "name": "TetherUSD",
      "symbol": "USDT",
      "decimals": 6
    },
    {
      "address": "6b175474e89094c44da98b954eedeac495271d0f",
      "name": "DaiStablecoin",
      "symbol": "DAI",
      "decimals": 18
    },
    ...
  ]
}

Mermaid graph

graph TD;
  map_balance_changes[map: map_balance_changes];
  sf.ethereum.type.v2.Block[source: sf.ethereum.type.v2.Block] --> map_balance_changes;
  map_valid_balance_changes[map: map_valid_balance_changes];
  map_balance_changes --> map_valid_balance_changes;
  store_known_contracts[store: store_known_contracts];
  map_valid_balance_changes --> store_known_contracts;
  map_contracts[map: map_contracts];
  store_known_contracts -- deltas --> map_contracts;
  graph_out[map: graph_out];
  map_contracts --> graph_out;
  db_out[map: db_out];
  map_contracts --> db_out;

Modules

Package name: erc20_contracts
Version: v0.1.0
Doc: ERC-20 Token Contract Info
Modules:
----
Name: store_known_contracts
Initial block: 0
Kind: store
Value Type: string
Update Policy: UPDATE_POLICY_SET_IF_NOT_EXISTS
Hash: 82f03b5fd3efbdbc65c7e5d45798405f33257815
Doc: Stores known contracts

Name: map_contracts
Initial block: 0
Kind: map
Output Type: proto:erc20.contracts.types.v1.Contracts
Hash: 5db9c17c07f9c77340123d40265899b957d69266
Doc: Extracts ERC20 token name, symbol and decimals

Name: graph_out
Initial block: 0
Kind: map
Output Type: proto:sf.substreams.sink.entity.v1.EntityChanges
Hash: f6b5404eddf524d3fb0de22ada75aae3959b33d5

Name: db_out
Initial block: 0
Kind: map
Output Type: proto:sf.substreams.database.v1.DatabaseChanges
Hash: 53b65c3f5f14d17f41dd0e0f5d0defa17d1c07a6

substreams-erc20-contracts's People

Contributors

deniscarriere avatar matlefebvre1234 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

substreams-erc20-contracts's Issues

map_contracts: wasm execution failed deterministically: panic

panic issue:

Block number: 813375 (ETH)

eth-substreams run --start-block 813370 https://github.com/pinax-network/substreams-erc20-contracts/releases/download/v0.1.2/erc20-contracts-v0.1.2.spkg graph_out --production-mode

----------- BLOCK #840,760 (77e4695c56bf20719ae302528b5c397e52f5de53bdca8a428f9ce210c0703d80) ---------------
----------- BLOCK #840,761 (a7c846eb95de5d69801c946c329ce6939db28b63cac336ad4c9adbde799fc3eb) ---------------
Error: rpc error: code = Unknown desc = rpc error: code = InvalidArgument desc = step new irr: handler step new: execute modules: applying executor results "map_contracts": execute: maps wasm call: block 10635344: module "map_contracts": wasm execution failed deterministically: panic in the wasm: "called `Option::unwrap()` on a `None` value" at /home/mat/.cargo/registry/src/github.com-1ecc6299db9ec823/substreams-0.5.10/src/scalar.rs:565:25
----- stack trace -----
log: get_contract_name: "8e10c1a0d80018354944093be9a7e2cbdd6c437f"
log: get_contract_symbol: "8e10c1a0d80018354944093be9a7e2cbdd6c437f"
log: get_contract_decimals: "8e10c1a0d80018354944093be9a7e2cbdd6c437f"

โŒ Error

const error = new ConnectError(status.message, status.code, headerOrTrailer);

^

ConnectError: [unknown] rpc error: code = InvalidArgument desc = step new irr: handler step new: execute modules: applying executor results "map_contracts": execute: maps wasm call: block 10635344: module "map_contracts": wasm execution failed deterministically: panic in the wasm: "called `Option::unwrap()` on a `None` value" at /home/mat/.cargo/registry/src/github.com-1ecc6299db9ec823/substreams-0.5.10/src/scalar.rs:565:25

----- stack trace -----

log: get_contract_name: "8e10c1a0d80018354944093be9a7e2cbdd6c437f"

log: get_contract_symbol: "8e10c1a0d80018354944093be9a7e2cbdd6c437f"

log: get_contract_decimals: "8e10c1a0d80018354944093be9a7e2cbdd6c437f"

at findTrailerError (file:///node_modules/@bufbuild/connect-node/node_modules/@bufbuild/connect/dist/esm/protocol-grpc/trailer-status.js:80:23)

at validateTrailer (file:///node_modules/@bufbuild/connect-node/node_modules/@bufbuild/connect/dist/esm/protocol-grpc/validate-trailer.js:22:17)

at file:///node_modules/@bufbuild/connect-node/node_modules/@bufbuild/connect/dist/esm/protocol-grpc/transport.js:144:37

at Generator.next (<anonymous>)

at resume (file:///node_modules/@bufbuild/connect-node/node_modules/@bufbuild/connect/dist/esm/protocol-grpc/transport.js:32:44)

at fulfill (file:///node_modules/@bufbuild/connect-node/node_modules/@bufbuild/connect/dist/esm/protocol-grpc/transport.js:34:31)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {

rawMessage: 'rpc error: code = InvalidArgument desc = step new irr: handler step new: execute modules: applying executor results "map_contracts": execute: maps wasm call: block 10635344: module "map_contracts": wasm execution failed deterministically: panic in the wasm: "called `Option::unwrap()` on a `None` value" at /home/mat/.cargo/registry/src/github.com-1ecc6299db9ec823/substreams-0.5.10/src/scalar.rs:565:25\n' +

Last pushed block

},

clock: {

timestamp: '2016-01-07T21:33:32.000Z',

number: 813375,

id: '5bce4c6bea5a6e046dec3cb7a36054d1b348834e47c8b8ca2288041c83652775'

},

manifest: {

substreamsEndpoint: 'https://eth.substreams.pinax.network:9000'/;,

chain: 'eth',

finalBlockOnly: 'false',

moduleName: 'graph_out',

type: 'sf.substreams.sink.entity.v1.EntityChanges',

moduleHash: 'dd6cc2c1bbe1516bb4bddcd9a8ca47e1861f5609'

}

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.