Substreams for ERC-20 tokens.
$ gh repo clone pinax-network/substreams-erc20
$ cd substreams-erc20
$ make
$ make gui
- Ethereum Docs: ERC-20 Token Standard
- EIPS: ERC-20 Token Standard
- OpenZeppelin implementation
- ConsenSys implementation
Method | Description |
---|---|
name |
Returns the name of the token - e.g. "MyToken". |
symbol |
Returns the symbol of the token. E.g. "HIX". |
decimals |
Returns the number of decimals the token uses - e.g. 8 , means to divide the token amount by 100000000 to |
totalSupply |
Returns the total token supply. |
balanceOf |
Returns the account balance of another account with address _owner . |
transfer |
Transfers _value amount of tokens to address _to , and MUST fire the Transfer event. |
transferFrom |
Transfers _value amount of tokens from address _from to address _to , and MUST fire the Transfer event. |
approve |
Allows _spender to withdraw from your account multiple times, up to the _value amount. If this function is |
allowance |
Returns the amount which _spender is still allowed to withdraw from _owner . |
input | method |
---|---|
0xa9059cbb |
transfer(address,uint256) |
0x23b872dd |
transferFrom(address,address,uint256) |
0x095ea7b3 |
approve(address,uint256) |
https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7#writeContract
input | method |
---|---|
0xcc872b66 |
issue(uint256) |
0xdb006a75 |
redeem(uint256) |
https://etherscan.io/address/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48#writeProxyContract
input | method |
---|---|
0x40c10f19 |
mint(address,uint256) |
0x42966c68 |
burn(uint256) |
0xf2fde38b |
transferOwnership(address) |
Event | Description |
---|---|
Transfer |
MUST trigger when tokens are transferred, including zero value transfers. |
Approval |
MUST trigger on any successful call to approve(address _spender, uint256 _value) . |
graph TD;
map_block[map: map_block];
sf.ethereum.type.v2.Block[source: sf.ethereum.type.v2.Block] --> map_block;
graph_out[map: graph_out];
sf.substreams.v1.Clock[source: sf.substreams.v1.Clock] --> graph_out;
map_block --> graph_out;
Here is a quick link to see the graph:
Package name: erc20
Version: v0.3.0
Doc: ERC-20
Modules:
----
Name: map_block
Initial block: 0
Kind: map
Output Type: proto:erc20.types.v1.Block
Hash: b12d86d51593789e230c66f0980f23c27b48d431
Doc: Extracts 'Approval' & 'Transfer' events from the block and storage changes from 'transfer' and 'transferFrom' functions.
Name: graph_out
Initial block: 0
Kind: map
Output Type: proto:sf.substreams.sink.entity.v1.EntityChanges
Hash: 9ebb0501883d74139f68af6d24b3649b35f80bb5
Name: kv_out
Initial block: 0
Kind: map
Output Type: proto:sf.substreams.sink.kv.v1.KVOperations
Hash: 18506933a53f78a0c8581d77ccedb2059d3a78f3