What problem does it solve?
Indexing contracts created at runtime by factory contracts (like Uniswap pairs) is impossible with static address configuration, since the addresses don't exist when the indexer starts. This Skill shows how to register those contracts dynamically so their events are captured from the moment of creation.
Core Features & Use Cases
- Dynamic Contract Registration: Use
indexer.contractRegister with context.chain.<ContractName>.add(address) to register contracts that have no address in config.yaml.
- Async Registration Logic: Perform external calls (e.g., checking a contract version) to decide which contract type to register for a given address.
- Same-Block Coverage: Automatically index all events from a newly registered contract within the same block it was created, including earlier transactions in that block.
- Use Case: Index every Uniswap V2 pair's Swap and Sync events by listening to the factory's
PairCreated event and registering each new pair address at runtime.
Quick Start
Ask the AI to set up a HyperIndex config and handlers that register Uniswap-style factory-created contracts dynamically using contractRegister.