Skip to content

Does something when a new contract is deployed

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

INTEARnear/new-token-indexer

Repository files navigation

Contract Indexer

This indexer watches for new contract deployments and sends NEP-141 / NEP-171 deployments to Redis stream newcontract_nep141 / newcontract_nep171. To avoid handling contract update (second deployment on the same address), it saves existing tokens in known_tokens.txt or known_nft_tokens.txt on each line. Before running, it's recommended to backfill or manually enter all known tokens in this file so that it doesn't trigger an event with wrong timestamp when an existing contract is updated.

The NEP-141 and NEP-171 detection work by calling ft_metadata or nft_metadata on RPC, set REDIS_URL environment variable to override the RPC URL. It calls this method at the specific block when a "deploy code" receipt was executed, but since RPCs can garbage collect some relatively old blocks, set LATEST_BLOCK_META=1 environment variable, and it'll request at latest final block.

To run it, set REDIS_URL environment variable and cargo run --release

About

Does something when a new contract is deployed

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages