Indexing Ethereum contracts
Checkpoint initially supported indexing Starknet contracts only, but it can also index Ethereum contracts now.
Usage with Ethereum is very similar to usage with Starknet, differences are:
Use full signature for event name in config (
ProposalUpdated(uint256,(address,bytes),string)
instead ofProposalUpdated
)Your writers should be using
evm.Writer
instead ofstarknet.Writer
.You should create indexer using
new evm.EvmIndexer
instead ofnew starknet.StarknetIndexer
.
import Checkpoint, { evm } from '@snapshot-labs/checkpoint';
const handleProxyDeployed: evm.Writer = async ({ blockNumber, event }) => {};
const writers = { handleProxyDeployed };
const ethIndexer = new evm.EvmIndexer(writers);
const checkpoint = new Checkpoint(...);
checkpoint.addIndexer('eth', config, ethIndexer);
checkpoint.start();
Last updated
Was this helpful?