Build EVM blockchain data indexers using Ponder (ponder.sh) - an open-source TypeScript framework for indexing smart contract events, transactions, and traces into custom database schemas with type-safe APIs. Use when the user mentions ponder, blockchain/EVM indexing, onchain data pipelines, subgraph replacement, or wants to index smart contract events into a queryable database.
98
99%
Does it follow best practices?
Impact
98%
1.25xAverage score across 5 eval scenarios
Passed
No known issues
A cross-chain bridge protocol operates on both Ethereum mainnet and Base. The bridge contract on each chain emits a BridgeTransfer event when tokens are bridged:
event BridgeTransfer(address indexed sender, address indexed recipient, uint256 amount, uint256 destChainId, bytes32 transferId)The bridge contracts are:
0x3154cf16ccdb4c6d922629664174b904d80f2c35 deployed at block 185000000x3154cf16ccdb4c6d922629664174b904d80f2c35 deployed at block 6800000The protocol team needs to monitor all bridge transfers across both chains in a single indexer. Because the bridge requires matching transfers between chains (a send on one chain corresponds to a receive on the other), they need cross-chain consistency in the data ordering. They want to query transfers filtered by sender, recipient, or source chain through an API.
Create a complete Ponder project with:
ponder.config.ts - Multi-chain configuration with appropriate ordering modeponder.schema.ts - Schema for bridge transfers with chain awareness and query indexessrc/index.ts - Indexing handler that processes events from both chainssrc/api/index.ts - API with both standard query interface and a custom endpoint for transfer volume summarytsconfig.json - TypeScript configurationpackage.json - Dependenciesabis/Bridge.ts - Bridge ABI.env.local - Environment variables for both chainsThe ABI for the bridge contract is:
[{"type":"event","name":"BridgeTransfer","inputs":[{"name":"sender","type":"address","indexed":true},{"name":"recipient","type":"address","indexed":true},{"name":"amount","type":"uint256","indexed":false},{"name":"destChainId","type":"uint256","indexed":false},{"name":"transferId","type":"bytes32","indexed":false}]}]